Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 15:15

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 16 Oct 2012, 02:27 
Offline
Tiptop
Tiptop

Joined: 02 Jul 2012, 17:23
Posts: 17
is it possible to make a prompt for a custom bbcode? for example youtube? i have made all the edits to your code but when i click on my youtube bbcode i get no promt.

Here is what i did.
editor.js
Code:
// Open tag
        // insert_text(bbopen + bbclose);

        // Better Prompt 4 BBCodes / 4seven / 2011

        // img
        if (bbopen == '[img]')
        {
        jPrompt(img_wiz_2, '', img_wiz_1, function(img){
        if(img){
        setCaretPosition(caret_pos);
        insert_text('[img]' + img + '[/img]');}
        });
        }
      
        // url
        else if (bbopen == '[url]')
        {
        jPrompt(url_wiz_2, '', url_wiz_1, function(url_title){
        if(url_title){
        jPrompt(url_wiz_3, '', url_wiz_1, function(url){
        if(url_title&&url){
        setCaretPosition(caret_pos);
        insert_text('[url=' + url + ']' + url_title + '[/url]');}
        });
        }
        });
        }

        // flash
        else if (bbopen == '[flash=]')
        {
        jPrompt(fla_wiz_2, '', fla_wiz_1, function(flash_width){
        if(flash_width){
        jPrompt(fla_wiz_3, '', fla_wiz_1, function(flash_height){
        if(flash_width&&flash_height){
        jPrompt(fla_wiz_4, '', fla_wiz_1, function(flash_url){
        if(flash_width&&flash_height&&flash_url){
        setCaretPosition(caret_pos);
        insert_text('[flash=' + flash_width + ',' + flash_height + ']' + flash_url + '[/flash]');}
        });
        }
        });
        }
        });
        }
      
      // YouTube
        else if (bbopen == '[youtube]')
        {
        jPrompt(ytb_wiz_2, '', ytb_wiz_1, function(youtube){
        if(youtube){
        setCaretPosition(caret_pos);
        insert_text('[youtube]' + youtube + '[/youtube]');}
        });
        }
        });
        }
        });
        }
        });
        }
      
        // Better Prompt 4 BBCodes / 4seven / 2011

        else{

        insert_text(bbopen + bbclose);}


posting_buttons.html
Code:
<script type="text/javascript">
// <![CDATA[
   // Better Prompt 4 BBCodes / 4seven / 2011
   // img
   var img_wiz_1  = "{LA_IMG_WIZ_1}";
   var img_wiz_2  = "{LA_IMG_WIZ_2}";
   // url
   var url_wiz_1  = "{LA_URL_WIZ_1}";
   var url_wiz_2  = "{LA_URL_WIZ_2}";
   var url_wiz_3  = "{LA_URL_WIZ_3}";
   // flash
   var fla_wiz_1  = "{LA_FLA_WIZ_1}";
   var fla_wiz_2  = "{LA_FLA_WIZ_2}";
   var fla_wiz_3  = "{LA_FLA_WIZ_3}";
   var fla_wiz_4  = "{LA_FLA_WIZ_4}";
   // youtube
   var ytb_wiz_1  = "{LA_YTB_WIZ_1}";
   var ytb_wiz_2  = "{LA_YTB_WIZ_2}";
   // ok + cancel
   var bb_wiz_ok  = "{LA_BB_WIZ_OK}";
   var bb_wiz_ca  = "{LA_BB_WIZ_CA}";
   // Better Prompt 4 BBCodes / 4seven / 2011
// ]]>
</script>

<script type="text/javascript" src="jquery/jquery.alerts.js"></script>


lang_better_prompt.php
Code:
    $lang array_merge($lang, array(
    
// img
    
'IMG_WIZ_1'           => 'Img BBCode Wizard',
    
'IMG_WIZ_2'           => 'Enter Img URL',
    
// url
    
'URL_WIZ_1'           => 'URL BBCode Wizard',
    
'URL_WIZ_2'           => 'Enter URL Title',
    
'URL_WIZ_3'           => 'Enter URL',
    
// flash
    
'FLA_WIZ_1'           => 'Flash BBCode Wizard',
    
'FLA_WIZ_2'           => 'Enter width of Flash File',
    
'FLA_WIZ_3'           => 'Enter height of Flash File',
    
'FLA_WIZ_4'           => 'Enter URL of Flash File',
    
// youtube
    
'YTB_WIZ_1'              => 'YouTube BBCode',
    
'YTB_WIZ_2'              => 'Enter YouTube URL',
    
// ok + cancel
    
'BB_WIZ_OK'           => '&nbsp;OK&nbsp;',
    
'BB_WIZ_CA'           => '&nbsp;Cancel&nbsp;'
    
)); 


What am i missing? (yes i have already created a custom bbcode for youtube)


Top
 Profile  
Reply with quote  
PostPosted: 16 Oct 2012, 02:31 
Offline
Tiptop
Tiptop
User avatar

Joined: 20 Jun 2012, 16:55
Posts: 318
Normally you can adapt each BBCode, if you transform it syntactical right.

find in your edits

Code:
          // YouTube
            else if (bbopen == '[youtube]')
            {
            jPrompt(ytb_wiz_2, '', ytb_wiz_1, function(youtube){
            if(youtube){
            setCaretPosition(caret_pos);
            insert_text('[youtube]' + youtube + '[/youtube]');}
            });
            }
            });
            }
            });
            }
            });
            


replace with

Code:
          // YouTube
            else if (bbopen == '[youtube]')
            {
            jPrompt(ytb_wiz_2, '', ytb_wiz_1, function(youtube){
            if(youtube){
            setCaretPosition(caret_pos);
            insert_text('[youtube]' + youtube + '[/youtube]');}
            });
            

just take a look with eg notepad++ for unclosed or unneeded brackets.

_________________
Current Mods | Mod Base | php(BB) programming | No help via PM


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.010s | 22 Queries | GZIP : Off ]