Changeset 14417

Show
Ignore:
Timestamp:
07/14/08 00:58:52 (12 months ago)
Author:
bill
Message:

Inline Editor markup into mail.html, rather than creating it programatically, after race condition fix for iframe initialization on FF2.
The code for iframe initialization is pretty messy in that it has separate paths for IE/FF (only FF2 calls _drawIFrame()), and should be cleaned up at some point.
Fixes #7097 !strict.

Location:
dijit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/demos/mail.html

    r14413 r14417  
    230230 
    231231                        <!-- new message part --> 
    232                         <!-- : editor will be created programmically to avoid init issues --> 
    233                          
     232                        <div dojoType="dijit.Editor" region="center" style="overflow:auto" 
     233        extraPlugins="['createLink','insertImage',{name:'dijit._editor.plugins.FontChoice', command: 'fontName', generic: true},'fontSize']" 
     234 
     235> 
     236<i> This is just a sample message. There is email-address auto-complete in the to: field. 
     237<br><br> give it a whirl. 
     238</i> 
     239</div> 
    234240                        <div dojoType="dijit.layout.ContentPane" region="bottom" style="height:32px" align="center"> 
    235241                                <button dojoType="dijit.form.Button" iconClass="mailIconOk" 
     
    288294                                        tabs.addChild(newTab); 
    289295                                        tabs.selectChild(newTab); 
    290                                         newTab.containerNode.appendChild(document.createElement('div')); 
    291                                         newTab.containerNode.lastChild.innerHTML='<i> This is just a sample message. There is email-address auto-complete in the to: field.<br><br> give it a whirl.</i>'; 
    292                                         var editor = new dijit.Editor({ 
    293                                                  extraPlugins: ['createLink','insertImage',{name:'dijit._editor.plugins.FontChoice', command: 'fontName', generic: true},'fontSize'], 
    294                                                  region:'center', 
    295                                                  height:'100%' 
    296                                                  },newTab.containerNode.lastChild); 
    297                                         if(editor.iframe){ 
    298                                                 //if iframe is used, don't use addChild otherwise the editor is not working properly because 
    299                                                 //addChild will re-attach the editor to the document DOM, instead use this hack 
    300                                                 newTab._setupChild(editor); 
    301                                                 setTimeout(dojo.hitch(newTab,'layout'),0) 
    302                                         }else{ 
    303                                                 newTab.addChild(editor); 
    304                                         } 
    305296                                </script> 
    306297                        </button> 
  • dijit/trunk/_editor/RichText.js

    r14400 r14417  
    214214 
    215215 
    216                 // note that on Safari lower than 420+, we have to get the iframe 
    217                 // by ID in order to get something w/ a contentDocument property 
    218  
    219                 var contentDoc = this.iframe.contentDocument; 
    220                 contentDoc.open(); 
    221                 contentDoc.write(this._getIframeDocTxt(html)); 
    222                 contentDoc.close(); 
    223216 
    224217                // now we wait for onload. Janky hack! 
     
    234227                                        }else if(this.iframe.contentDocument){ 
    235228                                                // for opera 
     229                                                // TODO: this method is only being called for FF2; can we remove this? 
    236230                                                this.window = this.iframe.contentDocument.window; 
    237231                                                this.document = this.iframe.contentDocument; 
     
    245239                                        return; 
    246240                                } 
     241 
     242                                // note that on Safari lower than 420+, we have to get the iframe 
     243                                // by ID in order to get something w/ a contentDocument property 
     244                                var contentDoc = this.document; 
     245                                contentDoc.open(); 
     246                                contentDoc.write(this._getIframeDocTxt(html)); 
     247                                contentDoc.close(); 
    247248 
    248249                                dojo._destroyElement(tmpContent);