We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] IMG tab in quick reply
Topic Started: Aug 11 2015, 02:48 AM (226 Views)
Mozz
Member Avatar
" It’s not a bug – it’s an undocumented feature "
[ *  *  *  * ]
Board : Link in profile

I have had a look around for an existing code,
What i was wondering, is there a way to ad a img tag on the quick reply instead of having to open full reply.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
$('#fast-reply dd').prepend('<div style="width: 90%; margin: 0 auto 10px auto" class="l"><button type="button" id="QuickIMG">Image</button></div>');

function QuickBBC(openTag, closeTag) {
var textArea = $('#fast-reply textarea');
var len = textArea.val().length;
var start = textArea[0].selectionStart;
var end = textArea[0].selectionEnd;
var selectedText = textArea.val().substring(start, end);
var replacement = openTag + selectedText + closeTag;
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
}

$('#QuickIMG').click(function() {
var iURL = window.prompt('Enter the complete URL for the image', 'http://');

if (iURL) {
QuickBBC('[IMG]' + iURL, '[/IMG]');
}
});
//]]>
</script>
Offline Profile Goto Top
 
Mozz
Member Avatar
" It’s not a bug – it’s an undocumented feature "
[ *  *  *  * ]
Once again Cory, it works like a charm, Thank you my good man :)
Offline Profile Goto Top
 
Coffeeluver
Member
[ *  * ]
Thanks so much. I've added it to mine and it works great.
Offline Profile Goto Top
 
Moonface
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
0 users reading this topic
« Previous Topic · Closed Requests · Next Topic »
Locked Topic