1. #1
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    291
    Vote Rating
    0
    jheid is on a distinguished road

      0  

    Default Ext.ux.form.HtmlEditor.JSpell

    Ext.ux.form.HtmlEditor.JSpell


    I needed a spell checker for the HTML editor component (for IE 6 indeed). So I used JSpell (look here to get an idea: http://www.jspell.com/tinymcespellchecker.html) and wrote a plugin for it. Here it is:

    PHP Code:
    Ext.namespace ('Ext.ux.form.HtmlEditor');

    Ext.ux.form.HtmlEditor.JSpell = function (config) {
     
    Ext.apply(thisconfig);
     
    Ext.ux.form.HtmlEditor.JSpell.superclass.constructor.call (this);
     };
    Ext.extend (Ext.ux.form.HtmlEditor.JSpellExt.util.Observable, {
     
    jspellServerPath'/abc',
     
    jspellImagePath'images/jspell/',
     
    scriptPath'js/jspellEvolution.js',
     
    // additional config elements
     
    jspellConfig: {},

     
    init: function (cmp) {
      for (var 
    x in this.jspellConfig)
          
    window[x] = this.jspellConfig[x];
      
    window.jspellServerPath this.jspellServerPath;
      
    window.jspellImagePath this.jspellImagePath;

      var 
    head document.getElementsByTagName ('head')[0];
      var 
    script document.createElement ('script');
      
    script.type 'text/javascript';
      
    script.src this.scriptPath;
      
    head.appendChild (script);  

      
    cmp.on ('afterrender', function () {
       
    cmp.on ('sync', function (cmphtml) {
        
    this.el.dom.value html.replace (/<span[^>]+class="?j3"?[^>]*>(.*?)<\/span>/gi'$1'); 
        });
       var 
    initSpellchecker = function () {
        if (
    typeof jspellInit == 'undefined' || !cmp.iframe.contentWindow.document.body) {
           
    initSpellchecker.defer (100);
           } else {
                  
    setTimeout (function () {
                   
    cmp.iframe.id cmp.iframe.id || Ext.id ();
                   
    window.getSpellCheckArray = function () {              
                    return [[ 
    documentcmp.iframe.id ]];
                    };
                   
    jspellInit ();
                   }, 
    10);
                  }
        };
       
    initSpellchecker ();
       }, 
    this);
     }
    }); 
    You can use it wth a HTMLEditorField like this:

    PHP Code:
    new Ext.form.HtmlEditor ({
     
    plugins: [
      new 
    Ext.ux.form.HtmlEditor.JSpell ({
       
    jspellConfig: {
        
    jspellRightClicktrue
        
    }
       })
     }); 
    Currently it checks it as you type (like Firefox or Word does). It would be easy to add a button for manual spell checking.

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    renaud.lemortellec is on a distinguished road

      0  

    Default Syntax Error

    Syntax Error


    When i use your plugin, i have a syntax error in jspellEvolution.js (line 376)
    Any idea ?

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2007
    Posts
    291
    Vote Rating
    0
    jheid is on a distinguished road

      0  

    Default


    What's in that line?

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    renaud.lemortellec is on a distinguished road

      0  

    Default


    jspellEvolution.js:376
    Code:
    eval(J6q.responseText);
    J6q.responseText contains a Tomcat error page. I think i've not correctly installed JSpell or ur plugin...

    do you have an example of configuration ?

    scriptPath => jspellEvolution.js url
    jspellServerPath => ?
    jspellImagePath => ?

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    renaud.lemortellec is on a distinguished road

      0  

    Default


    ok i understand

    JSpell is temporarly installed here : http://localhost:8080/jspellEvolution/
    so i've done this :

    jspellServerPath: 'http://localhost:8080/jspellEvolution/abc',
    jspellImagePath: 'http://localhost:8080/jspellEvolution/jspellimages/',
    scriptPath: 'http://localhost:8080/jspellEvolution/jspellEvolution.js',

    there is no syntax error but nothing appends (no correction) when i type texte in my htmleditor

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    renaud.lemortellec is on a distinguished road

      0  

    Default


    Code:
    setTimeout (function () {
                            cmp.iframe.id = cmp.iframe.id || Ext.id ();
                            window.getSpellCheckArray = function () {
                                alert('getSpellCheckArray');
                                return [[ document, cmp.iframe.id ]];
                            };
                            alert('jspellInit: ' + cmp.iframe.id);
                            jspellInit();
                        }, 10);
    alert('jspellInit: ' + cmp.iframe.id) is called but alert('getSpellCheckArray') is never called.

  7. #7
    Sencha User
    Join Date
    Dec 2012
    Location
    VA
    Posts
    1
    Vote Rating
    0
    Shalini_DOE is on a distinguished road

      0  

    Default


    The same code is not working. Has anyone got the jspell to work. I am using .NET MVC 4 with extjs library as my UI

Similar Threads

  1. Ext.ux.form.HtmlEditor.Plugins
    By VinylFox in forum Ext 3.x: User Extensions and Plugins
    Replies: 144
    Last Post: 23 Apr 2012, 12:09 PM
  2. Replies: 1
    Last Post: 5 Feb 2010, 7:12 AM
  3. Issues with Ext.form.HtmlEditor :(
    By wasp in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 5 Feb 2009, 7:39 AM
  4. Help with Ext.form.HtmlEditor??
    By sarada in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 12 Jun 2008, 10:21 AM
  5. Just Like Ext.form.HtmlEditor
    By chalu in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 5 Jun 2008, 4:40 AM

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi