Changeset 16147

Show
Ignore:
Timestamp:
08/02/07 11:05:09 (1 year ago)
Author:
GamerZ
Message:

Added Quick Tag for TinyMCE

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-polls/trunk/polls/polls-admin-js.php

    r16112 r16147  
    203203 
    204204// Function: Insert Poll Quick Tag 
    205 function edInsertPoll(myField) { 
     205function insertPoll(where, myField) { 
    206206      var poll_id = prompt("<?php _e('Enter Poll ID', 'wp-polls'); ?>"); 
    207207      while(isNaN(poll_id)) { 
     
    209209      } 
    210210      if (poll_id > 0) { 
    211             edInsertContent(myField, '[poll=' + poll_id + ']'); 
    212       } 
    213 
     211            if(where == 'code') { 
     212                  edInsertContent(myField, '[poll=' + poll_id + ']'); 
     213            } else { 
     214                  return '[poll=' + poll_id + ']'; 
     215            } 
     216      } 
     217
  • wp-polls/trunk/polls/polls.php

    r16112 r16147  
    202202      echo "\t\t".'qt_button.value = "'.__('Poll', 'wp-polls').'";'."\n"; 
    203203      echo "\t\t".'qt_button.title = "'.__('Insert Poll', 'wp-polls').'";'."\n"; 
    204       echo "\t\t".'qt_button.onclick = function () {edInsertPoll(edCanvas);}'."\n"; 
     204      echo "\t\t".'qt_button.onclick = function () { insertPoll(\'code\', edCanvas);}'."\n"; 
    205205      echo "\t\t".'qt_button.id = "ed_poll";'."\n"; 
    206206      echo "\t\t".'qt_toolbar.appendChild(qt_button);'."\n"; 
    207207      echo "\t".'}'."\n"; 
    208208      echo '</script>'."\n"; 
     209} 
     210 
     211 
     212### Function: Add Quick Tag For Poll In TinyMCE, Coutesy Of An-Archos (http://an-archos.com/anarchy-media-player) 
     213add_filter("mce_plugins", "poll_mce_plugins", 5); 
     214function poll_mce_plugins($plugins) {     
     215      array_push($plugins, '-polls', 'bold');     
     216      return $plugins; 
     217} 
     218add_filter("mce_buttons", "poll_mce_buttons", 5); 
     219function poll_mce_buttons($buttons) { 
     220      array_push($buttons, 'separator', 'polls'); 
     221      return $buttons; 
     222} 
     223add_action('tinymce_before_init','poll_external_plugins'); 
     224function poll_external_plugins() {   
     225      echo 'tinyMCE.loadPlugin("polls", "'.get_option('siteurl').'/wp-content/plugins/polls/tinymce/plugins/polls/");' . "\n";  
     226      return; 
    209227} 
    210228 
  • wp-polls/trunk/polls/wp-polls.pot

    r16112 r16147  
    33"Project-Id-Version: WP-Polls 2.21\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2007-08-02 01:24+0800\n" 
     5"PO-Revision-Date: 2007-08-02 19:04+0800\n" 
    66"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n" 
    77"Language-Team: Ravan <ravanhagen@gmail.com>\n" 
     
    415415#: polls-manager.php:488 
    416416#: polls-manager.php:496 
    417 #: polls.php:319 
    418 #: polls.php:324 
    419 #: polls.php:435 
    420 #: polls.php:440 
    421 #: polls.php:816 
    422 #: polls.php:820 
     417#: polls.php:337 
     418#: polls.php:342 
     419#: polls.php:453 
     420#: polls.php:458 
     421#: polls.php:834 
     422#: polls.php:838 
    423423#, php-format 
    424424msgid "%s @ %s" 
     
    584584#: polls-templates.php:116 
    585585#: polls-templates.php:119 
    586 #: polls.php:1269 
    587 #: polls.php:1272 
     586#: polls.php:1287 
     587#: polls.php:1290 
    588588msgid "Total Voters" 
    589589msgstr "" 
     
    598598 
    599599#: polls-manager.php:494 
    600 #: polls.php:322 
    601 #: polls.php:438 
    602 #: polls.php:818 
     600#: polls.php:340 
     601#: polls.php:456 
     602#: polls.php:836 
    603603msgid "No Expiry" 
    604604msgstr "" 
     
    821821#: polls-templates.php:110 
    822822#: polls-templates.php:113 
    823 #: polls.php:1266 
    824 #: polls.php:1267 
     823#: polls.php:1284 
     824#: polls.php:1285 
    825825msgid "Votes" 
    826826msgstr "" 
     
    10101010#: polls-templates.php:104 
    10111011#: polls-templates.php:119 
    1012 #: polls.php:1260 
    1013 #: polls.php:1273 
     1012#: polls.php:1278 
     1013#: polls.php:1291 
    10141014msgid "Vote" 
    10151015msgstr "" 
    10161016 
    10171017#: polls-templates.php:104 
    1018 #: polls.php:1261 
     1018#: polls.php:1279 
    10191019msgid "View Results Of This Poll" 
    10201020msgstr "" 
    10211021 
    10221022#: polls-templates.php:104 
    1023 #: polls.php:1261 
     1023#: polls.php:1279 
    10241024msgid "View Results" 
    10251025msgstr "" 
    10261026 
    10271027#: polls-templates.php:113 
    1028 #: polls.php:1267 
     1028#: polls.php:1285 
    10291029msgid "You Have Voted For This Choice" 
    10301030msgstr "" 
    10311031 
    10321032#: polls-templates.php:119 
    1033 #: polls.php:1273 
     1033#: polls.php:1291 
    10341034msgid "Vote For This Poll" 
    10351035msgstr "" 
     
    10371037#: polls-templates.php:122 
    10381038#: polls-usage.php:80 
    1039 #: polls.php:1300 
     1039#: polls.php:1318 
    10401040msgid "Polls Archive" 
    10411041msgstr "" 
     
    10501050 
    10511051#: polls-templates.php:131 
    1052 #: polls.php:1275 
     1052#: polls.php:1293 
    10531053msgid "Sorry, there are no polls available at the moment." 
    10541054msgstr "" 
    10551055 
    10561056#: polls-templates.php:134 
    1057 #: polls.php:1276 
     1057#: polls.php:1294 
    10581058msgid "An error has occurred when processing your poll." 
    10591059msgstr "" 
     
    15161516msgstr "" 
    15171517 
    1518 #: polls.php:400 
    1519 #: polls.php:560 
     1518#: polls.php:418 
     1519#: polls.php:578 
    15201520msgid "Loading" 
    15211521msgstr "" 
    15221522 
    1523 #: polls.php:602 
     1523#: polls.php:620 
    15241524msgid "Note: There is a poll embedded within this post, please visit the site to participate in this post's poll." 
    15251525msgstr "" 
    15261526 
    1527 #: polls.php:945 
     1527#: polls.php:963 
    15281528msgid "Previous Page" 
    15291529msgstr "" 
    15301530 
    1531 #: polls.php:953 
     1531#: polls.php:971 
    15321532msgid "Next Page" 
    15331533msgstr "" 
    15341534 
    1535 #: polls.php:962 
     1535#: polls.php:980 
    15361536msgid "Pages" 
    15371537msgstr "" 
    15381538 
    1539 #: polls.php:964 
     1539#: polls.php:982 
    15401540msgid "Go to First Page" 
    15411541msgstr "" 
    15421542 
    1543 #: polls.php:964 
     1543#: polls.php:982 
    15441544msgid "First" 
    15451545msgstr "" 
    15461546 
    1547 #: polls.php:967 
    1548 #: polls.php:979 
     1547#: polls.php:985 
     1548#: polls.php:997 
    15491549msgid "Go to Page" 
    15501550msgstr "" 
    15511551 
    1552 #: polls.php:974 
     1552#: polls.php:992 
    15531553msgid "Page" 
    15541554msgstr "" 
    15551555 
    1556 #: polls.php:982 
     1556#: polls.php:1000 
    15571557msgid "Go to Last Page" 
    15581558msgstr "" 
    15591559 
    1560 #: polls.php:982 
     1560#: polls.php:1000 
    15611561msgid "Last" 
    15621562msgstr "" 
    15631563 
    1564 #: polls.php:1146 
     1564#: polls.php:1164 
    15651565#, php-format 
    15661566msgid "Unable To Update Poll Total Votes And Poll Total Voters. Poll ID #%s" 
    15671567msgstr "" 
    15681568 
    1569 #: polls.php:1150 
     1569#: polls.php:1168 
    15701570#, php-format 
    15711571msgid "You Had Already Voted For This Poll. Poll ID #%s" 
    15721572msgstr "" 
    15731573 
    1574 #: polls.php:1154 
     1574#: polls.php:1172 
    15751575#, php-format 
    15761576msgid "Invalid Poll ID. Poll ID #%s" 
    15771577msgstr "" 
    15781578 
    1579 #: polls.php:1180 
    1580 #: polls.php:1182 
    1581 #: polls.php:1192 
     1579#: polls.php:1198 
     1580#: polls.php:1200 
     1581#: polls.php:1210 
    15821582msgid "WP-Polls" 
    15831583msgstr "" 
    15841584 
    1585 #: polls.php:1194 
     1585#: polls.php:1212 
    15861586msgid "polls were created." 
    15871587msgstr "" 
    15881588 
    1589 #: polls.php:1195 
     1589#: polls.php:1213 
    15901590msgid "polls' answers were given." 
    15911591msgstr "" 
    15921592 
    1593 #: polls.php:1196 
     1593#: polls.php:1214 
    15941594msgid "votes were casted." 
    15951595msgstr "" 
    15961596 
    1597 #: polls.php:1244 
     1597#: polls.php:1262 
    15981598msgid "How Is My Site?" 
    15991599msgstr "" 
    16001600 
    1601 #: polls.php:1247 
     1601#: polls.php:1265 
    16021602msgid "Good" 
    16031603msgstr "" 
    16041604 
    1605 #: polls.php:1248 
     1605#: polls.php:1266 
    16061606msgid "Excellent" 
    16071607msgstr "" 
    16081608 
    1609 #: polls.php:1249 
     1609#: polls.php:1267 
    16101610msgid "Bad" 
    16111611msgstr "" 
    16121612 
    1613 #: polls.php:1250 
     1613#: polls.php:1268 
    16141614msgid "Can Be Improved" 
    16151615msgstr "" 
    16161616 
    1617 #: polls.php:1251 
     1617#: polls.php:1269 
    16181618msgid "No Comments" 
    16191619msgstr "" 
  • wp-polls/trunk/readme.html

    r16112 r16147  
    299299                              <strong>Version 2.21 (01-10-2007)</strong> 
    300300                              <ul> 
    301                                     <li>NEW: Added Quick Tag For Poll To Code Editor</li> 
     301                                    <li>NEW: Added Quick Tag For Poll To Visual (TinyMCE) / Code Editor</li> 
    302302                                    <li>NEW: New CSS Style For WP-Polls Archive (.wp-polls-archive)</li> 
    303303                                    <li>NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page</li>