diff options
author | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:24 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-18 10:26:26 +0400 |
commit | f0cfe83e3725f9a3928da97a6e3085e79cb25309 (patch) | |
tree | 4b0af188defaa807c7bc6ff3a101b41c9166c463 /lib/dijit/_editor | |
parent | 9a2885da170ffd64358b99194095851a2d09c1b6 (diff) |
upgrade dojo to 1.8.3 (refs #570)
Diffstat (limited to 'lib/dijit/_editor')
169 files changed, 10854 insertions, 57 deletions
diff --git a/lib/dijit/_editor/RichText.js b/lib/dijit/_editor/RichText.js index afa4a944d..7bd30103d 100644 --- a/lib/dijit/_editor/RichText.js +++ b/lib/dijit/_editor/RichText.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/RichText",["dojo/_base/array","dojo/_base/config","dojo/_base/declare","dojo/_base/Deferred","dojo/dom","dojo/dom-attr","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/_base/event","dojo/_base/kernel","dojo/keys","dojo/_base/lang","dojo/on","dojo/query","dojo/ready","dojo/_base/sniff","dojo/topic","dojo/_base/unload","dojo/_base/url","dojo/_base/window","../_Widget","../_CssStateMixin","./selection","./range","./html","../focus",".."],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,on,_f,_10,has,_11,_12,_13,win,_14,_15,_16,_17,_18,_19,_1a){var _1b=_3("dijit._editor.RichText",[_14,_15],{constructor:function(_1c){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};if(_1c&&_e.isString(_1c.value)){this.value=_1c.value;}this.onLoadDeferred=new _4();},baseClass:"dijitEditor",inheritWidth:false,focusOnLoad:false,name:"",styleSheets:"",height:"300px",minHeight:"1em",isClosed:true,isLoaded:false,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",_NAME_CONTENT_SEP:"@@**%%:%%**@@",onLoadDeferred:null,isTabIndent:false,disableSpellCheck:false,postCreate:function(){if("textarea"===this.domNode.tagName.toLowerCase()){console.warn("RichText should not be used with the TEXTAREA tag. See dijit._editor.RichText docs.");}this.contentPreFilters=[_e.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);if(has("mozilla")){this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters);this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters);}if(has("webkit")){this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters);this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters);}if(has("ie")){this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters);this.contentDomPostFilters=[_e.hitch(this,this._stripBreakerNodes)].concat(this.contentDomPostFilters);}this.inherited(arguments);_11.publish(_1a._scopeName+"._editor.RichText::init",this);this.open();this.setupDefaultShortcuts();},setupDefaultShortcuts:function(){var _1d=_e.hitch(this,function(cmd,arg){return function(){return !this.execCommand(cmd,arg);};});var _1e={b:_1d("bold"),i:_1d("italic"),u:_1d("underline"),a:_1d("selectall"),s:function(){this.save(true);},m:function(){this.isTabIndent=!this.isTabIndent;},"1":_1d("formatblock","h1"),"2":_1d("formatblock","h2"),"3":_1d("formatblock","h3"),"4":_1d("formatblock","h4"),"\\":_1d("insertunorderedlist")};if(!has("ie")){_1e.Z=_1d("redo");}var key;for(key in _1e){this.addKeyHandler(key,true,false,_1e[key]);}},events:["onKeyPress","onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:false,_localizeEditorCommands:function(){if(_1b._editorCommandsLocalized){this._local2NativeFormatNames=_1b._local2NativeFormatNames;this._native2LocalFormatNames=_1b._native2LocalFormatNames;return;}_1b._editorCommandsLocalized=true;_1b._local2NativeFormatNames={};_1b._native2LocalFormatNames={};this._local2NativeFormatNames=_1b._local2NativeFormatNames;this._native2LocalFormatNames=_1b._native2LocalFormatNames;var _1f=["div","p","pre","h1","h2","h3","h4","h5","h6","ol","ul","address"];var _20="",_21,i=0;while((_21=_1f[i++])){if(_21.charAt(1)!=="l"){_20+="<"+_21+"><span>content</span></"+_21+"><br/>";}else{_20+="<"+_21+"><li>content</li></"+_21+"><br/>";}}var _22={position:"absolute",top:"0px",zIndex:10,opacity:0.01};var div=_8.create("div",{style:_22,innerHTML:_20});win.body().appendChild(div);var _23=_e.hitch(this,function(){var _24=div.firstChild;while(_24){try{_16.selectElement(_24.firstChild);var _25=_24.tagName.toLowerCase();this._local2NativeFormatNames[_25]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[_25]]=_25;_24=_24.nextSibling.nextSibling;}catch(e){}}div.parentNode.removeChild(div);div.innerHTML="";});setTimeout(_23,0);},open:function(_26){if(!this.onLoadDeferred||this.onLoadDeferred.fired>=0){this.onLoadDeferred=new _4();}if(!this.isClosed){this.close();}_11.publish(_1a._scopeName+"._editor.RichText::open",this);if(arguments.length===1&&_26.nodeName){this.domNode=_26;}var dn=this.domNode;var _27;if(_e.isString(this.value)){_27=this.value;delete this.value;dn.innerHTML="";}else{if(dn.nodeName&&dn.nodeName.toLowerCase()=="textarea"){var ta=(this.textarea=dn);this.name=ta.name;_27=ta.value;dn=this.domNode=win.doc.createElement("div");dn.setAttribute("widgetId",this.id);ta.removeAttribute("widgetId");dn.cssText=ta.cssText;dn.className+=" "+ta.className;_8.place(dn,ta,"before");var _28=_e.hitch(this,function(){_a.set(ta,{display:"block",position:"absolute",top:"-1000px"});if(has("ie")){var s=ta.style;this.__overflow=s.overflow;s.overflow="hidden";}});if(has("ie")){setTimeout(_28,10);}else{_28();}if(ta.form){var _29=ta.value;this.reset=function(){var _2a=this.getValue();if(_2a!==_29){this.replaceValue(_29);}};on(ta.form,"submit",_e.hitch(this,function(){_6.set(ta,"disabled",this.disabled);ta.value=this.getValue();}));}}else{_27=_18.getChildrenHtml(dn);dn.innerHTML="";}}this.value=_27;if(dn.nodeName&&dn.nodeName==="LI"){dn.innerHTML=" <br>";}this.header=dn.ownerDocument.createElement("div");dn.appendChild(this.header);this.editingArea=dn.ownerDocument.createElement("div");dn.appendChild(this.editingArea);this.footer=dn.ownerDocument.createElement("div");dn.appendChild(this.footer);if(!this.name){this.name=this.id+"_AUTOGEN";}if(this.name!==""&&(!_2["useXDomain"]||_2["allowXdRichTextSave"])){var _2b=_5.byId(_1a._scopeName+"._editor.RichText.value");if(_2b&&_2b.value!==""){var _2c=_2b.value.split(this._SEPARATOR),i=0,dat;while((dat=_2c[i++])){var _2d=dat.split(this._NAME_CONTENT_SEP);if(_2d[0]===this.name){_27=_2d[1];_2c=_2c.splice(i,1);_2b.value=_2c.join(this._SEPARATOR);break;}}}if(!_1b._globalSaveHandler){_1b._globalSaveHandler={};_12.addOnUnload(function(){var id;for(id in _1b._globalSaveHandler){var f=_1b._globalSaveHandler[id];if(_e.isFunction(f)){f();}}});}_1b._globalSaveHandler[this.id]=_e.hitch(this,"_saveContent");}this.isClosed=false;var ifr=(this.editorObject=this.iframe=win.doc.createElement("iframe"));ifr.id=this.id+"_iframe";this._iframeSrc=this._getIframeDocTxt();ifr.style.border="none";ifr.style.width="100%";if(this._layoutMode){ifr.style.height="100%";}else{if(has("ie")>=7){if(this.height){ifr.style.height=this.height;}if(this.minHeight){ifr.style.minHeight=this.minHeight;}}else{ifr.style.height=this.height?this.height:this.minHeight;}}ifr.frameBorder=0;ifr._loadFunc=_e.hitch(this,function(w){this.window=w;this.document=this.window.document;if(has("ie")){this._localizeEditorCommands();}this.onLoad(_27);});var _2e="parent."+_1a._scopeName+".byId(\""+this.id+"\")._iframeSrc";var s="javascript:(function(){try{return "+_2e+"}catch(e){document.open();document.domain=\""+document.domain+"\";document.write("+_2e+");document.close();}})()";ifr.setAttribute("src",s);this.editingArea.appendChild(ifr);if(has("safari")<=4){var src=ifr.getAttribute("src");if(!src||src.indexOf("javascript")===-1){setTimeout(function(){ifr.setAttribute("src",s);},0);}}if(dn.nodeName==="LI"){dn.lastChild.style.marginTop="-1.2em";}_7.add(this.domNode,this.baseClass);},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var _2f=_a.getComputedStyle(this.domNode);var _30="";var _31=true;if(has("ie")||has("webkit")||(!this.height&&!has("mozilla"))){_30="<div id='dijitEditorBody'></div>";_31=false;}else{if(has("mozilla")){this._cursorToStart=true;_30=" ";}}var _32=[_2f.fontWeight,_2f.fontSize,_2f.fontFamily].join(" ");var _33=_2f.lineHeight;if(_33.indexOf("px")>=0){_33=parseFloat(_33)/parseFloat(_2f.fontSize);}else{if(_33.indexOf("em")>=0){_33=parseFloat(_33);}else{_33="normal";}}var _34="";var _35=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(_36){_36=_36.replace(/^;/ig,"")+";";var s=_36.split(":")[0];if(s){s=_e.trim(s);s=s.toLowerCase();var i;var sC="";for(i=0;i<s.length;i++){var c=s.charAt(i);switch(c){case "-":i++;c=s.charAt(i).toUpperCase();default:sC+=c;}}_a.set(_35.domNode,sC,"");}_34+=_36+";";});var _37=_f("label[for=\""+this.id+"\"]");return [this.isLeftToRight()?"<html>\n<head>\n":"<html dir='rtl'>\n<head>\n",(has("mozilla")&&_37.length?"<title>"+_37[0].innerHTML+"</title>\n":""),"<meta http-equiv='Content-Type' content='text/html'>\n","<style>\n","\tbody,html {\n","\t\tbackground:transparent;\n","\t\tpadding: 1px 0 0 0;\n","\t\tmargin: -1px 0 0 0;\n",((has("webkit"))?"\t\twidth: 100%;\n":""),((has("webkit"))?"\t\theight: 100%;\n":""),"\t}\n","\tbody{\n","\t\ttop:0px;\n","\t\tleft:0px;\n","\t\tright:0px;\n","\t\tfont:",_32,";\n",((this.height||has("opera"))?"":"\t\tposition: fixed;\n"),"\t\tmin-height:",this.minHeight,";\n","\t\tline-height:",_33,";\n","\t}\n","\tp{ margin: 1em 0; }\n",(!_31&&!this.height?"\tbody,html {overflow-y: hidden;}\n":""),"\t#dijitEditorBody{overflow-x: auto; overflow-y:"+(this.height?"auto;":"hidden;")+" outline: 0px;}\n","\tli > ul:-moz-first-node, li > ol:-moz-first-node{ padding-top: 1.2em; }\n",(!has("ie")?"\tli{ min-height:1.2em; }\n":""),"</style>\n",this._applyEditingAreaStyleSheets(),"\n","</head>\n<body ",(_31?"id='dijitEditorBody' ":""),"onload='frameElement._loadFunc(window,document)' style='"+_34+"'>",_30,"</body>\n</html>"].join("");},_applyEditingAreaStyleSheets:function(){var _38=[];if(this.styleSheets){_38=this.styleSheets.split(";");this.styleSheets="";}_38=_38.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];var _39="",i=0,url;while((url=_38[i++])){var _3a=(new _13(win.global.location,url)).toString();this.editingAreaStyleSheets.push(_3a);_39+="<link rel=\"stylesheet\" type=\"text/css\" href=\""+_3a+"\"/>";}return _39;},addStyleSheet:function(uri){var url=uri.toString();if(url.charAt(0)==="."||(url.charAt(0)!=="/"&&!uri.host)){url=(new _13(win.global.location,url)).toString();}if(_1.indexOf(this.editingAreaStyleSheets,url)>-1){return;}this.editingAreaStyleSheets.push(url);this.onLoadDeferred.addCallback(_e.hitch(this,function(){if(this.document.createStyleSheet){this.document.createStyleSheet(url);}else{var _3b=this.document.getElementsByTagName("head")[0];var _3c=this.document.createElement("link");_3c.rel="stylesheet";_3c.type="text/css";_3c.href=url;_3b.appendChild(_3c);}}));},removeStyleSheet:function(uri){var url=uri.toString();if(url.charAt(0)==="."||(url.charAt(0)!=="/"&&!uri.host)){url=(new _13(win.global.location,url)).toString();}var _3d=_1.indexOf(this.editingAreaStyleSheets,url);if(_3d===-1){return;}delete this.editingAreaStyleSheets[_3d];win.withGlobal(this.window,"query",dojo,["link:[href=\""+url+"\"]"]).orphan();},disabled:false,_mozSettingProps:{"styleWithCSS":false},_setDisabledAttr:function(_3e){_3e=!!_3e;this._set("disabled",_3e);if(!this.isLoaded){return;}if(has("ie")||has("webkit")||has("opera")){var _3f=has("ie")&&(this.isLoaded||!this.focusOnLoad);if(_3f){this.editNode.unselectable="on";}this.editNode.contentEditable=!_3e;if(_3f){var _40=this;setTimeout(function(){if(_40.editNode){_40.editNode.unselectable="off";}},0);}}else{try{this.document.designMode=(_3e?"off":"on");}catch(e){return;}if(!_3e&&this._mozSettingProps){var ps=this._mozSettingProps;var n;for(n in ps){if(ps.hasOwnProperty(n)){try{this.document.execCommand(n,false,ps[n]);}catch(e2){}}}}}this._disabledOK=true;},onLoad:function(_41){if(!this.window.__registeredWindow){this.window.__registeredWindow=true;this._iframeRegHandle=_19.registerIframe(this.iframe);}if(!has("ie")&&!has("webkit")&&(this.height||has("mozilla"))){this.editNode=this.document.body;}else{this.editNode=this.document.body.firstChild;var _42=this;if(has("ie")){this.tabStop=_8.create("div",{tabIndex:-1},this.editingArea);this.iframe.onfocus=function(){_42.editNode.setActive();};}}this.focusNode=this.editNode;var _43=this.events.concat(this.captureEvents);var ap=this.iframe?this.document:this.editNode;_1.forEach(_43,function(_44){this.connect(ap,_44.toLowerCase(),_44);},this);this.connect(ap,"onmouseup","onClick");if(has("ie")){this.connect(this.document,"onmousedown","_onIEMouseDown");this.editNode.style.zoom=1;}else{this.connect(this.document,"onmousedown",function(){delete this._cursorToStart;});}if(has("webkit")){this._webkitListener=this.connect(this.document,"onmouseup","onDisplayChanged");this.connect(this.document,"onmousedown",function(e){var t=e.target;if(t&&(t===this.document.body||t===this.document)){setTimeout(_e.hitch(this,"placeCursorAtEnd"),0);}});}if(has("ie")){try{this.document.execCommand("RespectVisibilityInDesign",true,null);}catch(e){}}this.isLoaded=true;this.set("disabled",this.disabled);var _45=_e.hitch(this,function(){this.setValue(_41);if(this.onLoadDeferred){this.onLoadDeferred.callback(true);}this.onDisplayChanged();if(this.focusOnLoad){_10(_e.hitch(this,function(){setTimeout(_e.hitch(this,"focus"),this.updateInterval);}));}this.value=this.getValue(true);});if(this.setValueDeferred){this.setValueDeferred.addCallback(_45);}else{_45();}},onKeyDown:function(e){if(e.keyCode===_d.TAB&&this.isTabIndent){_b.stop(e);if(this.queryCommandEnabled((e.shiftKey?"outdent":"indent"))){this.execCommand((e.shiftKey?"outdent":"indent"));}}if(has("ie")){if(e.keyCode==_d.TAB&&!this.isTabIndent){if(e.shiftKey&&!e.ctrlKey&&!e.altKey){this.iframe.focus();}else{if(!e.shiftKey&&!e.ctrlKey&&!e.altKey){this.tabStop.focus();}}}else{if(e.keyCode===_d.BACKSPACE&&this.document.selection.type==="Control"){_b.stop(e);this.execCommand("delete");}else{if((65<=e.keyCode&&e.keyCode<=90)||(e.keyCode>=37&&e.keyCode<=40)){e.charCode=e.keyCode;this.onKeyPress(e);}}}}if(has("ff")){if(e.keyCode===_d.PAGE_UP||e.keyCode===_d.PAGE_DOWN){if(this.editNode.clientHeight>=this.editNode.scrollHeight){e.preventDefault();}}}return true;},onKeyUp:function(){},setDisabled:function(_46){_c.deprecated("dijit.Editor::setDisabled is deprecated","use dijit.Editor::attr(\"disabled\",boolean) instead",2);this.set("disabled",_46);},_setValueAttr:function(_47){this.setValue(_47);},_setDisableSpellCheckAttr:function(_48){if(this.document){_6.set(this.document.body,"spellcheck",!_48);}else{this.onLoadDeferred.addCallback(_e.hitch(this,function(){_6.set(this.document.body,"spellcheck",!_48);}));}this._set("disableSpellCheck",_48);},onKeyPress:function(e){var c=(e.keyChar&&e.keyChar.toLowerCase())||e.keyCode,_49=this._keyHandlers[c],_4a=arguments;if(_49&&!e.altKey){_1.some(_49,function(h){if(!(h.shift^e.shiftKey)&&!(h.ctrl^(e.ctrlKey||e.metaKey))){if(!h.handler.apply(this,_4a)){e.preventDefault();}return true;}},this);}if(!this._onKeyHitch){this._onKeyHitch=_e.hitch(this,"onKeyPressed");}setTimeout(this._onKeyHitch,1);return true;},addKeyHandler:function(key,_4b,_4c,_4d){if(!_e.isArray(this._keyHandlers[key])){this._keyHandlers[key]=[];}this._keyHandlers[key].push({shift:_4c||false,ctrl:_4b||false,handler:_4d});},onKeyPressed:function(){this.onDisplayChanged();},onClick:function(e){this.onDisplayChanged(e);},_onIEMouseDown:function(){if(!this.focused&&!this.disabled){this.focus();}},_onBlur:function(e){this.inherited(arguments);var _4e=this.getValue(true);if(_4e!==this.value){this.onChange(_4e);}this._set("value",_4e);},_onFocus:function(e){if(!this.disabled){if(!this._disabledOK){this.set("disabled",false);}this.inherited(arguments);}},blur:function(){if(!has("ie")&&this.window.document.documentElement&&this.window.document.documentElement.focus){this.window.document.documentElement.focus();}else{if(win.doc.body.focus){win.doc.body.focus();}}},focus:function(){if(!this.isLoaded){this.focusOnLoad=true;return;}if(this._cursorToStart){delete this._cursorToStart;if(this.editNode.childNodes){this.placeCursorAtStart();return;}}if(!has("ie")){_19.focus(this.iframe);}else{if(this.editNode&&this.editNode.focus){this.iframe.fireEvent("onfocus",document.createEventObject());}}},updateInterval:200,_updateTimer:null,onDisplayChanged:function(){if(this._updateTimer){clearTimeout(this._updateTimer);}if(!this._updateHandler){this._updateHandler=_e.hitch(this,"onNormalizedDisplayChanged");}this._updateTimer=setTimeout(this._updateHandler,this.updateInterval);},onNormalizedDisplayChanged:function(){delete this._updateTimer;},onChange:function(){},_normalizeCommand:function(cmd,_4f){var _50=cmd.toLowerCase();if(_50==="formatblock"){if(has("safari")&&_4f===undefined){_50="heading";}}else{if(_50==="hilitecolor"&&!has("mozilla")){_50="backcolor";}}return _50;},_qcaCache:{},queryCommandAvailable:function(_51){var ca=this._qcaCache[_51];if(ca!==undefined){return ca;}return (this._qcaCache[_51]=this._queryCommandAvailable(_51));},_queryCommandAvailable:function(_52){var ie=1;var _53=1<<1;var _54=1<<2;var _55=1<<3;function _56(_57){return {ie:Boolean(_57&ie),mozilla:Boolean(_57&_53),webkit:Boolean(_57&_54),opera:Boolean(_57&_55)};};var _58=null;switch(_52.toLowerCase()){case "bold":case "italic":case "underline":case "subscript":case "superscript":case "fontname":case "fontsize":case "forecolor":case "hilitecolor":case "justifycenter":case "justifyfull":case "justifyleft":case "justifyright":case "delete":case "selectall":case "toggledir":_58=_56(_53|ie|_54|_55);break;case "createlink":case "unlink":case "removeformat":case "inserthorizontalrule":case "insertimage":case "insertorderedlist":case "insertunorderedlist":case "indent":case "outdent":case "formatblock":case "inserthtml":case "undo":case "redo":case "strikethrough":case "tabindent":_58=_56(_53|ie|_55|_54);break;case "blockdirltr":case "blockdirrtl":case "dirltr":case "dirrtl":case "inlinedirltr":case "inlinedirrtl":_58=_56(ie);break;case "cut":case "copy":case "paste":_58=_56(ie|_53|_54);break;case "inserttable":_58=_56(_53|ie);break;case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":_58=_56(ie|_53);break;default:return false;}return (has("ie")&&_58.ie)||(has("mozilla")&&_58.mozilla)||(has("webkit")&&_58.webkit)||(has("opera")&&_58.opera);},execCommand:function(_59,_5a){var _5b;this.focus();_59=this._normalizeCommand(_59,_5a);if(_5a!==undefined){if(_59==="heading"){throw new Error("unimplemented");}else{if((_59==="formatblock")&&has("ie")){_5a="<"+_5a+">";}}}var _5c="_"+_59+"Impl";if(this[_5c]){_5b=this[_5c](_5a);}else{_5a=arguments.length>1?_5a:null;if(_5a||_59!=="createlink"){_5b=this.document.execCommand(_59,false,_5a);}}this.onDisplayChanged();return _5b;},queryCommandEnabled:function(_5d){if(this.disabled||!this._disabledOK){return false;}_5d=this._normalizeCommand(_5d);var _5e="_"+_5d+"EnabledImpl";if(this[_5e]){return this[_5e](_5d);}else{return this._browserQueryCommandEnabled(_5d);}},queryCommandState:function(_5f){if(this.disabled||!this._disabledOK){return false;}_5f=this._normalizeCommand(_5f);try{return this.document.queryCommandState(_5f);}catch(e){return false;}},queryCommandValue:function(_60){if(this.disabled||!this._disabledOK){return false;}var r;_60=this._normalizeCommand(_60);if(has("ie")&&_60==="formatblock"){r=this._native2LocalFormatNames[this.document.queryCommandValue(_60)];}else{if(has("mozilla")&&_60==="hilitecolor"){var _61;try{_61=this.document.queryCommandValue("styleWithCSS");}catch(e){_61=false;}this.document.execCommand("styleWithCSS",false,true);r=this.document.queryCommandValue(_60);this.document.execCommand("styleWithCSS",false,_61);}else{r=this.document.queryCommandValue(_60);}}return r;},_sCall:function(_62,_63){return win.withGlobal(this.window,_62,_16,_63);},placeCursorAtStart:function(){this.focus();var _64=false;if(has("mozilla")){var _65=this.editNode.firstChild;while(_65){if(_65.nodeType===3){if(_65.nodeValue.replace(/^\s+|\s+$/g,"").length>0){_64=true;this._sCall("selectElement",[_65]);break;}}else{if(_65.nodeType===1){_64=true;var tg=_65.tagName?_65.tagName.toLowerCase():"";if(/br|input|img|base|meta|area|basefont|hr|link/.test(tg)){this._sCall("selectElement",[_65]);}else{this._sCall("selectElementChildren",[_65]);}break;}}_65=_65.nextSibling;}}else{_64=true;this._sCall("selectElementChildren",[this.editNode]);}if(_64){this._sCall("collapse",[true]);}},placeCursorAtEnd:function(){this.focus();var _66=false;if(has("mozilla")){var _67=this.editNode.lastChild;while(_67){if(_67.nodeType===3){if(_67.nodeValue.replace(/^\s+|\s+$/g,"").length>0){_66=true;this._sCall("selectElement",[_67]);break;}}else{if(_67.nodeType===1){_66=true;if(_67.lastChild){this._sCall("selectElement",[_67.lastChild]);}else{this._sCall("selectElement",[_67]);}break;}}_67=_67.previousSibling;}}else{_66=true;this._sCall("selectElementChildren",[this.editNode]);}if(_66){this._sCall("collapse",[false]);}},getValue:function(_68){if(this.textarea){if(this.isClosed||!this.isLoaded){return this.textarea.value;}}return this._postFilterContent(null,_68);},_getValueAttr:function(){return this.getValue(true);},setValue:function(_69){if(!this.isLoaded){this.onLoadDeferred.addCallback(_e.hitch(this,function(){this.setValue(_69);}));return;}this._cursorToStart=true;if(this.textarea&&(this.isClosed||!this.isLoaded)){this.textarea.value=_69;}else{_69=this._preFilterContent(_69);var _6a=this.isClosed?this.domNode:this.editNode;if(_69&&has("mozilla")&&_69.toLowerCase()==="<p></p>"){_69="<p> </p>";}if(!_69&&has("webkit")){_69=" ";}_6a.innerHTML=_69;this._preDomFilterContent(_6a);}this.onDisplayChanged();this._set("value",this.getValue(true));},replaceValue:function(_6b){if(this.isClosed){this.setValue(_6b);}else{if(this.window&&this.window.getSelection&&!has("mozilla")){this.setValue(_6b);}else{if(this.window&&this.window.getSelection){_6b=this._preFilterContent(_6b);this.execCommand("selectall");if(!_6b){this._cursorToStart=true;_6b=" ";}this.execCommand("inserthtml",_6b);this._preDomFilterContent(this.editNode);}else{if(this.document&&this.document.selection){this.setValue(_6b);}}}}this._set("value",this.getValue(true));},_preFilterContent:function(_6c){var ec=_6c;_1.forEach(this.contentPreFilters,function(ef){if(ef){ec=ef(ec);}});return ec;},_preDomFilterContent:function(dom){dom=dom||this.editNode;_1.forEach(this.contentDomPreFilters,function(ef){if(ef&&_e.isFunction(ef)){ef(dom);}},this);},_postFilterContent:function(dom,_6d){var ec;if(!_e.isString(dom)){dom=dom||this.editNode;if(this.contentDomPostFilters.length){if(_6d){dom=_e.clone(dom);}_1.forEach(this.contentDomPostFilters,function(ef){dom=ef(dom);});}ec=_18.getChildrenHtml(dom);}else{ec=dom;}if(!_e.trim(ec.replace(/^\xA0\xA0*/,"").replace(/\xA0\xA0*$/,"")).length){ec="";}_1.forEach(this.contentPostFilters,function(ef){ec=ef(ec);});return ec;},_saveContent:function(){var _6e=_5.byId(_1a._scopeName+"._editor.RichText.value");if(_6e){if(_6e.value){_6e.value+=this._SEPARATOR;}_6e.value+=this.name+this._NAME_CONTENT_SEP+this.getValue(true);}},escapeXml:function(str,_6f){str=str.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");if(!_6f){str=str.replace(/'/gm,"'");}return str;},getNodeHtml:function(_70){_c.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead",2);return _18.getNodeHtml(_70);},getNodeChildrenHtml:function(dom){_c.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return _18.getChildrenHtml(dom);},close:function(_71){if(this.isClosed){return;}if(!arguments.length){_71=true;}if(_71){this._set("value",this.getValue(true));}if(this.interval){clearInterval(this.interval);}if(this._webkitListener){this.disconnect(this._webkitListener);delete this._webkitListener;}if(has("ie")){this.iframe.onfocus=null;}this.iframe._loadFunc=null;if(this._iframeRegHandle){this._iframeRegHandle.remove();delete this._iframeRegHandle;}if(this.textarea){var s=this.textarea.style;s.position="";s.left=s.top="";if(has("ie")){s.overflow=this.__overflow;this.__overflow=null;}this.textarea.value=this.value;_8.destroy(this.domNode);this.domNode=this.textarea;}else{this.domNode.innerHTML=this.value;}delete this.iframe;_7.remove(this.domNode,this.baseClass);this.isClosed=true;this.isLoaded=false;delete this.editNode;delete this.focusNode;if(this.window&&this.window._frameElement){this.window._frameElement=null;}this.window=null;this.document=null;this.editingArea=null;this.editorObject=null;},destroy:function(){if(!this.isClosed){this.close(false);}if(this._updateTimer){clearTimeout(this._updateTimer);}this.inherited(arguments);if(_1b._globalSaveHandler){delete _1b._globalSaveHandler[this.id];}},_removeMozBogus:function(_72){return _72.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"");},_removeWebkitBogus:function(_73){_73=_73.replace(/\sclass="webkit-block-placeholder"/gi,"");_73=_73.replace(/\sclass="apple-style-span"/gi,"");_73=_73.replace(/<meta charset=\"utf-8\" \/>/gi,"");return _73;},_normalizeFontStyle:function(_74){return _74.replace(/<(\/)?strong([ \>])/gi,"<$1b$2").replace(/<(\/)?em([ \>])/gi,"<$1i$2");},_preFixUrlAttributes:function(_75){return _75.replace(/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl=$2$3$5$2").replace(/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl=$2$3$5$2");},_browserQueryCommandEnabled:function(_76){if(!_76){return false;}var _77=has("ie")?this.document.selection.createRange():this.document;try{return _77.queryCommandEnabled(_76);}catch(e){return false;}},_createlinkEnabledImpl:function(){var _78=true;if(has("opera")){var sel=this.window.getSelection();if(sel.isCollapsed){_78=true;}else{_78=this.document.queryCommandEnabled("createlink");}}else{_78=this._browserQueryCommandEnabled("createlink");}return _78;},_unlinkEnabledImpl:function(){var _79=true;if(has("mozilla")||has("webkit")){_79=this._sCall("hasAncestorElement",["a"]);}else{_79=this._browserQueryCommandEnabled("unlink");}return _79;},_inserttableEnabledImpl:function(){var _7a=true;if(has("mozilla")||has("webkit")){_7a=true;}else{_7a=this._browserQueryCommandEnabled("inserttable");}return _7a;},_cutEnabledImpl:function(){var _7b=true;if(has("webkit")){var sel=this.window.getSelection();if(sel){sel=sel.toString();}_7b=!!sel;}else{_7b=this._browserQueryCommandEnabled("cut");}return _7b;},_copyEnabledImpl:function(){var _7c=true;if(has("webkit")){var sel=this.window.getSelection();if(sel){sel=sel.toString();}_7c=!!sel;}else{_7c=this._browserQueryCommandEnabled("copy");}return _7c;},_pasteEnabledImpl:function(){var _7d=true;if(has("webkit")){return true;}else{_7d=this._browserQueryCommandEnabled("paste");}return _7d;},_inserthorizontalruleImpl:function(_7e){if(has("ie")){return this._inserthtmlImpl("<hr>");}return this.document.execCommand("inserthorizontalrule",false,_7e);},_unlinkImpl:function(_7f){if((this.queryCommandEnabled("unlink"))&&(has("mozilla")||has("webkit"))){var a=this._sCall("getAncestorElement",["a"]);this._sCall("selectElement",[a]);return this.document.execCommand("unlink",false,null);}return this.document.execCommand("unlink",false,_7f);},_hilitecolorImpl:function(_80){var _81;var _82=this._handleTextColorOrProperties("hilitecolor",_80);if(!_82){if(has("mozilla")){this.document.execCommand("styleWithCSS",false,true);_81=this.document.execCommand("hilitecolor",false,_80);this.document.execCommand("styleWithCSS",false,false);}else{_81=this.document.execCommand("hilitecolor",false,_80);}}return _81;},_backcolorImpl:function(_83){if(has("ie")){_83=_83?_83:null;}var _84=this._handleTextColorOrProperties("backcolor",_83);if(!_84){_84=this.document.execCommand("backcolor",false,_83);}return _84;},_forecolorImpl:function(_85){if(has("ie")){_85=_85?_85:null;}var _86=false;_86=this._handleTextColorOrProperties("forecolor",_85);if(!_86){_86=this.document.execCommand("forecolor",false,_85);}return _86;},_inserthtmlImpl:function(_87){_87=this._preFilterContent(_87);var rv=true;if(has("ie")){var _88=this.document.selection.createRange();if(this.document.selection.type.toUpperCase()==="CONTROL"){var n=_88.item(0);while(_88.length){_88.remove(_88.item(0));}n.outerHTML=_87;}else{_88.pasteHTML(_87);}_88.select();}else{if(has("mozilla")&&!_87.length){this._sCall("remove");}else{rv=this.document.execCommand("inserthtml",false,_87);}}return rv;},_boldImpl:function(_89){var _8a=false;if(has("ie")){this._adaptIESelection();_8a=this._adaptIEFormatAreaAndExec("bold");}if(!_8a){_8a=this.document.execCommand("bold",false,_89);}return _8a;},_italicImpl:function(_8b){var _8c=false;if(has("ie")){this._adaptIESelection();_8c=this._adaptIEFormatAreaAndExec("italic");}if(!_8c){_8c=this.document.execCommand("italic",false,_8b);}return _8c;},_underlineImpl:function(_8d){var _8e=false;if(has("ie")){this._adaptIESelection();_8e=this._adaptIEFormatAreaAndExec("underline");}if(!_8e){_8e=this.document.execCommand("underline",false,_8d);}return _8e;},_strikethroughImpl:function(_8f){var _90=false;if(has("ie")){this._adaptIESelection();_90=this._adaptIEFormatAreaAndExec("strikethrough");}if(!_90){_90=this.document.execCommand("strikethrough",false,_8f);}return _90;},_superscriptImpl:function(_91){var _92=false;if(has("ie")){this._adaptIESelection();_92=this._adaptIEFormatAreaAndExec("superscript");}if(!_92){_92=this.document.execCommand("superscript",false,_91);}return _92;},_subscriptImpl:function(_93){var _94=false;if(has("ie")){this._adaptIESelection();_94=this._adaptIEFormatAreaAndExec("subscript");}if(!_94){_94=this.document.execCommand("subscript",false,_93);}return _94;},_fontnameImpl:function(_95){var _96;if(has("ie")){_96=this._handleTextColorOrProperties("fontname",_95);}if(!_96){_96=this.document.execCommand("fontname",false,_95);}return _96;},_fontsizeImpl:function(_97){var _98;if(has("ie")){_98=this._handleTextColorOrProperties("fontsize",_97);}if(!_98){_98=this.document.execCommand("fontsize",false,_97);}return _98;},_insertorderedlistImpl:function(_99){var _9a=false;if(has("ie")){_9a=this._adaptIEList("insertorderedlist",_99);}if(!_9a){_9a=this.document.execCommand("insertorderedlist",false,_99);}return _9a;},_insertunorderedlistImpl:function(_9b){var _9c=false;if(has("ie")){_9c=this._adaptIEList("insertunorderedlist",_9b);}if(!_9c){_9c=this.document.execCommand("insertunorderedlist",false,_9b);}return _9c;},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header);},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer);},_getNodeChildrenHeight:function(_9d){var h=0;if(_9d&&_9d.childNodes){var i;for(i=0;i<_9d.childNodes.length;i++){var _9e=_9.position(_9d.childNodes[i]);h+=_9e.h;}}return h;},_isNodeEmpty:function(_9f,_a0){if(_9f.nodeType===1){if(_9f.childNodes.length>0){return this._isNodeEmpty(_9f.childNodes[0],_a0);}return true;}else{if(_9f.nodeType===3){return (_9f.nodeValue.substring(_a0)==="");}}return false;},_removeStartingRangeFromRange:function(_a1,_a2){if(_a1.nextSibling){_a2.setStart(_a1.nextSibling,0);}else{var _a3=_a1.parentNode;while(_a3&&_a3.nextSibling==null){_a3=_a3.parentNode;}if(_a3){_a2.setStart(_a3.nextSibling,0);}}return _a2;},_adaptIESelection:function(){var _a4=_17.getSelection(this.window);if(_a4&&_a4.rangeCount&&!_a4.isCollapsed){var _a5=_a4.getRangeAt(0);var _a6=_a5.startContainer;var _a7=_a5.startOffset;while(_a6.nodeType===3&&_a7>=_a6.length&&_a6.nextSibling){_a7=_a7-_a6.length;_a6=_a6.nextSibling;}var _a8=null;while(this._isNodeEmpty(_a6,_a7)&&_a6!==_a8){_a8=_a6;_a5=this._removeStartingRangeFromRange(_a6,_a5);_a6=_a5.startContainer;_a7=0;}_a4.removeAllRanges();_a4.addRange(_a5);}},_adaptIEFormatAreaAndExec:function(_a9){var _aa=_17.getSelection(this.window);var doc=this.document;var rs,ret,_ab,txt,_ac,_ad,_ae,_af;if(_a9&&_aa&&_aa.isCollapsed){var _b0=this.queryCommandValue(_a9);if(_b0){var _b1=this._tagNamesForCommand(_a9);_ab=_aa.getRangeAt(0);var fs=_ab.startContainer;if(fs.nodeType===3){var _b2=_ab.endOffset;if(fs.length<_b2){ret=this._adjustNodeAndOffset(rs,_b2);fs=ret.node;_b2=ret.offset;}}var _b3;while(fs&&fs!==this.editNode){var _b4=fs.tagName?fs.tagName.toLowerCase():"";if(_1.indexOf(_b1,_b4)>-1){_b3=fs;break;}fs=fs.parentNode;}if(_b3){rs=_ab.startContainer;var _b5=doc.createElement(_b3.tagName);_8.place(_b5,_b3,"after");if(rs&&rs.nodeType===3){var _b6,_b7;var _b8=_ab.endOffset;if(rs.length<_b8){ret=this._adjustNodeAndOffset(rs,_b8);rs=ret.node;_b8=ret.offset;}txt=rs.nodeValue;_ac=doc.createTextNode(txt.substring(0,_b8));var _b9=txt.substring(_b8,txt.length);if(_b9){_ad=doc.createTextNode(_b9);}_8.place(_ac,rs,"before");if(_ad){_ae=doc.createElement("span");_ae.className="ieFormatBreakerSpan";_8.place(_ae,rs,"after");_8.place(_ad,_ae,"after");_ad=_ae;}_8.destroy(rs);var _ba=_ac.parentNode;var _bb=[];var _bc;while(_ba!==_b3){var tg=_ba.tagName;_bc={tagName:tg};_bb.push(_bc);var _bd=doc.createElement(tg);if(_ba.style){if(_bd.style){if(_ba.style.cssText){_bd.style.cssText=_ba.style.cssText;_bc.cssText=_ba.style.cssText;}}}if(_ba.tagName==="FONT"){if(_ba.color){_bd.color=_ba.color;_bc.color=_ba.color;}if(_ba.face){_bd.face=_ba.face;_bc.face=_ba.face;}if(_ba.size){_bd.size=_ba.size;_bc.size=_ba.size;}}if(_ba.className){_bd.className=_ba.className;_bc.className=_ba.className;}if(_ad){_b6=_ad;while(_b6){_b7=_b6.nextSibling;_bd.appendChild(_b6);_b6=_b7;}}if(_bd.tagName==_ba.tagName){_ae=doc.createElement("span");_ae.className="ieFormatBreakerSpan";_8.place(_ae,_ba,"after");_8.place(_bd,_ae,"after");}else{_8.place(_bd,_ba,"after");}_ac=_ba;_ad=_bd;_ba=_ba.parentNode;}if(_ad){_b6=_ad;if(_b6.nodeType===1||(_b6.nodeType===3&&_b6.nodeValue)){_b5.innerHTML="";}while(_b6){_b7=_b6.nextSibling;_b5.appendChild(_b6);_b6=_b7;}}if(_bb.length){_bc=_bb.pop();var _be=doc.createElement(_bc.tagName);if(_bc.cssText&&_be.style){_be.style.cssText=_bc.cssText;}if(_bc.className){_be.className=_bc.className;}if(_bc.tagName==="FONT"){if(_bc.color){_be.color=_bc.color;}if(_bc.face){_be.face=_bc.face;}if(_bc.size){_be.size=_bc.size;}}_8.place(_be,_b5,"before");while(_bb.length){_bc=_bb.pop();var _bf=doc.createElement(_bc.tagName);if(_bc.cssText&&_bf.style){_bf.style.cssText=_bc.cssText;}if(_bc.className){_bf.className=_bc.className;}if(_bc.tagName==="FONT"){if(_bc.color){_bf.color=_bc.color;}if(_bc.face){_bf.face=_bc.face;}if(_bc.size){_bf.size=_bc.size;}}_be.appendChild(_bf);_be=_bf;}_af=doc.createTextNode(".");_ae.appendChild(_af);_be.appendChild(_af);win.withGlobal(this.window,_e.hitch(this,function(){var _c0=_17.create();_c0.setStart(_af,0);_c0.setEnd(_af,_af.length);_aa.removeAllRanges();_aa.addRange(_c0);_16.collapse(false);_af.parentNode.innerHTML="";}));}else{_ae=doc.createElement("span");_ae.className="ieFormatBreakerSpan";_af=doc.createTextNode(".");_ae.appendChild(_af);_8.place(_ae,_b5,"before");win.withGlobal(this.window,_e.hitch(this,function(){var _c1=_17.create();_c1.setStart(_af,0);_c1.setEnd(_af,_af.length);_aa.removeAllRanges();_aa.addRange(_c1);_16.collapse(false);_af.parentNode.innerHTML="";}));}if(!_b5.firstChild){_8.destroy(_b5);}return true;}}return false;}else{_ab=_aa.getRangeAt(0);rs=_ab.startContainer;if(rs&&rs.nodeType===3){win.withGlobal(this.window,_e.hitch(this,function(){var _c2=_ab.startOffset;if(rs.length<_c2){ret=this._adjustNodeAndOffset(rs,_c2);rs=ret.node;_c2=ret.offset;}txt=rs.nodeValue;_ac=doc.createTextNode(txt.substring(0,_c2));var _c3=txt.substring(_c2);if(_c3!==""){_ad=doc.createTextNode(txt.substring(_c2));}_ae=doc.createElement("span");_af=doc.createTextNode(".");_ae.appendChild(_af);if(_ac.length){_8.place(_ac,rs,"after");}else{_ac=rs;}_8.place(_ae,_ac,"after");if(_ad){_8.place(_ad,_ae,"after");}_8.destroy(rs);var _c4=_17.create();_c4.setStart(_af,0);_c4.setEnd(_af,_af.length);_aa.removeAllRanges();_aa.addRange(_c4);doc.execCommand(_a9);_8.place(_ae.firstChild,_ae,"before");_8.destroy(_ae);_c4.setStart(_af,0);_c4.setEnd(_af,_af.length);_aa.removeAllRanges();_aa.addRange(_c4);_16.collapse(false);_af.parentNode.innerHTML="";}));return true;}}}else{return false;}},_adaptIEList:function(_c5){var _c6=_17.getSelection(this.window);if(_c6.isCollapsed){if(_c6.rangeCount&&!this.queryCommandValue(_c5)){var _c7=_c6.getRangeAt(0);var sc=_c7.startContainer;if(sc&&sc.nodeType==3){if(!_c7.startOffset){win.withGlobal(this.window,_e.hitch(this,function(){var _c8="ul";if(_c5==="insertorderedlist"){_c8="ol";}var _c9=_8.create(_c8);var li=_8.create("li",null,_c9);_8.place(_c9,sc,"before");li.appendChild(sc);_8.create("br",null,_c9,"after");var _ca=_17.create();_ca.setStart(sc,0);_ca.setEnd(sc,sc.length);_c6.removeAllRanges();_c6.addRange(_ca);_16.collapse(true);}));return true;}}}}return false;},_handleTextColorOrProperties:function(_cb,_cc){var _cd=_17.getSelection(this.window);var doc=this.document;var rs,ret,_ce,txt,_cf,_d0,_d1,_d2;_cc=_cc||null;if(_cb&&_cd&&_cd.isCollapsed){if(_cd.rangeCount){_ce=_cd.getRangeAt(0);rs=_ce.startContainer;if(rs&&rs.nodeType===3){win.withGlobal(this.window,_e.hitch(this,function(){var _d3=_ce.startOffset;if(rs.length<_d3){ret=this._adjustNodeAndOffset(rs,_d3);rs=ret.node;_d3=ret.offset;}txt=rs.nodeValue;_cf=doc.createTextNode(txt.substring(0,_d3));var _d4=txt.substring(_d3);if(_d4!==""){_d0=doc.createTextNode(txt.substring(_d3));}_d1=_8.create("span");_d2=doc.createTextNode(".");_d1.appendChild(_d2);var _d5=_8.create("span");_d1.appendChild(_d5);if(_cf.length){_8.place(_cf,rs,"after");}else{_cf=rs;}_8.place(_d1,_cf,"after");if(_d0){_8.place(_d0,_d1,"after");}_8.destroy(rs);var _d6=_17.create();_d6.setStart(_d2,0);_d6.setEnd(_d2,_d2.length);_cd.removeAllRanges();_cd.addRange(_d6);if(has("webkit")){var _d7="color";if(_cb==="hilitecolor"||_cb==="backcolor"){_d7="backgroundColor";}_a.set(_d1,_d7,_cc);_16.remove();_8.destroy(_d5);_d1.innerHTML=" ";_16.selectElement(_d1);this.focus();}else{this.execCommand(_cb,_cc);_8.place(_d1.firstChild,_d1,"before");_8.destroy(_d1);_d6.setStart(_d2,0);_d6.setEnd(_d2,_d2.length);_cd.removeAllRanges();_cd.addRange(_d6);_16.collapse(false);_d2.parentNode.removeChild(_d2);}}));return true;}}}return false;},_adjustNodeAndOffset:function(_d8,_d9){while(_d8.length<_d9&&_d8.nextSibling&&_d8.nextSibling.nodeType===3){_d9=_d9-_d8.length;_d8=_d8.nextSibling;}return {"node":_d8,"offset":_d9};},_tagNamesForCommand:function(_da){if(_da==="bold"){return ["b","strong"];}else{if(_da==="italic"){return ["i","em"];}else{if(_da==="strikethrough"){return ["s","strike"];}else{if(_da==="superscript"){return ["sup"];}else{if(_da==="subscript"){return ["sub"];}else{if(_da==="underline"){return ["u"];}}}}}}return [];},_stripBreakerNodes:function(_db){win.withGlobal(this.window,_e.hitch(this,function(){var _dc=_f(".ieFormatBreakerSpan",_db);var i;for(i=0;i<_dc.length;i++){var b=_dc[i];while(b.firstChild){_8.place(b.firstChild,b,"before");}_8.destroy(b);}}));return _db;}});return _1b;});
\ No newline at end of file +define("dijit/_editor/RichText",["dojo/_base/array","dojo/_base/config","dojo/_base/declare","dojo/_base/Deferred","dojo/dom","dojo/dom-attr","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/_base/event","dojo/_base/kernel","dojo/keys","dojo/_base/lang","dojo/on","dojo/query","dojo/ready","dojo/sniff","dojo/topic","dojo/_base/unload","dojo/_base/url","dojo/_base/window","../_Widget","../_CssStateMixin","./selection","./range","./html","../focus","../main"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,on,_f,_10,has,_11,_12,_13,win,_14,_15,_16,_17,_18,_19,_1a){var _1b=_3("dijit._editor.RichText",[_14,_15],{constructor:function(_1c){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};if(_1c&&_e.isString(_1c.value)){this.value=_1c.value;}this.onLoadDeferred=new _4();},baseClass:"dijitEditor",inheritWidth:false,focusOnLoad:false,name:"",styleSheets:"",height:"300px",minHeight:"1em",isClosed:true,isLoaded:false,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",_NAME_CONTENT_SEP:"@@**%%:%%**@@",onLoadDeferred:null,isTabIndent:false,disableSpellCheck:false,postCreate:function(){if("textarea"===this.domNode.tagName.toLowerCase()){console.warn("RichText should not be used with the TEXTAREA tag. See dijit._editor.RichText docs.");}this.contentPreFilters=[_e.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);if(has("mozilla")){this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters);this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters);}if(has("webkit")){this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters);this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters);}if(has("ie")){this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters);this.contentDomPostFilters=[_e.hitch(this,this._stripBreakerNodes)].concat(this.contentDomPostFilters);}this.inherited(arguments);_11.publish(_1a._scopeName+"._editor.RichText::init",this);this.open();this.setupDefaultShortcuts();},setupDefaultShortcuts:function(){var _1d=_e.hitch(this,function(cmd,arg){return function(){return !this.execCommand(cmd,arg);};});var _1e={b:_1d("bold"),i:_1d("italic"),u:_1d("underline"),a:_1d("selectall"),s:function(){this.save(true);},m:function(){this.isTabIndent=!this.isTabIndent;},"1":_1d("formatblock","h1"),"2":_1d("formatblock","h2"),"3":_1d("formatblock","h3"),"4":_1d("formatblock","h4"),"\\":_1d("insertunorderedlist")};if(!has("ie")){_1e.Z=_1d("redo");}var key;for(key in _1e){this.addKeyHandler(key,true,false,_1e[key]);}},events:["onKeyPress","onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:false,_localizeEditorCommands:function(){if(_1b._editorCommandsLocalized){this._local2NativeFormatNames=_1b._local2NativeFormatNames;this._native2LocalFormatNames=_1b._native2LocalFormatNames;return;}_1b._editorCommandsLocalized=true;_1b._local2NativeFormatNames={};_1b._native2LocalFormatNames={};this._local2NativeFormatNames=_1b._local2NativeFormatNames;this._native2LocalFormatNames=_1b._native2LocalFormatNames;var _1f=["div","p","pre","h1","h2","h3","h4","h5","h6","ol","ul","address"];var _20="",_21,i=0;while((_21=_1f[i++])){if(_21.charAt(1)!=="l"){_20+="<"+_21+"><span>content</span></"+_21+"><br/>";}else{_20+="<"+_21+"><li>content</li></"+_21+"><br/>";}}var _22={position:"absolute",top:"0px",zIndex:10,opacity:0.01};var div=_8.create("div",{style:_22,innerHTML:_20});this.ownerDocumentBody.appendChild(div);var _23=_e.hitch(this,function(){var _24=div.firstChild;while(_24){try{this._sCall("selectElement",[_24.firstChild]);var _25=_24.tagName.toLowerCase();this._local2NativeFormatNames[_25]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[_25]]=_25;_24=_24.nextSibling.nextSibling;}catch(e){}}_8.destroy(div);});this.defer(_23);},open:function(_26){if(!this.onLoadDeferred||this.onLoadDeferred.fired>=0){this.onLoadDeferred=new _4();}if(!this.isClosed){this.close();}_11.publish(_1a._scopeName+"._editor.RichText::open",this);if(arguments.length===1&&_26.nodeName){this.domNode=_26;}var dn=this.domNode;var _27;if(_e.isString(this.value)){_27=this.value;delete this.value;dn.innerHTML="";}else{if(dn.nodeName&&dn.nodeName.toLowerCase()=="textarea"){var ta=(this.textarea=dn);this.name=ta.name;_27=ta.value;dn=this.domNode=this.ownerDocument.createElement("div");dn.setAttribute("widgetId",this.id);ta.removeAttribute("widgetId");dn.cssText=ta.cssText;dn.className+=" "+ta.className;_8.place(dn,ta,"before");var _28=_e.hitch(this,function(){_a.set(ta,{display:"block",position:"absolute",top:"-1000px"});if(has("ie")){var s=ta.style;this.__overflow=s.overflow;s.overflow="hidden";}});if(has("ie")){this.defer(_28,10);}else{_28();}if(ta.form){var _29=ta.value;this.reset=function(){var _2a=this.getValue();if(_2a!==_29){this.replaceValue(_29);}};on(ta.form,"submit",_e.hitch(this,function(){_6.set(ta,"disabled",this.disabled);ta.value=this.getValue();}));}}else{_27=_18.getChildrenHtml(dn);dn.innerHTML="";}}this.value=_27;if(dn.nodeName&&dn.nodeName==="LI"){dn.innerHTML=" <br>";}this.header=dn.ownerDocument.createElement("div");dn.appendChild(this.header);this.editingArea=dn.ownerDocument.createElement("div");dn.appendChild(this.editingArea);this.footer=dn.ownerDocument.createElement("div");dn.appendChild(this.footer);if(!this.name){this.name=this.id+"_AUTOGEN";}if(this.name!==""&&(!_2["useXDomain"]||_2["allowXdRichTextSave"])){var _2b=_5.byId(_1a._scopeName+"._editor.RichText.value");if(_2b&&_2b.value!==""){var _2c=_2b.value.split(this._SEPARATOR),i=0,dat;while((dat=_2c[i++])){var _2d=dat.split(this._NAME_CONTENT_SEP);if(_2d[0]===this.name){_27=_2d[1];_2c=_2c.splice(i,1);_2b.value=_2c.join(this._SEPARATOR);break;}}}if(!_1b._globalSaveHandler){_1b._globalSaveHandler={};_12.addOnUnload(function(){var id;for(id in _1b._globalSaveHandler){var f=_1b._globalSaveHandler[id];if(_e.isFunction(f)){f();}}});}_1b._globalSaveHandler[this.id]=_e.hitch(this,"_saveContent");}this.isClosed=false;var ifr=(this.editorObject=this.iframe=this.ownerDocument.createElement("iframe"));ifr.id=this.id+"_iframe";ifr.style.border="none";ifr.style.width="100%";if(this._layoutMode){ifr.style.height="100%";}else{if(has("ie")>=7){if(this.height){ifr.style.height=this.height;}if(this.minHeight){ifr.style.minHeight=this.minHeight;}}else{ifr.style.height=this.height?this.height:this.minHeight;}}ifr.frameBorder=0;ifr._loadFunc=_e.hitch(this,function(w){this.window=w;this.document=this.window.document;if(has("ie")){this._localizeEditorCommands();}this.onLoad(_27);});var src=this._getIframeDocTxt(),s="javascript: '"+src.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'";ifr.setAttribute("src",s);this.editingArea.appendChild(ifr);if(has("safari")<=4){src=ifr.getAttribute("src");if(!src||src.indexOf("javascript")===-1){this.defer(function(){ifr.setAttribute("src",s);});}}if(dn.nodeName==="LI"){dn.lastChild.style.marginTop="-1.2em";}_7.add(this.domNode,this.baseClass);},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var _2e=_a.getComputedStyle(this.domNode);var _2f="";var _30=true;if(has("ie")||has("webkit")||(!this.height&&!has("mozilla"))){_2f="<div id='dijitEditorBody'></div>";_30=false;}else{if(has("mozilla")){this._cursorToStart=true;_2f=" ";}}var _31=[_2e.fontWeight,_2e.fontSize,_2e.fontFamily].join(" ");var _32=_2e.lineHeight;if(_32.indexOf("px")>=0){_32=parseFloat(_32)/parseFloat(_2e.fontSize);}else{if(_32.indexOf("em")>=0){_32=parseFloat(_32);}else{_32="normal";}}var _33="";var _34=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(_35){_35=_35.replace(/^;/ig,"")+";";var s=_35.split(":")[0];if(s){s=_e.trim(s);s=s.toLowerCase();var i;var sC="";for(i=0;i<s.length;i++){var c=s.charAt(i);switch(c){case "-":i++;c=s.charAt(i).toUpperCase();default:sC+=c;}}_a.set(_34.domNode,sC,"");}_33+=_35+";";});var _36=_f("label[for=\""+this.id+"\"]");return [this.isLeftToRight()?"<html>\n<head>\n":"<html dir='rtl'>\n<head>\n",(has("mozilla")&&_36.length?"<title>"+_36[0].innerHTML+"</title>\n":""),"<meta http-equiv='Content-Type' content='text/html'>\n","<style>\n","\tbody,html {\n","\t\tbackground:transparent;\n","\t\tpadding: 1px 0 0 0;\n","\t\tmargin: -1px 0 0 0;\n",((has("webkit"))?"\t\twidth: 100%;\n":""),((has("webkit"))?"\t\theight: 100%;\n":""),"\t}\n","\tbody{\n","\t\ttop:0px;\n","\t\tleft:0px;\n","\t\tright:0px;\n","\t\tfont:",_31,";\n",((this.height||has("opera"))?"":"\t\tposition: fixed;\n"),"\t\tmin-height:",this.minHeight,";\n","\t\tline-height:",_32,";\n","\t}\n","\tp{ margin: 1em 0; }\n",(!_30&&!this.height?"\tbody,html {overflow-y: hidden;}\n":""),"\t#dijitEditorBody{overflow-x: auto; overflow-y:"+(this.height?"auto;":"hidden;")+" outline: 0px;}\n","\tli > ul:-moz-first-node, li > ol:-moz-first-node{ padding-top: 1.2em; }\n",(!has("ie")?"\tli{ min-height:1.2em; }\n":""),"</style>\n",this._applyEditingAreaStyleSheets(),"\n","</head>\n<body ",(_30?"id='dijitEditorBody' ":""),"onload='frameElement && frameElement._loadFunc(window,document)' ","style='"+_33+"'>",_2f,"</body>\n</html>"].join("");},_applyEditingAreaStyleSheets:function(){var _37=[];if(this.styleSheets){_37=this.styleSheets.split(";");this.styleSheets="";}_37=_37.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];var _38="",i=0,url;while((url=_37[i++])){var _39=(new _13(win.global.location,url)).toString();this.editingAreaStyleSheets.push(_39);_38+="<link rel=\"stylesheet\" type=\"text/css\" href=\""+_39+"\"/>";}return _38;},addStyleSheet:function(uri){var url=uri.toString();if(url.charAt(0)==="."||(url.charAt(0)!=="/"&&!uri.host)){url=(new _13(win.global.location,url)).toString();}if(_1.indexOf(this.editingAreaStyleSheets,url)>-1){return;}this.editingAreaStyleSheets.push(url);this.onLoadDeferred.then(_e.hitch(this,function(){if(this.document.createStyleSheet){this.document.createStyleSheet(url);}else{var _3a=this.document.getElementsByTagName("head")[0];var _3b=this.document.createElement("link");_3b.rel="stylesheet";_3b.type="text/css";_3b.href=url;_3a.appendChild(_3b);}}));},removeStyleSheet:function(uri){var url=uri.toString();if(url.charAt(0)==="."||(url.charAt(0)!=="/"&&!uri.host)){url=(new _13(win.global.location,url)).toString();}var _3c=_1.indexOf(this.editingAreaStyleSheets,url);if(_3c===-1){return;}delete this.editingAreaStyleSheets[_3c];_f("link:[href=\""+url+"\"]",this.window.document).orphan();},disabled:false,_mozSettingProps:{"styleWithCSS":false},_setDisabledAttr:function(_3d){_3d=!!_3d;this._set("disabled",_3d);if(!this.isLoaded){return;}if(has("ie")||has("webkit")||has("opera")){var _3e=has("ie")&&(this.isLoaded||!this.focusOnLoad);if(_3e){this.editNode.unselectable="on";}this.editNode.contentEditable=!_3d;if(_3e){this.defer(function(){if(this.editNode){this.editNode.unselectable="off";}});}}else{try{this.document.designMode=(_3d?"off":"on");}catch(e){return;}if(!_3d&&this._mozSettingProps){var ps=this._mozSettingProps;var n;for(n in ps){if(ps.hasOwnProperty(n)){try{this.document.execCommand(n,false,ps[n]);}catch(e2){}}}}}this._disabledOK=true;},onLoad:function(_3f){if(!this.window.__registeredWindow){this.window.__registeredWindow=true;this._iframeRegHandle=_19.registerIframe(this.iframe);}if(!has("ie")&&!has("webkit")&&(this.height||has("mozilla"))){this.editNode=this.document.body;}else{this.editNode=this.document.body.firstChild;var _40=this;if(has("ie")){this.tabStop=_8.create("div",{tabIndex:-1},this.editingArea);this.iframe.onfocus=function(){_40.editNode.setActive();};}}this.focusNode=this.editNode;var _41=this.events.concat(this.captureEvents);var ap=this.iframe?this.document:this.editNode;_1.forEach(_41,function(_42){this.connect(ap,_42.toLowerCase(),_42);},this);this.connect(ap,"onmouseup","onClick");if(has("ie")){this.connect(this.document,"onmousedown","_onIEMouseDown");this.editNode.style.zoom=1;}else{this.connect(this.document,"onmousedown",function(){delete this._cursorToStart;});}if(has("webkit")){this._webkitListener=this.connect(this.document,"onmouseup","onDisplayChanged");this.connect(this.document,"onmousedown",function(e){var t=e.target;if(t&&(t===this.document.body||t===this.document)){this.defer("placeCursorAtEnd");}});}if(has("ie")){try{this.document.execCommand("RespectVisibilityInDesign",true,null);}catch(e){}}this.isLoaded=true;this.set("disabled",this.disabled);var _43=_e.hitch(this,function(){this.setValue(_3f);if(this.onLoadDeferred){this.onLoadDeferred.resolve(true);}this.onDisplayChanged();if(this.focusOnLoad){_10(_e.hitch(this,"defer","focus",this.updateInterval));}this.value=this.getValue(true);});if(this.setValueDeferred){this.setValueDeferred.then(_43);}else{_43();}},onKeyDown:function(e){if(e.keyCode===_d.TAB&&this.isTabIndent){_b.stop(e);if(this.queryCommandEnabled((e.shiftKey?"outdent":"indent"))){this.execCommand((e.shiftKey?"outdent":"indent"));}}if(has("ie")){if(e.keyCode==_d.TAB&&!this.isTabIndent){if(e.shiftKey&&!e.ctrlKey&&!e.altKey){this.iframe.focus();}else{if(!e.shiftKey&&!e.ctrlKey&&!e.altKey){this.tabStop.focus();}}}else{if(e.keyCode===_d.BACKSPACE&&this.document.selection.type==="Control"){_b.stop(e);this.execCommand("delete");}else{if((65<=e.keyCode&&e.keyCode<=90)||(e.keyCode>=37&&e.keyCode<=40)){e.charCode=e.keyCode;this.onKeyPress(e);}}}}if(has("ff")){if(e.keyCode===_d.PAGE_UP||e.keyCode===_d.PAGE_DOWN){if(this.editNode.clientHeight>=this.editNode.scrollHeight){e.preventDefault();}}}return true;},onKeyUp:function(){},setDisabled:function(_44){_c.deprecated("dijit.Editor::setDisabled is deprecated","use dijit.Editor::attr(\"disabled\",boolean) instead",2);this.set("disabled",_44);},_setValueAttr:function(_45){this.setValue(_45);},_setDisableSpellCheckAttr:function(_46){if(this.document){_6.set(this.document.body,"spellcheck",!_46);}else{this.onLoadDeferred.then(_e.hitch(this,function(){_6.set(this.document.body,"spellcheck",!_46);}));}this._set("disableSpellCheck",_46);},onKeyPress:function(e){var c=(e.keyChar&&e.keyChar.toLowerCase())||e.keyCode,_47=this._keyHandlers[c],_48=arguments;if(_47&&!e.altKey){_1.some(_47,function(h){if(!(h.shift^e.shiftKey)&&!(h.ctrl^(e.ctrlKey||e.metaKey))){if(!h.handler.apply(this,_48)){e.preventDefault();}return true;}},this);}if(!this._onKeyHitch){this._onKeyHitch=_e.hitch(this,"onKeyPressed");}this.defer("_onKeyHitch",1);return true;},addKeyHandler:function(key,_49,_4a,_4b){if(!_e.isArray(this._keyHandlers[key])){this._keyHandlers[key]=[];}this._keyHandlers[key].push({shift:_4a||false,ctrl:_49||false,handler:_4b});},onKeyPressed:function(){this.onDisplayChanged();},onClick:function(e){this.onDisplayChanged(e);},_onIEMouseDown:function(){if(!this.focused&&!this.disabled){this.focus();}},_onBlur:function(e){this.inherited(arguments);var _4c=this.getValue(true);if(_4c!==this.value){this.onChange(_4c);}this._set("value",_4c);},_onFocus:function(e){if(!this.disabled){if(!this._disabledOK){this.set("disabled",false);}this.inherited(arguments);}},blur:function(){if(!has("ie")&&this.window.document.documentElement&&this.window.document.documentElement.focus){this.window.document.documentElement.focus();}else{if(this.ownerDocumentBody.focus){this.ownerDocumentBody.focus();}}},focus:function(){if(!this.isLoaded){this.focusOnLoad=true;return;}if(this._cursorToStart){delete this._cursorToStart;if(this.editNode.childNodes){this.placeCursorAtStart();return;}}if(!has("ie")){_19.focus(this.iframe);}else{if(this.editNode&&this.editNode.focus){this.iframe.fireEvent("onfocus",document.createEventObject());}}},updateInterval:200,_updateTimer:null,onDisplayChanged:function(){if(this._updateTimer){this._updateTimer.remove();}this._updateTimer=this.defer("onNormalizedDisplayChanged",this.updateInterval);},onNormalizedDisplayChanged:function(){delete this._updateTimer;},onChange:function(){},_normalizeCommand:function(cmd,_4d){var _4e=cmd.toLowerCase();if(_4e==="formatblock"){if(has("safari")&&_4d===undefined){_4e="heading";}}else{if(_4e==="hilitecolor"&&!has("mozilla")){_4e="backcolor";}}return _4e;},_qcaCache:{},queryCommandAvailable:function(_4f){var ca=this._qcaCache[_4f];if(ca!==undefined){return ca;}return (this._qcaCache[_4f]=this._queryCommandAvailable(_4f));},_queryCommandAvailable:function(_50){var ie=1;var _51=1<<1;var _52=1<<2;var _53=1<<3;function _54(_55){return {ie:Boolean(_55&ie),mozilla:Boolean(_55&_51),webkit:Boolean(_55&_52),opera:Boolean(_55&_53)};};var _56=null;switch(_50.toLowerCase()){case "bold":case "italic":case "underline":case "subscript":case "superscript":case "fontname":case "fontsize":case "forecolor":case "hilitecolor":case "justifycenter":case "justifyfull":case "justifyleft":case "justifyright":case "delete":case "selectall":case "toggledir":_56=_54(_51|ie|_52|_53);break;case "createlink":case "unlink":case "removeformat":case "inserthorizontalrule":case "insertimage":case "insertorderedlist":case "insertunorderedlist":case "indent":case "outdent":case "formatblock":case "inserthtml":case "undo":case "redo":case "strikethrough":case "tabindent":_56=_54(_51|ie|_53|_52);break;case "blockdirltr":case "blockdirrtl":case "dirltr":case "dirrtl":case "inlinedirltr":case "inlinedirrtl":_56=_54(ie);break;case "cut":case "copy":case "paste":_56=_54(ie|_51|_52|_53);break;case "inserttable":_56=_54(_51|ie);break;case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":_56=_54(ie|_51);break;default:return false;}return (has("ie")&&_56.ie)||(has("mozilla")&&_56.mozilla)||(has("webkit")&&_56.webkit)||(has("opera")&&_56.opera);},execCommand:function(_57,_58){var _59;this.focus();_57=this._normalizeCommand(_57,_58);if(_58!==undefined){if(_57==="heading"){throw new Error("unimplemented");}else{if((_57==="formatblock")&&has("ie")){_58="<"+_58+">";}}}var _5a="_"+_57+"Impl";if(this[_5a]){_59=this[_5a](_58);}else{_58=arguments.length>1?_58:null;if(_58||_57!=="createlink"){_59=this.document.execCommand(_57,false,_58);}}this.onDisplayChanged();return _59;},queryCommandEnabled:function(_5b){if(this.disabled||!this._disabledOK){return false;}_5b=this._normalizeCommand(_5b);var _5c="_"+_5b+"EnabledImpl";if(this[_5c]){return this[_5c](_5b);}else{return this._browserQueryCommandEnabled(_5b);}},queryCommandState:function(_5d){if(this.disabled||!this._disabledOK){return false;}_5d=this._normalizeCommand(_5d);try{return this.document.queryCommandState(_5d);}catch(e){return false;}},queryCommandValue:function(_5e){if(this.disabled||!this._disabledOK){return false;}var r;_5e=this._normalizeCommand(_5e);if(has("ie")&&_5e==="formatblock"){r=this._native2LocalFormatNames[this.document.queryCommandValue(_5e)];}else{if(has("mozilla")&&_5e==="hilitecolor"){var _5f;try{_5f=this.document.queryCommandValue("styleWithCSS");}catch(e){_5f=false;}this.document.execCommand("styleWithCSS",false,true);r=this.document.queryCommandValue(_5e);this.document.execCommand("styleWithCSS",false,_5f);}else{r=this.document.queryCommandValue(_5e);}}return r;},_sCall:function(_60,_61){return win.withGlobal(this.window,_60,_16,_61);},placeCursorAtStart:function(){this.focus();var _62=false;if(has("mozilla")){var _63=this.editNode.firstChild;while(_63){if(_63.nodeType===3){if(_63.nodeValue.replace(/^\s+|\s+$/g,"").length>0){_62=true;this._sCall("selectElement",[_63]);break;}}else{if(_63.nodeType===1){_62=true;var tg=_63.tagName?_63.tagName.toLowerCase():"";if(/br|input|img|base|meta|area|basefont|hr|link/.test(tg)){this._sCall("selectElement",[_63]);}else{this._sCall("selectElementChildren",[_63]);}break;}}_63=_63.nextSibling;}}else{_62=true;this._sCall("selectElementChildren",[this.editNode]);}if(_62){this._sCall("collapse",[true]);}},placeCursorAtEnd:function(){this.focus();var _64=false;if(has("mozilla")){var _65=this.editNode.lastChild;while(_65){if(_65.nodeType===3){if(_65.nodeValue.replace(/^\s+|\s+$/g,"").length>0){_64=true;this._sCall("selectElement",[_65]);break;}}else{if(_65.nodeType===1){_64=true;this._sCall("selectElement",[_65.lastChild||_65]);break;}}_65=_65.previousSibling;}}else{_64=true;this._sCall("selectElementChildren",[this.editNode]);}if(_64){this._sCall("collapse",[false]);}},getValue:function(_66){if(this.textarea){if(this.isClosed||!this.isLoaded){return this.textarea.value;}}return this._postFilterContent(null,_66);},_getValueAttr:function(){return this.getValue(true);},setValue:function(_67){if(!this.isLoaded){this.onLoadDeferred.then(_e.hitch(this,function(){this.setValue(_67);}));return;}this._cursorToStart=true;if(this.textarea&&(this.isClosed||!this.isLoaded)){this.textarea.value=_67;}else{_67=this._preFilterContent(_67);var _68=this.isClosed?this.domNode:this.editNode;if(_67&&has("mozilla")&&_67.toLowerCase()==="<p></p>"){_67="<p> </p>";}if(!_67&&has("webkit")){_67=" ";}_68.innerHTML=_67;this._preDomFilterContent(_68);}this.onDisplayChanged();this._set("value",this.getValue(true));},replaceValue:function(_69){if(this.isClosed){this.setValue(_69);}else{if(this.window&&this.window.getSelection&&!has("mozilla")){this.setValue(_69);}else{if(this.window&&this.window.getSelection){_69=this._preFilterContent(_69);this.execCommand("selectall");if(!_69){this._cursorToStart=true;_69=" ";}this.execCommand("inserthtml",_69);this._preDomFilterContent(this.editNode);}else{if(this.document&&this.document.selection){this.setValue(_69);}}}}this._set("value",this.getValue(true));},_preFilterContent:function(_6a){var ec=_6a;_1.forEach(this.contentPreFilters,function(ef){if(ef){ec=ef(ec);}});return ec;},_preDomFilterContent:function(dom){dom=dom||this.editNode;_1.forEach(this.contentDomPreFilters,function(ef){if(ef&&_e.isFunction(ef)){ef(dom);}},this);},_postFilterContent:function(dom,_6b){var ec;if(!_e.isString(dom)){dom=dom||this.editNode;if(this.contentDomPostFilters.length){if(_6b){dom=_e.clone(dom);}_1.forEach(this.contentDomPostFilters,function(ef){dom=ef(dom);});}ec=_18.getChildrenHtml(dom);}else{ec=dom;}if(!_e.trim(ec.replace(/^\xA0\xA0*/,"").replace(/\xA0\xA0*$/,"")).length){ec="";}_1.forEach(this.contentPostFilters,function(ef){ec=ef(ec);});return ec;},_saveContent:function(){var _6c=_5.byId(_1a._scopeName+"._editor.RichText.value");if(_6c){if(_6c.value){_6c.value+=this._SEPARATOR;}_6c.value+=this.name+this._NAME_CONTENT_SEP+this.getValue(true);}},escapeXml:function(str,_6d){str=str.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");if(!_6d){str=str.replace(/'/gm,"'");}return str;},getNodeHtml:function(_6e){_c.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead",2);return _18.getNodeHtml(_6e);},getNodeChildrenHtml:function(dom){_c.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return _18.getChildrenHtml(dom);},close:function(_6f){if(this.isClosed){return;}if(!arguments.length){_6f=true;}if(_6f){this._set("value",this.getValue(true));}if(this.interval){clearInterval(this.interval);}if(this._webkitListener){this.disconnect(this._webkitListener);delete this._webkitListener;}if(has("ie")){this.iframe.onfocus=null;}this.iframe._loadFunc=null;if(this._iframeRegHandle){this._iframeRegHandle.remove();delete this._iframeRegHandle;}if(this.textarea){var s=this.textarea.style;s.position="";s.left=s.top="";if(has("ie")){s.overflow=this.__overflow;this.__overflow=null;}this.textarea.value=this.value;_8.destroy(this.domNode);this.domNode=this.textarea;}else{this.domNode.innerHTML=this.value;}delete this.iframe;_7.remove(this.domNode,this.baseClass);this.isClosed=true;this.isLoaded=false;delete this.editNode;delete this.focusNode;if(this.window&&this.window._frameElement){this.window._frameElement=null;}this.window=null;this.document=null;this.editingArea=null;this.editorObject=null;},destroy:function(){if(!this.isClosed){this.close(false);}if(this._updateTimer){this._updateTimer.remove();}this.inherited(arguments);if(_1b._globalSaveHandler){delete _1b._globalSaveHandler[this.id];}},_removeMozBogus:function(_70){return _70.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"");},_removeWebkitBogus:function(_71){_71=_71.replace(/\sclass="webkit-block-placeholder"/gi,"");_71=_71.replace(/\sclass="apple-style-span"/gi,"");_71=_71.replace(/<meta charset=\"utf-8\" \/>/gi,"");return _71;},_normalizeFontStyle:function(_72){return _72.replace(/<(\/)?strong([ \>])/gi,"<$1b$2").replace(/<(\/)?em([ \>])/gi,"<$1i$2");},_preFixUrlAttributes:function(_73){return _73.replace(/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl=$2$3$5$2").replace(/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl=$2$3$5$2");},_browserQueryCommandEnabled:function(_74){if(!_74){return false;}var _75=has("ie")?this.document.selection.createRange():this.document;try{return _75.queryCommandEnabled(_74);}catch(e){return false;}},_createlinkEnabledImpl:function(){var _76=true;if(has("opera")){var sel=this.window.getSelection();if(sel.isCollapsed){_76=true;}else{_76=this.document.queryCommandEnabled("createlink");}}else{_76=this._browserQueryCommandEnabled("createlink");}return _76;},_unlinkEnabledImpl:function(){var _77=true;if(has("mozilla")||has("webkit")){_77=this._sCall("hasAncestorElement",["a"]);}else{_77=this._browserQueryCommandEnabled("unlink");}return _77;},_inserttableEnabledImpl:function(){var _78=true;if(has("mozilla")||has("webkit")){_78=true;}else{_78=this._browserQueryCommandEnabled("inserttable");}return _78;},_cutEnabledImpl:function(){var _79=true;if(has("webkit")){var sel=this.window.getSelection();if(sel){sel=sel.toString();}_79=!!sel;}else{_79=this._browserQueryCommandEnabled("cut");}return _79;},_copyEnabledImpl:function(){var _7a=true;if(has("webkit")){var sel=this.window.getSelection();if(sel){sel=sel.toString();}_7a=!!sel;}else{_7a=this._browserQueryCommandEnabled("copy");}return _7a;},_pasteEnabledImpl:function(){var _7b=true;if(has("webkit")){return true;}else{_7b=this._browserQueryCommandEnabled("paste");}return _7b;},_inserthorizontalruleImpl:function(_7c){if(has("ie")){return this._inserthtmlImpl("<hr>");}return this.document.execCommand("inserthorizontalrule",false,_7c);},_unlinkImpl:function(_7d){if((this.queryCommandEnabled("unlink"))&&(has("mozilla")||has("webkit"))){var a=this._sCall("getAncestorElement",["a"]);this._sCall("selectElement",[a]);return this.document.execCommand("unlink",false,null);}return this.document.execCommand("unlink",false,_7d);},_hilitecolorImpl:function(_7e){var _7f;var _80=this._handleTextColorOrProperties("hilitecolor",_7e);if(!_80){if(has("mozilla")){this.document.execCommand("styleWithCSS",false,true);_7f=this.document.execCommand("hilitecolor",false,_7e);this.document.execCommand("styleWithCSS",false,false);}else{_7f=this.document.execCommand("hilitecolor",false,_7e);}}return _7f;},_backcolorImpl:function(_81){if(has("ie")){_81=_81?_81:null;}var _82=this._handleTextColorOrProperties("backcolor",_81);if(!_82){_82=this.document.execCommand("backcolor",false,_81);}return _82;},_forecolorImpl:function(_83){if(has("ie")){_83=_83?_83:null;}var _84=false;_84=this._handleTextColorOrProperties("forecolor",_83);if(!_84){_84=this.document.execCommand("forecolor",false,_83);}return _84;},_inserthtmlImpl:function(_85){_85=this._preFilterContent(_85);var rv=true;if(has("ie")){var _86=this.document.selection.createRange();if(this.document.selection.type.toUpperCase()==="CONTROL"){var n=_86.item(0);while(_86.length){_86.remove(_86.item(0));}n.outerHTML=_85;}else{_86.pasteHTML(_85);}_86.select();}else{if(has("mozilla")&&!_85.length){this._sCall("remove");}else{rv=this.document.execCommand("inserthtml",false,_85);}}return rv;},_boldImpl:function(_87){var _88=false;if(has("ie")){this._adaptIESelection();_88=this._adaptIEFormatAreaAndExec("bold");}if(!_88){_88=this.document.execCommand("bold",false,_87);}return _88;},_italicImpl:function(_89){var _8a=false;if(has("ie")){this._adaptIESelection();_8a=this._adaptIEFormatAreaAndExec("italic");}if(!_8a){_8a=this.document.execCommand("italic",false,_89);}return _8a;},_underlineImpl:function(_8b){var _8c=false;if(has("ie")){this._adaptIESelection();_8c=this._adaptIEFormatAreaAndExec("underline");}if(!_8c){_8c=this.document.execCommand("underline",false,_8b);}return _8c;},_strikethroughImpl:function(_8d){var _8e=false;if(has("ie")){this._adaptIESelection();_8e=this._adaptIEFormatAreaAndExec("strikethrough");}if(!_8e){_8e=this.document.execCommand("strikethrough",false,_8d);}return _8e;},_superscriptImpl:function(_8f){var _90=false;if(has("ie")){this._adaptIESelection();_90=this._adaptIEFormatAreaAndExec("superscript");}if(!_90){_90=this.document.execCommand("superscript",false,_8f);}return _90;},_subscriptImpl:function(_91){var _92=false;if(has("ie")){this._adaptIESelection();_92=this._adaptIEFormatAreaAndExec("subscript");}if(!_92){_92=this.document.execCommand("subscript",false,_91);}return _92;},_fontnameImpl:function(_93){var _94;if(has("ie")){_94=this._handleTextColorOrProperties("fontname",_93);}if(!_94){_94=this.document.execCommand("fontname",false,_93);}return _94;},_fontsizeImpl:function(_95){var _96;if(has("ie")){_96=this._handleTextColorOrProperties("fontsize",_95);}if(!_96){_96=this.document.execCommand("fontsize",false,_95);}return _96;},_insertorderedlistImpl:function(_97){var _98=false;if(has("ie")){_98=this._adaptIEList("insertorderedlist",_97);}if(!_98){_98=this.document.execCommand("insertorderedlist",false,_97);}return _98;},_insertunorderedlistImpl:function(_99){var _9a=false;if(has("ie")){_9a=this._adaptIEList("insertunorderedlist",_99);}if(!_9a){_9a=this.document.execCommand("insertunorderedlist",false,_99);}return _9a;},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header);},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer);},_getNodeChildrenHeight:function(_9b){var h=0;if(_9b&&_9b.childNodes){var i;for(i=0;i<_9b.childNodes.length;i++){var _9c=_9.position(_9b.childNodes[i]);h+=_9c.h;}}return h;},_isNodeEmpty:function(_9d,_9e){if(_9d.nodeType===1){if(_9d.childNodes.length>0){return this._isNodeEmpty(_9d.childNodes[0],_9e);}return true;}else{if(_9d.nodeType===3){return (_9d.nodeValue.substring(_9e)==="");}}return false;},_removeStartingRangeFromRange:function(_9f,_a0){if(_9f.nextSibling){_a0.setStart(_9f.nextSibling,0);}else{var _a1=_9f.parentNode;while(_a1&&_a1.nextSibling==null){_a1=_a1.parentNode;}if(_a1){_a0.setStart(_a1.nextSibling,0);}}return _a0;},_adaptIESelection:function(){var _a2=_17.getSelection(this.window);if(_a2&&_a2.rangeCount&&!_a2.isCollapsed){var _a3=_a2.getRangeAt(0);var _a4=_a3.startContainer;var _a5=_a3.startOffset;while(_a4.nodeType===3&&_a5>=_a4.length&&_a4.nextSibling){_a5=_a5-_a4.length;_a4=_a4.nextSibling;}var _a6=null;while(this._isNodeEmpty(_a4,_a5)&&_a4!==_a6){_a6=_a4;_a3=this._removeStartingRangeFromRange(_a4,_a3);_a4=_a3.startContainer;_a5=0;}_a2.removeAllRanges();_a2.addRange(_a3);}},_adaptIEFormatAreaAndExec:function(_a7){var _a8=_17.getSelection(this.window);var doc=this.document;var rs,ret,_a9,txt,_aa,_ab,_ac,_ad;if(_a7&&_a8&&_a8.isCollapsed){var _ae=this.queryCommandValue(_a7);if(_ae){var _af=this._tagNamesForCommand(_a7);_a9=_a8.getRangeAt(0);var fs=_a9.startContainer;if(fs.nodeType===3){var _b0=_a9.endOffset;if(fs.length<_b0){ret=this._adjustNodeAndOffset(rs,_b0);fs=ret.node;_b0=ret.offset;}}var _b1;while(fs&&fs!==this.editNode){var _b2=fs.tagName?fs.tagName.toLowerCase():"";if(_1.indexOf(_af,_b2)>-1){_b1=fs;break;}fs=fs.parentNode;}if(_b1){rs=_a9.startContainer;var _b3=doc.createElement(_b1.tagName);_8.place(_b3,_b1,"after");if(rs&&rs.nodeType===3){var _b4,_b5;var _b6=_a9.endOffset;if(rs.length<_b6){ret=this._adjustNodeAndOffset(rs,_b6);rs=ret.node;_b6=ret.offset;}txt=rs.nodeValue;_aa=doc.createTextNode(txt.substring(0,_b6));var _b7=txt.substring(_b6,txt.length);if(_b7){_ab=doc.createTextNode(_b7);}_8.place(_aa,rs,"before");if(_ab){_ac=doc.createElement("span");_ac.className="ieFormatBreakerSpan";_8.place(_ac,rs,"after");_8.place(_ab,_ac,"after");_ab=_ac;}_8.destroy(rs);var _b8=_aa.parentNode;var _b9=[];var _ba;while(_b8!==_b1){var tg=_b8.tagName;_ba={tagName:tg};_b9.push(_ba);var _bb=doc.createElement(tg);if(_b8.style){if(_bb.style){if(_b8.style.cssText){_bb.style.cssText=_b8.style.cssText;_ba.cssText=_b8.style.cssText;}}}if(_b8.tagName==="FONT"){if(_b8.color){_bb.color=_b8.color;_ba.color=_b8.color;}if(_b8.face){_bb.face=_b8.face;_ba.face=_b8.face;}if(_b8.size){_bb.size=_b8.size;_ba.size=_b8.size;}}if(_b8.className){_bb.className=_b8.className;_ba.className=_b8.className;}if(_ab){_b4=_ab;while(_b4){_b5=_b4.nextSibling;_bb.appendChild(_b4);_b4=_b5;}}if(_bb.tagName==_b8.tagName){_ac=doc.createElement("span");_ac.className="ieFormatBreakerSpan";_8.place(_ac,_b8,"after");_8.place(_bb,_ac,"after");}else{_8.place(_bb,_b8,"after");}_aa=_b8;_ab=_bb;_b8=_b8.parentNode;}if(_ab){_b4=_ab;if(_b4.nodeType===1||(_b4.nodeType===3&&_b4.nodeValue)){_b3.innerHTML="";}while(_b4){_b5=_b4.nextSibling;_b3.appendChild(_b4);_b4=_b5;}}var _bc;if(_b9.length){_ba=_b9.pop();var _bd=doc.createElement(_ba.tagName);if(_ba.cssText&&_bd.style){_bd.style.cssText=_ba.cssText;}if(_ba.className){_bd.className=_ba.className;}if(_ba.tagName==="FONT"){if(_ba.color){_bd.color=_ba.color;}if(_ba.face){_bd.face=_ba.face;}if(_ba.size){_bd.size=_ba.size;}}_8.place(_bd,_b3,"before");while(_b9.length){_ba=_b9.pop();var _be=doc.createElement(_ba.tagName);if(_ba.cssText&&_be.style){_be.style.cssText=_ba.cssText;}if(_ba.className){_be.className=_ba.className;}if(_ba.tagName==="FONT"){if(_ba.color){_be.color=_ba.color;}if(_ba.face){_be.face=_ba.face;}if(_ba.size){_be.size=_ba.size;}}_bd.appendChild(_be);_bd=_be;}_ad=doc.createTextNode(".");_ac.appendChild(_ad);_bd.appendChild(_ad);_bc=_17.create(this.window);_bc.setStart(_ad,0);_bc.setEnd(_ad,_ad.length);_a8.removeAllRanges();_a8.addRange(_bc);this._sCall("collapse",[false]);_ad.parentNode.innerHTML="";}else{_ac=doc.createElement("span");_ac.className="ieFormatBreakerSpan";_ad=doc.createTextNode(".");_ac.appendChild(_ad);_8.place(_ac,_b3,"before");_bc=_17.create(this.window);_bc.setStart(_ad,0);_bc.setEnd(_ad,_ad.length);_a8.removeAllRanges();_a8.addRange(_bc);this._sCall("collapse",[false]);_ad.parentNode.innerHTML="";}if(!_b3.firstChild){_8.destroy(_b3);}return true;}}return false;}else{_a9=_a8.getRangeAt(0);rs=_a9.startContainer;if(rs&&rs.nodeType===3){var _b0=_a9.startOffset;if(rs.length<_b0){ret=this._adjustNodeAndOffset(rs,_b0);rs=ret.node;_b0=ret.offset;}txt=rs.nodeValue;_aa=doc.createTextNode(txt.substring(0,_b0));var _b7=txt.substring(_b0);if(_b7!==""){_ab=doc.createTextNode(txt.substring(_b0));}_ac=doc.createElement("span");_ad=doc.createTextNode(".");_ac.appendChild(_ad);if(_aa.length){_8.place(_aa,rs,"after");}else{_aa=rs;}_8.place(_ac,_aa,"after");if(_ab){_8.place(_ab,_ac,"after");}_8.destroy(rs);var _bc=_17.create(this.window);_bc.setStart(_ad,0);_bc.setEnd(_ad,_ad.length);_a8.removeAllRanges();_a8.addRange(_bc);doc.execCommand(_a7);_8.place(_ac.firstChild,_ac,"before");_8.destroy(_ac);_bc.setStart(_ad,0);_bc.setEnd(_ad,_ad.length);_a8.removeAllRanges();_a8.addRange(_bc);this._sCall("collapse",[false]);_ad.parentNode.innerHTML="";return true;}}}else{return false;}},_adaptIEList:function(_bf){var _c0=_17.getSelection(this.window);if(_c0.isCollapsed){if(_c0.rangeCount&&!this.queryCommandValue(_bf)){var _c1=_c0.getRangeAt(0);var sc=_c1.startContainer;if(sc&&sc.nodeType==3){if(!_c1.startOffset){var _c2="ul";if(_bf==="insertorderedlist"){_c2="ol";}var _c3=this.document.createElement(_c2);var li=_8.create("li",null,_c3);_8.place(_c3,sc,"before");li.appendChild(sc);_8.create("br",null,_c3,"after");var _c4=_17.create(this.window);_c4.setStart(sc,0);_c4.setEnd(sc,sc.length);_c0.removeAllRanges();_c0.addRange(_c4);this._sCall("collapse",[true]);return true;}}}}return false;},_handleTextColorOrProperties:function(_c5,_c6){var _c7=_17.getSelection(this.window);var doc=this.document;var rs,ret,_c8,txt,_c9,_ca,_cb,_cc;_c6=_c6||null;if(_c5&&_c7&&_c7.isCollapsed){if(_c7.rangeCount){_c8=_c7.getRangeAt(0);rs=_c8.startContainer;if(rs&&rs.nodeType===3){var _cd=_c8.startOffset;if(rs.length<_cd){ret=this._adjustNodeAndOffset(rs,_cd);rs=ret.node;_cd=ret.offset;}txt=rs.nodeValue;_c9=doc.createTextNode(txt.substring(0,_cd));var _ce=txt.substring(_cd);if(_ce!==""){_ca=doc.createTextNode(txt.substring(_cd));}_cb=doc.createElement("span");_cc=doc.createTextNode(".");_cb.appendChild(_cc);var _cf=doc.createElement("span");_cb.appendChild(_cf);if(_c9.length){_8.place(_c9,rs,"after");}else{_c9=rs;}_8.place(_cb,_c9,"after");if(_ca){_8.place(_ca,_cb,"after");}_8.destroy(rs);var _d0=_17.create(this.window);_d0.setStart(_cc,0);_d0.setEnd(_cc,_cc.length);_c7.removeAllRanges();_c7.addRange(_d0);if(has("webkit")){var _d1="color";if(_c5==="hilitecolor"||_c5==="backcolor"){_d1="backgroundColor";}_a.set(_cb,_d1,_c6);this._sCall("remove",[]);_8.destroy(_cf);_cb.innerHTML=" ";this._sCall("selectElement",[_cb]);this.focus();}else{this.execCommand(_c5,_c6);_8.place(_cb.firstChild,_cb,"before");_8.destroy(_cb);_d0.setStart(_cc,0);_d0.setEnd(_cc,_cc.length);_c7.removeAllRanges();_c7.addRange(_d0);this._sCall("collapse",[false]);_cc.parentNode.removeChild(_cc);}return true;}}}return false;},_adjustNodeAndOffset:function(_d2,_d3){while(_d2.length<_d3&&_d2.nextSibling&&_d2.nextSibling.nodeType===3){_d3=_d3-_d2.length;_d2=_d2.nextSibling;}return {"node":_d2,"offset":_d3};},_tagNamesForCommand:function(_d4){if(_d4==="bold"){return ["b","strong"];}else{if(_d4==="italic"){return ["i","em"];}else{if(_d4==="strikethrough"){return ["s","strike"];}else{if(_d4==="superscript"){return ["sup"];}else{if(_d4==="subscript"){return ["sub"];}else{if(_d4==="underline"){return ["u"];}}}}}}return [];},_stripBreakerNodes:function(_d5){if(!this.isLoaded){return;}_f(".ieFormatBreakerSpan",_d5).forEach(function(b){while(b.firstChild){_8.place(b.firstChild,b,"before");}_8.destroy(b);});return _d5;}});return _1b;});
\ No newline at end of file diff --git a/lib/dijit/_editor/RichText.js.uncompressed.js b/lib/dijit/_editor/RichText.js.uncompressed.js new file mode 100644 index 000000000..5fd3e0962 --- /dev/null +++ b/lib/dijit/_editor/RichText.js.uncompressed.js @@ -0,0 +1,2874 @@ +define("dijit/_editor/RichText", [ + "dojo/_base/array", // array.forEach array.indexOf array.some + "dojo/_base/config", // config + "dojo/_base/declare", // declare + "dojo/_base/Deferred", // Deferred + "dojo/dom", // dom.byId + "dojo/dom-attr", // domAttr.set or get + "dojo/dom-class", // domClass.add domClass.remove + "dojo/dom-construct", // domConstruct.create domConstruct.destroy domConstruct.place + "dojo/dom-geometry", // domGeometry.position + "dojo/dom-style", // domStyle.getComputedStyle domStyle.set + "dojo/_base/event", // event.stop + "dojo/_base/kernel", // kernel.deprecated + "dojo/keys", // keys.BACKSPACE keys.TAB + "dojo/_base/lang", // lang.clone lang.hitch lang.isArray lang.isFunction lang.isString lang.trim + "dojo/on", // on() + "dojo/query", // query + "dojo/ready", // ready + "dojo/sniff", // has("ie") has("mozilla") has("opera") has("safari") has("webkit") + "dojo/topic", // topic.publish() (publish) + "dojo/_base/unload", // unload + "dojo/_base/url", // url + "dojo/_base/window", // win.global + "../_Widget", + "../_CssStateMixin", + "./selection", + "./range", + "./html", + "../focus", + "../main" // dijit._scopeName +], function(array, config, declare, Deferred, dom, domAttr, domClass, domConstruct, domGeometry, domStyle, + event, kernel, keys, lang, on, query, ready, has, topic, unload, _Url, win, + _Widget, _CssStateMixin, selectionapi, rangeapi, htmlapi, focus, dijit){ + +// module: +// dijit/_editor/RichText +// summary: +// dijit/_editor/RichText is the core of dijit/Editor, which provides basic +// WYSIWYG editing features. + +// if you want to allow for rich text saving with back/forward actions, you must add a text area to your page with +// the id==dijit._scopeName + "._editor.RichText.value" (typically "dijit/_editor/RichText.value). For example, +// something like this will work: +// +// <textarea id="dijit._editor.RichText.value" style="display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;"></textarea> +// + +var RichText = declare("dijit._editor.RichText", [_Widget, _CssStateMixin], { + // summary: + // dijit/_editor/RichText is the core of dijit.Editor, which provides basic + // WYSIWYG editing features. + // + // description: + // dijit/_editor/RichText is the core of dijit.Editor, which provides basic + // WYSIWYG editing features. It also encapsulates the differences + // of different js engines for various browsers. Do not use this widget + // with an HTML <TEXTAREA> tag, since the browser unescapes XML escape characters, + // like <. This can have unexpected behavior and lead to security issues + // such as scripting attacks. + // + // tags: + // private + + constructor: function(params /*===== , srcNodeRef =====*/){ + // summary: + // Create the widget. + // params: Object|null + // Initial settings for any of the widget attributes, except readonly attributes. + // srcNodeRef: DOMNode + // The widget replaces the specified DOMNode. + + // contentPreFilters: Function(String)[] + // Pre content filter function register array. + // these filters will be executed before the actual + // editing area gets the html content. + this.contentPreFilters = []; + + // contentPostFilters: Function(String)[] + // post content filter function register array. + // These will be used on the resulting html + // from contentDomPostFilters. The resulting + // content is the final html (returned by getValue()). + this.contentPostFilters = []; + + // contentDomPreFilters: Function(DomNode)[] + // Pre content dom filter function register array. + // These filters are applied after the result from + // contentPreFilters are set to the editing area. + this.contentDomPreFilters = []; + + // contentDomPostFilters: Function(DomNode)[] + // Post content dom filter function register array. + // These filters are executed on the editing area dom. + // The result from these will be passed to contentPostFilters. + this.contentDomPostFilters = []; + + // editingAreaStyleSheets: dojo._URL[] + // array to store all the stylesheets applied to the editing area + this.editingAreaStyleSheets = []; + + // Make a copy of this.events before we start writing into it, otherwise we + // will modify the prototype which leads to bad things on pages w/multiple editors + this.events = [].concat(this.events); + + this._keyHandlers = {}; + + if(params && lang.isString(params.value)){ + this.value = params.value; + } + + this.onLoadDeferred = new Deferred(); + }, + + baseClass: "dijitEditor", + + // inheritWidth: Boolean + // whether to inherit the parent's width or simply use 100% + inheritWidth: false, + + // focusOnLoad: [deprecated] Boolean + // Focus into this widget when the page is loaded + focusOnLoad: false, + + // name: String? + // Specifies the name of a (hidden) `<textarea>` node on the page that's used to save + // the editor content on page leave. Used to restore editor contents after navigating + // to a new page and then hitting the back button. + name: "", + + // styleSheets: [const] String + // semicolon (";") separated list of css files for the editing area + styleSheets: "", + + // height: String + // Set height to fix the editor at a specific height, with scrolling. + // By default, this is 300px. If you want to have the editor always + // resizes to accommodate the content, use AlwaysShowToolbar plugin + // and set height="". If this editor is used within a layout widget, + // set height="100%". + height: "300px", + + // minHeight: String + // The minimum height that the editor should have. + minHeight: "1em", + + // isClosed: [private] Boolean + isClosed: true, + + // isLoaded: [private] Boolean + isLoaded: false, + + // _SEPARATOR: [private] String + // Used to concat contents from multiple editors into a single string, + // so they can be saved into a single `<textarea>` node. See "name" attribute. + _SEPARATOR: "@@**%%__RICHTEXTBOUNDRY__%%**@@", + + // _NAME_CONTENT_SEP: [private] String + // USed to separate name from content. Just a colon isn't safe. + _NAME_CONTENT_SEP: "@@**%%:%%**@@", + + // onLoadDeferred: [readonly] dojo.Deferred + // Deferred which is fired when the editor finishes loading. + // Call myEditor.onLoadDeferred.then(callback) it to be informed + // when the rich-text area initialization is finalized. + onLoadDeferred: null, + + // isTabIndent: Boolean + // Make tab key and shift-tab indent and outdent rather than navigating. + // Caution: sing this makes web pages inaccessible to users unable to use a mouse. + isTabIndent: false, + + // disableSpellCheck: [const] Boolean + // When true, disables the browser's native spell checking, if supported. + // Works only in Firefox. + disableSpellCheck: false, + + postCreate: function(){ + if("textarea" === this.domNode.tagName.toLowerCase()){ + console.warn("RichText should not be used with the TEXTAREA tag. See dijit._editor.RichText docs."); + } + + // Push in the builtin filters now, making them the first executed, but not over-riding anything + // users passed in. See: #6062 + this.contentPreFilters = [lang.hitch(this, "_preFixUrlAttributes")].concat(this.contentPreFilters); + if(has("mozilla")){ + this.contentPreFilters = [this._normalizeFontStyle].concat(this.contentPreFilters); + this.contentPostFilters = [this._removeMozBogus].concat(this.contentPostFilters); + } + if(has("webkit")){ + // Try to clean up WebKit bogus artifacts. The inserted classes + // made by WebKit sometimes messes things up. + this.contentPreFilters = [this._removeWebkitBogus].concat(this.contentPreFilters); + this.contentPostFilters = [this._removeWebkitBogus].concat(this.contentPostFilters); + } + if(has("ie")){ + // IE generates <strong> and <em> but we want to normalize to <b> and <i> + this.contentPostFilters = [this._normalizeFontStyle].concat(this.contentPostFilters); + this.contentDomPostFilters = [lang.hitch(this, this._stripBreakerNodes)].concat(this.contentDomPostFilters); + } + this.inherited(arguments); + + topic.publish(dijit._scopeName + "._editor.RichText::init", this); + this.open(); + this.setupDefaultShortcuts(); + }, + + setupDefaultShortcuts: function(){ + // summary: + // Add some default key handlers + // description: + // Overwrite this to setup your own handlers. The default + // implementation does not use Editor commands, but directly + // executes the builtin commands within the underlying browser + // support. + // tags: + // protected + var exec = lang.hitch(this, function(cmd, arg){ + return function(){ + return !this.execCommand(cmd,arg); + }; + }); + + var ctrlKeyHandlers = { + b: exec("bold"), + i: exec("italic"), + u: exec("underline"), + a: exec("selectall"), + s: function(){ this.save(true); }, + m: function(){ this.isTabIndent = !this.isTabIndent; }, + + "1": exec("formatblock", "h1"), + "2": exec("formatblock", "h2"), + "3": exec("formatblock", "h3"), + "4": exec("formatblock", "h4"), + + "\\": exec("insertunorderedlist") + }; + + if(!has("ie")){ + ctrlKeyHandlers.Z = exec("redo"); //FIXME: undo? + } + + var key; + for(key in ctrlKeyHandlers){ + this.addKeyHandler(key, true, false, ctrlKeyHandlers[key]); + } + }, + + // events: [private] String[] + // events which should be connected to the underlying editing area + events: ["onKeyPress", "onKeyDown", "onKeyUp"], // onClick handled specially + + // captureEvents: [deprecated] String[] + // Events which should be connected to the underlying editing + // area, events in this array will be addListener with + // capture=true. + // TODO: looking at the code I don't see any distinction between events and captureEvents, + // so get rid of this for 2.0 if not sooner + captureEvents: [], + + _editorCommandsLocalized: false, + _localizeEditorCommands: function(){ + // summary: + // When IE is running in a non-English locale, the API actually changes, + // so that we have to say (for example) danraku instead of p (for paragraph). + // Handle that here. + // tags: + // private + if(RichText._editorCommandsLocalized){ + // Use the already generate cache of mappings. + this._local2NativeFormatNames = RichText._local2NativeFormatNames; + this._native2LocalFormatNames = RichText._native2LocalFormatNames; + return; + } + RichText._editorCommandsLocalized = true; + RichText._local2NativeFormatNames = {}; + RichText._native2LocalFormatNames = {}; + this._local2NativeFormatNames = RichText._local2NativeFormatNames; + this._native2LocalFormatNames = RichText._native2LocalFormatNames; + //in IE, names for blockformat is locale dependent, so we cache the values here + + //put p after div, so if IE returns Normal, we show it as paragraph + //We can distinguish p and div if IE returns Normal, however, in order to detect that, + //we have to call this.document.selection.createRange().parentElement() or such, which + //could slow things down. Leave it as it is for now + var formats = ['div', 'p', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'address']; + var localhtml = "", format, i=0; + while((format=formats[i++])){ + //append a <br> after each element to separate the elements more reliably + if(format.charAt(1) !== 'l'){ + localhtml += "<"+format+"><span>content</span></"+format+"><br/>"; + }else{ + localhtml += "<"+format+"><li>content</li></"+format+"><br/>"; + } + } + // queryCommandValue returns empty if we hide editNode, so move it out of screen temporary + // Also, IE9 does weird stuff unless we do it inside the editor iframe. + var style = { position: "absolute", top: "0px", zIndex: 10, opacity: 0.01 }; + var div = domConstruct.create('div', {style: style, innerHTML: localhtml}); + this.ownerDocumentBody.appendChild(div); + + // IE9 has a timing issue with doing this right after setting + // the inner HTML, so put a delay in. + var inject = lang.hitch(this, function(){ + var node = div.firstChild; + while(node){ + try{ + this._sCall("selectElement", [node.firstChild]); + var nativename = node.tagName.toLowerCase(); + this._local2NativeFormatNames[nativename] = document.queryCommandValue("formatblock"); + this._native2LocalFormatNames[this._local2NativeFormatNames[nativename]] = nativename; + node = node.nextSibling.nextSibling; + //console.log("Mapped: ", nativename, " to: ", this._local2NativeFormatNames[nativename]); + }catch(e){ /*Sqelch the occasional IE9 error */ } + } + domConstruct.destroy(div); + }); + this.defer(inject); + }, + + open: function(/*DomNode?*/ element){ + // summary: + // Transforms the node referenced in this.domNode into a rich text editing + // node. + // description: + // Sets up the editing area asynchronously. This will result in + // the creation and replacement with an iframe. + // tags: + // private + + if(!this.onLoadDeferred || this.onLoadDeferred.fired >= 0){ + this.onLoadDeferred = new Deferred(); + } + + if(!this.isClosed){ this.close(); } + topic.publish(dijit._scopeName + "._editor.RichText::open", this); + + if(arguments.length === 1 && element.nodeName){ // else unchanged + this.domNode = element; + } + + var dn = this.domNode; + + // "html" will hold the innerHTML of the srcNodeRef and will be used to + // initialize the editor. + var html; + + if(lang.isString(this.value)){ + // Allow setting the editor content programmatically instead of + // relying on the initial content being contained within the target + // domNode. + html = this.value; + delete this.value; + dn.innerHTML = ""; + }else if(dn.nodeName && dn.nodeName.toLowerCase() == "textarea"){ + // if we were created from a textarea, then we need to create a + // new editing harness node. + var ta = (this.textarea = dn); + this.name = ta.name; + html = ta.value; + dn = this.domNode = this.ownerDocument.createElement("div"); + dn.setAttribute('widgetId', this.id); + ta.removeAttribute('widgetId'); + dn.cssText = ta.cssText; + dn.className += " " + ta.className; + domConstruct.place(dn, ta, "before"); + var tmpFunc = lang.hitch(this, function(){ + //some browsers refuse to submit display=none textarea, so + //move the textarea off screen instead + domStyle.set(ta, { + display: "block", + position: "absolute", + top: "-1000px" + }); + + if(has("ie")){ //nasty IE bug: abnormal formatting if overflow is not hidden + var s = ta.style; + this.__overflow = s.overflow; + s.overflow = "hidden"; + } + }); + if(has("ie")){ + this.defer(tmpFunc, 10); + }else{ + tmpFunc(); + } + + if(ta.form){ + var resetValue = ta.value; + this.reset = function(){ + var current = this.getValue(); + if(current !== resetValue){ + this.replaceValue(resetValue); + } + }; + on(ta.form, "submit", lang.hitch(this, function(){ + // Copy value to the <textarea> so it gets submitted along with form. + // FIXME: should we be calling close() here instead? + domAttr.set(ta, 'disabled', this.disabled); // don't submit the value if disabled + ta.value = this.getValue(); + })); + } + }else{ + html = htmlapi.getChildrenHtml(dn); + dn.innerHTML = ""; + } + + this.value = html; + + // If we're a list item we have to put in a blank line to force the + // bullet to nicely align at the top of text + if(dn.nodeName && dn.nodeName === "LI"){ + dn.innerHTML = " <br>"; + } + + // Construct the editor div structure. + this.header = dn.ownerDocument.createElement("div"); + dn.appendChild(this.header); + this.editingArea = dn.ownerDocument.createElement("div"); + dn.appendChild(this.editingArea); + this.footer = dn.ownerDocument.createElement("div"); + dn.appendChild(this.footer); + + if(!this.name){ + this.name = this.id + "_AUTOGEN"; + } + + // User has pressed back/forward button so we lost the text in the editor, but it's saved + // in a hidden <textarea> (which contains the data for all the editors on this page), + // so get editor value from there + if(this.name !== "" && (!config["useXDomain"] || config["allowXdRichTextSave"])){ + var saveTextarea = dom.byId(dijit._scopeName + "._editor.RichText.value"); + if(saveTextarea && saveTextarea.value !== ""){ + var datas = saveTextarea.value.split(this._SEPARATOR), i=0, dat; + while((dat=datas[i++])){ + var data = dat.split(this._NAME_CONTENT_SEP); + if(data[0] === this.name){ + html = data[1]; + datas = datas.splice(i, 1); + saveTextarea.value = datas.join(this._SEPARATOR); + break; + } + } + } + + if(!RichText._globalSaveHandler){ + RichText._globalSaveHandler = {}; + unload.addOnUnload(function(){ + var id; + for(id in RichText._globalSaveHandler){ + var f = RichText._globalSaveHandler[id]; + if(lang.isFunction(f)){ + f(); + } + } + }); + } + RichText._globalSaveHandler[this.id] = lang.hitch(this, "_saveContent"); + } + + this.isClosed = false; + + var ifr = (this.editorObject = this.iframe = this.ownerDocument.createElement('iframe')); + ifr.id = this.id+"_iframe"; + ifr.style.border = "none"; + ifr.style.width = "100%"; + if(this._layoutMode){ + // iframe should be 100% height, thus getting it's height from surrounding + // <div> (which has the correct height set by Editor) + ifr.style.height = "100%"; + }else{ + if(has("ie") >= 7){ + if(this.height){ + ifr.style.height = this.height; + } + if(this.minHeight){ + ifr.style.minHeight = this.minHeight; + } + }else{ + ifr.style.height = this.height ? this.height : this.minHeight; + } + } + ifr.frameBorder = 0; + ifr._loadFunc = lang.hitch( this, function(w){ + this.window = w; + this.document = this.window.document; + + if(has("ie")){ + this._localizeEditorCommands(); + } + + // Do final setup and set initial contents of editor + this.onLoad(html); + }); + + // Set the iframe's initial (blank) content. + var src = this._getIframeDocTxt(), + s = "javascript: '" + src.replace(/\\/g, "\\\\").replace(/'/g, "\\'") + "'"; + ifr.setAttribute('src', s); + this.editingArea.appendChild(ifr); + + if(has("safari") <= 4){ + src = ifr.getAttribute("src"); + if(!src || src.indexOf("javascript") === -1){ + // Safari 4 and earlier sometimes act oddly + // So we have to set it again. + this.defer(function(){ ifr.setAttribute('src', s); }); + } + } + + // TODO: this is a guess at the default line-height, kinda works + if(dn.nodeName === "LI"){ + dn.lastChild.style.marginTop = "-1.2em"; + } + + domClass.add(this.domNode, this.baseClass); + }, + + //static cache variables shared among all instance of this class + _local2NativeFormatNames: {}, + _native2LocalFormatNames: {}, + + _getIframeDocTxt: function(){ + // summary: + // Generates the boilerplate text of the document inside the iframe (ie, `<html><head>...</head><body/></html>`). + // Editor content (if not blank) should be added afterwards. + // tags: + // private + var _cs = domStyle.getComputedStyle(this.domNode); + + // The contents inside of <body>. The real contents are set later via a call to setValue(). + var html = ""; + var setBodyId = true; + if(has("ie") || has("webkit") || (!this.height && !has("mozilla"))){ + // In auto-expand mode, need a wrapper div for AlwaysShowToolbar plugin to correctly + // expand/contract the editor as the content changes. + html = "<div id='dijitEditorBody'></div>"; + setBodyId = false; + }else if(has("mozilla")){ + // workaround bug where can't select then delete text (until user types something + // into the editor)... and/or issue where typing doesn't erase selected text + this._cursorToStart = true; + html = " "; // + } + + var font = [ _cs.fontWeight, _cs.fontSize, _cs.fontFamily ].join(" "); + + // line height is tricky - applying a units value will mess things up. + // if we can't get a non-units value, bail out. + var lineHeight = _cs.lineHeight; + if(lineHeight.indexOf("px") >= 0){ + lineHeight = parseFloat(lineHeight)/parseFloat(_cs.fontSize); + // console.debug(lineHeight); + }else if(lineHeight.indexOf("em")>=0){ + lineHeight = parseFloat(lineHeight); + }else{ + // If we can't get a non-units value, just default + // it to the CSS spec default of 'normal'. Seems to + // work better, esp on IE, than '1.0' + lineHeight = "normal"; + } + var userStyle = ""; + var self = this; + this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig, function(match){ + match = match.replace(/^;/ig,"") + ';'; + var s = match.split(":")[0]; + if(s){ + s = lang.trim(s); + s = s.toLowerCase(); + var i; + var sC = ""; + for(i = 0; i < s.length; i++){ + var c = s.charAt(i); + switch(c){ + case "-": + i++; + c = s.charAt(i).toUpperCase(); + default: + sC += c; + } + } + domStyle.set(self.domNode, sC, ""); + } + userStyle += match + ';'; + }); + + + // need to find any associated label element and update iframe document title + var label=query('label[for="'+this.id+'"]'); + + return [ + this.isLeftToRight() ? "<html>\n<head>\n" : "<html dir='rtl'>\n<head>\n", + (has("mozilla") && label.length ? "<title>" + label[0].innerHTML + "</title>\n" : ""), + "<meta http-equiv='Content-Type' content='text/html'>\n", + "<style>\n", + "\tbody,html {\n", + "\t\tbackground:transparent;\n", + "\t\tpadding: 1px 0 0 0;\n", + "\t\tmargin: -1px 0 0 0;\n", // remove extraneous vertical scrollbar on safari and firefox + + // Set the html/body sizing. Webkit always needs this, other browsers + // only set it when height is defined (not auto-expanding), otherwise + // scrollers do not appear. + ((has("webkit"))?"\t\twidth: 100%;\n":""), + ((has("webkit"))?"\t\theight: 100%;\n":""), + "\t}\n", + + // TODO: left positioning will cause contents to disappear out of view + // if it gets too wide for the visible area + "\tbody{\n", + "\t\ttop:0px;\n", + "\t\tleft:0px;\n", + "\t\tright:0px;\n", + "\t\tfont:", font, ";\n", + ((this.height||has("opera")) ? "" : "\t\tposition: fixed;\n"), + // FIXME: IE 6 won't understand min-height? + "\t\tmin-height:", this.minHeight, ";\n", + "\t\tline-height:", lineHeight,";\n", + "\t}\n", + "\tp{ margin: 1em 0; }\n", + + // Determine how scrollers should be applied. In autoexpand mode (height = "") no scrollers on y at all. + // But in fixed height mode we want both x/y scrollers. Also, if it's using wrapping div and in auto-expand + // (Mainly IE) we need to kill the y scroller on body and html. + (!setBodyId && !this.height ? "\tbody,html {overflow-y: hidden;}\n" : ""), + "\t#dijitEditorBody{overflow-x: auto; overflow-y:" + (this.height ? "auto;" : "hidden;") + " outline: 0px;}\n", + "\tli > ul:-moz-first-node, li > ol:-moz-first-node{ padding-top: 1.2em; }\n", + // Can't set min-height in IE9, it puts layout on li, which puts move/resize handles. + (!has("ie") ? "\tli{ min-height:1.2em; }\n" : ""), + "</style>\n", + this._applyEditingAreaStyleSheets(),"\n", + "</head>\n<body ", + (setBodyId?"id='dijitEditorBody' ":""), + + // Onload handler fills in real editor content. + // On IE9, sometimes onload is called twice, and the first time frameElement is null (test_FullScreen.html) + "onload='frameElement && frameElement._loadFunc(window,document)' ", + "style='"+userStyle+"'>", html, "</body>\n</html>" + ].join(""); // String + }, + + _applyEditingAreaStyleSheets: function(){ + // summary: + // apply the specified css files in styleSheets + // tags: + // private + var files = []; + if(this.styleSheets){ + files = this.styleSheets.split(';'); + this.styleSheets = ''; + } + + //empty this.editingAreaStyleSheets here, as it will be filled in addStyleSheet + files = files.concat(this.editingAreaStyleSheets); + this.editingAreaStyleSheets = []; + + var text='', i=0, url; + while((url=files[i++])){ + var abstring = (new _Url(win.global.location, url)).toString(); + this.editingAreaStyleSheets.push(abstring); + text += '<link rel="stylesheet" type="text/css" href="'+abstring+'"/>'; + } + return text; + }, + + addStyleSheet: function(/*dojo/_base/url*/ uri){ + // summary: + // add an external stylesheet for the editing area + // uri: + // Url of the external css file + var url=uri.toString(); + + //if uri is relative, then convert it to absolute so that it can be resolved correctly in iframe + if(url.charAt(0) === '.' || (url.charAt(0) !== '/' && !uri.host)){ + url = (new _Url(win.global.location, url)).toString(); + } + + if(array.indexOf(this.editingAreaStyleSheets, url) > -1){ +// console.debug("dijit/_editor/RichText.addStyleSheet(): Style sheet "+url+" is already applied"); + return; + } + + this.editingAreaStyleSheets.push(url); + this.onLoadDeferred.then(lang.hitch(this, function(){ + if(this.document.createStyleSheet){ //IE + this.document.createStyleSheet(url); + }else{ //other browser + var head = this.document.getElementsByTagName("head")[0]; + var stylesheet = this.document.createElement("link"); + stylesheet.rel="stylesheet"; + stylesheet.type="text/css"; + stylesheet.href=url; + head.appendChild(stylesheet); + } + })); + }, + + removeStyleSheet: function(/*dojo/_base/url*/ uri){ + // summary: + // remove an external stylesheet for the editing area + var url=uri.toString(); + //if uri is relative, then convert it to absolute so that it can be resolved correctly in iframe + if(url.charAt(0) === '.' || (url.charAt(0) !== '/' && !uri.host)){ + url = (new _Url(win.global.location, url)).toString(); + } + var index = array.indexOf(this.editingAreaStyleSheets, url); + if(index === -1){ +// console.debug("dijit/_editor/RichText.removeStyleSheet(): Style sheet "+url+" has not been applied"); + return; + } + delete this.editingAreaStyleSheets[index]; + query('link:[href="'+url+'"]', this.window.document).orphan(); + }, + + // disabled: Boolean + // The editor is disabled; the text cannot be changed. + disabled: false, + + _mozSettingProps: {'styleWithCSS':false}, + _setDisabledAttr: function(/*Boolean*/ value){ + value = !!value; + this._set("disabled", value); + if(!this.isLoaded){ return; } // this method requires init to be complete + if(has("ie") || has("webkit") || has("opera")){ + var preventIEfocus = has("ie") && (this.isLoaded || !this.focusOnLoad); + if(preventIEfocus){ this.editNode.unselectable = "on"; } + this.editNode.contentEditable = !value; + if(preventIEfocus){ + this.defer(function(){ + if(this.editNode){ // guard in case widget destroyed before timeout + this.editNode.unselectable = "off"; + } + }); + } + }else{ //moz + try{ + this.document.designMode=(value?'off':'on'); + }catch(e){ return; } // ! _disabledOK + if(!value && this._mozSettingProps){ + var ps = this._mozSettingProps; + var n; + for(n in ps){ + if(ps.hasOwnProperty(n)){ + try{ + this.document.execCommand(n,false,ps[n]); + }catch(e2){} + } + } + } +// this.document.execCommand('contentReadOnly', false, value); +// if(value){ +// this.blur(); //to remove the blinking caret +// } + } + this._disabledOK = true; + }, + +/* Event handlers + *****************/ + + onLoad: function(/*String*/ html){ + // summary: + // Handler after the iframe finishes loading. + // html: String + // Editor contents should be set to this value + // tags: + // protected + + // TODO: rename this to _onLoad, make empty public onLoad() method, deprecate/make protected onLoadDeferred handler? + + if(!this.window.__registeredWindow){ + this.window.__registeredWindow = true; + this._iframeRegHandle = focus.registerIframe(this.iframe); + } + if(!has("ie") && !has("webkit") && (this.height || has("mozilla"))){ + this.editNode=this.document.body; + }else{ + // there's a wrapper div around the content, see _getIframeDocTxt(). + this.editNode=this.document.body.firstChild; + var _this = this; + if(has("ie")){ // #4996 IE wants to focus the BODY tag + this.tabStop = domConstruct.create('div', { tabIndex: -1 }, this.editingArea); + this.iframe.onfocus = function(){ _this.editNode.setActive(); }; + } + } + this.focusNode = this.editNode; // for InlineEditBox + + + var events = this.events.concat(this.captureEvents); + var ap = this.iframe ? this.document : this.editNode; + array.forEach(events, function(item){ + this.connect(ap, item.toLowerCase(), item); + }, this); + + this.connect(ap, "onmouseup", "onClick"); // mouseup in the margin does not generate an onclick event + + if(has("ie")){ // IE contentEditable + this.connect(this.document, "onmousedown", "_onIEMouseDown"); // #4996 fix focus + + // give the node Layout on IE + // TODO: this may no longer be needed, since we've reverted IE to using an iframe, + // not contentEditable. Removing it would also probably remove the need for creating + // the extra <div> in _getIframeDocTxt() + this.editNode.style.zoom = 1.0; + }else{ + this.connect(this.document, "onmousedown", function(){ + // Clear the moveToStart focus, as mouse + // down will set cursor point. Required to properly + // work with selection/position driven plugins and clicks in + // the window. refs: #10678 + delete this._cursorToStart; + }); + } + + if(has("webkit")){ + //WebKit sometimes doesn't fire right on selections, so the toolbar + //doesn't update right. Therefore, help it out a bit with an additional + //listener. A mouse up will typically indicate a display change, so fire this + //and get the toolbar to adapt. Reference: #9532 + this._webkitListener = this.connect(this.document, "onmouseup", "onDisplayChanged"); + this.connect(this.document, "onmousedown", function(e){ + var t = e.target; + if(t && (t === this.document.body || t === this.document)){ + // Since WebKit uses the inner DIV, we need to check and set position. + // See: #12024 as to why the change was made. + this.defer("placeCursorAtEnd"); + } + }); + } + + if(has("ie")){ + // Try to make sure 'hidden' elements aren't visible in edit mode (like browsers other than IE + // do). See #9103 + try{ + this.document.execCommand('RespectVisibilityInDesign', true, null); + }catch(e){/* squelch */} + } + + this.isLoaded = true; + + this.set('disabled', this.disabled); // initialize content to editable (or not) + + // Note that setValue() call will only work after isLoaded is set to true (above) + + // Set up a function to allow delaying the setValue until a callback is fired + // This ensures extensions like dijit.Editor have a way to hold the value set + // until plugins load (and do things like register filters). + var setContent = lang.hitch(this, function(){ + this.setValue(html); + if(this.onLoadDeferred){ + this.onLoadDeferred.resolve(true); + } + this.onDisplayChanged(); + if(this.focusOnLoad){ + // after the document loads, then set focus after updateInterval expires so that + // onNormalizedDisplayChanged has run to avoid input caret issues + ready(lang.hitch(this, "defer", "focus", this.updateInterval)); + } + // Save off the initial content now + this.value = this.getValue(true); + }); + if(this.setValueDeferred){ + this.setValueDeferred.then(setContent); + }else{ + setContent(); + } + }, + + onKeyDown: function(/* Event */ e){ + // summary: + // Handler for onkeydown event + // tags: + // protected + + // we need this event at the moment to get the events from control keys + // such as the backspace. It might be possible to add this to Dojo, so that + // keyPress events can be emulated by the keyDown and keyUp detection. + + if(e.keyCode === keys.TAB && this.isTabIndent ){ + event.stop(e); //prevent tab from moving focus out of editor + + // FIXME: this is a poor-man's indent/outdent. It would be + // better if it added 4 " " chars in an undoable way. + // Unfortunately pasteHTML does not prove to be undoable + if(this.queryCommandEnabled((e.shiftKey ? "outdent" : "indent"))){ + this.execCommand((e.shiftKey ? "outdent" : "indent")); + } + } + if(has("ie")){ + if(e.keyCode == keys.TAB && !this.isTabIndent){ + if(e.shiftKey && !e.ctrlKey && !e.altKey){ + // focus the BODY so the browser will tab away from it instead + this.iframe.focus(); + }else if(!e.shiftKey && !e.ctrlKey && !e.altKey){ + // focus the BODY so the browser will tab away from it instead + this.tabStop.focus(); + } + }else if(e.keyCode === keys.BACKSPACE && this.document.selection.type === "Control"){ + // IE has a bug where if a non-text object is selected in the editor, + // hitting backspace would act as if the browser's back button was + // clicked instead of deleting the object. see #1069 + event.stop(e); + this.execCommand("delete"); + }else if((65 <= e.keyCode && e.keyCode <= 90) || + (e.keyCode>=37 && e.keyCode<=40) // FIXME: get this from connect() instead! + ){ //arrow keys + e.charCode = e.keyCode; + this.onKeyPress(e); + } + } + if(has("ff")){ + if(e.keyCode === keys.PAGE_UP || e.keyCode === keys.PAGE_DOWN ){ + if(this.editNode.clientHeight >= this.editNode.scrollHeight){ + // Stop the event to prevent firefox from trapping the cursor when there is no scroll bar. + e.preventDefault(); + } + } + } + return true; + }, + + onKeyUp: function(/*===== e =====*/){ + // summary: + // Handler for onkeyup event + // tags: + // callback + }, + + setDisabled: function(/*Boolean*/ disabled){ + // summary: + // Deprecated, use set('disabled', ...) instead. + // tags: + // deprecated + kernel.deprecated('dijit.Editor::setDisabled is deprecated','use dijit.Editor::attr("disabled",boolean) instead', 2.0); + this.set('disabled',disabled); + }, + _setValueAttr: function(/*String*/ value){ + // summary: + // Registers that attr("value", foo) should call setValue(foo) + this.setValue(value); + }, + _setDisableSpellCheckAttr: function(/*Boolean*/ disabled){ + if(this.document){ + domAttr.set(this.document.body, "spellcheck", !disabled); + }else{ + // try again after the editor is finished loading + this.onLoadDeferred.then(lang.hitch(this, function(){ + domAttr.set(this.document.body, "spellcheck", !disabled); + })); + } + this._set("disableSpellCheck", disabled); + }, + + onKeyPress: function(e){ + // summary: + // Handle the various key events + // tags: + // protected + + var c = (e.keyChar && e.keyChar.toLowerCase()) || e.keyCode, + handlers = this._keyHandlers[c], + args = arguments; + + if(handlers && !e.altKey){ + array.some(handlers, function(h){ + // treat meta- same as ctrl-, for benefit of mac users + if(!(h.shift ^ e.shiftKey) && !(h.ctrl ^ (e.ctrlKey||e.metaKey))){ + if(!h.handler.apply(this, args)){ + e.preventDefault(); + } + return true; + } + }, this); + } + + // function call after the character has been inserted + if(!this._onKeyHitch){ + this._onKeyHitch = lang.hitch(this, "onKeyPressed"); + } + this.defer("_onKeyHitch", 1); + return true; + }, + + addKeyHandler: function(/*String*/ key, /*Boolean*/ ctrl, /*Boolean*/ shift, /*Function*/ handler){ + // summary: + // Add a handler for a keyboard shortcut + // description: + // The key argument should be in lowercase if it is a letter character + // tags: + // protected + if(!lang.isArray(this._keyHandlers[key])){ + this._keyHandlers[key] = []; + } + //TODO: would be nice to make this a hash instead of an array for quick lookups + this._keyHandlers[key].push({ + shift: shift || false, + ctrl: ctrl || false, + handler: handler + }); + }, + + onKeyPressed: function(){ + // summary: + // Handler for after the user has pressed a key, and the display has been updated. + // (Runs on a timer so that it runs after the display is updated) + // tags: + // private + this.onDisplayChanged(/*e*/); // can't pass in e + }, + + onClick: function(/*Event*/ e){ + // summary: + // Handler for when the user clicks. + // tags: + // private + + // console.info('onClick',this._tryDesignModeOn); + this.onDisplayChanged(e); + }, + + _onIEMouseDown: function(){ + // summary: + // IE only to prevent 2 clicks to focus + // tags: + // protected + + if(!this.focused && !this.disabled){ + this.focus(); + } + }, + + _onBlur: function(e){ + // summary: + // Called from focus manager when focus has moved away from this editor + // tags: + // protected + + // console.info('_onBlur') + + this.inherited(arguments); + + var newValue = this.getValue(true); + if(newValue !== this.value){ + this.onChange(newValue); + } + this._set("value", newValue); + }, + + _onFocus: function(/*Event*/ e){ + // summary: + // Called from focus manager when focus has moved into this editor + // tags: + // protected + + // console.info('_onFocus') + if(!this.disabled){ + if(!this._disabledOK){ + this.set('disabled', false); + } + this.inherited(arguments); + } + }, + + // TODO: remove in 2.0 + blur: function(){ + // summary: + // Remove focus from this instance. + // tags: + // deprecated + if(!has("ie") && this.window.document.documentElement && this.window.document.documentElement.focus){ + this.window.document.documentElement.focus(); + }else if(this.ownerDocumentBody.focus){ + this.ownerDocumentBody.focus(); + } + }, + + focus: function(){ + // summary: + // Move focus to this editor + if(!this.isLoaded){ + this.focusOnLoad = true; + return; + } + if(this._cursorToStart){ + delete this._cursorToStart; + if(this.editNode.childNodes){ + this.placeCursorAtStart(); // this calls focus() so return + return; + } + } + if(!has("ie")){ + focus.focus(this.iframe); + }else if(this.editNode && this.editNode.focus){ + // editNode may be hidden in display:none div, lets just punt in this case + //this.editNode.focus(); -> causes IE to scroll always (strict and quirks mode) to the top the Iframe + // if we fire the event manually and let the browser handle the focusing, the latest + // cursor position is focused like in FF + this.iframe.fireEvent('onfocus', document.createEventObject()); // createEventObject only in IE + // }else{ + // TODO: should we throw here? + // console.debug("Have no idea how to focus into the editor!"); + } + }, + + // _lastUpdate: 0, + updateInterval: 200, + _updateTimer: null, + onDisplayChanged: function(/*Event*/ /*===== e =====*/){ + // summary: + // This event will be fired every time the display context + // changes and the result needs to be reflected in the UI. + // description: + // If you don't want to have update too often, + // onNormalizedDisplayChanged should be used instead + // tags: + // private + + // var _t=new Date(); + if(this._updateTimer){ + this._updateTimer.remove(); + } + this._updateTimer = this.defer("onNormalizedDisplayChanged", this.updateInterval); + + // Technically this should trigger a call to watch("value", ...) registered handlers, + // but getValue() is too slow to call on every keystroke so we don't. + }, + onNormalizedDisplayChanged: function(){ + // summary: + // This event is fired every updateInterval ms or more + // description: + // If something needs to happen immediately after a + // user change, please use onDisplayChanged instead. + // tags: + // private + delete this._updateTimer; + }, + onChange: function(/*===== newContent =====*/){ + // summary: + // This is fired if and only if the editor loses focus and + // the content is changed. + }, + _normalizeCommand: function(/*String*/ cmd, /*Anything?*/argument){ + // summary: + // Used as the advice function to map our + // normalized set of commands to those supported by the target + // browser. + // tags: + // private + + var command = cmd.toLowerCase(); + if(command === "formatblock"){ + if(has("safari") && argument === undefined){ command = "heading"; } + }else if(command === "hilitecolor" && !has("mozilla")){ + command = "backcolor"; + } + + return command; + }, + + _qcaCache: {}, + queryCommandAvailable: function(/*String*/ command){ + // summary: + // Tests whether a command is supported by the host. Clients + // SHOULD check whether a command is supported before attempting + // to use it, behaviour for unsupported commands is undefined. + // command: + // The command to test for + // tags: + // private + + // memoizing version. See _queryCommandAvailable for computing version + var ca = this._qcaCache[command]; + if(ca !== undefined){ return ca; } + return (this._qcaCache[command] = this._queryCommandAvailable(command)); + }, + + _queryCommandAvailable: function(/*String*/ command){ + // summary: + // See queryCommandAvailable(). + // tags: + // private + + var ie = 1; + var mozilla = 1 << 1; + var webkit = 1 << 2; + var opera = 1 << 3; + + function isSupportedBy(browsers){ + return { + ie: Boolean(browsers & ie), + mozilla: Boolean(browsers & mozilla), + webkit: Boolean(browsers & webkit), + opera: Boolean(browsers & opera) + }; + } + + var supportedBy = null; + + switch(command.toLowerCase()){ + case "bold": case "italic": case "underline": + case "subscript": case "superscript": + case "fontname": case "fontsize": + case "forecolor": case "hilitecolor": + case "justifycenter": case "justifyfull": case "justifyleft": + case "justifyright": case "delete": case "selectall": case "toggledir": + supportedBy = isSupportedBy(mozilla | ie | webkit | opera); + break; + + case "createlink": case "unlink": case "removeformat": + case "inserthorizontalrule": case "insertimage": + case "insertorderedlist": case "insertunorderedlist": + case "indent": case "outdent": case "formatblock": + case "inserthtml": case "undo": case "redo": case "strikethrough": case "tabindent": + supportedBy = isSupportedBy(mozilla | ie | opera | webkit); + break; + + case "blockdirltr": case "blockdirrtl": + case "dirltr": case "dirrtl": + case "inlinedirltr": case "inlinedirrtl": + supportedBy = isSupportedBy(ie); + break; + case "cut": case "copy": case "paste": + supportedBy = isSupportedBy( ie | mozilla | webkit | opera); + break; + + case "inserttable": + supportedBy = isSupportedBy(mozilla | ie); + break; + + case "insertcell": case "insertcol": case "insertrow": + case "deletecells": case "deletecols": case "deleterows": + case "mergecells": case "splitcell": + supportedBy = isSupportedBy(ie | mozilla); + break; + + default: return false; + } + + return (has("ie") && supportedBy.ie) || + (has("mozilla") && supportedBy.mozilla) || + (has("webkit") && supportedBy.webkit) || + (has("opera") && supportedBy.opera); // Boolean return true if the command is supported, false otherwise + }, + + execCommand: function(/*String*/ command, argument){ + // summary: + // Executes a command in the Rich Text area + // command: + // The command to execute + // argument: + // An optional argument to the command + // tags: + // protected + var returnValue; + + //focus() is required for IE to work + //In addition, focus() makes sure after the execution of + //the command, the editor receives the focus as expected + this.focus(); + + command = this._normalizeCommand(command, argument); + + if(argument !== undefined){ + if(command === "heading"){ + throw new Error("unimplemented"); + }else if((command === "formatblock") && has("ie")){ + argument = '<'+argument+'>'; + } + } + + //Check to see if we have any over-rides for commands, they will be functions on this + //widget of the form _commandImpl. If we don't, fall through to the basic native + //exec command of the browser. + var implFunc = "_" + command + "Impl"; + if(this[implFunc]){ + returnValue = this[implFunc](argument); + }else{ + argument = arguments.length > 1 ? argument : null; + if(argument || command !== "createlink"){ + returnValue = this.document.execCommand(command, false, argument); + } + } + + this.onDisplayChanged(); + return returnValue; + }, + + queryCommandEnabled: function(/*String*/ command){ + // summary: + // Check whether a command is enabled or not. + // command: + // The command to execute + // tags: + // protected + if(this.disabled || !this._disabledOK){ return false; } + + command = this._normalizeCommand(command); + + //Check to see if we have any over-rides for commands, they will be functions on this + //widget of the form _commandEnabledImpl. If we don't, fall through to the basic native + //command of the browser. + var implFunc = "_" + command + "EnabledImpl"; + + if(this[implFunc]){ + return this[implFunc](command); + }else{ + return this._browserQueryCommandEnabled(command); + } + }, + + queryCommandState: function(command){ + // summary: + // Check the state of a given command and returns true or false. + // tags: + // protected + + if(this.disabled || !this._disabledOK){ return false; } + command = this._normalizeCommand(command); + try{ + return this.document.queryCommandState(command); + }catch(e){ + //Squelch, occurs if editor is hidden on FF 3 (and maybe others.) + return false; + } + }, + + queryCommandValue: function(command){ + // summary: + // Check the value of a given command. This matters most for + // custom selections and complex values like font value setting. + // tags: + // protected + + if(this.disabled || !this._disabledOK){ return false; } + var r; + command = this._normalizeCommand(command); + if(has("ie") && command === "formatblock"){ + r = this._native2LocalFormatNames[this.document.queryCommandValue(command)]; + }else if(has("mozilla") && command === "hilitecolor"){ + var oldValue; + try{ + oldValue = this.document.queryCommandValue("styleWithCSS"); + }catch(e){ + oldValue = false; + } + this.document.execCommand("styleWithCSS", false, true); + r = this.document.queryCommandValue(command); + this.document.execCommand("styleWithCSS", false, oldValue); + }else{ + r = this.document.queryCommandValue(command); + } + return r; + }, + + // Misc. + + _sCall: function(name, args){ + // summary: + // Run the named method of dijit/_editor/selection over the + // current editor instance's window, with the passed args. + // tags: + // private + return win.withGlobal(this.window, name, selectionapi, args); + }, + + // FIXME: this is a TON of code duplication. Why? + + placeCursorAtStart: function(){ + // summary: + // Place the cursor at the start of the editing area. + // tags: + // private + + this.focus(); + + //see comments in placeCursorAtEnd + var isvalid=false; + if(has("mozilla")){ + // TODO: Is this branch even necessary? + var first=this.editNode.firstChild; + while(first){ + if(first.nodeType === 3){ + if(first.nodeValue.replace(/^\s+|\s+$/g, "").length>0){ + isvalid=true; + this._sCall("selectElement", [ first ]); + break; + } + }else if(first.nodeType === 1){ + isvalid=true; + var tg = first.tagName ? first.tagName.toLowerCase() : ""; + // Collapse before childless tags. + if(/br|input|img|base|meta|area|basefont|hr|link/.test(tg)){ + this._sCall("selectElement", [ first ]); + }else{ + // Collapse inside tags with children. + this._sCall("selectElementChildren", [ first ]); + } + break; + } + first = first.nextSibling; + } + }else{ + isvalid=true; + this._sCall("selectElementChildren", [ this.editNode ]); + } + if(isvalid){ + this._sCall("collapse", [ true ]); + } + }, + + placeCursorAtEnd: function(){ + // summary: + // Place the cursor at the end of the editing area. + // tags: + // private + + this.focus(); + + //In mozilla, if last child is not a text node, we have to use + // selectElementChildren on this.editNode.lastChild otherwise the + // cursor would be placed at the end of the closing tag of + //this.editNode.lastChild + var isvalid=false; + if(has("mozilla")){ + var last=this.editNode.lastChild; + while(last){ + if(last.nodeType === 3){ + if(last.nodeValue.replace(/^\s+|\s+$/g, "").length>0){ + isvalid=true; + this._sCall("selectElement", [ last ]); + break; + } + }else if(last.nodeType === 1){ + isvalid=true; + this._sCall("selectElement", [ last.lastChild || last]); + break; + } + last = last.previousSibling; + } + }else{ + isvalid=true; + this._sCall("selectElementChildren", [ this.editNode ]); + } + if(isvalid){ + this._sCall("collapse", [ false ]); + } + }, + + getValue: function(/*Boolean?*/ nonDestructive){ + // summary: + // Return the current content of the editing area (post filters + // are applied). Users should call get('value') instead. + // nonDestructive: + // defaults to false. Should the post-filtering be run over a copy + // of the live DOM? Most users should pass "true" here unless they + // *really* know that none of the installed filters are going to + // mess up the editing session. + // tags: + // private + if(this.textarea){ + if(this.isClosed || !this.isLoaded){ + return this.textarea.value; + } + } + + return this._postFilterContent(null, nonDestructive); + }, + _getValueAttr: function(){ + // summary: + // Hook to make attr("value") work + return this.getValue(true); + }, + + setValue: function(/*String*/ html){ + // summary: + // This function sets the content. No undo history is preserved. + // Users should use set('value', ...) instead. + // tags: + // deprecated + + // TODO: remove this and getValue() for 2.0, and move code to _setValueAttr() + + if(!this.isLoaded){ + // try again after the editor is finished loading + this.onLoadDeferred.then(lang.hitch(this, function(){ + this.setValue(html); + })); + return; + } + this._cursorToStart = true; + if(this.textarea && (this.isClosed || !this.isLoaded)){ + this.textarea.value=html; + }else{ + html = this._preFilterContent(html); + var node = this.isClosed ? this.domNode : this.editNode; + if(html && has("mozilla") && html.toLowerCase() === "<p></p>"){ + html = "<p> </p>"; // + } + + // Use to avoid webkit problems where editor is disabled until the user clicks it + if(!html && has("webkit")){ + html = " "; // + } + node.innerHTML = html; + this._preDomFilterContent(node); + } + + this.onDisplayChanged(); + this._set("value", this.getValue(true)); + }, + + replaceValue: function(/*String*/ html){ + // summary: + // This function set the content while trying to maintain the undo stack + // (now only works fine with Moz, this is identical to setValue in all + // other browsers) + // tags: + // protected + + if(this.isClosed){ + this.setValue(html); + }else if(this.window && this.window.getSelection && !has("mozilla")){ // Safari + // look ma! it's a totally f'd browser! + this.setValue(html); + }else if(this.window && this.window.getSelection){ // Moz + html = this._preFilterContent(html); + this.execCommand("selectall"); + if(!html){ + this._cursorToStart = true; + html = " "; // + } + this.execCommand("inserthtml", html); + this._preDomFilterContent(this.editNode); + }else if(this.document && this.document.selection){//IE + //In IE, when the first element is not a text node, say + //an <a> tag, when replacing the content of the editing + //area, the <a> tag will be around all the content + //so for now, use setValue for IE too + this.setValue(html); + } + + this._set("value", this.getValue(true)); + }, + + _preFilterContent: function(/*String*/ html){ + // summary: + // Filter the input before setting the content of the editing + // area. DOM pre-filtering may happen after this + // string-based filtering takes place but as of 1.2, this is not + // guaranteed for operations such as the inserthtml command. + // tags: + // private + + var ec = html; + array.forEach(this.contentPreFilters, function(ef){ if(ef){ ec = ef(ec); } }); + return ec; + }, + _preDomFilterContent: function(/*DomNode*/ dom){ + // summary: + // filter the input's live DOM. All filter operations should be + // considered to be "live" and operating on the DOM that the user + // will be interacting with in their editing session. + // tags: + // private + dom = dom || this.editNode; + array.forEach(this.contentDomPreFilters, function(ef){ + if(ef && lang.isFunction(ef)){ + ef(dom); + } + }, this); + }, + + _postFilterContent: function( + /*DomNode|DomNode[]|String?*/ dom, + /*Boolean?*/ nonDestructive){ + // summary: + // filter the output after getting the content of the editing area + // + // description: + // post-filtering allows plug-ins and users to specify any number + // of transforms over the editor's content, enabling many common + // use-cases such as transforming absolute to relative URLs (and + // vice-versa), ensuring conformance with a particular DTD, etc. + // The filters are registered in the contentDomPostFilters and + // contentPostFilters arrays. Each item in the + // contentDomPostFilters array is a function which takes a DOM + // Node or array of nodes as its only argument and returns the + // same. It is then passed down the chain for further filtering. + // The contentPostFilters array behaves the same way, except each + // member operates on strings. Together, the DOM and string-based + // filtering allow the full range of post-processing that should + // be necessaray to enable even the most agressive of post-editing + // conversions to take place. + // + // If nonDestructive is set to "true", the nodes are cloned before + // filtering proceeds to avoid potentially destructive transforms + // to the content which may still needed to be edited further. + // Once DOM filtering has taken place, the serialized version of + // the DOM which is passed is run through each of the + // contentPostFilters functions. + // + // dom: + // a node, set of nodes, which to filter using each of the current + // members of the contentDomPostFilters and contentPostFilters arrays. + // + // nonDestructive: + // defaults to "false". If true, ensures that filtering happens on + // a clone of the passed-in content and not the actual node + // itself. + // + // tags: + // private + + var ec; + if(!lang.isString(dom)){ + dom = dom || this.editNode; + if(this.contentDomPostFilters.length){ + if(nonDestructive){ + dom = lang.clone(dom); + } + array.forEach(this.contentDomPostFilters, function(ef){ + dom = ef(dom); + }); + } + ec = htmlapi.getChildrenHtml(dom); + }else{ + ec = dom; + } + + if(!lang.trim(ec.replace(/^\xA0\xA0*/, '').replace(/\xA0\xA0*$/, '')).length){ + ec = ""; + } + + // if(has("ie")){ + // //removing appended <P> </P> for IE + // ec = ec.replace(/(?:<p> </p>[\n\r]*)+$/i,""); + // } + array.forEach(this.contentPostFilters, function(ef){ + ec = ef(ec); + }); + + return ec; + }, + + _saveContent: function(){ + // summary: + // Saves the content in an onunload event if the editor has not been closed + // tags: + // private + + var saveTextarea = dom.byId(dijit._scopeName + "._editor.RichText.value"); + if(saveTextarea){ + if(saveTextarea.value){ + saveTextarea.value += this._SEPARATOR; + } + saveTextarea.value += this.name + this._NAME_CONTENT_SEP + this.getValue(true); + } + }, + + + escapeXml: function(/*String*/ str, /*Boolean*/ noSingleQuotes){ + // summary: + // Adds escape sequences for special characters in XML. + // Optionally skips escapes for single quotes + // tags: + // private + + str = str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """); + if(!noSingleQuotes){ + str = str.replace(/'/gm, "'"); + } + return str; // string + }, + + getNodeHtml: function(/* DomNode */ node){ + // summary: + // Deprecated. Use dijit/_editor/html::_getNodeHtml() instead. + // tags: + // deprecated + kernel.deprecated('dijit.Editor::getNodeHtml is deprecated','use dijit/_editor/html::getNodeHtml instead', 2); + return htmlapi.getNodeHtml(node); // String + }, + + getNodeChildrenHtml: function(/* DomNode */ dom){ + // summary: + // Deprecated. Use dijit/_editor/html::getChildrenHtml() instead. + // tags: + // deprecated + kernel.deprecated('dijit.Editor::getNodeChildrenHtml is deprecated','use dijit/_editor/html::getChildrenHtml instead', 2); + return htmlapi.getChildrenHtml(dom); + }, + + close: function(/*Boolean?*/ save){ + // summary: + // Kills the editor and optionally writes back the modified contents to the + // element from which it originated. + // save: + // Whether or not to save the changes. If false, the changes are discarded. + // tags: + // private + + if(this.isClosed){ return; } + + if(!arguments.length){ save = true; } + if(save){ + this._set("value", this.getValue(true)); + } + + // line height is squashed for iframes + // FIXME: why was this here? if(this.iframe){ this.domNode.style.lineHeight = null; } + + if(this.interval){ clearInterval(this.interval); } + + if(this._webkitListener){ + //Cleaup of WebKit fix: #9532 + this.disconnect(this._webkitListener); + delete this._webkitListener; + } + + // Guard against memory leaks on IE (see #9268) + if(has("ie")){ + this.iframe.onfocus = null; + } + this.iframe._loadFunc = null; + + if(this._iframeRegHandle){ + this._iframeRegHandle.remove(); + delete this._iframeRegHandle; + } + + if(this.textarea){ + var s = this.textarea.style; + s.position = ""; + s.left = s.top = ""; + if(has("ie")){ + s.overflow = this.__overflow; + this.__overflow = null; + } + this.textarea.value = this.value; + domConstruct.destroy(this.domNode); + this.domNode = this.textarea; + }else{ + // Note that this destroys the iframe + this.domNode.innerHTML = this.value; + } + delete this.iframe; + + domClass.remove(this.domNode, this.baseClass); + this.isClosed = true; + this.isLoaded = false; + + delete this.editNode; + delete this.focusNode; + + if(this.window && this.window._frameElement){ + this.window._frameElement = null; + } + + this.window = null; + this.document = null; + this.editingArea = null; + this.editorObject = null; + }, + + destroy: function(){ + if(!this.isClosed){ this.close(false); } + if(this._updateTimer){ + this._updateTimer.remove(); + } + this.inherited(arguments); + if(RichText._globalSaveHandler){ + delete RichText._globalSaveHandler[this.id]; + } + }, + + _removeMozBogus: function(/* String */ html){ + // summary: + // Post filter to remove unwanted HTML attributes generated by mozilla + // tags: + // private + return html.replace(/\stype="_moz"/gi, '').replace(/\s_moz_dirty=""/gi, '').replace(/_moz_resizing="(true|false)"/gi,''); // String + }, + _removeWebkitBogus: function(/* String */ html){ + // summary: + // Post filter to remove unwanted HTML attributes generated by webkit + // tags: + // private + html = html.replace(/\sclass="webkit-block-placeholder"/gi, ''); + html = html.replace(/\sclass="apple-style-span"/gi, ''); + // For some reason copy/paste sometime adds extra meta tags for charset on + // webkit (chrome) on mac.They need to be removed. See: #12007" + html = html.replace(/<meta charset=\"utf-8\" \/>/gi, ''); + return html; // String + }, + _normalizeFontStyle: function(/* String */ html){ + // summary: + // Convert 'strong' and 'em' to 'b' and 'i'. + // description: + // Moz can not handle strong/em tags correctly, so to help + // mozilla and also to normalize output, convert them to 'b' and 'i'. + // + // Note the IE generates 'strong' and 'em' rather than 'b' and 'i' + // tags: + // private + return html.replace(/<(\/)?strong([ \>])/gi, '<$1b$2') + .replace(/<(\/)?em([ \>])/gi, '<$1i$2' ); // String + }, + + _preFixUrlAttributes: function(/* String */ html){ + // summary: + // Pre-filter to do fixing to href attributes on `<a>` and `<img>` tags + // tags: + // private + return html.replace(/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi, + '$1$4$2$3$5$2 _djrealurl=$2$3$5$2') + .replace(/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi, + '$1$4$2$3$5$2 _djrealurl=$2$3$5$2'); // String + }, + + /***************************************************************************** + The following functions implement HTML manipulation commands for various + browser/contentEditable implementations. The goal of them is to enforce + standard behaviors of them. + ******************************************************************************/ + + /*** queryCommandEnabled implementations ***/ + + _browserQueryCommandEnabled: function(command){ + // summary: + // Implementation to call to the native queryCommandEnabled of the browser. + // command: + // The command to check. + // tags: + // protected + if(!command) { return false; } + var elem = has("ie") ? this.document.selection.createRange() : this.document; + try{ + return elem.queryCommandEnabled(command); + }catch(e){ + return false; + } + }, + + _createlinkEnabledImpl: function(/*===== argument =====*/){ + // summary: + // This function implements the test for if the create link + // command should be enabled or not. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var enabled = true; + if(has("opera")){ + var sel = this.window.getSelection(); + if(sel.isCollapsed){ + enabled = true; + }else{ + enabled = this.document.queryCommandEnabled("createlink"); + } + }else{ + enabled = this._browserQueryCommandEnabled("createlink"); + } + return enabled; + }, + + _unlinkEnabledImpl: function(/*===== argument =====*/){ + // summary: + // This function implements the test for if the unlink + // command should be enabled or not. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var enabled = true; + if(has("mozilla") || has("webkit")){ + enabled = this._sCall("hasAncestorElement", ["a"]); + }else{ + enabled = this._browserQueryCommandEnabled("unlink"); + } + return enabled; + }, + + _inserttableEnabledImpl: function(/*===== argument =====*/){ + // summary: + // This function implements the test for if the inserttable + // command should be enabled or not. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var enabled = true; + if(has("mozilla") || has("webkit")){ + enabled = true; + }else{ + enabled = this._browserQueryCommandEnabled("inserttable"); + } + return enabled; + }, + + _cutEnabledImpl: function(/*===== argument =====*/){ + // summary: + // This function implements the test for if the cut + // command should be enabled or not. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var enabled = true; + if(has("webkit")){ + // WebKit deems clipboard activity as a security threat and natively would return false + var sel = this.window.getSelection(); + if(sel){ sel = sel.toString(); } + enabled = !!sel; + }else{ + enabled = this._browserQueryCommandEnabled("cut"); + } + return enabled; + }, + + _copyEnabledImpl: function(/*===== argument =====*/){ + // summary: + // This function implements the test for if the copy + // command should be enabled or not. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var enabled = true; + if(has("webkit")){ + // WebKit deems clipboard activity as a security threat and natively would return false + var sel = this.window.getSelection(); + if(sel){ sel = sel.toString(); } + enabled = !!sel; + }else{ + enabled = this._browserQueryCommandEnabled("copy"); + } + return enabled; + }, + + _pasteEnabledImpl: function(/*===== argument =====*/){ + // summary:c + // This function implements the test for if the paste + // command should be enabled or not. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var enabled = true; + if(has("webkit")){ + return true; + }else{ + enabled = this._browserQueryCommandEnabled("paste"); + } + return enabled; + }, + + /*** execCommand implementations ***/ + + _inserthorizontalruleImpl: function(argument){ + // summary: + // This function implements the insertion of HTML 'HR' tags. + // into a point on the page. IE doesn't to it right, so + // we have to use an alternate form + // argument: + // arguments to the exec command, if any. + // tags: + // protected + if(has("ie")){ + return this._inserthtmlImpl("<hr>"); + } + return this.document.execCommand("inserthorizontalrule", false, argument); + }, + + _unlinkImpl: function(argument){ + // summary: + // This function implements the unlink of an 'a' tag. + // argument: + // arguments to the exec command, if any. + // tags: + // protected + if((this.queryCommandEnabled("unlink")) && (has("mozilla") || has("webkit"))){ + var a = this._sCall("getAncestorElement", [ "a" ]); + this._sCall("selectElement", [ a ]); + return this.document.execCommand("unlink", false, null); + } + return this.document.execCommand("unlink", false, argument); + }, + + _hilitecolorImpl: function(argument){ + // summary: + // This function implements the hilitecolor command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var returnValue; + var isApplied = this._handleTextColorOrProperties("hilitecolor", argument); + if(!isApplied){ + if(has("mozilla")){ + // mozilla doesn't support hilitecolor properly when useCSS is + // set to false (bugzilla #279330) + this.document.execCommand("styleWithCSS", false, true); + console.log("Executing color command."); + returnValue = this.document.execCommand("hilitecolor", false, argument); + this.document.execCommand("styleWithCSS", false, false); + }else{ + returnValue = this.document.execCommand("hilitecolor", false, argument); + } + } + return returnValue; + }, + + _backcolorImpl: function(argument){ + // summary: + // This function implements the backcolor command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + if(has("ie")){ + // Tested under IE 6 XP2, no problem here, comment out + // IE weirdly collapses ranges when we exec these commands, so prevent it + // var tr = this.document.selection.createRange(); + argument = argument ? argument : null; + } + var isApplied = this._handleTextColorOrProperties("backcolor", argument); + if(!isApplied){ + isApplied = this.document.execCommand("backcolor", false, argument); + } + return isApplied; + }, + + _forecolorImpl: function(argument){ + // summary: + // This function implements the forecolor command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + if(has("ie")){ + // Tested under IE 6 XP2, no problem here, comment out + // IE weirdly collapses ranges when we exec these commands, so prevent it + // var tr = this.document.selection.createRange(); + argument = argument? argument : null; + } + var isApplied = false; + isApplied = this._handleTextColorOrProperties("forecolor", argument); + if(!isApplied){ + isApplied = this.document.execCommand("forecolor", false, argument); + } + return isApplied; + }, + + _inserthtmlImpl: function(argument){ + // summary: + // This function implements the insertion of HTML content into + // a point on the page. + // argument: + // The content to insert, if any. + // tags: + // protected + argument = this._preFilterContent(argument); + var rv = true; + if(has("ie")){ + var insertRange = this.document.selection.createRange(); + if(this.document.selection.type.toUpperCase() === 'CONTROL'){ + var n=insertRange.item(0); + while(insertRange.length){ + insertRange.remove(insertRange.item(0)); + } + n.outerHTML=argument; + }else{ + insertRange.pasteHTML(argument); + } + insertRange.select(); + //insertRange.collapse(true); + }else if(has("mozilla") && !argument.length){ + //mozilla can not inserthtml an empty html to delete current selection + //so we delete the selection instead in this case + this._sCall("remove"); // FIXME + }else{ + rv = this.document.execCommand("inserthtml", false, argument); + } + return rv; + }, + + _boldImpl: function(argument){ + // summary: + // This function implements an over-ride of the bold command. + // argument: + // Not used, operates by selection. + // tags: + // protected + var applied = false; + if(has("ie")){ + this._adaptIESelection(); + applied = this._adaptIEFormatAreaAndExec("bold"); + } + if(!applied){ + applied = this.document.execCommand("bold", false, argument); + } + return applied; + }, + + _italicImpl: function(argument){ + // summary: + // This function implements an over-ride of the italic command. + // argument: + // Not used, operates by selection. + // tags: + // protected + var applied = false; + if(has("ie")){ + this._adaptIESelection(); + applied = this._adaptIEFormatAreaAndExec("italic"); + } + if(!applied){ + applied = this.document.execCommand("italic", false, argument); + } + return applied; + }, + + _underlineImpl: function(argument){ + // summary: + // This function implements an over-ride of the underline command. + // argument: + // Not used, operates by selection. + // tags: + // protected + var applied = false; + if(has("ie")){ + this._adaptIESelection(); + applied = this._adaptIEFormatAreaAndExec("underline"); + } + if(!applied){ + applied = this.document.execCommand("underline", false, argument); + } + return applied; + }, + + _strikethroughImpl: function(argument){ + // summary: + // This function implements an over-ride of the strikethrough command. + // argument: + // Not used, operates by selection. + // tags: + // protected + var applied = false; + if(has("ie")){ + this._adaptIESelection(); + applied = this._adaptIEFormatAreaAndExec("strikethrough"); + } + if(!applied){ + applied = this.document.execCommand("strikethrough", false, argument); + } + return applied; + }, + + _superscriptImpl: function(argument){ + // summary: + // This function implements an over-ride of the superscript command. + // argument: + // Not used, operates by selection. + // tags: + // protected + var applied = false; + if(has("ie")){ + this._adaptIESelection(); + applied = this._adaptIEFormatAreaAndExec("superscript"); + } + if(!applied){ + applied = this.document.execCommand("superscript", false, argument); + } + return applied; + }, + + _subscriptImpl: function(argument){ + // summary: + // This function implements an over-ride of the superscript command. + // argument: + // Not used, operates by selection. + // tags: + // protected + var applied = false; + if(has("ie")){ + this._adaptIESelection(); + applied = this._adaptIEFormatAreaAndExec("subscript"); + + } + if(!applied){ + applied = this.document.execCommand("subscript", false, argument); + } + return applied; + }, + + _fontnameImpl: function(argument){ + // summary: + // This function implements the fontname command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var isApplied; + if(has("ie")){ + isApplied = this._handleTextColorOrProperties("fontname", argument); + } + if(!isApplied){ + isApplied = this.document.execCommand("fontname", false, argument); + } + return isApplied; + }, + + _fontsizeImpl: function(argument){ + // summary: + // This function implements the fontsize command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var isApplied; + if(has("ie")){ + isApplied = this._handleTextColorOrProperties("fontsize", argument); + } + if(!isApplied){ + isApplied = this.document.execCommand("fontsize", false, argument); + } + return isApplied; + }, + + _insertorderedlistImpl: function(argument){ + // summary: + // This function implements the insertorderedlist command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var applied = false; + if(has("ie")){ + applied = this._adaptIEList("insertorderedlist", argument); + } + if(!applied){ + applied = this.document.execCommand("insertorderedlist", false, argument); + } + return applied; + }, + + _insertunorderedlistImpl: function(argument){ + // summary: + // This function implements the insertunorderedlist command + // argument: + // arguments to the exec command, if any. + // tags: + // protected + var applied = false; + if(has("ie")){ + applied = this._adaptIEList("insertunorderedlist", argument); + } + if(!applied){ + applied = this.document.execCommand("insertunorderedlist", false, argument); + } + return applied; + }, + + getHeaderHeight: function(){ + // summary: + // A function for obtaining the height of the header node + return this._getNodeChildrenHeight(this.header); // Number + }, + + getFooterHeight: function(){ + // summary: + // A function for obtaining the height of the footer node + return this._getNodeChildrenHeight(this.footer); // Number + }, + + _getNodeChildrenHeight: function(node){ + // summary: + // An internal function for computing the cumulative height of all child nodes of 'node' + // node: + // The node to process the children of; + var h = 0; + if(node && node.childNodes){ + // IE didn't compute it right when position was obtained on the node directly is some cases, + // so we have to walk over all the children manually. + var i; + for(i = 0; i < node.childNodes.length; i++){ + var size = domGeometry.position(node.childNodes[i]); + h += size.h; + } + } + return h; // Number + }, + + _isNodeEmpty: function(node, startOffset){ + // summary: + // Function to test if a node is devoid of real content. + // node: + // The node to check. + // tags: + // private. + if(node.nodeType === 1/*element*/){ + if(node.childNodes.length > 0){ + return this._isNodeEmpty(node.childNodes[0], startOffset); + } + return true; + }else if(node.nodeType === 3/*text*/){ + return (node.nodeValue.substring(startOffset) === ""); + } + return false; + }, + + _removeStartingRangeFromRange: function(node, range){ + // summary: + // Function to adjust selection range by removing the current + // start node. + // node: + // The node to remove from the starting range. + // range: + // The range to adapt. + // tags: + // private + if(node.nextSibling){ + range.setStart(node.nextSibling,0); + }else{ + var parent = node.parentNode; + while(parent && parent.nextSibling == null){ + //move up the tree until we find a parent that has another node, that node will be the next node + parent = parent.parentNode; + } + if(parent){ + range.setStart(parent.nextSibling,0); + } + } + return range; + }, + + _adaptIESelection: function(){ + // summary: + // Function to adapt the IE range by removing leading 'newlines' + // Needed to fix issue with bold/italics/underline not working if + // range included leading 'newlines'. + // In IE, if a user starts a selection at the very end of a line, + // then the native browser commands will fail to execute correctly. + // To work around the issue, we can remove all empty nodes from + // the start of the range selection. + var selection = rangeapi.getSelection(this.window); + if(selection && selection.rangeCount && !selection.isCollapsed){ + var range = selection.getRangeAt(0); + var firstNode = range.startContainer; + var startOffset = range.startOffset; + + while(firstNode.nodeType === 3/*text*/ && startOffset >= firstNode.length && firstNode.nextSibling){ + //traverse the text nodes until we get to the one that is actually highlighted + startOffset = startOffset - firstNode.length; + firstNode = firstNode.nextSibling; + } + + //Remove the starting ranges until the range does not start with an empty node. + var lastNode=null; + while(this._isNodeEmpty(firstNode, startOffset) && firstNode !== lastNode){ + lastNode =firstNode; //this will break the loop in case we can't find the next sibling + range = this._removeStartingRangeFromRange(firstNode, range); //move the start container to the next node in the range + firstNode = range.startContainer; + startOffset = 0; //start at the beginning of the new starting range + } + selection.removeAllRanges();// this will work as long as users cannot select multiple ranges. I have not been able to do that in the editor. + selection.addRange(range); + } + }, + + _adaptIEFormatAreaAndExec: function(command){ + // summary: + // Function to handle IE's quirkiness regarding how it handles + // format commands on a word. This involves a lit of node splitting + // and format cloning. + // command: + // The format command, needed to check if the desired + // command is true or not. + var selection = rangeapi.getSelection(this.window); + var doc = this.document; + var rs, ret, range, txt, startNode, endNode, breaker, sNode; + if(command && selection && selection.isCollapsed){ + var isApplied = this.queryCommandValue(command); + if(isApplied){ + + // We have to split backwards until we hit the format + var nNames = this._tagNamesForCommand(command); + range = selection.getRangeAt(0); + var fs = range.startContainer; + if(fs.nodeType === 3){ + var offset = range.endOffset; + if(fs.length < offset){ + //We are not looking from the right node, try to locate the correct one + ret = this._adjustNodeAndOffset(rs, offset); + fs = ret.node; + offset = ret.offset; + } + } + var topNode; + while(fs && fs !== this.editNode){ + // We have to walk back and see if this is still a format or not. + // Hm, how do I do this? + var tName = fs.tagName? fs.tagName.toLowerCase() : ""; + if(array.indexOf(nNames, tName) > -1){ + topNode = fs; + break; + } + fs = fs.parentNode; + } + + // Okay, we have a stopping place, time to split things apart. + if(topNode){ + // Okay, we know how far we have to split backwards, so we have to split now. + rs = range.startContainer; + var newblock = doc.createElement(topNode.tagName); + domConstruct.place(newblock, topNode, "after"); + if(rs && rs.nodeType === 3){ + // Text node, we have to split it. + var nodeToMove, tNode; + var endOffset = range.endOffset; + if(rs.length < endOffset){ + //We are not splitting the right node, try to locate the correct one + ret = this._adjustNodeAndOffset(rs, endOffset); + rs = ret.node; + endOffset = ret.offset; + } + + txt = rs.nodeValue; + startNode = doc.createTextNode(txt.substring(0, endOffset)); + var endText = txt.substring(endOffset, txt.length); + if(endText){ + endNode = doc.createTextNode(endText); + } + // Place the split, then remove original nodes. + domConstruct.place(startNode, rs, "before"); + if(endNode){ + breaker = doc.createElement("span"); + breaker.className = "ieFormatBreakerSpan"; + domConstruct.place(breaker, rs, "after"); + domConstruct.place(endNode, breaker, "after"); + endNode = breaker; + } + domConstruct.destroy(rs); + + // Okay, we split the text. Now we need to see if we're + // parented to the block element we're splitting and if + // not, we have to split all the way up. Ugh. + var parentC = startNode.parentNode; + var tagList = []; + var tagData; + while(parentC !== topNode){ + var tg = parentC.tagName; + tagData = {tagName: tg}; + tagList.push(tagData); + + var newTg = doc.createElement(tg); + // Clone over any 'style' data. + if(parentC.style){ + if(newTg.style){ + if(parentC.style.cssText){ + newTg.style.cssText = parentC.style.cssText; + tagData.cssText = parentC.style.cssText; + } + } + } + // If font also need to clone over any font data. + if(parentC.tagName === "FONT"){ + if(parentC.color){ + newTg.color = parentC.color; + tagData.color = parentC.color; + } + if(parentC.face){ + newTg.face = parentC.face; + tagData.face = parentC.face; + } + if(parentC.size){ // this check was necessary on IE + newTg.size = parentC.size; + tagData.size = parentC.size; + } + } + if(parentC.className){ + newTg.className = parentC.className; + tagData.className = parentC.className; + } + + // Now move end node and every sibling + // after it over into the new tag. + if(endNode){ + nodeToMove = endNode; + while(nodeToMove){ + tNode = nodeToMove.nextSibling; + newTg.appendChild(nodeToMove); + nodeToMove = tNode; + } + } + if(newTg.tagName == parentC.tagName){ + breaker = doc.createElement("span"); + breaker.className = "ieFormatBreakerSpan"; + domConstruct.place(breaker, parentC, "after"); + domConstruct.place(newTg, breaker, "after"); + }else{ + domConstruct.place(newTg, parentC, "after"); + } + startNode = parentC; + endNode = newTg; + parentC = parentC.parentNode; + } + + // Lastly, move the split out all the split tags + // to the new block as they should now be split properly. + if(endNode){ + nodeToMove = endNode; + if(nodeToMove.nodeType === 1 || (nodeToMove.nodeType === 3 && nodeToMove.nodeValue)){ + // Non-blank text and non-text nodes need to clear out that blank space + // before moving the contents. + newblock.innerHTML = ""; + } + while(nodeToMove){ + tNode = nodeToMove.nextSibling; + newblock.appendChild(nodeToMove); + nodeToMove = tNode; + } + } + + // We had intermediate tags, we have to now recreate them inbetween the split + // and restore what styles, classnames, etc, we can. + var newrange; + if(tagList.length){ + tagData = tagList.pop(); + var newContTag = doc.createElement(tagData.tagName); + if(tagData.cssText && newContTag.style){ + newContTag.style.cssText = tagData.cssText; + } + if(tagData.className){ + newContTag.className = tagData.className; + } + if(tagData.tagName === "FONT"){ + if(tagData.color){ + newContTag.color = tagData.color; + } + if(tagData.face){ + newContTag.face = tagData.face; + } + if(tagData.size){ + newContTag.size = tagData.size; + } + } + domConstruct.place(newContTag, newblock, "before"); + while(tagList.length){ + tagData = tagList.pop(); + var newTgNode = doc.createElement(tagData.tagName); + if(tagData.cssText && newTgNode.style){ + newTgNode.style.cssText = tagData.cssText; + } + if(tagData.className){ + newTgNode.className = tagData.className; + } + if(tagData.tagName === "FONT"){ + if(tagData.color){ + newTgNode.color = tagData.color; + } + if(tagData.face){ + newTgNode.face = tagData.face; + } + if(tagData.size){ + newTgNode.size = tagData.size; + } + } + newContTag.appendChild(newTgNode); + newContTag = newTgNode; + } + + // Okay, everything is theoretically split apart and removed from the content + // so insert the dummy text to select, select it, then + // clear to position cursor. + sNode = doc.createTextNode("."); + breaker.appendChild(sNode); + newContTag.appendChild(sNode); + newrange = rangeapi.create(this.window); + newrange.setStart(sNode, 0); + newrange.setEnd(sNode, sNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + this._sCall("collapse", [false]); + sNode.parentNode.innerHTML = ""; + }else{ + // No extra tags, so we have to insert a breaker point and rely + // on filters to remove it later. + breaker = doc.createElement("span"); + breaker.className="ieFormatBreakerSpan"; + sNode = doc.createTextNode("."); + breaker.appendChild(sNode); + domConstruct.place(breaker, newblock, "before"); + newrange = rangeapi.create(this.window); + newrange.setStart(sNode, 0); + newrange.setEnd(sNode, sNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + this._sCall("collapse", [false]); + sNode.parentNode.innerHTML = ""; + } + if(!newblock.firstChild){ + // Empty, we don't need it. Split was at end or similar + // So, remove it. + domConstruct.destroy(newblock); + } + return true; + } + } + return false; + }else{ + range = selection.getRangeAt(0); + rs = range.startContainer; + if(rs && rs.nodeType === 3){ + // Text node, we have to split it. + var offset = range.startOffset; + if(rs.length < offset){ + //We are not splitting the right node, try to locate the correct one + ret = this._adjustNodeAndOffset(rs, offset); + rs = ret.node; + offset = ret.offset; + } + txt = rs.nodeValue; + startNode = doc.createTextNode(txt.substring(0, offset)); + var endText = txt.substring(offset); + if(endText !== ""){ + endNode = doc.createTextNode(txt.substring(offset)); + } + // Create a space, we'll select and bold it, so + // the whole word doesn't get bolded + breaker = doc.createElement("span"); + sNode = doc.createTextNode("."); + breaker.appendChild(sNode); + if(startNode.length){ + domConstruct.place(startNode, rs, "after"); + }else{ + startNode = rs; + } + domConstruct.place(breaker, startNode, "after"); + if(endNode){ + domConstruct.place(endNode, breaker, "after"); + } + domConstruct.destroy(rs); + var newrange = rangeapi.create(this.window); + newrange.setStart(sNode, 0); + newrange.setEnd(sNode, sNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + doc.execCommand(command); + domConstruct.place(breaker.firstChild, breaker, "before"); + domConstruct.destroy(breaker); + newrange.setStart(sNode, 0); + newrange.setEnd(sNode, sNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + this._sCall("collapse", [false]); + sNode.parentNode.innerHTML = ""; + return true; + } + } + }else{ + return false; + } + }, + + _adaptIEList: function(command /*===== , argument =====*/){ + // summary: + // This function handles normalizing the IE list behavior as + // much as possible. + // command: + // The list command to execute. + // argument: + // Any additional argument. + // tags: + // private + var selection = rangeapi.getSelection(this.window); + if(selection.isCollapsed){ + // In the case of no selection, lets commonize the behavior and + // make sure that it indents if needed. + if(selection.rangeCount && !this.queryCommandValue(command)){ + var range = selection.getRangeAt(0); + var sc = range.startContainer; + if(sc && sc.nodeType == 3){ + // text node. Lets see if there is a node before it that isn't + // some sort of breaker. + if(!range.startOffset){ + // We're at the beginning of a text area. It may have been br split + // Who knows? In any event, we must create the list manually + // or IE may shove too much into the list element. It seems to + // grab content before the text node too if it's br split. + // Why can't IE work like everyone else? + + // Create a space, we'll select and bold it, so + // the whole word doesn't get bolded + var lType = "ul"; + if(command === "insertorderedlist"){ + lType = "ol"; + } + var list = this.document.createElement(lType); + var li = domConstruct.create("li", null, list); + domConstruct.place(list, sc, "before"); + // Move in the text node as part of the li. + li.appendChild(sc); + // We need a br after it or the enter key handler + // sometimes throws errors. + domConstruct.create("br", null, list, "after"); + // Okay, now lets move our cursor to the beginning. + var newrange = rangeapi.create(this.window); + newrange.setStart(sc, 0); + newrange.setEnd(sc, sc.length); + selection.removeAllRanges(); + selection.addRange(newrange); + this._sCall("collapse", [true]); + return true; + } + } + } + } + return false; + }, + + _handleTextColorOrProperties: function(command, argument){ + // summary: + // This function handles appplying text color as best it is + // able to do so when the selection is collapsed, making the + // behavior cross-browser consistent. It also handles the name + // and size for IE. + // command: + // The command. + // argument: + // Any additional arguments. + // tags: + // private + var selection = rangeapi.getSelection(this.window); + var doc = this.document; + var rs, ret, range, txt, startNode, endNode, breaker, sNode; + argument = argument || null; + if(command && selection && selection.isCollapsed){ + if(selection.rangeCount){ + range = selection.getRangeAt(0); + rs = range.startContainer; + if(rs && rs.nodeType === 3){ + // Text node, we have to split it. + var offset = range.startOffset; + if(rs.length < offset){ + //We are not splitting the right node, try to locate the correct one + ret = this._adjustNodeAndOffset(rs, offset); + rs = ret.node; + offset = ret.offset; + } + txt = rs.nodeValue; + startNode = doc.createTextNode(txt.substring(0, offset)); + var endText = txt.substring(offset); + if(endText !== ""){ + endNode = doc.createTextNode(txt.substring(offset)); + } + // Create a space, we'll select and bold it, so + // the whole word doesn't get bolded + breaker = doc.createElement("span"); + sNode = doc.createTextNode("."); + breaker.appendChild(sNode); + // Create a junk node to avoid it trying to style the breaker. + // This will get destroyed later. + var extraSpan = doc.createElement("span"); + breaker.appendChild(extraSpan); + if(startNode.length){ + domConstruct.place(startNode, rs, "after"); + }else{ + startNode = rs; + } + domConstruct.place(breaker, startNode, "after"); + if(endNode){ + domConstruct.place(endNode, breaker, "after"); + } + domConstruct.destroy(rs); + var newrange = rangeapi.create(this.window); + newrange.setStart(sNode, 0); + newrange.setEnd(sNode, sNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + if(has("webkit")){ + // WebKit is frustrating with positioning the cursor. + // It stinks to have a selected space, but there really + // isn't much choice here. + var style = "color"; + if(command === "hilitecolor" || command === "backcolor"){ + style = "backgroundColor"; + } + domStyle.set(breaker, style, argument); + this._sCall("remove", []); + domConstruct.destroy(extraSpan); + breaker.innerHTML = " "; // + this._sCall("selectElement", [breaker]); + this.focus(); + }else{ + this.execCommand(command, argument); + domConstruct.place(breaker.firstChild, breaker, "before"); + domConstruct.destroy(breaker); + newrange.setStart(sNode, 0); + newrange.setEnd(sNode, sNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + this._sCall("collapse", [false]); + sNode.parentNode.removeChild(sNode); + } + return true; + } + } + } + return false; + }, + + _adjustNodeAndOffset: function(/*DomNode*/node, /*Int*/offset){ + // summary: + // In the case there are multiple text nodes in a row the offset may not be within the node. + // If the offset is larger than the node length, it will attempt to find + // the next text sibling until it locates the text node in which the offset refers to + // node: + // The node to check. + // offset: + // The position to find within the text node + // tags: + // private. + while(node.length < offset && node.nextSibling && node.nextSibling.nodeType === 3){ + //Adjust the offset and node in the case of multiple text nodes in a row + offset = offset - node.length; + node = node.nextSibling; + } + return {"node": node, "offset": offset}; + }, + + _tagNamesForCommand: function(command){ + // summary: + // Function to return the tab names that are associated + // with a particular style. + // command: String + // The command to return tags for. + // tags: + // private + if(command === "bold"){ + return ["b", "strong"]; + }else if(command === "italic"){ + return ["i","em"]; + }else if(command === "strikethrough"){ + return ["s", "strike"]; + }else if(command === "superscript"){ + return ["sup"]; + }else if(command === "subscript"){ + return ["sub"]; + }else if(command === "underline"){ + return ["u"]; + } + return []; + }, + + _stripBreakerNodes: function(/*DOMNode*/ node){ + // summary: + // Function for stripping out the breaker spans inserted by the formatting command. + // Registered as a filter for IE, handles the breaker spans needed to fix up + // How bold/italic/etc, work when selection is collapsed (single cursor). + if(!this.isLoaded){ return; } // this method requires init to be complete + query(".ieFormatBreakerSpan", node).forEach(function(b){ + while(b.firstChild){ + domConstruct.place(b.firstChild, b, "before"); + } + domConstruct.destroy(b); + }); + return node; + } +}); + +return RichText; + +}); diff --git a/lib/dijit/_editor/_Plugin.js b/lib/dijit/_editor/_Plugin.js index 7eff3ba01..36b7fae98 100644 --- a/lib/dijit/_editor/_Plugin.js +++ b/lib/dijit/_editor/_Plugin.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/_Plugin",["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","../form/Button"],function(_1,_2,_3,_4){var _5=_2("dijit._editor._Plugin",null,{constructor:function(_6){this.params=_6||{};_3.mixin(this,this.params);this._connects=[];this._attrPairNames={};},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:true,buttonClass:_4,disabled:false,getLabel:function(_7){return this.editor.commands[_7];},_initButton:function(){if(this.command.length){var _8=this.getLabel(this.command),_9=this.editor,_a=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);if(!this.button){var _b=_3.mixin({label:_8,dir:_9.dir,lang:_9.lang,showLabel:false,iconClass:_a,dropDown:this.dropDown,tabIndex:"-1"},this.params||{});this.button=new this.buttonClass(_b);}}if(this.get("disabled")&&this.button){this.button.set("disabled",this.get("disabled"));}},destroy:function(){var h;while(h=this._connects.pop()){h.remove();}if(this.dropDown){this.dropDown.destroyRecursive();}},connect:function(o,f,tf){this._connects.push(_1.connect(o,f,this,tf));},updateState:function(){var e=this.editor,c=this.command,_c,_d;if(!e||!e.isLoaded||!c.length){return;}var _e=this.get("disabled");if(this.button){try{_d=!_e&&e.queryCommandEnabled(c);if(this.enabled!==_d){this.enabled=_d;this.button.set("disabled",!_d);}if(typeof this.button.checked=="boolean"){_c=e.queryCommandState(c);if(this.checked!==_c){this.checked=_c;this.button.set("checked",e.queryCommandState(c));}}}catch(e){}}},setEditor:function(_f){this.editor=_f;this._initButton();if(this.button&&this.useDefaultCommand){if(this.editor.queryCommandAvailable(this.command)){this.connect(this.button,"onClick",_3.hitch(this.editor,"execCommand",this.command,this.commandArg));}else{this.button.domNode.style.display="none";}}this.connect(this.editor,"onNormalizedDisplayChanged","updateState");},setToolbar:function(_10){if(this.button){_10.addChild(this.button);}},set:function(_11,_12){if(typeof _11==="object"){for(var x in _11){this.set(x,_11[x]);}return this;}var _13=this._getAttrNames(_11);if(this[_13.s]){var _14=this[_13.s].apply(this,Array.prototype.slice.call(arguments,1));}else{this._set(_11,_12);}return _14||this;},get:function(_15){var _16=this._getAttrNames(_15);return this[_16.g]?this[_16.g]():this[_15];},_setDisabledAttr:function(_17){this.disabled=_17;this.updateState();},_getAttrNames:function(_18){var apn=this._attrPairNames;if(apn[_18]){return apn[_18];}var uc=_18.charAt(0).toUpperCase()+_18.substr(1);return (apn[_18]={s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(_19,_1a){this[_19]=_1a;}});_5.registry={};return _5;});
\ No newline at end of file +define("dijit/_editor/_Plugin",["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","../form/Button"],function(_1,_2,_3,_4){var _5=_2("dijit._editor._Plugin",null,{constructor:function(_6){this.params=_6||{};_3.mixin(this,this.params);this._connects=[];this._attrPairNames={};},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:true,buttonClass:_4,disabled:false,getLabel:function(_7){return this.editor.commands[_7];},_initButton:function(){if(this.command.length){var _8=this.getLabel(this.command),_9=this.editor,_a=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);if(!this.button){var _b=_3.mixin({label:_8,ownerDocument:_9.ownerDocument,dir:_9.dir,lang:_9.lang,showLabel:false,iconClass:_a,dropDown:this.dropDown,tabIndex:"-1"},this.params||{});this.button=new this.buttonClass(_b);}}if(this.get("disabled")&&this.button){this.button.set("disabled",this.get("disabled"));}},destroy:function(){var h;while(h=this._connects.pop()){h.remove();}if(this.dropDown){this.dropDown.destroyRecursive();}},connect:function(o,f,tf){this._connects.push(_1.connect(o,f,this,tf));},updateState:function(){var e=this.editor,c=this.command,_c,_d;if(!e||!e.isLoaded||!c.length){return;}var _e=this.get("disabled");if(this.button){try{_d=!_e&&e.queryCommandEnabled(c);if(this.enabled!==_d){this.enabled=_d;this.button.set("disabled",!_d);}if(_d){if(typeof this.button.checked=="boolean"){_c=e.queryCommandState(c);if(this.checked!==_c){this.checked=_c;this.button.set("checked",e.queryCommandState(c));}}}}catch(e){}}},setEditor:function(_f){this.editor=_f;this._initButton();if(this.button&&this.useDefaultCommand){if(this.editor.queryCommandAvailable(this.command)){this.connect(this.button,"onClick",_3.hitch(this.editor,"execCommand",this.command,this.commandArg));}else{this.button.domNode.style.display="none";}}this.connect(this.editor,"onNormalizedDisplayChanged","updateState");},setToolbar:function(_10){if(this.button){_10.addChild(this.button);}},set:function(_11,_12){if(typeof _11==="object"){for(var x in _11){this.set(x,_11[x]);}return this;}var _13=this._getAttrNames(_11);if(this[_13.s]){var _14=this[_13.s].apply(this,Array.prototype.slice.call(arguments,1));}else{this._set(_11,_12);}return _14||this;},get:function(_15){var _16=this._getAttrNames(_15);return this[_16.g]?this[_16.g]():this[_15];},_setDisabledAttr:function(_17){this.disabled=_17;this.updateState();},_getAttrNames:function(_18){var apn=this._attrPairNames;if(apn[_18]){return apn[_18];}var uc=_18.charAt(0).toUpperCase()+_18.substr(1);return (apn[_18]={s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(_19,_1a){this[_19]=_1a;}});_5.registry={};return _5;});
\ No newline at end of file diff --git a/lib/dijit/_editor/_Plugin.js.uncompressed.js b/lib/dijit/_editor/_Plugin.js.uncompressed.js new file mode 100644 index 000000000..18d8d4e25 --- /dev/null +++ b/lib/dijit/_editor/_Plugin.js.uncompressed.js @@ -0,0 +1,302 @@ +define("dijit/_editor/_Plugin", [ + "dojo/_base/connect", // connect.connect + "dojo/_base/declare", // declare + "dojo/_base/lang", // lang.mixin, lang.hitch + "../form/Button" +], function(connect, declare, lang, Button){ + +// module: +// dijit/_editor/_Plugin +// summary: +// Base class for a "plugin" to the editor, which is usually +// a single button on the Toolbar and some associated code + + +var _Plugin = declare("dijit._editor._Plugin", null, { + // summary: + // Base class for a "plugin" to the editor, which is usually + // a single button on the Toolbar and some associated code + + constructor: function(args){ + // summary: + // Create the plugin. + // args: Object? + // Initial settings for any of the attributes. + + this.params = args || {}; + lang.mixin(this, this.params); + this._connects=[]; + this._attrPairNames = {}; + }, + + // editor: [const] dijit.Editor + // Points to the parent editor + editor: null, + + // iconClassPrefix: [const] String + // The CSS class name for the button node is formed from `iconClassPrefix` and `command` + iconClassPrefix: "dijitEditorIcon", + + // button: dijit/_WidgetBase? + // Pointer to `dijit/form/Button` or other widget (ex: `dijit/form/FilteringSelect`) + // that is added to the toolbar to control this plugin. + // If not specified, will be created on initialization according to `buttonClass` + button: null, + + // command: String + // String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command. + // Passed to editor.execCommand() if `useDefaultCommand` is true. + command: "", + + // useDefaultCommand: Boolean + // If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`. + useDefaultCommand: true, + + // buttonClass: Widget Class + // Class of widget (ex: dijit.form.Button or dijit/form/FilteringSelect) + // that is added to the toolbar to control this plugin. + // This is used to instantiate the button, unless `button` itself is specified directly. + buttonClass: Button, + + // disabled: Boolean + // Flag to indicate if this plugin has been disabled and should do nothing + // helps control button state, among other things. Set via the setter api. + disabled: false, + + getLabel: function(/*String*/key){ + // summary: + // Returns the label to use for the button + // tags: + // private + return this.editor.commands[key]; // String + }, + + _initButton: function(){ + // summary: + // Initialize the button or other widget that will control this plugin. + // This code only works for plugins controlling built-in commands in the editor. + // tags: + // protected extension + if(this.command.length){ + var label = this.getLabel(this.command), + editor = this.editor, + className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1); + if(!this.button){ + var props = lang.mixin({ + label: label, + ownerDocument: editor.ownerDocument, + dir: editor.dir, + lang: editor.lang, + showLabel: false, + iconClass: className, + dropDown: this.dropDown, + tabIndex: "-1" + }, this.params || {}); + this.button = new this.buttonClass(props); + } + } + if(this.get("disabled") && this.button){ + this.button.set("disabled", this.get("disabled")); + } + }, + + destroy: function(){ + // summary: + // Destroy this plugin + + var h; + while(h = this._connects.pop()){ h.remove(); } + if(this.dropDown){ + this.dropDown.destroyRecursive(); + } + }, + + connect: function(o, f, tf){ + // summary: + // Make a connect.connect() that is automatically disconnected when this plugin is destroyed. + // Similar to `dijit/_Widget.connect()`. + // tags: + // protected + this._connects.push(connect.connect(o, f, this, tf)); + }, + + updateState: function(){ + // summary: + // Change state of the plugin to respond to events in the editor. + // description: + // This is called on meaningful events in the editor, such as change of selection + // or caret position (but not simple typing of alphanumeric keys). It gives the + // plugin a chance to update the CSS of its button. + // + // For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the + // characters next to the caret are bold or not. + // + // Only makes sense when `useDefaultCommand` is true, as it calls Editor.queryCommandEnabled(`command`). + var e = this.editor, + c = this.command, + checked, enabled; + if(!e || !e.isLoaded || !c.length){ return; } + var disabled = this.get("disabled"); + if(this.button){ + try{ + enabled = !disabled && e.queryCommandEnabled(c); + if(this.enabled !== enabled){ + this.enabled = enabled; + this.button.set('disabled', !enabled); + } + if(enabled){ + if(typeof this.button.checked == 'boolean'){ + checked = e.queryCommandState(c); + if(this.checked !== checked){ + this.checked = checked; + this.button.set('checked', e.queryCommandState(c)); + } + } + } + }catch(e){ + console.log(e); // FIXME: we shouldn't have debug statements in our code. Log as an error? + } + } + }, + + setEditor: function(/*dijit/Editor*/ editor){ + // summary: + // Tell the plugin which Editor it is associated with. + + // TODO: refactor code to just pass editor to constructor. + + // FIXME: detach from previous editor!! + this.editor = editor; + + // FIXME: prevent creating this if we don't need to (i.e., editor can't handle our command) + this._initButton(); + + // Processing for buttons that execute by calling editor.execCommand() + if(this.button && this.useDefaultCommand){ + if(this.editor.queryCommandAvailable(this.command)){ + this.connect(this.button, "onClick", + lang.hitch(this.editor, "execCommand", this.command, this.commandArg) + ); + }else{ + // hide button because editor doesn't support command (due to browser limitations) + this.button.domNode.style.display = "none"; + } + } + + this.connect(this.editor, "onNormalizedDisplayChanged", "updateState"); + }, + + setToolbar: function(/*dijit/Toolbar*/ toolbar){ + // summary: + // Tell the plugin to add it's controller widget (often a button) + // to the toolbar. Does nothing if there is no controller widget. + + // TODO: refactor code to just pass toolbar to constructor. + + if(this.button){ + toolbar.addChild(this.button); + } + // console.debug("adding", this.button, "to:", toolbar); + }, + + set: function(/* attribute */ name, /* anything */ value){ + // summary: + // Set a property on a plugin + // name: + // The property to set. + // value: + // The value to set in the property. + // description: + // Sets named properties on a plugin which may potentially be handled by a + // setter in the plugin. + // For example, if the plugin has a properties "foo" + // and "bar" and a method named "_setFooAttr", calling: + // | plugin.set("foo", "Howdy!"); + // would be equivalent to writing: + // | plugin._setFooAttr("Howdy!"); + // and: + // | plugin.set("bar", 3); + // would be equivalent to writing: + // | plugin.bar = 3; + // + // set() may also be called with a hash of name/value pairs, ex: + // | plugin.set({ + // | foo: "Howdy", + // | bar: 3 + // | }) + // This is equivalent to calling set(foo, "Howdy") and set(bar, 3) + if(typeof name === "object"){ + for(var x in name){ + this.set(x, name[x]); + } + return this; + } + var names = this._getAttrNames(name); + if(this[names.s]){ + // use the explicit setter + var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1)); + }else{ + this._set(name, value); + } + return result || this; + }, + + get: function(name){ + // summary: + // Get a property from a plugin. + // name: + // The property to get. + // description: + // Get a named property from a plugin. The property may + // potentially be retrieved via a getter method. If no getter is defined, this + // just retrieves the object's property. + // For example, if the plugin has a properties "foo" + // and "bar" and a method named "_getFooAttr", calling: + // | plugin.get("foo"); + // would be equivalent to writing: + // | plugin._getFooAttr(); + // and: + // | plugin.get("bar"); + // would be equivalent to writing: + // | plugin.bar; + var names = this._getAttrNames(name); + return this[names.g] ? this[names.g]() : this[name]; + }, + + _setDisabledAttr: function(disabled){ + // summary: + // Function to set the plugin state and call updateState to make sure the + // button is updated appropriately. + this.disabled = disabled; + this.updateState(); + }, + + _getAttrNames: function(name){ + // summary: + // Helper function for get() and set(). + // Caches attribute name values so we don't do the string ops every time. + // tags: + // private + + var apn = this._attrPairNames; + if(apn[name]){ return apn[name]; } + var uc = name.charAt(0).toUpperCase() + name.substr(1); + return (apn[name] = { + s: "_set"+uc+"Attr", + g: "_get"+uc+"Attr" + }); + }, + + _set: function(/*String*/ name, /*anything*/ value){ + // summary: + // Helper function to set new value for specified attribute + this[name] = value; + } +}); + +// Hash mapping plugin name to factory, used for registering plugins +_Plugin.registry = {}; + +return _Plugin; + +}); diff --git a/lib/dijit/_editor/html.js b/lib/dijit/_editor/html.js index 45becc4b0..dc19ffba8 100644 --- a/lib/dijit/_editor/html.js +++ b/lib/dijit/_editor/html.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/html",["dojo/_base/lang","dojo/_base/sniff",".."],function(_1,_2,_3){_1.getObject("_editor",true,_3);_3._editor.escapeXml=function(_4,_5){_4=_4.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");if(!_5){_4=_4.replace(/'/gm,"'");}return _4;};_3._editor.getNodeHtml=function(_6){var _7;switch(_6.nodeType){case 1:var _8=_6.nodeName.toLowerCase();if(!_8||_8.charAt(0)=="/"){return "";}_7="<"+_8;var _9=[];var _a;if(_2("ie")&&_6.outerHTML){var s=_6.outerHTML;s=s.substr(0,s.indexOf(">")).replace(/(['"])[^"']*\1/g,"");var _b=/(\b\w+)\s?=/g;var m,_c;while((m=_b.exec(s))){_c=m[1];if(_c.substr(0,3)!="_dj"){if(_c=="src"||_c=="href"){if(_6.getAttribute("_djrealurl")){_9.push([_c,_6.getAttribute("_djrealurl")]);continue;}}var _d,_e;switch(_c){case "style":_d=_6.style.cssText.toLowerCase();break;case "class":_d=_6.className;break;case "width":if(_8==="img"){_e=/width=(\S+)/i.exec(s);if(_e){_d=_e[1];}break;}case "height":if(_8==="img"){_e=/height=(\S+)/i.exec(s);if(_e){_d=_e[1];}break;}default:_d=_6.getAttribute(_c);}if(_d!=null){_9.push([_c,_d.toString()]);}}}}else{var i=0;while((_a=_6.attributes[i++])){var n=_a.name;if(n.substr(0,3)!="_dj"){var v=_a.value;if(n=="src"||n=="href"){if(_6.getAttribute("_djrealurl")){v=_6.getAttribute("_djrealurl");}}_9.push([n,v]);}}}_9.sort(function(a,b){return a[0]<b[0]?-1:(a[0]==b[0]?0:1);});var j=0;while((_a=_9[j++])){_7+=" "+_a[0]+"=\""+(_1.isString(_a[1])?_3._editor.escapeXml(_a[1],true):_a[1])+"\"";}if(_8==="script"){_7+=">"+_6.innerHTML+"</"+_8+">";}else{if(_6.childNodes.length){_7+=">"+_3._editor.getChildrenHtml(_6)+"</"+_8+">";}else{switch(_8){case "br":case "hr":case "img":case "input":case "base":case "meta":case "area":case "basefont":_7+=" />";break;default:_7+="></"+_8+">";}}}break;case 4:case 3:_7=_3._editor.escapeXml(_6.nodeValue,true);break;case 8:_7="<!--"+_3._editor.escapeXml(_6.nodeValue,true)+"-->";break;default:_7="<!-- Element not recognized - Type: "+_6.nodeType+" Name: "+_6.nodeName+"-->";}return _7;};_3._editor.getChildrenHtml=function(_f){var out="";if(!_f){return out;}var _10=_f["childNodes"]||_f;var _11=!_2("ie")||_10!==_f;var _12,i=0;while((_12=_10[i++])){if(!_11||_12.parentNode==_f){out+=_3._editor.getNodeHtml(_12);}}return out;};return _3._editor;});
\ No newline at end of file +define("dijit/_editor/html",["dojo/_base/array","dojo/_base/lang","dojo/sniff"],function(_1,_2,_3){var _4={};_2.setObject("dijit._editor.html",_4);var _5=_4.escapeXml=function(_6,_7){_6=_6.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/gm,""");if(!_7){_6=_6.replace(/'/gm,"'");}return _6;};_4.getNodeHtml=function(_8){var _9=[];_4.getNodeHtmlHelper(_8,_9);return _9.join("");};_4.getNodeHtmlHelper=function(_a,_b){switch(_a.nodeType){case 1:var _c=_a.nodeName.toLowerCase();if(!_c||_c.charAt(0)=="/"){return "";}_b.push("<",_c);var _d=[],_e={};var _f;if(_3("dom-attributes-explicit")||_3("dom-attributes-specified-flag")){var i=0;while((_f=_a.attributes[i++])){var n=_f.name;if(n.substr(0,3)!=="_dj"&&(!_3("dom-attributes-specified-flag")||_f.specified)&&!(n in _e)){var v=_f.value;if(n=="src"||n=="href"){if(_a.getAttribute("_djrealurl")){v=_a.getAttribute("_djrealurl");}}if(_3("ie")===8&&n==="style"){v=v.replace("HEIGHT:","height:").replace("WIDTH:","width:");}_d.push([n,v]);_e[n]=v;}}}else{var _10=/^input$|^img$/i.test(_a.nodeName)?_a:_a.cloneNode(false);var s=_10.outerHTML;var _11=/[\w-]+=("[^"]*"|'[^']*'|\S*)/gi;var _12=s.match(_11);s=s.substr(0,s.indexOf(">"));_1.forEach(_12,function(_13){if(_13){var idx=_13.indexOf("=");if(idx>0){var key=_13.substring(0,idx);if(key.substr(0,3)!="_dj"){if(key=="src"||key=="href"){if(_a.getAttribute("_djrealurl")){_d.push([key,_a.getAttribute("_djrealurl")]);return;}}var val,_14;switch(key){case "style":val=_a.style.cssText.toLowerCase();break;case "class":val=_a.className;break;case "width":if(_c==="img"){_14=/width=(\S+)/i.exec(s);if(_14){val=_14[1];}break;}case "height":if(_c==="img"){_14=/height=(\S+)/i.exec(s);if(_14){val=_14[1];}break;}default:val=_a.getAttribute(key);}if(val!=null){_d.push([key,val.toString()]);}}}}},this);}_d.sort(function(a,b){return a[0]<b[0]?-1:(a[0]==b[0]?0:1);});var j=0;while((_f=_d[j++])){_b.push(" ",_f[0],"=\"",(typeof _f[1]==="string"?_5(_f[1],true):_f[1]),"\"");}switch(_c){case "br":case "hr":case "img":case "input":case "base":case "meta":case "area":case "basefont":_b.push(" />");break;case "script":_b.push(">",_a.innerHTML,"</",_c,">");break;default:_b.push(">");if(_a.hasChildNodes()){_4.getChildrenHtmlHelper(_a,_b);}_b.push("</",_c,">");}break;case 4:case 3:_b.push(_5(_a.nodeValue,true));break;case 8:_b.push("<!--",_5(_a.nodeValue,true),"-->");break;default:_b.push("<!-- Element not recognized - Type: ",_a.nodeType," Name: ",_a.nodeName,"-->");}};_4.getChildrenHtml=function(_15){var _16=[];_4.getChildrenHtmlHelper(_15,_16);return _16.join("");};_4.getChildrenHtmlHelper=function(dom,_17){if(!dom){return;}var _18=dom["childNodes"]||dom;var _19=!_3("ie")||_18!==dom;var _1a,i=0;while((_1a=_18[i++])){if(!_19||_1a.parentNode==dom){_4.getNodeHtmlHelper(_1a,_17);}}};return _4;});
\ No newline at end of file diff --git a/lib/dijit/_editor/html.js.uncompressed.js b/lib/dijit/_editor/html.js.uncompressed.js new file mode 100644 index 000000000..76d591a30 --- /dev/null +++ b/lib/dijit/_editor/html.js.uncompressed.js @@ -0,0 +1,223 @@ +define("dijit/_editor/html", [ + "dojo/_base/array", + "dojo/_base/lang", // lang.setObject + "dojo/sniff" // has("ie") +], function(array, lang, has){ + +// module: +// dijit/_editor/html +// summary: +// HTML serialization utility functions used by editor + +var exports = {}; +lang.setObject("dijit._editor.html", exports); + +var escape = exports.escapeXml = function(/*String*/ str, /*Boolean?*/ noSingleQuotes){ + // summary: + // Adds escape sequences for special characters in XML: `&<>"'`. + // Optionally skips escapes for single quotes. + str = str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """); + if(!noSingleQuotes){ + str = str.replace(/'/gm, "'"); + } + return str; // string +}; + + +exports.getNodeHtml = function(/*DomNode*/ node){ + // summary: + // Return string representing HTML for node and it's children + var output = []; + exports.getNodeHtmlHelper(node, output); + return output.join(""); +}; + +exports.getNodeHtmlHelper = function(/*DomNode*/ node, /*String[]*/ output){ + // summary: + // Pushes array of strings into output[] which represent HTML for node and it's children + switch(node.nodeType){ + case 1: // element node + var lName = node.nodeName.toLowerCase(); + if(!lName || lName.charAt(0) == "/"){ + // IE does some strange things with malformed HTML input, like + // treating a close tag </span> without an open tag <span>, as + // a new tag with tagName of /span. Corrupts output HTML, remove + // them. Other browsers don't prefix tags that way, so will + // never show up. + return ""; + } + output.push('<', lName); + + // store the list of attributes and sort it to have the + // attributes appear in the dictionary order + var attrarray = [], attrhash = {}; + var attr; + if(has("dom-attributes-explicit") || has("dom-attributes-specified-flag")){ + // IE8+ and all other browsers. + var i = 0; + while((attr = node.attributes[i++])){ + // ignore all attributes starting with _dj which are + // internal temporary attributes used by the editor + var n = attr.name; + if(n.substr(0,3) !== '_dj' && + (!has("dom-attributes-specified-flag") || attr.specified) && + !(n in attrhash)){ // workaround repeated attributes bug in IE8 (LinkDialog test) + var v = attr.value; + if(n == 'src' || n == 'href'){ + if(node.getAttribute('_djrealurl')){ + v = node.getAttribute('_djrealurl'); + } + } + if(has("ie") === 8 && n === "style"){ + v = v.replace("HEIGHT:", "height:").replace("WIDTH:", "width:"); + } + attrarray.push([n,v]); + attrhash[n] = v; + } + } + }else{ + // IE6-7 code path + var clone = /^input$|^img$/i.test(node.nodeName) ? node : node.cloneNode(false); + var s = clone.outerHTML; + // Split up and manage the attrs via regexp + // similar to prettyPrint attr logic. + var rgxp_attrsMatch = /[\w-]+=("[^"]*"|'[^']*'|\S*)/gi + var attrSplit = s.match(rgxp_attrsMatch); + s = s.substr(0, s.indexOf('>')); + array.forEach(attrSplit, function(attr){ + if(attr){ + var idx = attr.indexOf("="); + if(idx > 0){ + var key = attr.substring(0,idx); + if(key.substr(0,3) != '_dj'){ + if(key == 'src' || key == 'href'){ + if(node.getAttribute('_djrealurl')){ + attrarray.push([key,node.getAttribute('_djrealurl')]); + return; + } + } + var val, match; + switch(key){ + case 'style': + val = node.style.cssText.toLowerCase(); + break; + case 'class': + val = node.className; + break; + case 'width': + if(lName === "img"){ + // This somehow gets lost on IE for IMG tags and the like + // and we have to find it in outerHTML, known IE oddity. + match=/width=(\S+)/i.exec(s); + if(match){ + val = match[1]; + } + break; + } + case 'height': + if(lName === "img"){ + // This somehow gets lost on IE for IMG tags and the like + // and we have to find it in outerHTML, known IE oddity. + match=/height=(\S+)/i.exec(s); + if(match){ + val = match[1]; + } + break; + } + default: + val = node.getAttribute(key); + } + if(val != null){ + attrarray.push([key, val.toString()]); + } + } + } + } + }, this); + } + attrarray.sort(function(a,b){ + return a[0] < b[0] ? -1 : (a[0] == b[0] ? 0 : 1); + }); + var j = 0; + while((attr = attrarray[j++])){ + output.push(' ', attr[0], '="', + (typeof attr[1] === "string" ? escape(attr[1], true) : attr[1]), '"'); + } + switch(lName){ + case 'br': + case 'hr': + case 'img': + case 'input': + case 'base': + case 'meta': + case 'area': + case 'basefont': + // These should all be singly closed + output.push(' />'); + break; + case 'script': + // Browsers handle script tags differently in how you get content, + // but innerHTML always seems to work, so insert its content that way + // Yes, it's bad to allow script tags in the editor code, but some people + // seem to want to do it, so we need to at least return them right. + // other plugins/filters can strip them. + output.push('>', node.innerHTML, '</', lName, '>'); + break; + default: + output.push('>'); + if(node.hasChildNodes()){ + exports.getChildrenHtmlHelper(node, output); + } + output.push('</', lName, '>'); + } + break; + case 4: // cdata + case 3: // text + // FIXME: + output.push(escape(node.nodeValue, true)); + break; + case 8: // comment + // FIXME: + output.push('<!--', escape(node.nodeValue, true), '-->'); + break; + default: + output.push("<!-- Element not recognized - Type: ", node.nodeType, " Name: ", node.nodeName, "-->"); + } +}; + +exports.getChildrenHtml = function(/*DomNode*/ node){ + // summary: + // Returns the html content of a DomNode's children + var output = []; + exports.getChildrenHtmlHelper(node, output); + return output.join(""); +}; + +exports.getChildrenHtmlHelper = function(/*DomNode*/ dom, /*String[]*/ output){ + // summary: + // Pushes the html content of a DomNode's children into out[] + + if(!dom){ return; } + var nodes = dom["childNodes"] || dom; + + // IE issue. + // If we have an actual node we can check parent relationships on for IE, + // We should check, as IE sometimes builds invalid DOMS. If no parent, we can't check + // And should just process it and hope for the best. + var checkParent = !has("ie") || nodes !== dom; + + var node, i = 0; + while((node = nodes[i++])){ + // IE is broken. DOMs are supposed to be a tree. But in the case of malformed HTML, IE generates a graph + // meaning one node ends up with multiple references (multiple parents). This is totally wrong and invalid, but + // such is what it is. We have to keep track and check for this because otherwise the source output HTML will have dups. + // No other browser generates a graph. Leave it to IE to break a fundamental DOM rule. So, we check the parent if we can + // If we can't, nothing more we can do other than walk it. + if(!checkParent || node.parentNode == dom){ + exports.getNodeHtmlHelper(node, output); + } + } +}; + +return exports; +}); diff --git a/lib/dijit/_editor/nls/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..07d0f0723 --- /dev/null +++ b/lib/dijit/_editor/nls/FontChoice.js.uncompressed.js @@ -0,0 +1,62 @@ +define("dijit/_editor/nls/FontChoice", { root: +//begin v1.x content +({ + fontSize: "Size", + fontName: "Font", + formatBlock: "Format", + + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + + noFormat: "None", + p: "Paragraph", + h1: "Heading", + h2: "Subheading", + h3: "Sub-subheading", + pre: "Pre-formatted", + + 1: "xx-small", + 2: "x-small", + 3: "small", + 4: "medium", + 5: "large", + 6: "x-large", + 7: "xx-large" +}) +//end v1.x content +, +"zh": true, +"zh-tw": true, +"tr": true, +"th": true, +"sv": true, +"sl": true, +"sk": true, +"ru": true, +"ro": true, +"pt": true, +"pt-pt": true, +"pl": true, +"nl": true, +"nb": true, +"ko": true, +"kk": true, +"ja": true, +"it": true, +"hu": true, +"hr": true, +"he": true, +"fr": true, +"fi": true, +"es": true, +"el": true, +"de": true, +"da": true, +"cs": true, +"ca": true, +"az": true, +"ar": true +}); diff --git a/lib/dijit/_editor/nls/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..543f87a8e --- /dev/null +++ b/lib/dijit/_editor/nls/LinkDialog.js.uncompressed.js @@ -0,0 +1,48 @@ +define("dijit/_editor/nls/LinkDialog", { root: +//begin v1.x content +({ + createLinkTitle: "Link Properties", + insertImageTitle: "Image Properties", + url: "URL:", + text: "Description:", + target: "Target:", + set: "Set", + currentWindow: "Current Window", + parentWindow: "Parent Window", + topWindow: "Topmost Window", + newWindow: "New Window" +}) +//end v1.x content +, +"zh": true, +"zh-tw": true, +"tr": true, +"th": true, +"sv": true, +"sl": true, +"sk": true, +"ru": true, +"ro": true, +"pt": true, +"pt-pt": true, +"pl": true, +"nl": true, +"nb": true, +"ko": true, +"kk": true, +"ja": true, +"it": true, +"hu": true, +"hr": true, +"he": true, +"fr": true, +"fi": true, +"es": true, +"el": true, +"de": true, +"da": true, +"cs": true, +"ca": true, +"az": true, +"ar": true +}); diff --git a/lib/dijit/_editor/nls/ar/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/ar/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..ea2818c92 --- /dev/null +++ b/lib/dijit/_editor/nls/ar/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/ar/FontChoice", ({ + fontSize: "الحجم", + fontName: "طاقم طباعة", + formatBlock: "النسق", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "أحادي المسافة", + cursive: "كتابة بحروف متصلة", + fantasy: "خيالي", + noFormat: "لا شيء", + p: "فقرة", + h1: "عنوان", + h2: "عنوان فرعي", + h3: "فرعي-عنوان فرعي", + pre: "منسق بصفة مسبقة", + 1: "صغير جدا جدا", + 2: "صغير جدا", + 3: "صغير", + 4: "متوسط", + 5: "كبير", + 6: "كبير جدا", + 7: "كبير جدا جدا" +}) +); diff --git a/lib/dijit/_editor/nls/ar/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/ar/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..157b55d04 --- /dev/null +++ b/lib/dijit/_editor/nls/ar/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/ar/LinkDialog", ({ + createLinkTitle: "خصائص الوصلة", + insertImageTitle: "خصائص الصورة", + url: "عنوان URL:", + text: "الوصف:", + target: "الهدف:", + set: "تحديد", + currentWindow: "النافذة الحالية", + parentWindow: "النافذة الرئيسية", + topWindow: "النافذة العلوية", + newWindow: "نافذة جديدة" +}) +); diff --git a/lib/dijit/_editor/nls/ar/commands.js.uncompressed.js b/lib/dijit/_editor/nls/ar/commands.js.uncompressed.js new file mode 100644 index 000000000..cb8d8dfbd --- /dev/null +++ b/lib/dijit/_editor/nls/ar/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/ar/commands", ({ + 'bold': 'عري~ض', + 'copy': 'نسخ', + 'cut': 'قص', + 'delete': 'حذف', + 'indent': 'ازاحة للداخل', + 'insertHorizontalRule': 'مسطرة أفقية', + 'insertOrderedList': 'كشف مرقم', + 'insertUnorderedList': 'كشف نقطي', + 'italic': '~مائل', + 'justifyCenter': 'محاذاة في الوسط', + 'justifyFull': 'ضبط', + 'justifyLeft': 'محاذاة الى اليسار', + 'justifyRight': 'محاذاة الى اليمين', + 'outdent': 'ازاحة للخارج', + 'paste': 'لصق', + 'redo': 'اعادة', + 'removeFormat': 'ازالة النسق', + 'selectAll': 'اختيار كل', + 'strikethrough': 'تشطيب', + 'subscript': 'رمز سفلي', + 'superscript': 'رمز علوي', + 'underline': '~تسطير', + 'undo': 'تراجع', + 'unlink': 'ازالة وصلة', + 'createLink': 'تكوين وصلة', + 'toggleDir': 'تبديل الاتجاه', + 'insertImage': 'ادراج صورة', + 'insertTable': 'ادراج/تحرير جدول', + 'toggleTableBorder': 'تبديل حدود الجدول', + 'deleteTable': 'حذف جدول', + 'tableProp': 'خصائص الجدول', + 'htmlToggle': 'مصدر HTML', + 'foreColor': 'لون الواجهة الأمامية', + 'hiliteColor': 'لون الخلفية', + 'plainFormatBlock': 'نمط الفقرة', + 'formatBlock': 'نمط الفقرة', + 'fontSize': 'حجم طاقم الطباعة', + 'fontName': 'اسم طاقم الطباعة', + 'tabIndent': 'ازاحة علامة الجدولة للداخل', + "fullScreen": "تبديل الشاشة الكاملة", + "viewSource": "مشاهدة مصدر HTML", + "print": "طباعة", + "newPage": "صفحة جديدة", + /* Error messages */ + 'systemShortcut': 'يكون التصرف "${0}" متاحا فقط ببرنامج الاستعراض الخاص بك باستخدام المسار المختصر للوحة المفاتيح. استخدم ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/az/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/az/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..19c4deefa --- /dev/null +++ b/lib/dijit/_editor/nls/az/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/az/FontChoice", ({ + "1" : "xx-kiçik", + "2" : "x-kiçik", + "formatBlock" : "Format", + "3" : "kiçik", + "4" : "orta", + "5" : "böyük", + "6" : "çox-böyük", + "7" : "ən böyük", + "fantasy" : "fantaziya", + "serif" : "serif", + "p" : "Abzas", + "pre" : "Əvvəldən düzəldilmiş", + "sans-serif" : "sans-serif", + "fontName" : "Şrift", + "h1" : "Başlıq", + "h2" : "Alt Başlıq", + "h3" : "Alt Alt Başlıq", + "monospace" : "Tək aralıqlı", + "fontSize" : "Ölçü", + "cursive" : "Əl yazısı", + "noFormat" : "Heç biri" +}) +); diff --git a/lib/dijit/_editor/nls/az/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/az/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..66d46ad1c --- /dev/null +++ b/lib/dijit/_editor/nls/az/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/az/LinkDialog", ({ + "text" : "Yazı:", + "insertImageTitle" : "Şəkil başlığı əlavə et", + "set" : "Yönəlt", + "newWindow" : "Yeni pəncərə", + "topWindow" : "Üst pəncərə", + "target" : "Hədəf:", + "createLinkTitle" : "Köprü başlığı yarat", + "parentWindow" : "Ana pəncərə", + "currentWindow" : "Hazırki pəncərə", + "url" : "URL:" +}) +); diff --git a/lib/dijit/_editor/nls/az/commands.js.uncompressed.js b/lib/dijit/_editor/nls/az/commands.js.uncompressed.js new file mode 100644 index 000000000..2aba5f318 --- /dev/null +++ b/lib/dijit/_editor/nls/az/commands.js.uncompressed.js @@ -0,0 +1,50 @@ +define( +"dijit/_editor/nls/az/commands", ({ + "removeFormat" : "Formatı Sil", + "copy" :"Köçür", + "paste" :"Yapışdır", + "selectAll" :"Hamısını seç", + "insertOrderedList" :"Nömrəli siyahı", + "insertTable" :"Cədvəl əlavə et", + "print" :"Yazdır", + "underline" :"Altıxətli", + "foreColor" :"Ön plan rəngi", + "htmlToggle" :"HTML kodu", + "formatBlock" :"Abzas stili", + "newPage" :"Yeni səhifə", + "insertHorizontalRule" :"Üfüqi qayda", + "delete" :"Sil", + "insertUnorderedList" :"İşarələnmiş siyahı", + "tableProp" :"Cədvəl xüsusiyyətləri", + "insertImage" :"Şəkil əlavə et", + "superscript" :"Üst işarə", + "subscript" :"Alt işarə", + "createLink" :"Körpü yarat", + "undo" :"Geriyə al", + "fullScreen" :"Tam ekran aç", + "italic" :"İtalik", + "fontName" :"Yazı tipi", + "justifyLeft" :"Sol tərəfə Doğrult", + "unlink" :"Körpünü sil", + "toggleTableBorder" :"Cədvəl kənarlarını göstər/Gizlət", + "viewSource" :"HTML qaynaq kodunu göstər", + "fontSize" :"Yazı tipi böyüklüğü", + "systemShortcut" :"\"${0}\" prosesi yalnız printerinizdə klaviatura qısayolu ilə istifadə oluna bilər. Bundan istifadə edin", + "indent" :"Girinti", + "redo" :"Yenilə", + "strikethrough" :"Üstündən xətt çəkilmiş", + "justifyFull" :"Doğrult", + "justifyCenter" :"Ortaya doğrult", + "hiliteColor" :"Arxa plan rəngi", + "deleteTable" :"Cədvəli sil", + "outdent" :"Çıxıntı", + "cut" :"Kəs", + "plainFormatBlock" :"Abzas stili", + "toggleDir" :"İstiqaməti dəyişdir", + "bold" :"Qalın", + "tabIndent" :"Qulp girintisi", + "justifyRight" :"Sağa doğrult", + "appleKey" : "⌘${0}", + "ctrlKey" : "ctrl+${0}" +}) +); diff --git a/lib/dijit/_editor/nls/ca/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/ca/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..46237c108 --- /dev/null +++ b/lib/dijit/_editor/nls/ca/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/ca/FontChoice", ({ + fontSize: "Mida", + fontName: "Tipus de lletra", + formatBlock: "Format", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monoespai", + cursive: "Cursiva", + fantasy: "Fantasia", + noFormat: "Cap", + p: "Paràgraf", + h1: "Títol", + h2: "Subtítol", + h3: "Subsubtítol", + pre: "Format previ", + 1: "xx-petit", + 2: "x-petit", + 3: "petit", + 4: "mitjà", + 5: "gran", + 6: "x-gran", + 7: "xx-gran" +}) +); diff --git a/lib/dijit/_editor/nls/ca/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/ca/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..8726255f9 --- /dev/null +++ b/lib/dijit/_editor/nls/ca/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/ca/LinkDialog", ({ + createLinkTitle: "Propietats de l\'enllaç", + insertImageTitle: "Propietats de la imatge", + url: "URL:", + text: "Descripció:", + target: "Destinació:", + set: "Defineix", + currentWindow: "Finestra actual", + parentWindow: "Finestra pare", + topWindow: "Finestra superior", + newWindow: "Finestra nova" +}) +); diff --git a/lib/dijit/_editor/nls/ca/commands.js b/lib/dijit/_editor/nls/ca/commands.js index 0b724df79..7449c5024 100644 --- a/lib/dijit/_editor/nls/ca/commands.js +++ b/lib/dijit/_editor/nls/ca/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ca/commands",({"bold":"Negreta","copy":"Copia","cut":"Retalla","delete":"Suprimeix","indent":"Sagnat","insertHorizontalRule":"Regla horitzontal","insertOrderedList":"Llista numerada","insertUnorderedList":"Llista de vinyetes","italic":"Cursiva","justifyCenter":"Centra","justifyFull":"Justifica","justifyLeft":"Alinea a l'esquerra","justifyRight":"Alinea a la dreta","outdent":"Sagna a l'esquerra","paste":"Enganxa","redo":"Refés","removeFormat":"Elimina el format","selectAll":"Selecciona-ho tot","strikethrough":"Ratllat","subscript":"Subíndex","superscript":"Superíndex","underline":"Subratllat","undo":"Desfés","unlink":"Elimina l'enllaç","createLink":"Crea un enllaç","toggleDir":"Inverteix la direcció","insertImage":"Insereix imatge","insertTable":"Insereix/edita la taula","toggleTableBorder":"Inverteix els contorns de taula","deleteTable":"Suprimeix la taula","tableProp":"Propietat de taula","htmlToggle":"Font HTML","foreColor":"Color de primer pla","hiliteColor":"Color de fons","plainFormatBlock":"Estil de paràgraf","formatBlock":"Estil de paràgraf","fontSize":"Cos de la lletra","fontName":"Nom del tipus de lletra","tabIndent":"Sagnat","fullScreen":"Commuta pantalla completa","viewSource":"Visualitza font HTML","print":"Imprimeix","newPage":"Pàgina nova","systemShortcut":"L'acció \"${0}\" és l'única disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.","ctrlKey":"control+${0}"}));
\ No newline at end of file +define("dijit/_editor/nls/ca/commands",({"bold":"Negreta","copy":"Copia","cut":"Retalla","delete":"Suprimeix","indent":"Sagnat","insertHorizontalRule":"Regla horitzontal","insertOrderedList":"Llista numerada","insertUnorderedList":"Llista de vinyetes","italic":"Cursiva","justifyCenter":"Centra","justifyFull":"Justifica","justifyLeft":"Alinea a l'esquerra","justifyRight":"Alinea a la dreta","outdent":"Sagna a l'esquerra","paste":"Enganxa","redo":"Refés","removeFormat":"Elimina el format","selectAll":"Selecciona-ho tot","strikethrough":"Ratllat","subscript":"Subíndex","superscript":"Superíndex","underline":"Subratllat","undo":"Desfés","unlink":"Elimina l'enllaç","createLink":"Crea un enllaç","toggleDir":"Inverteix la direcció","insertImage":"Insereix imatge","insertTable":"Insereix/edita la taula","toggleTableBorder":"Inverteix els contorns de taula","deleteTable":"Suprimeix la taula","tableProp":"Propietat de taula","htmlToggle":"Font HTML","foreColor":"Color de primer pla","hiliteColor":"Color de fons","plainFormatBlock":"Estil de paràgraf","formatBlock":"Estil de paràgraf","fontSize":"Cos de la lletra","fontName":"Nom del tipus de lletra","tabIndent":"Sagnat","fullScreen":"Commuta pantalla completa","viewSource":"Visualitza font HTML","print":"Imprimeix","newPage":"Pàgina nova","systemShortcut":"L'acció \"${0}\" és l'única disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.","ctrlKey":"control+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ca/commands.js.uncompressed.js b/lib/dijit/_editor/nls/ca/commands.js.uncompressed.js new file mode 100644 index 000000000..601b0dddd --- /dev/null +++ b/lib/dijit/_editor/nls/ca/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/ca/commands", ({ + 'bold': 'Negreta', + 'copy': 'Copia', + 'cut': 'Retalla', + 'delete': 'Suprimeix', + 'indent': 'Sagnat', + 'insertHorizontalRule': 'Regla horitzontal', + 'insertOrderedList': 'Llista numerada', + 'insertUnorderedList': 'Llista de vinyetes', + 'italic': 'Cursiva', + 'justifyCenter': 'Centra', + 'justifyFull': 'Justifica', + 'justifyLeft': 'Alinea a l\'esquerra', + 'justifyRight': 'Alinea a la dreta', + 'outdent': 'Sagna a l\'esquerra', + 'paste': 'Enganxa', + 'redo': 'Refés', + 'removeFormat': 'Elimina el format', + 'selectAll': 'Selecciona-ho tot', + 'strikethrough': 'Ratllat', + 'subscript': 'Subíndex', + 'superscript': 'Superíndex', + 'underline': 'Subratllat', + 'undo': 'Desfés', + 'unlink': 'Elimina l\'enllaç', + 'createLink': 'Crea un enllaç', + 'toggleDir': 'Inverteix la direcció', + 'insertImage': 'Insereix imatge', + 'insertTable': 'Insereix/edita la taula', + 'toggleTableBorder': 'Inverteix els contorns de taula', + 'deleteTable': 'Suprimeix la taula', + 'tableProp': 'Propietat de taula', + 'htmlToggle': 'Font HTML', + 'foreColor': 'Color de primer pla', + 'hiliteColor': 'Color de fons', + 'plainFormatBlock': 'Estil de paràgraf', + 'formatBlock': 'Estil de paràgraf', + 'fontSize': 'Cos de la lletra', + 'fontName': 'Nom del tipus de lletra', + 'tabIndent': 'Sagnat', + "fullScreen": "Commuta pantalla completa", + "viewSource": "Visualitza font HTML", + "print": "Imprimeix", + "newPage": "Pàgina nova", + /* Error messages */ + 'systemShortcut': 'L\'acció "${0}" és l\'única disponible al navegador utilitzant una drecera del teclat. Utilitzeu ${1}.', + 'ctrlKey':'control+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/commands.js.uncompressed.js b/lib/dijit/_editor/nls/commands.js.uncompressed.js new file mode 100644 index 000000000..344b5ec23 --- /dev/null +++ b/lib/dijit/_editor/nls/commands.js.uncompressed.js @@ -0,0 +1,85 @@ +define("dijit/_editor/nls/commands", { root: +//begin v1.x content +({ + 'bold': 'Bold', + 'copy': 'Copy', + 'cut': 'Cut', + 'delete': 'Delete', + 'indent': 'Indent', + 'insertHorizontalRule': 'Horizontal Rule', + 'insertOrderedList': 'Numbered List', + 'insertUnorderedList': 'Bullet List', + 'italic': 'Italic', + 'justifyCenter': 'Align Center', + 'justifyFull': 'Justify', + 'justifyLeft': 'Align Left', + 'justifyRight': 'Align Right', + 'outdent': 'Outdent', + 'paste': 'Paste', + 'redo': 'Redo', + 'removeFormat': 'Remove Format', + 'selectAll': 'Select All', + 'strikethrough': 'Strikethrough', + 'subscript': 'Subscript', + 'superscript': 'Superscript', + 'underline': 'Underline', + 'undo': 'Undo', + 'unlink': 'Remove Link', + 'createLink': 'Create Link', + 'toggleDir': 'Toggle Direction', + 'insertImage': 'Insert Image', + 'insertTable': 'Insert/Edit Table', + 'toggleTableBorder': 'Toggle Table Border', + 'deleteTable': 'Delete Table', + 'tableProp': 'Table Property', + 'htmlToggle': 'HTML Source', + 'foreColor': 'Foreground Color', + 'hiliteColor': 'Background Color', + 'plainFormatBlock': 'Paragraph Style', + 'formatBlock': 'Paragraph Style', + 'fontSize': 'Font Size', + 'fontName': 'Font Name', + 'tabIndent': 'Tab Indent', + "fullScreen": "Toggle Full Screen", + "viewSource": "View HTML Source", + "print": "Print", + "newPage": "New Page", + /* Error messages */ + 'systemShortcut': 'The "${0}" action is only available in your browser using a keyboard shortcut. Use ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +//end v1.x content +, +"zh": true, +"zh-tw": true, +"tr": true, +"th": true, +"sv": true, +"sl": true, +"sk": true, +"ru": true, +"ro": true, +"pt": true, +"pt-pt": true, +"pl": true, +"nl": true, +"nb": true, +"ko": true, +"kk": true, +"ja": true, +"it": true, +"hu": true, +"hr": true, +"he": true, +"fr": true, +"fi": true, +"es": true, +"el": true, +"de": true, +"da": true, +"cs": true, +"ca": true, +"az": true, +"ar": true +}); diff --git a/lib/dijit/_editor/nls/cs/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/cs/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..42fbbaee2 --- /dev/null +++ b/lib/dijit/_editor/nls/cs/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/cs/FontChoice", ({ + fontSize: "Velikost", + fontName: "Písmo", + formatBlock: "Formát", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Žádný", + p: "Odstavec", + h1: "Nadpis", + h2: "Podnadpis", + h3: "Podnadpis 2", + pre: "Předformátované", + 1: "extra malé", + 2: "velmi malé", + 3: "malé", + 4: "střední", + 5: "velké", + 6: "velmi velké", + 7: "extra velké" +}) +); diff --git a/lib/dijit/_editor/nls/cs/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/cs/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..d437975be --- /dev/null +++ b/lib/dijit/_editor/nls/cs/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/cs/LinkDialog", ({ + createLinkTitle: "Vlastnosti odkazu", + insertImageTitle: "Vlastnosti obrázku", + url: "Adresa URL:", + text: "Popis:", + target: "Cíl:", + set: "Nastavit", + currentWindow: "Aktuální okno", + parentWindow: "Nadřízené okno", + topWindow: "Okno nejvyšší úrovně", + newWindow: "Nové okno" +}) +); diff --git a/lib/dijit/_editor/nls/cs/commands.js b/lib/dijit/_editor/nls/cs/commands.js index a2927caea..7b26dd96d 100644 --- a/lib/dijit/_editor/nls/cs/commands.js +++ b/lib/dijit/_editor/nls/cs/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/cs/commands",({"bold":"Tučné","copy":"Kopírovat","cut":"Vyjmout","delete":"Odstranit","indent":"Odsadit","insertHorizontalRule":"Vodorovná čára","insertOrderedList":"Číslovaný seznam","insertUnorderedList":"Seznam s odrážkami","italic":"Kurzíva","justifyCenter":"Zarovnat na střed","justifyFull":"Do bloku","justifyLeft":"Zarovnat vlevo","justifyRight":"Zarovnat vpravo","outdent":"Předsadit","paste":"Vložit","redo":"Opakovat","removeFormat":"Odebrat formát","selectAll":"Vybrat vše","strikethrough":"Přeškrtnutí","subscript":"Dolní index","superscript":"Horní index","underline":"Podtržení","undo":"Zpět","unlink":"Odebrat odkaz","createLink":"Vytvořit odkaz","toggleDir":"Přepnout směr","insertImage":"Vložit obrázek","insertTable":"Vložit/upravit tabulku","toggleTableBorder":"Přepnout ohraničení tabulky","deleteTable":"Odstranit tabulku","tableProp":"Vlastnost tabulky","htmlToggle":"Zdroj HTML","foreColor":"Barva popředí","hiliteColor":"Barva pozadí","plainFormatBlock":"Styl odstavce","formatBlock":"Styl odstavce","fontSize":"Velikost písma","fontName":"Název písma","tabIndent":"Odsazení tabulátoru","fullScreen":"Přepnout celou obrazovku","viewSource":"Zobrazit zdroj HTML","print":"Tisk","newPage":"Nová stránka","systemShortcut":"Akce \"${0}\" je v prohlížeči dostupná pouze prostřednictvím klávesové zkratky. Použijte klávesovou zkratku ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/cs/commands",({"bold":"Tučné","copy":"Kopírovat","cut":"Vyjmout","delete":"Odstranit","indent":"Odsadit","insertHorizontalRule":"Vodorovná čára","insertOrderedList":"Číslovaný seznam","insertUnorderedList":"Seznam s odrážkami","italic":"Kurzíva","justifyCenter":"Zarovnat na střed","justifyFull":"Do bloku","justifyLeft":"Zarovnat vlevo","justifyRight":"Zarovnat vpravo","outdent":"Předsadit","paste":"Vložit","redo":"Opakovat","removeFormat":"Odebrat formát","selectAll":"Vybrat vše","strikethrough":"Přeškrtnutí","subscript":"Dolní index","superscript":"Horní index","underline":"Podtržení","undo":"Zpět","unlink":"Odebrat odkaz","createLink":"Vytvořit odkaz","toggleDir":"Přepnout směr","insertImage":"Vložit obrázek","insertTable":"Vložit/upravit tabulku","toggleTableBorder":"Přepnout ohraničení tabulky","deleteTable":"Odstranit tabulku","tableProp":"Vlastnost tabulky","htmlToggle":"Zdroj HTML","foreColor":"Barva popředí","hiliteColor":"Barva pozadí","plainFormatBlock":"Styl odstavce","formatBlock":"Styl odstavce","fontSize":"Velikost písma","fontName":"Název písma","tabIndent":"Odsazení tabulátoru","fullScreen":"Přepnout celou obrazovku","viewSource":"Zobrazit zdroj HTML","print":"Tisk","newPage":"Nová stránka","systemShortcut":"Akce \"${0}\" je v prohlížeči dostupná pouze prostřednictvím klávesové zkratky. Použijte klávesovou zkratku ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/cs/commands.js.uncompressed.js b/lib/dijit/_editor/nls/cs/commands.js.uncompressed.js new file mode 100644 index 000000000..d69aca728 --- /dev/null +++ b/lib/dijit/_editor/nls/cs/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/cs/commands", ({ + 'bold': 'Tučné', + 'copy': 'Kopírovat', + 'cut': 'Vyjmout', + 'delete': 'Odstranit', + 'indent': 'Odsadit', + 'insertHorizontalRule': 'Vodorovná čára', + 'insertOrderedList': 'Číslovaný seznam', + 'insertUnorderedList': 'Seznam s odrážkami', + 'italic': 'Kurzíva', + 'justifyCenter': 'Zarovnat na střed', + 'justifyFull': 'Do bloku', + 'justifyLeft': 'Zarovnat vlevo', + 'justifyRight': 'Zarovnat vpravo', + 'outdent': 'Předsadit', + 'paste': 'Vložit', + 'redo': 'Opakovat', + 'removeFormat': 'Odebrat formát', + 'selectAll': 'Vybrat vše', + 'strikethrough': 'Přeškrtnutí', + 'subscript': 'Dolní index', + 'superscript': 'Horní index', + 'underline': 'Podtržení', + 'undo': 'Zpět', + 'unlink': 'Odebrat odkaz', + 'createLink': 'Vytvořit odkaz', + 'toggleDir': 'Přepnout směr', + 'insertImage': 'Vložit obrázek', + 'insertTable': 'Vložit/upravit tabulku', + 'toggleTableBorder': 'Přepnout ohraničení tabulky', + 'deleteTable': 'Odstranit tabulku', + 'tableProp': 'Vlastnost tabulky', + 'htmlToggle': 'Zdroj HTML', + 'foreColor': 'Barva popředí', + 'hiliteColor': 'Barva pozadí', + 'plainFormatBlock': 'Styl odstavce', + 'formatBlock': 'Styl odstavce', + 'fontSize': 'Velikost písma', + 'fontName': 'Název písma', + 'tabIndent': 'Odsazení tabulátoru', + "fullScreen": "Přepnout celou obrazovku", + "viewSource": "Zobrazit zdroj HTML", + "print": "Tisk", + "newPage": "Nová stránka", + /* Error messages */ + 'systemShortcut': 'Akce "${0}" je v prohlížeči dostupná pouze prostřednictvím klávesové zkratky. Použijte klávesovou zkratku ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/da/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/da/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..a5f959b0b --- /dev/null +++ b/lib/dijit/_editor/nls/da/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/da/FontChoice", ({ + fontSize: "Størrelse", + fontName: "Skrifttype", + formatBlock: "Format", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "kursiv", + fantasy: "fantasy", + noFormat: "Ingen", + p: "Afsnit", + h1: "Overskrift", + h2: "Underoverskrift", + h3: "Underunderoverskrift", + pre: "Forudformateret", + 1: "xx-small", + 2: "x-small", + 3: "small", + 4: "medium", + 5: "large", + 6: "x-large", + 7: "xx-large" +}) +); diff --git a/lib/dijit/_editor/nls/da/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/da/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..1712160e4 --- /dev/null +++ b/lib/dijit/_editor/nls/da/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/da/LinkDialog", ({ + createLinkTitle: "Linkegenskaber", + insertImageTitle: "Billedegenskaber", + url: "URL:", + text: "Beskrivelse:", + target: "Mål:", + set: "Definér", + currentWindow: "Aktuelt vindue", + parentWindow: "Overordnet vindue", + topWindow: "Øverste vindue", + newWindow: "Nyt vindue" +}) +); diff --git a/lib/dijit/_editor/nls/da/commands.js b/lib/dijit/_editor/nls/da/commands.js index a7b86591b..d193a9715 100644 --- a/lib/dijit/_editor/nls/da/commands.js +++ b/lib/dijit/_editor/nls/da/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/da/commands",({"bold":"Fed","copy":"Kopiér","cut":"Klip","delete":"Slet","indent":"Indrykning","insertHorizontalRule":"Vandret linje","insertOrderedList":"Nummereret liste","insertUnorderedList":"Punktliste","italic":"Kursiv","justifyCenter":"Centreret","justifyFull":"Lige margener","justifyLeft":"Venstrejusteret","justifyRight":"Højrejusteret","outdent":"Udrykning","paste":"Sæt ind","redo":"Annullér Fortryd","removeFormat":"Fjern format","selectAll":"Markér alle","strikethrough":"Gennemstreget","subscript":"Sænket skrift","superscript":"Hævet skrift","underline":"Understreget","undo":"Fortryd","unlink":"Fjern link","createLink":"Opret link","toggleDir":"Skift retning","insertImage":"Indsæt billede","insertTable":"Indsæt/redigér tabel","toggleTableBorder":"Skift tabelramme","deleteTable":"Slet tabel","tableProp":"Tabelegenskab","htmlToggle":"HTML-kilde","foreColor":"Forgrundsfarve","hiliteColor":"Baggrundsfarve","plainFormatBlock":"Afsnitstypografi","formatBlock":"Afsnitstypografi","fontSize":"Skriftstørrelse","fontName":"Skriftnavn","tabIndent":"Indrykning med tabulator","fullScreen":"Aktivér/deaktivér fuldskærm","viewSource":"Vis HTML-kilde","print":"Udskriv","newPage":"Ny side","systemShortcut":"Funktionen \"${0}\" kan kun bruges i din browser med en tastaturgenvej. Brug ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/da/commands",({"bold":"Fed","copy":"Kopiér","cut":"Klip","delete":"Slet","indent":"Indrykning","insertHorizontalRule":"Vandret linje","insertOrderedList":"Nummereret liste","insertUnorderedList":"Punktliste","italic":"Kursiv","justifyCenter":"Centreret","justifyFull":"Lige margener","justifyLeft":"Venstrejusteret","justifyRight":"Højrejusteret","outdent":"Udrykning","paste":"Sæt ind","redo":"Annullér Fortryd","removeFormat":"Fjern format","selectAll":"Markér alle","strikethrough":"Gennemstreget","subscript":"Sænket skrift","superscript":"Hævet skrift","underline":"Understreget","undo":"Fortryd","unlink":"Fjern link","createLink":"Opret link","toggleDir":"Skift retning","insertImage":"Indsæt billede","insertTable":"Indsæt/redigér tabel","toggleTableBorder":"Skift tabelramme","deleteTable":"Slet tabel","tableProp":"Tabelegenskab","htmlToggle":"HTML-kilde","foreColor":"Forgrundsfarve","hiliteColor":"Baggrundsfarve","plainFormatBlock":"Afsnitstypografi","formatBlock":"Afsnitstypografi","fontSize":"Skriftstørrelse","fontName":"Skriftnavn","tabIndent":"Tabulatorindrykning","fullScreen":"Fuld skærm til/fra","viewSource":"Vis HTML-kilde","print":"Udskriv","newPage":"Ny side","systemShortcut":"Funktionen \"${0}\" kan kun bruges i din browser med en tastaturgenvej. Brug ${1}.","ctrlKey":"Ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/da/commands.js.uncompressed.js b/lib/dijit/_editor/nls/da/commands.js.uncompressed.js new file mode 100644 index 000000000..25987432c --- /dev/null +++ b/lib/dijit/_editor/nls/da/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/da/commands", ({ + 'bold': 'Fed', + 'copy': 'Kopiér', + 'cut': 'Klip', + 'delete': 'Slet', + 'indent': 'Indrykning', + 'insertHorizontalRule': 'Vandret linje', + 'insertOrderedList': 'Nummereret liste', + 'insertUnorderedList': 'Punktliste', + 'italic': 'Kursiv', + 'justifyCenter': 'Centreret', + 'justifyFull': 'Lige margener', + 'justifyLeft': 'Venstrejusteret', + 'justifyRight': 'Højrejusteret', + 'outdent': 'Udrykning', + 'paste': 'Sæt ind', + 'redo': 'Annullér Fortryd', + 'removeFormat': 'Fjern format', + 'selectAll': 'Markér alle', + 'strikethrough': 'Gennemstreget', + 'subscript': 'Sænket skrift', + 'superscript': 'Hævet skrift', + 'underline': 'Understreget', + 'undo': 'Fortryd', + 'unlink': 'Fjern link', + 'createLink': 'Opret link', + 'toggleDir': 'Skift retning', + 'insertImage': 'Indsæt billede', + 'insertTable': 'Indsæt/redigér tabel', + 'toggleTableBorder': 'Skift tabelramme', + 'deleteTable': 'Slet tabel', + 'tableProp': 'Tabelegenskab', + 'htmlToggle': 'HTML-kilde', + 'foreColor': 'Forgrundsfarve', + 'hiliteColor': 'Baggrundsfarve', + 'plainFormatBlock': 'Afsnitstypografi', + 'formatBlock': 'Afsnitstypografi', + 'fontSize': 'Skriftstørrelse', + 'fontName': 'Skriftnavn', + 'tabIndent': 'Tabulatorindrykning', + "fullScreen": "Fuld skærm til/fra", + "viewSource": "Vis HTML-kilde", + "print": "Udskriv", + "newPage": "Ny side", + /* Error messages */ + 'systemShortcut': 'Funktionen "${0}" kan kun bruges i din browser med en tastaturgenvej. Brug ${1}.', + 'ctrlKey':'Ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/de/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/de/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..ea54a023c --- /dev/null +++ b/lib/dijit/_editor/nls/de/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/de/FontChoice", ({ + fontSize: "Größe", + fontName: "Schriftart", + formatBlock: "Format", + serif: "Serife", + "sans-serif": "Serifenlos", + monospace: "Monospaceschrift", + cursive: "Kursiv", + fantasy: "Fantasie", + noFormat: "Keine Angabe", + p: "Absatz", + h1: "Überschrift", + h2: "Unterüberschrift", + h3: "Unterunterüberschrift", + pre: "Vorformatiert", + 1: "XXS", + 2: "XS", + 3: "S", + 4: "M", + 5: "L", + 6: "XL", + 7: "XXL" +}) +); diff --git a/lib/dijit/_editor/nls/de/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/de/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..ca28bfd2b --- /dev/null +++ b/lib/dijit/_editor/nls/de/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/de/LinkDialog", ({ + createLinkTitle: "Linkeigenschaften", + insertImageTitle: "Grafikeigenschaften", + url: "URL:", + text: "Beschreibung:", + target: "Ziel:", + set: "Festlegen", + currentWindow: "Aktuelles Fenster", + parentWindow: "Übergeordnetes Fenster", + topWindow: "Aktives Fenster", + newWindow: "Neues Fenster" +}) +); diff --git a/lib/dijit/_editor/nls/de/commands.js b/lib/dijit/_editor/nls/de/commands.js index aff458b1c..e4eff7c66 100644 --- a/lib/dijit/_editor/nls/de/commands.js +++ b/lib/dijit/_editor/nls/de/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/de/commands",({"bold":"Fett","copy":"Kopieren","cut":"Ausschneiden","delete":"Löschen","indent":"Einrücken","insertHorizontalRule":"Horizontaler Strich","insertOrderedList":"Nummerierung","insertUnorderedList":"Aufzählungszeichen","italic":"Kursiv","justifyCenter":"Zentriert","justifyFull":"Blocksatz","justifyLeft":"Linksbündig","justifyRight":"Rechtsbündig","outdent":"Ausrücken","paste":"Einfügen","redo":"Wiederherstellen","removeFormat":"Formatierung entfernen","selectAll":"Alles auswählen","strikethrough":"Durchgestrichen","subscript":"Tiefgestellt","superscript":"Hochgestellt","underline":"Unterstrichen","undo":"Rückgängig","unlink":"Link entfernen","createLink":"Link erstellen","toggleDir":"Wechselrichtung","insertImage":"Grafik einfügen","insertTable":"Tabelle einfügen/bearbeiten","toggleTableBorder":"Tabellenumrandung ein-/ausschalten","deleteTable":"Tabelle löschen","tableProp":"Tabelleneigenschaft","htmlToggle":"HTML-Quelltext","foreColor":"Vordergrundfarbe","hiliteColor":"Hintergrundfarbe","plainFormatBlock":"Absatzstil","formatBlock":"Absatzstil","fontSize":"Schriftgröße","fontName":"Schriftartname","tabIndent":"Tabulatoreinrückung","fullScreen":"Gesamtanzeige","viewSource":"HTML-Quelle","print":"Drucken","newPage":"Neue Seite","systemShortcut":"Die Aktion \"${0}\" ist nur über einen Direktaufruf in Ihrem Browser verfügbar. Verwenden Sie ${1}.","ctrlKey":"Strg+${0}"}));
\ No newline at end of file +define("dijit/_editor/nls/de/commands",({"bold":"Fett","copy":"Kopieren","cut":"Ausschneiden","delete":"Löschen","indent":"Einrücken","insertHorizontalRule":"Horizontaler Strich","insertOrderedList":"Nummerierung","insertUnorderedList":"Aufzählungszeichen","italic":"Kursiv","justifyCenter":"Zentriert","justifyFull":"Blocksatz","justifyLeft":"Linksbündig","justifyRight":"Rechtsbündig","outdent":"Ausrücken","paste":"Einfügen","redo":"Wiederholen","removeFormat":"Formatierung entfernen","selectAll":"Alles auswählen","strikethrough":"Durchgestrichen","subscript":"Tiefgestellt","superscript":"Hochgestellt","underline":"Unterstrichen","undo":"Rückgängig","unlink":"Link entfernen","createLink":"Link erstellen","toggleDir":"Richtung wechseln","insertImage":"Grafik einfügen","insertTable":"Tabelle einfügen/bearbeiten","toggleTableBorder":"Tabellenumrandung ein-/ausschalten","deleteTable":"Tabelle löschen","tableProp":"Tabelleneigenschaft","htmlToggle":"HTML-Quelltext","foreColor":"Vordergrundfarbe","hiliteColor":"Hintergrundfarbe","plainFormatBlock":"Absatzstil","formatBlock":"Absatzstil","fontSize":"Schriftgröße","fontName":"Schriftartname","tabIndent":"Registerkarteneinrückung","fullScreen":"Gesamtanzeige","viewSource":"HTML-Quelle","print":"Drucken","newPage":"Neue Seite","systemShortcut":"Die Aktion \"${0}\" ist im Browser nur über einen Tastaturkurzbefehl verfügbar. Verwenden Sie ${1}.","ctrlKey":"Strg+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/de/commands.js.uncompressed.js b/lib/dijit/_editor/nls/de/commands.js.uncompressed.js new file mode 100644 index 000000000..20917fe44 --- /dev/null +++ b/lib/dijit/_editor/nls/de/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/de/commands", ({ + 'bold': 'Fett', + 'copy': 'Kopieren', + 'cut': 'Ausschneiden', + 'delete': 'Löschen', + 'indent': 'Einrücken', + 'insertHorizontalRule': 'Horizontaler Strich', + 'insertOrderedList': 'Nummerierung', + 'insertUnorderedList': 'Aufzählungszeichen', + 'italic': 'Kursiv', + 'justifyCenter': 'Zentriert', + 'justifyFull': 'Blocksatz', + 'justifyLeft': 'Linksbündig', + 'justifyRight': 'Rechtsbündig', + 'outdent': 'Ausrücken', + 'paste': 'Einfügen', + 'redo': 'Wiederholen', + 'removeFormat': 'Formatierung entfernen', + 'selectAll': 'Alles auswählen', + 'strikethrough': 'Durchgestrichen', + 'subscript': 'Tiefgestellt', + 'superscript': 'Hochgestellt', + 'underline': 'Unterstrichen', + 'undo': 'Rückgängig', + 'unlink': 'Link entfernen', + 'createLink': 'Link erstellen', + 'toggleDir': 'Richtung wechseln', + 'insertImage': 'Grafik einfügen', + 'insertTable': 'Tabelle einfügen/bearbeiten', + 'toggleTableBorder': 'Tabellenumrandung ein-/ausschalten', + 'deleteTable': 'Tabelle löschen', + 'tableProp': 'Tabelleneigenschaft', + 'htmlToggle': 'HTML-Quelltext', + 'foreColor': 'Vordergrundfarbe', + 'hiliteColor': 'Hintergrundfarbe', + 'plainFormatBlock': 'Absatzstil', + 'formatBlock': 'Absatzstil', + 'fontSize': 'Schriftgröße', + 'fontName': 'Schriftartname', + 'tabIndent': 'Registerkarteneinrückung', + "fullScreen": "Gesamtanzeige", + "viewSource": "HTML-Quelle", + "print": "Drucken", + "newPage": "Neue Seite", + /* Error messages */ + 'systemShortcut': 'Die Aktion "${0}" ist im Browser nur über einen Tastaturkurzbefehl verfügbar. Verwenden Sie ${1}.', + 'ctrlKey':'Strg+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/el/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/el/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..8c315b872 --- /dev/null +++ b/lib/dijit/_editor/nls/el/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/el/FontChoice", ({ + fontSize: "Μέγεθος", + fontName: "Γραμματοσειρά", + formatBlock: "Μορφή", + serif: "με πατούρες (serif)", + "sans-serif": "χωρίς πατούρες (sans-serif)", + monospace: "σταθερού πλάτους", + cursive: "πλάγιοι", + fantasy: "φαντασίας", + noFormat: "Χωρίς", + p: "Παράγραφος", + h1: "Επικεφαλίδα", + h2: "Δευτερεύουσα επικεφαλίδα", + h3: "Δευτερεύουσα επικεφαλίδα τρίτου επιπέδου", + pre: "Προ-μορφοποιημένο", + 1: "xx-μικρά", + 2: "x-μικρά", + 3: "μικρά", + 4: "μεσαία", + 5: "μεγάλα", + 6: "x-μεγάλα", + 7: "xx-μεγάλα" +}) +); diff --git a/lib/dijit/_editor/nls/el/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/el/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..69011f49a --- /dev/null +++ b/lib/dijit/_editor/nls/el/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/el/LinkDialog", ({ + createLinkTitle: "Ιδιότητες σύνδεσης", + insertImageTitle: "Ιδιότητες εικόνας", + url: "Διεύθυνση URL:", + text: "Περιγραφή:", + target: "Προορισμός:", + set: "Ορισμός", + currentWindow: "Τρέχον παράθυρο", + parentWindow: "Γονικό παράθυρο", + topWindow: "Παράθυρο σε πρώτο πλάνο", + newWindow: "Νέο παράθυρο" +}) +); diff --git a/lib/dijit/_editor/nls/el/commands.js b/lib/dijit/_editor/nls/el/commands.js index ea5403357..51ffaa440 100644 --- a/lib/dijit/_editor/nls/el/commands.js +++ b/lib/dijit/_editor/nls/el/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/el/commands",({"bold":"Έντονα","copy":"Αντιγραφή","cut":"Αποκοπή","delete":"Διαγραφή","indent":"Εσοχή","insertHorizontalRule":"Οριζόντια γραμμή","insertOrderedList":"Αριθμημένη λίστα","insertUnorderedList":"Λίστα με κουκίδες","italic":"Πλάγια","justifyCenter":"Στοίχιση στο κέντρο","justifyFull":"Πλήρης στοίχιση","justifyLeft":"Στοίχιση αριστερά","justifyRight":"Στοίχιση δεξιά","outdent":"Μείωση περιθωρίου","paste":"Επικόλληση","redo":"Ακύρωση αναίρεσης","removeFormat":"Αφαίρεση μορφοποίησης","selectAll":"Επιλογή όλων","strikethrough":"Διαγράμμιση","subscript":"Δείκτης","superscript":"Εκθέτης","underline":"Υπογράμμιση","undo":"Αναίρεση","unlink":"Αφαίρεση σύνδεσης","createLink":"Δημιουργία σύνδεσης","toggleDir":"Εναλλαγή κατεύθυνσης","insertImage":"Εισαγωγή εικόνας","insertTable":"Εισαγωγή/Τροποποίηση πίνακα","toggleTableBorder":"Εναλλαγή εμφάνισης περιγράμματος πίνακα","deleteTable":"Διαγραφή πίνακα","tableProp":"Ιδιότητα πίνακα","htmlToggle":"Πρωτογενής κώδικας HTML","foreColor":"Χρώμα προσκηνίου","hiliteColor":"Χρώμα φόντου","plainFormatBlock":"Στυλ παραγράφου","formatBlock":"Στυλ παραγράφου","fontSize":"Μέγεθος γραμματοσειράς","fontName":"Όνομα γραμματοσειράς","tabIndent":"Εσοχή με το πλήκτρο Tab","fullScreen":"Εναλλαγή κατάστασης πλήρους οθόνης","viewSource":"Προβολή προέλευσης HTML","print":"Εκτύπωση","newPage":"Νέα σελίδα","systemShortcut":"Σε αυτό το πρόγραμμα πλοήγησης, η ενέργεια \"${0}\" είναι διαθέσιμη μόνο με τη χρήση μιας συντόμευσης πληκτρολογίου. Χρησιμοποιήστε τη συντόμευση ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/el/commands",({"bold":"Έντονα","copy":"Αντιγραφή","cut":"Αποκοπή","delete":"Διαγραφή","indent":"Εσοχή","insertHorizontalRule":"Οριζόντια γραμμή","insertOrderedList":"Αριθμημένη λίστα","insertUnorderedList":"Λίστα με κουκίδες","italic":"Πλάγια","justifyCenter":"Στοίχιση στο κέντρο","justifyFull":"Πλήρης στοίχιση","justifyLeft":"Στοίχιση αριστερά","justifyRight":"Στοίχιση δεξιά","outdent":"Μείωση περιθωρίου","paste":"Επικόλληση","redo":"Ακύρωση αναίρεσης","removeFormat":"Αφαίρεση μορφοποίησης","selectAll":"Επιλογή όλων","strikethrough":"Διαγράμμιση","subscript":"Δείκτης","superscript":"Εκθέτης","underline":"Υπογράμμιση","undo":"Αναίρεση","unlink":"Αφαίρεση σύνδεσης","createLink":"Δημιουργία σύνδεσης","toggleDir":"Εναλλαγή κατεύθυνσης","insertImage":"Εισαγωγή εικόνας","insertTable":"Εισαγωγή/Τροποποίηση πίνακα","toggleTableBorder":"Εναλλαγή εμφάνισης περιγράμματος πίνακα","deleteTable":"Διαγραφή πίνακα","tableProp":"Ιδιότητα πίνακα","htmlToggle":"Πρωτογενής κώδικας HTML","foreColor":"Χρώμα προσκηνίου","hiliteColor":"Χρώμα φόντου","plainFormatBlock":"Στυλ παραγράφου","formatBlock":"Στυλ παραγράφου","fontSize":"Μέγεθος γραμματοσειράς","fontName":"Όνομα γραμματοσειράς","tabIndent":"Εσοχή με το πλήκτρο Tab","fullScreen":"Εναλλαγή κατάστασης πλήρους οθόνης","viewSource":"Προβολή προέλευσης HTML","print":"Εκτύπωση","newPage":"Νέα σελίδα","systemShortcut":"Σε αυτό το πρόγραμμα πλοήγησης, η ενέργεια \"${0}\" είναι διαθέσιμη μόνο με τη χρήση μιας συντόμευσης πληκτρολογίου. Χρησιμοποιήστε τη συντόμευση ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/el/commands.js.uncompressed.js b/lib/dijit/_editor/nls/el/commands.js.uncompressed.js new file mode 100644 index 000000000..bb12160be --- /dev/null +++ b/lib/dijit/_editor/nls/el/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/el/commands", ({ + 'bold': 'Έντονα', + 'copy': 'Αντιγραφή', + 'cut': 'Αποκοπή', + 'delete': 'Διαγραφή', + 'indent': 'Εσοχή', + 'insertHorizontalRule': 'Οριζόντια γραμμή', + 'insertOrderedList': 'Αριθμημένη λίστα', + 'insertUnorderedList': 'Λίστα με κουκίδες', + 'italic': 'Πλάγια', + 'justifyCenter': 'Στοίχιση στο κέντρο', + 'justifyFull': 'Πλήρης στοίχιση', + 'justifyLeft': 'Στοίχιση αριστερά', + 'justifyRight': 'Στοίχιση δεξιά', + 'outdent': 'Μείωση περιθωρίου', + 'paste': 'Επικόλληση', + 'redo': 'Ακύρωση αναίρεσης', + 'removeFormat': 'Αφαίρεση μορφοποίησης', + 'selectAll': 'Επιλογή όλων', + 'strikethrough': 'Διαγράμμιση', + 'subscript': 'Δείκτης', + 'superscript': 'Εκθέτης', + 'underline': 'Υπογράμμιση', + 'undo': 'Αναίρεση', + 'unlink': 'Αφαίρεση σύνδεσης', + 'createLink': 'Δημιουργία σύνδεσης', + 'toggleDir': 'Εναλλαγή κατεύθυνσης', + 'insertImage': 'Εισαγωγή εικόνας', + 'insertTable': 'Εισαγωγή/Τροποποίηση πίνακα', + 'toggleTableBorder': 'Εναλλαγή εμφάνισης περιγράμματος πίνακα', + 'deleteTable': 'Διαγραφή πίνακα', + 'tableProp': 'Ιδιότητα πίνακα', + 'htmlToggle': 'Πρωτογενής κώδικας HTML', + 'foreColor': 'Χρώμα προσκηνίου', + 'hiliteColor': 'Χρώμα φόντου', + 'plainFormatBlock': 'Στυλ παραγράφου', + 'formatBlock': 'Στυλ παραγράφου', + 'fontSize': 'Μέγεθος γραμματοσειράς', + 'fontName': 'Όνομα γραμματοσειράς', + 'tabIndent': 'Εσοχή με το πλήκτρο Tab', + "fullScreen": "Εναλλαγή κατάστασης πλήρους οθόνης", + "viewSource": "Προβολή προέλευσης HTML", + "print": "Εκτύπωση", + "newPage": "Νέα σελίδα", + /* Error messages */ + 'systemShortcut': 'Σε αυτό το πρόγραμμα πλοήγησης, η ενέργεια "${0}" είναι διαθέσιμη μόνο με τη χρήση μιας συντόμευσης πληκτρολογίου. Χρησιμοποιήστε τη συντόμευση ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/es/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/es/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..ed8e6ff23 --- /dev/null +++ b/lib/dijit/_editor/nls/es/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/es/FontChoice", ({ + fontSize: "Tamaño", + fontName: "Font", + formatBlock: "Formato", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "espacio sencillo", + cursive: "cursiva", + fantasy: "fantasía", + noFormat: "Ninguno", + p: "Párrafo", + h1: "Cabecera", + h2: "Subcabecera", + h3: "Sub-subcabecera", + pre: "Preformateado", + 1: "xx-pequeño", + 2: "x-pequeño", + 3: "pequeño", + 4: "medio", + 5: "grande", + 6: "x-grande", + 7: "xx-grande" +}) +); diff --git a/lib/dijit/_editor/nls/es/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/es/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..de34f6770 --- /dev/null +++ b/lib/dijit/_editor/nls/es/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/es/LinkDialog", ({ + createLinkTitle: "Propiedades del enlace", + insertImageTitle: "Propiedades de la imagen", + url: "URL:", + text: "Descripción:", + target: "Destino:", + set: "Establecer", + currentWindow: "Ventana actual", + parentWindow: "Ventana padre", + topWindow: "Ventana superior", + newWindow: "Nueva ventana" +}) +); diff --git a/lib/dijit/_editor/nls/es/commands.js b/lib/dijit/_editor/nls/es/commands.js index eae7c635d..b01975fd3 100644 --- a/lib/dijit/_editor/nls/es/commands.js +++ b/lib/dijit/_editor/nls/es/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/es/commands",({"bold":"Negrita","copy":"Copiar","cut":"Cortar","delete":"Suprimir","indent":"Sangría","insertHorizontalRule":"Regla horizontal","insertOrderedList":"Lista numerada","insertUnorderedList":"Lista con viñetas","italic":"Cursiva","justifyCenter":"Alinear centro","justifyFull":"Justificar","justifyLeft":"Alinear izquierda","justifyRight":"Alinear derecha","outdent":"Anular sangría","paste":"Pegar","redo":"Rehacer","removeFormat":"Eliminar formato","selectAll":"Seleccionar todo","strikethrough":"Tachado","subscript":"Subíndice","superscript":"Superíndice","underline":"Subrayado","undo":"Deshacer","unlink":"Eliminar enlace","createLink":"Crear enlace","toggleDir":"Conmutar dirección","insertImage":"Insertar imagen","insertTable":"Insertar/Editar tabla","toggleTableBorder":"Conmutar borde de tabla","deleteTable":"Suprimir tabla","tableProp":"Propiedad de tabla","htmlToggle":"Fuente HTML","foreColor":"Color de primer plano","hiliteColor":"Color de segundo plano","plainFormatBlock":"Estilo de párrafo","formatBlock":"Estilo de párrafo","fontSize":"Tamaño de font","fontName":"Nombre de font","tabIndent":"Sangría de tabulador","fullScreen":"Conmutar pantalla completa","viewSource":"Ver fuente HTML","print":"Imprimir","newPage":"Nueva página","systemShortcut":"La acción \"${0}\" sólo está disponible en su navegador mediante un atajo de teclado. Utilice ${1}.","ctrlKey":"control+${0}"}));
\ No newline at end of file +define("dijit/_editor/nls/es/commands",({"bold":"Negrita","copy":"Copiar","cut":"Cortar","delete":"Suprimir","indent":"Sangría","insertHorizontalRule":"Regla horizontal","insertOrderedList":"Lista numerada","insertUnorderedList":"Lista con viñetas","italic":"Cursiva","justifyCenter":"Alinear centro","justifyFull":"Justificar","justifyLeft":"Alinear izquierda","justifyRight":"Alinear derecha","outdent":"Anular sangría","paste":"Pegar","redo":"Rehacer","removeFormat":"Eliminar formato","selectAll":"Seleccionar todo","strikethrough":"Tachado","subscript":"Subíndice","superscript":"Superíndice","underline":"Subrayado","undo":"Deshacer","unlink":"Eliminar enlace","createLink":"Crear enlace","toggleDir":"Conmutar dirección","insertImage":"Insertar imagen","insertTable":"Insertar/Editar tabla","toggleTableBorder":"Conmutar borde de tabla","deleteTable":"Suprimir tabla","tableProp":"Propiedad de tabla","htmlToggle":"Fuente HTML","foreColor":"Color de primer plano","hiliteColor":"Color de segundo plano","plainFormatBlock":"Estilo de párrafo","formatBlock":"Estilo de párrafo","fontSize":"Tamaño de font","fontName":"Nombre de font","tabIndent":"Sangría de tabulador","fullScreen":"Conmutar pantalla completa","viewSource":"Ver fuente HTML","print":"Imprimir","newPage":"Nueva página","systemShortcut":"La acción \"${0}\" sólo está disponible en su navegador mediante un atajo de teclado. Utilice ${1}.","ctrlKey":"control+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/es/commands.js.uncompressed.js b/lib/dijit/_editor/nls/es/commands.js.uncompressed.js new file mode 100644 index 000000000..72e1b322a --- /dev/null +++ b/lib/dijit/_editor/nls/es/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/es/commands", ({ + 'bold': 'Negrita', + 'copy': 'Copiar', + 'cut': 'Cortar', + 'delete': 'Suprimir', + 'indent': 'Sangría', + 'insertHorizontalRule': 'Regla horizontal', + 'insertOrderedList': 'Lista numerada', + 'insertUnorderedList': 'Lista con viñetas', + 'italic': 'Cursiva', + 'justifyCenter': 'Alinear centro', + 'justifyFull': 'Justificar', + 'justifyLeft': 'Alinear izquierda', + 'justifyRight': 'Alinear derecha', + 'outdent': 'Anular sangría', + 'paste': 'Pegar', + 'redo': 'Rehacer', + 'removeFormat': 'Eliminar formato', + 'selectAll': 'Seleccionar todo', + 'strikethrough': 'Tachado', + 'subscript': 'Subíndice', + 'superscript': 'Superíndice', + 'underline': 'Subrayado', + 'undo': 'Deshacer', + 'unlink': 'Eliminar enlace', + 'createLink': 'Crear enlace', + 'toggleDir': 'Conmutar dirección', + 'insertImage': 'Insertar imagen', + 'insertTable': 'Insertar/Editar tabla', + 'toggleTableBorder': 'Conmutar borde de tabla', + 'deleteTable': 'Suprimir tabla', + 'tableProp': 'Propiedad de tabla', + 'htmlToggle': 'Fuente HTML', + 'foreColor': 'Color de primer plano', + 'hiliteColor': 'Color de segundo plano', + 'plainFormatBlock': 'Estilo de párrafo', + 'formatBlock': 'Estilo de párrafo', + 'fontSize': 'Tamaño de font', + 'fontName': 'Nombre de font', + 'tabIndent': 'Sangría de tabulador', + "fullScreen": "Conmutar pantalla completa", + "viewSource": "Ver fuente HTML", + "print": "Imprimir", + "newPage": "Nueva página", + /* Error messages */ + 'systemShortcut': 'La acción "${0}" sólo está disponible en su navegador mediante un atajo de teclado. Utilice ${1}.', + 'ctrlKey':'control+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/fi/FontChoice.js b/lib/dijit/_editor/nls/fi/FontChoice.js index c2c1e7cd3..700b9e8a9 100644 --- a/lib/dijit/_editor/nls/fi/FontChoice.js +++ b/lib/dijit/_editor/nls/fi/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/fi/FontChoice",({fontSize:"Koko",fontName:"Fontti",formatBlock:"Muoto",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"Ei mitään",p:"Kappale",h1:"Otsikko",h2:"Alatason otsikko",h3:"Alimman tason otsikko",pre:"Esimuotoiltu",1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large",7:"xx-large"}));
\ No newline at end of file +define("dijit/_editor/nls/fi/FontChoice",({fontSize:"Koko",fontName:"Fontti",formatBlock:"Muotoile",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"Ei mitään",p:"Kappale",h1:"Otsikko",h2:"Alatason otsikko",h3:"Alimman tason otsikko",pre:"Esimuotoiltu",1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large",7:"xx-large"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/fi/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/fi/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..30fa99971 --- /dev/null +++ b/lib/dijit/_editor/nls/fi/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/fi/FontChoice", ({ + fontSize: "Koko", + fontName: "Fontti", + formatBlock: "Muotoile", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Ei mitään", + p: "Kappale", + h1: "Otsikko", + h2: "Alatason otsikko", + h3: "Alimman tason otsikko", + pre: "Esimuotoiltu", + 1: "xx-small", + 2: "x-small", + 3: "small", + 4: "medium", + 5: "large", + 6: "x-large", + 7: "xx-large" +}) +); diff --git a/lib/dijit/_editor/nls/fi/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/fi/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..ad6cfceca --- /dev/null +++ b/lib/dijit/_editor/nls/fi/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/fi/LinkDialog", ({ + createLinkTitle: "Linkin ominaisuudet", + insertImageTitle: "Kuvan ominaisuudet", + url: "URL-osoite:", + text: "Kuvaus:", + target: "Kohde:", + set: "Aseta", + currentWindow: "Nykyinen ikkuna", + parentWindow: "Pääikkuna", + topWindow: "Päällimmäinen ikkuna", + newWindow: "Uusi ikkuna" +}) +); diff --git a/lib/dijit/_editor/nls/fi/commands.js b/lib/dijit/_editor/nls/fi/commands.js index 88a6f1886..3d77fc787 100644 --- a/lib/dijit/_editor/nls/fi/commands.js +++ b/lib/dijit/_editor/nls/fi/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/fi/commands",({"bold":"Lihavointi","copy":"Kopioi","cut":"Leikkaa","delete":"Poista","indent":"Sisennä","insertHorizontalRule":"Vaakasuuntainen viiva","insertOrderedList":"Numeroitu luettelo","insertUnorderedList":"Numeroimaton luettelo","italic":"Kursivointi","justifyCenter":"Tasaus keskelle","justifyFull":"Tasaus","justifyLeft":"Tasaus vasemmalle","justifyRight":"Tasaus oikealle","outdent":"Ulonna","paste":"Liitä","redo":"Tee uudelleen","removeFormat":"Poista muotoilu","selectAll":"Valitse kaikki","strikethrough":"Yliviivaus","subscript":"Alaindeksi","superscript":"Yläindeksi","underline":"Alleviivaus","undo":"Kumoa","unlink":"Poista linkki","createLink":"Luo linkki","toggleDir":"Vaihda suuntaa","insertImage":"Lisää kuva","insertTable":"Lisää taulukko/muokkaa taulukkoa","toggleTableBorder":"Ota taulukon kehys käyttöön/poista kehys käytöstä","deleteTable":"Poista taulukko","tableProp":"Taulukon ominaisuudet","htmlToggle":"HTML-lähde","foreColor":"Edustaväri","hiliteColor":"Taustaväri","plainFormatBlock":"Kappaletyyli","formatBlock":"Kappaletyyli","fontSize":"Fontin koko","fontName":"Fontin nimi","tabIndent":"Sarkainsisennys","fullScreen":"Vaihda koko näyttö","viewSource":"Näytä HTML-lähde","print":"Tulosta","newPage":"Uusi sivu","systemShortcut":"Toiminto \"${0}\" on käytettävissä selaimessa vain näppäimistön pikatoiminnolla. Käytä seuraavaa: ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/fi/commands",({"bold":"Lihavointi","copy":"Kopioi","cut":"Leikkaa","delete":"Poista","indent":"Sisennä","insertHorizontalRule":"Vaakasuuntainen viiva","insertOrderedList":"Numeroitu luettelo","insertUnorderedList":"Numeroimaton luettelo","italic":"Kursivointi","justifyCenter":"Tasaus keskelle","justifyFull":"Tasaus","justifyLeft":"Tasaus vasemmalle","justifyRight":"Tasaus oikealle","outdent":"Ulonna","paste":"Liitä","redo":"Tee uudelleen","removeFormat":"Poista muotoilu","selectAll":"Valitse kaikki","strikethrough":"Yliviivaus","subscript":"Alennettu","superscript":"Korotettu","underline":"Alleviivaus","undo":"Kumoa","unlink":"Poista linkki","createLink":"Luo linkki","toggleDir":"Vaihda suuntaa","insertImage":"Lisää kuva","insertTable":"Lisää taulukko/muokkaa taulukkoa","toggleTableBorder":"Ota taulukon kehys käyttöön/poista kehys käytöstä","deleteTable":"Poista taulukko","tableProp":"Taulukon ominaisuudet","htmlToggle":"HTML-lähde","foreColor":"Edustaväri","hiliteColor":"Taustaväri","plainFormatBlock":"Kappaletyyli","formatBlock":"Kappaletyyli","fontSize":"Fonttikoko","fontName":"Fontin nimi","tabIndent":"Sarkainsisennys","fullScreen":"Vaihda koko näyttö","viewSource":"Näytä HTML-lähde","print":"Tulosta","newPage":"Uusi sivu","systemShortcut":"Toiminto \"${0}\" on käytettävissä selaimessa vain näppäimistön pikatoiminnolla. Käytä seuraavaa: ${1}.","ctrlKey":"Ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/fi/commands.js.uncompressed.js b/lib/dijit/_editor/nls/fi/commands.js.uncompressed.js new file mode 100644 index 000000000..0eb730864 --- /dev/null +++ b/lib/dijit/_editor/nls/fi/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/fi/commands", ({ + 'bold': 'Lihavointi', + 'copy': 'Kopioi', + 'cut': 'Leikkaa', + 'delete': 'Poista', + 'indent': 'Sisennä', + 'insertHorizontalRule': 'Vaakasuuntainen viiva', + 'insertOrderedList': 'Numeroitu luettelo', + 'insertUnorderedList': 'Numeroimaton luettelo', + 'italic': 'Kursivointi', + 'justifyCenter': 'Tasaus keskelle', + 'justifyFull': 'Tasaus', + 'justifyLeft': 'Tasaus vasemmalle', + 'justifyRight': 'Tasaus oikealle', + 'outdent': 'Ulonna', + 'paste': 'Liitä', + 'redo': 'Tee uudelleen', + 'removeFormat': 'Poista muotoilu', + 'selectAll': 'Valitse kaikki', + 'strikethrough': 'Yliviivaus', + 'subscript': 'Alennettu', + 'superscript': 'Korotettu', + 'underline': 'Alleviivaus', + 'undo': 'Kumoa', + 'unlink': 'Poista linkki', + 'createLink': 'Luo linkki', + 'toggleDir': 'Vaihda suuntaa', + 'insertImage': 'Lisää kuva', + 'insertTable': 'Lisää taulukko/muokkaa taulukkoa', + 'toggleTableBorder': 'Ota taulukon kehys käyttöön/poista kehys käytöstä', + 'deleteTable': 'Poista taulukko', + 'tableProp': 'Taulukon ominaisuudet', + 'htmlToggle': 'HTML-lähde', + 'foreColor': 'Edustaväri', + 'hiliteColor': 'Taustaväri', + 'plainFormatBlock': 'Kappaletyyli', + 'formatBlock': 'Kappaletyyli', + 'fontSize': 'Fonttikoko', + 'fontName': 'Fontin nimi', + 'tabIndent': 'Sarkainsisennys', + "fullScreen": "Vaihda koko näyttö", + "viewSource": "Näytä HTML-lähde", + "print": "Tulosta", + "newPage": "Uusi sivu", + /* Error messages */ + 'systemShortcut': 'Toiminto "${0}" on käytettävissä selaimessa vain näppäimistön pikatoiminnolla. Käytä seuraavaa: ${1}.', + 'ctrlKey':'Ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/fr/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/fr/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..8fba25433 --- /dev/null +++ b/lib/dijit/_editor/nls/fr/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/fr/FontChoice", ({ + fontSize: "Taille", + fontName: "Police", + formatBlock: "Mise en forme", + serif: "serif", + "sans-serif": "sans serif", + monospace: "espacement fixe", + cursive: "cursive", + fantasy: "fantaisie", + noFormat: "Néant", + p: "Paragraphe", + h1: "En-tête", + h2: "Sous-en-tête", + h3: "Sous-sous-en-tête", + pre: "Pré-mise en forme", + 1: "très très petite", + 2: "très petite", + 3: "petite", + 4: "moyenne", + 5: "grande", + 6: "très grande", + 7: "très très grande" +}) +); diff --git a/lib/dijit/_editor/nls/fr/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/fr/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..46ee185ad --- /dev/null +++ b/lib/dijit/_editor/nls/fr/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/fr/LinkDialog", ({ + createLinkTitle: "Propriétés du lien", + insertImageTitle: "Propriétés de l'image", + url: "URL :", + text: "Description :", + target: "Cible :", + set: "Définir", + currentWindow: "Fenêtre actuelle", + parentWindow: "Fenêtre parent", + topWindow: "Fenêtre supérieure", + newWindow: "Nouvelle fenêtre" +}) +); diff --git a/lib/dijit/_editor/nls/fr/commands.js b/lib/dijit/_editor/nls/fr/commands.js index b1b471b54..cb25f3633 100644 --- a/lib/dijit/_editor/nls/fr/commands.js +++ b/lib/dijit/_editor/nls/fr/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/fr/commands",({"bold":"Gras","copy":"Copier","cut":"Couper","delete":"Supprimer","indent":"Retrait","insertHorizontalRule":"Règle horizontale","insertOrderedList":"Liste numérotée","insertUnorderedList":"Liste à puces","italic":"Italique","justifyCenter":"Aligner au centre","justifyFull":"Justifier","justifyLeft":"Aligner à gauche","justifyRight":"Aligner à droite","outdent":"Retrait négatif","paste":"Coller","redo":"Rétablir","removeFormat":"Supprimer la mise en forme","selectAll":"Sélectionner tout","strikethrough":"Barrer","subscript":"Indice","superscript":"Exposant","underline":"Souligner","undo":"Annuler","unlink":"Supprimer le lien","createLink":"Créer un lien","toggleDir":"Changer de sens","insertImage":"Insérer une image","insertTable":"Insérer/Modifier un tableau","toggleTableBorder":"Afficher/Masquer la bordure du tableau","deleteTable":"Supprimer le tableau","tableProp":"Propriété du tableau","htmlToggle":"Source HTML","foreColor":"Couleur d'avant-plan","hiliteColor":"Couleur d'arrière-plan","plainFormatBlock":"Style de paragraphe","formatBlock":"Style de paragraphe","fontSize":"Taille de police","fontName":"Nom de police","tabIndent":"Retrait de tabulation","fullScreen":"Basculer en plein écran","viewSource":"Afficher la source HTML","print":"Imprimer","newPage":"Nouvelle page","systemShortcut":"L'action \"${0}\" est disponible dans votre navigateur uniquement, par le biais d'un raccourci-clavier. Utilisez ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/fr/commands",({"bold":"Gras","copy":"Copier","cut":"Couper","delete":"Supprimer","indent":"Retrait","insertHorizontalRule":"Règle horizontale","insertOrderedList":"Liste numérotée","insertUnorderedList":"Liste à puces","italic":"Italique","justifyCenter":"Aligner au centre","justifyFull":"Justifier","justifyLeft":"Aligner à gauche","justifyRight":"Aligner à droite","outdent":"Retrait négatif","paste":"Coller","redo":"Rétablir","removeFormat":"Supprimer la mise en forme","selectAll":"Sélectionner tout","strikethrough":"Barrer","subscript":"Indice","superscript":"Exposant","underline":"Souligner","undo":"Annuler","unlink":"Supprimer le lien","createLink":"Créer un lien","toggleDir":"Changer de sens","insertImage":"Insérer une image","insertTable":"Insérer/Modifier un tableau","toggleTableBorder":"Afficher/Masquer la bordure du tableau","deleteTable":"Supprimer le tableau","tableProp":"Propriété du tableau","htmlToggle":"Source HTML","foreColor":"Couleur d'avant-plan","hiliteColor":"Couleur d'arrière-plan","plainFormatBlock":"Style de paragraphe","formatBlock":"Style de paragraphe","fontSize":"Taille de police","fontName":"Nom de police","tabIndent":"Retrait de tabulation","fullScreen":"Basculer en plein écran","viewSource":"Afficher la source HTML","print":"Imprimer","newPage":"Nouvelle page","systemShortcut":"L'action \"${0}\" est disponible dans votre navigateur uniquement, par le biais d'un raccourci-clavier. Utilisez ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/fr/commands.js.uncompressed.js b/lib/dijit/_editor/nls/fr/commands.js.uncompressed.js new file mode 100644 index 000000000..27b6a4031 --- /dev/null +++ b/lib/dijit/_editor/nls/fr/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/fr/commands", ({ + 'bold': 'Gras', + 'copy': 'Copier', + 'cut': 'Couper', + 'delete': 'Supprimer', + 'indent': 'Retrait', + 'insertHorizontalRule': 'Règle horizontale', + 'insertOrderedList': 'Liste numérotée', + 'insertUnorderedList': 'Liste à puces', + 'italic': 'Italique', + 'justifyCenter': 'Aligner au centre', + 'justifyFull': 'Justifier', + 'justifyLeft': 'Aligner à gauche', + 'justifyRight': 'Aligner à droite', + 'outdent': 'Retrait négatif', + 'paste': 'Coller', + 'redo': 'Rétablir', + 'removeFormat': 'Supprimer la mise en forme', + 'selectAll': 'Sélectionner tout', + 'strikethrough': 'Barrer', + 'subscript': 'Indice', + 'superscript': 'Exposant', + 'underline': 'Souligner', + 'undo': 'Annuler', + 'unlink': 'Supprimer le lien', + 'createLink': 'Créer un lien', + 'toggleDir': 'Changer de sens', + 'insertImage': 'Insérer une image', + 'insertTable': 'Insérer/Modifier un tableau', + 'toggleTableBorder': 'Afficher/Masquer la bordure du tableau', + 'deleteTable': 'Supprimer le tableau', + 'tableProp': 'Propriété du tableau', + 'htmlToggle': 'Source HTML', + 'foreColor': 'Couleur d\'avant-plan', + 'hiliteColor': 'Couleur d\'arrière-plan', + 'plainFormatBlock': 'Style de paragraphe', + 'formatBlock': 'Style de paragraphe', + 'fontSize': 'Taille de police', + 'fontName': 'Nom de police', + 'tabIndent': 'Retrait de tabulation', + "fullScreen": "Basculer en plein écran", + "viewSource": "Afficher la source HTML", + "print": "Imprimer", + "newPage": "Nouvelle page", + /* Error messages */ + 'systemShortcut': 'L\'action "${0}" est disponible dans votre navigateur uniquement, par le biais d\'un raccourci-clavier. Utilisez ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/he/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/he/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..c8bee2c34 --- /dev/null +++ b/lib/dijit/_editor/nls/he/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/he/FontChoice", ({ + fontSize: "גודל", + fontName: "גופן", + formatBlock: "עיצוב", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "ללא ", + p: "פיסקה", + h1: "כותרת", + h2: "תת-כותרת", + h3: "תת-תת-כותרת", + pre: "מעוצב מראש", + 1: "קטן ביות", + 2: "קטן מאוד", + 3: "קטן", + 4: "בינוני", + 5: "גדול", + 6: "גדול מאוד", + 7: "גדול ביותר" +}) +); diff --git a/lib/dijit/_editor/nls/he/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/he/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..5a5de943c --- /dev/null +++ b/lib/dijit/_editor/nls/he/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/he/LinkDialog", ({ + createLinkTitle: "תכונות קישור", + insertImageTitle: "תכונות תמונה", + url: "URL:", + text: "תיאור:", + target: "יעד:", + set: "הגדרה", + currentWindow: "חלון נוכחי", + parentWindow: "חלון אב", + topWindow: "חלון עליון", + newWindow: "חלון חדש" +}) +); diff --git a/lib/dijit/_editor/nls/he/commands.js.uncompressed.js b/lib/dijit/_editor/nls/he/commands.js.uncompressed.js new file mode 100644 index 000000000..cf719d478 --- /dev/null +++ b/lib/dijit/_editor/nls/he/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/he/commands", ({ + 'bold': 'מודגש', + 'copy': 'עותק', + 'cut': 'גזירה', + 'delete': 'מחיקה', + 'indent': 'הגדלת כניסה', + 'insertHorizontalRule': 'קו אופקי', + 'insertOrderedList': 'רשימה ממוספרת', + 'insertUnorderedList': 'רשימה עם תבליטים', + 'italic': 'נטוי', + 'justifyCenter': 'יישור למרכז', + 'justifyFull': 'יישור דו-צדדי', + 'justifyLeft': 'יישור לשמאל', + 'justifyRight': 'יישור לימין', + 'outdent': 'הקטנת כניסה', + 'paste': 'הדבקה', + 'redo': 'שחזור פעולה', + 'removeFormat': 'סילוק עיצוב', + 'selectAll': 'בחירת הכל', + 'strikethrough': 'קו חוצה', + 'subscript': 'כתב תחתי', + 'superscript': 'כתב עילי', + 'underline': 'קו תחתי', + 'undo': 'ביטול פעולה', + 'unlink': 'סילוק הקישור', + 'createLink': 'יצירת קישור', + 'toggleDir': 'מיתוג כיוון', + 'insertImage': 'הוספת תמונה', + 'insertTable': 'הוספת/עריכת טבלה', + 'toggleTableBorder': 'מיתוג גבול טבלה', + 'deleteTable': 'מחיקת טבלה', + 'tableProp': 'תכונת טבלה', + 'htmlToggle': 'מקור HTML', + 'foreColor': 'צבע חזית', + 'hiliteColor': 'צבע רקע', + 'plainFormatBlock': 'סגנון פיסקה', + 'formatBlock': 'סגנון פיסקה', + 'fontSize': 'גופן יחסי', + 'fontName': 'שם גופן', + 'tabIndent': 'כניסת טאב', + "fullScreen": "מיתוג מסך מלא", + "viewSource": "הצגת מקור HTML", + "print": "הדפסה", + "newPage": "דף חדש", + /* Error messages */ + 'systemShortcut': 'הפעולה "${0}" זמינה בדפדפן רק באמצעות קיצור דרך במקלדת. השתמשו בקיצור ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/hr/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/hr/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..82e9bad43 --- /dev/null +++ b/lib/dijit/_editor/nls/hr/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/hr/FontChoice", ({ + fontSize: "Veličina", + fontName: "Font", + formatBlock: "Oblikovanje", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "jednaki razmak", + cursive: "rukopisni", + fantasy: "fantastika", + noFormat: "Nijedan", + p: "Odlomak", + h1: "Naslov", + h2: "Podnaslov", + h3: "Pod-podnaslov", + pre: "Prethodno formatirano", + 1: "vrlo vrlo malo", + 2: "vrlo malo", + 3: "malo", + 4: "srednje", + 5: "veliko", + 6: "vrlo veliko", + 7: "vrlo vrlo veliko" +}) +); diff --git a/lib/dijit/_editor/nls/hr/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/hr/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..43869cceb --- /dev/null +++ b/lib/dijit/_editor/nls/hr/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/hr/LinkDialog", ({ + createLinkTitle: "Svojstva veze", + insertImageTitle: "Svojstva slike", + url: "URL:", + text: "Opis:", + target: "Cilj:", + set: "Postavi", + currentWindow: "Aktivni prozor", + parentWindow: "Nadređeni prozor", + topWindow: "Najviši prozor", + newWindow: "Novi prozor" +}) +); diff --git a/lib/dijit/_editor/nls/hr/commands.js.uncompressed.js b/lib/dijit/_editor/nls/hr/commands.js.uncompressed.js new file mode 100644 index 000000000..d61bf4899 --- /dev/null +++ b/lib/dijit/_editor/nls/hr/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/hr/commands", ({ + 'bold': 'Podebljaj', + 'copy': 'Kopiraj', + 'cut': 'Izreži', + 'delete': 'Izbriši', + 'indent': 'Uvuci', + 'insertHorizontalRule': 'Vodoravno ravnalo', + 'insertOrderedList': 'Numerirani popis', + 'insertUnorderedList': 'Popis s grafičkim oznakama', + 'italic': 'Kurziv', + 'justifyCenter': 'Centriraj', + 'justifyFull': 'Poravnaj', + 'justifyLeft': 'Poravnaj lijevo', + 'justifyRight': 'Poravnaj desno', + 'outdent': 'Izvuci', + 'paste': 'Zalijepi', + 'redo': 'Ponovno napravi', + 'removeFormat': 'Ukloni oblikovanje', + 'selectAll': 'Izaberi sve', + 'strikethrough': 'Precrtaj', + 'subscript': 'Indeks', + 'superscript': 'Superskript', + 'underline': 'Podcrtaj', + 'undo': 'Poništi', + 'unlink': 'Ukloni vezu', + 'createLink': 'Kreiraj vezu', + 'toggleDir': 'Prebaci smjer', + 'insertImage': 'Umetni sliku', + 'insertTable': 'Umetni/Uredi tablicu', + 'toggleTableBorder': 'Prebaci rub tablice', + 'deleteTable': 'Izbriši tablicu', + 'tableProp': 'Svojstvo tablice', + 'htmlToggle': 'HTML izvor', + 'foreColor': 'Boja prednjeg plana', + 'hiliteColor': 'Boja pozadine', + 'plainFormatBlock': 'Stil odlomka', + 'formatBlock': 'Stil odlomka', + 'fontSize': 'Veličina fonta', + 'fontName': 'Ime fonta', + 'tabIndent': 'Tabulator uvlačenja', + "fullScreen": "Prebaci na potpun ekran", + "viewSource": "Pogledaj HTML izvor", + "print": "Ispis", + "newPage": "Nova stranica", + /* Error messages */ + 'systemShortcut': '"${0}" akcija je dostupna jedino u vašem pregledniku upotrebom prečice tipkovnice. Koristite ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/hu/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/hu/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..2868348ed --- /dev/null +++ b/lib/dijit/_editor/nls/hu/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/hu/FontChoice", ({ + fontSize: "Méret", + fontName: "Betűtípus", + formatBlock: "Formátum", + serif: "talpas", + "sans-serif": "talpatlan", + monospace: "rögzített szélességű", + cursive: "kurzív", + fantasy: "fantázia", + noFormat: "Nincs", + p: "Bekezdés", + h1: "Címsor", + h2: "Alcím", + h3: "Al-alcím", + pre: "Előformázott", + 1: "xx-kicsi", + 2: "x-kicsi", + 3: "kicsi", + 4: "közepes", + 5: "nagy", + 6: "x-nagy", + 7: "xx-nagy" +}) +); diff --git a/lib/dijit/_editor/nls/hu/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/hu/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..6558a2b42 --- /dev/null +++ b/lib/dijit/_editor/nls/hu/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/hu/LinkDialog", ({ + createLinkTitle: "Hivatkozás tulajdonságai", + insertImageTitle: "Kép tulajdonságai", + url: "URL:", + text: "Leírás:", + target: "Cél:", + set: "Beállítás", + currentWindow: "Aktuális ablak", + parentWindow: "Szülő ablak", + topWindow: "Legfelső szintű ablak", + newWindow: "Új ablak" +}) +); diff --git a/lib/dijit/_editor/nls/hu/commands.js b/lib/dijit/_editor/nls/hu/commands.js index 39d06ddb9..b10b15512 100644 --- a/lib/dijit/_editor/nls/hu/commands.js +++ b/lib/dijit/_editor/nls/hu/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/hu/commands",({"bold":"Félkövér","copy":"Másolás","cut":"Kivágás","delete":"Törlés","indent":"Behúzás","insertHorizontalRule":"Vízszintes vonalzó","insertOrderedList":"Számozott lista","insertUnorderedList":"Felsorolásjeles lista","italic":"Dőlt","justifyCenter":"Középre igazítás","justifyFull":"Sorkizárás","justifyLeft":"Balra igazítás","justifyRight":"Jobbra igazítás","outdent":"Negatív behúzás","paste":"Beillesztés","redo":"Újra","removeFormat":"Formázás eltávolítása","selectAll":"Összes kijelölése","strikethrough":"Áthúzott","subscript":"Alsó index","superscript":"Felső index","underline":"Aláhúzott","undo":"Visszavonás","unlink":"Hivatkozás eltávolítása","createLink":"Hivatkozás létrehozása","toggleDir":"Irány váltókapcsoló","insertImage":"Kép beszúrása","insertTable":"Táblázat beszúrása/szerkesztése","toggleTableBorder":"Táblázatszegély ki-/bekapcsolása","deleteTable":"Táblázat törlése","tableProp":"Táblázat tulajdonságai","htmlToggle":"HTML forrás","foreColor":"Előtérszín","hiliteColor":"Háttérszín","plainFormatBlock":"Bekezdés stílusa","formatBlock":"Bekezdés stílusa","fontSize":"Betűméret","fontName":"Betűtípus","tabIndent":"Tab behúzás","fullScreen":"Váltás teljes képernyőre","viewSource":"HTML forrás megjelenítése","print":"Nyomtatás","newPage":"Új oldal","systemShortcut":"A(z) \"${0}\" művelet a böngészőben csak billentyűparancs használatával érhető el. Használja a következőt: ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/hu/commands",({"bold":"Félkövér","copy":"Másolás","cut":"Kivágás","delete":"Törlés","indent":"Behúzás","insertHorizontalRule":"Vízszintes vonalzó","insertOrderedList":"Számozott lista","insertUnorderedList":"Felsorolásjeles lista","italic":"Dőlt","justifyCenter":"Középre igazítás","justifyFull":"Sorkizárás","justifyLeft":"Balra igazítás","justifyRight":"Jobbra igazítás","outdent":"Negatív behúzás","paste":"Beillesztés","redo":"Újra","removeFormat":"Formázás eltávolítása","selectAll":"Összes kijelölése","strikethrough":"Áthúzott","subscript":"Alsó index","superscript":"Felső index","underline":"Aláhúzott","undo":"Visszavonás","unlink":"Hivatkozás eltávolítása","createLink":"Hivatkozás létrehozása","toggleDir":"Irány váltókapcsoló","insertImage":"Kép beszúrása","insertTable":"Táblázat beszúrása/szerkesztése","toggleTableBorder":"Táblázatszegély ki-/bekapcsolása","deleteTable":"Táblázat törlése","tableProp":"Táblázat tulajdonságai","htmlToggle":"HTML forrás","foreColor":"Előtérszín","hiliteColor":"Háttérszín","plainFormatBlock":"Bekezdés stílusa","formatBlock":"Bekezdés stílusa","fontSize":"Betűméret","fontName":"Betűtípus","tabIndent":"Tab behúzás","fullScreen":"Váltás teljes képernyőre","viewSource":"HTML forrás megjelenítése","print":"Nyomtatás","newPage":"Új oldal","systemShortcut":"A(z) \"${0}\" művelet a böngészőben csak billentyűparancs használatával érhető el. Használja a következőt: ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/hu/commands.js.uncompressed.js b/lib/dijit/_editor/nls/hu/commands.js.uncompressed.js new file mode 100644 index 000000000..10b86ea90 --- /dev/null +++ b/lib/dijit/_editor/nls/hu/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/hu/commands", ({ + 'bold': 'Félkövér', + 'copy': 'Másolás', + 'cut': 'Kivágás', + 'delete': 'Törlés', + 'indent': 'Behúzás', + 'insertHorizontalRule': 'Vízszintes vonalzó', + 'insertOrderedList': 'Számozott lista', + 'insertUnorderedList': 'Felsorolásjeles lista', + 'italic': 'Dőlt', + 'justifyCenter': 'Középre igazítás', + 'justifyFull': 'Sorkizárás', + 'justifyLeft': 'Balra igazítás', + 'justifyRight': 'Jobbra igazítás', + 'outdent': 'Negatív behúzás', + 'paste': 'Beillesztés', + 'redo': 'Újra', + 'removeFormat': 'Formázás eltávolítása', + 'selectAll': 'Összes kijelölése', + 'strikethrough': 'Áthúzott', + 'subscript': 'Alsó index', + 'superscript': 'Felső index', + 'underline': 'Aláhúzott', + 'undo': 'Visszavonás', + 'unlink': 'Hivatkozás eltávolítása', + 'createLink': 'Hivatkozás létrehozása', + 'toggleDir': 'Irány váltókapcsoló', + 'insertImage': 'Kép beszúrása', + 'insertTable': 'Táblázat beszúrása/szerkesztése', + 'toggleTableBorder': 'Táblázatszegély ki-/bekapcsolása', + 'deleteTable': 'Táblázat törlése', + 'tableProp': 'Táblázat tulajdonságai', + 'htmlToggle': 'HTML forrás', + 'foreColor': 'Előtérszín', + 'hiliteColor': 'Háttérszín', + 'plainFormatBlock': 'Bekezdés stílusa', + 'formatBlock': 'Bekezdés stílusa', + 'fontSize': 'Betűméret', + 'fontName': 'Betűtípus', + 'tabIndent': 'Tab behúzás', + "fullScreen": "Váltás teljes képernyőre", + "viewSource": "HTML forrás megjelenítése", + "print": "Nyomtatás", + "newPage": "Új oldal", + /* Error messages */ + 'systemShortcut': 'A(z) "${0}" művelet a böngészőben csak billentyűparancs használatával érhető el. Használja a következőt: ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/it/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/it/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..1d181d3b3 --- /dev/null +++ b/lib/dijit/_editor/nls/it/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/it/FontChoice", ({ + fontSize: "Dimensione", + fontName: "Carattere", + formatBlock: "Formato", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "spaziatura fissa", + cursive: "corsivo", + fantasy: "fantasy", + noFormat: "Nessuna", + p: "Paragrafo", + h1: "Intestazione", + h2: "Sottointestazione", + h3: "Sottointestazione secondaria", + pre: "Preformattato", + 1: "piccolissimo", + 2: "molto piccolo", + 3: "piccolo", + 4: "medio", + 5: "grande", + 6: "molto grande", + 7: "grandissimo" +}) +); diff --git a/lib/dijit/_editor/nls/it/LinkDialog.js b/lib/dijit/_editor/nls/it/LinkDialog.js index 8e6eb0002..5682ac9f9 100644 --- a/lib/dijit/_editor/nls/it/LinkDialog.js +++ b/lib/dijit/_editor/nls/it/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/it/LinkDialog",({createLinkTitle:"Proprietà collegamento",insertImageTitle:"Proprietà immagine",url:"URL:",text:"Descrizione:",target:"Destinazione:",set:"Imposta",currentWindow:"Finestra corrente",parentWindow:"Finestra parent",topWindow:"Finestra in primo piano",newWindow:"Nuova finestra"}));
\ No newline at end of file +define("dijit/_editor/nls/it/LinkDialog",({createLinkTitle:"Proprietà collegamento",insertImageTitle:"Proprietà immagine",url:"URL:",text:"Descrizione:",target:"Destinazione:",set:"Imposta",currentWindow:"Finestra corrente",parentWindow:"Finestra padre",topWindow:"Finestra superiore",newWindow:"Nuova finestra"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/it/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/it/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..e59b36583 --- /dev/null +++ b/lib/dijit/_editor/nls/it/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/it/LinkDialog", ({ + createLinkTitle: "Proprietà collegamento", + insertImageTitle: "Proprietà immagine", + url: "URL:", + text: "Descrizione:", + target: "Destinazione:", + set: "Imposta", + currentWindow: "Finestra corrente", + parentWindow: "Finestra padre", + topWindow: "Finestra superiore", + newWindow: "Nuova finestra" +}) +); diff --git a/lib/dijit/_editor/nls/it/commands.js b/lib/dijit/_editor/nls/it/commands.js index f413791b7..82ae3ae5a 100644 --- a/lib/dijit/_editor/nls/it/commands.js +++ b/lib/dijit/_editor/nls/it/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/it/commands",({"bold":"Grassetto","copy":"Copia","cut":"Taglia","delete":"Elimina","indent":"Rientra","insertHorizontalRule":"Righello orizzontale","insertOrderedList":"Elenco numerato","insertUnorderedList":"Elenco puntato","italic":"Corsivo","justifyCenter":"Allinea al centro","justifyFull":"Giustifica","justifyLeft":"Allinea a sinistra","justifyRight":"Allinea a destra","outdent":"Rimuovi rientro","paste":"Incolla","redo":"Ripristina","removeFormat":"Rimuovi formato","selectAll":"Seleziona tutto","strikethrough":"Barrato","subscript":"Pedice","superscript":"Apice","underline":"Sottolineato","undo":"Annulla","unlink":"Rimuovi collegamento","createLink":"Crea collegamento","toggleDir":"Inverti direzione","insertImage":"Inserisci immagine","insertTable":"Inserisci/Modifica tabella","toggleTableBorder":"Mostra/Nascondi margine tabella","deleteTable":"Elimina tabella","tableProp":"Proprietà tabella","htmlToggle":"Origine HTML","foreColor":"Colore primo piano","hiliteColor":"Colore sfondo","plainFormatBlock":"Stile paragrafo","formatBlock":"Stile paragrafo","fontSize":"Dimensione carattere","fontName":"Nome carattere","tabIndent":"Rientranza tabulazione","fullScreen":"Attiva/Disattiva schermo intero","viewSource":"Visualizza origine HTML","print":"Stampa","newPage":"Nuova pagina","systemShortcut":"Azione \"${0}\" disponibile sul proprio browser solo mediante i tasti di scelta rapida della tastiera. Utilizzare ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/it/commands",({"bold":"Grassetto","copy":"Copia","cut":"Taglia","delete":"Annulla","indent":"Rientra","insertHorizontalRule":"Righello orizzontale","insertOrderedList":"Elenco numerato","insertUnorderedList":"Elenco a punti","italic":"Corsivo","justifyCenter":"Allinea al centro","justifyFull":"Giustifica","justifyLeft":"Allinea a sinistra","justifyRight":"Allinea a destra","outdent":"Annulla rientro","paste":"Incolla","redo":"Ripeti","removeFormat":"Rimuovi formato","selectAll":"Seleziona tutto","strikethrough":"Barrato","subscript":"Pedice","superscript":"Apice","underline":"Sottolinea","undo":"Annulla","unlink":"Rimuovi collegamento","createLink":"Crea collegamento","toggleDir":"Attiva/Disattiva direzione","insertImage":"Inserisci immagine","insertTable":"Inserisci/Modifica tabella","toggleTableBorder":"Attiva/Disattiva bordo tabella","deleteTable":"Elimina tabella","tableProp":"Proprietà tabella","htmlToggle":"Origine HTML","foreColor":"Colore in primo piano","hiliteColor":"Colore di sfondo","plainFormatBlock":"Stile paragrafo","formatBlock":"Stile paragrafo","fontSize":"Dimensione tipo di carattere","fontName":"Nome tipo di carattere","tabIndent":"Rientro tabulazione","fullScreen":"Attiva/Disattiva schermo intero","viewSource":"Visualizza origine HTML","print":"Stampa","newPage":"Nuova pagina","systemShortcut":"Azione \"${0}\" disponibile nel browser solo utilizzando una scelta rapida da tastiera. Utilizzare ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/it/commands.js.uncompressed.js b/lib/dijit/_editor/nls/it/commands.js.uncompressed.js new file mode 100644 index 000000000..5b1b53a4b --- /dev/null +++ b/lib/dijit/_editor/nls/it/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/it/commands", ({ + 'bold': 'Grassetto', + 'copy': 'Copia', + 'cut': 'Taglia', + 'delete': 'Annulla', + 'indent': 'Rientra', + 'insertHorizontalRule': 'Righello orizzontale', + 'insertOrderedList': 'Elenco numerato', + 'insertUnorderedList': 'Elenco a punti', + 'italic': 'Corsivo', + 'justifyCenter': 'Allinea al centro', + 'justifyFull': 'Giustifica', + 'justifyLeft': 'Allinea a sinistra', + 'justifyRight': 'Allinea a destra', + 'outdent': 'Annulla rientro', + 'paste': 'Incolla', + 'redo': 'Ripeti', + 'removeFormat': 'Rimuovi formato', + 'selectAll': 'Seleziona tutto', + 'strikethrough': 'Barrato', + 'subscript': 'Pedice', + 'superscript': 'Apice', + 'underline': 'Sottolinea', + 'undo': 'Annulla', + 'unlink': 'Rimuovi collegamento', + 'createLink': 'Crea collegamento', + 'toggleDir': 'Attiva/Disattiva direzione', + 'insertImage': 'Inserisci immagine', + 'insertTable': 'Inserisci/Modifica tabella', + 'toggleTableBorder': 'Attiva/Disattiva bordo tabella', + 'deleteTable': 'Elimina tabella', + 'tableProp': 'Proprietà tabella', + 'htmlToggle': 'Origine HTML', + 'foreColor': 'Colore in primo piano', + 'hiliteColor': 'Colore di sfondo', + 'plainFormatBlock': 'Stile paragrafo', + 'formatBlock': 'Stile paragrafo', + 'fontSize': 'Dimensione tipo di carattere', + 'fontName': 'Nome tipo di carattere', + 'tabIndent': 'Rientro tabulazione', + "fullScreen": "Attiva/Disattiva schermo intero", + "viewSource": "Visualizza origine HTML", + "print": "Stampa", + "newPage": "Nuova pagina", + /* Error messages */ + 'systemShortcut': 'Azione "${0}" disponibile nel browser solo utilizzando una scelta rapida da tastiera. Utilizzare ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/ja/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/ja/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..51232f1a5 --- /dev/null +++ b/lib/dijit/_editor/nls/ja/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/ja/FontChoice", ({ + fontSize: "サイズ", + fontName: "フォント", + formatBlock: "フォーマット", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "なし", + p: "段落", + h1: "見出し", + h2: "副見出し", + h3: "副見出しの副見出し", + pre: "事前フォーマット済み", + 1: "超極小", + 2: "極小", + 3: "小", + 4: "標準", + 5: "大", + 6: "特大", + 7: "超特大" +}) +); diff --git a/lib/dijit/_editor/nls/ja/LinkDialog.js b/lib/dijit/_editor/nls/ja/LinkDialog.js index 408e45ed6..d3d5e53cf 100644 --- a/lib/dijit/_editor/nls/ja/LinkDialog.js +++ b/lib/dijit/_editor/nls/ja/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ja/LinkDialog",({createLinkTitle:"リンク・プロパティー",insertImageTitle:"イメージ・プロパティー",url:"URL:",text:"説明:",target:"ターゲット:",set:"設定",currentWindow:"現行ウィンドウ",parentWindow:"親ウィンドウ",topWindow:"最上位ウィンドウ",newWindow:"新規ウィンドウ"}));
\ No newline at end of file +define("dijit/_editor/nls/ja/LinkDialog",({createLinkTitle:"リンク・プロパティー",insertImageTitle:"イメージ・プロパティー",url:"URL:",text:"説明:",target:"ターゲット: ",set:"設定",currentWindow:"現在のウィンドウ",parentWindow:"親ウィンドウ",topWindow:"最上位ウィンドウ",newWindow:"新規ウィンドウ"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ja/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/ja/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..6f4e06567 --- /dev/null +++ b/lib/dijit/_editor/nls/ja/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/ja/LinkDialog", ({ + createLinkTitle: "リンク・プロパティー", + insertImageTitle: "イメージ・プロパティー", + url: "URL:", + text: "説明:", + target: "ターゲット: ", + set: "設定", + currentWindow: "現在のウィンドウ", + parentWindow: "親ウィンドウ", + topWindow: "最上位ウィンドウ", + newWindow: "新規ウィンドウ" +}) +); diff --git a/lib/dijit/_editor/nls/ja/commands.js b/lib/dijit/_editor/nls/ja/commands.js index 56026d1e3..5cc5e5796 100644 --- a/lib/dijit/_editor/nls/ja/commands.js +++ b/lib/dijit/_editor/nls/ja/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ja/commands",({"bold":"太字","copy":"コピー","cut":"切り取り","delete":"削除","indent":"インデント","insertHorizontalRule":"水平罫線","insertOrderedList":"番号付きリスト","insertUnorderedList":"黒丸付きリスト","italic":"イタリック","justifyCenter":"中央揃え","justifyFull":"両端揃え","justifyLeft":"左揃え","justifyRight":"右揃え","outdent":"アウトデント","paste":"貼り付け","redo":"やり直し","removeFormat":"書式のクリア","selectAll":"すべて選択","strikethrough":"取り消し線","subscript":"下付き文字","superscript":"上付き文字","underline":"下線","undo":"元に戻す","unlink":"リンクの削除","createLink":"リンクの作成","toggleDir":"方向の切り替え","insertImage":"イメージの挿入","insertTable":"テーブルの挿入/編集","toggleTableBorder":"テーブル・ボーダーの切り替え","deleteTable":"テーブルの削除","tableProp":"テーブル・プロパティー","htmlToggle":"HTML ソース","foreColor":"前景色","hiliteColor":"マーカー","plainFormatBlock":"段落スタイル","formatBlock":"段落スタイル","fontSize":"フォント・サイズ","fontName":"フォント名","tabIndent":"タブ・インデント","fullScreen":"全画面表示に切り替え","viewSource":"HTML ソースの表示","print":"印刷","newPage":"新規ページ","systemShortcut":"\"${0}\" アクションを使用できるのは、ブラウザーでキーボード・ショートカットを使用する場合のみです。${1} を使用してください。","ctrlKey":"Ctrl+${0}"}));
\ No newline at end of file +define("dijit/_editor/nls/ja/commands",({"bold":"太字","copy":"コピー","cut":"切り取り","delete":"削除","indent":"インデント","insertHorizontalRule":"水平罫線","insertOrderedList":"番号付きリスト","insertUnorderedList":"黒丸付きリスト","italic":"イタリック","justifyCenter":"中央揃え","justifyFull":"両端揃え","justifyLeft":"左揃え","justifyRight":"右揃え","outdent":"アウトデント","paste":"貼り付け","redo":"やり直し","removeFormat":"形式の削除","selectAll":"すべて選択","strikethrough":"取り消し線","subscript":"下付き文字","superscript":"上付き文字","underline":"下線","undo":"元に戻す","unlink":"リンクの削除","createLink":"リンクの作成","toggleDir":"方向の切り替え","insertImage":"イメージの挿入","insertTable":"テーブルの挿入/編集","toggleTableBorder":"テーブルボーダーの切り替え","deleteTable":"テーブルの削除","tableProp":"テーブルプロパティ","htmlToggle":"HTML ソース","foreColor":"前景色","hiliteColor":"背景色","plainFormatBlock":"段落スタイル","formatBlock":"段落スタイル","fontSize":"フォントサイズ","fontName":"フォント名","tabIndent":"タブインデント","fullScreen":"全画面表示に切り替え","viewSource":"HTML ソースの表示","print":"印刷","newPage":"新しいページ","systemShortcut":"\"${0}\" アクションを使用できるのは、ブラウザーでキーボードショートカットを使用する場合のみです。 ${1} を使用してください。","ctrlKey":"Ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ja/commands.js.uncompressed.js b/lib/dijit/_editor/nls/ja/commands.js.uncompressed.js new file mode 100644 index 000000000..8c41419c5 --- /dev/null +++ b/lib/dijit/_editor/nls/ja/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/ja/commands", ({ + 'bold': '太字', + 'copy': 'コピー', + 'cut': '切り取り', + 'delete': '削除', + 'indent': 'インデント', + 'insertHorizontalRule': '水平罫線', + 'insertOrderedList': '番号付きリスト', + 'insertUnorderedList': '黒丸付きリスト', + 'italic': 'イタリック', + 'justifyCenter': '中央揃え', + 'justifyFull': '両端揃え', + 'justifyLeft': '左揃え', + 'justifyRight': '右揃え', + 'outdent': 'アウトデント', + 'paste': '貼り付け', + 'redo': 'やり直し', + 'removeFormat': '形式の削除', + 'selectAll': 'すべて選択', + 'strikethrough': '取り消し線', + 'subscript': '下付き文字', + 'superscript': '上付き文字', + 'underline': '下線', + 'undo': '元に戻す', + 'unlink': 'リンクの削除', + 'createLink': 'リンクの作成', + 'toggleDir': '方向の切り替え', + 'insertImage': 'イメージの挿入', + 'insertTable': 'テーブルの挿入/編集', + 'toggleTableBorder': 'テーブルボーダーの切り替え', + 'deleteTable': 'テーブルの削除', + 'tableProp': 'テーブルプロパティ', + 'htmlToggle': 'HTML ソース', + 'foreColor': '前景色', + 'hiliteColor': '背景色', + 'plainFormatBlock': '段落スタイル', + 'formatBlock': '段落スタイル', + 'fontSize': 'フォントサイズ', + 'fontName': 'フォント名', + 'tabIndent': 'タブインデント', + "fullScreen": "全画面表示に切り替え", + "viewSource": "HTML ソースの表示", + "print": "印刷", + "newPage": "新しいページ", + /* Error messages */ + 'systemShortcut': '"${0}" アクションを使用できるのは、ブラウザーでキーボードショートカットを使用する場合のみです。 ${1} を使用してください。', + 'ctrlKey':'Ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/kk/FontChoice.js b/lib/dijit/_editor/nls/kk/FontChoice.js index 1569c30b2..ee4db4392 100644 --- a/lib/dijit/_editor/nls/kk/FontChoice.js +++ b/lib/dijit/_editor/nls/kk/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/kk/FontChoice",({fontSize:"Өлшемі",fontName:"Қаріп",formatBlock:"Пішім",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"көлбеу",fantasy:"қиял-ғажайып",noFormat:"Ешбір",p:"Еже",h1:"Үстіңгі деректеме",h2:"Ішкі тақырып",h3:"Ішкі-ішкі тақырып",pre:"Алдын ала пішімделген",1:"xx-кіші",2:"x-кіші",3:"кіші",4:"орташа",5:"үлкен",6:"x-үлкен",7:"xx-үлкен"}));
\ No newline at end of file +define("dijit/_editor/nls/kk/FontChoice",({fontSize:"Өлшемі",fontName:"Қаріп",formatBlock:"Пішім",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"көлбеу",fantasy:"fantasy",noFormat:"Ешбір",p:"Еже",h1:"Тақырып",h2:"Ішкі тақырып",h3:"Ішкі-ішкі тақырып",pre:"Алдын ала пішімделген",1:"xx-кіші",2:"x-кіші",3:"кіші",4:"орташа",5:"үлкен",6:"x-үлкен",7:"xx-үлкен"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/kk/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/kk/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..e7a52c87a --- /dev/null +++ b/lib/dijit/_editor/nls/kk/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/kk/FontChoice", ({ + fontSize: "Өлшемі", + fontName: "Қаріп", + formatBlock: "Пішім", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "көлбеу", + fantasy: "fantasy", + noFormat: "Ешбір", + p: "Еже", + h1: "Тақырып", + h2: "Ішкі тақырып", + h3: "Ішкі-ішкі тақырып", + pre: "Алдын ала пішімделген", + 1: "xx-кіші", + 2: "x-кіші", + 3: "кіші", + 4: "орташа", + 5: "үлкен", + 6: "x-үлкен", + 7: "xx-үлкен" +}) +); diff --git a/lib/dijit/_editor/nls/kk/LinkDialog.js b/lib/dijit/_editor/nls/kk/LinkDialog.js index b186e824a..0967b8094 100644 --- a/lib/dijit/_editor/nls/kk/LinkDialog.js +++ b/lib/dijit/_editor/nls/kk/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/kk/LinkDialog",({createLinkTitle:"Сілтеме сипаттары",insertImageTitle:"Сурет сипаттары",url:"URL мекенжайы:",text:"Сипаттама:",target:"Мақсат:",set:"Орнату",currentWindow:"Ағымдағы терезе",parentWindow:"Басты терезе",topWindow:"Ең жоғарғы терезе",newWindow:"Жаңа терезе"}));
\ No newline at end of file +define("dijit/_editor/nls/kk/LinkDialog",({createLinkTitle:"Сілтеме сипаттары",insertImageTitle:"Сурет сипаттары",url:"URL:",text:"Сипаттама:",target:"Мақсат:",set:"Орнату",currentWindow:"Ағымдағы терезе",parentWindow:"Басты терезе",topWindow:"Ең жоғарғы терезе",newWindow:"Жаңа терезе"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/kk/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/kk/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..1a78a3295 --- /dev/null +++ b/lib/dijit/_editor/nls/kk/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/kk/LinkDialog", ({ + createLinkTitle: "Сілтеме сипаттары", + insertImageTitle: "Сурет сипаттары", + url: "URL:", + text: "Сипаттама:", + target: "Мақсат:", + set: "Орнату", + currentWindow: "Ағымдағы терезе", + parentWindow: "Басты терезе", + topWindow: "Ең жоғарғы терезе", + newWindow: "Жаңа терезе" +}) +); diff --git a/lib/dijit/_editor/nls/kk/commands.js b/lib/dijit/_editor/nls/kk/commands.js index 15d253122..32a22f964 100644 --- a/lib/dijit/_editor/nls/kk/commands.js +++ b/lib/dijit/_editor/nls/kk/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/kk/commands",({"bold":"Қалың","copy":"Көшіру","cut":"Қиып алу","delete":"Жою","indent":"Шегіндіру","insertHorizontalRule":"Көлденең сызғыш","insertOrderedList":"Нөмірленген тізім","insertUnorderedList":"Таңбалауыш тізім","italic":"Көлбеу","justifyCenter":"Ортасы бойынша туралау","justifyFull":"Туралау","justifyLeft":"Сол жақ бойынша туралау","justifyRight":"Оң жақ бойынша туралау","outdent":"Шығыңқы","paste":"Қою","redo":"Қайтару","removeFormat":"Пішімді алып тастау","selectAll":"Барлығын таңдау","strikethrough":"Сызылған","subscript":"Жоласты","superscript":"Жолүсті","underline":"Асты сызылған","undo":"Болдырмау ","unlink":"Сілтемені жою","createLink":"Сілтеме жасау","toggleDir":"Бағытты қосу","insertImage":"Сурет кірістіру","insertTable":"Кестені кірістіру/өңдеу","toggleTableBorder":"Кесте жиегін қосу","deleteTable":"Кестені жою","tableProp":"Кесте сипаты","htmlToggle":"HTML көзі","foreColor":"Алды түсі","hiliteColor":"Өң түсі","plainFormatBlock":"Еже мәнері","formatBlock":"Еже мәнері","fontSize":"Қаріп өлшемі","fontName":"Қаріп атауы","tabIndent":"Қойынды шегінісі","fullScreen":"Толық экранды қосу","viewSource":"HTML көзін қарау","print":"Басып шығару","newPage":"Жаңа бет","systemShortcut":"\"${0}\" әрекеті шолғышта тек пернелер тіркесімі арқылы қол жетімді. ${1} пайдаланыңыз."}));
\ No newline at end of file +define("dijit/_editor/nls/kk/commands",({"bold":"Қалың","copy":"Көшіру","cut":"Қиып алу","delete":"Жою","indent":"Шегіндіру","insertHorizontalRule":"Көлденең сызғыш","insertOrderedList":"Нөмірленген тізім","insertUnorderedList":"Таңбалауыш тізім","italic":"Көлбеу","justifyCenter":"Ортасы бойынша туралау","justifyFull":"Туралау","justifyLeft":"Сол жақ бойынша туралау","justifyRight":"Оң жақ бойынша туралау","outdent":"Солға ығысу","paste":"Қою","redo":"Қайтару","removeFormat":"Пішімді алып тастау","selectAll":"Барлығын таңдау","strikethrough":"Сызылған","subscript":"Жоласты","superscript":"Жолүсті","underline":"Асты сызылған","undo":"Болдырмау","unlink":"Сілтемені алып тастау","createLink":"Сілтеме жасау","toggleDir":"Бағытты қосу","insertImage":"Суретті кірістіру","insertTable":"Кестені кірістіру/өңдеу","toggleTableBorder":"Кесте жиегін қосу","deleteTable":"Кестені жою","tableProp":"Кесте сипаты","htmlToggle":"HTML көзі","foreColor":"Алды түсі","hiliteColor":"Өң түсі","plainFormatBlock":"Еже мәнері","formatBlock":"Еже мәнері","fontSize":"Қаріп өлшемі","fontName":"Қаріп атауы","tabIndent":"Қойынды шегінісі","fullScreen":"Толық экранды қосу","viewSource":"HTML көзін қарау","print":"Басып шығару","newPage":"Жаңа бет","systemShortcut":"\"${0}\" әрекеті шолғышта тек пернелер тіркесімі арқылы қол жетімді. ${1} пайдаланыңыз.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/kk/commands.js.uncompressed.js b/lib/dijit/_editor/nls/kk/commands.js.uncompressed.js new file mode 100644 index 000000000..ea78dd296 --- /dev/null +++ b/lib/dijit/_editor/nls/kk/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/kk/commands", ({ + 'bold': 'Қалың', + 'copy': 'Көшіру', + 'cut': 'Қиып алу', + 'delete': 'Жою', + 'indent': 'Шегіндіру', + 'insertHorizontalRule': 'Көлденең сызғыш', + 'insertOrderedList': 'Нөмірленген тізім', + 'insertUnorderedList': 'Таңбалауыш тізім', + 'italic': 'Көлбеу', + 'justifyCenter': 'Ортасы бойынша туралау', + 'justifyFull': 'Туралау', + 'justifyLeft': 'Сол жақ бойынша туралау', + 'justifyRight': 'Оң жақ бойынша туралау', + 'outdent': 'Солға ығысу', + 'paste': 'Қою', + 'redo': 'Қайтару', + 'removeFormat': 'Пішімді алып тастау', + 'selectAll': 'Барлығын таңдау', + 'strikethrough': 'Сызылған', + 'subscript': 'Жоласты', + 'superscript': 'Жолүсті', + 'underline': 'Асты сызылған', + 'undo': 'Болдырмау', + 'unlink': 'Сілтемені алып тастау', + 'createLink': 'Сілтеме жасау', + 'toggleDir': 'Бағытты қосу', + 'insertImage': 'Суретті кірістіру', + 'insertTable': 'Кестені кірістіру/өңдеу', + 'toggleTableBorder': 'Кесте жиегін қосу', + 'deleteTable': 'Кестені жою', + 'tableProp': 'Кесте сипаты', + 'htmlToggle': 'HTML көзі', + 'foreColor': 'Алды түсі', + 'hiliteColor': 'Өң түсі', + 'plainFormatBlock': 'Еже мәнері', + 'formatBlock': 'Еже мәнері', + 'fontSize': 'Қаріп өлшемі', + 'fontName': 'Қаріп атауы', + 'tabIndent': 'Қойынды шегінісі', + "fullScreen": "Толық экранды қосу", + "viewSource": "HTML көзін қарау", + "print": "Басып шығару", + "newPage": "Жаңа бет", + /* Error messages */ + 'systemShortcut': '"${0}" әрекеті шолғышта тек пернелер тіркесімі арқылы қол жетімді. ${1} пайдаланыңыз.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/ko/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/ko/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..ae20a2c66 --- /dev/null +++ b/lib/dijit/_editor/nls/ko/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/ko/FontChoice", ({ + fontSize: "크기", + fontName: "글꼴", + formatBlock: "서식", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "없음", + p: "단락", + h1: "제목", + h2: "부제목", + h3: "하위 부제목", + pre: "서식이 지정됨", + 1: "가장 작게", + 2: "조금 작게", + 3: "작게", + 4: "중간", + 5: "크게", + 6: "조금 크게", + 7: "가장 크게" +}) +); diff --git a/lib/dijit/_editor/nls/ko/LinkDialog.js b/lib/dijit/_editor/nls/ko/LinkDialog.js index a8b7c7c9e..a5b4baea3 100644 --- a/lib/dijit/_editor/nls/ko/LinkDialog.js +++ b/lib/dijit/_editor/nls/ko/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ko/LinkDialog",({createLinkTitle:"링크 등록 정보",insertImageTitle:"이미지 등록 정보",url:"URL:",text:"설명:",target:"대상",set:"설정",currentWindow:"현재 창",parentWindow:"상위 창",topWindow:"최상위 창",newWindow:"새 창"}));
\ No newline at end of file +define("dijit/_editor/nls/ko/LinkDialog",({createLinkTitle:"링크 특성",insertImageTitle:"이미지 특성",url:"URL:",text:"설명:",target:"대상",set:"설정",currentWindow:"현재 창",parentWindow:"상위 창",topWindow:"최상위 창",newWindow:"새 창"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ko/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/ko/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..02d50173f --- /dev/null +++ b/lib/dijit/_editor/nls/ko/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/ko/LinkDialog", ({ + createLinkTitle: "링크 특성", + insertImageTitle: "이미지 특성", + url: "URL:", + text: "설명:", + target: "대상", + set: "설정", + currentWindow: "현재 창", + parentWindow: "상위 창", + topWindow: "최상위 창", + newWindow: "새 창" +}) +); diff --git a/lib/dijit/_editor/nls/ko/commands.js b/lib/dijit/_editor/nls/ko/commands.js index 6ad5e7137..ff62c8d1a 100644 --- a/lib/dijit/_editor/nls/ko/commands.js +++ b/lib/dijit/_editor/nls/ko/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ko/commands",({"bold":"굵게","copy":"복사","cut":"잘라내기","delete":"삭제","indent":"들여쓰기","insertHorizontalRule":"수평 자","insertOrderedList":"번호 목록","insertUnorderedList":"글머리표 목록","italic":"기울임꼴","justifyCenter":"가운데 맞춤","justifyFull":"양쪽 맞춤","justifyLeft":"왼쪽 맞춤","justifyRight":"오른쪽 맞춤","outdent":"내어쓰기","paste":"붙여넣기","redo":"다시 실행","removeFormat":"형식 제거","selectAll":"모두 선택","strikethrough":"취소선","subscript":"아래첨자","superscript":"위첨자","underline":"밑줄","undo":"실행 취소","unlink":"링크 제거","createLink":"링크 작성","toggleDir":"방향 토글","insertImage":"이미지 삽입","insertTable":"테이블 삽입/편집","toggleTableBorder":"테이블 외곽선 토글","deleteTable":"테이블 삭제","tableProp":"테이블 특성","htmlToggle":"HTML 소스","foreColor":"전경색","hiliteColor":"배경색","plainFormatBlock":"단락 양식","formatBlock":"단락 양식","fontSize":"글꼴 크기","fontName":"글꼴 이름","tabIndent":"탭 들여쓰기","fullScreen":"전체 화면 토글","viewSource":"HTML 소스 보기","print":"인쇄","newPage":"새 페이지","systemShortcut":"\"${0}\" 조치는 브라우저에서 키보드 단축키를 통해서만 사용 가능합니다. ${1}을(를) 사용하십시오."}));
\ No newline at end of file +define("dijit/_editor/nls/ko/commands",({"bold":"굵게","copy":"복사","cut":"잘라내기","delete":"삭제","indent":"들여쓰기","insertHorizontalRule":"가로 줄","insertOrderedList":"번호 목록","insertUnorderedList":"글머리표 목록","italic":"기울임꼴","justifyCenter":"가운데 맞춤","justifyFull":"양쪽 맞춤","justifyLeft":"왼쪽 맞춤","justifyRight":"오른쪽 맞춤","outdent":"내어쓰기","paste":"붙여넣기","redo":"다시 실행","removeFormat":"형식 제거","selectAll":"모두 선택","strikethrough":"취소선","subscript":"아래첨자","superscript":"위첨자","underline":"밑줄","undo":"실행 취소","unlink":"링크 제거","createLink":"링크 작성","toggleDir":"방향 토글","insertImage":"이미지 삽입","insertTable":"테이블 삽입/편집","toggleTableBorder":"테이블 외곽선 토글","deleteTable":"테이블 삭제","tableProp":"테이블 특성","htmlToggle":"HTML 소스","foreColor":"전경색","hiliteColor":"배경색","plainFormatBlock":"단락 양식","formatBlock":"단락 양식","fontSize":"글꼴 크기","fontName":"글꼴 이름","tabIndent":"탭 들여쓰기","fullScreen":"전체 화면 토글","viewSource":"HTML 소스 보기","print":"인쇄","newPage":"새 페이지","systemShortcut":"\"${0}\" 조치는 브라우저에서 키보드 단축키를 통해서만 사용 가능합니다. ${1}을(를) 사용하십시오.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ko/commands.js.uncompressed.js b/lib/dijit/_editor/nls/ko/commands.js.uncompressed.js new file mode 100644 index 000000000..893da2609 --- /dev/null +++ b/lib/dijit/_editor/nls/ko/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/ko/commands", ({ + 'bold': '굵게', + 'copy': '복사', + 'cut': '잘라내기', + 'delete': '삭제', + 'indent': '들여쓰기', + 'insertHorizontalRule': '가로 줄', + 'insertOrderedList': '번호 목록', + 'insertUnorderedList': '글머리표 목록', + 'italic': '기울임꼴', + 'justifyCenter': '가운데 맞춤', + 'justifyFull': '양쪽 맞춤', + 'justifyLeft': '왼쪽 맞춤', + 'justifyRight': '오른쪽 맞춤', + 'outdent': '내어쓰기', + 'paste': '붙여넣기', + 'redo': '다시 실행', + 'removeFormat': '형식 제거', + 'selectAll': '모두 선택', + 'strikethrough': '취소선', + 'subscript': '아래첨자', + 'superscript': '위첨자', + 'underline': '밑줄', + 'undo': '실행 취소', + 'unlink': '링크 제거', + 'createLink': '링크 작성', + 'toggleDir': '방향 토글', + 'insertImage': '이미지 삽입', + 'insertTable': '테이블 삽입/편집', + 'toggleTableBorder': '테이블 외곽선 토글', + 'deleteTable': '테이블 삭제', + 'tableProp': '테이블 특성', + 'htmlToggle': 'HTML 소스', + 'foreColor': '전경색', + 'hiliteColor': '배경색', + 'plainFormatBlock': '단락 양식', + 'formatBlock': '단락 양식', + 'fontSize': '글꼴 크기', + 'fontName': '글꼴 이름', + 'tabIndent': '탭 들여쓰기', + "fullScreen": "전체 화면 토글", + "viewSource": "HTML 소스 보기", + "print": "인쇄", + "newPage": "새 페이지", + /* Error messages */ + 'systemShortcut': '"${0}" 조치는 브라우저에서 키보드 단축키를 통해서만 사용 가능합니다. ${1}을(를) 사용하십시오.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/nb/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/nb/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..edcbd6707 --- /dev/null +++ b/lib/dijit/_editor/nls/nb/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/nb/FontChoice", ({ + fontSize: "Størrelse", + fontName: "Skrift", + formatBlock: "Format", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "kursiv", + fantasy: "fantasi", + noFormat: "Ingen", + p: "Avsnitt", + h1: "Overskrift", + h2: "Undertittel", + h3: "Under-undertittel", + pre: "Forhåndsformatert", + 1: "xx-liten", + 2: "x-liten", + 3: "liten", + 4: "middels", + 5: "stor", + 6: "x-stor", + 7: "xx-stor" +}) +); diff --git a/lib/dijit/_editor/nls/nb/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/nb/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..02595e10f --- /dev/null +++ b/lib/dijit/_editor/nls/nb/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/nb/LinkDialog", ({ + createLinkTitle: "Koblingsegenskaper", + insertImageTitle: "Bildeegenskaper", + url: "URL:", + text: "Beskrivelse:", + target: "Mål:", + set: "Definer", + currentWindow: "Gjeldende vindu", + parentWindow: "Overordnet vindu", + topWindow: "Øverste vindu", + newWindow: "Nytt vindu" +}) +); diff --git a/lib/dijit/_editor/nls/nb/commands.js.uncompressed.js b/lib/dijit/_editor/nls/nb/commands.js.uncompressed.js new file mode 100644 index 000000000..4ffc6c151 --- /dev/null +++ b/lib/dijit/_editor/nls/nb/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/nb/commands", ({ + 'bold': 'Fet', + 'copy': 'Kopier', + 'cut': 'Klipp ut', + 'delete': 'Slett', + 'indent': 'Innrykk', + 'insertHorizontalRule': 'Vannrett strek', + 'insertOrderedList': 'Nummerert liste', + 'insertUnorderedList': 'Punktliste', + 'italic': 'Kursiv', + 'justifyCenter': 'Midtstill', + 'justifyFull': 'Juster', + 'justifyLeft': 'Venstrejuster', + 'justifyRight': 'Høyrejuster', + 'outdent': 'Fjern innrykk', + 'paste': 'Lim inn', + 'redo': 'Gjør om', + 'removeFormat': 'Fjern format', + 'selectAll': 'Velg alle', + 'strikethrough': 'Gjennomstreking', + 'subscript': 'Senket skrift', + 'superscript': 'Hevet skrift', + 'underline': 'Understreking', + 'undo': 'Angre', + 'unlink': 'Fjern kobling', + 'createLink': 'Opprett kobling', + 'toggleDir': 'Bytt retning', + 'insertImage': 'Sett inn bilde', + 'insertTable': 'Sett inn/rediger tabell', + 'toggleTableBorder': 'Bytt tabellkant', + 'deleteTable': 'Slett tabell', + 'tableProp': 'Tabellegenskap', + 'htmlToggle': 'HTML-kilde', + 'foreColor': 'Forgrunnsfarge', + 'hiliteColor': 'Bakgrunnsfarge', + 'plainFormatBlock': 'Avsnittsstil', + 'formatBlock': 'Avsnittsstil', + 'fontSize': 'Skriftstørrelse', + 'fontName': 'Skriftnavn', + 'tabIndent': 'Tabulatorinnrykk', + "fullScreen": "Slå på/av full skjerm", + "viewSource": "Vis HTML-kilde", + "print": "Skriv ut", + "newPage": "Ny side", + /* Error messages */ + 'systemShortcut': 'Handlingen "${0}" er bare tilgjengelig i nettleseren ved hjelp av en tastatursnarvei. Bruk ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/nl/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/nl/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..05657e5d0 --- /dev/null +++ b/lib/dijit/_editor/nls/nl/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/nl/FontChoice", ({ + fontSize: "Grootte", + fontName: "Lettertype", + formatBlock: "Opmaak", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursief", + fantasy: "fantasy", + noFormat: "Geen", + p: "Alinea", + h1: "Kop", + h2: "Subkop", + h3: "Sub-subkop", + pre: "Vooraf opgemaakt", + 1: "xx-klein", + 2: "x-klein", + 3: "klein", + 4: "gemiddeld", + 5: "groot", + 6: "x-groot", + 7: "xx-groot" +}) +); diff --git a/lib/dijit/_editor/nls/nl/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/nl/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..63cbfd8a8 --- /dev/null +++ b/lib/dijit/_editor/nls/nl/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/nl/LinkDialog", ({ + createLinkTitle: "Linkeigenschappen", + insertImageTitle: "Afbeeldingseigenschappen", + url: "URL:", + text: "Beschrijving:", + target: "Doel:", + set: "Instellen", + currentWindow: "Huidig venster", + parentWindow: "Hoofdvenster", + topWindow: "Bovenste venster", + newWindow: "Nieuw venster" +}) +); diff --git a/lib/dijit/_editor/nls/nl/commands.js b/lib/dijit/_editor/nls/nl/commands.js index 30564deba..2f368b221 100644 --- a/lib/dijit/_editor/nls/nl/commands.js +++ b/lib/dijit/_editor/nls/nl/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/nl/commands",({"bold":"Vet","copy":"Kopiëren","cut":"Knippen","delete":"Wissen","indent":"Inspringen","insertHorizontalRule":"Horizontale liniaal","insertOrderedList":"Genummerde lijst","insertUnorderedList":"Lijst met opsommingstekens","italic":"Cursief","justifyCenter":"Centreren","justifyFull":"Uitvullen","justifyLeft":"Links uitlijnen","justifyRight":"Rechts uitlijnen","outdent":"Uitspringen","paste":"Plakken","redo":"Opnieuw","removeFormat":"Opmaak verwijderen","selectAll":"Alles selecteren","strikethrough":"Doorhalen","subscript":"Subscript","superscript":"Superscript","underline":"Onderstrepen","undo":"Ongedaan maken","unlink":"Link verwijderen","createLink":"Link maken","toggleDir":"Schrijfrichting wijzigen","insertImage":"Afbeelding invoegen","insertTable":"Tabel invoegen/bewerken","toggleTableBorder":"Tabelkader wijzigen","deleteTable":"Tabel wissen","tableProp":"Tabeleigenschap","htmlToggle":"HTML-bron","foreColor":"Voorgrondkleur","hiliteColor":"Achtergrondkleur","plainFormatBlock":"Alineastijl","formatBlock":"Alineastijl","fontSize":"Lettergrootte","fontName":"Lettertype","tabIndent":"Inspringen","fullScreen":"Volledig scherm in-/uitschakelen","viewSource":"HTML-bron bekijken","print":"Afdrukken","newPage":"Nieuwe pagina","systemShortcut":"De actie \"${0}\" is alleen beschikbaar in uw browser via een sneltoetscombinatie. Gebruik ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/nl/commands",({"bold":"Vet","copy":"Kopiëren","cut":"Knippen","delete":"Wissen","indent":"Inspringen","insertHorizontalRule":"Horizontale liniaal","insertOrderedList":"Genummerde lijst","insertUnorderedList":"Lijst met opsommingstekens","italic":"Cursief","justifyCenter":"Centreren","justifyFull":"Uitvullen","justifyLeft":"Links uitlijnen","justifyRight":"Rechts uitlijnen","outdent":"Uitspringen","paste":"Plakken","redo":"Opnieuw","removeFormat":"Opmaak verwijderen","selectAll":"Alles selecteren","strikethrough":"Doorhalen","subscript":"Subscript","superscript":"Superscript","underline":"Onderstrepen","undo":"Ongedaan maken","unlink":"Link verwijderen","createLink":"Link maken","toggleDir":"Schrijfrichting wijzigen","insertImage":"Afbeelding invoegen","insertTable":"Tabel invoegen/bewerken","toggleTableBorder":"Tabelkader wijzigen","deleteTable":"Tabel wissen","tableProp":"Tabeleigenschap","htmlToggle":"HTML-bron","foreColor":"Voorgrondkleur","hiliteColor":"Achtergrondkleur","plainFormatBlock":"Alineastijl","formatBlock":"Alineastijl","fontSize":"Lettergrootte","fontName":"Lettertype","tabIndent":"Inspringen","fullScreen":"Volledig scherm in-/uitschakelen","viewSource":"HTML-bron bekijken","print":"Afdrukken","newPage":"Nieuwe pagina","systemShortcut":"De actie \"${0}\" is alleen beschikbaar in uw browser via een sneltoetscombinatie. Gebruik ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/nl/commands.js.uncompressed.js b/lib/dijit/_editor/nls/nl/commands.js.uncompressed.js new file mode 100644 index 000000000..588289fad --- /dev/null +++ b/lib/dijit/_editor/nls/nl/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/nl/commands", ({ + 'bold': 'Vet', + 'copy': 'Kopiëren', + 'cut': 'Knippen', + 'delete': 'Wissen', + 'indent': 'Inspringen', + 'insertHorizontalRule': 'Horizontale liniaal', + 'insertOrderedList': 'Genummerde lijst', + 'insertUnorderedList': 'Lijst met opsommingstekens', + 'italic': 'Cursief', + 'justifyCenter': 'Centreren', + 'justifyFull': 'Uitvullen', + 'justifyLeft': 'Links uitlijnen', + 'justifyRight': 'Rechts uitlijnen', + 'outdent': 'Uitspringen', + 'paste': 'Plakken', + 'redo': 'Opnieuw', + 'removeFormat': 'Opmaak verwijderen', + 'selectAll': 'Alles selecteren', + 'strikethrough': 'Doorhalen', + 'subscript': 'Subscript', + 'superscript': 'Superscript', + 'underline': 'Onderstrepen', + 'undo': 'Ongedaan maken', + 'unlink': 'Link verwijderen', + 'createLink': 'Link maken', + 'toggleDir': 'Schrijfrichting wijzigen', + 'insertImage': 'Afbeelding invoegen', + 'insertTable': 'Tabel invoegen/bewerken', + 'toggleTableBorder': 'Tabelkader wijzigen', + 'deleteTable': 'Tabel wissen', + 'tableProp': 'Tabeleigenschap', + 'htmlToggle': 'HTML-bron', + 'foreColor': 'Voorgrondkleur', + 'hiliteColor': 'Achtergrondkleur', + 'plainFormatBlock': 'Alineastijl', + 'formatBlock': 'Alineastijl', + 'fontSize': 'Lettergrootte', + 'fontName': 'Lettertype', + 'tabIndent': 'Inspringen', + "fullScreen": "Volledig scherm in-/uitschakelen", + "viewSource": "HTML-bron bekijken", + "print": "Afdrukken", + "newPage": "Nieuwe pagina", + /* Error messages */ + 'systemShortcut': 'De actie "${0}" is alleen beschikbaar in uw browser via een sneltoetscombinatie. Gebruik ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/pl/FontChoice.js b/lib/dijit/_editor/nls/pl/FontChoice.js index 4255ea21a..e4d6f09ee 100644 --- a/lib/dijit/_editor/nls/pl/FontChoice.js +++ b/lib/dijit/_editor/nls/pl/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/pl/FontChoice",({fontSize:"Wielkość",fontName:"Czcionka",formatBlock:"Format",serif:"szeryfowa","sans-serif":"bezszeryfowa",monospace:"czcionka o stałej szerokości",cursive:"kursywa",fantasy:"fantazyjna",noFormat:"Brak",p:"Akapit",h1:"Nagłówek",h2:"Nagłówek 2-go poziomu",h3:"Nagłówek 3-go poziomu",pre:"Wstępnie sformatowane",1:"najmniejsza",2:"mniejsza",3:"mała",4:"średnia",5:"duża",6:"większa",7:"największa"}));
\ No newline at end of file +define("dijit/_editor/nls/pl/FontChoice",({fontSize:"Rozmiar",fontName:"Czcionka",formatBlock:"Format",serif:"szeryfowa","sans-serif":"bezszeryfowa",monospace:"czcionka o stałej szerokości",cursive:"kursywa",fantasy:"fantazyjna",noFormat:"Brak",p:"Akapit",h1:"Nagłówek",h2:"Nagłówek 2-go poziomu",h3:"Nagłówek 3-go poziomu",pre:"Wstępnie sformatowane",1:"najmniejsza",2:"mniejsza",3:"mała",4:"średnia",5:"duże",6:"większa",7:"największa"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/pl/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/pl/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..d19712073 --- /dev/null +++ b/lib/dijit/_editor/nls/pl/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/pl/FontChoice", ({ + fontSize: "Rozmiar", + fontName: "Czcionka", + formatBlock: "Format", + serif: "szeryfowa", + "sans-serif": "bezszeryfowa", + monospace: "czcionka o stałej szerokości", + cursive: "kursywa", + fantasy: "fantazyjna", + noFormat: "Brak", + p: "Akapit", + h1: "Nagłówek", + h2: "Nagłówek 2-go poziomu", + h3: "Nagłówek 3-go poziomu", + pre: "Wstępnie sformatowane", + 1: "najmniejsza", + 2: "mniejsza", + 3: "mała", + 4: "średnia", + 5: "duże", + 6: "większa", + 7: "największa" +}) +); diff --git a/lib/dijit/_editor/nls/pl/LinkDialog.js b/lib/dijit/_editor/nls/pl/LinkDialog.js index 39efed70c..73f04a4ab 100644 --- a/lib/dijit/_editor/nls/pl/LinkDialog.js +++ b/lib/dijit/_editor/nls/pl/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/pl/LinkDialog",({createLinkTitle:"Właściwości odsyłacza",insertImageTitle:"Właściwości obrazu",url:"Adres URL:",text:"Opis:",target:"Cel:",set:"Ustaw",currentWindow:"Bieżące okno",parentWindow:"Okno macierzyste",topWindow:"Okno najwyższego poziomu",newWindow:"Nowe okno"}));
\ No newline at end of file +define("dijit/_editor/nls/pl/LinkDialog",({createLinkTitle:"Właściwości odsyłacza",insertImageTitle:"Właściwości obrazu",url:"Adres URL:",text:"Opis:",target:"Docelowe:",set:"Ustaw",currentWindow:"Bieżące okno",parentWindow:"Okno macierzyste",topWindow:"Okno najwyższego poziomu",newWindow:"Nowe okno"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/pl/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/pl/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..5ff35a305 --- /dev/null +++ b/lib/dijit/_editor/nls/pl/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/pl/LinkDialog", ({ + createLinkTitle: "Właściwości odsyłacza", + insertImageTitle: "Właściwości obrazu", + url: "Adres URL:", + text: "Opis:", + target: "Docelowe:", + set: "Ustaw", + currentWindow: "Bieżące okno", + parentWindow: "Okno macierzyste", + topWindow: "Okno najwyższego poziomu", + newWindow: "Nowe okno" +}) +); diff --git a/lib/dijit/_editor/nls/pl/commands.js b/lib/dijit/_editor/nls/pl/commands.js index 70b6b1def..76dbf8c07 100644 --- a/lib/dijit/_editor/nls/pl/commands.js +++ b/lib/dijit/_editor/nls/pl/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/pl/commands",({"bold":"Pogrubienie","copy":"Kopiuj","cut":"Wytnij","delete":"Usuń","indent":"Wcięcie","insertHorizontalRule":"Linia pozioma","insertOrderedList":"Lista numerowana","insertUnorderedList":"Lista wypunktowana","italic":"Kursywa","justifyCenter":"Wyrównaj do środka","justifyFull":"Wyrównaj do lewej i prawej","justifyLeft":"Wyrównaj do lewej","justifyRight":"Wyrównaj do prawej","outdent":"Usuń wcięcie","paste":"Wklej","redo":"Ponów","removeFormat":"Usuń formatowanie","selectAll":"Wybierz wszystko","strikethrough":"Przekreślenie","subscript":"Indeks dolny","superscript":"Indeks górny","underline":"Podkreślenie","undo":"Cofnij","unlink":"Usuń odsyłacz","createLink":"Utwórz odsyłacz","toggleDir":"Przełącz kierunek","insertImage":"Wstaw obraz","insertTable":"Wstaw/edytuj tabelę","toggleTableBorder":"Przełącz ramkę tabeli","deleteTable":"Usuń tabelę","tableProp":"Właściwość tabeli","htmlToggle":"Kod źródłowy HTML","foreColor":"Kolor pierwszego planu","hiliteColor":"Kolor tła","plainFormatBlock":"Styl akapitu","formatBlock":"Styl akapitu","fontSize":"Wielkość czcionki","fontName":"Nazwa czcionki","tabIndent":"Wcięcie o tabulator","fullScreen":"Przełącz pełny ekran","viewSource":"Wyświetl kod źródłowy HTML","print":"Drukuj","newPage":"Nowa strona","systemShortcut":"Działanie ${0} jest dostępne w tej przeglądarce wyłącznie przy użyciu skrótu klawiaturowego. Należy użyć klawiszy ${1}.","ctrlKey":"Ctrl+${0}"}));
\ No newline at end of file +define("dijit/_editor/nls/pl/commands",({"bold":"Pogrubienie","copy":"Kopiuj","cut":"Wytnij","delete":"Usuń","indent":"Wcięcie","insertHorizontalRule":"Linijka pozioma","insertOrderedList":"Lista numerowana","insertUnorderedList":"Lista wypunktowana","italic":"Kursywa","justifyCenter":"Wyśrodkowanie","justifyFull":"Wyrównaj do lewej i prawej","justifyLeft":"Wyrównanie do lewej","justifyRight":"Wyrównanie do prawej","outdent":"Usuwanie wcięcia","paste":"Wklej","redo":"Ponów","removeFormat":"Usuń formatowanie","selectAll":"Zaznacz wszystko","strikethrough":"Przekreślenie","subscript":"Indeks dolny","superscript":"Indeks górny","underline":"Podkreślenie","undo":"Cofnij","unlink":"Usuń odsyłacz","createLink":"Utwórz odsyłacz","toggleDir":"Przełącz kierunek","insertImage":"Wstaw obraz","insertTable":"Wstaw/edytuj tabelę","toggleTableBorder":"Przełącz ramkę tabeli","deleteTable":"Usuń tabelę","tableProp":"Właściwość tabeli","htmlToggle":"Źródło HTML","foreColor":"Kolor pierwszego planu","hiliteColor":"Kolor tła","plainFormatBlock":"Styl akapitu","formatBlock":"Styl akapitu","fontSize":"Rozmiar czcionki","fontName":"Nazwa czcionki","tabIndent":"Wcięcie o tabulator","fullScreen":"Przełącz pełny ekran","viewSource":"Wyświetl kod źródłowy HTML","print":"Drukuj","newPage":"Nowa strona","systemShortcut":"Działanie ${0} jest dostępne w tej przeglądarce wyłącznie przy użyciu skrótu klawiaturowego. Należy użyć klawiszy ${1}.","ctrlKey":"Ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/pl/commands.js.uncompressed.js b/lib/dijit/_editor/nls/pl/commands.js.uncompressed.js new file mode 100644 index 000000000..e84a7aa60 --- /dev/null +++ b/lib/dijit/_editor/nls/pl/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/pl/commands", ({ + 'bold': 'Pogrubienie', + 'copy': 'Kopiuj', + 'cut': 'Wytnij', + 'delete': 'Usuń', + 'indent': 'Wcięcie', + 'insertHorizontalRule': 'Linijka pozioma', + 'insertOrderedList': 'Lista numerowana', + 'insertUnorderedList': 'Lista wypunktowana', + 'italic': 'Kursywa', + 'justifyCenter': 'Wyśrodkowanie', + 'justifyFull': 'Wyrównaj do lewej i prawej', + 'justifyLeft': 'Wyrównanie do lewej', + 'justifyRight': 'Wyrównanie do prawej', + 'outdent': 'Usuwanie wcięcia', + 'paste': 'Wklej', + 'redo': 'Ponów', + 'removeFormat': 'Usuń formatowanie', + 'selectAll': 'Zaznacz wszystko', + 'strikethrough': 'Przekreślenie', + 'subscript': 'Indeks dolny', + 'superscript': 'Indeks górny', + 'underline': 'Podkreślenie', + 'undo': 'Cofnij', + 'unlink': 'Usuń odsyłacz', + 'createLink': 'Utwórz odsyłacz', + 'toggleDir': 'Przełącz kierunek', + 'insertImage': 'Wstaw obraz', + 'insertTable': 'Wstaw/edytuj tabelę', + 'toggleTableBorder': 'Przełącz ramkę tabeli', + 'deleteTable': 'Usuń tabelę', + 'tableProp': 'Właściwość tabeli', + 'htmlToggle': 'Źródło HTML', + 'foreColor': 'Kolor pierwszego planu', + 'hiliteColor': 'Kolor tła', + 'plainFormatBlock': 'Styl akapitu', + 'formatBlock': 'Styl akapitu', + 'fontSize': 'Rozmiar czcionki', + 'fontName': 'Nazwa czcionki', + 'tabIndent': 'Wcięcie o tabulator', + "fullScreen": "Przełącz pełny ekran", + "viewSource": "Wyświetl kod źródłowy HTML", + "print": "Drukuj", + "newPage": "Nowa strona", + /* Error messages */ + 'systemShortcut': 'Działanie ${0} jest dostępne w tej przeglądarce wyłącznie przy użyciu skrótu klawiaturowego. Należy użyć klawiszy ${1}.', + 'ctrlKey':'Ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/pt-pt/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/pt-pt/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..b06f43f23 --- /dev/null +++ b/lib/dijit/_editor/nls/pt-pt/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/pt-pt/FontChoice", ({ + fontSize: "Tamanho", + fontName: "Tipo de letra", + formatBlock: "Formato", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Nenhum", + p: "Parágrafo", + h1: "Título", + h2: "Sub-título", + h3: "Sub-subtítulo", + pre: "Pré-formatado", + 1: "xxs", + 2: "xs", + 3: "small", + 4: "medium", + 5: "large", + 6: "xl", + 7: "xxl" +}) +); diff --git a/lib/dijit/_editor/nls/pt-pt/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/pt-pt/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..ff0409226 --- /dev/null +++ b/lib/dijit/_editor/nls/pt-pt/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/pt-pt/LinkDialog", ({ + createLinkTitle: "Propriedades da ligação", + insertImageTitle: "Propriedades da imagem", + url: "URL:", + text: "Descrição:", + target: "Destino:", + set: "Definir", + currentWindow: "Janela actual", + parentWindow: "Janela ascendente", + topWindow: "Janela superior", + newWindow: "Nova janela" +}) +); diff --git a/lib/dijit/_editor/nls/pt-pt/commands.js.uncompressed.js b/lib/dijit/_editor/nls/pt-pt/commands.js.uncompressed.js new file mode 100644 index 000000000..18cc55828 --- /dev/null +++ b/lib/dijit/_editor/nls/pt-pt/commands.js.uncompressed.js @@ -0,0 +1,49 @@ +define( +"dijit/_editor/nls/pt-pt/commands", ({ + 'bold': 'Negrito', + 'copy': 'Copiar', + 'cut': 'Cortar', + 'delete': 'Eliminar', + 'indent': 'Indentar', + 'insertHorizontalRule': 'Régua horizontal', + 'insertOrderedList': 'Lista numerada', + 'insertUnorderedList': 'Lista marcada', + 'italic': 'Itálico', + 'justifyCenter': 'Alinhar ao centro', + 'justifyFull': 'Justificar', + 'justifyLeft': 'Alinhar à esquerda', + 'justifyRight': 'Alinhar à direita', + 'outdent': 'Recuar', + 'paste': 'Colar', + 'redo': 'Repetir', + 'removeFormat': 'Remover formato', + 'selectAll': 'Seleccionar tudo', + 'strikethrough': 'Rasurado', + 'subscript': 'Inferior à linha', + 'superscript': 'Superior à linha', + 'underline': 'Sublinhado', + 'undo': 'Anular', + 'unlink': 'Remover ligação', + 'createLink': 'Criar ligação', + 'toggleDir': 'Alternar direcção', + 'insertImage': 'Inserir imagem', + 'insertTable': 'Inserir/Editar tabela', + 'toggleTableBorder': 'Alternar contorno da tabela', + 'deleteTable': 'Eliminar tabela', + 'tableProp': 'Propriedades da tabela', + 'htmlToggle': 'Código-fonte de HTML', + 'foreColor': 'Cor de primeiro plano', + 'hiliteColor': 'Cor de segundo plano', + 'plainFormatBlock': 'Estilo de parágrafo', + 'formatBlock': 'Estilo de parágrafo', + 'fontSize': 'Tamanho do tipo de letra', + 'fontName': 'Nome do tipo de letra', + 'tabIndent': 'Indentar com a tecla Tab', + "fullScreen": "Alternar ecrã completo", + "viewSource": "Ver origem HTML", + "print": "Imprimir", + "newPage": "Nova página", + /* Error messages */ + 'systemShortcut': 'A acção "${0}" apenas está disponível no navegador utilizando um atalho de teclado. Utilize ${1}.' +}) +); diff --git a/lib/dijit/_editor/nls/pt/FontChoice.js b/lib/dijit/_editor/nls/pt/FontChoice.js index 57c44c79c..6ddeb434c 100644 --- a/lib/dijit/_editor/nls/pt/FontChoice.js +++ b/lib/dijit/_editor/nls/pt/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/pt/FontChoice",({fontSize:"Tamanho",fontName:"Fonte",formatBlock:"Formatar",serif:"serif","sans-serif":"sans-serif",monospace:"espaço simples",cursive:"cursiva",fantasy:"fantasy",noFormat:"Nenhuma",p:"Parágrafo",h1:"Título",h2:"Subtítulo",h3:"Sub-subtítulo",pre:"Pré-formatado",1:"extra-extra-pequeno",2:"extra-pequeno",3:"pequena",4:"médio",5:"grande",6:"extra-grande",7:"extra-extra-grande"}));
\ No newline at end of file +define("dijit/_editor/nls/pt/FontChoice",({fontSize:"Tamanho",fontName:"Fonte",formatBlock:"Formatar",serif:"serif","sans-serif":"sans-serif",monospace:"espaço simples",cursive:"cursiva",fantasy:"fantasy",noFormat:"Nenhum",p:"Parágrafo",h1:"Título",h2:"Subtítulo",h3:"Sub-subtítulo",pre:"Pré-formatado",1:"extra-extra-pequeno",2:"extra-pequeno",3:"pequena",4:"médio",5:"grande",6:"extra-grande",7:"extra-extra-grande"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/pt/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/pt/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..a5e4cfca6 --- /dev/null +++ b/lib/dijit/_editor/nls/pt/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/pt/FontChoice", ({ + fontSize: "Tamanho", + fontName: "Fonte", + formatBlock: "Formatar", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "espaço simples", + cursive: "cursiva", + fantasy: "fantasy", + noFormat: "Nenhum", + p: "Parágrafo", + h1: "Título", + h2: "Subtítulo", + h3: "Sub-subtítulo", + pre: "Pré-formatado", + 1: "extra-extra-pequeno", + 2: "extra-pequeno", + 3: "pequena", + 4: "médio", + 5: "grande", + 6: "extra-grande", + 7: "extra-extra-grande" +}) +); diff --git a/lib/dijit/_editor/nls/pt/LinkDialog.js b/lib/dijit/_editor/nls/pt/LinkDialog.js index 8d03b5561..c69e75880 100644 --- a/lib/dijit/_editor/nls/pt/LinkDialog.js +++ b/lib/dijit/_editor/nls/pt/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/pt/LinkDialog",({createLinkTitle:"Propriedades de Link",insertImageTitle:"Propriedades de Imagem",url:"URL:",text:"Descrição:",target:"Destino:",set:"Definir",currentWindow:"Janela Atual",parentWindow:"Janela Pai",topWindow:"Primeira Janela",newWindow:"Nova Janela"}));
\ No newline at end of file +define("dijit/_editor/nls/pt/LinkDialog",({createLinkTitle:"Propriedades de Link",insertImageTitle:"Propriedades de Imagem",url:"URL:",text:"Descrição:",target:"Destino:",set:"Configurar",currentWindow:"Janela Atual",parentWindow:"Janela Pai",topWindow:"Primeira Janela",newWindow:"Nova Janela"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/pt/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/pt/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..d9b29633c --- /dev/null +++ b/lib/dijit/_editor/nls/pt/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/pt/LinkDialog", ({ + createLinkTitle: "Propriedades de Link", + insertImageTitle: "Propriedades de Imagem", + url: "URL:", + text: "Descrição:", + target: "Destino:", + set: "Configurar", + currentWindow: "Janela Atual", + parentWindow: "Janela Pai", + topWindow: "Primeira Janela", + newWindow: "Nova Janela" +}) +); diff --git a/lib/dijit/_editor/nls/pt/commands.js b/lib/dijit/_editor/nls/pt/commands.js index 35c6142ca..aaec7f3c8 100644 --- a/lib/dijit/_editor/nls/pt/commands.js +++ b/lib/dijit/_editor/nls/pt/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/pt/commands",({"bold":"Negrito","copy":"Copiar","cut":"Recortar","delete":"Excluir","indent":"Recuar","insertHorizontalRule":"Régua Horizontal","insertOrderedList":"Lista Numerada","insertUnorderedList":"Lista com Marcadores","italic":"Itálico","justifyCenter":"Alinhar pelo Centro","justifyFull":"Justificar","justifyLeft":"Alinhar à Esquerda","justifyRight":"Alinhar à Direita","outdent":"Não chanfrado","paste":"Colar","redo":"Refazer","removeFormat":"Remover Formato","selectAll":"Selecionar Todos","strikethrough":"Tachado","subscript":"Subscrito","superscript":"Sobrescrito","underline":"Sublinhado","undo":"Desfazer","unlink":"Remover Link","createLink":"Criar Link","toggleDir":"Comutar Direção","insertImage":"Inserir Imagem","insertTable":"Inserir/Editar Tabela","toggleTableBorder":"Alternar Moldura da Tabela","deleteTable":"Excluir Tabela","tableProp":"Propriedade da Tabela","htmlToggle":"Origem HTML","foreColor":"Cor do Primeiro Plano","hiliteColor":"Cor do Segundo Plano","plainFormatBlock":"Estilo de Parágrafo","formatBlock":"Estilo de Parágrafo","fontSize":"Tamanho da Fonte","fontName":"Nome da Fonte","tabIndent":"Recuo de Guia","fullScreen":"Comutar Tela Cheia","viewSource":"Visualizar Origem HTML","print":"Imprimir","newPage":"Nova Página","systemShortcut":"A ação \"${0}\" está disponível em seu navegador apenas usando um atalho de teclado. Use ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/pt/commands",({"bold":"Negrito","copy":"Copiar","cut":"Recortar","delete":"Excluir","indent":"Recuar","insertHorizontalRule":"Régua Horizontal","insertOrderedList":"Lista Numerada","insertUnorderedList":"Lista com Marcadores","italic":"Itálico","justifyCenter":"Alinhar pelo Centro","justifyFull":"Justificar","justifyLeft":"Alinhar à Esquerda","justifyRight":"Alinhar à Direita","outdent":"Não chanfrado","paste":"Colar","redo":"Refazer","removeFormat":"Remover Formato","selectAll":"Selecionar Tudo","strikethrough":"Tachado","subscript":"Subscrito","superscript":"Sobrescrito","underline":"Sublinhado","undo":"Desfazer","unlink":"Remover Link","createLink":"Criar Link","toggleDir":"Comutar Direção","insertImage":"Inserir imagem","insertTable":"Inserir/Editar Tabela","toggleTableBorder":"Alternar Moldura da Tabela","deleteTable":"Excluir Tabela","tableProp":"Propriedade da Tabela","htmlToggle":"Origem HTML","foreColor":"Cor do Primeiro Plano","hiliteColor":"Cor do Segundo Plano","plainFormatBlock":"Estilo de Parágrafo","formatBlock":"Estilo de Parágrafo","fontSize":"Tamanho da Fonte","fontName":"Nome da Fonte","tabIndent":"Recuo de Guia","fullScreen":"Comutar Tela Cheia","viewSource":"Visualizar Origem HTML","print":"Imprimir","newPage":"Nova Página","systemShortcut":"A ação \"${0}\" está disponível em seu navegador apenas usando um atalho de teclado. Use ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/pt/commands.js.uncompressed.js b/lib/dijit/_editor/nls/pt/commands.js.uncompressed.js new file mode 100644 index 000000000..55b380684 --- /dev/null +++ b/lib/dijit/_editor/nls/pt/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/pt/commands", ({ + 'bold': 'Negrito', + 'copy': 'Copiar', + 'cut': 'Recortar', + 'delete': 'Excluir', + 'indent': 'Recuar', + 'insertHorizontalRule': 'Régua Horizontal', + 'insertOrderedList': 'Lista Numerada', + 'insertUnorderedList': 'Lista com Marcadores', + 'italic': 'Itálico', + 'justifyCenter': 'Alinhar pelo Centro', + 'justifyFull': 'Justificar', + 'justifyLeft': 'Alinhar à Esquerda', + 'justifyRight': 'Alinhar à Direita', + 'outdent': 'Não chanfrado', + 'paste': 'Colar', + 'redo': 'Refazer', + 'removeFormat': 'Remover Formato', + 'selectAll': 'Selecionar Tudo', + 'strikethrough': 'Tachado', + 'subscript': 'Subscrito', + 'superscript': 'Sobrescrito', + 'underline': 'Sublinhado', + 'undo': 'Desfazer', + 'unlink': 'Remover Link', + 'createLink': 'Criar Link', + 'toggleDir': 'Comutar Direção', + 'insertImage': 'Inserir imagem', + 'insertTable': 'Inserir/Editar Tabela', + 'toggleTableBorder': 'Alternar Moldura da Tabela', + 'deleteTable': 'Excluir Tabela', + 'tableProp': 'Propriedade da Tabela', + 'htmlToggle': 'Origem HTML', + 'foreColor': 'Cor do Primeiro Plano', + 'hiliteColor': 'Cor do Segundo Plano', + 'plainFormatBlock': 'Estilo de Parágrafo', + 'formatBlock': 'Estilo de Parágrafo', + 'fontSize': 'Tamanho da Fonte', + 'fontName': 'Nome da Fonte', + 'tabIndent': 'Recuo de Guia', + "fullScreen": "Comutar Tela Cheia", + "viewSource": "Visualizar Origem HTML", + "print": "Imprimir", + "newPage": "Nova Página", + /* Error messages */ + 'systemShortcut': 'A ação "${0}" está disponível em seu navegador apenas usando um atalho de teclado. Use ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/ro/FontChoice.js b/lib/dijit/_editor/nls/ro/FontChoice.js index a65bf8319..d254655f0 100644 --- a/lib/dijit/_editor/nls/ro/FontChoice.js +++ b/lib/dijit/_editor/nls/ro/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ro/FontChoice",({fontSize:"Dimensiune",fontName:"Font",formatBlock:"Format",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"Fără",p:"Paragraf",h1:"Titlu",h2:"Subtitlu",h3:"Sub-subtitlu",pre:"Preformatat",1:"xxs (xx-small)",2:"xs (x-small)",3:"s (small)",4:"m (medium)",5:"l (large)",6:"xl (x-large)",7:"xxl (xx-large)"}));
\ No newline at end of file +define("dijit/_editor/nls/ro/FontChoice",({fontSize:"Mărime",fontName:"Font",formatBlock:"Format",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"Nimic",p:"Paragraf",h1:"Titlu",h2:"Subtitlu",h3:"Sub-subtitlu",pre:"Preformatat",1:"xxs (xx-small)",2:"xs (x-small)",3:"s (small)",4:"m (medium)",5:"l (large)",6:"xl (x-large)",7:"xxl (xx-large)"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ro/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/ro/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..9dd383953 --- /dev/null +++ b/lib/dijit/_editor/nls/ro/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/ro/FontChoice", ({ + fontSize: "Mărime", + fontName: "Font", + formatBlock: "Format", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Nimic", + p: "Paragraf", + h1: "Titlu", + h2: "Subtitlu", + h3: "Sub-subtitlu", + pre: "Preformatat", + 1: "xxs (xx-small)", + 2: "xs (x-small)", + 3: "s (small)", + 4: "m (medium)", + 5: "l (large)", + 6: "xl (x-large)", + 7: "xxl (xx-large)" +}) +); diff --git a/lib/dijit/_editor/nls/ro/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/ro/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..9be4db081 --- /dev/null +++ b/lib/dijit/_editor/nls/ro/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/ro/LinkDialog", ({ + createLinkTitle: "Proprietăţi legătură", + insertImageTitle: "Proprietăţi imagine", + url: "URL:", + text: "Descriere:", + target: "Destinaţie:", + set: "Setare", + currentWindow: "Fereastra curentă", + parentWindow: "Fereastra părinte", + topWindow: "Fereastra cea mai de sus", + newWindow: "Fereastra nouă" +}) +); diff --git a/lib/dijit/_editor/nls/ro/commands.js b/lib/dijit/_editor/nls/ro/commands.js index dcbf9d3a9..8ba66adff 100644 --- a/lib/dijit/_editor/nls/ro/commands.js +++ b/lib/dijit/_editor/nls/ro/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ro/commands",({"bold":"Aldin","copy":"Copiere","cut":"Tăiere","delete":"Ştergere","indent":"Micşorare indent","insertHorizontalRule":"Linie delimitatoare","insertOrderedList":"Listă numerotată","insertUnorderedList":"Listă cu marcator","italic":"Cursiv","justifyCenter":"Aliniere centru","justifyFull":"Aliniere stânga-dreapta","justifyLeft":"Aliniere stânga","justifyRight":"Aliniere dreapta","outdent":"Mărire indent","paste":"Lipire","redo":"Refacere acţiune","removeFormat":"Înlăturare format","selectAll":"Selectează tot","strikethrough":"Tăiere text cu o linie","subscript":"Scriere indice inferior","superscript":"Scriere indice superior","underline":"Subliniere","undo":"Anulare acţiune","unlink":"Înlăturare legătură","createLink":"Creare legătură","toggleDir":"Comutare direcţie","insertImage":"Inserare imagine","insertTable":"Inserare/Editare tabelă","toggleTableBorder":"Comutare bordură tabelă","deleteTable":"Ştergere tabelă","tableProp":"Proprietate tabelă","htmlToggle":"Sursă HTML","foreColor":"Culoare de prim-plan","hiliteColor":"Culoare de fundal","plainFormatBlock":"Stil paragraf","formatBlock":"Stil paragraf","fontSize":"Dimensiune font","fontName":"Nume font","tabIndent":"Indentare Tab","fullScreen":"Comutare ecran complet","viewSource":"Vizualizara sursă HTML","print":"Tipărire","newPage":"Pagină nouă","systemShortcut":"Acţiunea \"${0}\" este disponibilă în browser doar utilizând o comandă rapidă de la tastatură. Utilizaţi ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/ro/commands",({"bold":"Aldin","copy":"Copiere","cut":"Tăiere","delete":"Ştergere","indent":"Micşorare indent","insertHorizontalRule":"Linie delimitatoare","insertOrderedList":"Listă numerotată","insertUnorderedList":"Listă cu marcator","italic":"Cursiv","justifyCenter":"Aliniere centru","justifyFull":"Aliniere stânga-dreapta","justifyLeft":"Aliniere stânga","justifyRight":"Aliniere dreapta","outdent":"Mărire indent","paste":"Lipire","redo":"Refacere acţiune","removeFormat":"Înlăturare format","selectAll":"Selectează tot","strikethrough":"Tăiere text cu o linie","subscript":"Scriere indice inferior","superscript":"Scriere indice superior","underline":"Subliniere","undo":"Anulare acţiune","unlink":"Înlăturare legătură","createLink":"Creare legătură","toggleDir":"Comutare direcţie","insertImage":"Inserare imagine","insertTable":"Inserare/Editare tabelă","toggleTableBorder":"Comutare bordură tabelă","deleteTable":"Ştergere tabelă","tableProp":"Proprietate tabelă","htmlToggle":"Sursă HTML","foreColor":"Culoare de prim-plan","hiliteColor":"Culoare de fundal","plainFormatBlock":"Stil paragraf","formatBlock":"Stil paragraf","fontSize":"Dimensiune font","fontName":"Nume font","tabIndent":"Indentare Tab","fullScreen":"Comutare ecran complet","viewSource":"Vizualizara sursă HTML","print":"Tipărire","newPage":"Pagină nouă","systemShortcut":"Acţiunea \"${0}\" este disponibilă în browser doar utilizând o comandă rapidă de la tastatură. Utilizaţi ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ro/commands.js.uncompressed.js b/lib/dijit/_editor/nls/ro/commands.js.uncompressed.js new file mode 100644 index 000000000..565e2c3ec --- /dev/null +++ b/lib/dijit/_editor/nls/ro/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/ro/commands", ({ + 'bold': 'Aldin', + 'copy': 'Copiere', + 'cut': 'Tăiere', + 'delete': 'Ştergere', + 'indent': 'Micşorare indent', + 'insertHorizontalRule': 'Linie delimitatoare', + 'insertOrderedList': 'Listă numerotată', + 'insertUnorderedList': 'Listă cu marcator', + 'italic': 'Cursiv', + 'justifyCenter': 'Aliniere centru', + 'justifyFull': 'Aliniere stânga-dreapta', + 'justifyLeft': 'Aliniere stânga', + 'justifyRight': 'Aliniere dreapta', + 'outdent': 'Mărire indent', + 'paste': 'Lipire', + 'redo': 'Refacere acţiune', + 'removeFormat': 'Înlăturare format', + 'selectAll': 'Selectează tot', + 'strikethrough': 'Tăiere text cu o linie', + 'subscript': 'Scriere indice inferior', + 'superscript': 'Scriere indice superior', + 'underline': 'Subliniere', + 'undo': 'Anulare acţiune', + 'unlink': 'Înlăturare legătură', + 'createLink': 'Creare legătură', + 'toggleDir': 'Comutare direcţie', + 'insertImage': 'Inserare imagine', + 'insertTable': 'Inserare/Editare tabelă', + 'toggleTableBorder': 'Comutare bordură tabelă', + 'deleteTable': 'Ştergere tabelă', + 'tableProp': 'Proprietate tabelă', + 'htmlToggle': 'Sursă HTML', + 'foreColor': 'Culoare de prim-plan', + 'hiliteColor': 'Culoare de fundal', + 'plainFormatBlock': 'Stil paragraf', + 'formatBlock': 'Stil paragraf', + 'fontSize': 'Dimensiune font', + 'fontName': 'Nume font', + 'tabIndent': 'Indentare Tab', + "fullScreen": "Comutare ecran complet", + "viewSource": "Vizualizara sursă HTML", + "print": "Tipărire", + "newPage": "Pagină nouă", + /* Error messages */ + 'systemShortcut': 'Acţiunea "${0}" este disponibilă în browser doar utilizând o comandă rapidă de la tastatură. Utilizaţi ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/ru/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/ru/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..34b0396ba --- /dev/null +++ b/lib/dijit/_editor/nls/ru/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/ru/FontChoice", ({ + fontSize: "Размер", + fontName: "Шрифт", + formatBlock: "Формат", + serif: "с засечками", + "sans-serif": "без засечек", + monospace: "непропорциональный", + cursive: "курсив", + fantasy: "артистический", + noFormat: "Нет", + p: "Абзац", + h1: "Заголовок", + h2: "Подзаголовок", + h3: "Вложенный подзаголовок", + pre: "Заранее отформатированный", + 1: "самый маленький", + 2: "очень маленький", + 3: "маленький", + 4: "средний", + 5: "большой", + 6: "очень большой", + 7: "самый большой" +}) +); diff --git a/lib/dijit/_editor/nls/ru/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/ru/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..19b5f75f8 --- /dev/null +++ b/lib/dijit/_editor/nls/ru/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/ru/LinkDialog", ({ + createLinkTitle: "Свойства ссылки", + insertImageTitle: "Свойства изображения", + url: "URL:", + text: "Описание:", + target: "Целевой объект:", + set: "Задать", + currentWindow: "Текущее окно", + parentWindow: "Родительское окно", + topWindow: "Верхнее окно", + newWindow: "Новое окно" +}) +); diff --git a/lib/dijit/_editor/nls/ru/commands.js b/lib/dijit/_editor/nls/ru/commands.js index 6a6a5099a..5e463334e 100644 --- a/lib/dijit/_editor/nls/ru/commands.js +++ b/lib/dijit/_editor/nls/ru/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/ru/commands",({"bold":"Полужирный","copy":"Копировать","cut":"Вырезать","delete":"Удалить","indent":"Отступ","insertHorizontalRule":"Горизонтальная линейка","insertOrderedList":"Нумерованный список","insertUnorderedList":"Список с маркерами","italic":"Курсив","justifyCenter":"По центру","justifyFull":"По ширине","justifyLeft":"По левому краю","justifyRight":"По правому краю","outdent":"Втяжка","paste":"Вставить","redo":"Повторить","removeFormat":"Удалить формат","selectAll":"Выбрать все","strikethrough":"Перечеркивание","subscript":"Нижний индекс","superscript":"Верхний индекс","underline":"Подчеркивание","undo":"Отменить","unlink":"Удалить ссылку","createLink":"Создать ссылку","toggleDir":"Изменить направление","insertImage":"Вставить изображение","insertTable":"Вставить/изменить таблицу","toggleTableBorder":"Переключить рамку таблицы","deleteTable":"Удалить таблицу","tableProp":"Свойства таблицы","htmlToggle":"Код HTML","foreColor":"Цвет текста","hiliteColor":"Цвет фона","plainFormatBlock":"Стиль абзаца","formatBlock":"Стиль абзаца","fontSize":"Размер шрифта","fontName":"Название шрифта","tabIndent":"Табуляция","fullScreen":"Переключить полноэкранный режим","viewSource":"Показать исходный код HTML","print":"Печать","newPage":"Создать страницу","systemShortcut":"Действие \"${0}\" можно выполнить в браузере только путем нажатия клавиш ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/ru/commands",({"bold":"Полужирный","copy":"Копировать","cut":"Вырезать","delete":"Удалить","indent":"Отступ","insertHorizontalRule":"Горизонтальная линейка","insertOrderedList":"Нумерованный список","insertUnorderedList":"Список с маркерами","italic":"Курсив","justifyCenter":"По центру","justifyFull":"По ширине","justifyLeft":"По левому краю","justifyRight":"По правому краю","outdent":"Втяжка","paste":"Вставить","redo":"Повторить","removeFormat":"Удалить формат","selectAll":"Выбрать все","strikethrough":"Перечеркивание","subscript":"Нижний индекс","superscript":"Верхний индекс","underline":"Подчеркивание","undo":"Отменить","unlink":"Удалить ссылку","createLink":"Создать ссылку","toggleDir":"Изменить направление","insertImage":"Вставить изображение","insertTable":"Вставить/изменить таблицу","toggleTableBorder":"Переключить рамку таблицы","deleteTable":"Удалить таблицу","tableProp":"Свойства таблицы","htmlToggle":"Код HTML","foreColor":"Цвет текста","hiliteColor":"Цвет фона","plainFormatBlock":"Стиль абзаца","formatBlock":"Стиль абзаца","fontSize":"Размер шрифта","fontName":"Название шрифта","tabIndent":"Табуляция","fullScreen":"Переключить полноэкранный режим","viewSource":"Показать исходный код HTML","print":"Печать","newPage":"Создать страницу","systemShortcut":"Действие \"${0}\" можно выполнить в браузере только путем нажатия клавиш ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/ru/commands.js.uncompressed.js b/lib/dijit/_editor/nls/ru/commands.js.uncompressed.js new file mode 100644 index 000000000..8bfe3568e --- /dev/null +++ b/lib/dijit/_editor/nls/ru/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/ru/commands", ({ + 'bold': 'Полужирный', + 'copy': 'Копировать', + 'cut': 'Вырезать', + 'delete': 'Удалить', + 'indent': 'Отступ', + 'insertHorizontalRule': 'Горизонтальная линейка', + 'insertOrderedList': 'Нумерованный список', + 'insertUnorderedList': 'Список с маркерами', + 'italic': 'Курсив', + 'justifyCenter': 'По центру', + 'justifyFull': 'По ширине', + 'justifyLeft': 'По левому краю', + 'justifyRight': 'По правому краю', + 'outdent': 'Втяжка', + 'paste': 'Вставить', + 'redo': 'Повторить', + 'removeFormat': 'Удалить формат', + 'selectAll': 'Выбрать все', + 'strikethrough': 'Перечеркивание', + 'subscript': 'Нижний индекс', + 'superscript': 'Верхний индекс', + 'underline': 'Подчеркивание', + 'undo': 'Отменить', + 'unlink': 'Удалить ссылку', + 'createLink': 'Создать ссылку', + 'toggleDir': 'Изменить направление', + 'insertImage': 'Вставить изображение', + 'insertTable': 'Вставить/изменить таблицу', + 'toggleTableBorder': 'Переключить рамку таблицы', + 'deleteTable': 'Удалить таблицу', + 'tableProp': 'Свойства таблицы', + 'htmlToggle': 'Код HTML', + 'foreColor': 'Цвет текста', + 'hiliteColor': 'Цвет фона', + 'plainFormatBlock': 'Стиль абзаца', + 'formatBlock': 'Стиль абзаца', + 'fontSize': 'Размер шрифта', + 'fontName': 'Название шрифта', + 'tabIndent': 'Табуляция', + "fullScreen": "Переключить полноэкранный режим", + "viewSource": "Показать исходный код HTML", + "print": "Печать", + "newPage": "Создать страницу", + /* Error messages */ + 'systemShortcut': 'Действие "${0}" можно выполнить в браузере только путем нажатия клавиш ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/sk/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/sk/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..fbc1d786c --- /dev/null +++ b/lib/dijit/_editor/nls/sk/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/sk/FontChoice", ({ + fontSize: "Veľkosť", + fontName: "Písmo", + formatBlock: "Formát", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Žiadny", + p: "Odsek", + h1: "Hlavička", + h2: "Podhlavička", + h3: "Pod-podhlavička", + pre: "Predformátované", + 1: "xx-small", + 2: "x-small", + 3: "small", + 4: "medium", + 5: "large", + 6: "x-large", + 7: "xx-large" +}) +); diff --git a/lib/dijit/_editor/nls/sk/LinkDialog.js b/lib/dijit/_editor/nls/sk/LinkDialog.js index 1251d38e7..ff02838ed 100644 --- a/lib/dijit/_editor/nls/sk/LinkDialog.js +++ b/lib/dijit/_editor/nls/sk/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/sk/LinkDialog",({createLinkTitle:"Pripojiť vlastnosti",insertImageTitle:"Vlastnosti obrázka ",url:"URL:",text:"Opis:",target:"Cieľ:",set:"Nastaviť",currentWindow:"Aktuálne okno ",parentWindow:"Rodičovské okno ",topWindow:"Najvrchnejšie okno ",newWindow:"Nové okno "}));
\ No newline at end of file +define("dijit/_editor/nls/sk/LinkDialog",({createLinkTitle:"Vlastnosti prepojenia",insertImageTitle:"Vlastnosti obrázka",url:"Adresa URL:",text:"Opis:",target:"Cieľ:",set:"Nastaviť",currentWindow:"Aktuálne okno",parentWindow:"Rodičovské okno",topWindow:"Najvyššie okno",newWindow:"Nové okno"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/sk/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/sk/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..68b9ce3ac --- /dev/null +++ b/lib/dijit/_editor/nls/sk/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/sk/LinkDialog", ({ + createLinkTitle: "Vlastnosti prepojenia", + insertImageTitle: "Vlastnosti obrázka", + url: "Adresa URL:", + text: "Opis:", + target: "Cieľ:", + set: "Nastaviť", + currentWindow: "Aktuálne okno", + parentWindow: "Rodičovské okno", + topWindow: "Najvyššie okno", + newWindow: "Nové okno" +}) +); diff --git a/lib/dijit/_editor/nls/sk/commands.js b/lib/dijit/_editor/nls/sk/commands.js index 1ba3b24c6..272d47e71 100644 --- a/lib/dijit/_editor/nls/sk/commands.js +++ b/lib/dijit/_editor/nls/sk/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/sk/commands",({"bold":"Tučné písmo","copy":"Kopírovať","cut":"Vystrihnúť","delete":"Vymazať","indent":"Odsadiť","insertHorizontalRule":"Horizontálna čiara","insertOrderedList":"Číslovaný zoznam","insertUnorderedList":"Zoznam s odrážkami","italic":"Kurzíva","justifyCenter":"Zarovnať na stred","justifyFull":"Zarovnať podľa okraja","justifyLeft":"Zarovnať doľava","justifyRight":"Zarovnať doprava","outdent":"Predsadiť","paste":"Nalepiť","redo":"Znova vykonať","removeFormat":"Odstrániť formát","selectAll":"Vybrať všetko","strikethrough":"Prečiarknuť","subscript":"Dolný index","superscript":"Horný index","underline":"Podčiarknuť","undo":"Vrátiť späť","unlink":"Odstrániť prepojenie","createLink":"Vytvoriť prepojenie","toggleDir":"Prepnúť smer","insertImage":"Vložiť obrázok","insertTable":"Vložiť/upraviť tabuľku","toggleTableBorder":"Prepnúť rámček tabuľky","deleteTable":"Vymazať tabuľku","tableProp":"Vlastnosť tabuľky","htmlToggle":"Zdroj HTML","foreColor":"Farba popredia","hiliteColor":"Farba pozadia","plainFormatBlock":"Štýl odseku","formatBlock":"Štýl odseku","fontSize":"Veľkosť písma","fontName":"Názov písma","tabIndent":"Odsadenie tabulátora","fullScreen":"Zobraziť na celú obrazovku","viewSource":"Zobraziť zdrojový kód HTML ","print":"Tlačiť","newPage":"Nová stránka ","systemShortcut":"Akcia \"${0}\" je vo vašom prehliadači dostupná len s použitím klávesovej skratky. Použite ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/sk/commands",({"bold":"Tučné","copy":"Kopírovať","cut":"Vystrihnúť","delete":"Vymazať","indent":"Odsadiť","insertHorizontalRule":"Vodorovná čiara","insertOrderedList":"Číslovaný zoznam","insertUnorderedList":"Zoznam s odrážkami","italic":"Kurzíva","justifyCenter":"Zarovnať na stred","justifyFull":"Zarovnať k okrajom","justifyLeft":"Zarovnať vľavo","justifyRight":"Zarovnať vpravo","outdent":"Zmenšiť odsadenie","paste":"Prilepiť","redo":"Znova","removeFormat":"Odstrániť formátovanie","selectAll":"Vybrať všetko","strikethrough":"Prečiarknuť","subscript":"Dolný index","superscript":"Horný index","underline":"Podčiarknuť","undo":"Späť","unlink":"Odstrániť prepojenie","createLink":"Vytvoriť prepojenie","toggleDir":"Prepnúť smer","insertImage":"Vložiť obrázok","insertTable":"Vložiť/upraviť tabuľku","toggleTableBorder":"Prepnúť ohraničenie tabuľky","deleteTable":"Odstrániť tabuľku","tableProp":"Vlastnosť tabuľky","htmlToggle":"Zdrojový kód HTML","foreColor":"Farba popredia","hiliteColor":"Farba pozadia","plainFormatBlock":"Štýl odseku","formatBlock":"Štýl odseku","fontSize":"Veľkosť písma","fontName":"Názov písma","tabIndent":"Odsadenie tabulátora","fullScreen":"Prepnúť na celú obrazovku","viewSource":"Zobraziť zdrojový kód HTML","print":"Vytlačiť","newPage":"Nová stránka","systemShortcut":"Akcia \"${0}\" je vo vašom prehliadači dostupná iba prostredníctvom klávesovej skratky. Stlačte ${1}.","ctrlKey":"Ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/sk/commands.js.uncompressed.js b/lib/dijit/_editor/nls/sk/commands.js.uncompressed.js new file mode 100644 index 000000000..bb8632e75 --- /dev/null +++ b/lib/dijit/_editor/nls/sk/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/sk/commands", ({ + 'bold': 'Tučné', + 'copy': 'Kopírovať', + 'cut': 'Vystrihnúť', + 'delete': 'Vymazať', + 'indent': 'Odsadiť', + 'insertHorizontalRule': 'Vodorovná čiara', + 'insertOrderedList': 'Číslovaný zoznam', + 'insertUnorderedList': 'Zoznam s odrážkami', + 'italic': 'Kurzíva', + 'justifyCenter': 'Zarovnať na stred', + 'justifyFull': 'Zarovnať k okrajom', + 'justifyLeft': 'Zarovnať vľavo', + 'justifyRight': 'Zarovnať vpravo', + 'outdent': 'Zmenšiť odsadenie', + 'paste': 'Prilepiť', + 'redo': 'Znova', + 'removeFormat': 'Odstrániť formátovanie', + 'selectAll': 'Vybrať všetko', + 'strikethrough': 'Prečiarknuť', + 'subscript': 'Dolný index', + 'superscript': 'Horný index', + 'underline': 'Podčiarknuť', + 'undo': 'Späť', + 'unlink': 'Odstrániť prepojenie', + 'createLink': 'Vytvoriť prepojenie', + 'toggleDir': 'Prepnúť smer', + 'insertImage': 'Vložiť obrázok', + 'insertTable': 'Vložiť/upraviť tabuľku', + 'toggleTableBorder': 'Prepnúť ohraničenie tabuľky', + 'deleteTable': 'Odstrániť tabuľku', + 'tableProp': 'Vlastnosť tabuľky', + 'htmlToggle': 'Zdrojový kód HTML', + 'foreColor': 'Farba popredia', + 'hiliteColor': 'Farba pozadia', + 'plainFormatBlock': 'Štýl odseku', + 'formatBlock': 'Štýl odseku', + 'fontSize': 'Veľkosť písma', + 'fontName': 'Názov písma', + 'tabIndent': 'Odsadenie tabulátora', + "fullScreen": "Prepnúť na celú obrazovku", + "viewSource": "Zobraziť zdrojový kód HTML", + "print": "Vytlačiť", + "newPage": "Nová stránka", + /* Error messages */ + 'systemShortcut': 'Akcia "${0}" je vo vašom prehliadači dostupná iba prostredníctvom klávesovej skratky. Stlačte ${1}.', + 'ctrlKey':'Ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/sl/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/sl/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..3d9e927b1 --- /dev/null +++ b/lib/dijit/_editor/nls/sl/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/sl/FontChoice", ({ + fontSize: "Velikost", + fontName: "Pisava", + formatBlock: "Oblika", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Brez", + p: "Odstavek", + h1: "Naslovni slog", + h2: "Podnaslovni slog", + h3: "Pod-podnaslovni slog", + pre: "Vnaprej oblikovan", + 1: "xx-majhno", + 2: "x-majhno", + 3: "majhno", + 4: "srednje", + 5: "veliko", + 6: "x-veliko", + 7: "xx-veliko" +}) +); diff --git a/lib/dijit/_editor/nls/sl/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/sl/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..c7f1c7252 --- /dev/null +++ b/lib/dijit/_editor/nls/sl/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/sl/LinkDialog", ({ + createLinkTitle: "Lastnosti povezave", + insertImageTitle: "Lastnosti slike", + url: "URL:", + text: "Opis:", + target: "Cilj:", + set: "Nastavi", + currentWindow: "Trenutno okno", + parentWindow: "Nadrejeno okno", + topWindow: "Okno na vrhu", + newWindow: "Novo okno" +}) +); diff --git a/lib/dijit/_editor/nls/sl/commands.js b/lib/dijit/_editor/nls/sl/commands.js index 9061e1602..d26ba426f 100644 --- a/lib/dijit/_editor/nls/sl/commands.js +++ b/lib/dijit/_editor/nls/sl/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/sl/commands",({"bold":"Krepko","copy":"Prekopiraj","cut":"Izreži","delete":"Izbriši","indent":"Zamik","insertHorizontalRule":"Vodoravno ravnilo","insertOrderedList":"Oštevilčen seznam","insertUnorderedList":"Naštevni seznam","italic":"Ležeče","justifyCenter":"Poravnaj na sredino","justifyFull":"Poravnaj obojestransko","justifyLeft":"Poravnaj levo","justifyRight":"Poravnaj desno","outdent":"Primakni","paste":"Prilepi","redo":"Znova uveljavi","removeFormat":"Odstrani oblikovanje","selectAll":"Izberi vse","strikethrough":"Prečrtano","subscript":"Podpisano","superscript":"Nadpisano","underline":"Podčrtano","undo":"Razveljavi","unlink":"Odstrani povezavo","createLink":"Ustvari povezavo","toggleDir":"Preklopi smer","insertImage":"Vstavi sliko","insertTable":"Vstavi/uredi tabelo","toggleTableBorder":"Preklopi na rob tabele","deleteTable":"Izbriši tabelo","tableProp":"Lastnost tabele","htmlToggle":"Izvorna koda HTML","foreColor":"Barva ospredja","hiliteColor":"Barva ozadja","plainFormatBlock":"Slog odstavka","formatBlock":"Slog odstavka","fontSize":"Velikost pisave","fontName":"Ime pisave","tabIndent":"Zamik tabulatorja","fullScreen":"Preklopi na celozaslonski način","viewSource":"Prikaži izvorno kodo HTML","print":"Natisni","newPage":"Nova stran","systemShortcut":"Dejanje \"${0}\" lahko v vašem brskalniku uporabite samo z bližnjico na tipkovnici. Uporabite ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/sl/commands",({"bold":"Krepko","copy":"Prekopiraj","cut":"Izreži","delete":"Izbriši","indent":"Zamik","insertHorizontalRule":"Vodoravno ravnilo","insertOrderedList":"Oštevilčen seznam","insertUnorderedList":"Naštevni seznam","italic":"Ležeče","justifyCenter":"Poravnaj na sredino","justifyFull":"Poravnaj obojestransko","justifyLeft":"Poravnaj levo","justifyRight":"Poravnaj desno","outdent":"Primakni","paste":"Prilepi","redo":"Znova uveljavi","removeFormat":"Odstrani oblikovanje","selectAll":"Izberi vse","strikethrough":"Prečrtano","subscript":"Podpisano","superscript":"Nadpisano","underline":"Podčrtano","undo":"Razveljavi","unlink":"Odstrani povezavo","createLink":"Ustvari povezavo","toggleDir":"Preklopi smer","insertImage":"Vstavi sliko","insertTable":"Vstavi/uredi tabelo","toggleTableBorder":"Preklopi na obrobo tabele","deleteTable":"Izbriši tabelo","tableProp":"Lastnost tabele","htmlToggle":"Izvor HTML","foreColor":"Barva ospredja","hiliteColor":"Barva ozadja","plainFormatBlock":"Slog odstavka","formatBlock":"Slog odstavka","fontSize":"Velikost pisave","fontName":"Ime pisave","tabIndent":"Zamik tabulatorja","fullScreen":"Preklopi na celozaslonski način","viewSource":"Prikaži izvorno kodo HTML","print":"Natisni","newPage":"Nova stran","systemShortcut":"Dejanje \"${0}\" lahko v vašem brskalniku uporabite samo z bližnjico na tipkovnici. Uporabite ${1}."}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/sl/commands.js.uncompressed.js b/lib/dijit/_editor/nls/sl/commands.js.uncompressed.js new file mode 100644 index 000000000..b03f5af33 --- /dev/null +++ b/lib/dijit/_editor/nls/sl/commands.js.uncompressed.js @@ -0,0 +1,49 @@ +define( +"dijit/_editor/nls/sl/commands", ({ + 'bold': 'Krepko', + 'copy': 'Prekopiraj', + 'cut': 'Izreži', + 'delete': 'Izbriši', + 'indent': 'Zamik', + 'insertHorizontalRule': 'Vodoravno ravnilo', + 'insertOrderedList': 'Oštevilčen seznam', + 'insertUnorderedList': 'Naštevni seznam', + 'italic': 'Ležeče', + 'justifyCenter': 'Poravnaj na sredino', + 'justifyFull': 'Poravnaj obojestransko', + 'justifyLeft': 'Poravnaj levo', + 'justifyRight': 'Poravnaj desno', + 'outdent': 'Primakni', + 'paste': 'Prilepi', + 'redo': 'Znova uveljavi', + 'removeFormat': 'Odstrani oblikovanje', + 'selectAll': 'Izberi vse', + 'strikethrough': 'Prečrtano', + 'subscript': 'Podpisano', + 'superscript': 'Nadpisano', + 'underline': 'Podčrtano', + 'undo': 'Razveljavi', + 'unlink': 'Odstrani povezavo', + 'createLink': 'Ustvari povezavo', + 'toggleDir': 'Preklopi smer', + 'insertImage': 'Vstavi sliko', + 'insertTable': 'Vstavi/uredi tabelo', + 'toggleTableBorder': 'Preklopi na obrobo tabele', + 'deleteTable': 'Izbriši tabelo', + 'tableProp': 'Lastnost tabele', + 'htmlToggle': 'Izvor HTML', + 'foreColor': 'Barva ospredja', + 'hiliteColor': 'Barva ozadja', + 'plainFormatBlock': 'Slog odstavka', + 'formatBlock': 'Slog odstavka', + 'fontSize': 'Velikost pisave', + 'fontName': 'Ime pisave', + 'tabIndent': 'Zamik tabulatorja', + "fullScreen": "Preklopi na celozaslonski način", + "viewSource": "Prikaži izvorno kodo HTML", + "print": "Natisni", + "newPage": "Nova stran", + /* Error messages */ + 'systemShortcut': 'Dejanje "${0}" lahko v vašem brskalniku uporabite samo z bližnjico na tipkovnici. Uporabite ${1}.' +}) +); diff --git a/lib/dijit/_editor/nls/sv/FontChoice.js b/lib/dijit/_editor/nls/sv/FontChoice.js index 197fca5e3..c9db732a5 100644 --- a/lib/dijit/_editor/nls/sv/FontChoice.js +++ b/lib/dijit/_editor/nls/sv/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/sv/FontChoice",({fontSize:"Storlek",fontName:"Teckensnitt",formatBlock:"Format",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"kursivt",fantasy:"fantasy",noFormat:"Ingen",p:"Stycke",h1:"Rubrik",h2:"Underrubrik",h3:"Underunderrubrik",pre:"Förformaterat",1:"mycket, mycket litet",2:"mycket litet",3:"litet",4:"medelstort",5:"stort",6:"extra stort",7:"extra extra stort"}));
\ No newline at end of file +define("dijit/_editor/nls/sv/FontChoice",({fontSize:"Storlek ",fontName:"Teckensnitt",formatBlock:"Format",serif:"serif","sans-serif":"sans-serif",monospace:"monospace",cursive:"cursive",fantasy:"fantasy",noFormat:"Inget",p:"Stycke",h1:"Rubrik 1",h2:"Rubrik 2",h3:"Rubrik 3",pre:"Förformaterad",1:"XXS",2:"XS",3:"S",4:"M",5:"L",6:"XL",7:"XXL"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/sv/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/sv/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..ba2ec83f2 --- /dev/null +++ b/lib/dijit/_editor/nls/sv/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/sv/FontChoice", ({ + fontSize: "Storlek ", + fontName: "Teckensnitt", + formatBlock: "Format", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "Inget", + p: "Stycke", + h1: "Rubrik 1", + h2: "Rubrik 2", + h3: "Rubrik 3", + pre: "Förformaterad", + 1: "XXS", + 2: "XS", + 3: "S", + 4: "M", + 5: "L", + 6: "XL", + 7: "XXL" +}) +); diff --git a/lib/dijit/_editor/nls/sv/LinkDialog.js b/lib/dijit/_editor/nls/sv/LinkDialog.js index 91eb3cb0e..3c3a39d68 100644 --- a/lib/dijit/_editor/nls/sv/LinkDialog.js +++ b/lib/dijit/_editor/nls/sv/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/sv/LinkDialog",({createLinkTitle:"Länkegenskaper",insertImageTitle:"Bildegenskaper",url:"URL-adress:",text:"Beskrivning:",target:"Mål:",set:"Ange",currentWindow:"aktuellt fönster",parentWindow:"överordnat fönster",topWindow:"översta fönstret",newWindow:"nytt fönster"}));
\ No newline at end of file +define("dijit/_editor/nls/sv/LinkDialog",({createLinkTitle:"Länkegenskaper",insertImageTitle:"Bildegenskaper",url:"URL-adress:",text:"Beskrivning:",target:"Mål:",set:"Använd",currentWindow:"Aktuellt fönster",parentWindow:"Överordnat fönster",topWindow:"Översta fönstret",newWindow:"Nytt fönster"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/sv/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/sv/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..dca1fc0f6 --- /dev/null +++ b/lib/dijit/_editor/nls/sv/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/sv/LinkDialog", ({ + createLinkTitle: "Länkegenskaper", + insertImageTitle: "Bildegenskaper", + url: "URL-adress:", + text: "Beskrivning:", + target: "Mål:", + set: "Använd", + currentWindow: "Aktuellt fönster", + parentWindow: "Överordnat fönster", + topWindow: "Översta fönstret", + newWindow: "Nytt fönster" +}) +); diff --git a/lib/dijit/_editor/nls/sv/commands.js b/lib/dijit/_editor/nls/sv/commands.js index fb62d3068..c26d0020b 100644 --- a/lib/dijit/_editor/nls/sv/commands.js +++ b/lib/dijit/_editor/nls/sv/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/sv/commands",({"bold":"Fetstil","copy":"Kopiera","cut":"Klipp ut","delete":"Ta bort","indent":"Indrag","insertHorizontalRule":"Horisontell linjal","insertOrderedList":"Numrerad lista","insertUnorderedList":"Punktlista","italic":"Kursiv","justifyCenter":"Centrera","justifyFull":"Marginaljustera","justifyLeft":"Vänsterjustera","justifyRight":"Högerjustera","outdent":"Utdrag","paste":"Klistra in","redo":"Gör om","removeFormat":"Ta bort format","selectAll":"Markera allt","strikethrough":"Genomstruken","subscript":"Nedsänkt","superscript":"Upphöjt","underline":"Understrykning","undo":"Ångra","unlink":"Ta bort länk","createLink":"Skapa länk","toggleDir":"Växla riktning","insertImage":"Infoga bild","insertTable":"Infoga/redigera tabell","toggleTableBorder":"Aktivera/avaktivera tabellram","deleteTable":"Ta bort tabell","tableProp":"Tabellegenskap","htmlToggle":"HTML-källkod","foreColor":"Förgrundsfärg","hiliteColor":"Bakgrundsfärg","plainFormatBlock":"Styckeformat","formatBlock":"Styckeformat","fontSize":"Teckenstorlek","fontName":"Teckensnittsnamn","tabIndent":"Tabbindrag","fullScreen":"Växla helskärm","viewSource":"Visa HTML-kod","print":"Skriv ut","newPage":"Ny sida","systemShortcut":"Åtgärden \"${0}\" är endast tillgänglig i webbläsaren med hjälp av ett kortkommando. Använd ${1}.","ctrlKey":"Ctrl+${0}","appleKey":"⌘+${0}"}));
\ No newline at end of file +define("dijit/_editor/nls/sv/commands",({"bold":"Halvfet","copy":"Kopiera ","cut":"Klipp ut ","delete":"Ta bort ","indent":"Indrag","insertHorizontalRule":"Horisontell linje","insertOrderedList":"Numrerad lista","insertUnorderedList":"Punktlista","italic":"Kursiv","justifyCenter":"Justera centrerat","justifyFull":"Justera","justifyLeft":"Justera till vänster","justifyRight":"Justera till höger","outdent":"Utdrag","paste":"Klistra in","redo":"Gör om","removeFormat":"Ta bort format","selectAll":"Markera allt","strikethrough":"Genomstrykning","subscript":"Nedsänkt","superscript":"Upphöjt","underline":"Understrykning","undo":"Ångra","unlink":"Ta bort länk","createLink":"Skapa länk","toggleDir":"Växla riktning","insertImage":"Infoga bild","insertTable":"Infoga/redigera tabell","toggleTableBorder":"Växla tabellkantlinjer","deleteTable":"Ta bort tabell","tableProp":"Tabellegenskap","htmlToggle":"HTML-källa","foreColor":"Förgrundsfärg","hiliteColor":"Bakgrundsfärg","plainFormatBlock":"Styckeformat","formatBlock":"Styckeformat","fontSize":"Teckenstorlek","fontName":"Teckensnitt","tabIndent":"Indrag tabb","fullScreen":"Växla fullskärm","viewSource":"Visa HTML-kod","print":"Skriv ut","newPage":"Ny sida","systemShortcut":"Åtgärden ${0} är endast tillgänglig i webbläsaren via ett tangentbordskommando. Använd ${1}.","ctrlKey":"Ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/sv/commands.js.uncompressed.js b/lib/dijit/_editor/nls/sv/commands.js.uncompressed.js new file mode 100644 index 000000000..5950b0196 --- /dev/null +++ b/lib/dijit/_editor/nls/sv/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/sv/commands", ({ + 'bold': 'Halvfet', + 'copy': 'Kopiera ', + 'cut': 'Klipp ut ', + 'delete': 'Ta bort ', + 'indent': 'Indrag', + 'insertHorizontalRule': 'Horisontell linje', + 'insertOrderedList': 'Numrerad lista', + 'insertUnorderedList': 'Punktlista', + 'italic': 'Kursiv', + 'justifyCenter': 'Justera centrerat', + 'justifyFull': 'Justera', + 'justifyLeft': 'Justera till vänster', + 'justifyRight': 'Justera till höger', + 'outdent': 'Utdrag', + 'paste': 'Klistra in', + 'redo': 'Gör om', + 'removeFormat': 'Ta bort format', + 'selectAll': 'Markera allt', + 'strikethrough': 'Genomstrykning', + 'subscript': 'Nedsänkt', + 'superscript': 'Upphöjt', + 'underline': 'Understrykning', + 'undo': 'Ångra', + 'unlink': 'Ta bort länk', + 'createLink': 'Skapa länk', + 'toggleDir': 'Växla riktning', + 'insertImage': 'Infoga bild', + 'insertTable': 'Infoga/redigera tabell', + 'toggleTableBorder': 'Växla tabellkantlinjer', + 'deleteTable': 'Ta bort tabell', + 'tableProp': 'Tabellegenskap', + 'htmlToggle': 'HTML-källa', + 'foreColor': 'Förgrundsfärg', + 'hiliteColor': 'Bakgrundsfärg', + 'plainFormatBlock': 'Styckeformat', + 'formatBlock': 'Styckeformat', + 'fontSize': 'Teckenstorlek', + 'fontName': 'Teckensnitt', + 'tabIndent': 'Indrag tabb', + "fullScreen": "Växla fullskärm", + "viewSource": "Visa HTML-kod", + "print": "Skriv ut", + "newPage": "Ny sida", + /* Error messages */ + 'systemShortcut': 'Åtgärden ${0} är endast tillgänglig i webbläsaren via ett tangentbordskommando. Använd ${1}.', + 'ctrlKey':'Ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/th/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/th/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..715e2e617 --- /dev/null +++ b/lib/dijit/_editor/nls/th/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/th/FontChoice", ({ + fontSize: "ขนาด", + fontName: "ฟอนต์", + formatBlock: "รูปแบบ", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "monospace", + cursive: "cursive", + fantasy: "fantasy", + noFormat: "ไม่มี", + p: "ย่อหน้า", + h1: "ส่วนหัว", + h2: "ส่วนหัวย่อย", + h3: "ส่วนย่อยของส่วนหัวย่อย", + pre: "การกำหนดรูปแบบล่วงหน้า", + 1: "xx-small", + 2: "x-small", + 3: "small", + 4: "medium", + 5: "large", + 6: "x-large", + 7: "xx-large" +}) +); diff --git a/lib/dijit/_editor/nls/th/LinkDialog.js b/lib/dijit/_editor/nls/th/LinkDialog.js index 4b7756829..9d3352235 100644 --- a/lib/dijit/_editor/nls/th/LinkDialog.js +++ b/lib/dijit/_editor/nls/th/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/th/LinkDialog",({createLinkTitle:"คุณสมบัติลิงก์",insertImageTitle:"คุณสมบัติอิมเมจ",url:"URL:",text:"รายละเอียด:",target:"เป้าหมาย:",set:"ตั้งค่า",currentWindow:"หน้าต่างปัจจุบัน",parentWindow:"หน้าต่างหลัก",topWindow:"หน้าต่างบนสุด",newWindow:"หน้าต่างใหม่"}));
\ No newline at end of file +define("dijit/_editor/nls/th/LinkDialog",({createLinkTitle:"คุณสมบัติลิงก์",insertImageTitle:"คุณสมบัติรูปภาพ",url:"URL:",text:"คำอธิบาย:",target:"เป้าหมาย:",set:"เซ็ต",currentWindow:"หน้าต่างปัจจุบัน",parentWindow:"หน้าต่างหลัก",topWindow:"หน้าต่างบนสุด",newWindow:"หน้าต่างใหม่"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/th/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/th/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..8df6810f4 --- /dev/null +++ b/lib/dijit/_editor/nls/th/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/th/LinkDialog", ({ + createLinkTitle: "คุณสมบัติลิงก์", + insertImageTitle: "คุณสมบัติรูปภาพ", + url: "URL:", + text: "คำอธิบาย:", + target: "เป้าหมาย:", + set: "เซ็ต", + currentWindow: "หน้าต่างปัจจุบัน", + parentWindow: "หน้าต่างหลัก", + topWindow: "หน้าต่างบนสุด", + newWindow: "หน้าต่างใหม่" +}) +); diff --git a/lib/dijit/_editor/nls/th/commands.js b/lib/dijit/_editor/nls/th/commands.js index d7480eb96..6bba32e2b 100644 --- a/lib/dijit/_editor/nls/th/commands.js +++ b/lib/dijit/_editor/nls/th/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/th/commands",({"bold":"ตัวหนา","copy":"คัดลอก","cut":"ตัด","delete":"ลบ","indent":"เพิ่มการเยื้อง","insertHorizontalRule":"ไม้บรรทัดแนวนอน","insertOrderedList":"ลำดับเลข","insertUnorderedList":"หัวข้อย่อย","italic":"ตัวเอียง","justifyCenter":"จัดกึ่งกลาง","justifyFull":"จัดชิดขอบ","justifyLeft":"จัดชิดซ้าย","justifyRight":"จัดชิดขวา","outdent":"ลดการเยื้อง","paste":"วาง","redo":"ทำซ้ำ","removeFormat":"ลบรูปแบบออก","selectAll":"เลือกทั้งหมด","strikethrough":"ขีดทับ","subscript":"ตัวห้อย","superscript":"ตัวยก","underline":"ขีดเส้นใต้","undo":"เลิกทำ","unlink":"ลบลิงก์ออก","createLink":"สร้างลิงก์","toggleDir":"สลับทิศทาง","insertImage":"แทรกอิมเมจ","insertTable":"แทรก/แก้ไขตาราง","toggleTableBorder":"สลับเส้นขอบตาราง","deleteTable":"ลบตาราง","tableProp":"คุณสมบัติตาราง","htmlToggle":"ซอร์ส HTML","foreColor":"สีพื้นหน้า","hiliteColor":"สีพื้นหลัง","plainFormatBlock":"ลักษณะย่อหน้า","formatBlock":"ลักษณะย่อหน้า","fontSize":"ขนาดฟอนต์","fontName":"ชื่อฟอนต์","tabIndent":"เยื้องแท็บ","fullScreen":"สลับจอภาพแบบเต็ม","viewSource":"ดูซอร์ส HTML","print":"พิมพ์","newPage":"หน้าใหม่","systemShortcut":"การดำเนินการ\"${0}\" ใช้งานได้เฉพาะกับเบราว์เซอร์ของคุณโดยใช้แป้นพิมพ์ลัด ใช้ ${1}"}));
\ No newline at end of file +define("dijit/_editor/nls/th/commands",({"bold":"ตัวหนา","copy":"คัดลอก","cut":"ตัด","delete":"ลบ","indent":"เพิ่มการเยื้อง","insertHorizontalRule":"ไม้บรรทัดแนวนอน","insertOrderedList":"ลำดับเลข","insertUnorderedList":"หัวข้อย่อย","italic":"ตัวเอียง","justifyCenter":"จัดแนวกึ่งกลาง","justifyFull":"ชิดขอบ","justifyLeft":"จัดชิดซ้าย","justifyRight":"จัดชิดขวา","outdent":"ลดการเยื้อง","paste":"วาง","redo":"ทำซ้ำ","removeFormat":"ลบรูปแบบออก","selectAll":"เลือกทั้งหมด","strikethrough":"ขีดทับ","subscript":"ตัวห้อย","superscript":"ตัวยก","underline":"ขีดเส้นใต้","undo":"เลิกทำ","unlink":"ลบลิงก์ออก","createLink":"สร้างลิงก์","toggleDir":"สลับทิศทาง","insertImage":"แทรกรูปภาพ","insertTable":"แทรก/แก้ไขตาราง","toggleTableBorder":"สลับเส้นขอบตาราง","deleteTable":"ลบตาราง","tableProp":"คุณสมบัติตาราง","htmlToggle":"ซอร์ส HTML","foreColor":"สีพื้นหน้า","hiliteColor":"สีพื้นหลัง","plainFormatBlock":"ลักษณะย่อหน้า","formatBlock":"ลักษณะย่อหน้า","fontSize":"ขนาดฟอนต์","fontName":"ชื่อฟอนต์","tabIndent":"เยื้องแท็บ","fullScreen":"สลับจอภาพแบบเต็ม","viewSource":"ดูซอร์ส HTML","print":"พิมพ์","newPage":"หน้าใหม่","systemShortcut":"การดำเนินการ\"${0}\" ใช้งานได้เฉพาะกับเบราว์เซอร์ของคุณโดยใช้แป้นพิมพ์ลัด ใช้ ${1}","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/th/commands.js.uncompressed.js b/lib/dijit/_editor/nls/th/commands.js.uncompressed.js new file mode 100644 index 000000000..dced848cd --- /dev/null +++ b/lib/dijit/_editor/nls/th/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/th/commands", ({ + 'bold': 'ตัวหนา', + 'copy': 'คัดลอก', + 'cut': 'ตัด', + 'delete': 'ลบ', + 'indent': 'เพิ่มการเยื้อง', + 'insertHorizontalRule': 'ไม้บรรทัดแนวนอน', + 'insertOrderedList': 'ลำดับเลข', + 'insertUnorderedList': 'หัวข้อย่อย', + 'italic': 'ตัวเอียง', + 'justifyCenter': 'จัดแนวกึ่งกลาง', + 'justifyFull': 'ชิดขอบ', + 'justifyLeft': 'จัดชิดซ้าย', + 'justifyRight': 'จัดชิดขวา', + 'outdent': 'ลดการเยื้อง', + 'paste': 'วาง', + 'redo': 'ทำซ้ำ', + 'removeFormat': 'ลบรูปแบบออก', + 'selectAll': 'เลือกทั้งหมด', + 'strikethrough': 'ขีดทับ', + 'subscript': 'ตัวห้อย', + 'superscript': 'ตัวยก', + 'underline': 'ขีดเส้นใต้', + 'undo': 'เลิกทำ', + 'unlink': 'ลบลิงก์ออก', + 'createLink': 'สร้างลิงก์', + 'toggleDir': 'สลับทิศทาง', + 'insertImage': 'แทรกรูปภาพ', + 'insertTable': 'แทรก/แก้ไขตาราง', + 'toggleTableBorder': 'สลับเส้นขอบตาราง', + 'deleteTable': 'ลบตาราง', + 'tableProp': 'คุณสมบัติตาราง', + 'htmlToggle': 'ซอร์ส HTML', + 'foreColor': 'สีพื้นหน้า', + 'hiliteColor': 'สีพื้นหลัง', + 'plainFormatBlock': 'ลักษณะย่อหน้า', + 'formatBlock': 'ลักษณะย่อหน้า', + 'fontSize': 'ขนาดฟอนต์', + 'fontName': 'ชื่อฟอนต์', + 'tabIndent': 'เยื้องแท็บ', + "fullScreen": "สลับจอภาพแบบเต็ม", + "viewSource": "ดูซอร์ส HTML", + "print": "พิมพ์", + "newPage": "หน้าใหม่", + /* Error messages */ + 'systemShortcut': 'การดำเนินการ"${0}" ใช้งานได้เฉพาะกับเบราว์เซอร์ของคุณโดยใช้แป้นพิมพ์ลัด ใช้ ${1}', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/tr/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/tr/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..456d3c236 --- /dev/null +++ b/lib/dijit/_editor/nls/tr/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/tr/FontChoice", ({ + fontSize: "Boyut", + fontName: "Yazı Tipi", + formatBlock: "Biçim", + serif: "serif", + "sans-serif": "sans-serif", + monospace: "tek aralıklı", + cursive: "el yazısı", + fantasy: "fantazi", + noFormat: "Yok", + p: "Paragraf", + h1: "Başlık", + h2: "Alt Başlık", + h3: "Alt Alt Başlık", + pre: "Önceden Biçimlendirilmiş", + 1: "xx-küçük", + 2: "x-küçük", + 3: "küçük", + 4: "orta", + 5: "büyük", + 6: "x-büyük", + 7: "xx-büyük" +}) +); diff --git a/lib/dijit/_editor/nls/tr/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/tr/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..bef0e704f --- /dev/null +++ b/lib/dijit/_editor/nls/tr/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/tr/LinkDialog", ({ + createLinkTitle: "Bağlantı Özellikleri", + insertImageTitle: "Resim Özellikleri", + url: "URL:", + text: "Açıklama:", + target: "Hedef:", + set: "Ayarla", + currentWindow: "Geçerli Pencere", + parentWindow: "Üst Pencere", + topWindow: "En Üst Pencere", + newWindow: "Yeni Pencere" +}) +); diff --git a/lib/dijit/_editor/nls/tr/commands.js b/lib/dijit/_editor/nls/tr/commands.js index 5565b9a14..3b12fb511 100644 --- a/lib/dijit/_editor/nls/tr/commands.js +++ b/lib/dijit/_editor/nls/tr/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/tr/commands",({"bold":"Kalın","copy":"Kopyala","cut":"Kes","delete":"Sil","indent":"Girinti","insertHorizontalRule":"Yatay Kural","insertOrderedList":"Numaralı Liste","insertUnorderedList":"Madde İşaretli Liste","italic":"İtalik","justifyCenter":"Ortaya Hizala","justifyFull":"Yasla","justifyLeft":"Sola Hizala","justifyRight":"Sağa Hizala","outdent":"Çıkıntı","paste":"Yapıştır","redo":"Yinele","removeFormat":"Biçimi Kaldır","selectAll":"Tümünü Seç","strikethrough":"Üstü Çizili","subscript":"Alt Simge","superscript":"Üst Simge","underline":"Altı Çizili","undo":"Geri Al","unlink":"Bağlantıyı Kaldır","createLink":"Bağlantı Oluştur","toggleDir":"Yönü Değiştir","insertImage":"Resim Ekle","insertTable":"Tablo Ekle/Düzenle","toggleTableBorder":"Tablo Kenarlığını Göster/Gizle","deleteTable":"Tabloyu Sil","tableProp":"Tablo Özelliği","htmlToggle":"HTML Kaynağı","foreColor":"Ön Plan Rengi","hiliteColor":"Arka Plan Rengi","plainFormatBlock":"Paragraf Stili","formatBlock":"Paragraf Stili","fontSize":"Yazı Tipi Boyutu","fontName":"Yazı Tipi Adı","tabIndent":"Sekme Girintisi","fullScreen":"Tam Ekranı Aç/Kapat","viewSource":"HTML Kaynağını Görüntüle","print":"Yazdır","newPage":"Yeni Sayfa","systemShortcut":"\"${0}\" işlemi yalnızca tarayıcınızda bir klavye kısayoluyla birlikte kullanılabilir. Şunu kullanın: ${1}."}));
\ No newline at end of file +define("dijit/_editor/nls/tr/commands",({"bold":"Kalın","copy":"Kopyala","cut":"Kes","delete":"Sil","indent":"Girinti","insertHorizontalRule":"Yatay Kural","insertOrderedList":"Numaralı Liste","insertUnorderedList":"Madde İşaretli Liste","italic":"İtalik","justifyCenter":"Ortaya Hizala","justifyFull":"Yasla","justifyLeft":"Sola Hizala","justifyRight":"Sağa Hizala","outdent":"Çıkıntı","paste":"Yapıştır","redo":"Yinele","removeFormat":"Biçimi Kaldır","selectAll":"Tümünü Seç","strikethrough":"Üstü Çizili","subscript":"Alt Simge","superscript":"Üst Simge","underline":"Altı Çizili","undo":"Geri Al","unlink":"Bağlantıyı Kaldır","createLink":"Bağlantı Oluştur","toggleDir":"Yönü Değiştir","insertImage":"Resim Ekle","insertTable":"Tablo Ekle/Düzenle","toggleTableBorder":"Tablo Kenarlığını Göster/Gizle","deleteTable":"Tabloyu Sil","tableProp":"Tablo Özelliği","htmlToggle":"HTML Kaynağı","foreColor":"Ön Plan Rengi","hiliteColor":"Arka Plan Rengi","plainFormatBlock":"Paragraf Stili","formatBlock":"Paragraf Stili","fontSize":"Yazı Tipi Boyutu","fontName":"Yazı Tipi Adı","tabIndent":"Sekme Girintisi","fullScreen":"Tam Ekranı Aç/Kapat","viewSource":"HTML Kaynağını Görüntüle","print":"Yazdır","newPage":"Yeni Sayfa","systemShortcut":"\"${0}\" işlemi yalnızca tarayıcınızda bir klavye kısayoluyla birlikte kullanılabilir. Şunu kullanın: ${1}.","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/tr/commands.js.uncompressed.js b/lib/dijit/_editor/nls/tr/commands.js.uncompressed.js new file mode 100644 index 000000000..a93e67ccd --- /dev/null +++ b/lib/dijit/_editor/nls/tr/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/tr/commands", ({ + 'bold': 'Kalın', + 'copy': 'Kopyala', + 'cut': 'Kes', + 'delete': 'Sil', + 'indent': 'Girinti', + 'insertHorizontalRule': 'Yatay Kural', + 'insertOrderedList': 'Numaralı Liste', + 'insertUnorderedList': 'Madde İşaretli Liste', + 'italic': 'İtalik', + 'justifyCenter': 'Ortaya Hizala', + 'justifyFull': 'Yasla', + 'justifyLeft': 'Sola Hizala', + 'justifyRight': 'Sağa Hizala', + 'outdent': 'Çıkıntı', + 'paste': 'Yapıştır', + 'redo': 'Yinele', + 'removeFormat': 'Biçimi Kaldır', + 'selectAll': 'Tümünü Seç', + 'strikethrough': 'Üstü Çizili', + 'subscript': 'Alt Simge', + 'superscript': 'Üst Simge', + 'underline': 'Altı Çizili', + 'undo': 'Geri Al', + 'unlink': 'Bağlantıyı Kaldır', + 'createLink': 'Bağlantı Oluştur', + 'toggleDir': 'Yönü Değiştir', + 'insertImage': 'Resim Ekle', + 'insertTable': 'Tablo Ekle/Düzenle', + 'toggleTableBorder': 'Tablo Kenarlığını Göster/Gizle', + 'deleteTable': 'Tabloyu Sil', + 'tableProp': 'Tablo Özelliği', + 'htmlToggle': 'HTML Kaynağı', + 'foreColor': 'Ön Plan Rengi', + 'hiliteColor': 'Arka Plan Rengi', + 'plainFormatBlock': 'Paragraf Stili', + 'formatBlock': 'Paragraf Stili', + 'fontSize': 'Yazı Tipi Boyutu', + 'fontName': 'Yazı Tipi Adı', + 'tabIndent': 'Sekme Girintisi', + "fullScreen": "Tam Ekranı Aç/Kapat", + "viewSource": "HTML Kaynağını Görüntüle", + "print": "Yazdır", + "newPage": "Yeni Sayfa", + /* Error messages */ + 'systemShortcut': '"${0}" işlemi yalnızca tarayıcınızda bir klavye kısayoluyla birlikte kullanılabilir. Şunu kullanın: ${1}.', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/zh-tw/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/zh-tw/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..9fce29893 --- /dev/null +++ b/lib/dijit/_editor/nls/zh-tw/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/zh-tw/FontChoice", ({ + fontSize: "大小", + fontName: "字型", + formatBlock: "格式", + serif: "新細明體", + "sans-serif": "新細明體", + monospace: "等寬", + cursive: "Cursive", + fantasy: "Fantasy", + noFormat: "無", + p: "段落", + h1: "標題", + h2: "子標題", + h3: "次子標題", + pre: "預先格式化", + 1: "最小", + 2: "較小", + 3: "小", + 4: "中", + 5: "大", + 6: "較大", + 7: "最大" +}) +); diff --git a/lib/dijit/_editor/nls/zh-tw/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/zh-tw/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..a51049592 --- /dev/null +++ b/lib/dijit/_editor/nls/zh-tw/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/zh-tw/LinkDialog", ({ + createLinkTitle: "鏈結內容", + insertImageTitle: "影像內容", + url: "URL:", + text: "說明:", + target: "目標:", + set: "設定", + currentWindow: "現行視窗", + parentWindow: "上層視窗", + topWindow: "最上面的視窗", + newWindow: "新視窗" +}) +); diff --git a/lib/dijit/_editor/nls/zh-tw/commands.js b/lib/dijit/_editor/nls/zh-tw/commands.js index 2f676219b..2cd9ad43f 100644 --- a/lib/dijit/_editor/nls/zh-tw/commands.js +++ b/lib/dijit/_editor/nls/zh-tw/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/zh-tw/commands",({"bold":"粗體","copy":"複製","cut":"剪下","delete":"刪除","indent":"縮排","insertHorizontalRule":"水平尺規","insertOrderedList":"編號清單","insertUnorderedList":"項目符號清單","italic":"斜體","justifyCenter":"置中對齊","justifyFull":"對齊","justifyLeft":"靠左對齊","justifyRight":"靠右對齊","outdent":"凸排","paste":"貼上","redo":"重做","removeFormat":"移除格式","selectAll":"全選","strikethrough":"刪除線","subscript":"下標","superscript":"上標","underline":"底線","undo":"復原","unlink":"移除鏈結","createLink":"建立鏈結","toggleDir":"切換方向","insertImage":"插入影像","insertTable":"插入/編輯表格","toggleTableBorder":"切換表格邊框","deleteTable":"刪除表格","tableProp":"表格內容","htmlToggle":"HTML 原始檔","foreColor":"前景顏色","hiliteColor":"背景顏色","plainFormatBlock":"段落樣式","formatBlock":"段落樣式","fontSize":"字型大小","fontName":"字型名稱","tabIndent":"標籤縮排","fullScreen":"切換全螢幕","viewSource":"檢視 HTML 原始檔","print":"列印","newPage":"新頁面","systemShortcut":"\"${0}\" 動作在您的瀏覽器中,只能使用鍵盤快速鍵。請使用 ${1}。"}));
\ No newline at end of file +define("dijit/_editor/nls/zh-tw/commands",({"bold":"粗體","copy":"複製","cut":"剪下","delete":"刪除","indent":"縮排","insertHorizontalRule":"水平尺規","insertOrderedList":"編號清單","insertUnorderedList":"項目符號清單","italic":"斜體","justifyCenter":"置中對齊","justifyFull":"對齊","justifyLeft":"靠左對齊","justifyRight":"靠右對齊","outdent":"凸排","paste":"貼上","redo":"重做","removeFormat":"移除格式","selectAll":"全選","strikethrough":"刪除線","subscript":"下標","superscript":"上標","underline":"底線","undo":"復原","unlink":"移除鏈結","createLink":"建立鏈結","toggleDir":"切換方向","insertImage":"插入影像","insertTable":"插入/編輯表格","toggleTableBorder":"切換表格邊框","deleteTable":"刪除表格","tableProp":"表格內容","htmlToggle":"HTML 原始檔","foreColor":"前景顏色","hiliteColor":"背景顏色","plainFormatBlock":"段落樣式","formatBlock":"段落樣式","fontSize":"字型大小","fontName":"字型名稱","tabIndent":"標籤縮排","fullScreen":"切換全螢幕","viewSource":"檢視 HTML 原始檔","print":"列印","newPage":"新頁面","systemShortcut":"\"${0}\" 動作在您的瀏覽器中,只能使用鍵盤快速鍵。請使用 ${1}。","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/zh-tw/commands.js.uncompressed.js b/lib/dijit/_editor/nls/zh-tw/commands.js.uncompressed.js new file mode 100644 index 000000000..a694fd174 --- /dev/null +++ b/lib/dijit/_editor/nls/zh-tw/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/zh-tw/commands", ({ + 'bold': '粗體', + 'copy': '複製', + 'cut': '剪下', + 'delete': '刪除', + 'indent': '縮排', + 'insertHorizontalRule': '水平尺規', + 'insertOrderedList': '編號清單', + 'insertUnorderedList': '項目符號清單', + 'italic': '斜體', + 'justifyCenter': '置中對齊', + 'justifyFull': '對齊', + 'justifyLeft': '靠左對齊', + 'justifyRight': '靠右對齊', + 'outdent': '凸排', + 'paste': '貼上', + 'redo': '重做', + 'removeFormat': '移除格式', + 'selectAll': '全選', + 'strikethrough': '刪除線', + 'subscript': '下標', + 'superscript': '上標', + 'underline': '底線', + 'undo': '復原', + 'unlink': '移除鏈結', + 'createLink': '建立鏈結', + 'toggleDir': '切換方向', + 'insertImage': '插入影像', + 'insertTable': '插入/編輯表格', + 'toggleTableBorder': '切換表格邊框', + 'deleteTable': '刪除表格', + 'tableProp': '表格內容', + 'htmlToggle': 'HTML 原始檔', + 'foreColor': '前景顏色', + 'hiliteColor': '背景顏色', + 'plainFormatBlock': '段落樣式', + 'formatBlock': '段落樣式', + 'fontSize': '字型大小', + 'fontName': '字型名稱', + 'tabIndent': '標籤縮排', + "fullScreen": "切換全螢幕", + "viewSource": "檢視 HTML 原始檔", + "print": "列印", + "newPage": "新頁面", + /* Error messages */ + 'systemShortcut': '"${0}" 動作在您的瀏覽器中,只能使用鍵盤快速鍵。請使用 ${1}。', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/nls/zh/FontChoice.js b/lib/dijit/_editor/nls/zh/FontChoice.js index 67e802189..e692d0e2a 100644 --- a/lib/dijit/_editor/nls/zh/FontChoice.js +++ b/lib/dijit/_editor/nls/zh/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/zh/FontChoice",({fontSize:"大小",fontName:"字体",formatBlock:"格式",serif:"有衬线","sans-serif":"无衬线",monospace:"等宽字体",cursive:"草书",fantasy:"虚线",noFormat:"无",p:"段落",h1:"标题",h2:"子标题",h3:"二级子标题",pre:"预设有格式的",1:"XXS 号",2:"XS 号",3:"S 号",4:"M 号",5:"L 号",6:"XL 号",7:"XXL 号"}));
\ No newline at end of file +define("dijit/_editor/nls/zh/FontChoice",({fontSize:"大小",fontName:"字体",formatBlock:"格式",serif:"有衬线","sans-serif":"无衬线",monospace:"等宽字体",cursive:"草书",fantasy:"虚线",noFormat:"无",p:"段落",h1:"标题",h2:"副标题",h3:"二级子标题",pre:"预设有格式的",1:"XX 小号",2:"X 小号",3:"小号",4:"中号",5:"大号",6:"X 大号",7:"XX 大号"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/zh/FontChoice.js.uncompressed.js b/lib/dijit/_editor/nls/zh/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..dd8bd834b --- /dev/null +++ b/lib/dijit/_editor/nls/zh/FontChoice.js.uncompressed.js @@ -0,0 +1,25 @@ +define( +"dijit/_editor/nls/zh/FontChoice", ({ + fontSize: "大小", + fontName: "字体", + formatBlock: "格式", + serif: "有衬线", + "sans-serif": "无衬线", + monospace: "等宽字体", + cursive: "草书", + fantasy: "虚线", + noFormat: "无", + p: "段落", + h1: "标题", + h2: "副标题", + h3: "二级子标题", + pre: "预设有格式的", + 1: "XX 小号", + 2: "X 小号", + 3: "小号", + 4: "中号", + 5: "大号", + 6: "X 大号", + 7: "XX 大号" +}) +); diff --git a/lib/dijit/_editor/nls/zh/LinkDialog.js b/lib/dijit/_editor/nls/zh/LinkDialog.js index 40cbebd24..0b7b66f70 100644 --- a/lib/dijit/_editor/nls/zh/LinkDialog.js +++ b/lib/dijit/_editor/nls/zh/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/zh/LinkDialog",({createLinkTitle:"链接属性",insertImageTitle:"图像属性",url:"URL:",text:"描述:",target:"目标:",set:"设置",currentWindow:"当前窗口",parentWindow:"父窗口",topWindow:"顶层窗口",newWindow:"新建窗口"}));
\ No newline at end of file +define("dijit/_editor/nls/zh/LinkDialog",({createLinkTitle:"链接属性",insertImageTitle:"图像属性",url:"URL:",text:"说明:",target:"目标:",set:"集",currentWindow:"当前窗口",parentWindow:"父窗口",topWindow:"最顶层窗口",newWindow:"新建窗口"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/zh/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/nls/zh/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..a954c9be8 --- /dev/null +++ b/lib/dijit/_editor/nls/zh/LinkDialog.js.uncompressed.js @@ -0,0 +1,14 @@ +define( +"dijit/_editor/nls/zh/LinkDialog", ({ + createLinkTitle: "链接属性", + insertImageTitle: "图像属性", + url: "URL:", + text: "说明:", + target: "目标:", + set: "集", + currentWindow: "当前窗口", + parentWindow: "父窗口", + topWindow: "最顶层窗口", + newWindow: "新建窗口" +}) +); diff --git a/lib/dijit/_editor/nls/zh/commands.js b/lib/dijit/_editor/nls/zh/commands.js index bbac1fc3a..33cc25b2b 100644 --- a/lib/dijit/_editor/nls/zh/commands.js +++ b/lib/dijit/_editor/nls/zh/commands.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/nls/zh/commands",({"bold":"粗体","copy":"复制","cut":"剪切","delete":"删除","indent":"增加缩进","insertHorizontalRule":"水平线","insertOrderedList":"编号列表","insertUnorderedList":"符号列表","italic":"斜体","justifyCenter":"居中","justifyFull":"对齐","justifyLeft":"左对齐","justifyRight":"右对齐","outdent":"减少缩进","paste":"粘贴","redo":"重做","removeFormat":"除去格式","selectAll":"全选","strikethrough":"删除线","subscript":"下标","superscript":"上标","underline":"下划线","undo":"撤销","unlink":"除去链接","createLink":"创建链接","toggleDir":"固定方向","insertImage":"插入图像","insertTable":"插入/编辑表","toggleTableBorder":"切换表边框","deleteTable":"删除表","tableProp":"表属性","htmlToggle":"HTML 源代码","foreColor":"前景色","hiliteColor":"背景色","plainFormatBlock":"段落样式","formatBlock":"段落样式","fontSize":"字体大小","fontName":"字体名称","tabIndent":"制表符缩进","fullScreen":"切换全屏幕","viewSource":"查看 HTML 源代码","print":"打印","newPage":"新建页面","systemShortcut":"只能在浏览器中通过键盘快捷方式执行“${0}”操作。使用 ${1}。"}));
\ No newline at end of file +define("dijit/_editor/nls/zh/commands",({"bold":"粗体","copy":"复制","cut":"剪切","delete":"删除","indent":"缩进","insertHorizontalRule":"水平线","insertOrderedList":"编号列表","insertUnorderedList":"符号列表","italic":"斜体","justifyCenter":"居中","justifyFull":"调整","justifyLeft":"左对齐","justifyRight":"右对齐","outdent":"凸出","paste":"粘贴","redo":"重做","removeFormat":"除去格式","selectAll":"全选","strikethrough":"删除线","subscript":"下标","superscript":"上标","underline":"下划线","undo":"撤销","unlink":"除去链接","createLink":"创建链接","toggleDir":"切换方向","insertImage":"插入图像","insertTable":"插入/编辑表","toggleTableBorder":"切换表格边框","deleteTable":"删除表格","tableProp":"表格属性","htmlToggle":"HTML 源","foreColor":"前景颜色","hiliteColor":"背景颜色","plainFormatBlock":"段落样式","formatBlock":"段落样式","fontSize":"字体大小","fontName":"字体名称","tabIndent":"跳格缩进","fullScreen":"切换全屏幕","viewSource":"查看 HTML 源","print":"打印","newPage":"新建页面","systemShortcut":"只能在浏览器中通过键盘快捷方式执行“${0}”操作。使用 ${1}。","ctrlKey":"ctrl+${0}","appleKey":"⌘${0}"}));
\ No newline at end of file diff --git a/lib/dijit/_editor/nls/zh/commands.js.uncompressed.js b/lib/dijit/_editor/nls/zh/commands.js.uncompressed.js new file mode 100644 index 000000000..d1a567a53 --- /dev/null +++ b/lib/dijit/_editor/nls/zh/commands.js.uncompressed.js @@ -0,0 +1,51 @@ +define( +"dijit/_editor/nls/zh/commands", ({ + 'bold': '粗体', + 'copy': '复制', + 'cut': '剪切', + 'delete': '删除', + 'indent': '缩进', + 'insertHorizontalRule': '水平线', + 'insertOrderedList': '编号列表', + 'insertUnorderedList': '符号列表', + 'italic': '斜体', + 'justifyCenter': '居中', + 'justifyFull': '调整', + 'justifyLeft': '左对齐', + 'justifyRight': '右对齐', + 'outdent': '凸出', + 'paste': '粘贴', + 'redo': '重做', + 'removeFormat': '除去格式', + 'selectAll': '全选', + 'strikethrough': '删除线', + 'subscript': '下标', + 'superscript': '上标', + 'underline': '下划线', + 'undo': '撤销', + 'unlink': '除去链接', + 'createLink': '创建链接', + 'toggleDir': '切换方向', + 'insertImage': '插入图像', + 'insertTable': '插入/编辑表', + 'toggleTableBorder': '切换表格边框', + 'deleteTable': '删除表格', + 'tableProp': '表格属性', + 'htmlToggle': 'HTML 源', + 'foreColor': '前景颜色', + 'hiliteColor': '背景颜色', + 'plainFormatBlock': '段落样式', + 'formatBlock': '段落样式', + 'fontSize': '字体大小', + 'fontName': '字体名称', + 'tabIndent': '跳格缩进', + "fullScreen": "切换全屏幕", + "viewSource": "查看 HTML 源", + "print": "打印", + "newPage": "新建页面", + /* Error messages */ + 'systemShortcut': '只能在浏览器中通过键盘快捷方式执行“${0}”操作。使用 ${1}。', + 'ctrlKey':'ctrl+${0}', + 'appleKey':'\u2318${0}' // "command" or open-apple key on Macintosh +}) +); diff --git a/lib/dijit/_editor/plugins/AlwaysShowToolbar.js b/lib/dijit/_editor/plugins/AlwaysShowToolbar.js index 665b4bb7d..20a56fcfa 100644 --- a/lib/dijit/_editor/plugins/AlwaysShowToolbar.js +++ b/lib/dijit/_editor/plugins/AlwaysShowToolbar.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/AlwaysShowToolbar",["dojo/_base/declare","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/_base/lang","dojo/_base/sniff","dojo/_base/window","../_Plugin"],function(_1,_2,_3,_4,_5,_6,_7,_8){return _1("dijit._editor.plugins.AlwaysShowToolbar",_8,{_handleScroll:true,setEditor:function(e){if(!e.iframe){return;}this.editor=e;e.onLoadDeferred.addCallback(_5.hitch(this,this.enable));},enable:function(d){this._updateHeight();this.connect(window,"onscroll","globalOnScrollHandler");this.connect(this.editor,"onNormalizedDisplayChanged","_updateHeight");return d;},_updateHeight:function(){var e=this.editor;if(!e.isLoaded){return;}if(e.height){return;}var _9=_4.getMarginSize(e.editNode).h;if(_6("opera")){_9=e.editNode.scrollHeight;}if(!_9){_9=_4.getMarginSize(e.document.body).h;}if(_9==0){return;}if(_6("ie")<=7&&this.editor.minHeight){var _a=parseInt(this.editor.minHeight);if(_9<_a){_9=_a;}}if(_9!=this._lastHeight){this._lastHeight=_9;_4.setMarginBox(e.iframe,{h:this._lastHeight});}},_lastHeight:0,globalOnScrollHandler:function(){var _b=_6("ie")<7;if(!this._handleScroll){return;}var _c=this.editor.header;if(!this._scrollSetUp){this._scrollSetUp=true;this._scrollThreshold=_4.position(_c,true).y;}var _d=_4.docScroll().y;var s=_c.style;if(_d>this._scrollThreshold&&_d<this._scrollThreshold+this._lastHeight){if(!this._fixEnabled){var _e=_4.getMarginSize(_c);this.editor.iframe.style.marginTop=_e.h+"px";if(_b){s.left=_4.position(_c).x;if(_c.previousSibling){this._IEOriginalPos=["after",_c.previousSibling];}else{if(_c.nextSibling){this._IEOriginalPos=["before",_c.nextSibling];}else{this._IEOriginalPos=["last",_c.parentNode];}}_7.body().appendChild(_c);_2.add(_c,"dijitIEFixedToolbar");}else{s.position="fixed";s.top="0px";}_4.setMarginBox(_c,{w:_e.w});s.zIndex=2000;this._fixEnabled=true;}var _f=(this.height)?parseInt(this.editor.height):this.editor._lastHeight;s.display=(_d>this._scrollThreshold+_f)?"none":"";}else{if(this._fixEnabled){this.editor.iframe.style.marginTop="";s.position="";s.top="";s.zIndex="";s.display="";if(_b){s.left="";_2.remove(_c,"dijitIEFixedToolbar");if(this._IEOriginalPos){_3.place(_c,this._IEOriginalPos[1],this._IEOriginalPos[0]);this._IEOriginalPos=null;}else{_3.place(_c,this.editor.iframe,"before");}}s.width="";this._fixEnabled=false;}}},destroy:function(){this._IEOriginalPos=null;this._handleScroll=false;this.inherited(arguments);if(_6("ie")<7){_2.remove(this.editor.header,"dijitIEFixedToolbar");}}});});
\ No newline at end of file +define("dijit/_editor/plugins/AlwaysShowToolbar",["dojo/_base/declare","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/_base/lang","dojo/sniff","dojo/_base/window","../_Plugin"],function(_1,_2,_3,_4,_5,_6,_7,_8){return _1("dijit._editor.plugins.AlwaysShowToolbar",_8,{_handleScroll:true,setEditor:function(e){if(!e.iframe){return;}this.editor=e;e.onLoadDeferred.then(_5.hitch(this,this.enable));},enable:function(d){this._updateHeight();this.connect(window,"onscroll","globalOnScrollHandler");this.connect(this.editor,"onNormalizedDisplayChanged","_updateHeight");return d;},_updateHeight:function(){var e=this.editor;if(!e.isLoaded){return;}if(e.height){return;}var _9=_4.getMarginSize(e.editNode).h;if(_6("opera")){_9=e.editNode.scrollHeight;}if(!_9){_9=_4.getMarginSize(e.document.body).h;}if(_9==0){return;}if(_6("ie")<=7&&this.editor.minHeight){var _a=parseInt(this.editor.minHeight);if(_9<_a){_9=_a;}}if(_9!=this._lastHeight){this._lastHeight=_9;_4.setMarginBox(e.iframe,{h:this._lastHeight});}},_lastHeight:0,globalOnScrollHandler:function(){var _b=_6("ie")<7;if(!this._handleScroll){return;}var _c=this.editor.header;if(!this._scrollSetUp){this._scrollSetUp=true;this._scrollThreshold=_4.position(_c,true).y;}var _d=_4.docScroll(this.editor.ownerDocument).y;var s=_c.style;if(_d>this._scrollThreshold&&_d<this._scrollThreshold+this._lastHeight){if(!this._fixEnabled){var _e=_4.getMarginSize(_c);this.editor.iframe.style.marginTop=_e.h+"px";if(_b){s.left=_4.position(_c).x;if(_c.previousSibling){this._IEOriginalPos=["after",_c.previousSibling];}else{if(_c.nextSibling){this._IEOriginalPos=["before",_c.nextSibling];}else{this._IEOriginalPos=["last",_c.parentNode];}}this.editor.ownerDocumentBody.appendChild(_c);_2.add(_c,"dijitIEFixedToolbar");}else{s.position="fixed";s.top="0px";}_4.setMarginBox(_c,{w:_e.w});s.zIndex=2000;this._fixEnabled=true;}var _f=(this.height)?parseInt(this.editor.height):this.editor._lastHeight;s.display=(_d>this._scrollThreshold+_f)?"none":"";}else{if(this._fixEnabled){this.editor.iframe.style.marginTop="";s.position="";s.top="";s.zIndex="";s.display="";if(_b){s.left="";_2.remove(_c,"dijitIEFixedToolbar");if(this._IEOriginalPos){_3.place(_c,this._IEOriginalPos[1],this._IEOriginalPos[0]);this._IEOriginalPos=null;}else{_3.place(_c,this.editor.iframe,"before");}}s.width="";this._fixEnabled=false;}}},destroy:function(){this._IEOriginalPos=null;this._handleScroll=false;this.inherited(arguments);if(_6("ie")<7){_2.remove(this.editor.header,"dijitIEFixedToolbar");}}});});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/AlwaysShowToolbar.js.uncompressed.js b/lib/dijit/_editor/plugins/AlwaysShowToolbar.js.uncompressed.js new file mode 100644 index 000000000..1f2b7a4e2 --- /dev/null +++ b/lib/dijit/_editor/plugins/AlwaysShowToolbar.js.uncompressed.js @@ -0,0 +1,191 @@ +define("dijit/_editor/plugins/AlwaysShowToolbar", [ + "dojo/_base/declare", // declare + "dojo/dom-class", // domClass.add domClass.remove + "dojo/dom-construct", // domConstruct.place + "dojo/dom-geometry", + "dojo/_base/lang", // lang.hitch + "dojo/sniff", // has("ie") has("opera") + "dojo/_base/window", // win.body + "../_Plugin" +], function(declare, domClass, domConstruct, domGeometry, lang, has, win, _Plugin){ + +// module: +// dijit/_editor/plugins/AlwaysShowToolbar + +return declare("dijit._editor.plugins.AlwaysShowToolbar", _Plugin, { + // summary: + // This plugin is required for Editors in auto-expand mode. + // It handles the auto-expansion as the user adds/deletes text, + // and keeps the editor's toolbar visible even when the top of the editor + // has scrolled off the top of the viewport (usually when editing a long + // document). + // description: + // Specify this in extraPlugins (or plugins) parameter and also set + // height to "". + // example: + // | <script type="dojo/require"> + // | AlwaysShowToolbar: "dijit/_editor/plugins/AlwaysShowToolbar" + // | </script> + // | <div data-dojo-type="dijit/Editor" height="" + // | data-dojo-props="extraPlugins: [AlwaysShowToolbar]"> + + // _handleScroll: Boolean + // Enables/disables the handler for scroll events + _handleScroll: true, + + setEditor: function(e){ + // Overrides _Plugin.setEditor(). + if(!e.iframe){ + console.log('Port AlwaysShowToolbar plugin to work with Editor without iframe'); + return; + } + + this.editor = e; + + e.onLoadDeferred.then(lang.hitch(this, this.enable)); + }, + + enable: function(d){ + // summary: + // Enable plugin. Called when Editor has finished initializing. + // tags: + // private + + this._updateHeight(); + this.connect(window, 'onscroll', "globalOnScrollHandler"); + this.connect(this.editor, 'onNormalizedDisplayChanged', "_updateHeight"); + return d; + }, + + _updateHeight: function(){ + // summary: + // Updates the height of the editor area to fit the contents. + var e = this.editor; + if(!e.isLoaded){ return; } + if(e.height){ return; } + + var height = domGeometry.getMarginSize(e.editNode).h; + if(has("opera")){ + height = e.editNode.scrollHeight; + } + // console.debug('height',height); + // alert(this.editNode); + + //height maybe zero in some cases even though the content is not empty, + //we try the height of body instead + if(!height){ + height = domGeometry.getMarginSize(e.document.body).h; + } + + if(height == 0){ + console.debug("Can not figure out the height of the editing area!"); + return; //prevent setting height to 0 + } + if(has("ie") <= 7 && this.editor.minHeight){ + var min = parseInt(this.editor.minHeight); + if(height < min){ height = min; } + } + if(height != this._lastHeight){ + this._lastHeight = height; + // this.editorObject.style.height = this._lastHeight + "px"; + domGeometry.setMarginBox(e.iframe, { h: this._lastHeight }); + } + }, + + // _lastHeight: Integer + // Height in px of the editor at the last time we did sizing + _lastHeight: 0, + + globalOnScrollHandler: function(){ + // summary: + // Handler for scroll events that bubbled up to `<html>` + // tags: + // private + + var isIE6 = has("ie") < 7; + if(!this._handleScroll){ return; } + var tdn = this.editor.header; + if(!this._scrollSetUp){ + this._scrollSetUp = true; + this._scrollThreshold = domGeometry.position(tdn, true).y; +// var db = win.body; +// console.log("threshold:", this._scrollThreshold); + //what's this for?? comment out for now +// if((isIE6)&&(db)&&(domStyle.set or get TODO(db, "backgroundIimage")=="none")){ +// db.style.backgroundImage = "url(" + dojo.uri.moduleUri("dijit", "templates/blank.gif") + ")"; +// db.style.backgroundAttachment = "fixed"; +// } + } + + var scrollPos = domGeometry.docScroll(this.editor.ownerDocument).y; + var s = tdn.style; + + if(scrollPos > this._scrollThreshold && scrollPos < this._scrollThreshold+this._lastHeight){ + // dojo.debug(scrollPos); + if(!this._fixEnabled){ + var tdnbox = domGeometry.getMarginSize(tdn); + this.editor.iframe.style.marginTop = tdnbox.h+"px"; + + if(isIE6){ + s.left = domGeometry.position(tdn).x; + if(tdn.previousSibling){ + this._IEOriginalPos = ['after',tdn.previousSibling]; + }else if(tdn.nextSibling){ + this._IEOriginalPos = ['before',tdn.nextSibling]; + }else{ + this._IEOriginalPos = ['last',tdn.parentNode]; + } + this.editor.ownerDocumentBody.appendChild(tdn); + domClass.add(tdn,'dijitIEFixedToolbar'); + }else{ + s.position = "fixed"; + s.top = "0px"; + } + + domGeometry.setMarginBox(tdn, { w: tdnbox.w }); + s.zIndex = 2000; + this._fixEnabled = true; + } + // if we're showing the floating toolbar, make sure that if + // we've scrolled past the bottom of the editor that we hide + // the toolbar for this instance of the editor. + + // TODO: when we get multiple editor toolbar support working + // correctly, ensure that we check this against the scroll + // position of the bottom-most editor instance. + var eHeight = (this.height) ? parseInt(this.editor.height) : this.editor._lastHeight; + s.display = (scrollPos > this._scrollThreshold+eHeight) ? "none" : ""; + }else if(this._fixEnabled){ + this.editor.iframe.style.marginTop = ''; + s.position = ""; + s.top = ""; + s.zIndex = ""; + s.display = ""; + if(isIE6){ + s.left = ""; + domClass.remove(tdn,'dijitIEFixedToolbar'); + if(this._IEOriginalPos){ + domConstruct.place(tdn, this._IEOriginalPos[1], this._IEOriginalPos[0]); + this._IEOriginalPos = null; + }else{ + domConstruct.place(tdn, this.editor.iframe, 'before'); + } + } + s.width = ""; + this._fixEnabled = false; + } + }, + + destroy: function(){ + // Overrides _Plugin.destroy(). TODO: call this.inherited() rather than repeating code. + this._IEOriginalPos = null; + this._handleScroll = false; + this.inherited(arguments); + + if(has("ie") < 7){ + domClass.remove(this.editor.header, 'dijitIEFixedToolbar'); + } + } +}); + +}); diff --git a/lib/dijit/_editor/plugins/EnterKeyHandling.js b/lib/dijit/_editor/plugins/EnterKeyHandling.js index 60b3baa8a..6d226232c 100644 --- a/lib/dijit/_editor/plugins/EnterKeyHandling.js +++ b/lib/dijit/_editor/plugins/EnterKeyHandling.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/EnterKeyHandling",["dojo/_base/declare","dojo/dom-construct","dojo/_base/event","dojo/keys","dojo/_base/lang","dojo/_base/sniff","dojo/_base/window","dojo/window","../_Plugin","../RichText","../range","../selection"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c){return _1("dijit._editor.plugins.EnterKeyHandling",_9,{blockNodeForEnter:"BR",constructor:function(_d){if(_d){if("blockNodeForEnter" in _d){_d.blockNodeForEnter=_d.blockNodeForEnter.toUpperCase();}_5.mixin(this,_d);}},setEditor:function(_e){if(this.editor===_e){return;}this.editor=_e;if(this.blockNodeForEnter=="BR"){this.editor.customUndo=true;_e.onLoadDeferred.then(_5.hitch(this,function(d){this.connect(_e.document,"onkeypress",function(e){if(e.charOrCode==_4.ENTER){var ne=_5.mixin({},e);ne.shiftKey=true;if(!this.handleEnterKey(ne)){_3.stop(e);}}});if(_6("ie")==9){this.connect(_e.document,"onpaste",function(e){setTimeout(dojo.hitch(this,function(){var r=this.editor.document.selection.createRange();r.move("character",-1);r.select();r.move("character",1);r.select();}),0);});}return d;}));}else{if(this.blockNodeForEnter){var h=_5.hitch(this,this.handleEnterKey);_e.addKeyHandler(13,0,0,h);_e.addKeyHandler(13,0,1,h);this.connect(this.editor,"onKeyPressed","onKeyPressed");}}},onKeyPressed:function(){if(this._checkListLater){if(_7.withGlobal(this.editor.window,"isCollapsed",dijit)){var _f=_7.withGlobal(this.editor.window,"getAncestorElement",_c,["LI"]);if(!_f){_a.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter);var _10=_7.withGlobal(this.editor.window,"getAncestorElement",_c,[this.blockNodeForEnter]);if(_10){_10.innerHTML=this.bogusHtmlContent;if(_6("ie")){var r=this.editor.document.selection.createRange();r.move("character",-1);r.select();}}else{console.error("onKeyPressed: Cannot find the new block node");}}else{if(_6("mozilla")){if(_f.parentNode.parentNode.nodeName=="LI"){_f=_f.parentNode.parentNode;}}var fc=_f.firstChild;if(fc&&fc.nodeType==1&&(fc.nodeName=="UL"||fc.nodeName=="OL")){_f.insertBefore(fc.ownerDocument.createTextNode(" "),fc);var _11=_b.create(this.editor.window);_11.setStart(_f.firstChild,0);var _12=_b.getSelection(this.editor.window,true);_12.removeAllRanges();_12.addRange(_11);}}}this._checkListLater=false;}if(this._pressedEnterInBlock){if(this._pressedEnterInBlock.previousSibling){this.removeTrailingBr(this._pressedEnterInBlock.previousSibling);}delete this._pressedEnterInBlock;}},bogusHtmlContent:" ",blockNodes:/^(?:P|H1|H2|H3|H4|H5|H6|LI)$/,handleEnterKey:function(e){var _13,_14,_15,_16,_17,_18,doc=this.editor.document,br,rs,txt;if(e.shiftKey){var _19=_7.withGlobal(this.editor.window,"getParentElement",_c);var _1a=_b.getAncestor(_19,this.blockNodes);if(_1a){if(_1a.tagName=="LI"){return true;}_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);if(!_14.collapsed){_14.deleteContents();_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}if(_b.atBeginningOfContainer(_1a,_14.startContainer,_14.startOffset)){br=doc.createElement("br");_15=_b.create(this.editor.window);_1a.insertBefore(br,_1a.firstChild);_15.setStartAfter(br);_13.removeAllRanges();_13.addRange(_15);}else{if(_b.atEndOfContainer(_1a,_14.startContainer,_14.startOffset)){_15=_b.create(this.editor.window);br=doc.createElement("br");_1a.appendChild(br);_1a.appendChild(doc.createTextNode(" "));_15.setStart(_1a.lastChild,0);_13.removeAllRanges();_13.addRange(_15);}else{rs=_14.startContainer;if(rs&&rs.nodeType==3){txt=rs.nodeValue;_7.withGlobal(this.editor.window,function(){_16=doc.createTextNode(txt.substring(0,_14.startOffset));_17=doc.createTextNode(txt.substring(_14.startOffset));_18=doc.createElement("br");if(_17.nodeValue==""&&_6("webkit")){_17=doc.createTextNode(" ");}_2.place(_16,rs,"after");_2.place(_18,_16,"after");_2.place(_17,_18,"after");_2.destroy(rs);_15=_b.create();_15.setStart(_17,0);_13.removeAllRanges();_13.addRange(_15);});return false;}return true;}}}else{_13=_b.getSelection(this.editor.window);if(_13.rangeCount){_14=_13.getRangeAt(0);if(_14&&_14.startContainer){if(!_14.collapsed){_14.deleteContents();_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}rs=_14.startContainer;if(rs&&rs.nodeType==3){_7.withGlobal(this.editor.window,_5.hitch(this,function(){var _1b=false;var _1c=_14.startOffset;if(rs.length<_1c){ret=this._adjustNodeAndOffset(rs,_1c);rs=ret.node;_1c=ret.offset;}txt=rs.nodeValue;_16=doc.createTextNode(txt.substring(0,_1c));_17=doc.createTextNode(txt.substring(_1c));_18=doc.createElement("br");if(!_17.length){_17=doc.createTextNode(" ");_1b=true;}if(_16.length){_2.place(_16,rs,"after");}else{_16=rs;}_2.place(_18,_16,"after");_2.place(_17,_18,"after");_2.destroy(rs);_15=_b.create();_15.setStart(_17,0);_15.setEnd(_17,_17.length);_13.removeAllRanges();_13.addRange(_15);if(_1b&&!_6("webkit")){_c.remove();}else{_c.collapse(true);}}));}else{var _1d;if(_14.startOffset>=0){_1d=rs.childNodes[_14.startOffset];}_7.withGlobal(this.editor.window,_5.hitch(this,function(){var _1e=doc.createElement("br");var _1f=doc.createTextNode(" ");if(!_1d){rs.appendChild(_1e);rs.appendChild(_1f);}else{_2.place(_1e,_1d,"before");_2.place(_1f,_1e,"after");}_15=_b.create(_7.global);_15.setStart(_1f,0);_15.setEnd(_1f,_1f.length);_13.removeAllRanges();_13.addRange(_15);_c.collapse(true);}));}}}else{_a.prototype.execCommand.call(this.editor,"inserthtml","<br>");}}return false;}var _20=true;_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);if(!_14.collapsed){_14.deleteContents();_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}var _21=_b.getBlockAncestor(_14.endContainer,null,this.editor.editNode);var _22=_21.blockNode;if((this._checkListLater=(_22&&(_22.nodeName=="LI"||_22.parentNode.nodeName=="LI")))){if(_6("mozilla")){this._pressedEnterInBlock=_22;}if(/^(\s| | |\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s| | |\xA0)<\/span>)?(<br>)?$/.test(_22.innerHTML)){_22.innerHTML="";if(_6("webkit")){_15=_b.create(this.editor.window);_15.setStart(_22,0);_13.removeAllRanges();_13.addRange(_15);}this._checkListLater=false;}return true;}if(!_21.blockNode||_21.blockNode===this.editor.editNode){try{_a.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter);}catch(e2){}_21={blockNode:_7.withGlobal(this.editor.window,"getAncestorElement",_c,[this.blockNodeForEnter]),blockContainer:this.editor.editNode};if(_21.blockNode){if(_21.blockNode!=this.editor.editNode&&(!(_21.blockNode.textContent||_21.blockNode.innerHTML).replace(/^\s+|\s+$/g,"").length)){this.removeTrailingBr(_21.blockNode);return false;}}else{_21.blockNode=this.editor.editNode;}_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}var _23=doc.createElement(this.blockNodeForEnter);_23.innerHTML=this.bogusHtmlContent;this.removeTrailingBr(_21.blockNode);var _24=_14.endOffset;var _25=_14.endContainer;if(_25.length<_24){var ret=this._adjustNodeAndOffset(_25,_24);_25=ret.node;_24=ret.offset;}if(_b.atEndOfContainer(_21.blockNode,_25,_24)){if(_21.blockNode===_21.blockContainer){_21.blockNode.appendChild(_23);}else{_2.place(_23,_21.blockNode,"after");}_20=false;_15=_b.create(this.editor.window);_15.setStart(_23,0);_13.removeAllRanges();_13.addRange(_15);if(this.editor.height){_8.scrollIntoView(_23);}}else{if(_b.atBeginningOfContainer(_21.blockNode,_14.startContainer,_14.startOffset)){_2.place(_23,_21.blockNode,_21.blockNode===_21.blockContainer?"first":"before");if(_23.nextSibling&&this.editor.height){_15=_b.create(this.editor.window);_15.setStart(_23.nextSibling,0);_13.removeAllRanges();_13.addRange(_15);_8.scrollIntoView(_23.nextSibling);}_20=false;}else{if(_21.blockNode===_21.blockContainer){_21.blockNode.appendChild(_23);}else{_2.place(_23,_21.blockNode,"after");}_20=false;if(_21.blockNode.style){if(_23.style){if(_21.blockNode.style.cssText){_23.style.cssText=_21.blockNode.style.cssText;}}}rs=_14.startContainer;var _26;if(rs&&rs.nodeType==3){var _27,_28;_24=_14.endOffset;if(rs.length<_24){ret=this._adjustNodeAndOffset(rs,_24);rs=ret.node;_24=ret.offset;}txt=rs.nodeValue;_16=doc.createTextNode(txt.substring(0,_24));_17=doc.createTextNode(txt.substring(_24,txt.length));_2.place(_16,rs,"before");_2.place(_17,rs,"after");_2.destroy(rs);var _29=_16.parentNode;while(_29!==_21.blockNode){var tg=_29.tagName;var _2a=doc.createElement(tg);if(_29.style){if(_2a.style){if(_29.style.cssText){_2a.style.cssText=_29.style.cssText;}}}if(_29.tagName==="FONT"){if(_29.color){_2a.color=_29.color;}if(_29.face){_2a.face=_29.face;}if(_29.size){_2a.size=_29.size;}}_27=_17;while(_27){_28=_27.nextSibling;_2a.appendChild(_27);_27=_28;}_2.place(_2a,_29,"after");_16=_29;_17=_2a;_29=_29.parentNode;}_27=_17;if(_27.nodeType==1||(_27.nodeType==3&&_27.nodeValue)){_23.innerHTML="";}_26=_27;while(_27){_28=_27.nextSibling;_23.appendChild(_27);_27=_28;}}_15=_b.create(this.editor.window);var _2b;var _2c=_26;if(this.blockNodeForEnter!=="BR"){while(_2c){_2b=_2c;_28=_2c.firstChild;_2c=_28;}if(_2b&&_2b.parentNode){_23=_2b.parentNode;_15.setStart(_23,0);_13.removeAllRanges();_13.addRange(_15);if(this.editor.height){_8.scrollIntoView(_23);}if(_6("mozilla")){this._pressedEnterInBlock=_21.blockNode;}}else{_20=true;}}else{_15.setStart(_23,0);_13.removeAllRanges();_13.addRange(_15);if(this.editor.height){_8.scrollIntoView(_23);}if(_6("mozilla")){this._pressedEnterInBlock=_21.blockNode;}}}}return _20;},_adjustNodeAndOffset:function(_2d,_2e){while(_2d.length<_2e&&_2d.nextSibling&&_2d.nextSibling.nodeType==3){_2e=_2e-_2d.length;_2d=_2d.nextSibling;}return {"node":_2d,"offset":_2e};},removeTrailingBr:function(_2f){var _30=/P|DIV|LI/i.test(_2f.tagName)?_2f:_c.getParentOfType(_2f,["P","DIV","LI"]);if(!_30){return;}if(_30.lastChild){if((_30.childNodes.length>1&&_30.lastChild.nodeType==3&&/^[\s\xAD]*$/.test(_30.lastChild.nodeValue))||_30.lastChild.tagName=="BR"){_2.destroy(_30.lastChild);}}if(!_30.childNodes.length){_30.innerHTML=this.bogusHtmlContent;}}});});
\ No newline at end of file +define("dijit/_editor/plugins/EnterKeyHandling",["dojo/_base/declare","dojo/dom-construct","dojo/_base/event","dojo/keys","dojo/_base/lang","dojo/sniff","dojo/_base/window","dojo/window","../_Plugin","../RichText","../range","../../_base/focus"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c){return _1("dijit._editor.plugins.EnterKeyHandling",_9,{blockNodeForEnter:"BR",constructor:function(_d){if(_d){if("blockNodeForEnter" in _d){_d.blockNodeForEnter=_d.blockNodeForEnter.toUpperCase();}_5.mixin(this,_d);}},setEditor:function(_e){if(this.editor===_e){return;}this.editor=_e;if(this.blockNodeForEnter=="BR"){this.editor.customUndo=true;_e.onLoadDeferred.then(_5.hitch(this,function(d){this.connect(_e.document,"onkeypress",function(e){if(e.charOrCode==_4.ENTER){var ne=_5.mixin({},e);ne.shiftKey=true;if(!this.handleEnterKey(ne)){_3.stop(e);}}});if(_6("ie")>=9){this.connect(_e.document,"onpaste",function(e){setTimeout(dojo.hitch(this,function(){var r=this.editor.document.selection.createRange();r.move("character",-1);r.select();r.move("character",1);r.select();}),0);});}return d;}));}else{if(this.blockNodeForEnter){var h=_5.hitch(this,this.handleEnterKey);_e.addKeyHandler(13,0,0,h);_e.addKeyHandler(13,0,1,h);this.connect(this.editor,"onKeyPressed","onKeyPressed");}}},onKeyPressed:function(){if(this._checkListLater){if(_7.withGlobal(this.editor.window,"isCollapsed",_c)){var _f=this.editor._sCall("getAncestorElement",["LI"]);if(!_f){_a.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter);var _10=this.editor._sCall("getAncestorElement",[this.blockNodeForEnter]);if(_10){_10.innerHTML=this.bogusHtmlContent;if(_6("ie")<=9){var r=this.editor.document.selection.createRange();r.move("character",-1);r.select();}}else{console.error("onKeyPressed: Cannot find the new block node");}}else{if(_6("mozilla")){if(_f.parentNode.parentNode.nodeName=="LI"){_f=_f.parentNode.parentNode;}}var fc=_f.firstChild;if(fc&&fc.nodeType==1&&(fc.nodeName=="UL"||fc.nodeName=="OL")){_f.insertBefore(fc.ownerDocument.createTextNode(" "),fc);var _11=_b.create(this.editor.window);_11.setStart(_f.firstChild,0);var _12=_b.getSelection(this.editor.window,true);_12.removeAllRanges();_12.addRange(_11);}}}this._checkListLater=false;}if(this._pressedEnterInBlock){if(this._pressedEnterInBlock.previousSibling){this.removeTrailingBr(this._pressedEnterInBlock.previousSibling);}delete this._pressedEnterInBlock;}},bogusHtmlContent:" ",blockNodes:/^(?:P|H1|H2|H3|H4|H5|H6|LI)$/,handleEnterKey:function(e){var _13,_14,_15,_16,_17,_18,doc=this.editor.document,br,rs,txt;if(e.shiftKey){var _19=this.editor._sCall("getParentElement",[]);var _1a=_b.getAncestor(_19,this.blockNodes);if(_1a){if(_1a.tagName=="LI"){return true;}_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);if(!_14.collapsed){_14.deleteContents();_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}if(_b.atBeginningOfContainer(_1a,_14.startContainer,_14.startOffset)){br=doc.createElement("br");_15=_b.create(this.editor.window);_1a.insertBefore(br,_1a.firstChild);_15.setStartAfter(br);_13.removeAllRanges();_13.addRange(_15);}else{if(_b.atEndOfContainer(_1a,_14.startContainer,_14.startOffset)){_15=_b.create(this.editor.window);br=doc.createElement("br");_1a.appendChild(br);_1a.appendChild(doc.createTextNode(" "));_15.setStart(_1a.lastChild,0);_13.removeAllRanges();_13.addRange(_15);}else{rs=_14.startContainer;if(rs&&rs.nodeType==3){txt=rs.nodeValue;_16=doc.createTextNode(txt.substring(0,_14.startOffset));_17=doc.createTextNode(txt.substring(_14.startOffset));_18=doc.createElement("br");if(_17.nodeValue==""&&_6("webkit")){_17=doc.createTextNode(" ");}_2.place(_16,rs,"after");_2.place(_18,_16,"after");_2.place(_17,_18,"after");_2.destroy(rs);_15=_b.create(this.editor.window);_15.setStart(_17,0);_13.removeAllRanges();_13.addRange(_15);return false;}return true;}}}else{_13=_b.getSelection(this.editor.window);if(_13.rangeCount){_14=_13.getRangeAt(0);if(_14&&_14.startContainer){if(!_14.collapsed){_14.deleteContents();_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}rs=_14.startContainer;if(rs&&rs.nodeType==3){var _1b=false;var _1c=_14.startOffset;if(rs.length<_1c){ret=this._adjustNodeAndOffset(rs,_1c);rs=ret.node;_1c=ret.offset;}txt=rs.nodeValue;_16=doc.createTextNode(txt.substring(0,_1c));_17=doc.createTextNode(txt.substring(_1c));_18=doc.createElement("br");if(!_17.length){_17=doc.createTextNode(" ");_1b=true;}if(_16.length){_2.place(_16,rs,"after");}else{_16=rs;}_2.place(_18,_16,"after");_2.place(_17,_18,"after");_2.destroy(rs);_15=_b.create(this.editor.window);_15.setStart(_17,0);_15.setEnd(_17,_17.length);_13.removeAllRanges();_13.addRange(_15);if(_1b&&!_6("webkit")){this.editor._sCall("remove",[]);}else{this.editor._sCall("collapse",[true]);}}else{var _1d;if(_14.startOffset>=0){_1d=rs.childNodes[_14.startOffset];}var _18=doc.createElement("br");var _17=doc.createTextNode(" ");if(!_1d){rs.appendChild(_18);rs.appendChild(_17);}else{_2.place(_18,_1d,"before");_2.place(_17,_18,"after");}_15=_b.create(this.editor.window);_15.setStart(_17,0);_15.setEnd(_17,_17.length);_13.removeAllRanges();_13.addRange(_15);this.editor._sCall("collapse",[true]);}}}else{_a.prototype.execCommand.call(this.editor,"inserthtml","<br>");}}return false;}var _1e=true;_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);if(!_14.collapsed){_14.deleteContents();_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}var _1f=_b.getBlockAncestor(_14.endContainer,null,this.editor.editNode);var _20=_1f.blockNode;if((this._checkListLater=(_20&&(_20.nodeName=="LI"||_20.parentNode.nodeName=="LI")))){if(_6("mozilla")){this._pressedEnterInBlock=_20;}if(/^(\s| | |\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s| | |\xA0)<\/span>)?(<br>)?$/.test(_20.innerHTML)){_20.innerHTML="";if(_6("webkit")){_15=_b.create(this.editor.window);_15.setStart(_20,0);_13.removeAllRanges();_13.addRange(_15);}this._checkListLater=false;}return true;}if(!_1f.blockNode||_1f.blockNode===this.editor.editNode){try{_a.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter);}catch(e2){}_1f={blockNode:this.editor._sCall("getAncestorElement",[this.blockNodeForEnter]),blockContainer:this.editor.editNode};if(_1f.blockNode){if(_1f.blockNode!=this.editor.editNode&&(!(_1f.blockNode.textContent||_1f.blockNode.innerHTML).replace(/^\s+|\s+$/g,"").length)){this.removeTrailingBr(_1f.blockNode);return false;}}else{_1f.blockNode=this.editor.editNode;}_13=_b.getSelection(this.editor.window);_14=_13.getRangeAt(0);}var _21=doc.createElement(this.blockNodeForEnter);_21.innerHTML=this.bogusHtmlContent;this.removeTrailingBr(_1f.blockNode);var _22=_14.endOffset;var _23=_14.endContainer;if(_23.length<_22){var ret=this._adjustNodeAndOffset(_23,_22);_23=ret.node;_22=ret.offset;}if(_b.atEndOfContainer(_1f.blockNode,_23,_22)){if(_1f.blockNode===_1f.blockContainer){_1f.blockNode.appendChild(_21);}else{_2.place(_21,_1f.blockNode,"after");}_1e=false;_15=_b.create(this.editor.window);_15.setStart(_21,0);_13.removeAllRanges();_13.addRange(_15);if(this.editor.height){_8.scrollIntoView(_21);}}else{if(_b.atBeginningOfContainer(_1f.blockNode,_14.startContainer,_14.startOffset)){_2.place(_21,_1f.blockNode,_1f.blockNode===_1f.blockContainer?"first":"before");if(_21.nextSibling&&this.editor.height){_15=_b.create(this.editor.window);_15.setStart(_21.nextSibling,0);_13.removeAllRanges();_13.addRange(_15);_8.scrollIntoView(_21.nextSibling);}_1e=false;}else{if(_1f.blockNode===_1f.blockContainer){_1f.blockNode.appendChild(_21);}else{_2.place(_21,_1f.blockNode,"after");}_1e=false;if(_1f.blockNode.style){if(_21.style){if(_1f.blockNode.style.cssText){_21.style.cssText=_1f.blockNode.style.cssText;}}}rs=_14.startContainer;var _24;if(rs&&rs.nodeType==3){var _25,_26;_22=_14.endOffset;if(rs.length<_22){ret=this._adjustNodeAndOffset(rs,_22);rs=ret.node;_22=ret.offset;}txt=rs.nodeValue;_16=doc.createTextNode(txt.substring(0,_22));_17=doc.createTextNode(txt.substring(_22,txt.length));_2.place(_16,rs,"before");_2.place(_17,rs,"after");_2.destroy(rs);var _27=_16.parentNode;while(_27!==_1f.blockNode){var tg=_27.tagName;var _28=doc.createElement(tg);if(_27.style){if(_28.style){if(_27.style.cssText){_28.style.cssText=_27.style.cssText;}}}if(_27.tagName==="FONT"){if(_27.color){_28.color=_27.color;}if(_27.face){_28.face=_27.face;}if(_27.size){_28.size=_27.size;}}_25=_17;while(_25){_26=_25.nextSibling;_28.appendChild(_25);_25=_26;}_2.place(_28,_27,"after");_16=_27;_17=_28;_27=_27.parentNode;}_25=_17;if(_25.nodeType==1||(_25.nodeType==3&&_25.nodeValue)){_21.innerHTML="";}_24=_25;while(_25){_26=_25.nextSibling;_21.appendChild(_25);_25=_26;}}_15=_b.create(this.editor.window);var _29;var _2a=_24;if(this.blockNodeForEnter!=="BR"){while(_2a){_29=_2a;_26=_2a.firstChild;_2a=_26;}if(_29&&_29.parentNode){_21=_29.parentNode;_15.setStart(_21,0);_13.removeAllRanges();_13.addRange(_15);if(this.editor.height){_8.scrollIntoView(_21);}if(_6("mozilla")){this._pressedEnterInBlock=_1f.blockNode;}}else{_1e=true;}}else{_15.setStart(_21,0);_13.removeAllRanges();_13.addRange(_15);if(this.editor.height){_8.scrollIntoView(_21);}if(_6("mozilla")){this._pressedEnterInBlock=_1f.blockNode;}}}}return _1e;},_adjustNodeAndOffset:function(_2b,_2c){while(_2b.length<_2c&&_2b.nextSibling&&_2b.nextSibling.nodeType==3){_2c=_2c-_2b.length;_2b=_2b.nextSibling;}return {"node":_2b,"offset":_2c};},removeTrailingBr:function(_2d){var _2e=/P|DIV|LI/i.test(_2d.tagName)?_2d:this.editor._sCall("getParentOfType",[_2d,["P","DIV","LI"]]);if(!_2e){return;}if(_2e.lastChild){if((_2e.childNodes.length>1&&_2e.lastChild.nodeType==3&&/^[\s\xAD]*$/.test(_2e.lastChild.nodeValue))||_2e.lastChild.tagName=="BR"){_2.destroy(_2e.lastChild);}}if(!_2e.childNodes.length){_2e.innerHTML=this.bogusHtmlContent;}}});});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/EnterKeyHandling.js.uncompressed.js b/lib/dijit/_editor/plugins/EnterKeyHandling.js.uncompressed.js new file mode 100644 index 000000000..e5c7b7466 --- /dev/null +++ b/lib/dijit/_editor/plugins/EnterKeyHandling.js.uncompressed.js @@ -0,0 +1,622 @@ +define("dijit/_editor/plugins/EnterKeyHandling", [ + "dojo/_base/declare", // declare + "dojo/dom-construct", // domConstruct.destroy domConstruct.place + "dojo/_base/event", // event.stop + "dojo/keys", // keys.ENTER + "dojo/_base/lang", + "dojo/sniff", // has("ie") has("mozilla") has("webkit") + "dojo/_base/window", // win.withGlobal + "dojo/window", // winUtils.scrollIntoView + "../_Plugin", + "../RichText", + "../range", + "../../_base/focus" +], function(declare, domConstruct, event, keys, lang, has, win, winUtils, _Plugin, RichText, rangeapi, baseFocus){ + +// module: +// dijit/_editor/plugins/EnterKeyHandling + +return declare("dijit._editor.plugins.EnterKeyHandling", _Plugin, { + // summary: + // This plugin tries to make all browsers behave consistently with regard to + // how ENTER behaves in the editor window. It traps the ENTER key and alters + // the way DOM is constructed in certain cases to try to commonize the generated + // DOM and behaviors across browsers. + // + // description: + // This plugin has three modes: + // + // - blockNodeForEnter=BR + // - blockNodeForEnter=DIV + // - blockNodeForEnter=P + // + // In blockNodeForEnter=P, the ENTER key starts a new + // paragraph, and shift-ENTER starts a new line in the current paragraph. + // For example, the input: + // + // | first paragraph <shift-ENTER> + // | second line of first paragraph <ENTER> + // | second paragraph + // + // will generate: + // + // | <p> + // | first paragraph + // | <br/> + // | second line of first paragraph + // | </p> + // | <p> + // | second paragraph + // | </p> + // + // In BR and DIV mode, the ENTER key conceptually goes to a new line in the + // current paragraph, and users conceptually create a new paragraph by pressing ENTER twice. + // For example, if the user enters text into an editor like this: + // + // | one <ENTER> + // | two <ENTER> + // | three <ENTER> + // | <ENTER> + // | four <ENTER> + // | five <ENTER> + // | six <ENTER> + // + // It will appear on the screen as two 'paragraphs' of three lines each. Markupwise, this generates: + // + // BR: + // | one<br/> + // | two<br/> + // | three<br/> + // | <br/> + // | four<br/> + // | five<br/> + // | six<br/> + // + // DIV: + // | <div>one</div> + // | <div>two</div> + // | <div>three</div> + // | <div> </div> + // | <div>four</div> + // | <div>five</div> + // | <div>six</div> + + // blockNodeForEnter: String + // This property decides the behavior of Enter key. It can be either P, + // DIV, BR, or empty (which means disable this feature). Anything else + // will trigger errors. The default is 'BR' + // + // See class description for more details. + blockNodeForEnter: 'BR', + + constructor: function(args){ + if(args){ + if("blockNodeForEnter" in args){ + args.blockNodeForEnter = args.blockNodeForEnter.toUpperCase(); + } + lang.mixin(this,args); + } + }, + + setEditor: function(editor){ + // Overrides _Plugin.setEditor(). + if(this.editor === editor){ return; } + this.editor = editor; + if(this.blockNodeForEnter == 'BR'){ + // While Moz has a mode tht mostly works, it's still a little different, + // So, try to just have a common mode and be consistent. Which means + // we need to enable customUndo, if not already enabled. + this.editor.customUndo = true; + editor.onLoadDeferred.then(lang.hitch(this,function(d){ + this.connect(editor.document, "onkeypress", function(e){ + if(e.charOrCode == keys.ENTER){ + // Just do it manually. The handleEnterKey has a shift mode that + // Always acts like <br>, so just use it. + var ne = lang.mixin({},e); + ne.shiftKey = true; + if(!this.handleEnterKey(ne)){ + event.stop(e); + } + } + }); + if(has("ie") >= 9){ + this.connect(editor.document, "onpaste", function(e){ + setTimeout(dojo.hitch(this, function(){ + // Use the old range/selection code to kick IE 9 into updating + // its range by moving it back, then forward, one 'character'. + var r = this.editor.document.selection.createRange(); + r.move('character',-1); + r.select(); + r.move('character',1); + r.select(); + }),0); + }); + } + return d; + })); + }else if(this.blockNodeForEnter){ + // add enter key handler + // FIXME: need to port to the new event code!! + var h = lang.hitch(this,this.handleEnterKey); + editor.addKeyHandler(13, 0, 0, h); //enter + editor.addKeyHandler(13, 0, 1, h); //shift+enter + this.connect(this.editor,'onKeyPressed','onKeyPressed'); + } + }, + onKeyPressed: function(){ + // summary: + // Handler for keypress events. + // tags: + // private + if(this._checkListLater){ + if(win.withGlobal(this.editor.window, 'isCollapsed', baseFocus)){ + var liparent = this.editor._sCall('getAncestorElement', ['LI']); + if(!liparent){ + // circulate the undo detection code by calling RichText::execCommand directly + RichText.prototype.execCommand.call(this.editor, 'formatblock',this.blockNodeForEnter); + // set the innerHTML of the new block node + var block = this.editor._sCall('getAncestorElement', [this.blockNodeForEnter]); + if(block){ + block.innerHTML=this.bogusHtmlContent; + if(has("ie") <= 9){ + // move to the start by moving backwards one char + var r = this.editor.document.selection.createRange(); + r.move('character',-1); + r.select(); + } + }else{ + console.error('onKeyPressed: Cannot find the new block node'); // FIXME + } + }else{ + if(has("mozilla")){ + if(liparent.parentNode.parentNode.nodeName == 'LI'){ + liparent=liparent.parentNode.parentNode; + } + } + var fc=liparent.firstChild; + if(fc && fc.nodeType == 1 && (fc.nodeName == 'UL' || fc.nodeName == 'OL')){ + liparent.insertBefore(fc.ownerDocument.createTextNode('\xA0'),fc); + var newrange = rangeapi.create(this.editor.window); + newrange.setStart(liparent.firstChild,0); + var selection = rangeapi.getSelection(this.editor.window, true); + selection.removeAllRanges(); + selection.addRange(newrange); + } + } + } + this._checkListLater = false; + } + if(this._pressedEnterInBlock){ + // the new created is the original current P, so we have previousSibling below + if(this._pressedEnterInBlock.previousSibling){ + this.removeTrailingBr(this._pressedEnterInBlock.previousSibling); + } + delete this._pressedEnterInBlock; + } + }, + + // bogusHtmlContent: [private] String + // HTML to stick into a new empty block + bogusHtmlContent: ' ', // + + // blockNodes: [private] Regex + // Regex for testing if a given tag is a block level (display:block) tag + blockNodes: /^(?:P|H1|H2|H3|H4|H5|H6|LI)$/, + + handleEnterKey: function(e){ + // summary: + // Handler for enter key events when blockNodeForEnter is DIV or P. + // description: + // Manually handle enter key event to make the behavior consistent across + // all supported browsers. See class description for details. + // tags: + // private + + var selection, range, newrange, startNode, endNode, brNode, doc=this.editor.document,br,rs,txt; + if(e.shiftKey){ // shift+enter always generates <br> + var parent = this.editor._sCall('getParentElement', []); + var header = rangeapi.getAncestor(parent,this.blockNodes); + if(header){ + if(header.tagName == 'LI'){ + return true; // let browser handle + } + selection = rangeapi.getSelection(this.editor.window); + range = selection.getRangeAt(0); + if(!range.collapsed){ + range.deleteContents(); + selection = rangeapi.getSelection(this.editor.window); + range = selection.getRangeAt(0); + } + if(rangeapi.atBeginningOfContainer(header, range.startContainer, range.startOffset)){ + br=doc.createElement('br'); + newrange = rangeapi.create(this.editor.window); + header.insertBefore(br,header.firstChild); + newrange.setStartAfter(br); + selection.removeAllRanges(); + selection.addRange(newrange); + }else if(rangeapi.atEndOfContainer(header, range.startContainer, range.startOffset)){ + newrange = rangeapi.create(this.editor.window); + br=doc.createElement('br'); + header.appendChild(br); + header.appendChild(doc.createTextNode('\xA0')); + newrange.setStart(header.lastChild,0); + selection.removeAllRanges(); + selection.addRange(newrange); + }else{ + rs = range.startContainer; + if(rs && rs.nodeType == 3){ + // Text node, we have to split it. + txt = rs.nodeValue; + startNode = doc.createTextNode(txt.substring(0, range.startOffset)); + endNode = doc.createTextNode(txt.substring(range.startOffset)); + brNode = doc.createElement("br"); + + if(endNode.nodeValue == "" && has("webkit")){ + endNode = doc.createTextNode('\xA0') + } + domConstruct.place(startNode, rs, "after"); + domConstruct.place(brNode, startNode, "after"); + domConstruct.place(endNode, brNode, "after"); + domConstruct.destroy(rs); + newrange = rangeapi.create(this.editor.window); + newrange.setStart(endNode,0); + selection.removeAllRanges(); + selection.addRange(newrange); + return false; + } + return true; // let browser handle + } + }else{ + selection = rangeapi.getSelection(this.editor.window); + if(selection.rangeCount){ + range = selection.getRangeAt(0); + if(range && range.startContainer){ + if(!range.collapsed){ + range.deleteContents(); + selection = rangeapi.getSelection(this.editor.window); + range = selection.getRangeAt(0); + } + rs = range.startContainer; + if(rs && rs.nodeType == 3){ + // Text node, we have to split it. + var endEmpty = false; + + var offset = range.startOffset; + if(rs.length < offset){ + //We are not splitting the right node, try to locate the correct one + ret = this._adjustNodeAndOffset(rs, offset); + rs = ret.node; + offset = ret.offset; + } + txt = rs.nodeValue; + + startNode = doc.createTextNode(txt.substring(0, offset)); + endNode = doc.createTextNode(txt.substring(offset)); + brNode = doc.createElement("br"); + + if(!endNode.length){ + endNode = doc.createTextNode('\xA0'); + endEmpty = true; + } + + if(startNode.length){ + domConstruct.place(startNode, rs, "after"); + }else{ + startNode = rs; + } + domConstruct.place(brNode, startNode, "after"); + domConstruct.place(endNode, brNode, "after"); + domConstruct.destroy(rs); + newrange = rangeapi.create(this.editor.window); + newrange.setStart(endNode,0); + newrange.setEnd(endNode, endNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + if(endEmpty && !has("webkit")){ + this.editor._sCall("remove", []); + }else{ + this.editor._sCall("collapse", [true]); + } + }else{ + var targetNode; + if(range.startOffset >= 0){ + targetNode = rs.childNodes[range.startOffset]; + } + var brNode = doc.createElement("br"); + var endNode = doc.createTextNode('\xA0'); + if(!targetNode){ + rs.appendChild(brNode); + rs.appendChild(endNode); + }else{ + domConstruct.place(brNode, targetNode, "before"); + domConstruct.place(endNode, brNode, "after"); + } + newrange = rangeapi.create(this.editor.window); + newrange.setStart(endNode,0); + newrange.setEnd(endNode, endNode.length); + selection.removeAllRanges(); + selection.addRange(newrange); + this.editor._sCall("collapse", [true]); + } + } + }else{ + // don't change this: do not call this.execCommand, as that may have other logic in subclass + RichText.prototype.execCommand.call(this.editor, 'inserthtml', '<br>'); + } + } + return false; + } + var _letBrowserHandle = true; + + // first remove selection + selection = rangeapi.getSelection(this.editor.window); + range = selection.getRangeAt(0); + if(!range.collapsed){ + range.deleteContents(); + selection = rangeapi.getSelection(this.editor.window); + range = selection.getRangeAt(0); + } + + var block = rangeapi.getBlockAncestor(range.endContainer, null, this.editor.editNode); + var blockNode = block.blockNode; + + // if this is under a LI or the parent of the blockNode is LI, just let browser to handle it + if((this._checkListLater = (blockNode && (blockNode.nodeName == 'LI' || blockNode.parentNode.nodeName == 'LI')))){ + if(has("mozilla")){ + // press enter in middle of P may leave a trailing <br/>, let's remove it later + this._pressedEnterInBlock = blockNode; + } + // if this li only contains spaces, set the content to empty so the browser will outdent this item + if(/^(\s| | |\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s| | |\xA0)<\/span>)?(<br>)?$/.test(blockNode.innerHTML)){ + // empty LI node + blockNode.innerHTML = ''; + if(has("webkit")){ // WebKit tosses the range when innerHTML is reset + newrange = rangeapi.create(this.editor.window); + newrange.setStart(blockNode, 0); + selection.removeAllRanges(); + selection.addRange(newrange); + } + this._checkListLater = false; // nothing to check since the browser handles outdent + } + return true; + } + + // text node directly under body, let's wrap them in a node + if(!block.blockNode || block.blockNode===this.editor.editNode){ + try{ + RichText.prototype.execCommand.call(this.editor, 'formatblock',this.blockNodeForEnter); + }catch(e2){ /*squelch FF3 exception bug when editor content is a single BR*/ } + // get the newly created block node + // FIXME + block = {blockNode: this.editor._sCall('getAncestorElement', [this.blockNodeForEnter]), + blockContainer: this.editor.editNode}; + if(block.blockNode){ + if(block.blockNode != this.editor.editNode && + (!(block.blockNode.textContent || block.blockNode.innerHTML).replace(/^\s+|\s+$/g, "").length)){ + this.removeTrailingBr(block.blockNode); + return false; + } + }else{ // we shouldn't be here if formatblock worked + block.blockNode = this.editor.editNode; + } + selection = rangeapi.getSelection(this.editor.window); + range = selection.getRangeAt(0); + } + + var newblock = doc.createElement(this.blockNodeForEnter); + newblock.innerHTML=this.bogusHtmlContent; + this.removeTrailingBr(block.blockNode); + var endOffset = range.endOffset; + var node = range.endContainer; + if(node.length < endOffset){ + //We are not checking the right node, try to locate the correct one + var ret = this._adjustNodeAndOffset(node, endOffset); + node = ret.node; + endOffset = ret.offset; + } + if(rangeapi.atEndOfContainer(block.blockNode, node, endOffset)){ + if(block.blockNode === block.blockContainer){ + block.blockNode.appendChild(newblock); + }else{ + domConstruct.place(newblock, block.blockNode, "after"); + } + _letBrowserHandle = false; + // lets move caret to the newly created block + newrange = rangeapi.create(this.editor.window); + newrange.setStart(newblock, 0); + selection.removeAllRanges(); + selection.addRange(newrange); + if(this.editor.height){ + winUtils.scrollIntoView(newblock); + } + }else if(rangeapi.atBeginningOfContainer(block.blockNode, + range.startContainer, range.startOffset)){ + domConstruct.place(newblock, block.blockNode, block.blockNode === block.blockContainer ? "first" : "before"); + if(newblock.nextSibling && this.editor.height){ + // position input caret - mostly WebKit needs this + newrange = rangeapi.create(this.editor.window); + newrange.setStart(newblock.nextSibling, 0); + selection.removeAllRanges(); + selection.addRange(newrange); + // browser does not scroll the caret position into view, do it manually + winUtils.scrollIntoView(newblock.nextSibling); + } + _letBrowserHandle = false; + }else{ //press enter in the middle of P/DIV/Whatever/ + if(block.blockNode === block.blockContainer){ + block.blockNode.appendChild(newblock); + }else{ + domConstruct.place(newblock, block.blockNode, "after"); + } + _letBrowserHandle = false; + + // Clone any block level styles. + if(block.blockNode.style){ + if(newblock.style){ + if(block.blockNode.style.cssText){ + newblock.style.cssText = block.blockNode.style.cssText; + } + } + } + + // Okay, we probably have to split. + rs = range.startContainer; + var firstNodeMoved; + if(rs && rs.nodeType == 3){ + // Text node, we have to split it. + var nodeToMove, tNode; + endOffset = range.endOffset; + if(rs.length < endOffset){ + //We are not splitting the right node, try to locate the correct one + ret = this._adjustNodeAndOffset(rs, endOffset); + rs = ret.node; + endOffset = ret.offset; + } + + txt = rs.nodeValue; + startNode = doc.createTextNode(txt.substring(0, endOffset)); + endNode = doc.createTextNode(txt.substring(endOffset, txt.length)); + + // Place the split, then remove original nodes. + domConstruct.place(startNode, rs, "before"); + domConstruct.place(endNode, rs, "after"); + domConstruct.destroy(rs); + + // Okay, we split the text. Now we need to see if we're + // parented to the block element we're splitting and if + // not, we have to split all the way up. Ugh. + var parentC = startNode.parentNode; + while(parentC !== block.blockNode){ + var tg = parentC.tagName; + var newTg = doc.createElement(tg); + // Clone over any 'style' data. + if(parentC.style){ + if(newTg.style){ + if(parentC.style.cssText){ + newTg.style.cssText = parentC.style.cssText; + } + } + } + // If font also need to clone over any font data. + if(parentC.tagName === "FONT"){ + if(parentC.color){ + newTg.color = parentC.color; + } + if(parentC.face){ + newTg.face = parentC.face; + } + if(parentC.size){ // this check was necessary on IE + newTg.size = parentC.size; + } + } + + nodeToMove = endNode; + while(nodeToMove){ + tNode = nodeToMove.nextSibling; + newTg.appendChild(nodeToMove); + nodeToMove = tNode; + } + domConstruct.place(newTg, parentC, "after"); + startNode = parentC; + endNode = newTg; + parentC = parentC.parentNode; + } + + // Lastly, move the split out tags to the new block. + // as they should now be split properly. + nodeToMove = endNode; + if(nodeToMove.nodeType == 1 || (nodeToMove.nodeType == 3 && nodeToMove.nodeValue)){ + // Non-blank text and non-text nodes need to clear out that blank space + // before moving the contents. + newblock.innerHTML = ""; + } + firstNodeMoved = nodeToMove; + while(nodeToMove){ + tNode = nodeToMove.nextSibling; + newblock.appendChild(nodeToMove); + nodeToMove = tNode; + } + } + + //lets move caret to the newly created block + newrange = rangeapi.create(this.editor.window); + var nodeForCursor; + var innerMostFirstNodeMoved = firstNodeMoved; + if(this.blockNodeForEnter !== 'BR'){ + while(innerMostFirstNodeMoved){ + nodeForCursor = innerMostFirstNodeMoved; + tNode = innerMostFirstNodeMoved.firstChild; + innerMostFirstNodeMoved = tNode; + } + if(nodeForCursor && nodeForCursor.parentNode){ + newblock = nodeForCursor.parentNode; + newrange.setStart(newblock, 0); + selection.removeAllRanges(); + selection.addRange(newrange); + if(this.editor.height){ + winUtils.scrollIntoView(newblock); + } + if(has("mozilla")){ + // press enter in middle of P may leave a trailing <br/>, let's remove it later + this._pressedEnterInBlock = block.blockNode; + } + }else{ + _letBrowserHandle = true; + } + }else{ + newrange.setStart(newblock, 0); + selection.removeAllRanges(); + selection.addRange(newrange); + if(this.editor.height){ + winUtils.scrollIntoView(newblock); + } + if(has("mozilla")){ + // press enter in middle of P may leave a trailing <br/>, let's remove it later + this._pressedEnterInBlock = block.blockNode; + } + } + } + return _letBrowserHandle; + }, + + _adjustNodeAndOffset: function(/*DomNode*/node, /*Int*/offset){ + // summary: + // In the case there are multiple text nodes in a row the offset may not be within the node. If the offset is larger than the node length, it will attempt to find + // the next text sibling until it locates the text node in which the offset refers to + // node: + // The node to check. + // offset: + // The position to find within the text node + // tags: + // private. + while(node.length < offset && node.nextSibling && node.nextSibling.nodeType==3){ + //Adjust the offset and node in the case of multiple text nodes in a row + offset = offset - node.length; + node = node.nextSibling; + } + return {"node": node, "offset": offset}; + }, + + removeTrailingBr: function(container){ + // summary: + // If last child of container is a `<br>`, then remove it. + // tags: + // private + var para = /P|DIV|LI/i.test(container.tagName) ? + container : this.editor._sCall("getParentOfType", [container,['P','DIV','LI']]); + + if(!para){ return; } + if(para.lastChild){ + if((para.childNodes.length > 1 && para.lastChild.nodeType == 3 && /^[\s\xAD]*$/.test(para.lastChild.nodeValue)) || + para.lastChild.tagName=='BR'){ + + domConstruct.destroy(para.lastChild); + } + } + if(!para.childNodes.length){ + para.innerHTML=this.bogusHtmlContent; + } + } +}); + +}); diff --git a/lib/dijit/_editor/plugins/FontChoice.js b/lib/dijit/_editor/plugins/FontChoice.js index 7e12ac008..f96894ad7 100644 --- a/lib/dijit/_editor/plugins/FontChoice.js +++ b/lib/dijit/_editor/plugins/FontChoice.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/FontChoice",["dojo/_base/array","dojo/_base/declare","dojo/dom-construct","dojo/i18n","dojo/_base/lang","dojo/store/Memory","dojo/_base/window","../../registry","../../_Widget","../../_TemplatedMixin","../../_WidgetsInTemplateMixin","../../form/FilteringSelect","../_Plugin","../range","../selection","dojo/i18n!../nls/FontChoice"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f){var _10=_2("dijit._editor.plugins._FontDropDown",[_9,_a,_b],{label:"",plainText:false,templateString:"<span style='white-space: nowrap' class='dijit dijitReset dijitInline'>"+"<label class='dijitLeft dijitInline' for='${selectId}'>${label}</label>"+"<input data-dojo-type='dijit.form.FilteringSelect' required='false' "+"data-dojo-props='labelType:\"html\", labelAttr:\"label\", searchAttr:\"name\"' "+"tabIndex='-1' id='${selectId}' data-dojo-attach-point='select' value=''/>"+"</span>",postMixInProperties:function(){this.inherited(arguments);this.strings=_4.getLocalization("dijit._editor","FontChoice");this.label=this.strings[this.command];this.id=_8.getUniqueId(this.declaredClass.replace(/\./g,"_"));this.selectId=this.id+"_select";this.inherited(arguments);},postCreate:function(){this.select.set("store",new _6({idProperty:"value",data:_1.map(this.values,function(_11){var _12=this.strings[_11]||_11;return {label:this.getLabel(_11,_12),name:_12,value:_11};},this)}));this.select.set("value","",false);this.disabled=this.select.get("disabled");},_setValueAttr:function(_13,_14){_14=_14!==false;this.select.set("value",_1.indexOf(this.values,_13)<0?"":_13,_14);if(!_14){this.select._lastValueReported=null;}},_getValueAttr:function(){return this.select.get("value");},focus:function(){this.select.focus();},_setDisabledAttr:function(_15){this.disabled=_15;this.select.set("disabled",_15);}});var _16=_2("dijit._editor.plugins._FontNameDropDown",_10,{generic:false,command:"fontName",postMixInProperties:function(){if(!this.values){this.values=this.generic?["serif","sans-serif","monospace","cursive","fantasy"]:["Arial","Times New Roman","Comic Sans MS","Courier New"];}this.inherited(arguments);},getLabel:function(_17,_18){if(this.plainText){return _18;}else{return "<div style='font-family: "+_17+"'>"+_18+"</div>";}},_setValueAttr:function(_19,_1a){_1a=_1a!==false;if(this.generic){var map={"Arial":"sans-serif","Helvetica":"sans-serif","Myriad":"sans-serif","Times":"serif","Times New Roman":"serif","Comic Sans MS":"cursive","Apple Chancery":"cursive","Courier":"monospace","Courier New":"monospace","Papyrus":"fantasy","Estrangelo Edessa":"cursive","Gabriola":"fantasy"};_19=map[_19]||_19;}this.inherited(arguments,[_19,_1a]);}});var _1b=_2("dijit._editor.plugins._FontSizeDropDown",_10,{command:"fontSize",values:[1,2,3,4,5,6,7],getLabel:function(_1c,_1d){if(this.plainText){return _1d;}else{return "<font size="+_1c+"'>"+_1d+"</font>";}},_setValueAttr:function(_1e,_1f){_1f=_1f!==false;if(_1e.indexOf&&_1e.indexOf("px")!=-1){var _20=parseInt(_1e,10);_1e={10:1,13:2,16:3,18:4,24:5,32:6,48:7}[_20]||_1e;}this.inherited(arguments,[_1e,_1f]);}});var _21=_2("dijit._editor.plugins._FormatBlockDropDown",_10,{command:"formatBlock",values:["noFormat","p","h1","h2","h3","pre"],postCreate:function(){this.inherited(arguments);this.set("value","noFormat",false);},getLabel:function(_22,_23){if(this.plainText||_22=="noFormat"){return _23;}else{return "<"+_22+">"+_23+"</"+_22+">";}},_execCommand:function(_24,_25,_26){if(_26==="noFormat"){var _27;var end;var sel=_e.getSelection(_24.window);if(sel&&sel.rangeCount>0){var _28=sel.getRangeAt(0);var _29,tag;if(_28){_27=_28.startContainer;end=_28.endContainer;while(_27&&_27!==_24.editNode&&_27!==_24.document.body&&_27.nodeType!==1){_27=_27.parentNode;}while(end&&end!==_24.editNode&&end!==_24.document.body&&end.nodeType!==1){end=end.parentNode;}var _2a=_5.hitch(this,function(_2b,ary){if(_2b.childNodes&&_2b.childNodes.length){var i;for(i=0;i<_2b.childNodes.length;i++){var c=_2b.childNodes[i];if(c.nodeType==1){if(_7.withGlobal(_24.window,"inSelection",_f,[c])){var tag=c.tagName?c.tagName.toLowerCase():"";if(_1.indexOf(this.values,tag)!==-1){ary.push(c);}_2a(c,ary);}}}}});var _2c=_5.hitch(this,function(_2d){if(_2d&&_2d.length){_24.beginEditing();while(_2d.length){this._removeFormat(_24,_2d.pop());}_24.endEditing();}});var _2e=[];if(_27==end){var _2f;_29=_27;while(_29&&_29!==_24.editNode&&_29!==_24.document.body){if(_29.nodeType==1){tag=_29.tagName?_29.tagName.toLowerCase():"";if(_1.indexOf(this.values,tag)!==-1){_2f=_29;break;}}_29=_29.parentNode;}_2a(_27,_2e);if(_2f){_2e=[_2f].concat(_2e);}_2c(_2e);}else{_29=_27;while(_7.withGlobal(_24.window,"inSelection",_f,[_29])){if(_29.nodeType==1){tag=_29.tagName?_29.tagName.toLowerCase():"";if(_1.indexOf(this.values,tag)!==-1){_2e.push(_29);}_2a(_29,_2e);}_29=_29.nextSibling;}_2c(_2e);}_24.onDisplayChanged();}}}else{_24.execCommand(_25,_26);}},_removeFormat:function(_30,_31){if(_30.customUndo){while(_31.firstChild){_3.place(_31.firstChild,_31,"before");}_31.parentNode.removeChild(_31);}else{_7.withGlobal(_30.window,"selectElementChildren",_f,[_31]);var _32=_7.withGlobal(_30.window,"getSelectedHtml",_f,[null]);_7.withGlobal(_30.window,"selectElement",_f,[_31]);_30.execCommand("inserthtml",_32||"");}}});var _33=_2("dijit._editor.plugins.FontChoice",_d,{useDefaultCommand:false,_initButton:function(){var _34={fontName:_16,fontSize:_1b,formatBlock:_21}[this.command],_35=this.params;if(this.params.custom){_35.values=this.params.custom;}var _36=this.editor;this.button=new _34(_5.delegate({dir:_36.dir,lang:_36.lang},_35));this.connect(this.button.select,"onChange",function(_37){this.editor.focus();if(this.command=="fontName"&&_37.indexOf(" ")!=-1){_37="'"+_37+"'";}if(this.button._execCommand){this.button._execCommand(this.editor,this.command,_37);}else{this.editor.execCommand(this.command,_37);}});},updateState:function(){var _38=this.editor;var _39=this.command;if(!_38||!_38.isLoaded||!_39.length){return;}if(this.button){var _3a=this.get("disabled");this.button.set("disabled",_3a);if(_3a){return;}var _3b;try{_3b=_38.queryCommandValue(_39)||"";}catch(e){_3b="";}var _3c=_5.isString(_3b)&&_3b.match(/'([^']*)'/);if(_3c){_3b=_3c[1];}if(_39==="formatBlock"){if(!_3b||_3b=="p"){_3b=null;var _3d;var sel=_e.getSelection(this.editor.window);if(sel&&sel.rangeCount>0){var _3e=sel.getRangeAt(0);if(_3e){_3d=_3e.endContainer;}}while(_3d&&_3d!==_38.editNode&&_3d!==_38.document){var tg=_3d.tagName?_3d.tagName.toLowerCase():"";if(tg&&_1.indexOf(this.button.values,tg)>-1){_3b=tg;break;}_3d=_3d.parentNode;}if(!_3b){_3b="noFormat";}}else{if(_1.indexOf(this.button.values,_3b)<0){_3b="noFormat";}}}if(_3b!==this.button.get("value")){this.button.set("value",_3b,false);}}}});_1.forEach(["fontName","fontSize","formatBlock"],function(_3f){_d.registry[_3f]=function(_40){return new _33({command:_3f,plainText:_40.plainText});};});});
\ No newline at end of file +define("dijit/_editor/plugins/FontChoice",["dojo/_base/array","dojo/_base/declare","dojo/dom-construct","dojo/i18n","dojo/_base/lang","dojo/store/Memory","../../registry","../../_Widget","../../_TemplatedMixin","../../_WidgetsInTemplateMixin","../../form/FilteringSelect","../_Plugin","../range","dojo/i18n!../nls/FontChoice"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d){var _e=_2("dijit._editor.plugins._FontDropDown",[_8,_9,_a],{label:"",plainText:false,templateString:"<span style='white-space: nowrap' class='dijit dijitReset dijitInline'>"+"<label class='dijitLeft dijitInline' for='${selectId}'>${label}</label>"+"<input data-dojo-type='dijit.form.FilteringSelect' required='false' "+"data-dojo-props='labelType:\"html\", labelAttr:\"label\", searchAttr:\"name\"' "+"tabIndex='-1' id='${selectId}' data-dojo-attach-point='select' value=''/>"+"</span>",postMixInProperties:function(){this.inherited(arguments);this.strings=_4.getLocalization("dijit._editor","FontChoice");this.label=this.strings[this.command];this.id=_7.getUniqueId(this.declaredClass.replace(/\./g,"_"));this.selectId=this.id+"_select";this.inherited(arguments);},postCreate:function(){this.select.set("store",new _6({idProperty:"value",data:_1.map(this.values,function(_f){var _10=this.strings[_f]||_f;return {label:this.getLabel(_f,_10),name:_10,value:_f};},this)}));this.select.set("value","",false);this.disabled=this.select.get("disabled");},_setValueAttr:function(_11,_12){_12=_12!==false;this.select.set("value",_1.indexOf(this.values,_11)<0?"":_11,_12);if(!_12){this.select._lastValueReported=null;}},_getValueAttr:function(){return this.select.get("value");},focus:function(){this.select.focus();},_setDisabledAttr:function(_13){this.disabled=_13;this.select.set("disabled",_13);}});var _14=_2("dijit._editor.plugins._FontNameDropDown",_e,{generic:false,command:"fontName",postMixInProperties:function(){if(!this.values){this.values=this.generic?["serif","sans-serif","monospace","cursive","fantasy"]:["Arial","Times New Roman","Comic Sans MS","Courier New"];}this.inherited(arguments);},getLabel:function(_15,_16){if(this.plainText){return _16;}else{return "<div style='font-family: "+_15+"'>"+_16+"</div>";}},_setValueAttr:function(_17,_18){_18=_18!==false;if(this.generic){var map={"Arial":"sans-serif","Helvetica":"sans-serif","Myriad":"sans-serif","Times":"serif","Times New Roman":"serif","Comic Sans MS":"cursive","Apple Chancery":"cursive","Courier":"monospace","Courier New":"monospace","Papyrus":"fantasy","Estrangelo Edessa":"cursive","Gabriola":"fantasy"};_17=map[_17]||_17;}this.inherited(arguments,[_17,_18]);}});var _19=_2("dijit._editor.plugins._FontSizeDropDown",_e,{command:"fontSize",values:[1,2,3,4,5,6,7],getLabel:function(_1a,_1b){if(this.plainText){return _1b;}else{return "<font size="+_1a+"'>"+_1b+"</font>";}},_setValueAttr:function(_1c,_1d){_1d=_1d!==false;if(_1c.indexOf&&_1c.indexOf("px")!=-1){var _1e=parseInt(_1c,10);_1c={10:1,13:2,16:3,18:4,24:5,32:6,48:7}[_1e]||_1c;}this.inherited(arguments,[_1c,_1d]);}});var _1f=_2("dijit._editor.plugins._FormatBlockDropDown",_e,{command:"formatBlock",values:["noFormat","p","h1","h2","h3","pre"],postCreate:function(){this.inherited(arguments);this.set("value","noFormat",false);},getLabel:function(_20,_21){if(this.plainText||_20=="noFormat"){return _21;}else{return "<"+_20+">"+_21+"</"+_20+">";}},_execCommand:function(_22,_23,_24){if(_24==="noFormat"){var _25;var end;var sel=_d.getSelection(_22.window);if(sel&&sel.rangeCount>0){var _26=sel.getRangeAt(0);var _27,tag;if(_26){_25=_26.startContainer;end=_26.endContainer;while(_25&&_25!==_22.editNode&&_25!==_22.document.body&&_25.nodeType!==1){_25=_25.parentNode;}while(end&&end!==_22.editNode&&end!==_22.document.body&&end.nodeType!==1){end=end.parentNode;}var _28=_5.hitch(this,function(_29,ary){if(_29.childNodes&&_29.childNodes.length){var i;for(i=0;i<_29.childNodes.length;i++){var c=_29.childNodes[i];if(c.nodeType==1){if(_22._sCall("inSelection",[c])){var tag=c.tagName?c.tagName.toLowerCase():"";if(_1.indexOf(this.values,tag)!==-1){ary.push(c);}_28(c,ary);}}}}});var _2a=_5.hitch(this,function(_2b){if(_2b&&_2b.length){_22.beginEditing();while(_2b.length){this._removeFormat(_22,_2b.pop());}_22.endEditing();}});var _2c=[];if(_25==end){var _2d;_27=_25;while(_27&&_27!==_22.editNode&&_27!==_22.document.body){if(_27.nodeType==1){tag=_27.tagName?_27.tagName.toLowerCase():"";if(_1.indexOf(this.values,tag)!==-1){_2d=_27;break;}}_27=_27.parentNode;}_28(_25,_2c);if(_2d){_2c=[_2d].concat(_2c);}_2a(_2c);}else{_27=_25;while(_22._sCall("inSelection",[_27])){if(_27.nodeType==1){tag=_27.tagName?_27.tagName.toLowerCase():"";if(_1.indexOf(this.values,tag)!==-1){_2c.push(_27);}_28(_27,_2c);}_27=_27.nextSibling;}_2a(_2c);}_22.onDisplayChanged();}}}else{_22.execCommand(_23,_24);}},_removeFormat:function(_2e,_2f){if(_2e.customUndo){while(_2f.firstChild){_3.place(_2f.firstChild,_2f,"before");}_2f.parentNode.removeChild(_2f);}else{_2e._sCall("selectElementChildren",[_2f]);var _30=_2e._sCall("getSelectedHtml",[]);_2e._sCall("selectElement",[_2f]);_2e.execCommand("inserthtml",_30||"");}}});var _31=_2("dijit._editor.plugins.FontChoice",_c,{useDefaultCommand:false,_initButton:function(){var _32={fontName:_14,fontSize:_19,formatBlock:_1f}[this.command],_33=this.params;if(this.params.custom){_33.values=this.params.custom;}var _34=this.editor;this.button=new _32(_5.delegate({dir:_34.dir,lang:_34.lang},_33));this.connect(this.button.select,"onChange",function(_35){this.editor.focus();if(this.command=="fontName"&&_35.indexOf(" ")!=-1){_35="'"+_35+"'";}if(this.button._execCommand){this.button._execCommand(this.editor,this.command,_35);}else{this.editor.execCommand(this.command,_35);}});},updateState:function(){var _36=this.editor;var _37=this.command;if(!_36||!_36.isLoaded||!_37.length){return;}if(this.button){var _38=this.get("disabled");this.button.set("disabled",_38);if(_38){return;}var _39;try{_39=_36.queryCommandValue(_37)||"";}catch(e){_39="";}var _3a=_5.isString(_39)&&_39.match(/'([^']*)'/);if(_3a){_39=_3a[1];}if(_37==="formatBlock"){if(!_39||_39=="p"){_39=null;var _3b;var sel=_d.getSelection(this.editor.window);if(sel&&sel.rangeCount>0){var _3c=sel.getRangeAt(0);if(_3c){_3b=_3c.endContainer;}}while(_3b&&_3b!==_36.editNode&&_3b!==_36.document){var tg=_3b.tagName?_3b.tagName.toLowerCase():"";if(tg&&_1.indexOf(this.button.values,tg)>-1){_39=tg;break;}_3b=_3b.parentNode;}if(!_39){_39="noFormat";}}else{if(_1.indexOf(this.button.values,_39)<0){_39="noFormat";}}}if(_39!==this.button.get("value")){this.button.set("value",_39,false);}}}});_1.forEach(["fontName","fontSize","formatBlock"],function(_3d){_c.registry[_3d]=function(_3e){return new _31({command:_3d,plainText:_3e.plainText});};});_31._FontDropDown=_e;_31._FontNameDropDown=_14;_31._FontSizeDropDown=_19;_31._FormatBlockDropDown=_1f;return _31;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/FontChoice.js.uncompressed.js b/lib/dijit/_editor/plugins/FontChoice.js.uncompressed.js new file mode 100644 index 000000000..713717351 --- /dev/null +++ b/lib/dijit/_editor/plugins/FontChoice.js.uncompressed.js @@ -0,0 +1,583 @@ +define("dijit/_editor/plugins/FontChoice", [ + "dojo/_base/array", // array.indexOf array.map + "dojo/_base/declare", // declare + "dojo/dom-construct", // domConstruct.place + "dojo/i18n", // i18n.getLocalization + "dojo/_base/lang", // lang.delegate lang.hitch lang.isString + "dojo/store/Memory", // MemoryStore + "../../registry", // registry.getUniqueId + "../../_Widget", + "../../_TemplatedMixin", + "../../_WidgetsInTemplateMixin", + "../../form/FilteringSelect", + "../_Plugin", + "../range", + "dojo/i18n!../nls/FontChoice" +], function(array, declare, domConstruct, i18n, lang, MemoryStore, + registry, _Widget, _TemplatedMixin, _WidgetsInTemplateMixin, FilteringSelect, _Plugin, rangeapi){ + + +// module: +// dijit/_editor/plugins/FontChoice + + +var _FontDropDown = declare("dijit._editor.plugins._FontDropDown", + [_Widget, _TemplatedMixin, _WidgetsInTemplateMixin], { + // summary: + // Base class for widgets that contains a label (like "Font:") + // and a FilteringSelect drop down to pick a value. + // Used as Toolbar entry. + + // label: [public] String + // The label to apply to this particular FontDropDown. + label: "", + + // plainText: [public] boolean + // Flag to indicate that the returned label should be plain text + // instead of an example. + plainText: false, + + // templateString: [public] String + // The template used to construct the labeled dropdown. + templateString: + "<span style='white-space: nowrap' class='dijit dijitReset dijitInline'>" + + "<label class='dijitLeft dijitInline' for='${selectId}'>${label}</label>" + + "<input data-dojo-type='dijit.form.FilteringSelect' required='false' " + + "data-dojo-props='labelType:\"html\", labelAttr:\"label\", searchAttr:\"name\"' " + + "tabIndex='-1' id='${selectId}' data-dojo-attach-point='select' value=''/>" + + "</span>", + + postMixInProperties: function(){ + // summary: + // Over-ride to set specific properties. + this.inherited(arguments); + + this.strings = i18n.getLocalization("dijit._editor", "FontChoice"); + + // Set some substitution variables used in the template + this.label = this.strings[this.command]; + + // _WidgetBase sets the id after postMixInProperties(), but we need it now. + // Alternative is to have a buildRendering() method and move this.selectId setting there, + // or alternately get rid of selectId variable and just access ${id} in template? + this.id = registry.getUniqueId(this.declaredClass.replace(/\./g,"_")); + + this.selectId = this.id + "_select"; // used in template + + this.inherited(arguments); + }, + + postCreate: function(){ + // summary: + // Over-ride for the default postCreate action + // This establishes the filtering selects and the like. + + // Initialize the list of items in the drop down by creating data store with items like: + // {value: 1, name: "xx-small", label: "<font size=1>xx-small</font-size>" } + this.select.set("store", new MemoryStore({ + idProperty: "value", + data: array.map(this.values, function(value){ + var name = this.strings[value] || value; + return { + label: this.getLabel(value, name), + name: name, + value: value + }; + }, this) + })); + + this.select.set("value", "", false); + this.disabled = this.select.get("disabled"); + }, + + _setValueAttr: function(value, priorityChange){ + // summary: + // Over-ride for the default action of setting the + // widget value, maps the input to known values + // value: Object|String + // The value to set in the select. + // priorityChange: + // Optional parameter used to tell the select whether or not to fire + // onChange event. + + // if the value is not a permitted value, just set empty string to prevent showing the warning icon + priorityChange = priorityChange !== false; + this.select.set('value', array.indexOf(this.values,value) < 0 ? "" : value, priorityChange); + if(!priorityChange){ + // Clear the last state in case of updateState calls. Ref: #10466 + this.select._lastValueReported=null; + } + }, + + _getValueAttr: function(){ + // summary: + // Allow retrieving the value from the composite select on + // call to button.get("value"); + return this.select.get('value'); + }, + + focus: function(){ + // summary: + // Over-ride for focus control of this widget. Delegates focus down to the + // filtering select. + this.select.focus(); + }, + + _setDisabledAttr: function(value){ + // summary: + // Over-ride for the button's 'disabled' attribute so that it can be + // disabled programmatically. + + // Save off ths disabled state so the get retrieves it correctly + //without needing to have a function proxy it. + this.disabled = value; + this.select.set("disabled", value); + } +}); + + +var _FontNameDropDown = declare("dijit._editor.plugins._FontNameDropDown", _FontDropDown, { + // summary: + // Dropdown to select a font; goes in editor toolbar. + + // generic: [const] Boolean + // Use generic (web standard) font names + generic: false, + + // command: [public] String + // The editor 'command' implemented by this plugin. + command: "fontName", + + postMixInProperties: function(){ + // summary: + // Over-ride for the default posr mixin control + if(!this.values){ + this.values = this.generic ? + ["serif", "sans-serif", "monospace", "cursive", "fantasy"] : // CSS font-family generics + ["Arial", "Times New Roman", "Comic Sans MS", "Courier New"]; + } + this.inherited(arguments); + }, + + getLabel: function(value, name){ + // summary: + // Function used to generate the labels of the format dropdown + // will return a formatted, or plain label based on the value + // of the plainText option. + // value: String + // The 'insert value' associated with a name + // name: String + // The text name of the value + if(this.plainText){ + return name; + }else{ + return "<div style='font-family: "+value+"'>" + name + "</div>"; + } + }, + + _setValueAttr: function(value, priorityChange){ + // summary: + // Over-ride for the default action of setting the + // widget value, maps the input to known values + + priorityChange = priorityChange !== false; + if(this.generic){ + var map = { + "Arial": "sans-serif", + "Helvetica": "sans-serif", + "Myriad": "sans-serif", + "Times": "serif", + "Times New Roman": "serif", + "Comic Sans MS": "cursive", + "Apple Chancery": "cursive", + "Courier": "monospace", + "Courier New": "monospace", + "Papyrus": "fantasy", + "Estrangelo Edessa": "cursive", // Windows 7 + "Gabriola": "fantasy" // Windows 7 + }; + value = map[value] || value; + } + this.inherited(arguments, [value, priorityChange]); + } +}); + +var _FontSizeDropDown = declare("dijit._editor.plugins._FontSizeDropDown", _FontDropDown, { + // summary: + // Dropdown to select a font size; goes in editor toolbar. + + // command: [public] String + // The editor 'command' implemented by this plugin. + command: "fontSize", + + // values: [public] Number[] + // The HTML font size values supported by this plugin + values: [1,2,3,4,5,6,7], // sizes according to the old HTML FONT SIZE + + getLabel: function(value, name){ + // summary: + // Function used to generate the labels of the format dropdown + // will return a formatted, or plain label based on the value + // of the plainText option. + // We're stuck using the deprecated FONT tag to correspond + // with the size measurements used by the editor + // value: String + // The 'insert value' associated with a name + // name: String + // The text name of the value + if(this.plainText){ + return name; + }else{ + return "<font size=" + value + "'>" + name + "</font>"; + } + }, + + _setValueAttr: function(value, priorityChange){ + // summary: + // Over-ride for the default action of setting the + // widget value, maps the input to known values + priorityChange = priorityChange !== false; + if(value.indexOf && value.indexOf("px") != -1){ + var pixels = parseInt(value, 10); + value = {10:1, 13:2, 16:3, 18:4, 24:5, 32:6, 48:7}[pixels] || value; + } + + this.inherited(arguments, [value, priorityChange]); + } +}); + + +var _FormatBlockDropDown = declare("dijit._editor.plugins._FormatBlockDropDown", _FontDropDown, { + // summary: + // Dropdown to select a format (like paragraph or heading); goes in editor toolbar. + + // command: [public] String + // The editor 'command' implemented by this plugin. + command: "formatBlock", + + // values: [public] Array + // The HTML format tags supported by this plugin + values: ["noFormat", "p", "h1", "h2", "h3", "pre"], + + postCreate: function(){ + // Init and set the default value to no formatting. Update state will adjust it + // as needed. + this.inherited(arguments); + this.set("value", "noFormat", false); + }, + + getLabel: function(value, name){ + // summary: + // Function used to generate the labels of the format dropdown + // will return a formatted, or plain label based on the value + // of the plainText option. + // value: String + // The 'insert value' associated with a name + // name: String + // The text name of the value + if(this.plainText || value == "noFormat"){ + return name; + }else{ + return "<" + value + ">" + name + "</" + value + ">"; + } + }, + + _execCommand: function(editor, command, choice){ + // summary: + // Over-ride for default exec-command label. + // Allows us to treat 'none' as special. + if(choice === "noFormat"){ + var start; + var end; + var sel = rangeapi.getSelection(editor.window); + if(sel && sel.rangeCount > 0){ + var range = sel.getRangeAt(0); + var node, tag; + if(range){ + start = range.startContainer; + end = range.endContainer; + + // find containing nodes of start/end. + while(start && start !== editor.editNode && + start !== editor.document.body && + start.nodeType !== 1){ + start = start.parentNode; + } + + while(end && end !== editor.editNode && + end !== editor.document.body && + end.nodeType !== 1){ + end = end.parentNode; + } + + var processChildren = lang.hitch(this, function(node, ary){ + if(node.childNodes && node.childNodes.length){ + var i; + for(i = 0; i < node.childNodes.length; i++){ + var c = node.childNodes[i]; + if(c.nodeType == 1){ + if(editor._sCall("inSelection", [c])){ + var tag = c.tagName? c.tagName.toLowerCase(): ""; + if(array.indexOf(this.values, tag) !== -1){ + ary.push(c); + } + processChildren(c, ary); + } + } + } + } + }); + + var unformatNodes = lang.hitch(this, function(nodes){ + // summary: + // Internal function to clear format nodes. + // nodes: + // The array of nodes to strip formatting from. + if(nodes && nodes.length){ + editor.beginEditing(); + while(nodes.length){ + this._removeFormat(editor, nodes.pop()); + } + editor.endEditing(); + } + }); + + var clearNodes = []; + if(start == end){ + //Contained within the same block, may be collapsed, but who cares, see if we + // have a block element to remove. + var block; + node = start; + while(node && node !== editor.editNode && node !== editor.document.body){ + if(node.nodeType == 1){ + tag = node.tagName? node.tagName.toLowerCase(): ""; + if(array.indexOf(this.values, tag) !== -1){ + block = node; + break; + } + } + node = node.parentNode; + } + + //Also look for all child nodes in the selection that may need to be + //cleared of formatting + processChildren(start, clearNodes); + if(block){ clearNodes = [block].concat(clearNodes); } + unformatNodes(clearNodes); + }else{ + // Probably a multi select, so we have to process it. Whee. + node = start; + while(editor._sCall("inSelection", [node])){ + if(node.nodeType == 1){ + tag = node.tagName? node.tagName.toLowerCase(): ""; + if(array.indexOf(this.values, tag) !== -1){ + clearNodes.push(node); + } + processChildren(node,clearNodes); + } + node = node.nextSibling; + } + unformatNodes(clearNodes); + } + editor.onDisplayChanged(); + } + } + }else{ + editor.execCommand(command, choice); + } + }, + + _removeFormat: function(editor, node){ + // summary: + // function to remove the block format node. + // node: + // The block format node to remove (and leave the contents behind) + if(editor.customUndo){ + // So of course IE doesn't work right with paste-overs. + // We have to do this manually, which is okay since IE already uses + // customUndo and we turned it on for WebKit. WebKit pasted funny, + // so couldn't use the execCommand approach + while(node.firstChild){ + domConstruct.place(node.firstChild, node, "before"); + } + node.parentNode.removeChild(node); + }else{ + // Everyone else works fine this way, a paste-over and is native + // undo friendly. + editor._sCall("selectElementChildren", [node]) + var html = editor._sCall("getSelectedHtml", []) + editor._sCall("selectElement", [node]) + editor.execCommand("inserthtml", html||""); + } + } +}); + +// TODO: for 2.0, split into FontChoice plugin into three separate classes, +// one for each command (and change registry below) +var FontChoice = declare("dijit._editor.plugins.FontChoice", _Plugin,{ + // summary: + // This plugin provides three drop downs for setting style in the editor + // (font, font size, and format block), as controlled by command. + // + // description: + // The commands provided by this plugin are: + // + // - fontName: Provides a drop down to select from a list of font names + // - fontSize: Provides a drop down to select from a list of font sizes + // - formatBlock: Provides a drop down to select from a list of block styles + // which can easily be added to an editor by including one or more of the above commands + // in the `plugins` attribute as follows: + // + // | plugins="['fontName','fontSize',...]" + // + // It is possible to override the default dropdown list by providing an Array for the `custom` property when + // instantiating this plugin, e.g. + // + // | plugins="[{name:'dijit._editor.plugins.FontChoice', command:'fontName', values:['Verdana','Myriad','Garamond']},...]" + // + // Alternatively, for `fontName` only, `generic:true` may be specified to provide a dropdown with + // [CSS generic font families](http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families). + // + // Note that the editor is often unable to properly handle font styling information defined outside + // the context of the current editor instance, such as pre-populated HTML. + + // useDefaultCommand: [protected] Boolean + // Override _Plugin.useDefaultCommand... + // processing is handled by this plugin, not by dijit/Editor. + useDefaultCommand: false, + + _initButton: function(){ + // summary: + // Overrides _Plugin._initButton(), to initialize the FilteringSelect+label in toolbar, + // rather than a simple button. + // tags: + // protected + + // Create the widget to go into the toolbar (the so-called "button") + var clazz = { + fontName: _FontNameDropDown, + fontSize: _FontSizeDropDown, + formatBlock: _FormatBlockDropDown + }[this.command], + params = this.params; + + // For back-compat reasons support setting custom values via "custom" parameter + // rather than "values" parameter. Remove in 2.0. + if(this.params.custom){ + params.values = this.params.custom; + } + + var editor = this.editor; + this.button = new clazz(lang.delegate({dir: editor.dir, lang: editor.lang}, params)); + + // Reflect changes to the drop down in the editor + this.connect(this.button.select, "onChange", function(choice){ + // User invoked change, since all internal updates set priorityChange to false and will + // not trigger an onChange event. + this.editor.focus(); + + if(this.command == "fontName" && choice.indexOf(" ") != -1){ choice = "'" + choice + "'"; } + + // Invoke, the editor already normalizes commands called through its + // execCommand. + if(this.button._execCommand){ + this.button._execCommand(this.editor, this.command, choice); + }else{ + this.editor.execCommand(this.command, choice); + } + }); + }, + + updateState: function(){ + // summary: + // Overrides _Plugin.updateState(). This controls updating the menu + // options to the right values on state changes in the document (that trigger a + // test of the actions.) + // It set value of drop down in toolbar to reflect font/font size/format block + // of text at current caret position. + // tags: + // protected + var _e = this.editor; + var _c = this.command; + if(!_e || !_e.isLoaded || !_c.length){ return; } + + if(this.button){ + var disabled = this.get("disabled"); + this.button.set("disabled", disabled); + if(disabled){ return; } + var value; + try{ + value = _e.queryCommandValue(_c) || ""; + }catch(e){ + //Firefox may throw error above if the editor is just loaded, ignore it + value = ""; + } + + // strip off single quotes, if any + var quoted = lang.isString(value) && value.match(/'([^']*)'/); + if(quoted){ value = quoted[1]; } + + if(_c === "formatBlock"){ + if(!value || value == "p"){ + // Some browsers (WebKit) doesn't actually get the tag info right. + // and IE returns paragraph when in a DIV!, so incorrect a lot, + // so we have double-check it. + value = null; + var elem; + // Try to find the current element where the caret is. + var sel = rangeapi.getSelection(this.editor.window); + if(sel && sel.rangeCount > 0){ + var range = sel.getRangeAt(0); + if(range){ + elem = range.endContainer; + } + } + + // Okay, now see if we can find one of the formatting types we're in. + while(elem && elem !== _e.editNode && elem !== _e.document){ + var tg = elem.tagName?elem.tagName.toLowerCase():""; + if(tg && array.indexOf(this.button.values, tg) > -1){ + value = tg; + break; + } + elem = elem.parentNode; + } + if(!value){ + // Still no value, so lets select 'none'. + value = "noFormat"; + } + }else{ + // Check that the block format is one allowed, if not, + // null it so that it gets set to empty. + if(array.indexOf(this.button.values, value) < 0){ + value = "noFormat"; + } + } + } + if(value !== this.button.get("value")){ + // Set the value, but denote it is not a priority change, so no + // onchange fires. + this.button.set('value', value, false); + } + } + } +}); + +// Register these plugins +array.forEach(["fontName", "fontSize", "formatBlock"], function(name){ + _Plugin.registry[name] = function(args){ + return new FontChoice({ + command: name, + plainText: args.plainText + }); + }; +}); + +// Make all classes available through AMD, and return main class +FontChoice._FontDropDown = _FontDropDown; +FontChoice._FontNameDropDown = _FontNameDropDown; +FontChoice._FontSizeDropDown = _FontSizeDropDown; +FontChoice._FormatBlockDropDown = _FormatBlockDropDown; +return FontChoice; + +}); diff --git a/lib/dijit/_editor/plugins/FullScreen.js b/lib/dijit/_editor/plugins/FullScreen.js index 139f630dc..458dbf8b7 100644 --- a/lib/dijit/_editor/plugins/FullScreen.js +++ b/lib/dijit/_editor/plugins/FullScreen.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/FullScreen",["dojo/aspect","dojo/_base/declare","dojo/dom-class","dojo/dom-geometry","dojo/dom-style","dojo/_base/event","dojo/i18n","dojo/keys","dojo/_base/lang","dojo/on","dojo/_base/sniff","dojo/_base/window","dojo/window","../../focus","../_Plugin","../../form/ToggleButton","../../registry","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,on,_a,_b,_c,_d,_e,_f,_10){var _11=_2("dijit._editor.plugins.FullScreen",_e,{zIndex:500,_origState:null,_origiFrameState:null,_resizeHandle:null,isFullscreen:false,toggle:function(){this.button.set("checked",!this.button.get("checked"));},_initButton:function(){var _12=_7.getLocalization("dijit._editor","commands"),_13=this.editor;this.button=new _f({label:_12["fullScreen"],dir:_13.dir,lang:_13.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"FullScreen",tabIndex:"-1",onChange:_9.hitch(this,"_setFullScreen")});},setEditor:function(_14){this.editor=_14;this._initButton();this.editor.addKeyHandler(_8.F11,true,true,_9.hitch(this,function(e){this.toggle();_6.stop(e);setTimeout(_9.hitch(this,function(){this.editor.focus();}),250);return true;}));this.connect(this.editor.domNode,"onkeydown","_containFocus");},_containFocus:function(e){if(this.isFullscreen){var ed=this.editor;if(!ed.isTabIndent&&ed._fullscreen_oldOnKeyDown&&e.keyCode===_8.TAB){var f=_d.curNode;var avn=this._getAltViewNode();if(f==ed.iframe||(avn&&f===avn)){setTimeout(_9.hitch(this,function(){ed.toolbar.focus();}),10);}else{if(avn&&_5.get(ed.iframe,"display")==="none"){setTimeout(_9.hitch(this,function(){_d.focus(avn);}),10);}else{setTimeout(_9.hitch(this,function(){ed.focus();}),10);}}_6.stop(e);}else{if(ed._fullscreen_oldOnKeyDown){ed._fullscreen_oldOnKeyDown(e);}}}},_resizeEditor:function(){var vp=_c.getBox();_4.setMarginBox(this.editor.domNode,{w:vp.w,h:vp.h});var _15=this.editor.getHeaderHeight();var _16=this.editor.getFooterHeight();var _17=_4.getPadBorderExtents(this.editor.domNode);var _18=_4.getPadBorderExtents(this.editor.iframe.parentNode);var _19=_4.getMarginExtents(this.editor.iframe.parentNode);var _1a=vp.h-(_15+_17.h+_16);_4.setMarginBox(this.editor.iframe.parentNode,{h:_1a,w:vp.w});_4.setMarginBox(this.editor.iframe,{h:_1a-(_18.h+_19.h)});},_getAltViewNode:function(){},_setFullScreen:function(_1b){var vp=_c.getBox();var ed=this.editor;var _1c=_b.body();var _1d=ed.domNode.parentNode;this.isFullscreen=_1b;if(_1b){while(_1d&&_1d!==_b.body()){_3.add(_1d,"dijitForceStatic");_1d=_1d.parentNode;}this._editorResizeHolder=this.editor.resize;ed.resize=function(){};ed._fullscreen_oldOnKeyDown=ed.onKeyDown;ed.onKeyDown=_9.hitch(this,this._containFocus);this._origState={};this._origiFrameState={};var _1e=ed.domNode,_1f=_1e&&_1e.style||{};this._origState={width:_1f.width||"",height:_1f.height||"",top:_5.get(_1e,"top")||"",left:_5.get(_1e,"left")||"",position:_5.get(_1e,"position")||"static",marginBox:_4.getMarginBox(ed.domNode)};var _20=ed.iframe,_21=_20&&_20.style||{};var bc=_5.get(ed.iframe,"backgroundColor");this._origiFrameState={backgroundColor:bc||"transparent",width:_21.width||"auto",height:_21.height||"auto",zIndex:_21.zIndex||""};_5.set(ed.domNode,{position:"absolute",top:"0px",left:"0px",zIndex:this.zIndex,width:vp.w+"px",height:vp.h+"px"});_5.set(ed.iframe,{height:"100%",width:"100%",zIndex:this.zIndex,backgroundColor:bc!=="transparent"&&bc!=="rgba(0, 0, 0, 0)"?bc:"white"});_5.set(ed.iframe.parentNode,{height:"95%",width:"100%"});if(_1c.style&&_1c.style.overflow){this._oldOverflow=_5.get(_1c,"overflow");}else{this._oldOverflow="";}if(_a("ie")&&!_a("quirks")){if(_1c.parentNode&&_1c.parentNode.style&&_1c.parentNode.style.overflow){this._oldBodyParentOverflow=_1c.parentNode.style.overflow;}else{try{this._oldBodyParentOverflow=_5.get(_1c.parentNode,"overflow");}catch(e){this._oldBodyParentOverflow="scroll";}}_5.set(_1c.parentNode,"overflow","hidden");}_5.set(_1c,"overflow","hidden");var _22=function(){var vp=_c.getBox();if("_prevW" in this&&"_prevH" in this){if(vp.w===this._prevW&&vp.h===this._prevH){return;}}else{this._prevW=vp.w;this._prevH=vp.h;}if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}this._resizer=setTimeout(_9.hitch(this,function(){delete this._resizer;this._resizeEditor();}),10);};this._resizeHandle=on(window,"resize",_9.hitch(this,_22));this._resizeHandle2=_1.after(ed,"onResize",_9.hitch(this,function(){if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}this._resizer=setTimeout(_9.hitch(this,function(){delete this._resizer;this._resizeEditor();}),10);}));this._resizeEditor();var dn=this.editor.toolbar.domNode;setTimeout(function(){_c.scrollIntoView(dn);},250);}else{if(this._resizeHandle){this._resizeHandle.remove();this._resizeHandle=null;}if(this._resizeHandle2){this._resizeHandle2.remove();this._resizeHandle2=null;}if(this._rst){clearTimeout(this._rst);this._rst=null;}while(_1d&&_1d!==_b.body()){_3.remove(_1d,"dijitForceStatic");_1d=_1d.parentNode;}if(this._editorResizeHolder){this.editor.resize=this._editorResizeHolder;}if(!this._origState&&!this._origiFrameState){return;}if(ed._fullscreen_oldOnKeyDown){ed.onKeyDown=ed._fullscreen_oldOnKeyDown;delete ed._fullscreen_oldOnKeyDown;}var _23=this;setTimeout(function(){var mb=_23._origState.marginBox;var oh=_23._origState.height;if(_a("ie")&&!_a("quirks")){_1c.parentNode.style.overflow=_23._oldBodyParentOverflow;delete _23._oldBodyParentOverflow;}_5.set(_1c,"overflow",_23._oldOverflow);delete _23._oldOverflow;_5.set(ed.domNode,_23._origState);_5.set(ed.iframe.parentNode,{height:"",width:""});_5.set(ed.iframe,_23._origiFrameState);delete _23._origState;delete _23._origiFrameState;var _24=_10.getEnclosingWidget(ed.domNode.parentNode);if(_24&&_24.resize){_24.resize();}else{if(!oh||oh.indexOf("%")<0){setTimeout(_9.hitch(this,function(){ed.resize({h:mb.h});}),0);}}_c.scrollIntoView(_23.editor.toolbar.domNode);},100);}},updateState:function(){this.button.set("disabled",this.get("disabled"));},destroy:function(){if(this._resizeHandle){this._resizeHandle.remove();this._resizeHandle=null;}if(this._resizeHandle2){this._resizeHandle2.remove();this._resizeHandle2=null;}if(this._resizer){clearTimeout(this._resizer);this._resizer=null;}this.inherited(arguments);}});_e.registry["fullScreen"]=_e.registry["fullscreen"]=function(_25){return new _11({zIndex:("zIndex" in _25)?_25.zIndex:500});};return _11;});
\ No newline at end of file +define("dijit/_editor/plugins/FullScreen",["dojo/aspect","dojo/_base/declare","dojo/dom-class","dojo/dom-geometry","dojo/dom-style","dojo/_base/event","dojo/i18n","dojo/keys","dojo/_base/lang","dojo/on","dojo/sniff","dojo/_base/window","dojo/window","../../focus","../_Plugin","../../form/ToggleButton","../../registry","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,on,_a,_b,_c,_d,_e,_f,_10){var _11=_2("dijit._editor.plugins.FullScreen",_e,{zIndex:500,_origState:null,_origiFrameState:null,_resizeHandle:null,isFullscreen:false,toggle:function(){this.button.set("checked",!this.button.get("checked"));},_initButton:function(){var _12=_7.getLocalization("dijit._editor","commands"),_13=this.editor;this.button=new _f({label:_12["fullScreen"],ownerDocument:_13.ownerDocument,dir:_13.dir,lang:_13.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"FullScreen",tabIndex:"-1",onChange:_9.hitch(this,"_setFullScreen")});},setEditor:function(_14){this.editor=_14;this._initButton();this.editor.addKeyHandler(_8.F11,true,true,_9.hitch(this,function(e){this.toggle();_6.stop(e);setTimeout(_9.hitch(this,function(){this.editor.focus();}),250);return true;}));this.connect(this.editor.domNode,"onkeydown","_containFocus");},_containFocus:function(e){if(this.isFullscreen){var ed=this.editor;if(!ed.isTabIndent&&ed._fullscreen_oldOnKeyDown&&e.keyCode===_8.TAB){var f=_d.curNode;var avn=this._getAltViewNode();if(f==ed.iframe||(avn&&f===avn)){setTimeout(_9.hitch(this,function(){ed.toolbar.focus();}),10);}else{if(avn&&_5.get(ed.iframe,"display")==="none"){setTimeout(_9.hitch(this,function(){_d.focus(avn);}),10);}else{setTimeout(_9.hitch(this,function(){ed.focus();}),10);}}_6.stop(e);}else{if(ed._fullscreen_oldOnKeyDown){ed._fullscreen_oldOnKeyDown(e);}}}},_resizeEditor:function(){var vp=_c.getBox(this.editor.ownerDocument);_4.setMarginBox(this.editor.domNode,{w:vp.w,h:vp.h});var _15=this.editor.getHeaderHeight();var _16=this.editor.getFooterHeight();var _17=_4.getPadBorderExtents(this.editor.domNode);var _18=_4.getPadBorderExtents(this.editor.iframe.parentNode);var _19=_4.getMarginExtents(this.editor.iframe.parentNode);var _1a=vp.h-(_15+_17.h+_16);_4.setMarginBox(this.editor.iframe.parentNode,{h:_1a,w:vp.w});_4.setMarginBox(this.editor.iframe,{h:_1a-(_18.h+_19.h)});},_getAltViewNode:function(){},_setFullScreen:function(_1b){var ed=this.editor;var _1c=ed.ownerDocumentBody;var _1d=ed.domNode.parentNode;var vp=_c.getBox(ed.ownerDocument);this.isFullscreen=_1b;if(_1b){while(_1d&&_1d!==_1c){_3.add(_1d,"dijitForceStatic");_1d=_1d.parentNode;}this._editorResizeHolder=this.editor.resize;ed.resize=function(){};ed._fullscreen_oldOnKeyDown=ed.onKeyDown;ed.onKeyDown=_9.hitch(this,this._containFocus);this._origState={};this._origiFrameState={};var _1e=ed.domNode,_1f=_1e&&_1e.style||{};this._origState={width:_1f.width||"",height:_1f.height||"",top:_5.get(_1e,"top")||"",left:_5.get(_1e,"left")||"",position:_5.get(_1e,"position")||"static",marginBox:_4.getMarginBox(ed.domNode)};var _20=ed.iframe,_21=_20&&_20.style||{};var bc=_5.get(ed.iframe,"backgroundColor");this._origiFrameState={backgroundColor:bc||"transparent",width:_21.width||"auto",height:_21.height||"auto",zIndex:_21.zIndex||""};_5.set(ed.domNode,{position:"absolute",top:"0px",left:"0px",zIndex:this.zIndex,width:vp.w+"px",height:vp.h+"px"});_5.set(ed.iframe,{height:"100%",width:"100%",zIndex:this.zIndex,backgroundColor:bc!=="transparent"&&bc!=="rgba(0, 0, 0, 0)"?bc:"white"});_5.set(ed.iframe.parentNode,{height:"95%",width:"100%"});if(_1c.style&&_1c.style.overflow){this._oldOverflow=_5.get(_1c,"overflow");}else{this._oldOverflow="";}if(_a("ie")&&!_a("quirks")){if(_1c.parentNode&&_1c.parentNode.style&&_1c.parentNode.style.overflow){this._oldBodyParentOverflow=_1c.parentNode.style.overflow;}else{try{this._oldBodyParentOverflow=_5.get(_1c.parentNode,"overflow");}catch(e){this._oldBodyParentOverflow="scroll";}}_5.set(_1c.parentNode,"overflow","hidden");}_5.set(_1c,"overflow","hidden");var _22=function(){var vp=_c.getBox(ed.ownerDocument);if("_prevW" in this&&"_prevH" in this){if(vp.w===this._prevW&&vp.h===this._prevH){return;}}else{this._prevW=vp.w;this._prevH=vp.h;}if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}this._resizer=setTimeout(_9.hitch(this,function(){delete this._resizer;this._resizeEditor();}),10);};this._resizeHandle=on(window,"resize",_9.hitch(this,_22));this._resizeHandle2=_1.after(ed,"onResize",_9.hitch(this,function(){if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}this._resizer=setTimeout(_9.hitch(this,function(){delete this._resizer;this._resizeEditor();}),10);}));this._resizeEditor();var dn=this.editor.toolbar.domNode;setTimeout(function(){_c.scrollIntoView(dn);},250);}else{if(this._resizeHandle){this._resizeHandle.remove();this._resizeHandle=null;}if(this._resizeHandle2){this._resizeHandle2.remove();this._resizeHandle2=null;}if(this._rst){clearTimeout(this._rst);this._rst=null;}while(_1d&&_1d!==_1c){_3.remove(_1d,"dijitForceStatic");_1d=_1d.parentNode;}if(this._editorResizeHolder){this.editor.resize=this._editorResizeHolder;}if(!this._origState&&!this._origiFrameState){return;}if(ed._fullscreen_oldOnKeyDown){ed.onKeyDown=ed._fullscreen_oldOnKeyDown;delete ed._fullscreen_oldOnKeyDown;}var _23=this;setTimeout(function(){var mb=_23._origState.marginBox;var oh=_23._origState.height;if(_a("ie")&&!_a("quirks")){_1c.parentNode.style.overflow=_23._oldBodyParentOverflow;delete _23._oldBodyParentOverflow;}_5.set(_1c,"overflow",_23._oldOverflow);delete _23._oldOverflow;_5.set(ed.domNode,_23._origState);_5.set(ed.iframe.parentNode,{height:"",width:""});_5.set(ed.iframe,_23._origiFrameState);delete _23._origState;delete _23._origiFrameState;var _24=_10.getEnclosingWidget(ed.domNode.parentNode);if(_24&&_24.resize){_24.resize();}else{if(!oh||oh.indexOf("%")<0){setTimeout(_9.hitch(this,function(){ed.resize({h:mb.h});}),0);}}_c.scrollIntoView(_23.editor.toolbar.domNode);},100);}},updateState:function(){this.button.set("disabled",this.get("disabled"));},destroy:function(){if(this._resizeHandle){this._resizeHandle.remove();this._resizeHandle=null;}if(this._resizeHandle2){this._resizeHandle2.remove();this._resizeHandle2=null;}if(this._resizer){clearTimeout(this._resizer);this._resizer=null;}this.inherited(arguments);}});_e.registry["fullScreen"]=_e.registry["fullscreen"]=function(_25){return new _11({zIndex:("zIndex" in _25)?_25.zIndex:500});};return _11;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/FullScreen.js.uncompressed.js b/lib/dijit/_editor/plugins/FullScreen.js.uncompressed.js new file mode 100644 index 000000000..68f27954b --- /dev/null +++ b/lib/dijit/_editor/plugins/FullScreen.js.uncompressed.js @@ -0,0 +1,450 @@ +define("dijit/_editor/plugins/FullScreen", [ + "dojo/aspect", + "dojo/_base/declare", // declare + "dojo/dom-class", // domClass.add domClass.remove + "dojo/dom-geometry", + "dojo/dom-style", + "dojo/_base/event", // event.stop + "dojo/i18n", // i18n.getLocalization + "dojo/keys", // keys.F11 keys.TAB + "dojo/_base/lang", // lang.hitch + "dojo/on", // on() + "dojo/sniff", // has("ie"), has("quirks") + "dojo/_base/window", // win.body + "dojo/window", // winUtils.getBox winUtils.scrollIntoView + "../../focus", // focus.focus(), focus.curNode + "../_Plugin", + "../../form/ToggleButton", + "../../registry", // registry.getEnclosingWidget() + "dojo/i18n!../nls/commands" +], function(aspect, declare, domClass, domGeometry, domStyle, event, i18n, keys, lang, on, has, win, winUtils, + focus, _Plugin, ToggleButton, registry){ + + +// module: +// dijit/_editor/plugins/FullScreen + + +var FullScreen = declare("dijit._editor.plugins.FullScreen",_Plugin,{ + // summary: + // This plugin provides FullScreen capability to the editor. When + // toggled on, it will render the editor into the full window and + // overlay everything. It also binds to the hotkey: CTRL-SHIFT-F11 + // for toggling fullscreen mode. + + // zIndex: [public] Number + // zIndex value used for overlaying the full page. + // default is 500. + zIndex: 500, + + // _origState: [private] Object + // The original view state of the editor. + _origState: null, + + // _origiFrameState: [private] Object + // The original view state of the iframe of the editor. + _origiFrameState: null, + + // _resizeHandle: [private] Object + // Connection point used for handling resize when window resizes. + _resizeHandle: null, + + // isFullscreen: [const] boolean + // Read-Only variable used to denote of the editor is in fullscreen mode or not. + isFullscreen: false, + + toggle: function(){ + // summary: + // Function to allow programmatic toggling of the view. + this.button.set("checked", !this.button.get("checked")); + }, + + _initButton: function(){ + // summary: + // Over-ride for creation of the resize button. + var strings = i18n.getLocalization("dijit._editor", "commands"), + editor = this.editor; + this.button = new ToggleButton({ + label: strings["fullScreen"], + ownerDocument: editor.ownerDocument, + dir: editor.dir, + lang: editor.lang, + showLabel: false, + iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "FullScreen", + tabIndex: "-1", + onChange: lang.hitch(this, "_setFullScreen") + }); + }, + + setEditor: function(editor){ + // summary: + // Over-ride for the setting of the editor. + // editor: Object + // The editor to configure for this plugin to use. + this.editor = editor; + this._initButton(); + + this.editor.addKeyHandler(keys.F11, true, true, lang.hitch(this, function(e){ + // Enable the CTRL-SHIFT-F11 hotkey for fullscreen mode. + this.toggle(); + event.stop(e); + setTimeout(lang.hitch(this, function(){this.editor.focus();}), 250); + return true; + })); + this.connect(this.editor.domNode, "onkeydown", "_containFocus"); + }, + + _containFocus: function(e){ + // summary: + // When in Full Screen mode, it's good to try and retain focus in the editor + // so this function is intended to try and constrain the TAB key. + // e: Event + // The key event. + // tags: + // private + if(this.isFullscreen){ + var ed = this.editor; + if(!ed.isTabIndent && + ed._fullscreen_oldOnKeyDown && + e.keyCode === keys.TAB){ + // If we're in fullscreen mode, we want to take over how tab moves focus a bit. + // to keep it within the editor since it's hiding the rest of the page. + // IE hates changing focus IN the event handler, so need to put calls + // in a timeout. Gotta love IE. + // Also need to check for alternate view nodes if present and active. + var f = focus.curNode; + var avn = this._getAltViewNode(); + if(f == ed.iframe || + (avn && f === avn)){ + setTimeout(lang.hitch(this, function(){ + ed.toolbar.focus(); + }), 10); + }else{ + if(avn && domStyle.get(ed.iframe, "display") === "none"){ + setTimeout(lang.hitch(this, function(){ + focus.focus(avn); + }), 10); + }else{ + setTimeout(lang.hitch(this, function(){ + ed.focus(); + }), 10); + } + } + event.stop(e); + }else if(ed._fullscreen_oldOnKeyDown){ + // Only call up when it's a different function. Traps corner case event issue + // on IE which caused stack overflow on handler cleanup. + ed._fullscreen_oldOnKeyDown(e); + } + } + }, + + _resizeEditor: function(){ + // summary: + // Function to handle resizing the editor as the viewport + // resizes (window scaled) + // tags: + // private + var vp = winUtils.getBox(this.editor.ownerDocument); + domGeometry.setMarginBox(this.editor.domNode, { + w: vp.w, + h: vp.h + }); + + //Adjust the internal heights too, as they can be a bit off. + var hHeight = this.editor.getHeaderHeight(); + var fHeight = this.editor.getFooterHeight(); + var extents = domGeometry.getPadBorderExtents(this.editor.domNode); + var fcpExtents = domGeometry.getPadBorderExtents(this.editor.iframe.parentNode); + var fcmExtents = domGeometry.getMarginExtents(this.editor.iframe.parentNode); + + var cHeight = vp.h - (hHeight + extents.h + fHeight); + domGeometry.setMarginBox(this.editor.iframe.parentNode, { + h: cHeight, + w: vp.w + }); + domGeometry.setMarginBox(this.editor.iframe, { + h: cHeight - (fcpExtents.h + fcmExtents.h) + }); + }, + + _getAltViewNode: function(){ + // summary: + // This function is intended as a hook point for setting an + // alternate view node for when in full screen mode and the + // editable iframe is hidden. + // tags: + // protected. + }, + + _setFullScreen: function(full){ + // summary: + // Function to handle toggling between full screen and + // regular view. + // tags: + // private + + //Alias this for shorter code. + var ed = this.editor; + var body = ed.ownerDocumentBody; + var editorParent = ed.domNode.parentNode; + + var vp = winUtils.getBox(ed.ownerDocument); + + this.isFullscreen = full; + + if(full){ + //Parent classes can royally screw up this plugin, so we + //have to set everything to position static. + while(editorParent && editorParent !== body){ + domClass.add(editorParent, "dijitForceStatic"); + editorParent = editorParent.parentNode; + } + + // Save off the resize function. We want to kill its behavior. + this._editorResizeHolder = this.editor.resize; + ed.resize = function(){} ; + + // Try to constrain focus control. + ed._fullscreen_oldOnKeyDown = ed.onKeyDown; + ed.onKeyDown = lang.hitch(this, this._containFocus); + + this._origState = {}; + this._origiFrameState = {}; + + // Store the basic editor state we have to restore later. + // Not using domStyle.get here, had problems, didn't + // give me stuff like 100%, gave me pixel calculated values. + // Need the exact original values. + var domNode = ed.domNode, + rawStyle = domNode && domNode.style || {}; + this._origState = { + width: rawStyle.width || "", + height: rawStyle.height || "", + top: domStyle.get(domNode, "top") || "", + left: domStyle.get(domNode, "left") || "", + position: domStyle.get(domNode, "position") || "static", + marginBox: domGeometry.getMarginBox(ed.domNode) + }; + + // Store the iframe state we have to restore later. + // Not using domStyle.get here, had problems, didn't + // give me stuff like 100%, gave me pixel calculated values. + // Need the exact original values. + var iframe = ed.iframe, + iframeStyle = iframe && iframe.style || {}; + + var bc = domStyle.get(ed.iframe, "backgroundColor"); + this._origiFrameState = { + backgroundColor: bc || "transparent", + width: iframeStyle.width || "auto", + height: iframeStyle.height || "auto", + zIndex: iframeStyle.zIndex || "" + }; + + // Okay, size everything. + domStyle.set(ed.domNode, { + position: "absolute", + top: "0px", + left: "0px", + zIndex: this.zIndex, + width: vp.w + "px", + height: vp.h + "px" + }); + + domStyle.set(ed.iframe, { + height: "100%", + width: "100%", + zIndex: this.zIndex, + backgroundColor: bc !== "transparent" && + bc !== "rgba(0, 0, 0, 0)"?bc:"white" + }); + + domStyle.set(ed.iframe.parentNode, { + height: "95%", + width: "100%" + }); + + // Store the overflow state we have to restore later. + // IE had issues, so have to check that it's defined. Ugh. + if(body.style && body.style.overflow){ + this._oldOverflow = domStyle.get(body, "overflow"); + }else{ + this._oldOverflow = ""; + } + + if(has("ie") && !has("quirks")){ + // IE will put scrollbars in anyway, html (parent of body) + // also controls them in standards mode, so we have to + // remove them, argh. + if(body.parentNode && + body.parentNode.style && + body.parentNode.style.overflow){ + this._oldBodyParentOverflow = body.parentNode.style.overflow; + }else{ + try{ + this._oldBodyParentOverflow = domStyle.get(body.parentNode, "overflow"); + }catch(e){ + this._oldBodyParentOverflow = "scroll"; + } + } + domStyle.set(body.parentNode, "overflow", "hidden"); + } + domStyle.set(body, "overflow", "hidden"); + + var resizer = function(){ + // function to handle resize events. + // Will check current VP and only resize if + // different. + var vp = winUtils.getBox(ed.ownerDocument); + if("_prevW" in this && "_prevH" in this){ + // No actual size change, ignore. + if(vp.w === this._prevW && vp.h === this._prevH){ + return; + } + }else{ + this._prevW = vp.w; + this._prevH = vp.h; + } + if(this._resizer){ + clearTimeout(this._resizer); + delete this._resizer; + } + // Timeout it to help avoid spamming resize on IE. + // Works for all browsers. + this._resizer = setTimeout(lang.hitch(this, function(){ + delete this._resizer; + this._resizeEditor(); + }), 10); + }; + this._resizeHandle = on(window, "resize", lang.hitch(this, resizer)); + + // Also monitor for direct calls to resize and adapt editor. + this._resizeHandle2 = aspect.after(ed, "onResize", lang.hitch(this, function(){ + if(this._resizer){ + clearTimeout(this._resizer); + delete this._resizer; + } + this._resizer = setTimeout(lang.hitch(this, function(){ + delete this._resizer; + this._resizeEditor(); + }), 10); + })); + + // Call it once to work around IE glitchiness. Safe for other browsers too. + this._resizeEditor(); + var dn = this.editor.toolbar.domNode; + setTimeout(function(){winUtils.scrollIntoView(dn);}, 250); + }else{ + if(this._resizeHandle){ + // Cleanup resizing listeners + this._resizeHandle.remove(); + this._resizeHandle = null; + } + if(this._resizeHandle2){ + // Cleanup resizing listeners + this._resizeHandle2.remove(); + this._resizeHandle2 = null; + } + if(this._rst){ + clearTimeout(this._rst); + this._rst = null; + } + + //Remove all position static class assigns. + while(editorParent && editorParent !== body){ + domClass.remove(editorParent, "dijitForceStatic"); + editorParent = editorParent.parentNode; + } + + // Restore resize function + if(this._editorResizeHolder){ + this.editor.resize = this._editorResizeHolder; + } + + if(!this._origState && !this._origiFrameState){ + // If we actually didn't toggle, then don't do anything. + return; + } + if(ed._fullscreen_oldOnKeyDown){ + ed.onKeyDown = ed._fullscreen_oldOnKeyDown; + delete ed._fullscreen_oldOnKeyDown; + } + + // Add a timeout to make sure we don't have a resize firing in the + // background at the time of minimize. + var self = this; + setTimeout(function(){ + // Restore all the editor state. + var mb = self._origState.marginBox; + var oh = self._origState.height; + if(has("ie") && !has("quirks")){ + body.parentNode.style.overflow = self._oldBodyParentOverflow; + delete self._oldBodyParentOverflow; + } + domStyle.set(body, "overflow", self._oldOverflow); + delete self._oldOverflow; + + domStyle.set(ed.domNode, self._origState); + domStyle.set(ed.iframe.parentNode, { + height: "", + width: "" + }); + domStyle.set(ed.iframe, self._origiFrameState); + delete self._origState; + delete self._origiFrameState; + // In case it is contained in a layout and the layout changed size, + // go ahead and call resize. + var pWidget = registry.getEnclosingWidget(ed.domNode.parentNode); + if(pWidget && pWidget.resize){ + pWidget.resize(); + }else{ + if(!oh || oh.indexOf("%") < 0){ + // Resize if the original size wasn't set + // or wasn't in percent. Timeout is to avoid + // an IE crash in unit testing. + setTimeout(lang.hitch(this, function(){ed.resize({h: mb.h});}), 0); + } + } + winUtils.scrollIntoView(self.editor.toolbar.domNode); + }, 100); + } + }, + + updateState: function(){ + // summary: + // Over-ride for button state control for disabled to work. + this.button.set("disabled", this.get("disabled")); + }, + + destroy: function(){ + // summary: + // Over-ride to ensure the resize handle gets cleaned up. + if(this._resizeHandle){ + // Cleanup resizing listeners + this._resizeHandle.remove(); + this._resizeHandle = null; + } + if(this._resizeHandle2){ + // Cleanup resizing listeners + this._resizeHandle2.remove(); + this._resizeHandle2 = null; + } + if(this._resizer){ + clearTimeout(this._resizer); + this._resizer = null; + } + this.inherited(arguments); + } +}); + +// Register this plugin. +// For back-compat accept "fullscreen" (all lowercase) too, remove in 2.0 +_Plugin.registry["fullScreen"] = _Plugin.registry["fullscreen"] = function(args){ + return new FullScreen({ + zIndex: ("zIndex" in args)?args.zIndex:500 + }); +}; + +return FullScreen; +}); diff --git a/lib/dijit/_editor/plugins/LinkDialog.js b/lib/dijit/_editor/plugins/LinkDialog.js index a70a9683c..f4fb0b56d 100644 --- a/lib/dijit/_editor/plugins/LinkDialog.js +++ b/lib/dijit/_editor/plugins/LinkDialog.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/LinkDialog",["require","dojo/_base/declare","dojo/dom-attr","dojo/keys","dojo/_base/lang","dojo/_base/sniff","dojo/string","dojo/_base/window","../../_Widget","../_Plugin","../../form/DropDownButton","../range","../selection"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d){var _e=_2("dijit._editor.plugins.LinkDialog",_a,{buttonClass:_b,useDefaultCommand:false,urlRegExp:"((https?|ftps?|file)\\://|./|/|)(/[a-zA-Z]{1,1}:/|)(((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)*(?:[a-zA-Z](?:[-\\da-zA-Z]{0,80}[\\da-zA-Z])?)\\.?)|(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]|(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]|(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])|0[xX]0*[\\da-fA-F]{1,8}|([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}|([\\da-fA-F]{1,4}\\:){6}((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])))(\\:\\d+)?(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]{0,}(?:\\?[^?#\\s/]*)?(?:#.*)?)?)?",emailRegExp:"<?(mailto\\:)([!#-'*+\\-\\/-9=?A-Z^-~]+[.])*[!#-'*+\\-\\/-9=?A-Z^-~]+"+"@"+"((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)+(?:[a-zA-Z](?:[-\\da-zA-Z]{0,6}[\\da-zA-Z])?)\\.?)|localhost|^[^-][a-zA-Z0-9_-]*>?",htmlTemplate:"<a href=\"${urlInput}\" _djrealurl=\"${urlInput}\""+" target=\"${targetSelect}\""+">${textInput}</a>",tag:"a",_hostRxp:/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/,_userAtRxp:/^([!#-'*+\-\/-9=?A-Z^-~]+[.])*[!#-'*+\-\/-9=?A-Z^-~]+@/i,linkDialogTemplate:["<table><tr><td>","<label for='${id}_urlInput'>${url}</label>","</td><td>","<input data-dojo-type='dijit.form.ValidationTextBox' required='true' "+"id='${id}_urlInput' name='urlInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","<label for='${id}_textInput'>${text}</label>","</td><td>","<input data-dojo-type='dijit.form.ValidationTextBox' required='true' id='${id}_textInput' "+"name='textInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","<label for='${id}_targetSelect'>${target}</label>","</td><td>","<select id='${id}_targetSelect' name='targetSelect' data-dojo-type='dijit.form.Select'>","<option selected='selected' value='_self'>${currentWindow}</option>","<option value='_blank'>${newWindow}</option>","<option value='_top'>${topWindow}</option>","<option value='_parent'>${parentWindow}</option>","</select>","</td></tr><tr><td colspan='2'>","<button data-dojo-type='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>","<button data-dojo-type='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>","</td></tr></table>"].join(""),_initButton:function(){this.inherited(arguments);this.button.loadDropDown=_5.hitch(this,"_loadDropDown");this._connectTagEvents();},_loadDropDown:function(_f){_1(["dojo/i18n","../../TooltipDialog","../../registry","../../form/Button","../../form/Select","../../form/ValidationTextBox","dojo/i18n!../../nls/common","dojo/i18n!../nls/LinkDialog"],_5.hitch(this,function(_10,_11,_12){var _13=this;this.tag=this.command=="insertImage"?"img":"a";var _14=_5.delegate(_10.getLocalization("dijit","common",this.lang),_10.getLocalization("dijit._editor","LinkDialog",this.lang));var _15=(this.dropDown=this.button.dropDown=new _11({title:_14[this.command+"Title"],execute:_5.hitch(this,"setValue"),onOpen:function(){_13._onOpenDialog();_11.prototype.onOpen.apply(this,arguments);},onCancel:function(){setTimeout(_5.hitch(_13,"_onCloseDialog"),0);}}));_14.urlRegExp=this.urlRegExp;_14.id=_12.getUniqueId(this.editor.id);this._uniqueId=_14.id;this._setContent(_15.title+"<div style='border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'></div>"+_7.substitute(this.linkDialogTemplate,_14));_15.startup();this._urlInput=_12.byId(this._uniqueId+"_urlInput");this._textInput=_12.byId(this._uniqueId+"_textInput");this._setButton=_12.byId(this._uniqueId+"_setButton");this.connect(_12.byId(this._uniqueId+"_cancelButton"),"onClick",function(){this.dropDown.onCancel();});if(this._urlInput){this.connect(this._urlInput,"onChange","_checkAndFixInput");}if(this._textInput){this.connect(this._textInput,"onChange","_checkAndFixInput");}this._urlRegExp=new RegExp("^"+this.urlRegExp+"$","i");this._emailRegExp=new RegExp("^"+this.emailRegExp+"$","i");this._urlInput.isValid=_5.hitch(this,function(){var _16=this._urlInput.get("value");return this._urlRegExp.test(_16)||this._emailRegExp.test(_16);});this.connect(_15.domNode,"onkeypress",function(e){if(e&&e.charOrCode==_4.ENTER&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey){if(!this._setButton.get("disabled")){_15.onExecute();_15.execute(_15.get("value"));}}});_f();}));},_checkAndFixInput:function(){var _17=this;var url=this._urlInput.get("value");var _18=function(url){var _19=false;var _1a=false;if(url&&url.length>1){url=_5.trim(url);if(url.indexOf("mailto:")!==0){if(url.indexOf("/")>0){if(url.indexOf("://")===-1){if(url.charAt(0)!=="/"&&url.indexOf("./")!==0){if(_17._hostRxp.test(url)){_19=true;}}}}else{if(_17._userAtRxp.test(url)){_1a=true;}}}}if(_19){_17._urlInput.set("value","http://"+url);}if(_1a){_17._urlInput.set("value","mailto:"+url);}_17._setButton.set("disabled",!_17._isValid());};if(this._delayedCheck){clearTimeout(this._delayedCheck);this._delayedCheck=null;}this._delayedCheck=setTimeout(function(){_18(url);},250);},_connectTagEvents:function(){this.editor.onLoadDeferred.addCallback(_5.hitch(this,function(){this.connect(this.editor.editNode,"ondblclick",this._onDblClick);}));},_isValid:function(){return this._urlInput.isValid()&&this._textInput.isValid();},_setContent:function(_1b){this.dropDown.set({parserScope:"dojo",content:_1b});},_checkValues:function(_1c){if(_1c&&_1c.urlInput){_1c.urlInput=_1c.urlInput.replace(/"/g,""");}return _1c;},setValue:function(_1d){this._onCloseDialog();if(_6("ie")<9){var sel=_c.getSelection(this.editor.window);var _1e=sel.getRangeAt(0);var a=_1e.endContainer;if(a.nodeType===3){a=a.parentNode;}if(a&&(a.nodeName&&a.nodeName.toLowerCase()!==this.tag)){a=_8.withGlobal(this.editor.window,"getSelectedElement",_d,[this.tag]);}if(a&&(a.nodeName&&a.nodeName.toLowerCase()===this.tag)){if(this.editor.queryCommandEnabled("unlink")){_8.withGlobal(this.editor.window,"selectElementChildren",_d,[a]);this.editor.execCommand("unlink");}}}_1d=this._checkValues(_1d);this.editor.execCommand("inserthtml",_7.substitute(this.htmlTemplate,_1d));},_onCloseDialog:function(){this.editor.focus();},_getCurrentValues:function(a){var url,_1f,_20;if(a&&a.tagName.toLowerCase()===this.tag){url=a.getAttribute("_djrealurl")||a.getAttribute("href");_20=a.getAttribute("target")||"_self";_1f=a.textContent||a.innerText;_8.withGlobal(this.editor.window,"selectElement",_d,[a,true]);}else{_1f=_8.withGlobal(this.editor.window,_d.getSelectedText);}return {urlInput:url||"",textInput:_1f||"",targetSelect:_20||""};},_onOpenDialog:function(){var a;if(_6("ie")<9){var sel=_c.getSelection(this.editor.window);var _21=sel.getRangeAt(0);a=_21.endContainer;if(a.nodeType===3){a=a.parentNode;}if(a&&(a.nodeName&&a.nodeName.toLowerCase()!==this.tag)){a=_8.withGlobal(this.editor.window,"getSelectedElement",_d,[this.tag]);}}else{a=_8.withGlobal(this.editor.window,"getAncestorElement",_d,[this.tag]);}this.dropDown.reset();this._setButton.set("disabled",true);this.dropDown.set("value",this._getCurrentValues(a));},_onDblClick:function(e){if(e&&e.target){var t=e.target;var tg=t.tagName?t.tagName.toLowerCase():"";if(tg===this.tag&&_3.get(t,"href")){var _22=this.editor;_8.withGlobal(_22.window,"selectElement",_d,[t]);_22.onDisplayChanged();if(_22._updateTimer){clearTimeout(_22._updateTimer);delete _22._updateTimer;}_22.onNormalizedDisplayChanged();var _23=this.button;setTimeout(function(){_23.set("disabled",false);_23.loadAndOpenDropDown().then(function(){if(_23.dropDown.focus){_23.dropDown.focus();}});},10);}}}});var _24=_2("dijit._editor.plugins.ImgLinkDialog",[_e],{linkDialogTemplate:["<table><tr><td>","<label for='${id}_urlInput'>${url}</label>","</td><td>","<input dojoType='dijit.form.ValidationTextBox' regExp='${urlRegExp}' "+"required='true' id='${id}_urlInput' name='urlInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","<label for='${id}_textInput'>${text}</label>","</td><td>","<input data-dojo-type='dijit.form.ValidationTextBox' required='false' id='${id}_textInput' "+"name='textInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","</td><td>","</td></tr><tr><td colspan='2'>","<button data-dojo-type='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>","<button data-dojo-type='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>","</td></tr></table>"].join(""),htmlTemplate:"<img src=\"${urlInput}\" _djrealurl=\"${urlInput}\" alt=\"${textInput}\" />",tag:"img",_getCurrentValues:function(img){var url,_25;if(img&&img.tagName.toLowerCase()===this.tag){url=img.getAttribute("_djrealurl")||img.getAttribute("src");_25=img.getAttribute("alt");_8.withGlobal(this.editor.window,"selectElement",_d,[img,true]);}else{_25=_8.withGlobal(this.editor.window,_d.getSelectedText);}return {urlInput:url||"",textInput:_25||""};},_isValid:function(){return this._urlInput.isValid();},_connectTagEvents:function(){this.inherited(arguments);this.editor.onLoadDeferred.addCallback(_5.hitch(this,function(){this.connect(this.editor.editNode,"onmousedown",this._selectTag);}));},_selectTag:function(e){if(e&&e.target){var t=e.target;var tg=t.tagName?t.tagName.toLowerCase():"";if(tg===this.tag){_8.withGlobal(this.editor.window,"selectElement",_d,[t]);}}},_checkValues:function(_26){if(_26&&_26.urlInput){_26.urlInput=_26.urlInput.replace(/"/g,""");}if(_26&&_26.textInput){_26.textInput=_26.textInput.replace(/"/g,""");}return _26;},_onDblClick:function(e){if(e&&e.target){var t=e.target;var tg=t.tagName?t.tagName.toLowerCase():"";if(tg===this.tag&&_3.get(t,"src")){var _27=this.editor;_8.withGlobal(_27.window,"selectElement",_d,[t]);_27.onDisplayChanged();if(_27._updateTimer){clearTimeout(_27._updateTimer);delete _27._updateTimer;}_27.onNormalizedDisplayChanged();var _28=this.button;setTimeout(function(){_28.set("disabled",false);_28.loadAndOpenDropDown().then(function(){if(_28.dropDown.focus){_28.dropDown.focus();}});},10);}}}});_a.registry["createLink"]=function(){return new _e({command:"createLink"});};_a.registry["insertImage"]=function(){return new _24({command:"insertImage"});};_e.ImgLinkDialog=_24;return _e;});
\ No newline at end of file +define("dijit/_editor/plugins/LinkDialog",["require","dojo/_base/declare","dojo/dom-attr","dojo/keys","dojo/_base/lang","dojo/sniff","dojo/_base/query","dojo/string","../../_Widget","../_Plugin","../../form/DropDownButton","../range"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c){var _d=_2("dijit._editor.plugins.LinkDialog",_a,{buttonClass:_b,useDefaultCommand:false,urlRegExp:"((https?|ftps?|file)\\://|./|../|/|)(/[a-zA-Z]{1,1}:/|)(((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)*(?:[a-zA-Z](?:[-\\da-zA-Z]{0,80}[\\da-zA-Z])?)\\.?)|(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]|(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]|(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])|0[xX]0*[\\da-fA-F]{1,8}|([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}|([\\da-fA-F]{1,4}\\:){6}((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])))(\\:\\d+)?(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]{0,}(?:\\?[^?#\\s/]*)?(?:#.*)?)?)?",emailRegExp:"<?(mailto\\:)([!#-'*+\\-\\/-9=?A-Z^-~]+[.])*[!#-'*+\\-\\/-9=?A-Z^-~]+"+"@"+"((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)+(?:[a-zA-Z](?:[-\\da-zA-Z]{0,6}[\\da-zA-Z])?)\\.?)|localhost|^[^-][a-zA-Z0-9_-]*>?",htmlTemplate:"<a href=\"${urlInput}\" _djrealurl=\"${urlInput}\""+" target=\"${targetSelect}\""+">${textInput}</a>",tag:"a",_hostRxp:/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/,_userAtRxp:/^([!#-'*+\-\/-9=?A-Z^-~]+[.])*[!#-'*+\-\/-9=?A-Z^-~]+@/i,linkDialogTemplate:["<table role='presentation'><tr><td>","<label for='${id}_urlInput'>${url}</label>","</td><td>","<input data-dojo-type='dijit.form.ValidationTextBox' required='true' "+"id='${id}_urlInput' name='urlInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","<label for='${id}_textInput'>${text}</label>","</td><td>","<input data-dojo-type='dijit.form.ValidationTextBox' required='true' id='${id}_textInput' "+"name='textInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","<label for='${id}_targetSelect'>${target}</label>","</td><td>","<select id='${id}_targetSelect' name='targetSelect' data-dojo-type='dijit.form.Select'>","<option selected='selected' value='_self'>${currentWindow}</option>","<option value='_blank'>${newWindow}</option>","<option value='_top'>${topWindow}</option>","<option value='_parent'>${parentWindow}</option>","</select>","</td></tr><tr><td colspan='2'>","<button data-dojo-type='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>","<button data-dojo-type='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>","</td></tr></table>"].join(""),_initButton:function(){this.inherited(arguments);this.button.loadDropDown=_5.hitch(this,"_loadDropDown");this._connectTagEvents();},_loadDropDown:function(_e){_1(["dojo/i18n","../../TooltipDialog","../../registry","../../form/Button","../../form/Select","../../form/ValidationTextBox","dojo/i18n!../../nls/common","dojo/i18n!../nls/LinkDialog"],_5.hitch(this,function(_f,_10,_11){var _12=this;this.tag=this.command=="insertImage"?"img":"a";var _13=_5.delegate(_f.getLocalization("dijit","common",this.lang),_f.getLocalization("dijit._editor","LinkDialog",this.lang));var _14=(this.dropDown=this.button.dropDown=new _10({title:_13[this.command+"Title"],ownerDocument:this.editor.ownerDocument,dir:this.editor.dir,execute:_5.hitch(this,"setValue"),onOpen:function(){_12._onOpenDialog();_10.prototype.onOpen.apply(this,arguments);},onCancel:function(){setTimeout(_5.hitch(_12,"_onCloseDialog"),0);}}));_13.urlRegExp=this.urlRegExp;_13.id=_11.getUniqueId(this.editor.id);this._uniqueId=_13.id;this._setContent(_14.title+"<div style='border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'></div>"+_8.substitute(this.linkDialogTemplate,_13));_14.startup();this._urlInput=_11.byId(this._uniqueId+"_urlInput");this._textInput=_11.byId(this._uniqueId+"_textInput");this._setButton=_11.byId(this._uniqueId+"_setButton");this.connect(_11.byId(this._uniqueId+"_cancelButton"),"onClick",function(){this.dropDown.onCancel();});if(this._urlInput){this.connect(this._urlInput,"onChange","_checkAndFixInput");}if(this._textInput){this.connect(this._textInput,"onChange","_checkAndFixInput");}this._urlRegExp=new RegExp("^"+this.urlRegExp+"$","i");this._emailRegExp=new RegExp("^"+this.emailRegExp+"$","i");this._urlInput.isValid=_5.hitch(this,function(){var _15=this._urlInput.get("value");return this._urlRegExp.test(_15)||this._emailRegExp.test(_15);});this.connect(_14.domNode,"onkeypress",function(e){if(e&&e.charOrCode==_4.ENTER&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey){if(!this._setButton.get("disabled")){_14.onExecute();_14.execute(_14.get("value"));}}});_e();}));},_checkAndFixInput:function(){var _16=this;var url=this._urlInput.get("value");var _17=function(url){var _18=false;var _19=false;if(url&&url.length>1){url=_5.trim(url);if(url.indexOf("mailto:")!==0){if(url.indexOf("/")>0){if(url.indexOf("://")===-1){if(url.charAt(0)!=="/"&&url.indexOf("./")&&url.indexOf("../")!==0){if(_16._hostRxp.test(url)){_18=true;}}}}else{if(_16._userAtRxp.test(url)){_19=true;}}}}if(_18){_16._urlInput.set("value","http://"+url);}if(_19){_16._urlInput.set("value","mailto:"+url);}_16._setButton.set("disabled",!_16._isValid());};if(this._delayedCheck){clearTimeout(this._delayedCheck);this._delayedCheck=null;}this._delayedCheck=setTimeout(function(){_17(url);},250);},_connectTagEvents:function(){this.editor.onLoadDeferred.then(_5.hitch(this,function(){this.connect(this.editor.editNode,"ondblclick",this._onDblClick);}));},_isValid:function(){return this._urlInput.isValid()&&this._textInput.isValid();},_setContent:function(_1a){this.dropDown.set({parserScope:"dojo",content:_1a});},_checkValues:function(_1b){if(_1b&&_1b.urlInput){_1b.urlInput=_1b.urlInput.replace(/"/g,""");}return _1b;},setValue:function(_1c){this._onCloseDialog();if(_6("ie")<9){var sel=_c.getSelection(this.editor.window);var _1d=sel.getRangeAt(0);var a=_1d.endContainer;if(a.nodeType===3){a=a.parentNode;}if(a&&(a.nodeName&&a.nodeName.toLowerCase()!==this.tag)){a=this.editor._sCall("getSelectedElement",[this.tag]);}if(a&&(a.nodeName&&a.nodeName.toLowerCase()===this.tag)){if(this.editor.queryCommandEnabled("unlink")){this.editor._sCall("selectElementChildren",[a]);this.editor.execCommand("unlink");}}}_1c=this._checkValues(_1c);this.editor.execCommand("inserthtml",_8.substitute(this.htmlTemplate,_1c));_7("a",this.editor.document).forEach(function(a){if(!a.innerHTML&&!_3.has(a,"name")){a.parentNode.removeChild(a);}},this);},_onCloseDialog:function(){this.editor.focus();},_getCurrentValues:function(a){var url,_1e,_1f;if(a&&a.tagName.toLowerCase()===this.tag){url=a.getAttribute("_djrealurl")||a.getAttribute("href");_1f=a.getAttribute("target")||"_self";_1e=a.textContent||a.innerText;this.editor._sCall("selectElement",[a,true]);}else{_1e=this.editor._sCall("getSelectedText");}return {urlInput:url||"",textInput:_1e||"",targetSelect:_1f||""};},_onOpenDialog:function(){var a,b,fc;if(_6("ie")){var sel=_c.getSelection(this.editor.window);if(sel.rangeCount){var _20=sel.getRangeAt(0);a=_20.endContainer;if(a.nodeType===3){a=a.parentNode;}if(a&&(a.nodeName&&a.nodeName.toLowerCase()!==this.tag)){a=this.editor._sCall("getSelectedElement",[this.tag]);}if(!a||(a.nodeName&&a.nodeName.toLowerCase()!==this.tag)){b=this.editor._sCall("getAncestorElement",[this.tag]);if(b&&(b.nodeName&&b.nodeName.toLowerCase()==this.tag)){a=b;this.editor._sCall("selectElement",[a]);}else{if(_20.startContainer===_20.endContainer){fc=_20.startContainer.firstChild;if(fc&&(fc.nodeName&&fc.nodeName.toLowerCase()==this.tag)){a=fc;this.editor._sCall("selectElement",[a]);}}}}}}else{a=this.editor._sCall("getAncestorElement",[this.tag]);}this.dropDown.reset();this._setButton.set("disabled",true);this.dropDown.set("value",this._getCurrentValues(a));},_onDblClick:function(e){if(e&&e.target){var t=e.target;var tg=t.tagName?t.tagName.toLowerCase():"";if(tg===this.tag&&_3.get(t,"href")){var _21=this.editor;this.editor._sCall("selectElement",[t]);_21.onDisplayChanged();if(_21._updateTimer){_21._updateTimer.remove();delete _21._updateTimer;}_21.onNormalizedDisplayChanged();var _22=this.button;setTimeout(function(){_22.set("disabled",false);_22.loadAndOpenDropDown().then(function(){if(_22.dropDown.focus){_22.dropDown.focus();}});},10);}}}});var _23=_2("dijit._editor.plugins.ImgLinkDialog",[_d],{linkDialogTemplate:["<table role='presentation'><tr><td>","<label for='${id}_urlInput'>${url}</label>","</td><td>","<input dojoType='dijit.form.ValidationTextBox' regExp='${urlRegExp}' "+"required='true' id='${id}_urlInput' name='urlInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","<label for='${id}_textInput'>${text}</label>","</td><td>","<input data-dojo-type='dijit.form.ValidationTextBox' required='false' id='${id}_textInput' "+"name='textInput' data-dojo-props='intermediateChanges:true'/>","</td></tr><tr><td>","</td><td>","</td></tr><tr><td colspan='2'>","<button data-dojo-type='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>","<button data-dojo-type='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>","</td></tr></table>"].join(""),htmlTemplate:"<img src=\"${urlInput}\" _djrealurl=\"${urlInput}\" alt=\"${textInput}\" />",tag:"img",_getCurrentValues:function(img){var url,_24;if(img&&img.tagName.toLowerCase()===this.tag){url=img.getAttribute("_djrealurl")||img.getAttribute("src");_24=img.getAttribute("alt");this.editor._sCall("selectElement",[img,true]);}else{_24=this.editor._sCall("getSelectedText",[]);}return {urlInput:url||"",textInput:_24||""};},_isValid:function(){return this._urlInput.isValid();},_connectTagEvents:function(){this.inherited(arguments);this.editor.onLoadDeferred.then(_5.hitch(this,function(){this.connect(this.editor.editNode,"onmousedown",this._selectTag);}));},_selectTag:function(e){if(e&&e.target){var t=e.target;var tg=t.tagName?t.tagName.toLowerCase():"";if(tg===this.tag){this.editor._sCall("selectElement",[t]);}}},_checkValues:function(_25){if(_25&&_25.urlInput){_25.urlInput=_25.urlInput.replace(/"/g,""");}if(_25&&_25.textInput){_25.textInput=_25.textInput.replace(/"/g,""");}return _25;},_onDblClick:function(e){if(e&&e.target){var t=e.target;var tg=t.tagName?t.tagName.toLowerCase():"";if(tg===this.tag&&_3.get(t,"src")){var _26=this.editor;this.editor._sCall("selectElement",[t]);_26.onDisplayChanged();if(_26._updateTimer){_26._updateTimer.remove();delete _26._updateTimer;}_26.onNormalizedDisplayChanged();var _27=this.button;setTimeout(function(){_27.set("disabled",false);_27.loadAndOpenDropDown().then(function(){if(_27.dropDown.focus){_27.dropDown.focus();}});},10);}}}});_a.registry["createLink"]=function(){return new _d({command:"createLink"});};_a.registry["insertImage"]=function(){return new _23({command:"insertImage"});};_d.ImgLinkDialog=_23;return _d;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/LinkDialog.js.uncompressed.js b/lib/dijit/_editor/plugins/LinkDialog.js.uncompressed.js new file mode 100644 index 000000000..5ed6ce3da --- /dev/null +++ b/lib/dijit/_editor/plugins/LinkDialog.js.uncompressed.js @@ -0,0 +1,609 @@ +define("dijit/_editor/plugins/LinkDialog", [ + "require", + "dojo/_base/declare", // declare + "dojo/dom-attr", // domAttr.get + "dojo/keys", // keys.ENTER + "dojo/_base/lang", // lang.delegate lang.hitch lang.trim + "dojo/sniff", // has("ie") + "dojo/_base/query", // query + "dojo/string", // string.substitute + "../../_Widget", + "../_Plugin", + "../../form/DropDownButton", + "../range" +], function(require, declare, domAttr, keys, lang, has, query, string, + _Widget, _Plugin, DropDownButton, rangeapi){ + + +// module: +// dijit/_editor/plugins/LinkDialog +// summary: +// Editor plugins: LinkDialog (for inserting links) and ImgLinkDialog (for inserting images) + + +var LinkDialog = declare("dijit._editor.plugins.LinkDialog", _Plugin, { + // summary: + // This plugin provides the basis for an 'anchor' (link) dialog and an extension of it + // provides the image link dialog. + // description: + // The command provided by this plugin is: + // + // - createLink + + // Override _Plugin.buttonClass. This plugin is controlled by a DropDownButton + // (which triggers a TooltipDialog). + buttonClass: DropDownButton, + + // Override _Plugin.useDefaultCommand... processing is handled by this plugin, not by dijit/Editor. + useDefaultCommand: false, + + // urlRegExp: [protected] String + // Used for validating input as correct URL. While file:// urls are not terribly + // useful, they are technically valid. + urlRegExp: "((https?|ftps?|file)\\://|\./|\.\./|/|)(/[a-zA-Z]{1,1}:/|)(((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)*(?:[a-zA-Z](?:[-\\da-zA-Z]{0,80}[\\da-zA-Z])?)\\.?)|(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]|(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]|(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])|0[xX]0*[\\da-fA-F]{1,8}|([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}|([\\da-fA-F]{1,4}\\:){6}((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])))(\\:\\d+)?(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]{0,}(?:\\?[^?#\\s/]*)?(?:#.*)?)?)?", + + // emailRegExp: [protected] String + // Used for validating input as correct email address. Taken from dojox.validate + emailRegExp: "<?(mailto\\:)([!#-'*+\\-\\/-9=?A-Z^-~]+[.])*[!#-'*+\\-\\/-9=?A-Z^-~]+" /*username*/ + "@" + + "((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)+(?:[a-zA-Z](?:[-\\da-zA-Z]{0,6}[\\da-zA-Z])?)\\.?)|localhost|^[^-][a-zA-Z0-9_-]*>?", // host. + + // htmlTemplate: [protected] String + // String used for templating the HTML to insert at the desired point. + htmlTemplate: "<a href=\"${urlInput}\" _djrealurl=\"${urlInput}\"" + + " target=\"${targetSelect}\"" + + ">${textInput}</a>", + + // tag: [protected] String + // Tag used for the link type. + tag: "a", + + // _hostRxp [private] RegExp + // Regular expression used to validate url fragments (ip address, hostname, etc) + _hostRxp: /^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/, + + // _userAtRxp [private] RegExp + // Regular expression used to validate e-mail address fragment. + _userAtRxp: /^([!#-'*+\-\/-9=?A-Z^-~]+[.])*[!#-'*+\-\/-9=?A-Z^-~]+@/i, + + // linkDialogTemplate: [protected] String + // Template for contents of TooltipDialog to pick URL + linkDialogTemplate: [ + "<table role='presentation'><tr><td>", + "<label for='${id}_urlInput'>${url}</label>", + "</td><td>", + "<input data-dojo-type='dijit.form.ValidationTextBox' required='true' " + + "id='${id}_urlInput' name='urlInput' data-dojo-props='intermediateChanges:true'/>", + "</td></tr><tr><td>", + "<label for='${id}_textInput'>${text}</label>", + "</td><td>", + "<input data-dojo-type='dijit.form.ValidationTextBox' required='true' id='${id}_textInput' " + + "name='textInput' data-dojo-props='intermediateChanges:true'/>", + "</td></tr><tr><td>", + "<label for='${id}_targetSelect'>${target}</label>", + "</td><td>", + "<select id='${id}_targetSelect' name='targetSelect' data-dojo-type='dijit.form.Select'>", + "<option selected='selected' value='_self'>${currentWindow}</option>", + "<option value='_blank'>${newWindow}</option>", + "<option value='_top'>${topWindow}</option>", + "<option value='_parent'>${parentWindow}</option>", + "</select>", + "</td></tr><tr><td colspan='2'>", + "<button data-dojo-type='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>", + "<button data-dojo-type='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>", + "</td></tr></table>" + ].join(""), + + _initButton: function(){ + this.inherited(arguments); + + // Setup to lazy create TooltipDialog first time the button is clicked + this.button.loadDropDown = lang.hitch(this, "_loadDropDown"); + + this._connectTagEvents(); + }, + _loadDropDown: function(callback){ + // Called the first time the button is pressed. Initialize TooltipDialog. + require([ + "dojo/i18n", // i18n.getLocalization + "../../TooltipDialog", + "../../registry", // registry.byId, registry.getUniqueId + "../../form/Button", // used by template + "../../form/Select", // used by template + "../../form/ValidationTextBox", // used by template + "dojo/i18n!../../nls/common", + "dojo/i18n!../nls/LinkDialog" + ], lang.hitch(this, function(i18n, TooltipDialog, registry){ + var _this = this; + this.tag = this.command == 'insertImage' ? 'img' : 'a'; + var messages = lang.delegate(i18n.getLocalization("dijit", "common", this.lang), + i18n.getLocalization("dijit._editor", "LinkDialog", this.lang)); + var dropDown = (this.dropDown = this.button.dropDown = new TooltipDialog({ + title: messages[this.command + "Title"], + ownerDocument: this.editor.ownerDocument, + dir: this.editor.dir, + execute: lang.hitch(this, "setValue"), + onOpen: function(){ + _this._onOpenDialog(); + TooltipDialog.prototype.onOpen.apply(this, arguments); + }, + onCancel: function(){ + setTimeout(lang.hitch(_this, "_onCloseDialog"),0); + } + })); + messages.urlRegExp = this.urlRegExp; + messages.id = registry.getUniqueId(this.editor.id); + this._uniqueId = messages.id; + this._setContent(dropDown.title + + "<div style='border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'></div>" + + string.substitute(this.linkDialogTemplate, messages)); + dropDown.startup(); + this._urlInput = registry.byId(this._uniqueId + "_urlInput"); + this._textInput = registry.byId(this._uniqueId + "_textInput"); + this._setButton = registry.byId(this._uniqueId + "_setButton"); + this.connect(registry.byId(this._uniqueId + "_cancelButton"), "onClick", function(){ + this.dropDown.onCancel(); + }); + if(this._urlInput){ + this.connect(this._urlInput, "onChange", "_checkAndFixInput"); + } + if(this._textInput){ + this.connect(this._textInput, "onChange", "_checkAndFixInput"); + } + + // Build up the dual check for http/https/file:, and mailto formats. + this._urlRegExp = new RegExp("^" + this.urlRegExp + "$", "i"); + this._emailRegExp = new RegExp("^" + this.emailRegExp + "$", "i"); + this._urlInput.isValid = lang.hitch(this, function(){ + // Function over-ride of isValid to test if the input matches a url or a mailto style link. + var value = this._urlInput.get("value"); + return this._urlRegExp.test(value) || this._emailRegExp.test(value); + }); + + // Listen for enter and execute if valid. + this.connect(dropDown.domNode, "onkeypress", function(e){ + if(e && e.charOrCode == keys.ENTER && + !e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey){ + if(!this._setButton.get("disabled")){ + dropDown.onExecute(); + dropDown.execute(dropDown.get('value')); + } + } + }); + + callback(); + })); + }, + + _checkAndFixInput: function(){ + // summary: + // A function to listen for onChange events and test the input contents + // for valid information, such as valid urls with http/https/ftp and if + // not present, try and guess if the input url is relative or not, and if + // not, append http:// to it. Also validates other fields as determined by + // the internal _isValid function. + var self = this; + var url = this._urlInput.get("value"); + var fixupUrl = function(url){ + var appendHttp = false; + var appendMailto = false; + if(url && url.length > 1){ + url = lang.trim(url); + if(url.indexOf("mailto:") !== 0){ + if(url.indexOf("/") > 0){ + if(url.indexOf("://") === -1){ + // Check that it doesn't start with /, ./, or ../, which would + // imply 'target server relativeness' + if(url.charAt(0) !== '/' && url.indexOf("./") && url.indexOf("../") !== 0){ + if(self._hostRxp.test(url)){ + appendHttp = true; + } + } + } + }else if(self._userAtRxp.test(url)){ + // If it looks like a foo@, append a mailto. + appendMailto = true; + } + } + } + if(appendHttp){ + self._urlInput.set("value", "http://" + url); + } + if(appendMailto){ + self._urlInput.set("value", "mailto:" + url); + } + self._setButton.set("disabled", !self._isValid()); + }; + if(this._delayedCheck){ + clearTimeout(this._delayedCheck); + this._delayedCheck = null; + } + this._delayedCheck = setTimeout(function(){ + fixupUrl(url); + }, 250); + }, + + _connectTagEvents: function(){ + // summary: + // Over-ridable function that connects tag specific events. + this.editor.onLoadDeferred.then(lang.hitch(this, function(){ + this.connect(this.editor.editNode, "ondblclick", this._onDblClick); + })); + }, + + _isValid: function(){ + // summary: + // Internal function to allow validating of the inputs + // for a link to determine if set should be disabled or not + // tags: + // protected + return this._urlInput.isValid() && this._textInput.isValid(); + }, + + _setContent: function(staticPanel){ + // summary: + // Helper for _initButton above. Not sure why it's a separate method. + this.dropDown.set({ + parserScope: "dojo", // make parser search for dojoType/data-dojo-type even if page is multi-version + content: staticPanel + }); + }, + + _checkValues: function(args){ + // summary: + // Function to check the values in args and 'fix' them up as needed. + // args: Object + // Content being set. + // tags: + // protected + if(args && args.urlInput){ + args.urlInput = args.urlInput.replace(/"/g, """); + } + return args; + }, + + setValue: function(args){ + // summary: + // Callback from the dialog when user presses "set" button. + // tags: + // private + + // TODO: prevent closing popup if the text is empty + this._onCloseDialog(); + if(has("ie") < 9){ //see #4151 + var sel = rangeapi.getSelection(this.editor.window); + var range = sel.getRangeAt(0); + var a = range.endContainer; + if(a.nodeType === 3){ + // Text node, may be the link contents, so check parent. + // This plugin doesn't really support nested HTML elements + // in the link, it assumes all link content is text. + a = a.parentNode; + } + if(a && (a.nodeName && a.nodeName.toLowerCase() !== this.tag)){ + // Still nothing, one last thing to try on IE, as it might be 'img' + // and thus considered a control. + a = this.editor._sCall("getSelectedElement", [this.tag]); + } + if(a && (a.nodeName && a.nodeName.toLowerCase() === this.tag)){ + // Okay, we do have a match. IE, for some reason, sometimes pastes before + // instead of removing the targeted paste-over element, so we unlink the + // old one first. If we do not the <a> tag remains, but it has no content, + // so isn't readily visible (but is wrong for the action). + if(this.editor.queryCommandEnabled("unlink")){ + // Select all the link children, then unlink. The following insert will + // then replace the selected text. + this.editor._sCall("selectElementChildren", [a]); + this.editor.execCommand("unlink"); + } + } + } + // make sure values are properly escaped, etc. + args = this._checkValues(args); + this.editor.execCommand('inserthtml', + string.substitute(this.htmlTemplate, args)); + + // IE sometimes leaves a blank link, so we need to fix it up. + // Go ahead and do this for everyone just to avoid blank links + // in the page. + query("a", this.editor.document).forEach(function(a){ + if(!a.innerHTML && !domAttr.has(a, "name")){ + // Remove empty anchors that do not have "name" set. + // Empty ones with a name set could be a hidden hash + // anchor. + a.parentNode.removeChild(a); + } + }, this); + }, + + _onCloseDialog: function(){ + // summary: + // Handler for close event on the dialog + this.editor.focus(); + }, + + _getCurrentValues: function(a){ + // summary: + // Over-ride for getting the values to set in the dropdown. + // a: + // The anchor/link to process for data for the dropdown. + // tags: + // protected + var url, text, target; + if(a && a.tagName.toLowerCase() === this.tag){ + url = a.getAttribute('_djrealurl') || a.getAttribute('href'); + target = a.getAttribute('target') || "_self"; + text = a.textContent || a.innerText; + this.editor._sCall("selectElement", [a, true]); + }else{ + text = this.editor._sCall("getSelectedText"); + } + return {urlInput: url || '', textInput: text || '', targetSelect: target || ''}; //Object; + }, + + _onOpenDialog: function(){ + // summary: + // Handler for when the dialog is opened. + // If the caret is currently in a URL then populate the URL's info into the dialog. + var a,b,fc; + if(has("ie")){ + // IE, even IE10, is difficult to select the element in, using the range unified + // API seems to work reasonably well. + var sel = rangeapi.getSelection(this.editor.window); + if(sel.rangeCount){ + var range = sel.getRangeAt(0); + a = range.endContainer; + if(a.nodeType === 3){ + // Text node, may be the link contents, so check parent. + // This plugin doesn't really support nested HTML elements + // in the link, it assumes all link content is text. + a = a.parentNode; + } + if(a && (a.nodeName && a.nodeName.toLowerCase() !== this.tag)){ + // Still nothing, one last thing to try on IE, as it might be 'img' + // and thus considered a control. + a = this.editor._sCall("getSelectedElement", [this.tag]); + } + if(!a || (a.nodeName && a.nodeName.toLowerCase() !== this.tag)){ + // Try another lookup, IE's selection is just terrible. + b = this.editor._sCall("getAncestorElement", [this.tag]); + if(b && (b.nodeName && b.nodeName.toLowerCase() == this.tag)){ + // Looks like we found an A tag, use it and make sure just it is + // selected. + a = b; + this.editor._sCall("selectElement", [a]); + }else if (range.startContainer === range.endContainer){ + // STILL nothing. Trying one more thing. Lets look at the first child. + // It might be an anchor tag in a div by itself or the like. If it is, + // we'll use it otherwise we give up. The selection is not easily + // determinable to be on an existing anchor tag. + fc = range.startContainer.firstChild; + if(fc && (fc.nodeName && fc.nodeName.toLowerCase() == this.tag)){ + a = fc; + this.editor._sCall("selectElement", [a]); + } + } + } + } + }else{ + a = this.editor._sCall("getAncestorElement", [this.tag]); + } + this.dropDown.reset(); + this._setButton.set("disabled", true); + this.dropDown.set("value", this._getCurrentValues(a)); + }, + + _onDblClick: function(e){ + // summary: + // Function to define a behavior on double clicks on the element + // type this dialog edits to select it and pop up the editor + // dialog. + // e: Object + // The double-click event. + // tags: + // protected. + if(e && e.target){ + var t = e.target; + var tg = t.tagName ? t.tagName.toLowerCase() : ""; + if(tg === this.tag && domAttr.get(t,"href")){ + var editor = this.editor; + + this.editor._sCall("selectElement", [t]); + editor.onDisplayChanged(); + + // Call onNormalizedDisplayChange() now, rather than on timer. + // On IE, when focus goes to the first <input> in the TooltipDialog, the editor loses it's selection. + // Later if onNormalizedDisplayChange() gets called via the timer it will disable the LinkDialog button + // (actually, all the toolbar buttons), at which point clicking the <input> will close the dialog, + // since (for unknown reasons) focus.js ignores disabled controls. + if(editor._updateTimer){ + editor._updateTimer.remove(); + delete editor._updateTimer; + } + editor.onNormalizedDisplayChanged(); + + var button = this.button; + setTimeout(function(){ + // Focus shift outside the event handler. + // IE doesn't like focus changes in event handles. + button.set("disabled", false); + button.loadAndOpenDropDown().then(function(){ + if(button.dropDown.focus){ + button.dropDown.focus(); + } + }); + }, 10); + } + } + } +}); + +var ImgLinkDialog = declare("dijit._editor.plugins.ImgLinkDialog", [LinkDialog], { + // summary: + // This plugin extends LinkDialog and adds in a plugin for handling image links. + // provides the image link dialog. + // description: + // The command provided by this plugin is: + // + // - insertImage + + // linkDialogTemplate: [protected] String + // Over-ride for template since img dialog doesn't need target that anchor tags may. + linkDialogTemplate: [ + "<table role='presentation'><tr><td>", + "<label for='${id}_urlInput'>${url}</label>", + "</td><td>", + "<input dojoType='dijit.form.ValidationTextBox' regExp='${urlRegExp}' " + + "required='true' id='${id}_urlInput' name='urlInput' data-dojo-props='intermediateChanges:true'/>", + "</td></tr><tr><td>", + "<label for='${id}_textInput'>${text}</label>", + "</td><td>", + "<input data-dojo-type='dijit.form.ValidationTextBox' required='false' id='${id}_textInput' " + + "name='textInput' data-dojo-props='intermediateChanges:true'/>", + "</td></tr><tr><td>", + "</td><td>", + "</td></tr><tr><td colspan='2'>", + "<button data-dojo-type='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>", + "<button data-dojo-type='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>", + "</td></tr></table>" + ].join(""), + + // htmlTemplate: [protected] String + // String used for templating the `<img>` HTML to insert at the desired point. + htmlTemplate: "<img src=\"${urlInput}\" _djrealurl=\"${urlInput}\" alt=\"${textInput}\" />", + + // tag: [protected] String + // Tag used for the link type (img). + tag: "img", + + _getCurrentValues: function(img){ + // summary: + // Over-ride for getting the values to set in the dropdown. + // a: + // The anchor/link to process for data for the dropdown. + // tags: + // protected + var url, text; + if(img && img.tagName.toLowerCase() === this.tag){ + url = img.getAttribute('_djrealurl') || img.getAttribute('src'); + text = img.getAttribute('alt'); + this.editor._sCall("selectElement", [img, true]); + }else{ + text = this.editor._sCall("getSelectedText", []); + } + return {urlInput: url || '', textInput: text || ''}; //Object + }, + + _isValid: function(){ + // summary: + // Over-ride for images. You can have alt text of blank, it is valid. + // tags: + // protected + return this._urlInput.isValid(); + }, + + _connectTagEvents: function(){ + // summary: + // Over-ridable function that connects tag specific events. + this.inherited(arguments); + this.editor.onLoadDeferred.then(lang.hitch(this, function(){ + // Use onmousedown instead of onclick. Seems that IE eats the first onclick + // to wrap it in a selector box, then the second one acts as onclick. See #10420 + this.connect(this.editor.editNode, "onmousedown", this._selectTag); + })); + }, + + _selectTag: function(e){ + // summary: + // A simple event handler that lets me select an image if it is clicked on. + // makes it easier to select images in a standard way across browsers. Otherwise + // selecting an image for edit becomes difficult. + // e: Event + // The mousedown event. + // tags: + // private + if(e && e.target){ + var t = e.target; + var tg = t.tagName? t.tagName.toLowerCase() : ""; + if(tg === this.tag){ + this.editor._sCall("selectElement", [t]); + } + } + }, + + _checkValues: function(args){ + // summary: + // Function to check the values in args and 'fix' them up as needed + // (special characters in the url or alt text) + // args: Object + // Content being set. + // tags: + // protected + if(args && args.urlInput){ + args.urlInput = args.urlInput.replace(/"/g, """); + } + if(args && args.textInput){ + args.textInput = args.textInput.replace(/"/g, """); + } + return args; + }, + + _onDblClick: function(e){ + // summary: + // Function to define a behavior on double clicks on the element + // type this dialog edits to select it and pop up the editor + // dialog. + // e: Object + // The double-click event. + // tags: + // protected. + if(e && e.target){ + var t = e.target; + var tg = t.tagName ? t.tagName.toLowerCase() : ""; + if(tg === this.tag && domAttr.get(t,"src")){ + var editor = this.editor; + + this.editor._sCall("selectElement", [t]); + editor.onDisplayChanged(); + + // Call onNormalizedDisplayChange() now, rather than on timer. + // On IE, when focus goes to the first <input> in the TooltipDialog, the editor loses it's selection. + // Later if onNormalizedDisplayChange() gets called via the timer it will disable the LinkDialog button + // (actually, all the toolbar buttons), at which point clicking the <input> will close the dialog, + // since (for unknown reasons) focus.js ignores disabled controls. + if(editor._updateTimer){ + editor._updateTimer.remove(); + delete editor._updateTimer; + } + editor.onNormalizedDisplayChanged(); + + var button = this.button; + setTimeout(function(){ + // Focus shift outside the event handler. + // IE doesn't like focus changes in event handles. + button.set("disabled", false); + button.loadAndOpenDropDown().then(function(){ + if(button.dropDown.focus){ + button.dropDown.focus(); + } + }); + }, 10); + } + } + } +}); + +// Register these plugins +_Plugin.registry["createLink"] = function(){ + return new LinkDialog({command: "createLink"}); +}; +_Plugin.registry["insertImage"] = function(){ + return new ImgLinkDialog({command: "insertImage"}); +}; + + +// Export both LinkDialog and ImgLinkDialog +// TODO for 2.0: either return both classes in a hash, or split this file into two separate files. +// Then the documentation for the module can be applied to the hash, and will show up in the API doc. +LinkDialog.ImgLinkDialog = ImgLinkDialog; +return LinkDialog; +}); diff --git a/lib/dijit/_editor/plugins/NewPage.js b/lib/dijit/_editor/plugins/NewPage.js index 911731a00..bdd07946e 100644 --- a/lib/dijit/_editor/plugins/NewPage.js +++ b/lib/dijit/_editor/plugins/NewPage.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/NewPage",["dojo/_base/declare","dojo/i18n","dojo/_base/lang","../_Plugin","../../form/Button","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5){var _6=_1("dijit._editor.plugins.NewPage",_4,{content:"<br>",_initButton:function(){var _7=_2.getLocalization("dijit._editor","commands"),_8=this.editor;this.button=new _5({label:_7["newPage"],dir:_8.dir,lang:_8.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"NewPage",tabIndex:"-1",onClick:_3.hitch(this,"_newPage")});},setEditor:function(_9){this.editor=_9;this._initButton();},updateState:function(){this.button.set("disabled",this.get("disabled"));},_newPage:function(){this.editor.beginEditing();this.editor.set("value",this.content);this.editor.endEditing();this.editor.focus();}});_4.registry["newPage"]=_4.registry["newpage"]=function(_a){return new _6({content:("content" in _a)?_a.content:"<br>"});};return _6;});
\ No newline at end of file +define("dijit/_editor/plugins/NewPage",["dojo/_base/declare","dojo/i18n","dojo/_base/lang","../_Plugin","../../form/Button","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5){var _6=_1("dijit._editor.plugins.NewPage",_4,{content:"<br>",_initButton:function(){var _7=_2.getLocalization("dijit._editor","commands"),_8=this.editor;this.button=new _5({label:_7["newPage"],ownerDocument:_8.ownerDocument,dir:_8.dir,lang:_8.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"NewPage",tabIndex:"-1",onClick:_3.hitch(this,"_newPage")});},setEditor:function(_9){this.editor=_9;this._initButton();},updateState:function(){this.button.set("disabled",this.get("disabled"));},_newPage:function(){this.editor.beginEditing();this.editor.set("value",this.content);this.editor.endEditing();this.editor.focus();}});_4.registry["newPage"]=_4.registry["newpage"]=function(_a){return new _6({content:("content" in _a)?_a.content:"<br>"});};return _6;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/NewPage.js.uncompressed.js b/lib/dijit/_editor/plugins/NewPage.js.uncompressed.js new file mode 100644 index 000000000..72b6f686a --- /dev/null +++ b/lib/dijit/_editor/plugins/NewPage.js.uncompressed.js @@ -0,0 +1,77 @@ +define("dijit/_editor/plugins/NewPage", [ + "dojo/_base/declare", // declare + "dojo/i18n", // i18n.getLocalization + "dojo/_base/lang", // lang.hitch + "../_Plugin", + "../../form/Button", + "dojo/i18n!../nls/commands" +], function(declare, i18n, lang, _Plugin, Button){ + +// module: +// dijit/_editor/plugins/NewPage + + +var NewPage = declare("dijit._editor.plugins.NewPage",_Plugin,{ + // summary: + // This plugin provides a simple 'new page' capability. In other + // words, set content to some default user defined string. + + // content: [public] String + // The default content to insert into the editor as the new page. + // The default is the `<br>` tag, a single blank line. + content: "<br>", + + _initButton: function(){ + // summary: + // Over-ride for creation of the Print button. + var strings = i18n.getLocalization("dijit._editor", "commands"), + editor = this.editor; + this.button = new Button({ + label: strings["newPage"], + ownerDocument: editor.ownerDocument, + dir: editor.dir, + lang: editor.lang, + showLabel: false, + iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "NewPage", + tabIndex: "-1", + onClick: lang.hitch(this, "_newPage") + }); + }, + + setEditor: function(/*dijit/Editor*/ editor){ + // summary: + // Tell the plugin which Editor it is associated with. + // editor: Object + // The editor object to attach the newPage capability to. + this.editor = editor; + this._initButton(); + }, + + updateState: function(){ + // summary: + // Over-ride for button state control for disabled to work. + this.button.set("disabled", this.get("disabled")); + }, + + _newPage: function(){ + // summary: + // Function to set the content to blank. + // tags: + // private + this.editor.beginEditing(); + this.editor.set("value", this.content); + this.editor.endEditing(); + this.editor.focus(); + } +}); + +// Register this plugin. +// For back-compat accept "newpage" (all lowercase) too, remove in 2.0 +_Plugin.registry["newPage"] = _Plugin.registry["newpage"] = function(args){ + return new NewPage({ + content: ("content" in args)?args.content:"<br>" + }); +}; + +return NewPage; +}); diff --git a/lib/dijit/_editor/plugins/Print.js b/lib/dijit/_editor/plugins/Print.js index 7de192d52..b8d83cb2b 100644 --- a/lib/dijit/_editor/plugins/Print.js +++ b/lib/dijit/_editor/plugins/Print.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/Print",["dojo/_base/declare","dojo/i18n","dojo/_base/lang","dojo/_base/sniff","../../focus","../_Plugin","../../form/Button","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5,_6,_7){var _8=_1("dijit._editor.plugins.Print",_6,{_initButton:function(){var _9=_2.getLocalization("dijit._editor","commands"),_a=this.editor;this.button=new _7({label:_9["print"],dir:_a.dir,lang:_a.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"Print",tabIndex:"-1",onClick:_3.hitch(this,"_print")});},setEditor:function(_b){this.editor=_b;this._initButton();this.editor.onLoadDeferred.addCallback(_3.hitch(this,function(){if(!this.editor.iframe.contentWindow["print"]){this.button.set("disabled",true);}}));},updateState:function(){var _c=this.get("disabled");if(!this.editor.iframe.contentWindow["print"]){_c=true;}this.button.set("disabled",_c);},_print:function(){var _d=this.editor.iframe;if(_d.contentWindow["print"]){if(!_4("opera")&&!_4("chrome")){_5.focus(_d);_d.contentWindow.print();}else{var _e=this.editor.document;var _f=this.editor.get("value");_f="<html><head><meta http-equiv='Content-Type' "+"content='text/html; charset='UTF-8'></head><body>"+_f+"</body></html>";var win=window.open("javascript: ''","","status=0,menubar=0,location=0,toolbar=0,"+"width=1,height=1,resizable=0,scrollbars=0");win.document.open();win.document.write(_f);win.document.close();var _10=_e.getElementsByTagName("style");if(_10){var i;for(i=0;i<_10.length;i++){var _11=_10[i].innerHTML;var _12=win.document.createElement("style");_12.appendChild(win.document.createTextNode(_11));win.document.getElementsByTagName("head")[0].appendChild(_12);}}win.print();win.close();}}}});_6.registry["print"]=function(){return new _8({command:"print"});};return _8;});
\ No newline at end of file +define("dijit/_editor/plugins/Print",["dojo/_base/declare","dojo/i18n","dojo/_base/lang","dojo/sniff","../../focus","../_Plugin","../../form/Button","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5,_6,_7){var _8=_1("dijit._editor.plugins.Print",_6,{_initButton:function(){var _9=_2.getLocalization("dijit._editor","commands"),_a=this.editor;this.button=new _7({label:_9["print"],ownerDocument:_a.ownerDocument,dir:_a.dir,lang:_a.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"Print",tabIndex:"-1",onClick:_3.hitch(this,"_print")});},setEditor:function(_b){this.editor=_b;this._initButton();this.editor.onLoadDeferred.then(_3.hitch(this,function(){if(!this.editor.iframe.contentWindow["print"]){this.button.set("disabled",true);}}));},updateState:function(){var _c=this.get("disabled");if(!this.editor.iframe.contentWindow["print"]){_c=true;}this.button.set("disabled",_c);},_print:function(){var _d=this.editor.iframe;if(_d.contentWindow["print"]){if(!_4("opera")&&!_4("chrome")){_5.focus(_d);_d.contentWindow.print();}else{var _e=this.editor.document;var _f=this.editor.get("value");_f="<html><head><meta http-equiv='Content-Type' "+"content='text/html; charset='UTF-8'></head><body>"+_f+"</body></html>";var win=window.open("javascript: ''","","status=0,menubar=0,location=0,toolbar=0,"+"width=1,height=1,resizable=0,scrollbars=0");win.document.open();win.document.write(_f);win.document.close();var _10=_e.getElementsByTagName("style");if(_10){var i;for(i=0;i<_10.length;i++){var _11=_10[i].innerHTML;var _12=win.document.createElement("style");_12.appendChild(win.document.createTextNode(_11));win.document.getElementsByTagName("head")[0].appendChild(_12);}}win.print();win.close();}}}});_6.registry["print"]=function(){return new _8({command:"print"});};return _8;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/Print.js.uncompressed.js b/lib/dijit/_editor/plugins/Print.js.uncompressed.js new file mode 100644 index 000000000..933633d24 --- /dev/null +++ b/lib/dijit/_editor/plugins/Print.js.uncompressed.js @@ -0,0 +1,123 @@ +define("dijit/_editor/plugins/Print", [ + "dojo/_base/declare", // declare + "dojo/i18n", // i18n.getLocalization + "dojo/_base/lang", // lang.hitch + "dojo/sniff", // has("chrome") has("opera") + "../../focus", // focus.focus() + "../_Plugin", + "../../form/Button", + "dojo/i18n!../nls/commands" +], function(declare, i18n, lang, has, focus, _Plugin, Button){ + +// module: +// dijit/_editor/plugins/Print + + +var Print = declare("dijit._editor.plugins.Print",_Plugin,{ + // summary: + // This plugin provides Print capability to the editor. When + // clicked, the document in the editor frame will be printed. + + _initButton: function(){ + // summary: + // Over-ride for creation of the Print button. + var strings = i18n.getLocalization("dijit._editor", "commands"), + editor = this.editor; + this.button = new Button({ + label: strings["print"], + ownerDocument: editor.ownerDocument, + dir: editor.dir, + lang: editor.lang, + showLabel: false, + iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "Print", + tabIndex: "-1", + onClick: lang.hitch(this, "_print") + }); + }, + + setEditor: function(/*dijit/Editor*/ editor){ + // summary: + // Tell the plugin which Editor it is associated with. + // editor: Object + // The editor object to attach the print capability to. + this.editor = editor; + this._initButton(); + + // Set up a check that we have a print function + // and disable button if we do not. + this.editor.onLoadDeferred.then( + lang.hitch(this, function(){ + if(!this.editor.iframe.contentWindow["print"]){ + this.button.set("disabled", true); + } + }) + ); + }, + + updateState: function(){ + // summary: + // Over-ride for button state control for disabled to work. + var disabled = this.get("disabled"); + if(!this.editor.iframe.contentWindow["print"]){ + disabled = true; + } + this.button.set("disabled", disabled); + }, + + _print: function(){ + // summary: + // Function to trigger printing of the editor document + // tags: + // private + var edFrame = this.editor.iframe; + if(edFrame.contentWindow["print"]){ + // IE requires the frame to be focused for + // print to work, but since this is okay for all + // no special casing. + if(!has("opera") && !has("chrome")){ + focus.focus(edFrame); + edFrame.contentWindow.print(); + }else{ + // Neither Opera nor Chrome 3 et you print single frames. + // So, open a new 'window', print it, and close it. + // Also, can't use size 0x0, have to use 1x1 + var edDoc = this.editor.document; + var content = this.editor.get("value"); + content = "<html><head><meta http-equiv='Content-Type' " + + "content='text/html; charset='UTF-8'></head><body>" + + content + "</body></html>"; + var win = window.open("javascript: ''", + "", + "status=0,menubar=0,location=0,toolbar=0," + + "width=1,height=1,resizable=0,scrollbars=0"); + win.document.open(); + win.document.write(content); + win.document.close(); + + var styleNodes = edDoc.getElementsByTagName("style"); + if(styleNodes){ + // Clone over any editor view styles, since we can't print the iframe + // directly. + var i; + for(i = 0; i < styleNodes.length; i++){ + var style = styleNodes[i].innerHTML; + var sNode = win.document.createElement("style"); + sNode.appendChild(win.document.createTextNode(style)); + win.document.getElementsByTagName("head")[0].appendChild(sNode); + } + } + win.print(); + win.close(); + } + } + } +}); + +// Register this plugin. +_Plugin.registry["print"] = function(){ + return new Print({command: "print"}); +}; + + +return Print; +}); diff --git a/lib/dijit/_editor/plugins/TabIndent.js.uncompressed.js b/lib/dijit/_editor/plugins/TabIndent.js.uncompressed.js new file mode 100644 index 000000000..3cd0a136b --- /dev/null +++ b/lib/dijit/_editor/plugins/TabIndent.js.uncompressed.js @@ -0,0 +1,60 @@ +define("dijit/_editor/plugins/TabIndent", [ + "dojo/_base/declare", // declare + "dojo/_base/kernel", // kernel.experimental + "../_Plugin", + "../../form/ToggleButton" +], function(declare, kernel, _Plugin, ToggleButton){ + + // module: + // dijit/_editor/plugins/TabIndent + + kernel.experimental("dijit._editor.plugins.TabIndent"); + + + var TabIndent = declare("dijit._editor.plugins.TabIndent", _Plugin, { + // summary: + // This plugin is used to allow the use of the tab and shift-tab keys + // to indent/outdent list items. This overrides the default behavior + // of moving focus from/to the toolbar + + // Override _Plugin.useDefaultCommand... processing is handled by this plugin, not by dijit/Editor. + useDefaultCommand: false, + + // Override _Plugin.buttonClass to use a ToggleButton for this plugin rather than a vanilla Button + buttonClass: ToggleButton, + + command: "tabIndent", + + _initButton: function(){ + // Override _Plugin._initButton() to setup listener on button click + this.inherited(arguments); + + var e = this.editor; + this.connect(this.button, "onChange", function(val){ + e.set("isTabIndent", val); + }); + + // Set initial checked state of button based on Editor.isTabIndent + this.updateState(); + }, + + updateState: function(){ + // Overrides _Plugin.updateState(). + // Ctrl-m in the editor will switch tabIndent mode on/off, so we need to react to that. + var disabled = this.get("disabled"); + this.button.set("disabled", disabled); + if(disabled){ + return; + } + this.button.set('checked', this.editor.isTabIndent, false); + } + }); + + // Register this plugin. + _Plugin.registry["tabIndent"] = function(){ + return new TabIndent({command: "tabIndent"}); + }; + + + return TabIndent; +}); diff --git a/lib/dijit/_editor/plugins/TextColor.js b/lib/dijit/_editor/plugins/TextColor.js index c7943d640..7aa50cd51 100644 --- a/lib/dijit/_editor/plugins/TextColor.js +++ b/lib/dijit/_editor/plugins/TextColor.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/TextColor",["require","dojo/colors","dojo/_base/declare","dojo/_base/lang","../_Plugin","../../form/DropDownButton"],function(_1,_2,_3,_4,_5,_6){var _7=_3("dijit._editor.plugins.TextColor",_5,{buttonClass:_6,useDefaultCommand:false,_initButton:function(){this.inherited(arguments);var _8=this;this.button.loadDropDown=function(_9){_1(["../../ColorPalette"],_4.hitch(this,function(_a){this.dropDown=new _a({value:_8.value,onChange:function(_b){_8.editor.execCommand(_8.command,_b);}});_9();}));};},updateState:function(){var _c=this.editor;var _d=this.command;if(!_c||!_c.isLoaded||!_d.length){return;}if(this.button){var _e=this.get("disabled");this.button.set("disabled",_e);if(_e){return;}var _f;try{_f=_c.queryCommandValue(_d)||"";}catch(e){_f="";}}if(_f==""){_f="#000000";}if(_f=="transparent"){_f="#ffffff";}if(typeof _f=="string"){if(_f.indexOf("rgb")>-1){_f=_2.fromRgb(_f).toHex();}}else{_f=((_f&255)<<16)|(_f&65280)|((_f&16711680)>>>16);_f=_f.toString(16);_f="#000000".slice(0,7-_f.length)+_f;}this.value=_f;var _10=this.button.dropDown;if(_10&&_f!==_10.get("value")){_10.set("value",_f,false);}}});_5.registry["foreColor"]=function(){return new _7({command:"foreColor"});};_5.registry["hiliteColor"]=function(){return new _7({command:"hiliteColor"});};return _7;});
\ No newline at end of file +define("dijit/_editor/plugins/TextColor",["require","dojo/colors","dojo/_base/declare","dojo/_base/lang","../_Plugin","../../form/DropDownButton"],function(_1,_2,_3,_4,_5,_6){var _7=_3("dijit._editor.plugins.TextColor",_5,{buttonClass:_6,useDefaultCommand:false,_initButton:function(){this.inherited(arguments);var _8=this;this.button.loadDropDown=function(_9){_1(["../../ColorPalette"],_4.hitch(this,function(_a){this.dropDown=new _a({dir:_8.editor.dir,ownerDocument:_8.editor.ownerDocument,value:_8.value,onChange:function(_b){_8.editor.execCommand(_8.command,_b);}});_9();}));};},updateState:function(){var _c=this.editor;var _d=this.command;if(!_c||!_c.isLoaded||!_d.length){return;}if(this.button){var _e=this.get("disabled");this.button.set("disabled",_e);if(_e){return;}var _f;try{_f=_c.queryCommandValue(_d)||"";}catch(e){_f="";}}if(_f==""){_f="#000000";}if(_f=="transparent"){_f="#ffffff";}if(typeof _f=="string"){if(_f.indexOf("rgb")>-1){_f=_2.fromRgb(_f).toHex();}}else{_f=((_f&255)<<16)|(_f&65280)|((_f&16711680)>>>16);_f=_f.toString(16);_f="#000000".slice(0,7-_f.length)+_f;}this.value=_f;var _10=this.button.dropDown;if(_10&&_f!==_10.get("value")){_10.set("value",_f,false);}}});_5.registry["foreColor"]=function(){return new _7({command:"foreColor"});};_5.registry["hiliteColor"]=function(){return new _7({command:"hiliteColor"});};return _7;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/TextColor.js.uncompressed.js b/lib/dijit/_editor/plugins/TextColor.js.uncompressed.js new file mode 100644 index 000000000..b8da7c4a6 --- /dev/null +++ b/lib/dijit/_editor/plugins/TextColor.js.uncompressed.js @@ -0,0 +1,115 @@ +define("dijit/_editor/plugins/TextColor", [ + "require", + "dojo/colors", // colors.fromRgb + "dojo/_base/declare", // declare + "dojo/_base/lang", + "../_Plugin", + "../../form/DropDownButton" +], function(require, colors, declare, lang, _Plugin, DropDownButton){ + +// module: +// dijit/_editor/plugins/TextColor + + +var TextColor = declare("dijit._editor.plugins.TextColor", _Plugin, { + // summary: + // This plugin provides dropdown color pickers for setting text color and background color + // description: + // The commands provided by this plugin are: + // + // - foreColor - sets the text color + // - hiliteColor - sets the background color + + // Override _Plugin.buttonClass to use DropDownButton (with ColorPalette) to control this plugin + buttonClass: DropDownButton, + + // useDefaultCommand: Boolean + // False as we do not use the default editor command/click behavior. + useDefaultCommand: false, + + _initButton: function(){ + this.inherited(arguments); + + // Setup to lazy load ColorPalette first time the button is clicked + var self = this; + this.button.loadDropDown = function(callback){ + require(["../../ColorPalette"], lang.hitch(this, function(ColorPalette){ + this.dropDown = new ColorPalette({ + dir: self.editor.dir, + ownerDocument: self.editor.ownerDocument, + value: self.value, + onChange: function(color){ + self.editor.execCommand(self.command, color); + } + }); + callback(); + })); + }; + }, + + updateState: function(){ + // summary: + // Overrides _Plugin.updateState(). This updates the ColorPalette + // to show the color of the currently selected text. + // tags: + // protected + + var _e = this.editor; + var _c = this.command; + if(!_e || !_e.isLoaded || !_c.length){ + return; + } + + if(this.button){ + var disabled = this.get("disabled"); + this.button.set("disabled", disabled); + if(disabled){ return; } + + var value; + try{ + value = _e.queryCommandValue(_c)|| ""; + }catch(e){ + //Firefox may throw error above if the editor is just loaded, ignore it + value = ""; + } + } + + if(value == ""){ + value = "#000000"; + } + if(value == "transparent"){ + value = "#ffffff"; + } + + if(typeof value == "string"){ + //if RGB value, convert to hex value + if(value.indexOf("rgb")> -1){ + value = colors.fromRgb(value).toHex(); + } + }else{ //it's an integer(IE returns an MS access #) + value =((value & 0x0000ff)<< 16)|(value & 0x00ff00)|((value & 0xff0000)>>> 16); + value = value.toString(16); + value = "#000000".slice(0, 7 - value.length)+ value; + + } + + this.value = value; + + var dropDown = this.button.dropDown; + if(dropDown && value !== dropDown.get('value')){ + dropDown.set('value', value, false); + } + } +}); + +// Register this plugin. +_Plugin.registry["foreColor"] = function(){ + return new TextColor({command: "foreColor"}); +}; +_Plugin.registry["hiliteColor"] = function(){ + return new TextColor({command: "hiliteColor"}); +}; + + +return TextColor; +}); diff --git a/lib/dijit/_editor/plugins/ToggleDir.js b/lib/dijit/_editor/plugins/ToggleDir.js index 058445a9c..bf16dce9c 100644 --- a/lib/dijit/_editor/plugins/ToggleDir.js +++ b/lib/dijit/_editor/plugins/ToggleDir.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/ToggleDir",["dojo/_base/declare","dojo/dom-style","dojo/_base/kernel","dojo/_base/lang","../_Plugin","../../form/ToggleButton"],function(_1,_2,_3,_4,_5,_6){_3.experimental("dijit._editor.plugins.ToggleDir");var _7=_1("dijit._editor.plugins.ToggleDir",_5,{useDefaultCommand:false,command:"toggleDir",buttonClass:_6,_initButton:function(){this.inherited(arguments);this.editor.onLoadDeferred.addCallback(_4.hitch(this,function(){var _8=this.editor.editorObject.contentWindow.document.documentElement;_8=_8.getElementsByTagName("body")[0];var _9=_2.getComputedStyle(_8).direction=="ltr";this.button.set("checked",!_9);this.connect(this.button,"onChange","_setRtl");}));},updateState:function(){this.button.set("disabled",this.get("disabled"));},_setRtl:function(_a){var _b="ltr";if(_a){_b="rtl";}var _c=this.editor.editorObject.contentWindow.document.documentElement;_c=_c.getElementsByTagName("body")[0];_c.dir=_b;}});_5.registry["toggleDir"]=function(){return new _7({command:"toggleDir"});};return _7;});
\ No newline at end of file +define("dijit/_editor/plugins/ToggleDir",["dojo/_base/declare","dojo/dom-style","dojo/_base/kernel","dojo/_base/lang","../_Plugin","../../form/ToggleButton"],function(_1,_2,_3,_4,_5,_6){_3.experimental("dijit._editor.plugins.ToggleDir");var _7=_1("dijit._editor.plugins.ToggleDir",_5,{useDefaultCommand:false,command:"toggleDir",buttonClass:_6,_initButton:function(){this.inherited(arguments);this.editor.onLoadDeferred.then(_4.hitch(this,function(){var _8=this.editor.editorObject.contentWindow.document.documentElement;_8=_8.getElementsByTagName("body")[0];var _9=_2.getComputedStyle(_8).direction=="ltr";this.button.set("checked",!_9);this.connect(this.button,"onChange","_setRtl");}));},updateState:function(){this.button.set("disabled",this.get("disabled"));},_setRtl:function(_a){var _b="ltr";if(_a){_b="rtl";}var _c=this.editor.editorObject.contentWindow.document.documentElement;_c=_c.getElementsByTagName("body")[0];_c.dir=_b;}});_5.registry["toggleDir"]=function(){return new _7({command:"toggleDir"});};return _7;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/ToggleDir.js.uncompressed.js b/lib/dijit/_editor/plugins/ToggleDir.js.uncompressed.js new file mode 100644 index 000000000..7b36a21d9 --- /dev/null +++ b/lib/dijit/_editor/plugins/ToggleDir.js.uncompressed.js @@ -0,0 +1,69 @@ +define("dijit/_editor/plugins/ToggleDir", [ + "dojo/_base/declare", // declare + "dojo/dom-style", // domStyle.getComputedStyle + "dojo/_base/kernel", // kernel.experimental + "dojo/_base/lang", // lang.hitch + "../_Plugin", + "../../form/ToggleButton" +], function(declare, domStyle, kernel, lang, _Plugin, ToggleButton){ + + // module: + // dijit/_editor/plugins/ToggleDir + + kernel.experimental("dijit._editor.plugins.ToggleDir"); + + var ToggleDir = declare("dijit._editor.plugins.ToggleDir", _Plugin, { + // summary: + // This plugin is used to toggle direction of the edited document, + // independent of what direction the whole page is. + + // Override _Plugin.useDefaultCommand: processing is done in this plugin + // rather than by sending commands to the Editor + useDefaultCommand: false, + + command: "toggleDir", + + // Override _Plugin.buttonClass to use a ToggleButton for this plugin rather than a vanilla Button + buttonClass: ToggleButton, + + _initButton: function(){ + // Override _Plugin._initButton() to setup handler for button click events. + this.inherited(arguments); + this.editor.onLoadDeferred.then(lang.hitch(this, function(){ + var editDoc = this.editor.editorObject.contentWindow.document.documentElement; + //IE direction has to toggle on the body, not document itself. + //If you toggle just the document, things get very strange in the + //view. But, the nice thing is this works for all supported browsers. + editDoc = editDoc.getElementsByTagName("body")[0]; + var isLtr = domStyle.getComputedStyle(editDoc).direction == "ltr"; + this.button.set("checked", !isLtr); + this.connect(this.button, "onChange", "_setRtl"); + })); + }, + + updateState: function(){ + // summary: + // Over-ride for button state control for disabled to work. + this.button.set("disabled", this.get("disabled")); + }, + + _setRtl: function(rtl){ + // summary: + // Handler for button click events, to switch the text direction of the editor + var dir = "ltr"; + if(rtl){ + dir = "rtl"; + } + var editDoc = this.editor.editorObject.contentWindow.document.documentElement; + editDoc = editDoc.getElementsByTagName("body")[0]; + editDoc.dir/*html node*/ = dir; + } + }); + + // Register this plugin. + _Plugin.registry["toggleDir"] = function(){ + return new ToggleDir({command: "toggleDir"}); + }; + + return ToggleDir; +}); diff --git a/lib/dijit/_editor/plugins/ViewSource.js b/lib/dijit/_editor/plugins/ViewSource.js index c788fa048..e235ed09b 100644 --- a/lib/dijit/_editor/plugins/ViewSource.js +++ b/lib/dijit/_editor/plugins/ViewSource.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/plugins/ViewSource",["dojo/_base/array","dojo/_base/declare","dojo/dom-attr","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/_base/event","dojo/i18n","dojo/keys","dojo/_base/lang","dojo/on","dojo/_base/sniff","dojo/_base/window","dojo/window","../../focus","../_Plugin","../../form/ToggleButton","../..","../../registry","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,on,_b,_c,_d,_e,_f,_10,_11,_12){var _13=_2("dijit._editor.plugins.ViewSource",_f,{stripScripts:true,stripComments:true,stripIFrames:true,readOnly:false,_fsPlugin:null,toggle:function(){if(_b("webkit")){this._vsFocused=true;}this.button.set("checked",!this.button.get("checked"));},_initButton:function(){var _14=_8.getLocalization("dijit._editor","commands"),_15=this.editor;this.button=new _10({label:_14["viewSource"],dir:_15.dir,lang:_15.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"ViewSource",tabIndex:"-1",onChange:_a.hitch(this,"_showSource")});if(_b("ie")==7){this._ieFixNode=_4.create("div",{style:{opacity:"0",zIndex:"-1000",position:"absolute",top:"-1000px"}},_c.body());}this.button.set("readOnly",false);},setEditor:function(_16){this.editor=_16;this._initButton();this.editor.addKeyHandler(_9.F12,true,true,_a.hitch(this,function(e){this.button.focus();this.toggle();_7.stop(e);setTimeout(_a.hitch(this,function(){this.editor.focus();}),100);}));},_showSource:function(_17){var ed=this.editor;var _18=ed._plugins;var _19;this._sourceShown=_17;var _1a=this;try{if(!this.sourceArea){this._createSourceView();}if(_17){ed._sourceQueryCommandEnabled=ed.queryCommandEnabled;ed.queryCommandEnabled=function(cmd){return cmd.toLowerCase()==="viewsource";};this.editor.onDisplayChanged();_19=ed.get("value");_19=this._filter(_19);ed.set("value",_19);_1.forEach(_18,function(p){if(!(p instanceof _13)){p.set("disabled",true);}});if(this._fsPlugin){this._fsPlugin._getAltViewNode=function(){return _1a.sourceArea;};}this.sourceArea.value=_19;this.sourceArea.style.height=ed.iframe.style.height;this.sourceArea.style.width=ed.iframe.style.width;_6.set(ed.iframe,"display","none");_6.set(this.sourceArea,{display:"block"});var _1b=function(){var vp=_d.getBox();if("_prevW" in this&&"_prevH" in this){if(vp.w===this._prevW&&vp.h===this._prevH){return;}else{this._prevW=vp.w;this._prevH=vp.h;}}else{this._prevW=vp.w;this._prevH=vp.h;}if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}this._resizer=setTimeout(_a.hitch(this,function(){delete this._resizer;this._resize();}),10);};this._resizeHandle=on(window,"resize",_a.hitch(this,_1b));setTimeout(_a.hitch(this,this._resize),100);this.editor.onNormalizedDisplayChanged();this.editor.__oldGetValue=this.editor.getValue;this.editor.getValue=_a.hitch(this,function(){var txt=this.sourceArea.value;txt=this._filter(txt);return txt;});}else{if(!ed._sourceQueryCommandEnabled){return;}this._resizeHandle.remove();delete this._resizeHandle;if(this.editor.__oldGetValue){this.editor.getValue=this.editor.__oldGetValue;delete this.editor.__oldGetValue;}ed.queryCommandEnabled=ed._sourceQueryCommandEnabled;if(!this._readOnly){_19=this.sourceArea.value;_19=this._filter(_19);ed.beginEditing();ed.set("value",_19);ed.endEditing();}_1.forEach(_18,function(p){p.set("disabled",false);});_6.set(this.sourceArea,"display","none");_6.set(ed.iframe,"display","block");delete ed._sourceQueryCommandEnabled;this.editor.onDisplayChanged();}setTimeout(_a.hitch(this,function(){var _1c=ed.domNode.parentNode;if(_1c){var _1d=_12.getEnclosingWidget(_1c);if(_1d&&_1d.resize){_1d.resize();}}ed.resize();}),300);}catch(e){}},updateState:function(){this.button.set("disabled",this.get("disabled"));},_resize:function(){var ed=this.editor;var tbH=ed.getHeaderHeight();var fH=ed.getFooterHeight();var eb=_5.position(ed.domNode);var _1e=_5.getPadBorderExtents(ed.iframe.parentNode);var _1f=_5.getMarginExtents(ed.iframe.parentNode);var _20=_5.getPadBorderExtents(ed.domNode);var edb={w:eb.w-_20.w,h:eb.h-(tbH+_20.h+ +fH)};if(this._fsPlugin&&this._fsPlugin.isFullscreen){var vp=_d.getBox();edb.w=(vp.w-_20.w);edb.h=(vp.h-(tbH+_20.h+fH));}if(_b("ie")){edb.h-=2;}if(this._ieFixNode){var _21=-this._ieFixNode.offsetTop/1000;edb.w=Math.floor((edb.w+0.9)/_21);edb.h=Math.floor((edb.h+0.9)/_21);}_5.setMarginBox(this.sourceArea,{w:edb.w-(_1e.w+_1f.w),h:edb.h-(_1e.h+_1f.h)});_5.setMarginBox(ed.iframe.parentNode,{h:edb.h});},_createSourceView:function(){var ed=this.editor;var _22=ed._plugins;this.sourceArea=_4.create("textarea");if(this.readOnly){_3.set(this.sourceArea,"readOnly",true);this._readOnly=true;}_6.set(this.sourceArea,{padding:"0px",margin:"0px",borderWidth:"0px",borderStyle:"none"});_4.place(this.sourceArea,ed.iframe,"before");if(_b("ie")&&ed.iframe.parentNode.lastChild!==ed.iframe){_6.set(ed.iframe.parentNode.lastChild,{width:"0px",height:"0px",padding:"0px",margin:"0px",borderWidth:"0px",borderStyle:"none"});}ed._viewsource_oldFocus=ed.focus;var _23=this;ed.focus=function(){if(_23._sourceShown){_23.setSourceAreaCaret();}else{try{if(this._vsFocused){delete this._vsFocused;_e.focus(ed.editNode);}else{ed._viewsource_oldFocus();}}catch(e){}}};var i,p;for(i=0;i<_22.length;i++){p=_22[i];if(p&&(p.declaredClass==="dijit._editor.plugins.FullScreen"||p.declaredClass===(_11._scopeName+"._editor.plugins.FullScreen"))){this._fsPlugin=p;break;}}if(this._fsPlugin){this._fsPlugin._viewsource_getAltViewNode=this._fsPlugin._getAltViewNode;this._fsPlugin._getAltViewNode=function(){return _23._sourceShown?_23.sourceArea:this._viewsource_getAltViewNode();};}this.connect(this.sourceArea,"onkeydown",_a.hitch(this,function(e){if(this._sourceShown&&e.keyCode==_9.F12&&e.ctrlKey&&e.shiftKey){this.button.focus();this.button.set("checked",false);setTimeout(_a.hitch(this,function(){ed.focus();}),100);_7.stop(e);}}));},_stripScripts:function(_24){if(_24){_24=_24.replace(/<\s*script[^>]*>((.|\s)*?)<\\?\/\s*script\s*>/ig,"");_24=_24.replace(/<\s*script\b([^<>]|\s)*>?/ig,"");_24=_24.replace(/<[^>]*=(\s|)*[("|')]javascript:[^$1][(\s|.)]*[$1][^>]*>/ig,"");}return _24;},_stripComments:function(_25){if(_25){_25=_25.replace(/<!--(.|\s){1,}?-->/g,"");}return _25;},_stripIFrames:function(_26){if(_26){_26=_26.replace(/<\s*iframe[^>]*>((.|\s)*?)<\\?\/\s*iframe\s*>/ig,"");}return _26;},_filter:function(_27){if(_27){if(this.stripScripts){_27=this._stripScripts(_27);}if(this.stripComments){_27=this._stripComments(_27);}if(this.stripIFrames){_27=this._stripIFrames(_27);}}return _27;},setSourceAreaCaret:function(){var _28=_c.global;var _29=this.sourceArea;_e.focus(_29);if(this._sourceShown&&!this.readOnly){if(_b("ie")){if(this.sourceArea.createTextRange){var _2a=_29.createTextRange();_2a.collapse(true);_2a.moveStart("character",-99999);_2a.moveStart("character",0);_2a.moveEnd("character",0);_2a.select();}}else{if(_28.getSelection){if(_29.setSelectionRange){_29.setSelectionRange(0,0);}}}}},destroy:function(){if(this._ieFixNode){_c.body().removeChild(this._ieFixNode);}if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}if(this._resizeHandle){this._resizeHandle.remove();delete this._resizeHandle;}this.inherited(arguments);}});_f.registry["viewSource"]=_f.registry["viewsource"]=function(_2b){return new _13({readOnly:("readOnly" in _2b)?_2b.readOnly:false,stripComments:("stripComments" in _2b)?_2b.stripComments:true,stripScripts:("stripScripts" in _2b)?_2b.stripScripts:true,stripIFrames:("stripIFrames" in _2b)?_2b.stripIFrames:true});};return _13;});
\ No newline at end of file +define("dijit/_editor/plugins/ViewSource",["dojo/_base/array","dojo/_base/declare","dojo/dom-attr","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/_base/event","dojo/i18n","dojo/keys","dojo/_base/lang","dojo/on","dojo/sniff","dojo/_base/window","dojo/window","../../focus","../_Plugin","../../form/ToggleButton","../..","../../registry","dojo/aspect","dojo/i18n!../nls/commands"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,on,_b,_c,_d,_e,_f,_10,_11,_12,_13){var _14=_2("dijit._editor.plugins.ViewSource",_f,{stripScripts:true,stripComments:true,stripIFrames:true,readOnly:false,_fsPlugin:null,toggle:function(){if(_b("webkit")){this._vsFocused=true;}this.button.set("checked",!this.button.get("checked"));},_initButton:function(){var _15=_8.getLocalization("dijit._editor","commands"),_16=this.editor;this.button=new _10({label:_15["viewSource"],ownerDocument:_16.ownerDocument,dir:_16.dir,lang:_16.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"ViewSource",tabIndex:"-1",onChange:_a.hitch(this,"_showSource")});if(_b("ie")==7){this._ieFixNode=_4.create("div",{style:{opacity:"0",zIndex:"-1000",position:"absolute",top:"-1000px"}},_16.ownerDocumentBody);}this.button.set("readOnly",false);},setEditor:function(_17){this.editor=_17;this._initButton();this.editor.addKeyHandler(_9.F12,true,true,_a.hitch(this,function(e){this.button.focus();this.toggle();_7.stop(e);setTimeout(_a.hitch(this,function(){this.editor.focus();}),100);}));},_showSource:function(_18){var ed=this.editor;var _19=ed._plugins;var _1a;this._sourceShown=_18;var _1b=this;try{if(!this.sourceArea){this._createSourceView();}if(_18){ed._sourceQueryCommandEnabled=ed.queryCommandEnabled;ed.queryCommandEnabled=function(cmd){return cmd.toLowerCase()==="viewsource";};this.editor.onDisplayChanged();_1a=ed.get("value");_1a=this._filter(_1a);ed.set("value",_1a);_1.forEach(_19,function(p){if(p&&!(p instanceof _14)&&p.isInstanceOf(_f)){p.set("disabled",true);}});if(this._fsPlugin){this._fsPlugin._getAltViewNode=function(){return _1b.sourceArea;};}this.sourceArea.value=_1a;this.sourceArea.style.height=ed.iframe.style.height;this.sourceArea.style.width=ed.iframe.style.width;_6.set(ed.iframe,"display","none");_6.set(this.sourceArea,{display:"block"});var _1c=function(){var vp=_d.getBox(ed.ownerDocument);if("_prevW" in this&&"_prevH" in this){if(vp.w===this._prevW&&vp.h===this._prevH){return;}else{this._prevW=vp.w;this._prevH=vp.h;}}else{this._prevW=vp.w;this._prevH=vp.h;}if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}this._resizer=setTimeout(_a.hitch(this,function(){delete this._resizer;this._resize();}),10);};this._resizeHandle=on(window,"resize",_a.hitch(this,_1c));setTimeout(_a.hitch(this,this._resize),100);this.editor.onNormalizedDisplayChanged();this.editor.__oldGetValue=this.editor.getValue;this.editor.getValue=_a.hitch(this,function(){var txt=this.sourceArea.value;txt=this._filter(txt);return txt;});this._setListener=_13.after(this.editor,"setValue",_a.hitch(this,function(_1d){_1d=_1d||"";_1d=this._filter(_1d);this.sourceArea.value=_1d;}),true);}else{if(!ed._sourceQueryCommandEnabled){return;}this._setListener.remove();delete this._setListener;this._resizeHandle.remove();delete this._resizeHandle;if(this.editor.__oldGetValue){this.editor.getValue=this.editor.__oldGetValue;delete this.editor.__oldGetValue;}ed.queryCommandEnabled=ed._sourceQueryCommandEnabled;if(!this._readOnly){_1a=this.sourceArea.value;_1a=this._filter(_1a);ed.beginEditing();ed.set("value",_1a);ed.endEditing();}_1.forEach(_19,function(p){if(p&&p.isInstanceOf(_f)){p.set("disabled",false);}});_6.set(this.sourceArea,"display","none");_6.set(ed.iframe,"display","block");delete ed._sourceQueryCommandEnabled;this.editor.onDisplayChanged();}setTimeout(_a.hitch(this,function(){var _1e=ed.domNode.parentNode;if(_1e){var _1f=_12.getEnclosingWidget(_1e);if(_1f&&_1f.resize){_1f.resize();}}ed.resize();}),300);}catch(e){}},updateState:function(){this.button.set("disabled",this.get("disabled"));},_resize:function(){var ed=this.editor;var tbH=ed.getHeaderHeight();var fH=ed.getFooterHeight();var eb=_5.position(ed.domNode);var _20=_5.getPadBorderExtents(ed.iframe.parentNode);var _21=_5.getMarginExtents(ed.iframe.parentNode);var _22=_5.getPadBorderExtents(ed.domNode);var edb={w:eb.w-_22.w,h:eb.h-(tbH+_22.h+fH)};if(this._fsPlugin&&this._fsPlugin.isFullscreen){var vp=_d.getBox(ed.ownerDocument);edb.w=(vp.w-_22.w);edb.h=(vp.h-(tbH+_22.h+fH));}if(_b("ie")){edb.h-=2;}if(this._ieFixNode){var _23=-this._ieFixNode.offsetTop/1000;edb.w=Math.floor((edb.w+0.9)/_23);edb.h=Math.floor((edb.h+0.9)/_23);}_5.setMarginBox(this.sourceArea,{w:edb.w-(_20.w+_21.w),h:edb.h-(_20.h+_21.h)});_5.setMarginBox(ed.iframe.parentNode,{h:edb.h});},_createSourceView:function(){var ed=this.editor;var _24=ed._plugins;this.sourceArea=_4.create("textarea");if(this.readOnly){_3.set(this.sourceArea,"readOnly",true);this._readOnly=true;}_6.set(this.sourceArea,{padding:"0px",margin:"0px",borderWidth:"0px",borderStyle:"none"});_4.place(this.sourceArea,ed.iframe,"before");if(_b("ie")&&ed.iframe.parentNode.lastChild!==ed.iframe){_6.set(ed.iframe.parentNode.lastChild,{width:"0px",height:"0px",padding:"0px",margin:"0px",borderWidth:"0px",borderStyle:"none"});}ed._viewsource_oldFocus=ed.focus;var _25=this;ed.focus=function(){if(_25._sourceShown){_25.setSourceAreaCaret();}else{try{if(this._vsFocused){delete this._vsFocused;_e.focus(ed.editNode);}else{ed._viewsource_oldFocus();}}catch(e){}}};var i,p;for(i=0;i<_24.length;i++){p=_24[i];if(p&&(p.declaredClass==="dijit._editor.plugins.FullScreen"||p.declaredClass===(_11._scopeName+"._editor.plugins.FullScreen"))){this._fsPlugin=p;break;}}if(this._fsPlugin){this._fsPlugin._viewsource_getAltViewNode=this._fsPlugin._getAltViewNode;this._fsPlugin._getAltViewNode=function(){return _25._sourceShown?_25.sourceArea:this._viewsource_getAltViewNode();};}this.connect(this.sourceArea,"onkeydown",_a.hitch(this,function(e){if(this._sourceShown&&e.keyCode==_9.F12&&e.ctrlKey&&e.shiftKey){this.button.focus();this.button.set("checked",false);setTimeout(_a.hitch(this,function(){ed.focus();}),100);_7.stop(e);}}));},_stripScripts:function(_26){if(_26){_26=_26.replace(/<\s*script[^>]*>((.|\s)*?)<\\?\/\s*script\s*>/ig,"");_26=_26.replace(/<\s*script\b([^<>]|\s)*>?/ig,"");_26=_26.replace(/<[^>]*=(\s|)*[("|')]javascript:[^$1][(\s|.)]*[$1][^>]*>/ig,"");}return _26;},_stripComments:function(_27){if(_27){_27=_27.replace(/<!--(.|\s){1,}?-->/g,"");}return _27;},_stripIFrames:function(_28){if(_28){_28=_28.replace(/<\s*iframe[^>]*>((.|\s)*?)<\\?\/\s*iframe\s*>/ig,"");}return _28;},_filter:function(_29){if(_29){if(this.stripScripts){_29=this._stripScripts(_29);}if(this.stripComments){_29=this._stripComments(_29);}if(this.stripIFrames){_29=this._stripIFrames(_29);}}return _29;},setSourceAreaCaret:function(){var _2a=_c.global;var _2b=this.sourceArea;_e.focus(_2b);if(this._sourceShown&&!this.readOnly){if(_b("ie")){if(this.sourceArea.createTextRange){var _2c=_2b.createTextRange();_2c.collapse(true);_2c.moveStart("character",-99999);_2c.moveStart("character",0);_2c.moveEnd("character",0);_2c.select();}}else{if(_2a.getSelection){if(_2b.setSelectionRange){_2b.setSelectionRange(0,0);}}}}},destroy:function(){if(this._ieFixNode){_4.destroy(this._ieFixNode);}if(this._resizer){clearTimeout(this._resizer);delete this._resizer;}if(this._resizeHandle){this._resizeHandle.remove();delete this._resizeHandle;}if(this._setListener){this._setListener.remove();delete this._setListener;}this.inherited(arguments);}});_f.registry["viewSource"]=_f.registry["viewsource"]=function(_2d){return new _14({readOnly:("readOnly" in _2d)?_2d.readOnly:false,stripComments:("stripComments" in _2d)?_2d.stripComments:true,stripScripts:("stripScripts" in _2d)?_2d.stripScripts:true,stripIFrames:("stripIFrames" in _2d)?_2d.stripIFrames:true});};return _14;});
\ No newline at end of file diff --git a/lib/dijit/_editor/plugins/ViewSource.js.uncompressed.js b/lib/dijit/_editor/plugins/ViewSource.js.uncompressed.js new file mode 100644 index 000000000..e70e05c22 --- /dev/null +++ b/lib/dijit/_editor/plugins/ViewSource.js.uncompressed.js @@ -0,0 +1,577 @@ +define("dijit/_editor/plugins/ViewSource", [ + "dojo/_base/array", // array.forEach + "dojo/_base/declare", // declare + "dojo/dom-attr", // domAttr.set + "dojo/dom-construct", // domConstruct.create domConstruct.place + "dojo/dom-geometry", // domGeometry.setMarginBox domGeometry.position + "dojo/dom-style", // domStyle.set + "dojo/_base/event", // event.stop + "dojo/i18n", // i18n.getLocalization + "dojo/keys", // keys.F12 + "dojo/_base/lang", // lang.hitch + "dojo/on", // on() + "dojo/sniff", // has("ie") has("webkit") + "dojo/_base/window", // win.body win.global + "dojo/window", // winUtils.getBox + "../../focus", // focus.focus() + "../_Plugin", + "../../form/ToggleButton", + "../..", // dijit._scopeName + "../../registry", // registry.getEnclosingWidget() + "dojo/aspect", // Aspect commands for adice + "dojo/i18n!../nls/commands" +], function(array, declare, domAttr, domConstruct, domGeometry, domStyle, event, i18n, keys, lang, on, has, win, + winUtils, focus, _Plugin, ToggleButton, dijit, registry, aspect){ + +// module: +// dijit/_editor/plugins/ViewSource + + +var ViewSource = declare("dijit._editor.plugins.ViewSource",_Plugin, { + // summary: + // This plugin provides a simple view source capability. When view + // source mode is enabled, it disables all other buttons/plugins on the RTE. + // It also binds to the hotkey: CTRL-SHIFT-F11 for toggling ViewSource mode. + + // stripScripts: [public] Boolean + // Boolean flag used to indicate if script tags should be stripped from the document. + // Defaults to true. + stripScripts: true, + + // stripComments: [public] Boolean + // Boolean flag used to indicate if comment tags should be stripped from the document. + // Defaults to true. + stripComments: true, + + // stripComments: [public] Boolean + // Boolean flag used to indicate if iframe tags should be stripped from the document. + // Defaults to true. + stripIFrames: true, + + // readOnly: [const] Boolean + // Boolean flag used to indicate if the source view should be readonly or not. + // Cannot be changed after initialization of the plugin. + // Defaults to false. + readOnly: false, + + // _fsPlugin: [private] Object + // Reference to a registered fullscreen plugin so that viewSource knows + // how to scale. + _fsPlugin: null, + + toggle: function(){ + // summary: + // Function to allow programmatic toggling of the view. + + // For Webkit, we have to focus a very particular way. + // when swapping views, otherwise focus doesn't shift right + // but can't focus this way all the time, only for VS changes. + // If we did it all the time, buttons like bold, italic, etc + // break. + if(has("webkit")){this._vsFocused = true;} + this.button.set("checked", !this.button.get("checked")); + + }, + + _initButton: function(){ + // summary: + // Over-ride for creation of the resize button. + var strings = i18n.getLocalization("dijit._editor", "commands"), + editor = this.editor; + this.button = new ToggleButton({ + label: strings["viewSource"], + ownerDocument: editor.ownerDocument, + dir: editor.dir, + lang: editor.lang, + showLabel: false, + iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "ViewSource", + tabIndex: "-1", + onChange: lang.hitch(this, "_showSource") + }); + + // IE 7 has a horrible bug with zoom, so we have to create this node + // to cross-check later. Sigh. + if(has("ie") == 7){ + this._ieFixNode = domConstruct.create("div", { + style: { + opacity: "0", + zIndex: "-1000", + position: "absolute", + top: "-1000px" + } + }, editor.ownerDocumentBody); + } + // Make sure readonly mode doesn't make the wrong cursor appear over the button. + this.button.set("readOnly", false); + }, + + + setEditor: function(/*dijit/Editor*/ editor){ + // summary: + // Tell the plugin which Editor it is associated with. + // editor: Object + // The editor object to attach the print capability to. + this.editor = editor; + this._initButton(); + + this.editor.addKeyHandler(keys.F12, true, true, lang.hitch(this, function(e){ + // Move the focus before switching + // It'll focus back. Hiding a focused + // node causes issues. + this.button.focus(); + this.toggle(); + event.stop(e); + + // Call the focus shift outside of the handler. + setTimeout(lang.hitch(this, function(){ + // We over-ride focus, so we just need to call. + this.editor.focus(); + }), 100); + })); + }, + + _showSource: function(source){ + // summary: + // Function to toggle between the source and RTE views. + // source: boolean + // Boolean value indicating if it should be in source mode or not. + // tags: + // private + var ed = this.editor; + var edPlugins = ed._plugins; + var html; + this._sourceShown = source; + var self = this; + try{ + if(!this.sourceArea){ + this._createSourceView(); + } + if(source){ + // Update the QueryCommandEnabled function to disable everything but + // the source view mode. Have to over-ride a function, then kick all + // plugins to check their state. + ed._sourceQueryCommandEnabled = ed.queryCommandEnabled; + ed.queryCommandEnabled = function(cmd){ + return cmd.toLowerCase() === "viewsource"; + }; + this.editor.onDisplayChanged(); + html = ed.get("value"); + html = this._filter(html); + ed.set("value", html); + array.forEach(edPlugins, function(p){ + // Turn off any plugins not controlled by queryCommandenabled. + if(p && !(p instanceof ViewSource) && p.isInstanceOf(_Plugin)){ + p.set("disabled", true) + } + }); + + // We actually do need to trap this plugin and adjust how we + // display the textarea. + if(this._fsPlugin){ + this._fsPlugin._getAltViewNode = function(){ + return self.sourceArea; + }; + } + + this.sourceArea.value = html; + + // Since neither iframe nor textarea have margin, border, or padding, + // just set sizes equal + this.sourceArea.style.height = ed.iframe.style.height; + this.sourceArea.style.width = ed.iframe.style.width; + domStyle.set(ed.iframe, "display", "none"); + domStyle.set(this.sourceArea, { + display: "block" + }); + + var resizer = function(){ + // function to handle resize events. + // Will check current VP and only resize if + // different. + var vp = winUtils.getBox(ed.ownerDocument); + + if("_prevW" in this && "_prevH" in this){ + // No actual size change, ignore. + if(vp.w === this._prevW && vp.h === this._prevH){ + return; + }else{ + this._prevW = vp.w; + this._prevH = vp.h; + } + }else{ + this._prevW = vp.w; + this._prevH = vp.h; + } + if(this._resizer){ + clearTimeout(this._resizer); + delete this._resizer; + } + // Timeout it to help avoid spamming resize on IE. + // Works for all browsers. + this._resizer = setTimeout(lang.hitch(this, function(){ + delete this._resizer; + this._resize(); + }), 10); + }; + this._resizeHandle = on(window, "resize", lang.hitch(this, resizer)); + + //Call this on a delay once to deal with IE glitchiness on initial size. + setTimeout(lang.hitch(this, this._resize), 100); + + //Trigger a check for command enablement/disablement. + this.editor.onNormalizedDisplayChanged(); + + this.editor.__oldGetValue = this.editor.getValue; + this.editor.getValue = lang.hitch(this, function(){ + var txt = this.sourceArea.value; + txt = this._filter(txt); + return txt; + }); + + this._setListener = aspect.after(this.editor, "setValue", lang.hitch(this, function(htmlTxt){ + htmlTxt = htmlTxt || ""; + htmlTxt = this._filter(htmlTxt); + this.sourceArea.value = htmlTxt; + }), true); + }else{ + // First check that we were in source view before doing anything. + // corner case for being called with a value of false and we hadn't + // actually been in source display mode. + if(!ed._sourceQueryCommandEnabled){ + return; + } + + // Remove the set listener. + this._setListener.remove(); + delete this._setListener; + + this._resizeHandle.remove(); + delete this._resizeHandle; + + if(this.editor.__oldGetValue){ + this.editor.getValue = this.editor.__oldGetValue; + delete this.editor.__oldGetValue; + } + + // Restore all the plugin buttons state. + ed.queryCommandEnabled = ed._sourceQueryCommandEnabled; + if(!this._readOnly){ + html = this.sourceArea.value; + html = this._filter(html); + ed.beginEditing(); + ed.set("value", html); + ed.endEditing(); + } + + array.forEach(edPlugins, function(p){ + // Turn back on any plugins we turned off. + if(p && p.isInstanceOf(_Plugin)){ + p.set("disabled", false); + } + }); + + domStyle.set(this.sourceArea, "display", "none"); + domStyle.set(ed.iframe, "display", "block"); + delete ed._sourceQueryCommandEnabled; + + //Trigger a check for command enablement/disablement. + this.editor.onDisplayChanged(); + } + // Call a delayed resize to wait for some things to display in header/footer. + setTimeout(lang.hitch(this, function(){ + // Make resize calls. + var parent = ed.domNode.parentNode; + if(parent){ + var container = registry.getEnclosingWidget(parent); + if(container && container.resize){ + container.resize(); + } + } + ed.resize(); + }), 300); + }catch(e){ + console.log(e); + } + }, + + updateState: function(){ + // summary: + // Over-ride for button state control for disabled to work. + this.button.set("disabled", this.get("disabled")); + }, + + _resize: function(){ + // summary: + // Internal function to resize the source view + // tags: + // private + var ed = this.editor; + var tbH = ed.getHeaderHeight(); + var fH = ed.getFooterHeight(); + var eb = domGeometry.position(ed.domNode); + + // Styles are now applied to the internal source container, so we have + // to subtract them off. + var containerPadding = domGeometry.getPadBorderExtents(ed.iframe.parentNode); + var containerMargin = domGeometry.getMarginExtents(ed.iframe.parentNode); + + var extents = domGeometry.getPadBorderExtents(ed.domNode); + var edb = { + w: eb.w - extents.w, + h: eb.h - (tbH + extents.h + fH) + }; + + // Fullscreen gets odd, so we need to check for the FS plugin and + // adapt. + if(this._fsPlugin && this._fsPlugin.isFullscreen){ + //Okay, probably in FS, adjust. + var vp = winUtils.getBox(ed.ownerDocument); + edb.w = (vp.w - extents.w); + edb.h = (vp.h - (tbH + extents.h + fH)); + } + + if(has("ie")){ + // IE is always off by 2px, so we have to adjust here + // Note that IE ZOOM is broken here. I can't get + //it to scale right. + edb.h -= 2; + } + + // IE has a horrible zoom bug. So, we have to try and account for + // it and fix up the scaling. + if(this._ieFixNode){ + var _ie7zoom = -this._ieFixNode.offsetTop / 1000; + edb.w = Math.floor((edb.w + 0.9) / _ie7zoom); + edb.h = Math.floor((edb.h + 0.9) / _ie7zoom); + } + + domGeometry.setMarginBox(this.sourceArea, { + w: edb.w - (containerPadding.w + containerMargin.w), + h: edb.h - (containerPadding.h + containerMargin.h) + }); + + // Scale the parent container too in this case. + domGeometry.setMarginBox(ed.iframe.parentNode, { + h: edb.h + }); + }, + + _createSourceView: function(){ + // summary: + // Internal function for creating the source view area. + // tags: + // private + var ed = this.editor; + var edPlugins = ed._plugins; + this.sourceArea = domConstruct.create("textarea"); + if(this.readOnly){ + domAttr.set(this.sourceArea, "readOnly", true); + this._readOnly = true; + } + domStyle.set(this.sourceArea, { + padding: "0px", + margin: "0px", + borderWidth: "0px", + borderStyle: "none" + }); + domConstruct.place(this.sourceArea, ed.iframe, "before"); + + if(has("ie") && ed.iframe.parentNode.lastChild !== ed.iframe){ + // There's some weirdo div in IE used for focus control + // But is messed up scaling the textarea if we don't config + // it some so it doesn't have a varying height. + domStyle.set(ed.iframe.parentNode.lastChild,{ + width: "0px", + height: "0px", + padding: "0px", + margin: "0px", + borderWidth: "0px", + borderStyle: "none" + }); + } + + // We also need to take over editor focus a bit here, so that focus calls to + // focus the editor will focus to the right node when VS is active. + ed._viewsource_oldFocus = ed.focus; + var self = this; + ed.focus = function(){ + if(self._sourceShown){ + self.setSourceAreaCaret(); + }else{ + try{ + if(this._vsFocused){ + delete this._vsFocused; + // Must focus edit node in this case (webkit only) or + // focus doesn't shift right, but in normal + // cases we focus with the regular function. + focus.focus(ed.editNode); + }else{ + ed._viewsource_oldFocus(); + } + }catch(e){ + console.log(e); + } + } + }; + + var i, p; + for(i = 0; i < edPlugins.length; i++){ + // We actually do need to trap this plugin and adjust how we + // display the textarea. + p = edPlugins[i]; + if(p && (p.declaredClass === "dijit._editor.plugins.FullScreen" || + p.declaredClass === (dijit._scopeName + + "._editor.plugins.FullScreen"))){ + this._fsPlugin = p; + break; + } + } + if(this._fsPlugin){ + // Found, we need to over-ride the alt-view node function + // on FullScreen with our own, chain up to parent call when appropriate. + this._fsPlugin._viewsource_getAltViewNode = this._fsPlugin._getAltViewNode; + this._fsPlugin._getAltViewNode = function(){ + return self._sourceShown?self.sourceArea:this._viewsource_getAltViewNode(); + }; + } + + // Listen to the source area for key events as well, as we need to be able to hotkey toggle + // it from there too. + this.connect(this.sourceArea, "onkeydown", lang.hitch(this, function(e){ + if(this._sourceShown && e.keyCode == keys.F12 && e.ctrlKey && e.shiftKey){ + this.button.focus(); + this.button.set("checked", false); + setTimeout(lang.hitch(this, function(){ed.focus();}), 100); + event.stop(e); + } + })); + }, + + _stripScripts: function(html){ + // summary: + // Strips out script tags from the HTML used in editor. + // html: String + // The HTML to filter + // tags: + // private + if(html){ + // Look for closed and unclosed (malformed) script attacks. + html = html.replace(/<\s*script[^>]*>((.|\s)*?)<\\?\/\s*script\s*>/ig, ""); + html = html.replace(/<\s*script\b([^<>]|\s)*>?/ig, ""); + html = html.replace(/<[^>]*=(\s|)*[("|')]javascript:[^$1][(\s|.)]*[$1][^>]*>/ig, ""); + } + return html; + }, + + _stripComments: function(html){ + // summary: + // Strips out comments from the HTML used in editor. + // html: String + // The HTML to filter + // tags: + // private + if(html){ + html = html.replace(/<!--(.|\s){1,}?-->/g, ""); + } + return html; + }, + + _stripIFrames: function(html){ + // summary: + // Strips out iframe tags from the content, to avoid iframe script + // style injection attacks. + // html: String + // The HTML to filter + // tags: + // private + if(html){ + html = html.replace(/<\s*iframe[^>]*>((.|\s)*?)<\\?\/\s*iframe\s*>/ig, ""); + } + return html; + }, + + _filter: function(html){ + // summary: + // Internal function to perform some filtering on the HTML. + // html: String + // The HTML to filter + // tags: + // private + if(html){ + if(this.stripScripts){ + html = this._stripScripts(html); + } + if(this.stripComments){ + html = this._stripComments(html); + } + if(this.stripIFrames){ + html = this._stripIFrames(html); + } + } + return html; + }, + + setSourceAreaCaret: function(){ + // summary: + // Internal function to set the caret in the sourceArea + // to 0x0 + var global = win.global; + var elem = this.sourceArea; + focus.focus(elem); + if(this._sourceShown && !this.readOnly){ + if(has("ie")){ + if(this.sourceArea.createTextRange){ + var range = elem.createTextRange(); + range.collapse(true); + range.moveStart("character", -99999); // move to 0 + range.moveStart("character", 0); // delta from 0 is the correct position + range.moveEnd("character", 0); + range.select(); + } + }else if(global.getSelection){ + if(elem.setSelectionRange){ + elem.setSelectionRange(0,0); + } + } + } + }, + + destroy: function(){ + // summary: + // Over-ride to remove the node used to correct for IE's + // zoom bug. + if(this._ieFixNode){ + domConstruct.destroy(this._ieFixNode); + } + if(this._resizer){ + clearTimeout(this._resizer); + delete this._resizer; + } + if(this._resizeHandle){ + this._resizeHandle.remove(); + delete this._resizeHandle; + } + if(this._setListener){ + this._setListener.remove(); + delete this._setListener; + } + this.inherited(arguments); + } +}); + +// Register this plugin. +// For back-compat accept "viewsource" (all lowercase) too, remove in 2.0 +_Plugin.registry["viewSource"] = _Plugin.registry["viewsource"] = function(args){ + return new ViewSource({ + readOnly: ("readOnly" in args)?args.readOnly:false, + stripComments: ("stripComments" in args)?args.stripComments:true, + stripScripts: ("stripScripts" in args)?args.stripScripts:true, + stripIFrames: ("stripIFrames" in args)?args.stripIFrames:true + }); +}; + + + + +return ViewSource; +}); diff --git a/lib/dijit/_editor/range.js b/lib/dijit/_editor/range.js index 3c92de470..403d8968d 100644 --- a/lib/dijit/_editor/range.js +++ b/lib/dijit/_editor/range.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/range",["dojo/_base/array","dojo/_base/declare","dojo/_base/lang","dojo/_base/window",".."],function(_1,_2,_3,_4,_5){_5.range={};_5.range.getIndex=function(_6,_7){var _8=[],_9=[];var _a=_6;var _b,n;while(_6!=_7){var i=0;_b=_6.parentNode;while((n=_b.childNodes[i++])){if(n===_6){--i;break;}}_8.unshift(i);_9.unshift(i-_b.childNodes.length);_6=_b;}if(_8.length>0&&_a.nodeType==3){n=_a.previousSibling;while(n&&n.nodeType==3){_8[_8.length-1]--;n=n.previousSibling;}n=_a.nextSibling;while(n&&n.nodeType==3){_9[_9.length-1]++;n=n.nextSibling;}}return {o:_8,r:_9};};_5.range.getNode=function(_c,_d){if(!_3.isArray(_c)||_c.length==0){return _d;}var _e=_d;_1.every(_c,function(i){if(i>=0&&i<_e.childNodes.length){_e=_e.childNodes[i];}else{_e=null;return false;}return true;});return _e;};_5.range.getCommonAncestor=function(n1,n2,_f){_f=_f||n1.ownerDocument.body;var _10=function(n){var as=[];while(n){as.unshift(n);if(n!==_f){n=n.parentNode;}else{break;}}return as;};var _11=_10(n1);var _12=_10(n2);var m=Math.min(_11.length,_12.length);var com=_11[0];for(var i=1;i<m;i++){if(_11[i]===_12[i]){com=_11[i];}else{break;}}return com;};_5.range.getAncestor=function(_13,_14,_15){_15=_15||_13.ownerDocument.body;while(_13&&_13!==_15){var _16=_13.nodeName.toUpperCase();if(_14.test(_16)){return _13;}_13=_13.parentNode;}return null;};_5.range.BlockTagNames=/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/;_5.range.getBlockAncestor=function(_17,_18,_19){_19=_19||_17.ownerDocument.body;_18=_18||_5.range.BlockTagNames;var _1a=null,_1b;while(_17&&_17!==_19){var _1c=_17.nodeName.toUpperCase();if(!_1a&&_18.test(_1c)){_1a=_17;}if(!_1b&&(/^(?:BODY|TD|TH|CAPTION)$/).test(_1c)){_1b=_17;}_17=_17.parentNode;}return {blockNode:_1a,blockContainer:_1b||_17.ownerDocument.body};};_5.range.atBeginningOfContainer=function(_1d,_1e,_1f){var _20=false;var _21=(_1f==0);if(!_21&&_1e.nodeType==3){if(/^[\s\xA0]+$/.test(_1e.nodeValue.substr(0,_1f))){_21=true;}}if(_21){var _22=_1e;_20=true;while(_22&&_22!==_1d){if(_22.previousSibling){_20=false;break;}_22=_22.parentNode;}}return _20;};_5.range.atEndOfContainer=function(_23,_24,_25){var _26=false;var _27=(_25==(_24.length||_24.childNodes.length));if(!_27&&_24.nodeType==3){if(/^[\s\xA0]+$/.test(_24.nodeValue.substr(_25))){_27=true;}}if(_27){var _28=_24;_26=true;while(_28&&_28!==_23){if(_28.nextSibling){_26=false;break;}_28=_28.parentNode;}}return _26;};_5.range.adjacentNoneTextNode=function(_29,_2a){var _2b=_29;var len=(0-_29.length)||0;var _2c=_2a?"nextSibling":"previousSibling";while(_2b){if(_2b.nodeType!=3){break;}len+=_2b.length;_2b=_2b[_2c];}return [_2b,len];};_5.range._w3c=Boolean(window["getSelection"]);_5.range.create=function(_2d){if(_5.range._w3c){return (_2d||_4.global).document.createRange();}else{return new _5.range.W3CRange;}};_5.range.getSelection=function(win,_2e){if(_5.range._w3c){return win.getSelection();}else{var s=new _5.range.ie.selection(win);if(!_2e){s._getCurrentSelection();}return s;}};if(!_5.range._w3c){_5.range.ie={cachedSelection:{},selection:function(win){this._ranges=[];this.addRange=function(r,_2f){this._ranges.push(r);if(!_2f){r._select();}this.rangeCount=this._ranges.length;};this.removeAllRanges=function(){this._ranges=[];this.rangeCount=0;};var _30=function(){var r=win.document.selection.createRange();var _31=win.document.selection.type.toUpperCase();if(_31=="CONTROL"){return new _5.range.W3CRange(_5.range.ie.decomposeControlRange(r));}else{return new _5.range.W3CRange(_5.range.ie.decomposeTextRange(r));}};this.getRangeAt=function(i){return this._ranges[i];};this._getCurrentSelection=function(){this.removeAllRanges();var r=_30();if(r){this.addRange(r,true);this.isCollapsed=r.collapsed;}else{this.isCollapsed=true;}};},decomposeControlRange:function(_32){var _33=_32.item(0),_34=_32.item(_32.length-1);var _35=_33.parentNode,_36=_34.parentNode;var _37=_5.range.getIndex(_33,_35).o[0];var _38=_5.range.getIndex(_34,_36).o[0]+1;return [_35,_37,_36,_38];},getEndPoint:function(_39,end){var _3a=_39.duplicate();_3a.collapse(!end);var _3b="EndTo"+(end?"End":"Start");var _3c=_3a.parentElement();var _3d,_3e,_3f;if(_3c.childNodes.length>0){_1.every(_3c.childNodes,function(_40,i){var _41;if(_40.nodeType!=3){_3a.moveToElementText(_40);if(_3a.compareEndPoints(_3b,_39)>0){if(_3f&&_3f.nodeType==3){_3d=_3f;_41=true;}else{_3d=_3c;_3e=i;return false;}}else{if(i==_3c.childNodes.length-1){_3d=_3c;_3e=_3c.childNodes.length;return false;}}}else{if(i==_3c.childNodes.length-1){_3d=_40;_41=true;}}if(_41&&_3d){var _42=_5.range.adjacentNoneTextNode(_3d)[0];if(_42){_3d=_42.nextSibling;}else{_3d=_3c.firstChild;}var _43=_5.range.adjacentNoneTextNode(_3d);_42=_43[0];var _44=_43[1];if(_42){_3a.moveToElementText(_42);_3a.collapse(false);}else{_3a.moveToElementText(_3c);}_3a.setEndPoint(_3b,_39);_3e=_3a.text.length-_44;return false;}_3f=_40;return true;});}else{_3d=_3c;_3e=0;}if(!end&&_3d.nodeType==1&&_3e==_3d.childNodes.length){var _45=_3d.nextSibling;if(_45&&_45.nodeType==3){_3d=_45;_3e=0;}}return [_3d,_3e];},setEndPoint:function(_46,_47,_48){var _49=_46.duplicate(),_4a,len;if(_47.nodeType!=3){if(_48>0){_4a=_47.childNodes[_48-1];if(_4a){if(_4a.nodeType==3){_47=_4a;_48=_4a.length;}else{if(_4a.nextSibling&&_4a.nextSibling.nodeType==3){_47=_4a.nextSibling;_48=0;}else{_49.moveToElementText(_4a.nextSibling?_4a:_47);var _4b=_4a.parentNode;var _4c=_4b.insertBefore(_4a.ownerDocument.createTextNode(" "),_4a.nextSibling);_49.collapse(false);_4b.removeChild(_4c);}}}}else{_49.moveToElementText(_47);_49.collapse(true);}}if(_47.nodeType==3){var _4d=_5.range.adjacentNoneTextNode(_47);var _4e=_4d[0];len=_4d[1];if(_4e){_49.moveToElementText(_4e);_49.collapse(false);if(_4e.contentEditable!="inherit"){len++;}}else{_49.moveToElementText(_47.parentNode);_49.collapse(true);}_48+=len;if(_48>0){if(_49.move("character",_48)!=_48){console.error("Error when moving!");}}}return _49;},decomposeTextRange:function(_4f){var _50=_5.range.ie.getEndPoint(_4f);var _51=_50[0],_52=_50[1];var _53=_50[0],_54=_50[1];if(_4f.htmlText.length){if(_4f.htmlText==_4f.text){_54=_52+_4f.text.length;}else{_50=_5.range.ie.getEndPoint(_4f,true);_53=_50[0],_54=_50[1];}}return [_51,_52,_53,_54];},setRange:function(_55,_56,_57,_58,_59,_5a){var _5b=_5.range.ie.setEndPoint(_55,_56,_57);_55.setEndPoint("StartToStart",_5b);if(!_5a){var end=_5.range.ie.setEndPoint(_55,_58,_59);}_55.setEndPoint("EndToEnd",end||_5b);return _55;}};_2("dijit.range.W3CRange",null,{constructor:function(){if(arguments.length>0){this.setStart(arguments[0][0],arguments[0][1]);this.setEnd(arguments[0][2],arguments[0][3]);}else{this.commonAncestorContainer=null;this.startContainer=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=true;}},_updateInternal:function(){if(this.startContainer!==this.endContainer){this.commonAncestorContainer=_5.range.getCommonAncestor(this.startContainer,this.endContainer);}else{this.commonAncestorContainer=this.startContainer;}this.collapsed=(this.startContainer===this.endContainer)&&(this.startOffset==this.endOffset);},setStart:function(_5c,_5d){_5d=parseInt(_5d);if(this.startContainer===_5c&&this.startOffset==_5d){return;}delete this._cachedBookmark;this.startContainer=_5c;this.startOffset=_5d;if(!this.endContainer){this.setEnd(_5c,_5d);}else{this._updateInternal();}},setEnd:function(_5e,_5f){_5f=parseInt(_5f);if(this.endContainer===_5e&&this.endOffset==_5f){return;}delete this._cachedBookmark;this.endContainer=_5e;this.endOffset=_5f;if(!this.startContainer){this.setStart(_5e,_5f);}else{this._updateInternal();}},setStartAfter:function(_60,_61){this._setPoint("setStart",_60,_61,1);},setStartBefore:function(_62,_63){this._setPoint("setStart",_62,_63,0);},setEndAfter:function(_64,_65){this._setPoint("setEnd",_64,_65,1);},setEndBefore:function(_66,_67){this._setPoint("setEnd",_66,_67,0);},_setPoint:function(_68,_69,_6a,ext){var _6b=_5.range.getIndex(_69,_69.parentNode).o;this[_68](_69.parentNode,_6b.pop()+ext);},_getIERange:function(){var r=(this._body||this.endContainer.ownerDocument.body).createTextRange();_5.range.ie.setRange(r,this.startContainer,this.startOffset,this.endContainer,this.endOffset,this.collapsed);return r;},getBookmark:function(){this._getIERange();return this._cachedBookmark;},_select:function(){var r=this._getIERange();r.select();},deleteContents:function(){var s=this.startContainer,r=this._getIERange();if(s.nodeType===3&&!this.startOffset){this.setStartBefore(s);}r.pasteHTML("");this.endContainer=this.startContainer;this.endOffset=this.startOffset;this.collapsed=true;},cloneRange:function(){var r=new _5.range.W3CRange([this.startContainer,this.startOffset,this.endContainer,this.endOffset]);r._body=this._body;return r;},detach:function(){this._body=null;this.commonAncestorContainer=null;this.startContainer=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=true;}});}return _5.range;});
\ No newline at end of file +define("dijit/_editor/range",["dojo/_base/array","dojo/_base/declare","dojo/_base/lang","dojo/_base/window","../main"],function(_1,_2,_3,_4,_5){_5.range={};_5.range.getIndex=function(_6,_7){var _8=[],_9=[];var _a=_6;var _b,n;while(_6!=_7){var i=0;_b=_6.parentNode;while((n=_b.childNodes[i++])){if(n===_6){--i;break;}}_8.unshift(i);_9.unshift(i-_b.childNodes.length);_6=_b;}if(_8.length>0&&_a.nodeType==3){n=_a.previousSibling;while(n&&n.nodeType==3){_8[_8.length-1]--;n=n.previousSibling;}n=_a.nextSibling;while(n&&n.nodeType==3){_9[_9.length-1]++;n=n.nextSibling;}}return {o:_8,r:_9};};_5.range.getNode=function(_c,_d){if(!_3.isArray(_c)||_c.length==0){return _d;}var _e=_d;_1.every(_c,function(i){if(i>=0&&i<_e.childNodes.length){_e=_e.childNodes[i];}else{_e=null;return false;}return true;});return _e;};_5.range.getCommonAncestor=function(n1,n2,_f){_f=_f||n1.ownerDocument.body;var _10=function(n){var as=[];while(n){as.unshift(n);if(n!==_f){n=n.parentNode;}else{break;}}return as;};var _11=_10(n1);var _12=_10(n2);var m=Math.min(_11.length,_12.length);var com=_11[0];for(var i=1;i<m;i++){if(_11[i]===_12[i]){com=_11[i];}else{break;}}return com;};_5.range.getAncestor=function(_13,_14,_15){_15=_15||_13.ownerDocument.body;while(_13&&_13!==_15){var _16=_13.nodeName.toUpperCase();if(_14.test(_16)){return _13;}_13=_13.parentNode;}return null;};_5.range.BlockTagNames=/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/;_5.range.getBlockAncestor=function(_17,_18,_19){_19=_19||_17.ownerDocument.body;_18=_18||_5.range.BlockTagNames;var _1a=null,_1b;while(_17&&_17!==_19){var _1c=_17.nodeName.toUpperCase();if(!_1a&&_18.test(_1c)){_1a=_17;}if(!_1b&&(/^(?:BODY|TD|TH|CAPTION)$/).test(_1c)){_1b=_17;}_17=_17.parentNode;}return {blockNode:_1a,blockContainer:_1b||_17.ownerDocument.body};};_5.range.atBeginningOfContainer=function(_1d,_1e,_1f){var _20=false;var _21=(_1f==0);if(!_21&&_1e.nodeType==3){if(/^[\s\xA0]+$/.test(_1e.nodeValue.substr(0,_1f))){_21=true;}}if(_21){var _22=_1e;_20=true;while(_22&&_22!==_1d){if(_22.previousSibling){_20=false;break;}_22=_22.parentNode;}}return _20;};_5.range.atEndOfContainer=function(_23,_24,_25){var _26=false;var _27=(_25==(_24.length||_24.childNodes.length));if(!_27&&_24.nodeType==3){if(/^[\s\xA0]+$/.test(_24.nodeValue.substr(_25))){_27=true;}}if(_27){var _28=_24;_26=true;while(_28&&_28!==_23){if(_28.nextSibling){_26=false;break;}_28=_28.parentNode;}}return _26;};_5.range.adjacentNoneTextNode=function(_29,_2a){var _2b=_29;var len=(0-_29.length)||0;var _2c=_2a?"nextSibling":"previousSibling";while(_2b){if(_2b.nodeType!=3){break;}len+=_2b.length;_2b=_2b[_2c];}return [_2b,len];};_5.range.create=function(win){win=win||window;if(win.getSelection){return win.document.createRange();}else{return new _5.range.W3CRange();}};_5.range.getSelection=function(_2d,_2e){if(_2d.getSelection){return _2d.getSelection();}else{var s=new _5.range.ie.selection(_2d);if(!_2e){s._getCurrentSelection();}return s;}};if(!window.getSelection){_5.range.ie={cachedSelection:{},selection:function(_2f){this._ranges=[];this.addRange=function(r,_30){this._ranges.push(r);if(!_30){r._select();}this.rangeCount=this._ranges.length;};this.removeAllRanges=function(){this._ranges=[];this.rangeCount=0;};var _31=function(){var r=_2f.document.selection.createRange();var _32=_2f.document.selection.type.toUpperCase();if(_32=="CONTROL"){return new _5.range.W3CRange(_5.range.ie.decomposeControlRange(r));}else{return new _5.range.W3CRange(_5.range.ie.decomposeTextRange(r));}};this.getRangeAt=function(i){return this._ranges[i];};this._getCurrentSelection=function(){this.removeAllRanges();var r=_31();if(r){this.addRange(r,true);this.isCollapsed=r.collapsed;}else{this.isCollapsed=true;}};},decomposeControlRange:function(_33){var _34=_33.item(0),_35=_33.item(_33.length-1);var _36=_34.parentNode,_37=_35.parentNode;var _38=_5.range.getIndex(_34,_36).o[0];var _39=_5.range.getIndex(_35,_37).o[0]+1;return [_36,_38,_37,_39];},getEndPoint:function(_3a,end){var _3b=_3a.duplicate();_3b.collapse(!end);var _3c="EndTo"+(end?"End":"Start");var _3d=_3b.parentElement();var _3e,_3f,_40;if(_3d.childNodes.length>0){_1.every(_3d.childNodes,function(_41,i){var _42;if(_41.nodeType!=3){_3b.moveToElementText(_41);if(_3b.compareEndPoints(_3c,_3a)>0){if(_40&&_40.nodeType==3){_3e=_40;_42=true;}else{_3e=_3d;_3f=i;return false;}}else{if(i==_3d.childNodes.length-1){_3e=_3d;_3f=_3d.childNodes.length;return false;}}}else{if(i==_3d.childNodes.length-1){_3e=_41;_42=true;}}if(_42&&_3e){var _43=_5.range.adjacentNoneTextNode(_3e)[0];if(_43){_3e=_43.nextSibling;}else{_3e=_3d.firstChild;}var _44=_5.range.adjacentNoneTextNode(_3e);_43=_44[0];var _45=_44[1];if(_43){_3b.moveToElementText(_43);_3b.collapse(false);}else{_3b.moveToElementText(_3d);}_3b.setEndPoint(_3c,_3a);_3f=_3b.text.length-_45;return false;}_40=_41;return true;});}else{_3e=_3d;_3f=0;}if(!end&&_3e.nodeType==1&&_3f==_3e.childNodes.length){var _46=_3e.nextSibling;if(_46&&_46.nodeType==3){_3e=_46;_3f=0;}}return [_3e,_3f];},setEndPoint:function(_47,_48,_49){var _4a=_47.duplicate(),_4b,len;if(_48.nodeType!=3){if(_49>0){_4b=_48.childNodes[_49-1];if(_4b){if(_4b.nodeType==3){_48=_4b;_49=_4b.length;}else{if(_4b.nextSibling&&_4b.nextSibling.nodeType==3){_48=_4b.nextSibling;_49=0;}else{_4a.moveToElementText(_4b.nextSibling?_4b:_48);var _4c=_4b.parentNode;var _4d=_4c.insertBefore(_4b.ownerDocument.createTextNode(" "),_4b.nextSibling);_4a.collapse(false);_4c.removeChild(_4d);}}}}else{_4a.moveToElementText(_48);_4a.collapse(true);}}if(_48.nodeType==3){var _4e=_5.range.adjacentNoneTextNode(_48);var _4f=_4e[0];len=_4e[1];if(_4f){_4a.moveToElementText(_4f);_4a.collapse(false);if(_4f.contentEditable!="inherit"){len++;}}else{_4a.moveToElementText(_48.parentNode);_4a.collapse(true);_4a.move("character",1);_4a.move("character",-1);}_49+=len;if(_49>0){if(_4a.move("character",_49)!=_49){console.error("Error when moving!");}}}return _4a;},decomposeTextRange:function(_50){var _51=_5.range.ie.getEndPoint(_50);var _52=_51[0],_53=_51[1];var _54=_51[0],_55=_51[1];if(_50.htmlText.length){if(_50.htmlText==_50.text){_55=_53+_50.text.length;}else{_51=_5.range.ie.getEndPoint(_50,true);_54=_51[0],_55=_51[1];}}return [_52,_53,_54,_55];},setRange:function(_56,_57,_58,_59,_5a,_5b){var _5c=_5.range.ie.setEndPoint(_56,_57,_58);_56.setEndPoint("StartToStart",_5c);if(!_5b){var end=_5.range.ie.setEndPoint(_56,_59,_5a);}_56.setEndPoint("EndToEnd",end||_5c);return _56;}};_2("dijit.range.W3CRange",null,{constructor:function(){if(arguments.length>0){this.setStart(arguments[0][0],arguments[0][1]);this.setEnd(arguments[0][2],arguments[0][3]);}else{this.commonAncestorContainer=null;this.startContainer=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=true;}},_updateInternal:function(){if(this.startContainer!==this.endContainer){this.commonAncestorContainer=_5.range.getCommonAncestor(this.startContainer,this.endContainer);}else{this.commonAncestorContainer=this.startContainer;}this.collapsed=(this.startContainer===this.endContainer)&&(this.startOffset==this.endOffset);},setStart:function(_5d,_5e){_5e=parseInt(_5e);if(this.startContainer===_5d&&this.startOffset==_5e){return;}delete this._cachedBookmark;this.startContainer=_5d;this.startOffset=_5e;if(!this.endContainer){this.setEnd(_5d,_5e);}else{this._updateInternal();}},setEnd:function(_5f,_60){_60=parseInt(_60);if(this.endContainer===_5f&&this.endOffset==_60){return;}delete this._cachedBookmark;this.endContainer=_5f;this.endOffset=_60;if(!this.startContainer){this.setStart(_5f,_60);}else{this._updateInternal();}},setStartAfter:function(_61,_62){this._setPoint("setStart",_61,_62,1);},setStartBefore:function(_63,_64){this._setPoint("setStart",_63,_64,0);},setEndAfter:function(_65,_66){this._setPoint("setEnd",_65,_66,1);},setEndBefore:function(_67,_68){this._setPoint("setEnd",_67,_68,0);},_setPoint:function(_69,_6a,_6b,ext){var _6c=_5.range.getIndex(_6a,_6a.parentNode).o;this[_69](_6a.parentNode,_6c.pop()+ext);},_getIERange:function(){var r=(this._body||this.endContainer.ownerDocument.body).createTextRange();_5.range.ie.setRange(r,this.startContainer,this.startOffset,this.endContainer,this.endOffset,this.collapsed);return r;},getBookmark:function(){this._getIERange();return this._cachedBookmark;},_select:function(){var r=this._getIERange();r.select();},deleteContents:function(){var s=this.startContainer,r=this._getIERange();if(s.nodeType===3&&!this.startOffset){this.setStartBefore(s);}r.pasteHTML("");this.endContainer=this.startContainer;this.endOffset=this.startOffset;this.collapsed=true;},cloneRange:function(){var r=new _5.range.W3CRange([this.startContainer,this.startOffset,this.endContainer,this.endOffset]);r._body=this._body;return r;},detach:function(){this._body=null;this.commonAncestorContainer=null;this.startContainer=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=true;}});}return _5.range;});
\ No newline at end of file diff --git a/lib/dijit/_editor/range.js.uncompressed.js b/lib/dijit/_editor/range.js.uncompressed.js new file mode 100644 index 000000000..b1f55e1ce --- /dev/null +++ b/lib/dijit/_editor/range.js.uncompressed.js @@ -0,0 +1,559 @@ +define("dijit/_editor/range", [ + "dojo/_base/array", // array.every + "dojo/_base/declare", // declare + "dojo/_base/lang", // lang.isArray + "dojo/_base/window", // win.doc TODO: remove in 2.0 + "../main" // for exporting symbols to dijit, TODO: remove in 2.0 +], function(array, declare, lang, win, dijit){ + +// module: +// dijit/_editor/range +// summary: +// W3C range API + + +dijit.range={}; + +dijit.range.getIndex = function(/*DomNode*/node, /*DomNode*/parent){ +// dojo.profile.start("dijit.range.getIndex"); + var ret = [], retR = []; + var onode = node; + + var pnode, n; + while(node != parent){ + var i = 0; + pnode = node.parentNode; + while((n = pnode.childNodes[i++])){ + if(n === node){ + --i; + break; + } + } + //if(i>=pnode.childNodes.length){ + //dojo.debug("Error finding index of a node in dijit/range.getIndex()"); + //} + ret.unshift(i); + retR.unshift(i - pnode.childNodes.length); + node = pnode; + } + + //normalized() can not be called so often to prevent + //invalidating selection/range, so we have to detect + //here that any text nodes in a row + if(ret.length > 0 && onode.nodeType == 3){ + n = onode.previousSibling; + while(n && n.nodeType == 3){ + ret[ret.length - 1]--; + n = n.previousSibling; + } + n = onode.nextSibling; + while(n && n.nodeType == 3){ + retR[retR.length - 1]++; + n = n.nextSibling; + } + } +// dojo.profile.end("dijit/range.getIndex()"); + return {o: ret, r:retR}; +}; + +dijit.range.getNode = function(/*Array*/index, /*DomNode*/parent){ + if(!lang.isArray(index) || index.length == 0){ + return parent; + } + var node = parent; +// if(!node)debugger + array.every(index, function(i){ + if(i >= 0 && i < node.childNodes.length){ + node = node.childNodes[i]; + }else{ + node = null; + //console.debug('Error: can not find node with index',index,'under parent node',parent ); + return false; //terminate array.every + } + return true; //carry on the every loop + }); + + return node; +}; + +dijit.range.getCommonAncestor = function(n1, n2, root){ + root = root || n1.ownerDocument.body; + var getAncestors = function(n){ + var as = []; + while(n){ + as.unshift(n); + if(n !== root){ + n = n.parentNode; + }else{ + break; + } + } + return as; + }; + var n1as = getAncestors(n1); + var n2as = getAncestors(n2); + + var m = Math.min(n1as.length, n2as.length); + var com = n1as[0]; //at least, one element should be in the array: the root (BODY by default) + for(var i = 1; i < m; i++){ + if(n1as[i] === n2as[i]){ + com = n1as[i] + }else{ + break; + } + } + return com; +}; + +dijit.range.getAncestor = function(/*DomNode*/node, /*RegEx?*/regex, /*DomNode?*/root){ + root = root || node.ownerDocument.body; + while(node && node !== root){ + var name = node.nodeName.toUpperCase(); + if(regex.test(name)){ + return node; + } + + node = node.parentNode; + } + return null; +}; + +dijit.range.BlockTagNames = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/; +dijit.range.getBlockAncestor = function(/*DomNode*/node, /*RegEx?*/regex, /*DomNode?*/root){ + root = root || node.ownerDocument.body; + regex = regex || dijit.range.BlockTagNames; + var block = null, blockContainer; + while(node && node !== root){ + var name = node.nodeName.toUpperCase(); + if(!block && regex.test(name)){ + block = node; + } + if(!blockContainer && (/^(?:BODY|TD|TH|CAPTION)$/).test(name)){ + blockContainer = node; + } + + node = node.parentNode; + } + return {blockNode:block, blockContainer:blockContainer || node.ownerDocument.body}; +}; + +dijit.range.atBeginningOfContainer = function(/*DomNode*/container, /*DomNode*/node, /*Int*/offset){ + var atBeginning = false; + var offsetAtBeginning = (offset == 0); + if(!offsetAtBeginning && node.nodeType == 3){ //if this is a text node, check whether the left part is all space + if(/^[\s\xA0]+$/.test(node.nodeValue.substr(0, offset))){ + offsetAtBeginning = true; + } + } + if(offsetAtBeginning){ + var cnode = node; + atBeginning = true; + while(cnode && cnode !== container){ + if(cnode.previousSibling){ + atBeginning = false; + break; + } + cnode = cnode.parentNode; + } + } + return atBeginning; +}; + +dijit.range.atEndOfContainer = function(/*DomNode*/container, /*DomNode*/node, /*Int*/offset){ + var atEnd = false; + var offsetAtEnd = (offset == (node.length || node.childNodes.length)); + if(!offsetAtEnd && node.nodeType == 3){ //if this is a text node, check whether the right part is all space + if(/^[\s\xA0]+$/.test(node.nodeValue.substr(offset))){ + offsetAtEnd = true; + } + } + if(offsetAtEnd){ + var cnode = node; + atEnd = true; + while(cnode && cnode !== container){ + if(cnode.nextSibling){ + atEnd = false; + break; + } + cnode = cnode.parentNode; + } + } + return atEnd; +}; + +dijit.range.adjacentNoneTextNode = function(startnode, next){ + var node = startnode; + var len = (0 - startnode.length) || 0; + var prop = next ? 'nextSibling' : 'previousSibling'; + while(node){ + if(node.nodeType != 3){ + break; + } + len += node.length; + node = node[prop]; + } + return [node,len]; +}; + +dijit.range.create = function(/*Window?*/ win){ // TODO: for 2.0, replace optional window param w/mandatory window or document param + win = win || window; + if(win.getSelection){ + return win.document.createRange(); + }else{//IE + return new dijit.range.W3CRange(); + } +}; + +dijit.range.getSelection = function(/*Window*/ window, /*Boolean?*/ ignoreUpdate){ + if(window.getSelection){ + return window.getSelection(); + }else{//IE + var s = new dijit.range.ie.selection(window); + if(!ignoreUpdate){ + s._getCurrentSelection(); + } + return s; + } +}; + +// TODO: convert to has() test? But remember IE9 issues with quirks vs. standards in main frame vs. iframe. +if(!window.getSelection){ + dijit.range.ie = { + cachedSelection: {}, + selection: function(window){ + this._ranges = []; + this.addRange = function(r, /*boolean*/ internal){ + this._ranges.push(r); + if(!internal){ + r._select(); + } + this.rangeCount = this._ranges.length; + }; + this.removeAllRanges = function(){ + //don't detach, the range may be used later +// for(var i=0;i<this._ranges.length;i++){ +// this._ranges[i].detach(); +// } + this._ranges = []; + this.rangeCount = 0; + }; + var _initCurrentRange = function(){ + var r = window.document.selection.createRange(); + var type = window.document.selection.type.toUpperCase(); + if(type == "CONTROL"){ + //TODO: multiple range selection(?) + return new dijit.range.W3CRange(dijit.range.ie.decomposeControlRange(r)); + }else{ + return new dijit.range.W3CRange(dijit.range.ie.decomposeTextRange(r)); + } + }; + this.getRangeAt = function(i){ + return this._ranges[i]; + }; + this._getCurrentSelection = function(){ + this.removeAllRanges(); + var r = _initCurrentRange(); + if(r){ + this.addRange(r, true); + this.isCollapsed = r.collapsed; + }else{ + this.isCollapsed = true; + } + }; + }, + decomposeControlRange: function(range){ + var firstnode = range.item(0), lastnode = range.item(range.length - 1); + var startContainer = firstnode.parentNode, endContainer = lastnode.parentNode; + var startOffset = dijit.range.getIndex(firstnode, startContainer).o[0]; + var endOffset = dijit.range.getIndex(lastnode, endContainer).o[0] + 1; + return [startContainer, startOffset,endContainer, endOffset]; + }, + getEndPoint: function(range, end){ + var atmrange = range.duplicate(); + atmrange.collapse(!end); + var cmpstr = 'EndTo' + (end ? 'End' : 'Start'); + var parentNode = atmrange.parentElement(); + + var startnode, startOffset, lastNode; + if(parentNode.childNodes.length > 0){ + array.every(parentNode.childNodes, function(node, i){ + var calOffset; + if(node.nodeType != 3){ + atmrange.moveToElementText(node); + + if(atmrange.compareEndPoints(cmpstr, range) > 0){ + //startnode = node.previousSibling; + if(lastNode && lastNode.nodeType == 3){ + //where shall we put the start? in the text node or after? + startnode = lastNode; + calOffset = true; + }else{ + startnode = parentNode; + startOffset = i; + return false; + } + }else{ + if(i == parentNode.childNodes.length - 1){ + startnode = parentNode; + startOffset = parentNode.childNodes.length; + return false; + } + } + }else{ + if(i == parentNode.childNodes.length - 1){//at the end of this node + startnode = node; + calOffset = true; + } + } + // try{ + if(calOffset && startnode){ + var prevnode = dijit.range.adjacentNoneTextNode(startnode)[0]; + if(prevnode){ + startnode = prevnode.nextSibling; + }else{ + startnode = parentNode.firstChild; //firstChild must be a text node + } + var prevnodeobj = dijit.range.adjacentNoneTextNode(startnode); + prevnode = prevnodeobj[0]; + var lenoffset = prevnodeobj[1]; + if(prevnode){ + atmrange.moveToElementText(prevnode); + atmrange.collapse(false); + }else{ + atmrange.moveToElementText(parentNode); + } + atmrange.setEndPoint(cmpstr, range); + startOffset = atmrange.text.length - lenoffset; + + return false; + } + // }catch(e){ debugger } + lastNode = node; + return true; + }); + }else{ + startnode = parentNode; + startOffset = 0; + } + + //if at the end of startnode and we are dealing with start container, then + //move the startnode to nextSibling if it is a text node + //TODO: do this for end container? + if(!end && startnode.nodeType == 1 && startOffset == startnode.childNodes.length){ + var nextnode = startnode.nextSibling; + if(nextnode && nextnode.nodeType == 3){ + startnode = nextnode; + startOffset = 0; + } + } + return [startnode, startOffset]; + }, + setEndPoint: function(range, container, offset){ + //text node + var atmrange = range.duplicate(), node, len; + if(container.nodeType != 3){ //normal node + if(offset > 0){ + node = container.childNodes[offset - 1]; + if(node){ + if(node.nodeType == 3){ + container = node; + offset = node.length; + //pass through + }else{ + if(node.nextSibling && node.nextSibling.nodeType == 3){ + container = node.nextSibling; + offset = 0; + //pass through + }else{ + atmrange.moveToElementText(node.nextSibling ? node : container); + var parent = node.parentNode; + var tempNode = parent.insertBefore(node.ownerDocument.createTextNode(' '), node.nextSibling); + atmrange.collapse(false); + parent.removeChild(tempNode); + } + } + } + }else{ + atmrange.moveToElementText(container); + atmrange.collapse(true); + } + } + if(container.nodeType == 3){ + var prevnodeobj = dijit.range.adjacentNoneTextNode(container); + var prevnode = prevnodeobj[0]; + len = prevnodeobj[1]; + if(prevnode){ + atmrange.moveToElementText(prevnode); + atmrange.collapse(false); + //if contentEditable is not inherit, the above collapse won't make the end point + //in the correctly position: it always has a -1 offset, so compensate it + if(prevnode.contentEditable != 'inherit'){ + len++; + } + }else{ + atmrange.moveToElementText(container.parentNode); + atmrange.collapse(true); + + // Correct internal cursor position + // http://bugs.dojotoolkit.org/ticket/15578 + atmrange.move('character', 1); + atmrange.move('character', -1); + } + + offset += len; + if(offset > 0){ + if(atmrange.move('character', offset) != offset){ + console.error('Error when moving!'); + } + } + } + + return atmrange; + }, + decomposeTextRange: function(range){ + var tmpary = dijit.range.ie.getEndPoint(range); + var startContainer = tmpary[0], startOffset = tmpary[1]; + var endContainer = tmpary[0], endOffset = tmpary[1]; + + if(range.htmlText.length){ + if(range.htmlText == range.text){ //in the same text node + endOffset = startOffset + range.text.length; + }else{ + tmpary = dijit.range.ie.getEndPoint(range, true); + endContainer = tmpary[0],endOffset = tmpary[1]; +// if(startContainer.tagName == "BODY"){ +// startContainer = startContainer.firstChild; +// } + } + } + return [startContainer, startOffset, endContainer, endOffset]; + }, + setRange: function(range, startContainer, startOffset, endContainer, endOffset, collapsed){ + var start = dijit.range.ie.setEndPoint(range, startContainer, startOffset); + + range.setEndPoint('StartToStart', start); + if(!collapsed){ + var end = dijit.range.ie.setEndPoint(range, endContainer, endOffset); + } + range.setEndPoint('EndToEnd', end || start); + + return range; + } + }; + +declare("dijit.range.W3CRange",null, { + constructor: function(){ + if(arguments.length>0){ + this.setStart(arguments[0][0],arguments[0][1]); + this.setEnd(arguments[0][2],arguments[0][3]); + }else{ + this.commonAncestorContainer = null; + this.startContainer = null; + this.startOffset = 0; + this.endContainer = null; + this.endOffset = 0; + this.collapsed = true; + } + }, + _updateInternal: function(){ + if(this.startContainer !== this.endContainer){ + this.commonAncestorContainer = dijit.range.getCommonAncestor(this.startContainer, this.endContainer); + }else{ + this.commonAncestorContainer = this.startContainer; + } + this.collapsed = (this.startContainer === this.endContainer) && (this.startOffset == this.endOffset); + }, + setStart: function(node, offset){ + offset=parseInt(offset); + if(this.startContainer === node && this.startOffset == offset){ + return; + } + delete this._cachedBookmark; + + this.startContainer = node; + this.startOffset = offset; + if(!this.endContainer){ + this.setEnd(node, offset); + }else{ + this._updateInternal(); + } + }, + setEnd: function(node, offset){ + offset=parseInt(offset); + if(this.endContainer === node && this.endOffset == offset){ + return; + } + delete this._cachedBookmark; + + this.endContainer = node; + this.endOffset = offset; + if(!this.startContainer){ + this.setStart(node, offset); + }else{ + this._updateInternal(); + } + }, + setStartAfter: function(node, offset){ + this._setPoint('setStart', node, offset, 1); + }, + setStartBefore: function(node, offset){ + this._setPoint('setStart', node, offset, 0); + }, + setEndAfter: function(node, offset){ + this._setPoint('setEnd', node, offset, 1); + }, + setEndBefore: function(node, offset){ + this._setPoint('setEnd', node, offset, 0); + }, + _setPoint: function(what, node, offset, ext){ + var index = dijit.range.getIndex(node, node.parentNode).o; + this[what](node.parentNode, index.pop()+ext); + }, + _getIERange: function(){ + var r = (this._body || this.endContainer.ownerDocument.body).createTextRange(); + dijit.range.ie.setRange(r, this.startContainer, this.startOffset, this.endContainer, this.endOffset, this.collapsed); + return r; + }, + getBookmark: function(){ + this._getIERange(); + return this._cachedBookmark; + }, + _select: function(){ + var r = this._getIERange(); + r.select(); + }, + deleteContents: function(){ + var s = this.startContainer, r = this._getIERange(); + if(s.nodeType === 3 && !this.startOffset){ + //if the range starts at the beginning of a + //text node, move it to before the textnode + //to make sure the range is still valid + //after deleteContents() finishes + this.setStartBefore(s); + } + r.pasteHTML(''); + this.endContainer = this.startContainer; + this.endOffset = this.startOffset; + this.collapsed = true; + }, + cloneRange: function(){ + var r = new dijit.range.W3CRange([this.startContainer,this.startOffset, + this.endContainer,this.endOffset]); + r._body = this._body; + return r; + }, + detach: function(){ + this._body = null; + this.commonAncestorContainer = null; + this.startContainer = null; + this.startOffset = 0; + this.endContainer = null; + this.endOffset = 0; + this.collapsed = true; +} +}); +} //if(!window.getSelection) + + +return dijit.range; +}); diff --git a/lib/dijit/_editor/selection.js b/lib/dijit/_editor/selection.js index 55d8ee23b..c19c340af 100644 --- a/lib/dijit/_editor/selection.js +++ b/lib/dijit/_editor/selection.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_editor/selection",["dojo/dom","dojo/_base/lang","dojo/_base/sniff","dojo/_base/window",".."],function(_1,_2,_3,_4,_5){_2.getObject("_editor.selection",true,_5);_2.mixin(_5._editor.selection,{getType:function(){if(_3("ie")<9){return _4.doc.selection.type.toLowerCase();}else{var _6="text";var _7;try{_7=_4.global.getSelection();}catch(e){}if(_7&&_7.rangeCount==1){var _8=_7.getRangeAt(0);if((_8.startContainer==_8.endContainer)&&((_8.endOffset-_8.startOffset)==1)&&(_8.startContainer.nodeType!=3)){_6="control";}}return _6;}},getSelectedText:function(){if(_3("ie")<9){if(_5._editor.selection.getType()=="control"){return null;}return _4.doc.selection.createRange().text;}else{var _9=_4.global.getSelection();if(_9){return _9.toString();}}return "";},getSelectedHtml:function(){if(_3("ie")<9){if(_5._editor.selection.getType()=="control"){return null;}return _4.doc.selection.createRange().htmlText;}else{var _a=_4.global.getSelection();if(_a&&_a.rangeCount){var i;var _b="";for(i=0;i<_a.rangeCount;i++){var _c=_a.getRangeAt(i).cloneContents();var _d=_4.doc.createElement("div");_d.appendChild(_c);_b+=_d.innerHTML;}return _b;}return null;}},getSelectedElement:function(){if(_5._editor.selection.getType()=="control"){if(_3("ie")<9){var _e=_4.doc.selection.createRange();if(_e&&_e.item){return _4.doc.selection.createRange().item(0);}}else{var _f=_4.global.getSelection();return _f.anchorNode.childNodes[_f.anchorOffset];}}return null;},getParentElement:function(){if(_5._editor.selection.getType()=="control"){var p=this.getSelectedElement();if(p){return p.parentNode;}}else{if(_3("ie")<9){var r=_4.doc.selection.createRange();r.collapse(true);return r.parentElement();}else{var _10=_4.global.getSelection();if(_10){var _11=_10.anchorNode;while(_11&&(_11.nodeType!=1)){_11=_11.parentNode;}return _11;}}}return null;},hasAncestorElement:function(_12){return this.getAncestorElement.apply(this,arguments)!=null;},getAncestorElement:function(_13){var _14=this.getSelectedElement()||this.getParentElement();return this.getParentOfType(_14,arguments);},isTag:function(_15,_16){if(_15&&_15.tagName){var _17=_15.tagName.toLowerCase();for(var i=0;i<_16.length;i++){var _18=String(_16[i]).toLowerCase();if(_17==_18){return _18;}}}return "";},getParentOfType:function(_19,_1a){while(_19){if(this.isTag(_19,_1a).length){return _19;}_19=_19.parentNode;}return null;},collapse:function(_1b){if(window.getSelection){var _1c=_4.global.getSelection();if(_1c.removeAllRanges){if(_1b){_1c.collapseToStart();}else{_1c.collapseToEnd();}}else{_1c.collapse(_1b);}}else{if(_3("ie")){var _1d=_4.doc.selection.createRange();_1d.collapse(_1b);_1d.select();}}},remove:function(){var sel=_4.doc.selection;if(_3("ie")<9){if(sel.type.toLowerCase()!="none"){sel.clear();}return sel;}else{sel=_4.global.getSelection();sel.deleteFromDocument();return sel;}},selectElementChildren:function(_1e,_1f){var _20=_4.global;var doc=_4.doc;var _21;_1e=_1.byId(_1e);if(doc.selection&&_3("ie")<9&&_4.body().createTextRange){_21=_1e.ownerDocument.body.createTextRange();_21.moveToElementText(_1e);if(!_1f){try{_21.select();}catch(e){}}}else{if(_20.getSelection){var _22=_4.global.getSelection();if(_3("opera")){if(_22.rangeCount){_21=_22.getRangeAt(0);}else{_21=doc.createRange();}_21.setStart(_1e,0);_21.setEnd(_1e,(_1e.nodeType==3)?_1e.length:_1e.childNodes.length);_22.addRange(_21);}else{_22.selectAllChildren(_1e);}}}},selectElement:function(_23,_24){var _25;var doc=_4.doc;var _26=_4.global;_23=_1.byId(_23);if(_3("ie")<9&&_4.body().createTextRange){try{var tg=_23.tagName?_23.tagName.toLowerCase():"";if(tg==="img"||tg==="table"){_25=_4.body().createControlRange();}else{_25=_4.body().createRange();}_25.addElement(_23);if(!_24){_25.select();}}catch(e){this.selectElementChildren(_23,_24);}}else{if(_26.getSelection){var _27=_26.getSelection();_25=doc.createRange();if(_27.removeAllRanges){if(_3("opera")){if(_27.getRangeAt(0)){_25=_27.getRangeAt(0);}}_25.selectNode(_23);_27.removeAllRanges();_27.addRange(_25);}}}},inSelection:function(_28){if(_28){var _29;var doc=_4.doc;var _2a;if(_4.global.getSelection){var sel=_4.global.getSelection();if(sel&&sel.rangeCount>0){_2a=sel.getRangeAt(0);}if(_2a&&_2a.compareBoundaryPoints&&doc.createRange){try{_29=doc.createRange();_29.setStart(_28,0);if(_2a.compareBoundaryPoints(_2a.START_TO_END,_29)===1){return true;}}catch(e){}}}else{if(doc.selection){_2a=doc.selection.createRange();try{_29=_28.ownerDocument.body.createControlRange();if(_29){_29.addElement(_28);}}catch(e1){try{_29=_28.ownerDocument.body.createTextRange();_29.moveToElementText(_28);}catch(e2){}}if(_2a&&_29){if(_2a.compareEndPoints("EndToStart",_29)===1){return true;}}}}}return false;}});return _5._editor.selection;});
\ No newline at end of file +define("dijit/_editor/selection",["dojo/dom","dojo/_base/lang","dojo/sniff","dojo/_base/window","../main"],function(_1,_2,_3,_4,_5){var _6={getType:function(){if(_4.doc.getSelection){var _7="text";var _8;try{_8=_4.global.getSelection();}catch(e){}if(_8&&_8.rangeCount==1){var _9=_8.getRangeAt(0);if((_9.startContainer==_9.endContainer)&&((_9.endOffset-_9.startOffset)==1)&&(_9.startContainer.nodeType!=3)){_7="control";}}return _7;}else{return _4.doc.selection.type.toLowerCase();}},getSelectedText:function(){if(_4.doc.getSelection){var _a=_4.global.getSelection();return _a?_a.toString():"";}else{if(_5._editor.selection.getType()=="control"){return null;}return _4.doc.selection.createRange().text;}},getSelectedHtml:function(){if(_4.doc.getSelection){var _b=_4.global.getSelection();if(_b&&_b.rangeCount){var i;var _c="";for(i=0;i<_b.rangeCount;i++){var _d=_b.getRangeAt(i).cloneContents();var _e=_4.doc.createElement("div");_e.appendChild(_d);_c+=_e.innerHTML;}return _c;}return null;}else{if(_5._editor.selection.getType()=="control"){return null;}return _4.doc.selection.createRange().htmlText;}},getSelectedElement:function(){if(_5._editor.selection.getType()=="control"){if(_4.doc.getSelection){var _f=_4.global.getSelection();return _f.anchorNode.childNodes[_f.anchorOffset];}else{var _10=_4.doc.selection.createRange();if(_10&&_10.item){return _4.doc.selection.createRange().item(0);}}}return null;},getParentElement:function(){if(_5._editor.selection.getType()=="control"){var p=this.getSelectedElement();if(p){return p.parentNode;}}else{if(_4.doc.getSelection){var _11=_4.global.getSelection();if(_11){var _12=_11.anchorNode;while(_12&&(_12.nodeType!=1)){_12=_12.parentNode;}return _12;}}else{var r=_4.doc.selection.createRange();r.collapse(true);return r.parentElement();}}return null;},hasAncestorElement:function(_13){return this.getAncestorElement.apply(this,arguments)!=null;},getAncestorElement:function(_14){var _15=this.getSelectedElement()||this.getParentElement();return this.getParentOfType(_15,arguments);},isTag:function(_16,_17){if(_16&&_16.tagName){var _18=_16.tagName.toLowerCase();for(var i=0;i<_17.length;i++){var _19=String(_17[i]).toLowerCase();if(_18==_19){return _19;}}}return "";},getParentOfType:function(_1a,_1b){while(_1a){if(this.isTag(_1a,_1b).length){return _1a;}_1a=_1a.parentNode;}return null;},collapse:function(_1c){if(_4.doc.getSelection){var _1d=_4.global.getSelection();if(_1d.removeAllRanges){if(_1c){_1d.collapseToStart();}else{_1d.collapseToEnd();}}else{_1d.collapse(_1c);}}else{var _1e=_4.doc.selection.createRange();_1e.collapse(_1c);_1e.select();}},remove:function(){var sel=_4.doc.selection;if(_4.doc.getSelection){sel=_4.global.getSelection();sel.deleteFromDocument();return sel;}else{if(sel.type.toLowerCase()!="none"){sel.clear();}return sel;}},selectElementChildren:function(_1f,_20){var doc=_4.doc;var _21;_1f=_1.byId(_1f);if(_4.doc.getSelection){var _22=_4.global.getSelection();if(_3("opera")){if(_22.rangeCount){_21=_22.getRangeAt(0);}else{_21=doc.createRange();}_21.setStart(_1f,0);_21.setEnd(_1f,(_1f.nodeType==3)?_1f.length:_1f.childNodes.length);_22.addRange(_21);}else{_22.selectAllChildren(_1f);}}else{_21=_1f.ownerDocument.body.createTextRange();_21.moveToElementText(_1f);if(!_20){try{_21.select();}catch(e){}}}},selectElement:function(_23,_24){var _25;_23=_1.byId(_23);var doc=_23.ownerDocument;var _26=_4.global;if(doc.getSelection){var _27=_26.getSelection();_25=doc.createRange();if(_27.removeAllRanges){if(_3("opera")){if(_27.getRangeAt(0)){_25=_27.getRangeAt(0);}}_25.selectNode(_23);_27.removeAllRanges();_27.addRange(_25);}}else{try{var tg=_23.tagName?_23.tagName.toLowerCase():"";if(tg==="img"||tg==="table"){_25=_4.body(doc).createControlRange();}else{_25=_4.body(doc).createRange();}_25.addElement(_23);if(!_24){_25.select();}}catch(e){this.selectElementChildren(_23,_24);}}},inSelection:function(_28){if(_28){var _29;var doc=_4.doc;var _2a;if(_4.doc.getSelection){var sel=_4.global.getSelection();if(sel&&sel.rangeCount>0){_2a=sel.getRangeAt(0);}if(_2a&&_2a.compareBoundaryPoints&&doc.createRange){try{_29=doc.createRange();_29.setStart(_28,0);if(_2a.compareBoundaryPoints(_2a.START_TO_END,_29)===1){return true;}}catch(e){}}}else{_2a=doc.selection.createRange();try{_29=_28.ownerDocument.body.createControlRange();if(_29){_29.addElement(_28);}}catch(e1){try{_29=_28.ownerDocument.body.createTextRange();_29.moveToElementText(_28);}catch(e2){}}if(_2a&&_29){if(_2a.compareEndPoints("EndToStart",_29)===1){return true;}}}}return false;}};_2.setObject("dijit._editor.selection",_6);return _6;});
\ No newline at end of file diff --git a/lib/dijit/_editor/selection.js.uncompressed.js b/lib/dijit/_editor/selection.js.uncompressed.js new file mode 100644 index 000000000..272ac7787 --- /dev/null +++ b/lib/dijit/_editor/selection.js.uncompressed.js @@ -0,0 +1,383 @@ +define("dijit/_editor/selection", [ + "dojo/dom", // dom.byId + "dojo/_base/lang", + "dojo/sniff", // has("ie") has("opera") + "dojo/_base/window", // win.body win.doc win.doc.createElement win.doc.selection win.doc.selection.createRange win.doc.selection.type.toLowerCase win.global win.global.getSelection + "../main" // for exporting symbols to dijit._editor.selection (TODO: remove in 2.0) +], function(dom, lang, has, win, dijit){ + +// module: +// dijit/_editor/selection +// summary: +// Text selection API + +// FIXME: +// all of these methods branch internally for IE. This is probably +// sub-optimal in terms of runtime performance. We should investigate the +// size difference for differentiating at definition time. + +var selection = { + getType: function(){ + // summary: + // Get the selection type (like win.doc.select.type in IE). + if(win.doc.getSelection){ + // W3C path + var stype = "text"; + + // Check if the actual selection is a CONTROL (IMG, TABLE, HR, etc...). + var oSel; + try{ + oSel = win.global.getSelection(); + }catch(e){ /*squelch*/ } + + if(oSel && oSel.rangeCount == 1){ + var oRange = oSel.getRangeAt(0); + if( (oRange.startContainer == oRange.endContainer) && + ((oRange.endOffset - oRange.startOffset) == 1) && + (oRange.startContainer.nodeType != 3 /* text node*/) + ){ + stype = "control"; + } + } + return stype; //String + }else{ + // IE6-8 + return win.doc.selection.type.toLowerCase(); + } + }, + + getSelectedText: function(){ + // summary: + // Return the text (no html tags) included in the current selection or null if no text is selected + if(win.doc.getSelection){ + // W3C path + var selection = win.global.getSelection(); + return selection ? selection.toString() : ""; //String + }else{ + // IE6-8 + if(dijit._editor.selection.getType() == 'control'){ + return null; + } + return win.doc.selection.createRange().text; + } + }, + + getSelectedHtml: function(){ + // summary: + // Return the html text of the current selection or null if unavailable + if(win.doc.getSelection){ + // W3C path + var selection = win.global.getSelection(); + if(selection && selection.rangeCount){ + var i; + var html = ""; + for(i = 0; i < selection.rangeCount; i++){ + //Handle selections spanning ranges, such as Opera + var frag = selection.getRangeAt(i).cloneContents(); + var div = win.doc.createElement("div"); + div.appendChild(frag); + html += div.innerHTML; + } + return html; //String + } + return null; + }else{ + // IE6-8 + if(dijit._editor.selection.getType() == 'control'){ + return null; + } + return win.doc.selection.createRange().htmlText; + } + }, + + getSelectedElement: function(){ + // summary: + // Retrieves the selected element (if any), just in the case that + // a single element (object like and image or a table) is + // selected. + if(dijit._editor.selection.getType() == "control"){ + if(win.doc.getSelection){ + // W3C path + var selection = win.global.getSelection(); + return selection.anchorNode.childNodes[ selection.anchorOffset ]; + }else{ + // IE6-8 + var range = win.doc.selection.createRange(); + if(range && range.item){ + return win.doc.selection.createRange().item(0); + } + } + } + return null; + }, + + getParentElement: function(){ + // summary: + // Get the parent element of the current selection + if(dijit._editor.selection.getType() == "control"){ + var p = this.getSelectedElement(); + if(p){ return p.parentNode; } + }else{ + if(win.doc.getSelection){ + var selection = win.global.getSelection(); + if(selection){ + var node = selection.anchorNode; + while(node && (node.nodeType != 1)){ // not an element + node = node.parentNode; + } + return node; + } + }else{ + var r = win.doc.selection.createRange(); + r.collapse(true); + return r.parentElement(); + } + } + return null; + }, + + hasAncestorElement: function(/*String*/ tagName /* ... */){ + // summary: + // Check whether current selection has a parent element which is + // of type tagName (or one of the other specified tagName) + // tagName: String + // The tag name to determine if it has an ancestor of. + return this.getAncestorElement.apply(this, arguments) != null; //Boolean + }, + + getAncestorElement: function(/*String*/ tagName /* ... */){ + // summary: + // Return the parent element of the current selection which is of + // type tagName (or one of the other specified tagName) + // tagName: String + // The tag name to determine if it has an ancestor of. + var node = this.getSelectedElement() || this.getParentElement(); + return this.getParentOfType(node, arguments); //DOMNode + }, + + isTag: function(/*DomNode*/ node, /*String[]*/ tags){ + // summary: + // Function to determine if a node is one of an array of tags. + // node: + // The node to inspect. + // tags: + // An array of tag name strings to check to see if the node matches. + if(node && node.tagName){ + var _nlc = node.tagName.toLowerCase(); + for(var i=0; i<tags.length; i++){ + var _tlc = String(tags[i]).toLowerCase(); + if(_nlc == _tlc){ + return _tlc; // String + } + } + } + return ""; + }, + + getParentOfType: function(/*DomNode*/ node, /*String[]*/ tags){ + // summary: + // Function to locate a parent node that matches one of a set of tags + // node: + // The node to inspect. + // tags: + // An array of tag name strings to check to see if the node matches. + while(node){ + if(this.isTag(node, tags).length){ + return node; // DOMNode + } + node = node.parentNode; + } + return null; + }, + + collapse: function(/*Boolean*/ beginning){ + // summary: + // Function to collapse (clear), the current selection + // beginning: Boolean + // Indicates whether to collapse the cursor to the beginning of the selection or end. + if(win.doc.getSelection){ + // W3C path + var selection = win.global.getSelection(); + if(selection.removeAllRanges){ // Mozilla + if(beginning){ + selection.collapseToStart(); + }else{ + selection.collapseToEnd(); + } + }else{ // Safari + // pulled from WebCore/ecma/kjs_window.cpp, line 2536 + selection.collapse(beginning); + } + }else{ + // IE6-8 + var range = win.doc.selection.createRange(); + range.collapse(beginning); + range.select(); + } + }, + + remove: function(){ + // summary: + // Function to delete the currently selected content from the document. + var sel = win.doc.selection; + if(win.doc.getSelection){ + // W3C path + sel = win.global.getSelection(); + sel.deleteFromDocument(); + return sel; //Selection + }else{ + // IE6-8 + if(sel.type.toLowerCase() != "none"){ + sel.clear(); + } + return sel; //Selection + } + }, + + selectElementChildren: function(/*DomNode*/ element, /*Boolean?*/ nochangefocus){ + // summary: + // clear previous selection and select the content of the node + // (excluding the node itself) + // element: DOMNode + // The element you wish to select the children content of. + // nochangefocus: Boolean + // Indicates if the focus should change or not. + var doc = win.doc; + var range; + element = dom.byId(element); + if(win.doc.getSelection){ + // W3C + var selection = win.global.getSelection(); + if(has("opera")){ + //Opera's selectAllChildren doesn't seem to work right + //against <body> nodes and possibly others ... so + //we use the W3C range API + if(selection.rangeCount){ + range = selection.getRangeAt(0); + }else{ + range = doc.createRange(); + } + range.setStart(element, 0); + range.setEnd(element,(element.nodeType == 3) ? element.length : element.childNodes.length); + selection.addRange(range); + }else{ + selection.selectAllChildren(element); + } + }else{ + // IE6-8 + range = element.ownerDocument.body.createTextRange(); + range.moveToElementText(element); + if(!nochangefocus){ + try{ + range.select(); // IE throws an exception here if the widget is hidden. See #5439 + }catch(e){ /* squelch */} + } + } + }, + + selectElement: function(/*DomNode*/ element, /*Boolean?*/ nochangefocus){ + // summary: + // clear previous selection and select element (including all its children) + // element: DOMNode + // The element to select. + // nochangefocus: Boolean + // Boolean indicating if the focus should be changed. IE only. + var range; + element = dom.byId(element); // TODO: remove for 2.0 or sooner, spec listed above doesn't allow for string + var doc = element.ownerDocument; + var global = win.global; // TODO: use winUtils.get(doc)? + if(doc.getSelection){ + // W3C path + var selection = global.getSelection(); + range = doc.createRange(); + if(selection.removeAllRanges){ // Mozilla + // FIXME: does this work on Safari? + if(has("opera")){ + //Opera works if you use the current range on + //the selection if present. + if(selection.getRangeAt(0)){ + range = selection.getRangeAt(0); + } + } + range.selectNode(element); + selection.removeAllRanges(); + selection.addRange(range); + } + }else{ + // IE6-8 + try{ + var tg = element.tagName ? element.tagName.toLowerCase() : ""; + if(tg === "img" || tg === "table"){ + range = win.body(doc).createControlRange(); + }else{ + range = win.body(doc).createRange(); + } + range.addElement(element); + if(!nochangefocus){ + range.select(); + } + }catch(e){ + this.selectElementChildren(element, nochangefocus); + } + } + }, + + inSelection: function(node){ + // summary: + // This function determines if 'node' is + // in the current selection. + // tags: + // public + if(node){ + var newRange; + var doc = win.doc; + var range; + + if(win.doc.getSelection){ + // WC3 + var sel = win.global.getSelection(); + if(sel && sel.rangeCount > 0){ + range = sel.getRangeAt(0); + } + if(range && range.compareBoundaryPoints && doc.createRange){ + try{ + newRange = doc.createRange(); + newRange.setStart(node, 0); + if(range.compareBoundaryPoints(range.START_TO_END, newRange) === 1){ + return true; + } + }catch(e){ /* squelch */} + } + }else{ + // IE6-8, so we can't use the range object as the pseudo + // range doesn't implement the boundary checking, we have to + // use IE specific crud. + range = doc.selection.createRange(); + try{ + newRange = node.ownerDocument.body.createControlRange(); + if(newRange){ + newRange.addElement(node); + } + }catch(e1){ + try{ + newRange = node.ownerDocument.body.createTextRange(); + newRange.moveToElementText(node); + }catch(e2){/* squelch */} + } + if(range && newRange){ + // We can finally compare similar to W3C + if(range.compareEndPoints("EndToStart", newRange) === 1){ + return true; + } + } + } + } + return false; // Boolean + } +}; + + +lang.setObject("dijit._editor.selection", selection); + +return selection; +}); |