Changeset 14056
- Timestamp:
- 06/18/08 07:39:20 (5 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 added
- 6 modified
-
Editor.js (modified) (1 diff)
-
tests/_editor/test_TabIndent.html (added)
-
tests/_editor/test_ToggleDir.html (modified) (3 diffs)
-
themes/tundra/Editor.css (modified) (1 diff)
-
themes/tundra/images/editor.gif (modified) (previous)
-
_editor/nls/commands.js (modified) (1 diff)
-
_editor/plugins/TabIndent.js (added)
-
_editor/RichText.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/Editor.js
r13977 r14056 362 362 if(!dojo.isIE && !this.iframe && e.keyCode==dojo.keys.TAB){ 363 363 this._saveSelection(); 364 } 365 if (e.keyCode === dojo.keys.TAB && this.isTabIndent ){ 366 dojo.stopEvent(e); //prevent tab from moving focus out of editor 367 // FIXME: this is a poor-man's indent/outdent. It would be 368 // better if it added 4 " " chars in an undoable way. 369 // Unfortunately pasteHTML does not prove to be undoable 370 if (this.queryCommandEnabled((e.shiftKey ? "outdent" : "indent"))){ 371 this.execCommand((e.shiftKey ? "outdent" : "indent")); 372 } 373 }else if (dojo.isMoz && this.iframe && !this.isTabIndent){ 374 if( e.keyCode == dojo.keys.TAB && 375 !e.shiftKey && 376 !e.ctrlKey && 377 !e.altKey 378 ){ 379 // update iframe document title for screen reader 380 this.iframe.contentDocument.title = this._localizedIframeTitles.iframeFocusTitle; 381 382 // Place focus on the iframe. A subsequent tab or shift tab 383 // will put focus on the correct control. 384 this.iframe.focus(); // this.focus(); won't work 385 dojo.stopEvent(e); 386 }else if(e.keyCode == dojo.keys.TAB && e.shiftKey){ 387 // if there is a toolbar, set focus to it, otherwise ignore 388 if(this.toolbar){ // FIXME: this is badly factored!!! 389 this.toolbar.focus(); 390 } 391 dojo.stopEvent(e); 392 } 364 393 } 365 394 if(!this.customUndo){ -
dijit/trunk/tests/_editor/test_ToggleDir.html
r13735 r14056 10 10 <script type="text/javascript" src="../../../dojo/dojo.js" 11 11 djConfig="parseOnLoad: true, isDebug: true"></script> 12 13 <!-- required: a default dijit theme: --> 14 <link id="themeStyles" rel="stylesheet" href="../../../dijit/themes/tundra/tundra.css"> 15 12 16 <script type="text/javascript" src="../_testCommon.js"></script> 13 17 … … 16 20 dojo.require("dijit.Editor"); 17 21 dojo.require("dijit._editor.plugins.ToggleDir"); 22 dojo.require("dijit._editor.plugins.TabIndent"); 18 23 dojo.require("dojo.parser"); // scan page for widgets and instantiate them 19 24 </script> 20 25 </head> 21 <body >26 <body class="tundra"> 22 27 <div style="border: 1px dotted black;"> 23 < textareadojoType="dijit.Editor"28 <div dojoType="dijit.Editor" 24 29 extraPlugins="['toggleDir','|','dijit._editor.plugins.ToggleDir','|',{name:'dijit._editor.plugins.ToggleDir'}]"> 25 30 <ol> … … 28 33 left-to-right languages like English.</li> 29 34 </ol> 30 </ textarea>35 </div> 31 36 </div> 32 37 </body> -
dijit/trunk/themes/tundra/Editor.css
r13000 r14056 57 57 .tundra .dijitEditorIconToggleDir { background-position: -540px; /* padding: 0; margin: 0; color:#555555; 58 58 font-family:verdana,arial,sans-serif; font-weight: 800; font-size: 70%; */} 59 .tundra .dijitEditorIconTabIndent { background-position: -702px; } -
dijit/trunk/_editor/nls/commands.js
r13273 r14056 38 38 'fontSize': 'Font Size', 39 39 'fontName': 'Font Name', 40 'tabIndent': 'Tab Indent', 40 41 /* Error messages */ 41 42 'systemShortcutFF': 'The "${0}" action is only available in Mozilla Firefox using a keyboard shortcut. Use ${1}.', -
dijit/trunk/_editor/RichText.js
r13977 r14056 461 461 // deferred which is fired when the editor finishes loading 462 462 onLoadDeferred: null, 463 464 // isTabIndent: Boolean 465 // used to allow tab key and shift-tab to indent and outdent rather than navigate 466 isTabIndent: false, 463 467 464 468 postCreate: function(){ … … 490 494 a: exec("selectall"), 491 495 s: function(){ this.save(true); }, 496 m: function(){ this.isTabIndent = !this.isTabIndent; }, 492 497 493 498 "1": exec("formatblock", "h1"), … … 798 803 this.execCommand("delete"); 799 804 } 800 }else if (dojo.isMoz && this.iframe){801 if( e.keyCode == dojo.keys.TAB &&802 !e.shiftKey &&803 !e.ctrlKey &&804 !e.altKey805 ){806 // update iframe document title for screen reader807 this.iframe.contentDocument.title = this._localizedIframeTitles.iframeFocusTitle;808 809 // Place focus on the iframe. A subsequent tab or shift tab810 // will put focus on the correct control.811 this.iframe.focus(); // this.focus(); won't work812 dojo.stopEvent(e);813 }else if(e.keyCode == dojo.keys.TAB && e.shiftKey){814 // if there is a toolbar, set focus to it, otherwise ignore815 if(this.toolbar){ // FIXME: this is badly factored!!!816 this.toolbar.focus();817 }818 dojo.stopEvent(e);819 }820 805 } 821 806 return true; … … 1038 1023 case "insertorderedlist": case "insertunorderedlist": 1039 1024 case "indent": case "outdent": case "formatblock": 1040 case "inserthtml": case "undo": case "redo": case "strikethrough": 1025 case "inserthtml": case "undo": case "redo": case "strikethrough": case "tabindent": 1041 1026 supportedBy = isSupportedBy(mozilla | ie | opera | safari420); 1042 1027 break;