| CODENOTIFIER | HelpYou are not signed inSign in |
Project: dojo
Revision: 14417
Author: bill
Date: 14 Jul 2008 03:58:52
Diff at Trac: http://trac.dojotoolkit.org/changeset/14417
Changes: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.
| ... | ...@@ -213,13 +213,6 @@ | |
| 213 | 213 | // var contentDoc = this.iframe.contentWindow.document; |
| 214 | 214 | |
| 215 | 215 | |
| 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(); | |
| 223 | 216 | |
| 224 | 217 | // now we wait for onload. Janky hack! |
| 225 | 218 | var ifrFunc = dojo.hitch(this, function(){ |
| ... | ...@@ -233,6 +226,7 @@ | |
| 233 | 226 | this.document = this.iframe.contentWindow.document |
| 234 | 227 | }else if(this.iframe.contentDocument){ |
| 235 | 228 | // for opera |
| 229 | // TODO: this method is only being called for FF2; can we remove this? | |
| 236 | 230 | this.window = this.iframe.contentDocument.window; |
| 237 | 231 | this.document = this.iframe.contentDocument; |
| 238 | 232 | } |
| ... | ...@@ -245,6 +239,13 @@ | |
| 245 | 239 | return; |
| 246 | 240 | } |
| 247 | 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(); | |
| 248 | ||
| 248 | 249 | dojo._destroyElement(tmpContent); |
| 249 | 250 | this.onLoad(); |
| 250 | 251 | }else{ |
| ... | ...@@ -229,8 +229,14 @@ | |
| 229 | 229 | </div> |
| 230 | 230 | |
| 231 | 231 | <!-- 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> | |
| 234 | 240 | <div dojoType="dijit.layout.ContentPane" region="bottom" style="height:32px" align="center"> |
| 235 | 241 | <button dojoType="dijit.form.Button" iconClass="mailIconOk" |
| 236 | 242 | >Send |
| ... | ...@@ -287,21 +293,6 @@ | |
| 287 | 293 | ); |
| 288 | 294 | tabs.addChild(newTab); |
| 289 | 295 | 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 | } | |
| 305 | 296 | </script> |
| 306 | 297 | </button> |
| 307 | 298 | <span dojoType="dijit.Tooltip" connectId="newMsg">Click to compose new message.</span> |