Changeset 1043


Ignore:
Timestamp:
11/28/08 15:12:15 (3 years ago)
Author:
CrawfordCurrie
Message:

Item6041: fix empty bullet list Item324: get it working on Foswiki Item295: further detoxing

Location:
trunk
Files:
37 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/TinyMCEPlugin/data/System/TinyMCEPlugin.txt

    r1004 r1043  
    5151   remove_script_host : false, 
    5252   setupcontent_callback : FoswikiTiny.setUpContent, 
    53    urlconverter_callback : "TWikiTiny.convertLink", 
    54    hide_instance_callback : TWikiTiny.switchToRaw, 
    55    show_instance_callback : TWikiTiny.switchToWYSIWYG, 
    56    twikipuburl_callback : "TWikiTiny.convertPubURL", 
    57    save_callback : "TWikiTiny.saveCallback", 
     53   urlconverter_callback : "FoswikiTiny.convertLink", 
     54   hide_instance_callback : FoswikiTiny.switchToRaw, 
     55   show_instance_callback : FoswikiTiny.switchToWYSIWYG, 
     56   foswikipuburl_callback : "FoswikiTiny.convertPubURL", 
     57   save_callback : "FoswikiTiny.saveCallback", 
    5858   %IF{"$TINYMCEPLUGIN_DEBUG" then="debug:true,"}% 
    59    plugins : "table,searchreplace,autosave,paste,twikibuttons,twikiimage%IF{"$TINYMCEPLUGIN_DEBUG" then=",devkit"}%", 
    60    twiki_secret_id : "%WYSIWYG_SECRET_ID%", 
    61    twiki_vars : { PUBURLPATH : "%PUBURLPATH%", PUBURL : "%PUBURL%", WEB : "%WEB%", TOPIC : "%TOPIC%", ATTACHURL : "%ATTACHURL%", ATTACHURLPATH : "%ATTACHURLPATH%", VIEWSCRIPTURL : "%SCRIPTURL{view}%", SCRIPTSUFFIX: "%SCRIPTSUFFIX%", SCRIPTURL : "%SCRIPTURL%" }, 
     59   plugins : "table,searchreplace,autosave,paste,foswikibuttons,foswikiimage%IF{"$TINYMCEPLUGIN_DEBUG" then=",devkit"}%", 
     60   foswiki_secret_id : "%WYSIWYG_SECRET_ID%", 
     61   foswiki_vars : { PUBURLPATH : "%PUBURLPATH%", PUBURL : "%PUBURL%", WEB : "%WEB%", TOPIC : "%TOPIC%", ATTACHURL : "%ATTACHURL%", ATTACHURLPATH : "%ATTACHURLPATH%", VIEWSCRIPTURL : "%SCRIPTURL{view}%", SCRIPTSUFFIX: "%SCRIPTSUFFIX%", SCRIPTURL : "%SCRIPTURL%" }, 
    6262   theme_advanced_toolbar_align : "left", 
    63    twikibuttons_formats : [ 
     63   foswikibuttons_formats : [ 
    6464   { name: "Normal", el: "", style: null }, 
    6565   { name: "Heading 1", el: "h1", style: false }, 
     
    8181   paste_remove_styles: true, 
    8282   paste_strip_class_attributes: "all", 
    83    theme_advanced_buttons1 : "twikiformat,separator,bold,italic,tt,colour,removeformat,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,separator,attach,image,charmap,hr,separator,undo,redo,separator,search,replace", 
     83   theme_advanced_buttons1 : "foswikiformat,separator,bold,italic,tt,colour,removeformat,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,separator,attach,image,charmap,hr,separator,undo,redo,separator,search,replace", 
    8484   theme_advanced_buttons2: "tablecontrols,separator,code,hide", 
    8585   theme_advanced_buttons3: "", 
     
    8989   theme_advanced_path: false, 
    9090   theme_advanced_statusbar_location : "bottom", 
    91    content_css : "%PUBURLPATH%/%SYSTEMWEB%/TinyMCEPlugin/wysiwyg%IF{"$TINYMCEPLUGIN_DEBUG" then="_src"}%.css,%PUBURLPATH%/%SYSTEMWEB%/SkinTemplates/base.css,%TWIKISTYLEURL%,%TWIKICOLORSURL%" 
     91   content_css : "%PUBURLPATH%/%SYSTEMWEB%/TinyMCEPlugin/wysiwyg%IF{"$TINYMCEPLUGIN_DEBUG" then="_src"}%.css,%PUBURLPATH%/%SYSTEMWEB%/SkinTemplates/base.css,%FOSWIKISTYLEURL%,%FOSWIKICOLORSURL%" 
    9292</verbatim> 
    9393   * Additional settings for specific browsers. 
     
    141141|  14538 | First release | 
    142142|  Dependencies: | %$DEPENDENCIES% | 
    143 |  Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/TinyMCEPlugin | 
    144 |  Feedback: | http://twiki.org/cgi-bin/view/Plugins/TinyMCEPluginDev | 
    145 |  Appraisal: | http://twiki.org/cgi-bin/view/Plugins/TinyMCEPluginAppraisal | 
     143|  Plugin Home: | http://foswiki.org/Extensions/TinyMCEPlugin | 
    146144 
    147145Many thanks to the following sponsors for supporting this work: 
    148146   * [[http://ilog.fr][ILOG]] 
    149147   * [[http://www.carrier.com][Carrier Corporation]] 
    150    * [[http://twiki.net][TWIKI.NET]] 
     148   * [[http://foswiki.net][TWIKI.NET]] 
    151149 
    152150<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the Dev topic instead. --> 
  • trunk/TinyMCEPlugin/data/System/TinyMCEQuickHelp.txt

    r932 r1043  
    3434<li> Just type it in. When the topic is saved, what you type will be saved just as you wrote it.  </li> 
    3535<li> If any part of your macro parameters is sensitive to spacing, then select the entire macro and assign the ==PROTECTED== style to it before you save. </li></ul> 
    36 <span class="twikiUnvisited">[[%SYSTEMWEB%.Macros][More on macros]]</span> 
     36<span class="foswikiUnvisited">[[%SYSTEMWEB%.Macros][More on macros]]</span> 
    3737 
    3838*Editing the raw text instead of Wysiwyg* 
    3939<ul> 
    40 <li> Select    <img src="%PUBURL%/%WEB%/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/images/hide.gif" alt="the pickaxe" /> 
     40<li> Select    <img src="%PUBURL%/%WEB%/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/images/hide.gif" alt="the pickaxe" /> 
    4141, or use the _Raw Edit_ link in the bottom action bar. </li></ul> 
    4242</td> 
     
    5353   <img src="%PUBURL%/%WEB%/TinyMCEPlugin/tinymce/jscripts/tiny_mce/themes/advanced/images/unlink.gif" alt="unlink" /></td> 
    5454<td class="textcolumn"><ul> 
    55     <li> Links can either point to a URL or to the name of a Foswiki topic. For example =http://twiki.org=, =TopicNames=, =Webname.TopicNames=, or =Webname.Subweb.WebName=.</li> 
     55    <li> Links can either point to a URL or to the name of a Foswiki topic. For example =http://foswiki.org=, =TopicNames=, =Webname.TopicNames=, or =Webname.Subweb.WebName=.</li> 
    5656   </ul></td> 
    5757</tr> 
  • trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm

    r984 r1043  
    1717use strict; 
    1818 
    19 use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION ); 
    2019use Assert; 
    2120 
    22 $VERSION = '$Rev$'; 
    23 $RELEASE = '03 Aug 2008'; 
    24 $SHORTDESCRIPTION = 'Integration of TinyMCE with WysiwygPlugin'; 
     21our $VERSION = '$Rev$'; 
     22our $RELEASE = '03 Aug 2008'; 
     23our $SHORTDESCRIPTION = 'Integration of TinyMCE with WysiwygPlugin'; 
    2524 
    2625use Foswiki::Func; 
  • trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin/DEPENDENCIES

    r14 r1043  
    1 TWiki::Plugins::BehaviourContrib,>=15357,perl,Javascript module 
    2 TWiki::Plugins::WysiwygPlugin,>=16650,perl,Translator module 
     1Foswiki::Plugins::BehaviourContrib,>=15357,perl,Javascript module 
     2Foswiki::Plugins::WysiwygPlugin,>=16650,perl,Translator module 
  • trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin/MANIFEST

    r1005 r1043  
    282282pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/template/langs/en.js 0644 
    283283pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/template/template.htm 0644 
    284 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/attach.htm 
    285 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/editor_plugin.js 0644 
    286 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/editor_plugin_src.js 0644 
    287 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/images/attach.gif 0644 
    288 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/images/hide.gif 0644 
    289 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/images/tt.gif 0644 
    290 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/langs/en.js 0644 
    291 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/jscripts/attach.js  
    292 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/jscripts/attach_src.js  
    293 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/jscripts/colour.js 0644 
    294 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/jscripts/colour_src.js 0644 
    295 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/images/colour.gif 0644 
    296 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/css/popup.css 0644 
    297 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/css/popup_src.css 0644 
    298 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikibuttons/colours.htm 0644 
    299 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/css/advimage.css 0644 
    300 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/editor_plugin.js 0644 
    301 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/editor_plugin_src.js 0644 
    302 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/image.htm 0644 
    303 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/images/sample.gif 0644 
    304 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/jscripts/functions.js 0644 
    305 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/jscripts/functions_src.js 0644 
    306 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/langs/en.js 0644 
    307 pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/twikiimage/readme.txt 0644 
     284pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/attach.htm 
     285pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin.js 0644 
     286pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin_src.js 0644 
     287pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/images/attach.gif 0644 
     288pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/images/hide.gif 0644 
     289pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/images/tt.gif 0644 
     290pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/langs/en.js 0644 
     291pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/attach.js  
     292pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/attach_src.js  
     293pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/colour.js 0644 
     294pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/colour_src.js 0644 
     295pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/images/colour.gif 0644 
     296pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/css/popup.css 0644 
     297pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/css/popup_src.css 0644 
     298pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/colours.htm 0644 
     299pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/css/advimage.css 0644 
     300pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/editor_plugin.js 0644 
     301pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/editor_plugin_src.js 0644 
     302pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/image.htm 0644 
     303pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/images/sample.gif 0644 
     304pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/jscripts/functions.js 0644 
     305pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/jscripts/functions_src.js 0644 
     306pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/langs/en.js 0644 
     307pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/readme.txt 0644 
    308308pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js 0644 
    309309pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js 0644 
  • trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin/build.pl

    r852 r1043  
    22#!/usr/bin/perl -w 
    33BEGIN { 
    4     unshift @INC, split( /:/, $ENV{TWIKI_LIBS} ); 
     4    unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); 
    55} 
    66use Foswiki::Contrib::Build; 
     
    99$build = new Foswiki::Contrib::Build('TinyMCEPlugin'); 
    1010 
    11 # Set the details of the repository for uploads. 
    12 # This can be any web on any accessible TWiki installation. 
    13  
    14 # name of web to upload to 
    15 $build->{UPLOADTARGETWEB} = 'Extensions'; 
    16 # Full URL of pub directory 
    17 $build->{UPLOADTARGETPUB} = 'http://foswiki.org/pub'; 
    18 # Full URL of bin directory 
    19 $build->{UPLOADTARGETSCRIPT} = 'http://foswiki.org/bin'; 
    20 # Script extension 
    21 $build->{UPLOADTARGETSUFFIX} = ''; 
    22  
    2311# Build the target on the command line, or the default target 
    2412$build->build($build->{target}); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki.js

    r984 r1043  
    1 TWikiTiny.install();var IFRAME_ID='mce_editor_0';function changeEditBox(inDirection){return false;} 
     1FoswikiTiny.install();var IFRAME_ID='mce_editor_0';function changeEditBox(inDirection){return false;} 
    22function setEditBoxHeight(inRowCount){} 
    33function initTextAreaStyles(){var iframe=document.getElementById(IFRAME_ID);if(iframe==null)return;var node=iframe.parentNode;var counter=0;while(node!=document){if(node.nodeName=='TABLE'){node.style.height='auto';var selectboxes=node.getElementsByTagName('SELECT');var i,ilen=selectboxes.length;for(i=0;i<ilen;++i){selectboxes[i].style.marginLeft=selectboxes[i].style.marginRight='2px';selectboxes[i].style.fontSize='94%';} 
     
    66function handleKeyDown(e){if(!e)e=window.event;var code;if(e.keyCode)code=e.keyCode;if(code==27)return false;return true;} 
    77function validateMandatoryFields(event){if(foswiki.Pref.validateSuppressed){return true;} 
    8 var ok=true;var els=twiki.getElementsByClassName(document,'select','twikiMandatory');for(var j=0;j<els.length;j++){var one=false;for(var k=0;k<els[j].options.length;k++){if(els[j].options[k].selected){one=true;break;}} 
     8var ok=true;var els=foswiki.getElementsByClassName(document,'select','foswikiMandatory');for(var j=0;j<els.length;j++){var one=false;for(var k=0;k<els[j].options.length;k++){if(els[j].options[k].selected){one=true;break;}} 
    99if(!one){alert("The required form field '"+els[j].name+ 
    1010"' has no value.");ok=false;}} 
    11 var taglist=new Array('input','textarea');for(var i=0;i<taglist.length;i++){els=twiki.getElementsByClassName(document,taglist[i],'twikiMandatory');for(var j=0;j<els.length;j++){if(els[j].value==null||els[j].value.length==0){alert("The required form field '"+els[j].name+ 
     11var taglist=new Array('input','textarea');for(var i=0;i<taglist.length;i++){els=foswiki.getElementsByClassName(document,taglist[i],'foswikiMandatory');for(var j=0;j<els.length;j++){if(els[j].value==null||els[j].value.length==0){alert("The required form field '"+els[j].name+ 
    1212"' has no value.");ok=false;}}} 
    1313return ok;} 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_src.js

    r984 r1043  
    77  as published by the Free Software Foundation; either version 2 
    88  of the License, or (at your option) any later version. For 
    9   more details read LICENSE in the root of the TWiki distribution. 
     9  more details read LICENSE in the root of the Foswiki distribution. 
    1010 
    1111  This program is distributed in the hope that it will be useful, 
     
    1616*/ 
    1717 
    18 // Top level setup for tiny MCE editor. Requires tiny_mce.js and twiki_tiny.js 
     18// Top level setup for tiny MCE editor. Requires tiny_mce.js and foswiki_tiny.js 
    1919 
    20 TWikiTiny.install(); 
     20FoswikiTiny.install(); 
    2121 
    2222// Setup the standard edit screen for use with TMCE 
     
    8686    } 
    8787    var ok = true; 
    88     var els = twiki.getElementsByClassName(document, 'select', 
    89                                                'twikiMandatory'); 
     88    var els = foswiki.getElementsByClassName(document, 'select', 
     89                                               'foswikiMandatory'); 
    9090    for (var j = 0; j < els.length; j++) { 
    9191        var one = false; 
     
    104104    var taglist = new Array('input', 'textarea'); 
    105105    for (var i = 0; i < taglist.length; i++) { 
    106         els = twiki.getElementsByClassName(document, taglist[i], 
    107                                                'twikiMandatory'); 
     106        els = foswiki.getElementsByClassName(document, taglist[i], 
     107                                               'foswikiMandatory'); 
    108108        for (var j = 0; j < els.length; j++) { 
    109109            if (els[j].value == null || els[j].value.length == 0) { 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny.js

    r984 r1043  
    1 var TWikiTiny={twikiVars:null,request:null,metaTags:null,tml2html:new Array(),html2tml:new Array(),getTWikiVar:function(name){if(TWikiTiny.twikiVars==null){var sets=tinyMCE.getParam("twiki_vars","");TWikiTiny.twikiVars=eval(sets);} 
    2 return TWikiTiny.twikiVars[name];},expandVariables:function(url){for(var i in TWikiTiny.twikiVars){url=url.replace('%'+i+'%',TWikiTiny.twikiVars[i],'g');} 
     1var FoswikiTiny={foswikiVars:null,request:null,metaTags:null,tml2html:new Array(),html2tml:new Array(),getFoswikiVar:function(name){if(FoswikiTiny.foswikiVars==null){var sets=tinyMCE.getParam("foswiki_vars","");FoswikiTiny.foswikiVars=eval(sets);} 
     2return FoswikiTiny.foswikiVars[name];},expandVariables:function(url){for(var i in FoswikiTiny.foswikiVars){url=url.replace('%'+i+'%',FoswikiTiny.foswikiVars[i],'g');} 
    33return url;},enableSave:function(enabled){var status=enabled?null:"disabled";var elm=document.getElementById("save");if(elm){elm.disabled=status;} 
    4 elm=document.getElementById("preview");if(elm){elm.style.display='none';elm.disabled=status;}},transform:function(editor,handler,text,onReadyToSend,onReply,onFail){var url=TWikiTiny.getTWikiVar("SCRIPTURL");var suffix=TWikiTiny.getTWikiVar("SCRIPTSUFFIX");if(suffix==null)suffix='';url+="/rest"+suffix+"/WysiwygPlugin/"+handler;var path=TWikiTiny.getTWikiVar("WEB")+'.' 
    5 +TWikiTiny.getTWikiVar("TOPIC");TWikiTiny.request=new Object();if(tinyMCE.isIE){TWikiTiny.request.req=new ActiveXObject("Microsoft.XMLHTTP");}else{TWikiTiny.request.req=new XMLHttpRequest();} 
    6 TWikiTiny.request.editor=editor;TWikiTiny.request.req.open("POST",url,true);TWikiTiny.request.req.setRequestHeader("Content-type","application/x-www-form-urlencoded");var params="nocache="+encodeURIComponent((new Date()).getTime()) 
     4elm=document.getElementById("preview");if(elm){elm.style.display='none';elm.disabled=status;}},transform:function(editor,handler,text,onReadyToSend,onReply,onFail){var url=FoswikiTiny.getFoswikiVar("SCRIPTURL");var suffix=FoswikiTiny.getFoswikiVar("SCRIPTSUFFIX");if(suffix==null)suffix='';url+="/rest"+suffix+"/WysiwygPlugin/"+handler;var path=FoswikiTiny.getFoswikiVar("WEB")+'.' 
     5+FoswikiTiny.getFoswikiVar("TOPIC");FoswikiTiny.request=new Object();if(tinyMCE.isIE){FoswikiTiny.request.req=new ActiveXObject("Microsoft.XMLHTTP");}else{FoswikiTiny.request.req=new XMLHttpRequest();} 
     6FoswikiTiny.request.editor=editor;FoswikiTiny.request.req.open("POST",url,true);FoswikiTiny.request.req.setRequestHeader("Content-type","application/x-www-form-urlencoded");var params="nocache="+encodeURIComponent((new Date()).getTime()) 
    77+"&topic="+encodeURIComponent(path) 
    8 +"&text="+encodeURIComponent(text);TWikiTiny.request.req.setRequestHeader("Content-length",params.length);TWikiTiny.request.req.setRequestHeader("Connection","close");TWikiTiny.request.req.onreadystatechange=function(){if(TWikiTiny.request.req.readyState==4){if(TWikiTiny.request.req.status==200){onReply();}else{onFail();}}};onReadyToSend();TWikiTiny.request.req.send(params);},initialisedFromServer:false,setUpContent:function(editor_id,body,doc){if(TWikiTiny.initialisedFromServer)return;var editor=tinyMCE.getInstanceById(editor_id);TWikiTiny.switchToWYSIWYG(editor);TWikiTiny.initialisedFromServer=true;},switchToRaw:function(inst){inst.triggerSave(false,true);var text=inst.oldTargetElement.value;for(var i=0;i<TWikiTiny.html2tml.length;i++){var cb=TWikiTiny.html2tml[i];text=cb.apply(inst,[inst,text]);} 
    9 TWikiTiny.transform(inst,"html2tml",text,function(){TWikiTiny.enableSave(false);var te=TWikiTiny.request.editor.oldTargetElement;te.value="Please wait... retrieving page from server";},function(){var te=TWikiTiny.request.editor.oldTargetElement;var text=TWikiTiny.request.req.responseText;te.value=text;TWikiTiny.enableSave(true);},function(){var te=TWikiTiny.request.editor.oldTargetElement;te.value="There was a problem retrieving the page: " 
    10 +TWikiTiny.request.req.statusText;});var eid=inst.editorId;var id=eid+"_2WYSIWYG";var el=document.getElementById(id);if(el){el.style.display="block";}else{el=document.createElement('INPUT');el.id=id;el.type="button";el.value="WYSIWYG";el.className="twikiButton";el.onclick=function(){tinyMCE.execCommand("mceToggleEditor",null,inst.editorId);return false;} 
     8+"&text="+encodeURIComponent(text);FoswikiTiny.request.req.setRequestHeader("Content-length",params.length);FoswikiTiny.request.req.setRequestHeader("Connection","close");FoswikiTiny.request.req.onreadystatechange=function(){if(FoswikiTiny.request.req.readyState==4){if(FoswikiTiny.request.req.status==200){onReply();}else{onFail();}}};onReadyToSend();FoswikiTiny.request.req.send(params);},initialisedFromServer:false,setUpContent:function(editor_id,body,doc){if(FoswikiTiny.initialisedFromServer)return;var editor=tinyMCE.getInstanceById(editor_id);FoswikiTiny.switchToWYSIWYG(editor);FoswikiTiny.initialisedFromServer=true;},switchToRaw:function(inst){inst.triggerSave(false,true);var text=inst.oldTargetElement.value;for(var i=0;i<FoswikiTiny.html2tml.length;i++){var cb=FoswikiTiny.html2tml[i];text=cb.apply(inst,[inst,text]);} 
     9FoswikiTiny.transform(inst,"html2tml",text,function(){FoswikiTiny.enableSave(false);var te=FoswikiTiny.request.editor.oldTargetElement;te.value="Please wait... retrieving page from server";},function(){var te=FoswikiTiny.request.editor.oldTargetElement;var text=FoswikiTiny.request.req.responseText;te.value=text;FoswikiTiny.enableSave(true);},function(){var te=FoswikiTiny.request.editor.oldTargetElement;te.value="There was a problem retrieving the page: " 
     10+FoswikiTiny.request.req.statusText;});var eid=inst.editorId;var id=eid+"_2WYSIWYG";var el=document.getElementById(id);if(el){el.style.display="block";}else{el=document.createElement('INPUT');el.id=id;el.type="button";el.value="WYSIWYG";el.className="foswikiButton";el.onclick=function(){tinyMCE.execCommand("mceToggleEditor",null,inst.editorId);return false;} 
    1111var pel=inst.oldTargetElement.parentNode;pel.insertBefore(el,inst.oldTargetElement);} 
    12 inst.oldTargetElement.onchange=function(){var inst=tinyMCE.getInstanceById(eid);inst.isNotDirty=false;return true;}},switchToWYSIWYG:function(editor){editor.oldTargetElement.onchange=null;TWikiTiny.transform(editor,"tml2html",editor.oldTargetElement.value,function(){TWikiTiny.enableSave(false);var editor=TWikiTiny.request.editor;tinyMCE.setInnerHTML(TWikiTiny.request.editor.getBody(),"<span class='twikiAlert'>Please wait... retrieving page from server.</span>");},function(){var text=TWikiTiny.request.req.responseText;for(var i=0;i<TWikiTiny.tml2html.length;i++){var cb=TWikiTiny.tml2html[i];text=cb.apply(editor,[editor,text]);} 
    13 tinyMCE.setInnerHTML(TWikiTiny.request.editor.getBody(),text);TWikiTiny.request.editor.isNotDirty=true;TWikiTiny.enableSave(true);},function(){tinyMCE.setInnerHTML(TWikiTiny.request.editor.getBody(),"<div class='twikiAlert'>" 
     12inst.oldTargetElement.onchange=function(){var inst=tinyMCE.getInstanceById(eid);inst.isNotDirty=false;return true;}},switchToWYSIWYG:function(editor){editor.oldTargetElement.onchange=null;FoswikiTiny.transform(editor,"tml2html",editor.oldTargetElement.value,function(){FoswikiTiny.enableSave(false);var editor=FoswikiTiny.request.editor;tinyMCE.setInnerHTML(FoswikiTiny.request.editor.getBody(),"<span class='foswikiAlert'>Please wait... retrieving page from server.</span>");},function(){var text=FoswikiTiny.request.req.responseText;for(var i=0;i<FoswikiTiny.tml2html.length;i++){var cb=FoswikiTiny.tml2html[i];text=cb.apply(editor,[editor,text]);} 
     13tinyMCE.setInnerHTML(FoswikiTiny.request.editor.getBody(),text);FoswikiTiny.request.editor.isNotDirty=true;FoswikiTiny.enableSave(true);},function(){tinyMCE.setInnerHTML(FoswikiTiny.request.editor.getBody(),"<div class='foswikiAlert'>" 
    1414+"There was a problem retrieving the page: " 
    15 +TWikiTiny.request.req.statusText+"</div>");});var id=editor.editorId+"_2WYSIWYG";var el=document.getElementById(id);if(el){el.style.display="none";}},saveCallback:function(editor_id,html,body){var editor=tinyMCE.getInstanceById(editor_id);for(var i=0;i<TWikiTiny.html2tml.length;i++){var cb=TWikiTiny.html2tml[i];html=cb.apply(editor,[editor,html]);} 
    16 var secret_id=tinyMCE.getParam('twiki_secret_id');if(secret_id!=null&&html.indexOf('<!--'+secret_id+'-->')==-1){html='<!--'+secret_id+'-->'+html;} 
     15+FoswikiTiny.request.req.statusText+"</div>");});var id=editor.editorId+"_2WYSIWYG";var el=document.getElementById(id);if(el){el.style.display="none";}},saveCallback:function(editor_id,html,body){var editor=tinyMCE.getInstanceById(editor_id);for(var i=0;i<FoswikiTiny.html2tml.length;i++){var cb=FoswikiTiny.html2tml[i];html=cb.apply(editor,[editor,html]);} 
     16var secret_id=tinyMCE.getParam('foswiki_secret_id');if(secret_id!=null&&html.indexOf('<!--'+secret_id+'-->')==-1){html='<!--'+secret_id+'-->'+html;} 
    1717return html;},convertLink:function(url,node,onSave){if(onSave==null) 
    18 onSave=false;var orig=url;var pubUrl=TWikiTiny.getTWikiVar("PUBURL");var vsu=TWikiTiny.getTWikiVar("VIEWSCRIPTURL");url=TWikiTiny.expandVariables(url);if(onSave){if((url.indexOf(pubUrl+'/')!=0)&&(url.indexOf(vsu+'/')==0)){url=url.substr(vsu.length+1);url=url.replace(/\/+/g,'.');if(url.indexOf(TWikiTiny.getTWikiVar('WEB')+'.')==0){url=url.substr(TWikiTiny.getTWikiVar('WEB').length+1);}}}else{if(url.indexOf('/')==-1){var match=/^((?:\w+\.)*)(\w+)$/.exec(url);if(match!=null){var web=match[1];var topic=match[2];if(web==null||web.length==0){web=TWikiTiny.getTWikiVar("WEB");} 
     18onSave=false;var orig=url;var pubUrl=FoswikiTiny.getFoswikiVar("PUBURL");var vsu=FoswikiTiny.getFoswikiVar("VIEWSCRIPTURL");url=FoswikiTiny.expandVariables(url);if(onSave){if((url.indexOf(pubUrl+'/')!=0)&&(url.indexOf(vsu+'/')==0)){url=url.substr(vsu.length+1);url=url.replace(/\/+/g,'.');if(url.indexOf(FoswikiTiny.getFoswikiVar('WEB')+'.')==0){url=url.substr(FoswikiTiny.getFoswikiVar('WEB').length+1);}}}else{if(url.indexOf('/')==-1){var match=/^((?:\w+\.)*)(\w+)$/.exec(url);if(match!=null){var web=match[1];var topic=match[2];if(web==null||web.length==0){web=FoswikiTiny.getFoswikiVar("WEB");} 
    1919web=web.replace(/\.+/g,'/');web=web.replace(/\/+$/,'');url=vsu+'/'+web+'/'+topic;}}} 
    20 return url;},convertPubURL:function(url){var orig=url;var base=TWikiTiny.getTWikiVar("PUBURL")+'/' 
    21 +TWikiTiny.getTWikiVar("WEB")+'/' 
    22 +TWikiTiny.getTWikiVar("TOPIC")+'/';url=TWikiTiny.expandVariables(url);if(url.indexOf('/')==-1){url=base+url;} 
    23 return url;},getMetaTag:function(inKey){if(TWikiTiny.metaTags==null||TWikiTiny.metaTags.length==0){var head=document.getElementsByTagName("META");head=head[0].parentNode.childNodes;TWikiTiny.metaTags=new Array();for(var i=0;i<head.length;i++){if(head[i].tagName!=null&&head[i].tagName.toUpperCase()=='META'){TWikiTiny.metaTags[head[i].name]=head[i].content;}}} 
    24 return TWikiTiny.metaTags[inKey];},install:function(){var tmce_init=TWikiTiny.getMetaTag('TINYMCEPLUGIN_INIT');if(tmce_init!=null){eval("tinyMCE.init({"+unescape(tmce_init)+"});");return;} 
     20return url;},convertPubURL:function(url){var orig=url;var base=FoswikiTiny.getFoswikiVar("PUBURL")+'/' 
     21+FoswikiTiny.getFoswikiVar("WEB")+'/' 
     22+FoswikiTiny.getFoswikiVar("TOPIC")+'/';url=FoswikiTiny.expandVariables(url);if(url.indexOf('/')==-1){url=base+url;} 
     23return url;},getMetaTag:function(inKey){if(FoswikiTiny.metaTags==null||FoswikiTiny.metaTags.length==0){var head=document.getElementsByTagName("META");head=head[0].parentNode.childNodes;FoswikiTiny.metaTags=new Array();for(var i=0;i<head.length;i++){if(head[i].tagName!=null&&head[i].tagName.toUpperCase()=='META'){FoswikiTiny.metaTags[head[i].name]=head[i].content;}}} 
     24return FoswikiTiny.metaTags[inKey];},install:function(){var tmce_init=FoswikiTiny.getMetaTag('TINYMCEPLUGIN_INIT');if(tmce_init!=null){eval("tinyMCE.init({"+unescape(tmce_init)+"});");return;} 
    2525alert("Unable to install TinyMCE; <META name='TINYMCEPLUGIN_INIT' is missing");}}; 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny_src.js

    r984 r1043  
    77  as published by the Free Software Foundation; either version 2 
    88  of the License, or (at your option) any later version. For 
    9   more details read LICENSE in the root of the TWiki distribution. 
     9  more details read LICENSE in the root of the Foswiki distribution. 
    1010 
    1111  This program is distributed in the hope that it will be useful, 
     
    1616*/ 
    1717 
    18 // The TWikiTiny class object 
    19 var TWikiTiny = { 
    20  
    21     twikiVars : null, 
     18// The FoswikiTiny class object 
     19var FoswikiTiny = { 
     20 
     21    foswikiVars : null, 
    2222    request : null, // Container for HTTP request object 
    2323    metaTags : null, 
     
    2626    html2tml : new Array(), // callbacks, attached in plugins 
    2727 
    28     // Get a TWiki variable from the set passed 
    29     getTWikiVar : function (name) { 
    30         if (TWikiTiny.twikiVars == null) { 
    31             var sets = tinyMCE.getParam("twiki_vars", ""); 
    32             TWikiTiny.twikiVars = eval(sets); 
    33         } 
    34         return TWikiTiny.twikiVars[name]; 
     28    // Get a Foswiki variable from the set passed 
     29    getFoswikiVar : function (name) { 
     30        if (FoswikiTiny.foswikiVars == null) { 
     31            var sets = tinyMCE.getParam("foswiki_vars", ""); 
     32            FoswikiTiny.foswikiVars = eval(sets); 
     33        } 
     34        return FoswikiTiny.foswikiVars[name]; 
    3535    }, 
    3636 
    3737    expandVariables : function(url) { 
    38         for (var i in TWikiTiny.twikiVars) { 
    39             url = url.replace('%' + i + '%', TWikiTiny.twikiVars[i], 'g'); 
     38        for (var i in FoswikiTiny.foswikiVars) { 
     39            url = url.replace('%' + i + '%', FoswikiTiny.foswikiVars[i], 'g'); 
    4040        } 
    4141        return url; 
     
    5757    transform : function(editor, handler, text, onReadyToSend, onReply, onFail) { 
    5858        // Work out the rest URL from the location 
    59         var url = TWikiTiny.getTWikiVar("SCRIPTURL"); 
    60         var suffix = TWikiTiny.getTWikiVar("SCRIPTSUFFIX"); 
     59        var url = FoswikiTiny.getFoswikiVar("SCRIPTURL"); 
     60        var suffix = FoswikiTiny.getFoswikiVar("SCRIPTSUFFIX"); 
    6161        if (suffix == null) suffix = ''; 
    6262        url += "/rest" + suffix + "/WysiwygPlugin/" + handler; 
    63         var path = TWikiTiny.getTWikiVar("WEB") + '.' 
    64         + TWikiTiny.getTWikiVar("TOPIC"); 
    65         TWikiTiny.request = new Object(); 
     63        var path = FoswikiTiny.getFoswikiVar("WEB") + '.' 
     64        + FoswikiTiny.getFoswikiVar("TOPIC"); 
     65        FoswikiTiny.request = new Object(); 
    6666        if (tinyMCE.isIE) { 
    6767            // branch for IE/Windows ActiveX version 
    68             TWikiTiny.request.req = new ActiveXObject("Microsoft.XMLHTTP"); 
     68            FoswikiTiny.request.req = new ActiveXObject("Microsoft.XMLHTTP"); 
    6969        } else { 
    7070            // branch for native XMLHttpRequest object 
    71             TWikiTiny.request.req = new XMLHttpRequest(); 
    72         } 
    73         TWikiTiny.request.editor = editor; 
    74         TWikiTiny.request.req.open("POST", url, true); 
    75         TWikiTiny.request.req.setRequestHeader( 
     71            FoswikiTiny.request.req = new XMLHttpRequest(); 
     72        } 
     73        FoswikiTiny.request.editor = editor; 
     74        FoswikiTiny.request.req.open("POST", url, true); 
     75        FoswikiTiny.request.req.setRequestHeader( 
    7676            "Content-type", "application/x-www-form-urlencoded"); 
    7777        var params = "nocache=" + encodeURIComponent((new Date()).getTime()) 
     
    7979        + "&text=" + encodeURIComponent(text); 
    8080     
    81         TWikiTiny.request.req.setRequestHeader( 
     81        FoswikiTiny.request.req.setRequestHeader( 
    8282            "Content-length", params.length); 
    83         TWikiTiny.request.req.setRequestHeader("Connection", "close"); 
    84         TWikiTiny.request.req.onreadystatechange = function() { 
     83        FoswikiTiny.request.req.setRequestHeader("Connection", "close"); 
     84        FoswikiTiny.request.req.onreadystatechange = function() { 
    8585            // Callback for XMLHttpRequest 
    86             // only if TWikiTiny.request.req shows "complete" 
    87             if (TWikiTiny.request.req.readyState == 4) { 
     86            // only if FoswikiTiny.request.req shows "complete" 
     87            if (FoswikiTiny.request.req.readyState == 4) { 
    8888                // only if "OK" 
    89                 if (TWikiTiny.request.req.status == 200) { 
     89                if (FoswikiTiny.request.req.status == 200) { 
    9090                    onReply(); 
    9191                } else { 
     
    9595        }; 
    9696        onReadyToSend(); 
    97         TWikiTiny.request.req.send(params); 
     97        FoswikiTiny.request.req.send(params); 
    9898    }, 
    9999 
     
    105105        // to HTML. We need this test so that pressing the 'back' 
    106106        // button from a failed save doesn't banjax the old content. 
    107         if (TWikiTiny.initialisedFromServer) return; 
     107        if (FoswikiTiny.initialisedFromServer) return; 
    108108        var editor = tinyMCE.getInstanceById(editor_id); 
    109         TWikiTiny.switchToWYSIWYG(editor); 
    110         TWikiTiny.initialisedFromServer = true; 
     109        FoswikiTiny.switchToWYSIWYG(editor); 
     110        FoswikiTiny.initialisedFromServer = true; 
    111111    }, 
    112112 
     
    121121 
    122122        // Evaluate post-processors 
    123         for (var i = 0; i < TWikiTiny.html2tml.length; i++) { 
    124             var cb = TWikiTiny.html2tml[i]; 
     123        for (var i = 0; i < FoswikiTiny.html2tml.length; i++) { 
     124            var cb = FoswikiTiny.html2tml[i]; 
    125125            text = cb.apply(inst, [ inst, text ]); 
    126126        } 
    127         TWikiTiny.transform( 
     127        FoswikiTiny.transform( 
    128128            inst, "html2tml", text, 
    129129            function () { 
    130                 TWikiTiny.enableSave(false); 
    131                 var te = TWikiTiny.request.editor.oldTargetElement; 
     130                FoswikiTiny.enableSave(false); 
     131                var te = FoswikiTiny.request.editor.oldTargetElement; 
    132132                te.value = "Please wait... retrieving page from server"; 
    133133            }, 
    134134            function () { 
    135                 var te = TWikiTiny.request.editor.oldTargetElement; 
    136                 var text = TWikiTiny.request.req.responseText; 
     135                var te = FoswikiTiny.request.editor.oldTargetElement; 
     136                var text = FoswikiTiny.request.req.responseText; 
    137137                te.value = text; 
    138                 TWikiTiny.enableSave(true); 
     138                FoswikiTiny.enableSave(true); 
    139139            }, 
    140140            function () { 
    141                 var te = TWikiTiny.request.editor.oldTargetElement; 
     141                var te = FoswikiTiny.request.editor.oldTargetElement; 
    142142                te.value = "There was a problem retrieving the page: " 
    143                     + TWikiTiny.request.req.statusText; 
    144                 //TWikiTiny.enableSave(true); leave it disabled 
     143                    + FoswikiTiny.request.req.statusText; 
     144                //FoswikiTiny.enableSave(true); leave it disabled 
    145145            }); 
    146146        // Add the button for the switch back to WYSIWYG mode 
     
    157157            el.type = "button"; 
    158158            el.value = "WYSIWYG"; 
    159             el.className = "twikiButton"; 
     159            el.className = "foswikiButton"; 
    160160            el.onclick = function () { 
    161161                tinyMCE.execCommand("mceToggleEditor", null, inst.editorId); 
     
    180180        editor.oldTargetElement.onchange = null; 
    181181        // Need to tinyMCE.execCommand("mceToggleEditor", null, editor_id); 
    182         TWikiTiny.transform( 
     182        FoswikiTiny.transform( 
    183183            editor, "tml2html", editor.oldTargetElement.value, 
    184184            function () { 
    185185                // Before send 
    186                 TWikiTiny.enableSave(false); 
    187                 var editor = TWikiTiny.request.editor; 
     186                FoswikiTiny.enableSave(false); 
     187                var editor = FoswikiTiny.request.editor; 
    188188                tinyMCE.setInnerHTML( 
    189                     TWikiTiny.request.editor.getBody(), 
    190                     "<span class='twikiAlert'>Please wait... retrieving page from server.</span>"); 
     189                    FoswikiTiny.request.editor.getBody(), 
     190                    "<span class='foswikiAlert'>Please wait... retrieving page from server.</span>"); 
    191191            }, 
    192192            function () { 
    193193                // Handle the reply 
    194                 var text = TWikiTiny.request.req.responseText; 
     194                var text = FoswikiTiny.request.req.responseText; 
    195195                // Evaluate any registered pre-processors 
    196                 for (var i = 0; i < TWikiTiny.tml2html.length; i++) { 
    197                     var cb = TWikiTiny.tml2html[i]; 
     196                for (var i = 0; i < FoswikiTiny.tml2html.length; i++) { 
     197                    var cb = FoswikiTiny.tml2html[i]; 
    198198                    text = cb.apply(editor, [ editor, text ]); 
    199199                } 
    200                 tinyMCE.setInnerHTML(TWikiTiny.request.editor.getBody(), text); 
    201                 TWikiTiny.request.editor.isNotDirty = true; 
    202                 TWikiTiny.enableSave(true); 
     200                tinyMCE.setInnerHTML(FoswikiTiny.request.editor.getBody(), text); 
     201                FoswikiTiny.request.editor.isNotDirty = true; 
     202                FoswikiTiny.enableSave(true); 
    203203            }, 
    204204            function () { 
    205205                // Handle a failure 
    206206                tinyMCE.setInnerHTML( 
    207                     TWikiTiny.request.editor.getBody(), 
    208                     "<div class='twikiAlert'>" 
     207                    FoswikiTiny.request.editor.getBody(), 
     208                    "<div class='foswikiAlert'>" 
    209209                    + "There was a problem retrieving the page: " 
    210                     + TWikiTiny.request.req.statusText + "</div>"); 
    211                 //TWikiTiny.enableSave(true); leave save disabled 
     210                    + FoswikiTiny.request.req.statusText + "</div>"); 
     211                //FoswikiTiny.enableSave(true); leave save disabled 
    212212            }); 
    213213 
     
    225225        // Evaluate any registered post-processors 
    226226        var editor = tinyMCE.getInstanceById(editor_id); 
    227         for (var i = 0; i < TWikiTiny.html2tml.length; i++) { 
    228             var cb = TWikiTiny.html2tml[i]; 
     227        for (var i = 0; i < FoswikiTiny.html2tml.length; i++) { 
     228            var cb = FoswikiTiny.html2tml[i]; 
    229229            html = cb.apply(editor, [ editor, html ]); 
    230230        } 
    231         var secret_id = tinyMCE.getParam('twiki_secret_id'); 
     231        var secret_id = tinyMCE.getParam('foswiki_secret_id'); 
    232232        if (secret_id != null && html.indexOf( 
    233233                '<!--' + secret_id + '-->') == -1) { 
     
    239239 
    240240    // Called  
    241     // Called on URL insertion, but not on image sources. Expand TWiki 
     241    // Called on URL insertion, but not on image sources. Expand Foswiki 
    242242    // variables in the url. 
    243243    convertLink : function(url, node, onSave){ 
     
    245245            onSave = false; 
    246246        var orig = url; 
    247         var pubUrl = TWikiTiny.getTWikiVar("PUBURL"); 
    248         var vsu = TWikiTiny.getTWikiVar("VIEWSCRIPTURL"); 
    249         url = TWikiTiny.expandVariables(url); 
     247        var pubUrl = FoswikiTiny.getFoswikiVar("PUBURL"); 
     248        var vsu = FoswikiTiny.getFoswikiVar("VIEWSCRIPTURL"); 
     249        url = FoswikiTiny.expandVariables(url); 
    250250        if (onSave) { 
    251251            if ((url.indexOf(pubUrl + '/') != 0) && 
     
    253253                url = url.substr(vsu.length + 1); 
    254254                url = url.replace(/\/+/g, '.'); 
    255                 if (url.indexOf(TWikiTiny.getTWikiVar('WEB') + '.') == 0) { 
    256                     url = url.substr(TWikiTiny.getTWikiVar('WEB').length + 1); 
     255                if (url.indexOf(FoswikiTiny.getFoswikiVar('WEB') + '.') == 0) { 
     256                    url = url.substr(FoswikiTiny.getFoswikiVar('WEB').length + 1); 
    257257                } 
    258258            } 
     
    265265                    var topic = match[2]; 
    266266                    if (web == null || web.length == 0) { 
    267                         web = TWikiTiny.getTWikiVar("WEB"); 
     267                        web = FoswikiTiny.getFoswikiVar("WEB"); 
    268268                    } 
    269269                    web = web.replace(/\.+/g, '/'); 
     
    282282    convertPubURL : function(url){ 
    283283        var orig = url; 
    284         var base = TWikiTiny.getTWikiVar("PUBURL") + '/' 
    285         + TWikiTiny.getTWikiVar("WEB") + '/' 
    286         + TWikiTiny.getTWikiVar("TOPIC") + '/'; 
    287         url = TWikiTiny.expandVariables(url); 
     284        var base = FoswikiTiny.getFoswikiVar("PUBURL") + '/' 
     285        + FoswikiTiny.getFoswikiVar("WEB") + '/' 
     286        + FoswikiTiny.getFoswikiVar("TOPIC") + '/'; 
     287        url = FoswikiTiny.expandVariables(url); 
    288288        if (url.indexOf('/') == -1) { 
    289289            url = base + url; 
     
    293293 
    294294    getMetaTag : function(inKey) { 
    295         if (TWikiTiny.metaTags == null || TWikiTiny.metaTags.length == 0) { 
     295        if (FoswikiTiny.metaTags == null || FoswikiTiny.metaTags.length == 0) { 
    296296            // Do this the brute-force way because of the Firefox problem 
    297297            // seen sporadically on Bugs where the DOM appears complete, but 
     
    299299            var head = document.getElementsByTagName("META"); 
    300300            head = head[0].parentNode.childNodes; 
    301             TWikiTiny.metaTags = new Array(); 
     301            FoswikiTiny.metaTags = new Array(); 
    302302            for (var i = 0; i < head.length; i++) { 
    303303                if (head[i].tagName != null && 
    304304                    head[i].tagName.toUpperCase() == 'META') { 
    305                     TWikiTiny.metaTags[head[i].name] = head[i].content; 
    306                 } 
    307             } 
    308         } 
    309         return TWikiTiny.metaTags[inKey];  
     305                    FoswikiTiny.metaTags[head[i].name] = head[i].content; 
     306                } 
     307            } 
     308        } 
     309        return FoswikiTiny.metaTags[inKey];  
    310310    }, 
    311311     
    312312    install : function() { 
    313313        // find the TINYMCEPLUGIN_INIT META 
    314         var tmce_init = TWikiTiny.getMetaTag('TINYMCEPLUGIN_INIT'); 
     314        var tmce_init = FoswikiTiny.getMetaTag('TINYMCEPLUGIN_INIT'); 
    315315        if (tmce_init != null) { 
    316316            eval("tinyMCE.init({" + unescape(tmce_init) + "});"); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/attach.htm

    r14 r1043  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22  <head> 
    3         <title>{$lang_twikibuttons_attach_dlg_title}</title> 
     3        <title>{$lang_foswikibuttons_attach_dlg_title}</title> 
    44        <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script> 
    55        <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script> 
    66        <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script> 
    7         <script language="javascript" type="text/javascript" src="../../../../../twiki_tiny.js"></script> 
     7        <script language="javascript" type="text/javascript" src="../../../../../foswiki_tiny.js"></script> 
    88        <script language="javascript" type="text/javascript" src="jscripts/attach.js"></script> 
    99        <link rel="stylesheet" type="text/css" href="css/popup.css" /> 
     
    1313      <div class="tabs"> 
    1414        <ul> 
    15           <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_twikibuttons_general_tab}</a></span></li> 
    16           <li id="upload_tab"><span><a href="javascript:mcTabs.displayTab('upload_tab','upload_panel');" onmousedown="return false;">{$lang_twikibuttons_upload_tab}</a></span></li> 
     15          <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_foswikibuttons_general_tab}</a></span></li> 
     16          <li id="upload_tab"><span><a href="javascript:mcTabs.displayTab('upload_tab','upload_panel');" onmousedown="return false;">{$lang_foswikibuttons_upload_tab}</a></span></li> 
    1717        </ul> 
    1818      </div> 
     
    2121          <div id="general_panel" class="panel current"> 
    2222            <fieldset> 
    23               <legend>{$lang_twikibuttons_fieldset_general_tab}</legend> 
     23              <legend>{$lang_foswikibuttons_fieldset_general_tab}</legend> 
    2424              <table border="0" cellpadding="0" cellspacing="4"> 
    2525                  <tr> 
    26                     <td class="label"><label id="attachments_selectlabel" for="attachments_select">{$lang_twikibuttons_insert_attachment_link}</label>:</td>  
     26                    <td class="label"><label id="attachments_selectlabel" for="attachments_select">{$lang_foswikibuttons_insert_attachment_link}</label>:</td>  
    2727                    <td> 
    2828                      <select id="attachments_select" name="attachments_select" class="field" /> 
     
    3232              </table> 
    3333              <div style="float: left"> 
    34                 <input type="button" id="insert" name="insert" value="{$lang_twikibuttons_insert_attachment_link}" onclick="insertLink();" /> 
     34                <input type="button" id="insert" name="insert" value="{$lang_foswikibuttons_insert_attachment_link}" onclick="insertLink();" /> 
    3535              </div> 
    3636              <div style="float: right"> 
     
    3838              </div> 
    3939            </fieldset> 
    40             <label>{$lang_twikibuttons_attach_help}</label> 
     40            <label>{$lang_foswikibuttons_attach_help}</label> 
    4141          </div> 
    4242          <div id="upload_panel" class="panel"> 
    43             <legend>{$lang_twikibuttons_fieldset_upload_tab}</legend> 
     43            <legend>{$lang_foswikibuttons_fieldset_upload_tab}</legend> 
    4444            <fieldset> 
    4545              <table border="0" cellpadding="0" cellspacing="4"> 
    4646                  <tr> 
    47                     <td class="label"><label id="filepathlabel" for="filepath">{$lang_twikibuttons_attach_file}</label>:</td>  
     47                    <td class="label"><label id="filepathlabel" for="filepath">{$lang_foswikibuttons_attach_file}</label>:</td>  
    4848                    <td> 
    4949                      <input id="filepath" name="filepath" type="file" value="" class="field" /> 
     
    5151                  </tr> 
    5252                  <tr> 
    53                     <td class="label"><label id="filecommentlabel" for="filecomment">{$lang_twikibuttons_attach_comment}</label>:</td>  
     53                    <td class="label"><label id="filecommentlabel" for="filecomment">{$lang_foswikibuttons_attach_comment}</label>:</td>  
    5454                    <td><input id="filecomment" name="filecomment" type="text" value="" class="field" size="40"/></td>  
    5555                  </tr> 
    5656                  <tr> 
    57                     <td class="label"><label id="hidefilelabel" for="hidefile">{$lang_twikibuttons_attach_hide}</label>:</td>  
     57                    <td class="label"><label id="hidefilelabel" for="hidefile">{$lang_foswikibuttons_attach_hide}</label>:</td>  
    5858                    <td> 
    5959                      <input id="hidefile" name="hidefile" type="checkbox" value="1" class="field" /> 
     
    6666              <input type="hidden" name="noredirect" value="1" /> 
    6767              <div style="float: left"> 
    68                 <input type="submit" id="insert" name="insert" value="{$lang_twikibuttons_upload}" /> 
     68                <input type="submit" id="insert" name="insert" value="{$lang_foswikibuttons_upload}" /> 
    6969              </div> 
    7070              <div style="float: right"> 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/colours.htm

    r14 r1043  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22  <head> 
    3         <title>{$lang_twikibuttons_colours_dlg_title}</title> 
     3        <title>{$lang_foswikibuttons_colours_dlg_title}</title> 
    44        <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script> 
    55        <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script> 
     
    1010        <base target="_self" /> 
    1111  </head> 
    12     <body onload="tinyMCEPopup.executeOnLoad('init();');" id="twikibuttonscolours" style="display: none"> 
     12    <body onload="tinyMCEPopup.executeOnLoad('init();');" id="foswikibuttonscolours" style="display: none"> 
    1313      <div class="panel_wrapper"> 
    1414        <div id="general_panel" class="panel current"> 
     
    3939                <input title="midnightblue" class="colours" style="background-color:midnightblue" type="button" value="&nbsp;" onclick="setColour('midnightblue')" /> 
    4040              </td> 
    41               <td class="twikicolours" style="background-color:navy"> 
     41              <td class="foswikicolours" style="background-color:navy"> 
    4242                <input title="%NAVY%" class="colours" style="background-color:navy" type="button" value="&nbsp;" onclick="setColour('navy')" /> 
    4343              </td> 
     
    5050            </tr> 
    5151            <tr> 
    52               <td class="twikicolours" style="background-color:blue"> 
     52              <td class="foswikicolours" style="background-color:blue"> 
    5353                <input title="%BLUE%" class="colours" style="background-color:blue" type="button" value="&nbsp;" onclick="setColour('blue')" /> 
    5454              </td> 
     
    9191                <input title="darkcyan" class="colours" style="background-color:darkcyan" type="button" value="&nbsp;" onclick="setColour('darkcyan')" /> 
    9292              </td> 
    93               <td class="twikicolours" style="background-color:teal"> 
     93              <td class="foswikicolours" style="background-color:teal"> 
    9494                <input title="%TEAL%" class="colours" style="background-color:teal" type="button" value="&nbsp;" onclick="setColour('teal')" /> 
    9595              </td> 
     
    103103                <input title="aqua" class="colours" style="background-color:aqua" type="button" value="&nbsp;" onclick="setColour('aqua')" /> 
    104104              </td> 
    105               <td class="twikicolours" style="background-color:cyan"> 
     105              <td class="foswikicolours" style="background-color:cyan"> 
    106106                <input title="%AQUA%" class="colours" style="background-color:cyan" type="button" value="&nbsp;" onclick="setColour('cyan')" /> 
    107107              </td> 
     
    129129                <input title="darkgreen" class="colours" style="background-color:darkgreen" type="button" value="&nbsp;" onclick="setColour('darkgreen')" /> 
    130130              </td> 
    131               <td class="twikicolours" style="background-color:green"> 
     131              <td class="foswikicolours" style="background-color:green"> 
    132132                <input title="%GREEN%" class="colours" style="background-color:green" type="button" value="&nbsp;" onclick="setColour('green')" /> 
    133133              </td> 
     
    138138                <input title="limegreen" class="colours" style="background-color:limegreen" type="button" value="&nbsp;" onclick="setColour('limegreen')" /> 
    139139              </td> 
    140               <td class="twikicolours" style="background-color:lime"> 
     140              <td class="foswikicolours" style="background-color:lime"> 
    141141                <input title="%LIME%" class="colours" style="background-color:lime" type="button" value="&nbsp;" onclick="setColour('lime')" /> 
    142142              </td> 
     
    173173                <input title="olivedrab" class="colours" style="background-color:olivedrab" type="button" value="&nbsp;" onclick="setColour('olivedrab')" /> 
    174174              </td> 
    175               <td class="twikicolours" style="background-color:olive"> 
     175              <td class="foswikicolours" style="background-color:olive"> 
    176176                <input title="%OLIVE%" class="colours" style="background-color:olive" type="button" value="&nbsp;" onclick="setColour('olive')" /> 
    177177              </td> 
     
    190190            </tr> 
    191191            <tr> 
    192               <td class="twikicolours" style="background-color:yellow"> 
     192              <td class="foswikicolours" style="background-color:yellow"> 
    193193                <input title="%YELLOW%" class="colours" style="background-color:yellow" type="button" value="&nbsp;" onclick="setColour('yellow')" /> 
    194194              </td> 
     
    240240                <input title="darkred" class="colours" style="background-color:darkred" type="button" value="&nbsp;" onclick="setColour('darkred')" /> 
    241241              </td> 
    242               <td class="twikicolours" style="background-color:maroon"> 
     242              <td class="foswikicolours" style="background-color:maroon"> 
    243243                <input title="%MAROON%" class="colours" style="background-color:maroon" type="button" value="&nbsp;" onclick="setColour('maroon')" /> 
    244244              </td> 
    245               <td class="twikicolours" style="background-color:brown"> 
     245              <td class="foswikicolours" style="background-color:brown"> 
    246246                <input title="%BROWN%" class="colours" style="background-color:brown" type="button" value="&nbsp;" onclick="setColour('brown')" /> 
    247247              </td> 
     
    275275                <input title="darkorange" class="colours" style="background-color:darkorange" type="button" value="&nbsp;" onclick="setColour('darkorange')" /> 
    276276              </td> 
    277               <td class="twikicolours" style="background-color:orange"> 
     277              <td class="foswikicolours" style="background-color:orange"> 
    278278                <input title="%ORANGE%" class="colours" style="background-color:orange" type="button" value="&nbsp;" onclick="setColour('orange')" /> 
    279279              </td> 
     
    284284                <input title="crimson" class="colours" style="background-color:crimson" type="button" value="&nbsp;" onclick="setColour('crimson')" /> 
    285285              </td> 
    286               <td class="twikicolours" style="background-color:red"> 
     286              <td class="foswikicolours" style="background-color:red"> 
    287287                <input title="%RED%" class="colours" style="background-color:red" type="button" value="&nbsp;" onclick="setColour('red')" /> 
    288288              </td> 
     
    290290                <input title="deeppink" class="colours" style="background-color:deeppink" type="button" value="&nbsp;" onclick="setColour('deeppink')" /> 
    291291              </td> 
    292               <td class="twikicolours" style="background-color:fuchsia"> 
     292              <td class="foswikicolours" style="background-color:fuchsia"> 
    293293                <input title="%PINK%" class="colours" style="background-color:fuchsia" type="button" value="&nbsp;" onclick="setColour('fuchsia')" /> 
    294294              </td> 
     
    313313                <input title="mediumvioletred" class="colours" style="background-color:mediumvioletred" type="button" value="&nbsp;" onclick="setColour('mediumvioletred')" /> 
    314314              </td> 
    315               <td class="twikicolours" style="background-color:purple"> 
     315              <td class="foswikicolours" style="background-color:purple"> 
    316316                <input title="%PURPLE%" class="colours" style="background-color:purple" type="button" value="&nbsp;" onclick="setColour('purple')" /> 
    317317              </td> 
     
    421421                <input title="snow" class="colours" style="background-color:snow" type="button" value="&nbsp;" onclick="setColour('snow')" /> 
    422422              </td> 
    423               <td class="twikicolours" style="background-color:white"> 
     423              <td class="foswikicolours" style="background-color:white"> 
    424424                <input title="%WHITE%" class="colours" style="background-color:white" type="button" value="&nbsp;" onclick="setColour('white')" /> 
    425425              </td> 
     
    435435            </tr> 
    436436            <tr> 
    437               <td class="twikicolours" style="background-color:silver"> 
     437              <td class="foswikicolours" style="background-color:silver"> 
    438438                <input title="%SILVER%" class="colours" style="background-color:silver" type="button" value="&nbsp;" onclick="setColour('silver')" /> 
    439439              </td> 
     
    441441                <input title="darkgray" class="colours" style="background-color:darkgray" type="button" value="&nbsp;" onclick="setColour('darkgray')" /> 
    442442              </td> 
    443               <td class="twikicolours" style="background-color:gray"> 
     443              <td class="foswikicolours" style="background-color:gray"> 
    444444                <input title="%GRAY%" class="colours" style="background-color:gray" type="button" value="&nbsp;" onclick="setColour('gray')" /> 
    445445              </td> 
     
    456456                <input title="darkslategray" class="colours" style="background-color:darkslategray" type="button" value="&nbsp;" onclick="setColour('darkslategray')" /> 
    457457              </td> 
    458               <td class="twikicolours" style="background-color:black"> 
     458              <td class="foswikicolours" style="background-color:black"> 
    459459                <input title="%BLACK%" class="colours" style="background-color:black" type="button" value="&nbsp;" onclick="setColour('black')" /> 
    460460              </td> 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/css/popup.css

    r14 r1043  
    1 td.colours{border-width:1px;border-style:solid;border-color:black;font-size:1px;margin:0;padding:0;}td.twikicolours{border-width:2px;border-style:solid;border-color:red;font-size:1px;margin:0;padding:0;}table.colours{border-width:2px;border-style:solid;cursor:default}input.colours{border-width:0px;border-style:none;cursor:default;width:10px;height:10px;margin:0px;} 
     1td.colours{border-width:1px;border-style:solid;border-color:black;font-size:1px;margin:0;padding:0;}td.foswikicolours{border-width:2px;border-style:solid;border-color:red;font-size:1px;margin:0;padding:0;}table.colours{border-width:2px;border-style:solid;cursor:default}input.colours{border-width:0px;border-style:none;cursor:default;width:10px;height:10px;margin:0px;} 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/css/popup_src.css

    r14 r1043  
    88} 
    99 
    10 td.twikicolours { 
     10td.foswikicolours { 
    1111  border-width : 2px; 
    1212  border-style : solid; 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin.js

    r14 r1043  
    1 tinyMCE.importPluginLanguagePack('twikibuttons');var TWikiButtonsPlugin={getInfo:function(){return{longname:'TWiki Buttons Plugin',author:'Crawford Currie',authorurl:'http://c-dot.co.uk',infourl:'http://c-dot.co.uk',version:1};},initInstance:function(inst){},getControlHTML:function(cn){var html,formats;switch(cn){case"tt":return tinyMCE.getButtonHTML(cn,'lang_twikibuttons_tt_desc','{$pluginurl}/images/tt.gif','twikiTT',true);case"colour":return tinyMCE.getButtonHTML(cn,'lang_twikibuttons_colour_desc','{$pluginurl}/images/colour.gif','twikiCOLOUR',true);case"attach":return tinyMCE.getButtonHTML(cn,'lang_twikibuttons_attach_desc','{$pluginurl}/images/attach.gif','twikiATTACH',true);case"hide":return tinyMCE.getButtonHTML(cn,'lang_twikibuttons_hide_desc','{$pluginurl}/images/hide.gif','twikiHIDE',true);case"twikiformat":html='<select id="{$editor_id}_twikiFormatSelect" name="{$editor_id}_twikiFormatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'twikiFORMAT\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';formats=tinyMCE.getParam("twikibuttons_formats");for(var i=0;i<formats.length;i++){html+='<option value="'+formats[i].name+'">' 
     1tinyMCE.importPluginLanguagePack('foswikibuttons');var FoswikiButtonsPlugin={getInfo:function(){return{longname:'Foswiki Buttons Plugin',author:'Crawford Currie',authorurl:'http://c-dot.co.uk',infourl:'http://c-dot.co.uk',version:1};},initInstance:function(inst){},getControlHTML:function(cn){var html,formats;switch(cn){case"tt":return tinyMCE.getButtonHTML(cn,'lang_foswikibuttons_tt_desc','{$pluginurl}/images/tt.gif','foswikiTT',true);case"colour":return tinyMCE.getButtonHTML(cn,'lang_foswikibuttons_colour_desc','{$pluginurl}/images/colour.gif','foswikiCOLOUR',true);case"attach":return tinyMCE.getButtonHTML(cn,'lang_foswikibuttons_attach_desc','{$pluginurl}/images/attach.gif','foswikiATTACH',true);case"hide":return tinyMCE.getButtonHTML(cn,'lang_foswikibuttons_hide_desc','{$pluginurl}/images/hide.gif','foswikiHIDE',true);case"foswikiformat":html='<select id="{$editor_id}_foswikiFormatSelect" name="{$editor_id}_foswikiFormatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'foswikiFORMAT\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';formats=tinyMCE.getParam("foswikibuttons_formats");for(var i=0;i<formats.length;i++){html+='<option value="'+formats[i].name+'">' 
    22+formats[i].name+'</option>';} 
    33html+='</select>';return html;} 
    4 return"";},execCommand:function(editor_id,element,command,user_interface,value){var em;var inst=tinyMCE.getInstanceById(editor_id);switch(command){case"twikiCOLOUR":var t=inst.selection.getSelectedText();if(!(t&&t.length>0||pe)) 
    5 return true;template=new Array();template['file']='../../plugins/twikibuttons/colours.htm';template['width']=240;template['height']=140;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"twikiTT":inst=tinyMCE.getInstanceById(editor_id);elm=inst.getFocusElement();var t=inst.selection.getSelectedText();var pe=tinyMCE.getParentElement(elm,'TT');if(!(t&&t.length>0||pe)) 
     4return"";},execCommand:function(editor_id,element,command,user_interface,value){var em;var inst=tinyMCE.getInstanceById(editor_id);switch(command){case"foswikiCOLOUR":var t=inst.selection.getSelectedText();if(!(t&&t.length>0||pe)) 
     5return true;template=new Array();template['file']='../../plugins/foswikibuttons/colours.htm';template['width']=240;template['height']=140;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"foswikiTT":inst=tinyMCE.getInstanceById(editor_id);elm=inst.getFocusElement();var t=inst.selection.getSelectedText();var pe=tinyMCE.getParentElement(elm,'TT');if(!(t&&t.length>0||pe)) 
    66return true;var s=inst.selection.getSelectedHTML();if(s.length>0){tinyMCE.execCommand('mceBeginUndoLevel');tinyMCE.execInstanceCommand(editor_id,'mceSetCSSClass',user_interface,"WYSIWYG_TT");tinyMCE.execCommand('mceEndUndoLevel');} 
    7 return true;case"twikiHIDE":tinyMCE.execCommand("mceToggleEditor",user_interface,editor_id);return true;case"twikiATTACH":template=new Array();template['file']='../../plugins/twikibuttons/attach.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"twikiFORMAT":var formats=tinyMCE.getParam("twikibuttons_formats");var format=null;for(var i=0;i<formats.length;i++){if(formats[i].name==value){format=formats[i];break;}} 
     7return true;case"foswikiHIDE":tinyMCE.execCommand("mceToggleEditor",user_interface,editor_id);return true;case"foswikiATTACH":template=new Array();template['file']='../../plugins/foswikibuttons/attach.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"foswikiFORMAT":var formats=tinyMCE.getParam("foswikibuttons_formats");var format=null;for(var i=0;i<formats.length;i++){if(formats[i].name==value){format=formats[i];break;}} 
    88if(format!=null){tinyMCE.execCommand('mceBeginUndoLevel');if(format.el!=null){var fmt=format.el;if(fmt.length) 
    99fmt='<'+fmt+'>';tinyMCE.execInstanceCommand(editor_id,'FormatBlock',user_interface,fmt);if(format.el==''){elm=inst.getFocusElement();tinyMCE.execCommand('removeformat',user_interface,elm);}} 
     
    1414return;if(!any_selection){tinyMCE.switchClass(editor_id+'_tt','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_colour','mceButtonDisabled');}else{tinyMCE.switchClass(editor_id+'_tt','mceButtonNormal');tinyMCE.switchClass(editor_id+'_colour','mceButtonNormal');} 
    1515switch(node.nodeName){case"TT":tinyMCE.switchClass(editor_id+'_tt','mceButtonSelected');return true;} 
    16 var selectElm=document.getElementById(editor_id+"_twikiFormatSelect");if(selectElm){var formats=tinyMCE.getParam("twikibuttons_formats");var puck=-1;do{for(var i=0;i<formats.length;i++){if(!formats[i].el||formats[i].el==node.nodeName.toLowerCase()){if(!formats[i].style||RegExp('\\b'+formats[i].style+'\\b').test(tinyMCE.getAttrib(node,"class"))){puck=i;if(puck>0) 
     16var selectElm=document.getElementById(editor_id+"_foswikiFormatSelect");if(selectElm){var formats=tinyMCE.getParam("foswikibuttons_formats");var puck=-1;do{for(var i=0;i<formats.length;i++){if(!formats[i].el||formats[i].el==node.nodeName.toLowerCase()){if(!formats[i].style||RegExp('\\b'+formats[i].style+'\\b').test(tinyMCE.getAttrib(node,"class"))){puck=i;if(puck>0) 
    1717break;}}}}while(puck<0&&(node=node.parentNode)!=null);if(puck>=0){selectElm.selectedIndex=puck;}} 
    18 return true;}};tinyMCE.addPlugin("twikibuttons",TWikiButtonsPlugin); 
     18return true;}};tinyMCE.addPlugin("foswikibuttons",FoswikiButtonsPlugin); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/editor_plugin_src.js

    r14 r1043  
    1 tinyMCE.importPluginLanguagePack('twikibuttons'); 
     1tinyMCE.importPluginLanguagePack('foswikibuttons'); 
    22 
    3 var TWikiButtonsPlugin = { 
     3var FoswikiButtonsPlugin = { 
    44        getInfo : function() { 
    55                return { 
    6                         longname : 'TWiki Buttons Plugin', 
     6                        longname : 'Foswiki Buttons Plugin', 
    77                        author : 'Crawford Currie', 
    88                        authorurl : 'http://c-dot.co.uk', 
     
    1414        initInstance : function(inst) { 
    1515                //tinyMCE.importCSS(inst.getDoc(), 
    16         //tinyMCE.baseURL + "/plugins/twikibuttons/css/twikibuttons.css"); 
     16        //tinyMCE.baseURL + "/plugins/foswikibuttons/css/foswikibuttons.css"); 
    1717        }, 
    1818 
     
    2121                switch (cn) { 
    2222        case "tt": 
    23             return tinyMCE.getButtonHTML(cn, 'lang_twikibuttons_tt_desc', 
     23            return tinyMCE.getButtonHTML(cn, 'lang_foswikibuttons_tt_desc', 
    2424                                         '{$pluginurl}/images/tt.gif', 
    25                                          'twikiTT', true); 
     25                                         'foswikiTT', true); 
    2626        case "colour": 
    27             return tinyMCE.getButtonHTML(cn, 'lang_twikibuttons_colour_desc', 
     27            return tinyMCE.getButtonHTML(cn, 'lang_foswikibuttons_colour_desc', 
    2828                                         '{$pluginurl}/images/colour.gif', 
    29                                          'twikiCOLOUR', true); 
     29                                         'foswikiCOLOUR', true); 
    3030        case "attach": 
    31             return tinyMCE.getButtonHTML(cn, 'lang_twikibuttons_attach_desc', 
     31            return tinyMCE.getButtonHTML(cn, 'lang_foswikibuttons_attach_desc', 
    3232                                         '{$pluginurl}/images/attach.gif', 
    33                                          'twikiATTACH', true); 
     33                                         'foswikiATTACH', true); 
    3434        case "hide": 
    35             return tinyMCE.getButtonHTML(cn, 'lang_twikibuttons_hide_desc', 
     35            return tinyMCE.getButtonHTML(cn, 'lang_foswikibuttons_hide_desc', 
    3636                                         '{$pluginurl}/images/hide.gif', 
    37                                          'twikiHIDE', true); 
    38         case "twikiformat": 
    39             html = '<select id="{$editor_id}_twikiFormatSelect" name="{$editor_id}_twikiFormatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'twikiFORMAT\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'; 
    40             formats = tinyMCE.getParam("twikibuttons_formats"); 
     37                                         'foswikiHIDE', true); 
     38        case "foswikiformat": 
     39            html = '<select id="{$editor_id}_foswikiFormatSelect" name="{$editor_id}_foswikiFormatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'foswikiFORMAT\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'; 
     40            formats = tinyMCE.getParam("foswikibuttons_formats"); 
    4141            // Build format select 
    4242            for (var i = 0; i < formats.length; i++) { 
     
    5858 
    5959                switch (command) { 
    60         case "twikiCOLOUR": 
     60        case "foswikiCOLOUR": 
    6161            var t = inst.selection.getSelectedText(); 
    6262            if (!(t && t.length > 0 || pe)) 
     
    6464 
    6565            template = new Array(); 
    66             template['file'] = '../../plugins/twikibuttons/colours.htm'; 
     66            template['file'] = '../../plugins/foswikibuttons/colours.htm'; 
    6767            template['width'] = 240; 
    6868            template['height'] = 140; 
     
    7070            return true; 
    7171 
    72         case "twikiTT": 
     72        case "foswikiTT": 
    7373            inst = tinyMCE.getInstanceById(editor_id); 
    7474            elm = inst.getFocusElement(); 
     
    8989            return true; 
    9090 
    91         case "twikiHIDE": 
     91        case "foswikiHIDE": 
    9292            tinyMCE.execCommand("mceToggleEditor", user_interface, editor_id); 
    9393            return true; 
    9494 
    95         case "twikiATTACH": 
     95        case "foswikiATTACH": 
    9696            template = new Array(); 
    97             template['file'] = '../../plugins/twikibuttons/attach.htm'; 
     97            template['file'] = '../../plugins/foswikibuttons/attach.htm'; 
    9898            template['width'] = 350; 
    9999            template['height'] = 250; 
     
    101101            return true; 
    102102 
    103         case "twikiFORMAT": 
    104             var formats = tinyMCE.getParam("twikibuttons_formats"); 
     103        case "foswikiFORMAT": 
     104            var formats = tinyMCE.getParam("foswikibuttons_formats"); 
    105105            var format = null; 
    106106            for (var i = 0; i < formats.length; i++) { 
     
    166166 
    167167                var selectElm = document.getElementById( 
    168             editor_id + "_twikiFormatSelect"); 
     168            editor_id + "_foswikiFormatSelect"); 
    169169        if (selectElm) { 
    170             var formats = tinyMCE.getParam("twikibuttons_formats"); 
     170            var formats = tinyMCE.getParam("foswikibuttons_formats"); 
    171171            var puck = -1; 
    172172            do { 
     
    195195}; 
    196196 
    197 tinyMCE.addPlugin("twikibuttons", TWikiButtonsPlugin); 
     197tinyMCE.addPlugin("foswikibuttons", FoswikiButtonsPlugin); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/attach.js

    r14 r1043  
    11function initAttachDialog(){tinyMCEPopup.resizeToInnerSize();} 
    2 function getAttachInfo(){var scripturl=TWikiTiny.getTWikiVar("SCRIPTURL");var suffix=TWikiTiny.getTWikiVar("SCRIPTSUFFIX");if(suffix==null)suffix='';var url=scripturl+"/rest"+suffix+"/WysiwygPlugin/attachments";var request=(tinyMCE.isIE)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();request.open("POST",url,true);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");var path=TWikiTiny.getTWikiVar("WEB")+'.' 
    3 +TWikiTiny.getTWikiVar("TOPIC");var params="nocache="+encodeURIComponent((new Date()).getTime()) 
     2function getAttachInfo(){var scripturl=FoswikiTiny.getFoswikiVar("SCRIPTURL");var suffix=FoswikiTiny.getFoswikiVar("SCRIPTSUFFIX");if(suffix==null)suffix='';var url=scripturl+"/rest"+suffix+"/WysiwygPlugin/attachments";var request=(tinyMCE.isIE)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();request.open("POST",url,true);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");var path=FoswikiTiny.getFoswikiVar("WEB")+'.' 
     3+FoswikiTiny.getFoswikiVar("TOPIC");var params="nocache="+encodeURIComponent((new Date()).getTime()) 
    44+"&topic="+encodeURIComponent(path);request.setRequestHeader("Content-length",params.length);request.setRequestHeader("Connection","close");request.onreadystatechange=function(){attachmentListCallback(request);};request.send(params);var el=document.getElementById('upload_form');el.action=scripturl+"/rest"+suffix+ 
    55"/WysiwygPlugin/upload";el=document.getElementById('upload_form_topic');el.value=path;} 
    66function attachmentListCallback(request){if(request.readyState==4){if(request.status==200){var atts=request.responseText;if(atts!=null){atts=eval(atts);var select=document.getElementById("attachments_select");for(var i=0;i<atts.length;i++){select.options[i]=new Option(atts[i].name,atts[i].name);}}}else{alert("There was a problem retrieving the attachments list: " 
    77+request.statusText);}}} 
    8 function insertLink(){var inst=tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));var select=document.getElementById("attachments_select");var filename=select.value;var url=TWikiTiny.getTWikiVar("ATTACHURL")+'/'+filename;var tmp=filename.lastIndexOf(".");if(tmp>=0) 
     8function insertLink(){var inst=tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));var select=document.getElementById("attachments_select");var filename=select.value;var url=FoswikiTiny.getFoswikiVar("ATTACHURL")+'/'+filename;var tmp=filename.lastIndexOf(".");if(tmp>=0) 
    99tmp=filename.substring(tmp+1,filename.length).toLowerCase();var html;if(tmp=="jpg"||tmp=="gif"||tmp=="jpeg"||tmp=="png"||tmp=="bmp"){html="<img src='"+url+"' alt='"+filename+"'>";}else{html="<a href='"+url+"'>"+filename+"</a>";} 
    1010tinyMCEPopup.execCommand('mceBeginUndoLevel');tinyMCE.execCommand('mceInsertContent',false,html);tinyMCE.triggerNodeChange();tinyMCEPopup.execCommand('mceEndUndoLevel');tinyMCEPopup.close();} 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/attach_src.js

    r14 r1043  
    77  as published by the Free Software Foundation; either version 2 
    88  of the License, or (at your option) any later version. For 
    9   more details read LICENSE in the root of the TWiki distribution. 
     9  more details read LICENSE in the root of the Foswiki distribution. 
    1010 
    1111  This program is distributed in the hope that it will be useful, 
     
    2323function getAttachInfo() { 
    2424    // Work out the rest URL from the location 
    25     var scripturl = TWikiTiny.getTWikiVar("SCRIPTURL"); 
    26     var suffix = TWikiTiny.getTWikiVar("SCRIPTSUFFIX"); 
     25    var scripturl = FoswikiTiny.getFoswikiVar("SCRIPTURL"); 
     26    var suffix = FoswikiTiny.getFoswikiVar("SCRIPTSUFFIX"); 
    2727    if (suffix == null) suffix = ''; 
    2828    var url = scripturl + "/rest" + suffix + "/WysiwygPlugin/attachments"; 
     
    3535        "Content-type", "application/x-www-form-urlencoded"); 
    3636 
    37     var path = TWikiTiny.getTWikiVar("WEB") + '.'  
    38         + TWikiTiny.getTWikiVar("TOPIC"); 
     37    var path = FoswikiTiny.getFoswikiVar("WEB") + '.'  
     38        + FoswikiTiny.getFoswikiVar("TOPIC"); 
    3939    var params = "nocache=" + encodeURIComponent((new Date()).getTime()) 
    4040        + "&topic=" + encodeURIComponent(path); 
     
    7979    var select = document.getElementById("attachments_select"); 
    8080    var filename = select.value; 
    81     var url = TWikiTiny.getTWikiVar("ATTACHURL") + '/' + filename; 
     81    var url = FoswikiTiny.getFoswikiVar("ATTACHURL") + '/' + filename; 
    8282    var tmp = filename.lastIndexOf("."); 
    8383    if (tmp >= 0) 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/jscripts/colour_src.js

    r14 r1043  
    77  as published by the Free Software Foundation; either version 2 
    88  of the License, or (at your option) any later version. For 
    9   more details read LICENSE in the root of the TWiki distribution. 
     9  more details read LICENSE in the root of the Foswiki distribution. 
    1010 
    1111  This program is distributed in the hope that it will be useful, 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/langs/en.js

    r14 r1043  
    11// UK lang variables 
    22 
    3 tinyMCE.addToLang("twikibuttons", { 
     3tinyMCE.addToLang("foswikibuttons", { 
    44    tt_desc : "Typewriter text", 
    55    colour_desc : "Font colour", 
     
    1818    existing_attachments : "Existing Attachments", 
    1919    attach_help : "If recently uploaded files are not in the list, then close and re-open this dialog", 
    20     hide_desc : "Edit TWiki markup" 
     20    hide_desc : "Edit Foswiki markup" 
    2121}); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/css/advimage_src.css

    r14 r1043  
    1 /* CSS file for twikiimage plugin popup */ 
     1/* CSS file for foswikiimage plugin popup */ 
    22 
    33.mceImageList { 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/editor_plugin.js

    r14 r1043  
    1 tinyMCE.importPluginLanguagePack('twikiimage');var TinyMCE_TWikiImagePlugin={getInfo:function(){return{longname:'TWiki image',author:'WikiRing, from Moxiecode Systems AB original',authorurl:'http://wikiring.com',infourl:'http://twiki.org/cgi-bin/view/Plugins/TinyMCEPlugin',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"image":return tinyMCE.getButtonHTML(cn,'lang_image_desc','{$themeurl}/images/image.gif','mceAdvImage');} 
    2 return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvImage":var template=new Array();template['file']='../../plugins/twikiimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_twikiimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_twikiimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1) 
     1tinyMCE.importPluginLanguagePack('foswikiimage');var TinyMCE_FoswikiImagePlugin={getInfo:function(){return{longname:'Foswiki image',author:'WikiRing, from Moxiecode Systems AB original',authorurl:'http://wikiring.com',infourl:'http://foswiki.org/cgi-bin/view/Plugins/TinyMCEPlugin',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"image":return tinyMCE.getButtonHTML(cn,'lang_image_desc','{$themeurl}/images/image.gif','mceAdvImage');} 
     2return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvImage":var template=new Array();template['file']='../../plugins/foswikiimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_foswikiimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_foswikiimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1) 
    33return true;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;} 
    4 return false;},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":var imgs=content.getElementsByTagName("img"),src,i;for(i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){src=eval(tinyMCE.settings['twikipuburl_callback'] 
     4return false;},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":var imgs=content.getElementsByTagName("img"),src,i;for(i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){src=eval(tinyMCE.settings['foswikipuburl_callback'] 
    55+"(src);");imgs[i].setAttribute('onmouseover',"this.src='" 
    66+src+"';");} 
    7 if((src=this._getImageSrc(onmouseout))!=""){src=eval(tinyMCE.settings['twikipuburl_callback'] 
     7if((src=this._getImageSrc(onmouseout))!=""){src=eval(tinyMCE.settings['foswikipuburl_callback'] 
    88+"(src);");imgs[i].setAttribute('onmouseout',"this.src='" 
    99+src+"';");}} 
    10 break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){src=eval(tinyMCE.settings['twikipuburl_callback'] 
     10break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){src=eval(tinyMCE.settings['foswikipuburl_callback'] 
    1111+"(src);");imgs[i].setAttribute('onmouseover',"this.src='" 
    1212+src+"';");} 
    13 if((src=this._getImageSrc(onmouseout))!=""){src=eval(tinyMCE.settings['twikipuburl_callback'] 
     13if((src=this._getImageSrc(onmouseout))!=""){src=eval(tinyMCE.settings['foswikipuburl_callback'] 
    1414+"(src, null, true);");imgs[i].setAttribute('onmouseout',"this.src='" 
    1515+src+"';");}} 
    1616break;} 
    1717return content;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null) 
    18 return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_twikiimage','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_twikiimage','mceButtonNormal');return true;},_getImageSrc:function(s){var sr,p=-1;if(!s) 
     18return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_foswikiimage','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_foswikiimage','mceButtonNormal');return true;},_getImageSrc:function(s){var sr,p=-1;if(!s) 
    1919return"";if((p=s.indexOf('this.src='))!=-1){sr=s.substring(p+10);sr=sr.substring(0,sr.indexOf('\''));return sr;} 
    20 return"";}};tinyMCE.addPlugin("twikiimage",TinyMCE_TWikiImagePlugin); 
     20return"";}};tinyMCE.addPlugin("foswikiimage",TinyMCE_FoswikiImagePlugin); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/editor_plugin_src.js

    r14 r1043  
    99 
    1010/* Import plugin specific language pack */ 
    11 tinyMCE.importPluginLanguagePack('twikiimage'); 
     11tinyMCE.importPluginLanguagePack('foswikiimage'); 
    1212 
    13 var TinyMCE_TWikiImagePlugin = { 
     13var TinyMCE_FoswikiImagePlugin = { 
    1414        getInfo : function() { 
    1515                return { 
    16                         longname : 'TWiki image', 
     16                        longname : 'Foswiki image', 
    1717                        author : 'WikiRing, from Moxiecode Systems AB original', 
    1818                        authorurl : 'http://wikiring.com', 
    19                         infourl : 'http://twiki.org/cgi-bin/view/Plugins/TinyMCEPlugin', 
     19                        infourl : 'http://foswiki.org/cgi-bin/view/Plugins/TinyMCEPlugin', 
    2020                        version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion 
    2121                }; 
     
    3939                                var template = new Array(); 
    4040 
    41                                 template['file']   = '../../plugins/twikiimage/image.htm'; 
     41                                template['file']   = '../../plugins/foswikiimage/image.htm'; 
    4242                                template['width']  = 480; 
    4343                                template['height'] = 380; 
     
    4545                                // Language specific width and height addons 
    4646                                template['width']  += tinyMCE.getLang( 
    47                     'lang_twikiimage_delta_width', 0); 
     47                    'lang_foswikiimage_delta_width', 0); 
    4848                                template['height'] += tinyMCE.getLang( 
    49                     'lang_twikiimage_delta_height', 0); 
     49                    'lang_foswikiimage_delta_height', 0); 
    5050 
    5151                                var inst = tinyMCE.getInstanceById(editor_id); 
     
    7676 
    7777                                        if ((src = this._getImageSrc(onmouseover)) != "") { 
    78                         src = eval(tinyMCE.settings['twikipuburl_callback'] 
     78                        src = eval(tinyMCE.settings['foswikipuburl_callback'] 
    7979                                   + "(src);"); 
    8080 
     
    8484 
    8585                                        if ((src = this._getImageSrc(onmouseout)) != "") { 
    86                         src = eval(tinyMCE.settings['twikipuburl_callback'] 
     86                        src = eval(tinyMCE.settings['foswikipuburl_callback'] 
    8787                                   + "(src);"); 
    8888 
     
    102102 
    103103                                        if ((src = this._getImageSrc(onmouseover)) != "") { 
    104                         src = eval(tinyMCE.settings['twikipuburl_callback'] 
     104                        src = eval(tinyMCE.settings['foswikipuburl_callback'] 
    105105                                   + "(src);"); 
    106106 
     
    110110 
    111111                                        if ((src = this._getImageSrc(onmouseout)) != "") { 
    112                         src = eval(tinyMCE.settings['twikipuburl_callback'] 
     112                        src = eval(tinyMCE.settings['foswikipuburl_callback'] 
    113113                                   + "(src, null, true);"); 
    114114 
     
    131131                        if (node.nodeName == "IMG" && 
    132132                tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) { 
    133                                 tinyMCE.switchClass(editor_id + '_twikiimage', 
     133                                tinyMCE.switchClass(editor_id + '_foswikiimage', 
    134134                                    'mceButtonSelected'); 
    135135                                return true; 
     
    137137                } while ((node = node.parentNode)); 
    138138 
    139                 tinyMCE.switchClass(editor_id + '_twikiimage', 'mceButtonNormal'); 
     139                tinyMCE.switchClass(editor_id + '_foswikiimage', 'mceButtonNormal'); 
    140140 
    141141                return true; 
     
    166166}; 
    167167 
    168 tinyMCE.addPlugin("twikiimage", TinyMCE_TWikiImagePlugin); 
     168tinyMCE.addPlugin("foswikiimage", TinyMCE_FoswikiImagePlugin); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/image.htm

    r14 r1043  
    99        <base target="_self" /> 
    1010</head> 
    11 <body id="twikiimage" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none"> 
     11<body id="foswikiimage" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none"> 
    1212    <form onsubmit="insertAction();return false;" action="#">  
    1313                <div class="tabs"> 
    1414                        <ul> 
    15                                 <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_twikiimage_tab_general}</a></span></li> 
    16                                 <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{$lang_twikiimage_tab_appearance}</a></span></li> 
    17                                 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_twikiimage_tab_advanced}</a></span></li> 
     15                                <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_foswikiimage_tab_general}</a></span></li> 
     16                                <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{$lang_foswikiimage_tab_appearance}</a></span></li> 
     17                                <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_foswikiimage_tab_advanced}</a></span></li> 
    1818                        </ul> 
    1919                </div> 
     
    2222                        <div id="general_panel" class="panel current"> 
    2323                                <fieldset> 
    24                                                 <legend>{$lang_twikiimage_general}</legend> 
     24                                                <legend>{$lang_foswikiimage_general}</legend> 
    2525 
    2626                                                <table class="properties"> 
     
    3434                                                                  </table></td> 
    3535                                                                <td colspan="2"> 
    36                                                                     {$lang_twikiimage_img_url_help} 
     36                                                                    {$lang_foswikiimage_img_url_help} 
    3737                                                                </td> 
    3838                                                        </tr> 
     
    4646                                                        </tr>  
    4747                                                        <tr>  
    48                                                                 <td class="column1"><label id="titlelabel" for="title">{$lang_twikiimage_title}</label></td>  
     48                                                                <td class="column1"><label id="titlelabel" for="title">{$lang_foswikiimage_title}</label></td>  
    4949                                                                <td colspan="2"><input id="title" name="title" type="text" value="" /></td>  
    5050                                                        </tr> 
     
    5353 
    5454                                <fieldset> 
    55                                         <legend>{$lang_twikiimage_preview}</legend> 
     55                                        <legend>{$lang_foswikiimage_preview}</legend> 
    5656                                        <div id="prev"></div> 
    5757                                </fieldset> 
     
    6060                        <div id="appearance_panel" class="panel"> 
    6161                                <fieldset> 
    62                                         <legend>{$lang_twikiimage_tab_appearance}</legend> 
     62                                        <legend>{$lang_foswikiimage_tab_appearance}</legend> 
    6363 
    6464                                        <table border="0" cellpadding="4" cellspacing="0"> 
     
    8080                                                        <td rowspan="6" valign="top"> 
    8181                                                                <div class="alignPreview"> 
    82                                                                         <img id="alignSampleImg" src="images/sample.gif" alt="{$lang_twikiimage_example_img}" /> 
     82                                                                        <img id="alignSampleImg" src="images/sample.gif" alt="{$lang_foswikiimage_example_img}" /> 
    8383                                                                        Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam 
    8484                                                                        nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum 
     
    102102                                                                        <tr> 
    103103                                                                                <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td> 
    104                                                                                 <td><label id="constrainlabel" for="constrain">{$lang_twikiimage_constrain_proportions}</label></td> 
     104                                                                                <td><label id="constrainlabel" for="constrain">{$lang_foswikiimage_constrain_proportions}</label></td> 
    105105                                                                        </tr> 
    106106                                                                </table></td> 
     
    133133 
    134134                                                <tr> 
    135                                                         <td class="column1"><label id="stylelabel" for="style">{$lang_twikiimage_style}</label></td>  
     135                                                        <td class="column1"><label id="stylelabel" for="style">{$lang_foswikiimage_style}</label></td>  
    136136                                                        <td colspan="2"><input id="style" name="style" type="text" value="" onchange="styleUpdated();" /></td>  
    137137                                                </tr> 
    138138 
    139139                                                <!-- <tr> 
    140                                                         <td class="column1"><label id="classeslabel" for="classes">{$lang_twikiimage_classes}</label></td>  
     140                                                        <td class="column1"><label id="classeslabel" for="classes">{$lang_foswikiimage_classes}</label></td>  
    141141                                                        <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>  
    142142                                                </tr> --> 
     
    147147                        <div id="advanced_panel" class="panel"> 
    148148                                <fieldset> 
    149                                         <legend>{$lang_twikiimage_swap_image}</legend> 
     149                                        <legend>{$lang_foswikiimage_swap_image}</legend> 
    150150 
    151151                                        <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="changeMouseMove();" /> 
    152                                         <label id="onmousemovechecklabel" for="onmousemovecheck">{$lang_twikiimage_alt_image}</label> 
     152                                        <label id="onmousemovechecklabel" for="onmousemovecheck">{$lang_foswikiimage_alt_image}</label> 
    153153 
    154154                                        <table border="0" cellpadding="4" cellspacing="0" width="100%"> 
    155155                                                        <tr> 
    156                                                                 <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{$lang_twikiimage_mouseover}</label></td>  
     156                                                                <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{$lang_foswikiimage_mouseover}</label></td>  
    157157                                                                <td><table border="0" cellspacing="0" cellpadding="0">  
    158158                                                                        <tr>  
     
    167167                                                        </tr> 
    168168                                                        <tr>  
    169                                                                 <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{$lang_twikiimage_mouseout}</label></td>  
     169                                                                <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{$lang_foswikiimage_mouseout}</label></td>  
    170170                                                                <td class="column2"><table border="0" cellspacing="0" cellpadding="0">  
    171171                                                                        <tr>  
     
    183183 
    184184                                <fieldset> 
    185                                         <legend>{$lang_twikiimage_misc}</legend> 
     185                                        <legend>{$lang_foswikiimage_misc}</legend> 
    186186 
    187187                                        <table border="0" cellpadding="4" cellspacing="0"> 
    188188                                                <tr> 
    189                                                         <td class="column1"><label id="idlabel" for="id">{$lang_twikiimage_id}</label></td>  
     189                                                        <td class="column1"><label id="idlabel" for="id">{$lang_foswikiimage_id}</label></td>  
    190190                                                        <td><input id="id" name="id" type="text" value="" /></td>  
    191191                                                </tr> 
    192192 
    193193                                                <tr> 
    194                                                         <td class="column1"><label id="dirlabel" for="dir">{$lang_twikiimage_langdir}</label></td>  
     194                                                        <td class="column1"><label id="dirlabel" for="dir">{$lang_foswikiimage_langdir}</label></td>  
    195195                                                        <td> 
    196196                                                                <select id="dir" name="dir" onchange="changeAppearance();">  
    197197                                                                                <option value="">{$lang_not_set}</option>  
    198                                                                                 <option value="ltr">{$lang_twikiimage_ltr}</option>  
    199                                                                                 <option value="rtl">{$lang_twikiimage_rtl}</option>  
     198                                                                                <option value="ltr">{$lang_foswikiimage_ltr}</option>  
     199                                                                                <option value="rtl">{$lang_foswikiimage_rtl}</option>  
    200200                                                                </select> 
    201201                                                        </td>  
     
    203203 
    204204                                                <tr> 
    205                                                         <td class="column1"><label id="langlabel" for="lang">{$lang_twikiimage_langcode}</label></td>  
     205                                                        <td class="column1"><label id="langlabel" for="lang">{$lang_foswikiimage_langcode}</label></td>  
    206206                                                        <td> 
    207207                                                                <input id="lang" name="lang" type="text" value="" /> 
     
    210210 
    211211                                                <tr> 
    212                                                         <td class="column1"><label id="usemaplabel" for="usemap">{$lang_twikiimage_image_map}</label></td>  
     212                                                        <td class="column1"><label id="usemaplabel" for="usemap">{$lang_foswikiimage_image_map}</label></td>  
    213213                                                        <td> 
    214214                                                                <input id="usemap" name="usemap" type="text" value="" /> 
     
    217217 
    218218                                                <tr> 
    219                                                         <td class="column1"><label id="longdesclabel" for="longdesc">{$lang_twikiimage_long_desc}</label></td> 
     219                                                        <td class="column1"><label id="longdesclabel" for="longdesc">{$lang_foswikiimage_long_desc}</label></td> 
    220220                                                        <td><table border="0" cellspacing="0" cellpadding="0"> 
    221221                                                                        <tr> 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/jscripts/functions.js

    r14 r1043  
    33+url+'"></sc'+'ript>');}} 
    44function pubURL(url,node,on_save){return eval("tinyMCEPopup.windowOpener." 
    5 +tinyMCE.settings['twikipuburl_callback'] 
     5+tinyMCE.settings['foswikipuburl_callback'] 
    66+"(url, node, on_save);");} 
    77function getImageSrc(str){var pos=-1;if(!str) 
     
    1515document.getElementById("imagelistovercontainer").innerHTML=html;html=getImageListHTML('imagelistout','onmouseoutsrc');if(html=="") 
    1616document.getElementById("imagelistoutrow").style.display='none';else 
    17 document.getElementById("imagelistoutcontainer").innerHTML=html;html=getBrowserHTML('srcbrowser','src','image','twikiimage');document.getElementById("srcbrowsercontainer").innerHTML=html;html=getBrowserHTML('oversrcbrowser','onmouseoversrc','image','twikiimage');document.getElementById("onmouseoversrccontainer").innerHTML=html;html=getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','twikiimage');document.getElementById("onmouseoutsrccontainer").innerHTML=html;html=getBrowserHTML('longdescbrowser','longdesc','file','twikiimage');document.getElementById("longdesccontainer").innerHTML=html;if(isVisible('srcbrowser')) 
     17document.getElementById("imagelistoutcontainer").innerHTML=html;html=getBrowserHTML('srcbrowser','src','image','foswikiimage');document.getElementById("srcbrowsercontainer").innerHTML=html;html=getBrowserHTML('oversrcbrowser','onmouseoversrc','image','foswikiimage');document.getElementById("onmouseoversrccontainer").innerHTML=html;html=getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','foswikiimage');document.getElementById("onmouseoutsrccontainer").innerHTML=html;html=getBrowserHTML('longdescbrowser','longdesc','file','foswikiimage');document.getElementById("longdesccontainer").innerHTML=html;if(isVisible('srcbrowser')) 
    1818document.getElementById('src').style.width='260px';if(isVisible('oversrcbrowser')) 
    1919document.getElementById('onmouseoversrc').style.width='260px';if(isVisible('outsrcbrowser')) 
     
    2727orgImageHeight=trimSize(getStyle(elm,'height'));formObj.src.value=src;formObj.alt.value=tinyMCE.getAttrib(elm,'alt');formObj.title.value=tinyMCE.getAttrib(elm,'title');formObj.border.value=trimSize(getStyle(elm,'border','borderWidth'));formObj.vspace.value=tinyMCE.getAttrib(elm,'vspace');formObj.hspace.value=tinyMCE.getAttrib(elm,'hspace');formObj.width.value=orgImageWidth;formObj.height.value=orgImageHeight;formObj.onmouseoversrc.value=onmouseoversrc;formObj.onmouseoutsrc.value=onmouseoutsrc;formObj.id.value=tinyMCE.getAttrib(elm,'id');formObj.dir.value=tinyMCE.getAttrib(elm,'dir');formObj.lang.value=tinyMCE.getAttrib(elm,'lang');formObj.longdesc.value=tinyMCE.getAttrib(elm,'longdesc');formObj.usemap.value=tinyMCE.getAttrib(elm,'usemap');formObj.style.value=tinyMCE.serializeStyle(style);if(tinyMCE.isMSIE) 
    2828selectByValue(formObj,'align',getStyle(elm,'align','styleFloat'));else 
    29 selectByValue(formObj,'align',getStyle(elm,'align','cssFloat'));addClassesToList('classlist','twikiimage_styles');selectByValue(formObj,'classlist',tinyMCE.getAttrib(elm,'class'));selectByValue(formObj,'imagelistsrc',src);selectByValue(formObj,'imagelistover',onmouseoversrc);selectByValue(formObj,'imagelistout',onmouseoutsrc);updateStyle();showPreviewImage(src,true);changeAppearance();window.focus();}else 
    30 addClassesToList('classlist','twikiimage_styles');if(tinyMCE.getParam("twikiimage_constrain_proportions",true)) 
     29selectByValue(formObj,'align',getStyle(elm,'align','cssFloat'));addClassesToList('classlist','foswikiimage_styles');selectByValue(formObj,'classlist',tinyMCE.getAttrib(elm,'class'));selectByValue(formObj,'imagelistsrc',src);selectByValue(formObj,'imagelistover',onmouseoversrc);selectByValue(formObj,'imagelistout',onmouseoutsrc);updateStyle();showPreviewImage(src,true);changeAppearance();window.focus();}else 
     30addClassesToList('classlist','foswikiimage_styles');if(tinyMCE.getParam("foswikiimage_constrain_proportions",true)) 
    3131formObj.constrain.checked=true;if(formObj.onmouseoversrc.value!=""||formObj.onmouseoutsrc.value!="") 
    3232setSwapImageDisabled(false);else 
     
    4949return"";value=value.replace(/&/g,'&amp;');value=value.replace(/\"/g,'&quot;');value=value.replace(/</g,'&lt;');value=value.replace(/>/g,'&gt;');return' '+attrib+'="'+value+'"';} 
    5050function insertAction(){var inst=tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));var elm=inst.getFocusElement();var formObj=document.forms[0];var src=pubURL(formObj.src.value,tinyMCE.imgElement);var onmouseoversrc=formObj.onmouseoversrc.value;var onmouseoutsrc=formObj.onmouseoutsrc.value;if(!AutoValidator.validate(formObj)){alert(tinyMCE.getLang('lang_invalid_data'));return false;} 
    51 if(tinyMCE.getParam("accessibility_warnings")){if(formObj.alt.value==""&&!confirm(tinyMCE.getLang('lang_twikiimage_missing_alt','',true))) 
     51if(tinyMCE.getParam("accessibility_warnings")){if(formObj.alt.value==""&&!confirm(tinyMCE.getLang('lang_foswikiimage_missing_alt','',true))) 
    5252return;} 
    5353if(onmouseoversrc&&onmouseoversrc!="") 
     
    7979return;var temp=(parseInt(formObj.height.value)/parseInt(preloadImg.height))*preloadImg.width;formObj.width.value=temp.toFixed(0);updateStyle();} 
    8080function onSelectMainImage(target_form_element,name,value){var formObj=document.forms[0];formObj.alt.value=name;formObj.title.value=name;resetImageData();showPreviewImage(formObj.elements[target_form_element].value,false);} 
    81 function showPreviewImage(src,start){var formObj=document.forms[0];selectByValue(document.forms[0],'imagelistsrc',src);var elm=document.getElementById('prev');var src=pubURL(src,null,false);if(!start&&tinyMCE.getParam("twikiimage_update_dimensions_onchange",true)) 
     81function showPreviewImage(src,start){var formObj=document.forms[0];selectByValue(document.forms[0],'imagelistsrc',src);var elm=document.getElementById('prev');var src=pubURL(src,null,false);if(!start&&tinyMCE.getParam("foswikiimage_update_dimensions_onchange",true)) 
    8282resetImageData();if(src=="") 
    8383elm.innerHTML="";else 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/jscripts/functions_src.js

    r14 r1043  
    1 /* Functions for the twikiimage plugin popup */ 
     1/* Functions for the foswikiimage plugin popup */ 
    22 
    33var preloadImg = null; 
     
    2222function pubURL(url, node, on_save) { 
    2323        return eval("tinyMCEPopup.windowOpener." 
    24                 + tinyMCE.settings['twikipuburl_callback'] 
     24                + tinyMCE.settings['foswikipuburl_callback'] 
    2525                + "(url, node, on_save);"); 
    2626} 
     
    7777 
    7878        // Src browser 
    79         html = getBrowserHTML('srcbrowser','src','image','twikiimage'); 
     79        html = getBrowserHTML('srcbrowser','src','image','foswikiimage'); 
    8080        document.getElementById("srcbrowsercontainer").innerHTML = html; 
    8181 
    8282        // Over browser 
    8383        html = getBrowserHTML('oversrcbrowser', 'onmouseoversrc', 'image', 
    84                           'twikiimage'); 
     84                          'foswikiimage'); 
    8585        document.getElementById("onmouseoversrccontainer").innerHTML = html; 
    8686 
    8787        // Out browser 
    8888        html = getBrowserHTML('outsrcbrowser', 'onmouseoutsrc', 
    89                           'image', 'twikiimage'); 
     89                          'image', 'foswikiimage'); 
    9090        document.getElementById("onmouseoutsrccontainer").innerHTML = html; 
    9191 
    9292        // Longdesc browser 
    93         html = getBrowserHTML('longdescbrowser','longdesc','file','twikiimage'); 
     93        html = getBrowserHTML('longdescbrowser','longdesc','file','foswikiimage'); 
    9494        document.getElementById("longdesccontainer").innerHTML = html; 
    9595 
     
    172172                              elm, 'align', 'cssFloat')); 
    173173 
    174                 addClassesToList('classlist', 'twikiimage_styles'); 
     174                addClassesToList('classlist', 'foswikiimage_styles'); 
    175175 
    176176                selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class')); 
     
    185185                window.focus(); 
    186186        } else 
    187                 addClassesToList('classlist', 'twikiimage_styles'); 
     187                addClassesToList('classlist', 'foswikiimage_styles'); 
    188188 
    189189        // If option enabled default contrain proportions to checked 
    190         if (tinyMCE.getParam("twikiimage_constrain_proportions", true)) 
     190        if (tinyMCE.getParam("foswikiimage_constrain_proportions", true)) 
    191191                formObj.constrain.checked = true; 
    192192 
     
    300300        if (tinyMCE.getParam("accessibility_warnings")) { 
    301301                if (formObj.alt.value == "" && 
    302             !confirm(tinyMCE.getLang('lang_twikiimage_missing_alt', '', true))) 
     302            !confirm(tinyMCE.getLang('lang_foswikiimage_missing_alt', '', true))) 
    303303                        return; 
    304304        } 
     
    500500        var src = pubURL(src, null, false); 
    501501 
    502         if (!start && tinyMCE.getParam("twikiimage_update_dimensions_onchange", 
     502        if (!start && tinyMCE.getParam("foswikiimage_update_dimensions_onchange", 
    503503                                   true)) 
    504504                resetImageData(); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/langs/en.js

    r14 r1043  
    11// UK lang variables 
    22 
    3 tinyMCE.addToLang('twikiimage',{ 
     3tinyMCE.addToLang('foswikiimage',{ 
    44tab_general : 'General', 
    55tab_appearance : 'Appearance', 
     
    2424misc : 'Miscellaneous', 
    2525example_img : 'Appearance&nbsp;preview&nbsp;image', 
    26 missing_alt : 'Are you sure you want to continue without including an Image description? Without  it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the TWiki with images turned off.', 
    27 img_url_help : 'Enter a full URL, or the simple name of an attachment on this topic. You can use TWiki variables.' 
     26missing_alt : 'Are you sure you want to continue without including an Image description? Without  it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing with images turned off.', 
     27img_url_help : 'Enter a full URL, or the simple name of an attachment on this topic. You can use Foswiki macros.' 
    2828}); 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikiimage/readme.txt

    r14 r1043  
    11Derived from advimage; check the documentation on that plugin. 
    22 
    3 This derived version handles TWiki topic names entered into the 
     3This derived version handles Foswiki topic names entered into the 
    44dialog. 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/tiny_mce_src.js

    r14 r1043  
    11641164                                // Fixes odd MSIE bug where drag/droping elements in a iframe with height 100% breaks 
    11651165                                // This logic forces the width/height to be in pixels while the user is drag/dropping 
    1166 // NOTE: Disabled for TWiki; identified as the source of Item4506 
     1166// NOTE: Disabled for Foswiki; identified as the source of Item4506 
    11671167//                              if (tinyMCE.isRealIE) { 
    11681168//                                      var ife = tinyMCE.selectedInstance.iframeElement; 
  • trunk/WysiwygPlugin/data/System/WysiwygPlugin.txt

    r1022 r1043  
    188188| See Subversion logs for earlier revisions || 
    189189|  Dependencies: | %$DEPENDENCIES% | 
    190 |  Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/%TOPIC% | 
    191 |  Feedback: | Foswiki:Extensions/%TOPIC%Dev | 
    192 |  Appraisal: | http://twiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | 
    193  
    194 __Related Topics:__ %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences, [[%SYSTEMWEB%.Plugins][Plugins]] 
     190|  Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 
    195191 
    196192<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the Dev topic instead. --> 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin.pm

    r1039 r1043  
    99 
    1010Note: In the case of a new topic, you might expect to see the "create topic" 
    11 screen in the editor when it goes back to twiki for the topic content. This 
     11screen in the editor when it goes back to Foswiki for the topic content. This 
    1212doesn't happen because the earliest possible handler is called on the topic 
    1313content and not the template. The template is effectively ignored and a blank 
     
    3030use Encode; 
    3131 
    32 require Foswiki::Func;    # The plugins API 
    33 require Foswiki::Plugins; # For the API version 
    34 require Foswiki::Plugins::WysiwygPlugin::Constants; 
     32use Foswiki::Func;    # The plugins API 
     33use Foswiki::Plugins; # For the API version 
     34use Foswiki::Plugins::WysiwygPlugin::Constants; 
    3535 
    3636use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $SECRET_ID $NO_PREFS_IN_TOPIC ); 
     
    4545 
    4646$SECRET_ID = 'WYSIWYG content - do not remove this comment, and never use this identical text in your topics'; 
     47 
     48sub WHY { 1 }; 
    4749 
    4850sub initPlugin { 
     
    495497    if( $exclusions =~ /calls/ 
    496498          && $_[0] =~ /%((?!($calls_ok){)[A-Z_]+{.*?})%/s ) { 
    497         #print STDERR "WYSIWYG_DEBUG: has calls $1 (not in $calls_ok)\n"; 
     499        print STDERR "WYSIWYG_DEBUG: has calls $1 (not in $calls_ok)\n" 
     500          if (WHY); 
    498501        return "Text contains calls"; 
    499502    } 
    500503    if( $exclusions =~ /(macros|variables)/ && $_[0] =~ /%([A-Z_]+)%/s ) { 
    501         #print STDERR "$exclusions WYSIWYG_DEBUG: has macros $1\n"; 
     504        print STDERR "$exclusions WYSIWYG_DEBUG: has macros $1\n" 
     505          if (WHY); 
    502506        return "Text contains macros"; 
    503507    } 
    504508    if( $exclusions =~ /html/ && 
    505509          $_[0] =~ /<\/?((?!literal|verbatim|noautolink|nop|br)\w+)/ ) { 
    506         #print STDERR "WYSIWYG_DEBUG: has html: $1\n"; 
     510        print STDERR "WYSIWYG_DEBUG: has html: $1\n" 
     511          if (WHY); 
    507512        return "Text contains HTML"; 
    508513    } 
    509514    if( $exclusions =~ /comments/ && $_[0] =~ /<[!]--/ ) { 
    510         #print STDERR "WYSIWYG_DEBUG: has comments\n"; 
     515        print STDERR "WYSIWYG_DEBUG: has comments\n" 
     516          if (WHY); 
    511517        return "Text contains comments"; 
    512518    } 
    513519    if( $exclusions =~ /pre/ && $_[0] =~ /<pre\w/ ) { 
    514         #print STDERR "WYSIWYG_DEBUG: has pre\n"; 
     520        print STDERR "WYSIWYG_DEBUG: has pre\n" 
     521          if (WHY); 
    515522        return "Text contains PRE"; 
    516523    } 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm

    r811 r1043  
    11#package Foswiki::Plugins::WysiwygPlugin::Constants; 
    22# Use s simpler-named namespace for constants to improve code readability 
    3 package WC; 
     3package Foswiki::Plugins::WysiwygPlugin::Constants; 
    44 
    55use strict; 
     
    302302} 
    303303 
     304# Create shorter alias for other modules 
     305no strict 'refs'; 
     306*{'WC::'} = \*{'Foswiki::Plugins::WysiwygPlugin::Constants::'}; 
     307 
    3043081; 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML.pm

    r811 r1043  
    4343use strict; 
    4444 
    45 require Encode; 
    46 require HTML::Parser; 
    47 require HTML::Entities; 
    48  
    49 require Foswiki::Plugins::WysiwygPlugin::HTML2TML::Node; 
    50 require Foswiki::Plugins::WysiwygPlugin::HTML2TML::Leaf; 
     45use Encode; 
     46use HTML::Parser; 
     47use HTML::Entities; 
     48 
     49use Foswiki::Plugins::WysiwygPlugin::HTML2TML::Node; 
     50use Foswiki::Plugins::WysiwygPlugin::HTML2TML::Leaf; 
    5151 
    5252=pod 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm

    r811 r1043  
    4343use vars qw( $reww ); 
    4444 
    45 require Foswiki::Plugins::WysiwygPlugin::Constants; 
    46 require Foswiki::Plugins::WysiwygPlugin::HTML2TML::WC; 
     45use Foswiki::Plugins::WysiwygPlugin::Constants; 
     46use Foswiki::Plugins::WysiwygPlugin::HTML2TML::WC; 
    4747 
    4848=pod 
     
    617617        my $t; 
    618618        my $grandkid = $kid->{head}; 
    619         # IE generates spurious empty divs inside LIs. Detect and skip 
    620         # them. 
    621         if( $grandkid->{tag} =~ /^div$/i 
    622               && $grandkid == $kid->{tail} 
    623                 && scalar(keys %{$this->{attrs}}) == 0 ) { 
    624             $grandkid = $grandkid->{head}; 
    625         } 
    626         while ($grandkid) { 
    627             if( $grandkid->{tag} =~ /^[dou]l$/i ) { 
    628                 #$spawn = _trim( $spawn ); 
    629                 $t = $grandkid->_convertList( $indent.$WC::TAB ); 
    630             } else { 
    631                 ( $f, $t ) = $grandkid->generate( $WC::NO_BLOCK_TML ); 
    632                 $t =~ s/$WC::CHECKn/ /g; 
    633                 # Item5257: If this is the last child of the LI, trim 
    634                 # trailing spaces. Otherwise spaces generated by the 
    635                 # editor before the </li> will be appended to the line. 
    636                 # It is safe to remove them, as TML never depends on 
    637                 # these spaces. If there are any intentional spaces at 
    638                 # the end of protected content, these will have been 
    639                 # converted to &nbsp; and protected that way. 
    640                 $t =~ s/\s+$// unless $grandkid->{next}; 
    641             } 
    642             $spawn .= $t; 
    643             $grandkid = $grandkid->{next}; 
     619        if ($grandkid) { 
     620            # IE generates spurious empty divs inside LIs. Detect and skip 
     621            # them. 
     622            if( $grandkid->{tag} && $grandkid->{tag} =~ /^div$/i 
     623                  && $grandkid == $kid->{tail} 
     624                    && scalar(keys %{$this->{attrs}}) == 0 ) { 
     625                $grandkid = $grandkid->{head}; 
     626            } 
     627            while ($grandkid) { 
     628                if( $grandkid->{tag} && $grandkid->{tag} =~ /^[dou]l$/i ) { 
     629                    #$spawn = _trim( $spawn ); 
     630                    $t = $grandkid->_convertList( $indent.$WC::TAB ); 
     631                } else { 
     632                    ( $f, $t ) = $grandkid->generate( $WC::NO_BLOCK_TML ); 
     633                    $t =~ s/$WC::CHECKn/ /g; 
     634                    # Item5257: If this is the last child of the LI, trim 
     635                    # trailing spaces. Otherwise spaces generated by the 
     636                    # editor before the </li> will be appended to the line. 
     637                    # It is safe to remove them, as TML never depends on 
     638                    # these spaces. If there are any intentional spaces at 
     639                    # the end of protected content, these will have been 
     640                    # converted to &nbsp; and protected that way. 
     641                    $t =~ s/\s+$// unless $grandkid->{next}; 
     642                } 
     643                $spawn .= $t; 
     644                $grandkid = $grandkid->{next}; 
     645            } 
    644646        } 
    645647        #$spawn = _trim($spawn); 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm

    r811 r1043  
    3535package Foswiki::Plugins::WysiwygPlugin::TML2HTML; 
    3636 
     37use CGI qw( -any ); 
     38 
     39use Foswiki; 
     40use Foswiki::Plugins::WysiwygPlugin::Constants; 
     41 
    3742use strict; 
    38 use CGI qw( -any ); 
    39  
    40 require Foswiki; 
    41 require Foswiki::Plugins::WysiwygPlugin::Constants; 
    4243 
    4344my $TT0 = chr(0); 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/build.pl

    r811 r1043  
    44# 
    55BEGIN { 
    6   foreach my $pc (split(/:/, $ENV{TWIKI_LIBS} || '')) { 
    7     unshift @INC, $pc; 
    8   } 
     6    unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); 
    97} 
    108 
    119use Foswiki::Contrib::Build; 
    1210 
    13 # Declare our build package 
    14 { package WysiwygPluginBuild; 
    15  
    16   @WysiwygPluginBuild::ISA = ( "Foswiki::Contrib::Build" ); 
    17  
    18   sub new { 
    19     my $class = shift; 
    20     return bless( $class->SUPER::new( "WysiwygPlugin" ), $class ); 
    21   } 
    22 } 
    23  
    2411# Create the build object 
    25 $build = new WysiwygPluginBuild(); 
     12$build = new Foswiki::Contrib::Build('WysiwygPlugin'); 
    2613 
    2714# Build the target on the command line, or the default target 
  • trunk/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm

    r974 r1043  
    2626# 
    2727package TranslatorTests; 
    28 use base qw(TWikiTestCase); 
     28use base qw(FoswikiTestCase); 
    2929 
    3030use strict; 
     
    5858# test both, anything else to skin the test. 
    5959# name => identifier (used to compose the testcase function name) 
    60 # tml => source TWiki meta-language 
     60# tml => source topic meta-language 
    6161# html => expected html from expanding tml 
    6262# finaltml => optional expected tml from translating html. If not there, 
     
    15351535<verbatim>U 
    15361536</verbatim> 
    1537  
    15381537L 
    15391538HERE 
  • trunk/WysiwygPlugin/test/unit/WysiwygPlugin/WysiwygPluginTests.pm

    r811 r1043  
    1919# 
    2020package WysiwygPluginTests; 
    21 use base 'TWikiFnTestCase'; 
    22  
    23 use strict; 
     21use base 'FoswikiFnTestCase'; 
    2422 
    2523use Unit::Request; 
     
    2826use Foswiki::Plugins::WysiwygPlugin; 
    2927 
     28use strict; 
    3029use Carp; 
    3130 
     
    123122    }); 
    124123 
    125     my $twiki = new Foswiki('guest', $query ); 
    126         $twiki->{response}->charset($charset) if $charset; 
     124    my $foswiki = new Foswiki('guest', $query ); 
     125        $foswiki->{response}->charset($charset) if $charset; 
    127126 
    128127    my ($out, $result) = $this->capture( 
    129128        \&Foswiki::Plugins::WysiwygPlugin::_restTML2HTML, 
    130         $twiki, undef, undef, $twiki->{response}); 
     129        $foswiki, undef, undef, $foswiki->{response}); 
    131130 
    132131    $this->assert(!$result, $result); 
     
    142141 
    143142    require Foswiki::Plugins::WysiwygPlugin::Constants; 
    144     WC::mapUnicode2HighBit($out); 
     143    Foswiki::Plugins::WysiwygPlugin::Constants::mapUnicode2HighBit($out); 
    145144 
    146145    $this->assert($text eq $out, "'".anal($out)."' !=\n'".anal($text)."'"); 
     
    164163    }); 
    165164 
    166     my $twiki = new Foswiki('guest', $query ); 
    167         $twiki->{response}->charset($charset) if $charset; 
     165    my $foswiki = new Foswiki('guest', $query ); 
     166        $foswiki->{response}->charset($charset) if $charset; 
    168167 
    169168    my ($out, $result) = $this->capture( 
    170169        \&Foswiki::Plugins::WysiwygPlugin::_restHTML2TML, 
    171         $twiki, undef, undef, $twiki->{response}); 
     170        $foswiki, undef, undef, $foswiki->{response}); 
    172171 
    173172    $this->assert(!$result, $result); 
     
    180179 
    181180    require Foswiki::Plugins::WysiwygPlugin::Constants; 
    182     WC::mapUnicode2HighBit($out); 
     181    Foswiki::Plugins::WysiwygPlugin::Constants::mapUnicode2HighBit($out); 
    183182 
    184183    $out =~ s/\s*$//s; 
  • trunk/WysiwygPlugin/tools/tml2html.pl

    r811 r1043  
    66 
    77do '../bin/setlib.cfg'; 
    8 require Foswiki::Plugins::WysiwygPlugin::TML2HTML; 
     8use Foswiki::Plugins::WysiwygPlugin::TML2HTML; 
    99my $conv = new Foswiki::Plugins::WysiwygPlugin::TML2HTML(); 
    1010undef $/; 
Note: See TracChangeset for help on using the changeset viewer.