[Snippet] PopUp for [url]'ed [img]

Little Mods and Snips 3

[Snippet] PopUp for [url]'ed [img]

Postby Sekuro » 01 Oct 2011, 20:01

Pop Up for [url]'ed [img]

With this Snippet u can easy add a linked Image into the Postbox via PopUp

Instruction

Make a fake-bbcode

BBCode usage
Code: Select all
[img_url][/img_url]


HTML replacement
Code: Select all
 


Help line text
Click to start the Wizard

Display on posting page
yes


------------------

open

styles/xxxxxx/template/editor.js

find

Code: Select all
       // Open tag
       insert_text(bbopen + bbclose);


replace with

Code: Select all
            // IMG_URL Fake Tag
            if (bbopen == '[img_url]')
            {
                var Error = '';
                var URLL = prompt('Address of URL' , '');
                if (!URLL) {
                Error = "You haven't enter an URL Address";
                }
                if (Error) {
                alert("Error: "+Error);
                return;
                }
                var IMGURL = prompt('Adress of the Image' , '');
                if (!IMGURL) {
                Error = "You haven't enter an Image Address";
                }
                if (Error) {
                alert("Error: "+Error);
                return;
                }
                if (URLL + IMGURL) {
                    insert_text('[url=' + URLL + '][img]' + IMGURL + '[/img][/url]');
                }
                else {
                    return;
                }
            }  

            else
{
            // Open tag
           insert_text(bbopen + bbclose);}


Clear all Board-, Template-, Style- and Browser-Caches
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900


Return to Snip Cl@ss III

Who is online

Users browsing this forum: No registered users and 1 guest

cron