Changeset 5316


Ignore:
Timestamp:
10/18/09 09:56:27 (2 years ago)
Author:
PaulHarvey
Message:

Item2270: Fix incorrect wordcount (always 6 words) when users first enter edit mode

Location:
trunk/TinyMCEPlugin
Files:
3 edited

Legend:

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

    r5306 r5316  
    136136|  Release: | %$RELEASE% | 
    137137|  Change History: | <!-- versions below in reverse order -->&nbsp; | 
     138|  18 Oct 2009 | Foswikitask:Item2270: Fix incorrect wordcount when user first enters edit mode | 
    138139|  17 Oct 2009 | Foswikitask:Item2245: Upgrade to TinyMCE 3.2.7, enabled new standard plugin: wordcount| 
    139140|  20 Sep 2009 | Foswikitask:Item2121: Remove 2 MB of developer files that are not used | 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny.js

    r4145 r5316  
    2222+"Please wait... retrieving page from server." 
    2323+"</span>");FoswikiTiny.transform(editor,"tml2html",text,function(text,req,o){for(var i=0;i<FoswikiTiny.tml2html.length;i++){var cb=FoswikiTiny.tml2html[i];text=cb.apply(this,[this,text]);} 
     24if(this.plugins.wordcount!==undefined&&this.plugins.wordcount.blocked!==undefined){this.plugins.wordcount.blocked=0;} 
    2425this.setContent(text);this.isNotDirty=true;FoswikiTiny.enableSaveButton(true);},function(type,req,o){this.setContent("<div class='foswikiAlert'>" 
    2526+"There was a problem retrieving " 
     
    3637return FoswikiTiny.metaTags[inKey];},install:function(){var tmce_init=this.getMetaTag('TINYMCEPLUGIN_INIT');if(tmce_init!=null){eval("tinyMCE.init({"+unescape(tmce_init)+"});");return;} 
    3738alert("Unable to install TinyMCE; <META name='TINYMCEPLUGIN_INIT' is missing");},getTopicPath:function(){return this.getFoswikiVar("WEB")+'.'+this.getFoswikiVar("TOPIC");},getScriptURL:function(script){var scripturl=this.getFoswikiVar("SCRIPTURL");var suffix=this.getFoswikiVar("SCRIPTSUFFIX");if(suffix==null)suffix='';return scripturl+"/"+script+suffix;},getRESTURL:function(fn){return this.getScriptURL('rest')+"/WysiwygPlugin/"+fn;},getListOfAttachments:function(onSuccess){var url=this.getRESTURL('attachments');var path=this.getTopicPath();var params="nocache="+encodeURIComponent((new Date()).getTime()) 
    38 +"&topic="+encodeURIComponent(path);tinymce.util.XHR.send({url:url+"?"+params,type:"POST",content_type:"application/x-www-form-urlencoded",data:params,success:function(atts){if(atts!=null){onSuccess(eval(atts));}}});}}; 
     39+"&topic="+encodeURIComponent(path);tinymce.util.XHR.send({url:url+"?"+params,type:"POST",content_type:"application/x-www-form-urlencoded",data:params,success:function(atts){if(atts!=null){onSuccess(eval(atts));}}});}};; 
  • trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/foswiki_tiny_src.js

    r5005 r5316  
    238238                    text = cb.apply(this, [ this, text ]); 
    239239                } 
     240                /* SMELL: Work-around for Item2270. In future this plugin may 
     241                   be updated so that this needs to be changed. TMCE's wordcount 
     242                   plugin limits itself to a max. of one count per 
     243                   2 seconds, so users always see a wordcount of 6 (Please 
     244                   wait... retrieving page from server) when they first edit a 
     245                   document. So remove lock before setContent() */ 
     246                if (this.plugins.wordcount !== undefined && 
     247                  this.plugins.wordcount.blocked !== undefined) { 
     248                    this.plugins.wordcount.blocked = 0; 
     249                } 
    240250                this.setContent(text); 
    241251                this.isNotDirty = true; 
Note: See TracChangeset for help on using the changeset viewer.