Page 1 of 1

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

PostPosted: Tue 11. May 2010, 00:29
by 4seven
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);}