Edit C:\Program Files (x86)\Tencent\TIM\Misc\Editor\release\editor_toolbar.js
(function(A,_aoUndefined){A.extend(QMEditor.CONST.LANGUAGE.zh_CN,{FUN_SEPERATE:"???",FUN_BOLD:"??",FUN_ITALIC:"??",FUN_UNDERLINE:"???",FUN_FONTNAME:"????",FUN_FONTSIZE:"??????",FUN_FORECOLOR:"??????",FUN_BACKCOLOR:"??????",FUN_ALIGNMODE:"??????",FUN_SERIAL:"????",FUN_INDENT:"????",FUN_QUOT:"????",FUN_CREATELINK:"????",FUN_SOURCEEDIT:"??HTML??",FS_XXSMALL:"10",FS_XSMALL:"12",FS_SMALL:"14",FS_MEDIUM:"16",FS_LARGE:"18",FS_XLARGE:"24",FS_XXLARGE:"36",AM_LEFT:"???",AM_CENTER:"????",AM_RIGHT:"???",SL_NUMBER:"????",SL_PROJECT:"????",IT_INDENT:"????",IT_OUTDENT:"????",CL_NAME:"???",CL_LINK:"???",CL_MODIFY:"??",CL_DELETE:"??",CL_CONFIRM:"??",CL_CANCEL:"??",CL_NAME_DEF:"????????",SE_PREVIEW:"???????"});A.extend(QMEditor.CONST.getTemplate(),{_MENU_STATUS_ITEM:A.T(['<div class="qmEditorMenuStatusItem unselect" unselectable="on" style="$style$">$content$</div>']),_MENU_ICON_STATUS_ITEM:A.T(['<div class="qmEditorMenuIconStatusItem qmEditor$cmd$ unselect" unselectable="on" style="$style$">','<input class="qmEditorIcon" type="button" unselectable="on">','<span style="vertical-align:super;padding-left:2px;">$content$</span>',"</div>"]),_MENU_COLOR_CNTR:A.T(['<div id="qmEditorMenuColorCntr" class="unselect" unselectable="on">$html$</div>']),_MENU_COLOR:A.T(['<div class="qmEditorMenuItem" id="$id$" param="$color$" title="$color$" style="float:left;width:auto;height:auto;" unselectable="on" $event$ >','<div class="qmEditorMenuColor" param="$color$" style="background:$color$;" unselectable="on"></div>',"</div>"]),_MENU_BREAKLINE:A.T(['<br style="clear:both;">']),_MENU_SELECT_ITEM:A.T(["<b>»</b> $content$"]),_MENU_CREATELINK:A.T(['<div class="qmEditorMenuPanel" unselectable="on" style="background-color:transparent;">','<div id="name_cntr" class="qmEditorLinkDiv" unselectable="on" >','$langName$<input id="name" type="text" role="textbox" aria-label="??" aria-autocomplete="inline" tabindex="1001"/> ',"</div>",'<div id="link_cntr" class="qmEditorLinkDiv" unselectable="on" >','$langLink$<input id="link" type="text" role="textbox" aria-label="??" aria-autocomplete="inline" tabindex="1002"/>',"</div>",'<div class="qmEditorLinkButton" unselectable="on" >','<a id="modify" class="btn_gray qmEditorLinkBtn" tabindex="1003">$langModify$</a>','<a id="delete" class="btn_gray qmEditorLinkBtn" tabindex="1004">$langDelete$</a>','<a id="confirm" class="btn_gray qmEditorLinkBtn" role="button" aria-label="??" tabindex="1005">$langConfirm$</a>','<a id="cancel" class="btn_gray qmEditorLinkBtn" role="button" aria-label="??" tabindex="1006">$langCancel$</a>',"</div>","</div>"]),BOTTON_ICON_SOURCEEDIT:A.TE(['<div class="qmEditorBtnA" style="$ui.style$;padding-left:0;" ',' unselectable="on" onmousedown="return false;" title="$title$" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'"><HTML></div>']),SOURCEEDIT_TOOLBAR:A.TE(['<div class="qmEditorBtnA" style="float:right;padding:2px 5px 0 0;* padding:3px 5px 0 0;" unselectable="on" onmousedown="return false;" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" title="$formatTitle$" >','<span style="display:none;">',"$langFormatting$<span></span>","</span>","<span>$langFormat$</span>","</div>",'<div class="qmEditorBtnA qmEditorFormatBtn" unselectable="on" onmousedown="return false;" title="$previewTitle$" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'">',"$langPreview$<b>»</b>","</div>"]),BOTTON_ICON_PREVIEW:A.TE(['<div class="qmEditorBtnA" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" style="$ui.style$;padding-left:0;" ',' unselectable="on" onmousedown="return false;" title="$title$" >$ui.langPreview$</div>']),BOTTON_ICON_UPLOADEML:A.TE(['<div class="qmEditorBtnA" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" style="$ui.style$;padding-left:0;" ',' unselectable="on" onmousedown="return false;" title="$ui.title$" >$ui.langUploadEml$</div>'])});QMEditor.prototype._isCollapsed=function(){var _oEditWin=this.getEditWin();if(_oEditWin.getSelection){var _oSelection=_oEditWin.getSelection();return _oSelection.isCollapsed||_oSelection.getRangeAt(0).collapsed}else{return this.getEditDoc().selection.type=="None"}};QMEditor.prototype._hasAncestorNode=function(_asNodeTagName){var _oSelf=this,_oEditWin=_oSelf.getEditWin(),_oNode=_oSelf.getSelectionElement(),_oTestNode=_oNode,_bIsIEorChrome=A.gbIsIE||A.gbIsOpera;while(_oTestNode&&_oTestNode.nodeName!=_asNodeTagName){_oTestNode=_oTestNode.parentNode}if(_oTestNode){return true}if(this._isCollapsed()){return false}if(!_bIsIEorChrome){var _oPreviousNode=_oNode.previousSibling,_oNextNode=_oNode.nextSibling;if(_oPreviousNode&&_oPreviousNode.nodeName==_asNodeTagName){var _bResult=_oEditWin.getSelection().containsNode(_oPreviousNode,true);if(_bResult){return true}}if(_oNextNode&&_oNextNode.nodeName==_asNodeTagName){var _bResult=_oEditWin.getSelection().containsNode(_oNextNode,true);if(_bResult){return true}}}(function(_aoNode){if(!_aoNode){return}if(_aoNode.nodeName==_asNodeTagName){_oTestNode=_aoNode;return}for(var _curNode=_aoNode.firstChild,_nextNode;_curNode;_curNode=_nextNode){_nextNode=_curNode.nextSibling;arguments.callee(_curNode)}})(_bIsIEorChrome?_oNode.parentNode:_oNode);return!!_oTestNode};QMEditor.prototype.changeEditMode=function(_asEditMode){var _smEditMode=this.getEditMode();if(_smEditMode=="text"){return false}if(_smEditMode==_asEditMode){return true}var _bIsCode=_asEditMode=="source",_sEditMode=_bIsCode?"source":"html",_oSrceBody=this.getSrceBody(),_oEditObj=this.getEditObj();if(A.gbIsWebKit){(_bIsCode?this.getEditBody():_oSrceBody).blur()}_oEditObj.style.display=_bIsCode?"none":"block";_oSrceBody.style.display=_bIsCode?"block":"none";A.show(this.getRichToolBarObj(),!_bIsCode);A.show(this.getSrceToolBarObj(),_bIsCode);this.setEditContent(_sEditMode,this.getEditContent(_bIsCode?"html":"source"));this.setEditMode(_sEditMode);this.focus(0)};QMEditor.FUNCLIB._MENUSTATUS=QMEditor.FUNCLIB.inheritFrom(function(){this.setId("MENUSTATUS");this._msMenuItemTmpl=QMEditor.CONST.getTemplate()._MENU_STATUS_ITEM},QMEditor.FUNCLIB.MENU);QMEditor.FUNCLIB._MENUSTATUS.prototype.getMenuItems=function(){if(!this._moItemDatas){var _oMenuDatas=this._moMenuData,_oTmpl=this._msMenuItemTmpl,_sProp=this.getCmd()?"param":"cmd",_oItemDatas=[];for(var i=0,_nLen=_oMenuDatas.length,_oData;i<_nLen;i++){_oData=_oMenuDatas[i];_oItemDatas[i]={sId:i,sParam:_oData[_sProp],label:_oData["label"],nHeight:_oData.height||"auto",sItemValue:_oTmpl.replace(_oData)}}this._moItemDatas=_oItemDatas}return this._moItemDatas};QMEditor.FUNCLIB._MENUSTATUS.prototype.initMenu=function(_aoMenu){var _oSelf=this,_oBindEditor=_oSelf.getBindEditor(),_sCmd=_oSelf.getCmd();if(_sCmd){var _sValue=_oBindEditor.queryCmdValue(_sCmd),_sId=_oSelf.transValueToid(_sValue);_sValue&&_aoMenu.selectItem(_sId)}else{A.E(_oSelf._moMenuData,function(_aoData){_aoMenu.itemOption(_aoData.cmd,"bDisSelect",!_oBindEditor.queryCmdEnabled(_aoData.cmd))})}var _oMenuAll=_aoMenu.S("_menuall_");_oMenuAll.setAttribute('role',"listbox");_oMenuAll.setAttribute('tabindex',"-1");var _childNodes=_oMenuAll.childNodes;for(var i=0,len=_childNodes.length;i<len;i++){var _sId=_childNodes[i].id||"";if(_sId.indexOf('_menuitem_')>-1){_childNodes[i].setAttribute('role',"option");_childNodes[i].setAttribute('aria-label',_oSelf._moItemDatas[i]["label"]);_childNodes[i].setAttribute('tabindex',"-1")}}};QMEditor.FUNCLIB._MENUSTATUS.prototype.doItemClick=function(_asId){var _oSelf=this,_oBindEditor=_oSelf.getBindEditor(),_sCmd=_oSelf.getCmd();_sCmd?_oBindEditor.execCmd(_sCmd,_asId):_oBindEditor.execCmd(_asId)};QMEditor.FUNCLIB._MENUSTATUS.prototype.transValueToid=function(_sValue){return _sValue};QMEditor.FUNCLIB._MENUICONSTATUS=QMEditor.FUNCLIB.inheritFrom(function(){this.setId("MENUICONSTATUS");this._msMenuItemTmpl=QMEditor.CONST.getTemplate()._MENU_ICON_STATUS_ITEM},QMEditor.FUNCLIB._MENUSTATUS);QMEditor.FUNCLIB._MENUCOLOR=QMEditor.FUNCLIB.inheritFrom(function(){this.setId("MENUCOLOR");this._moCurSelItem=null;this._moMenuData=["#000000 #993300 #333300 #003300 #003366 #000080 #333399 #333333","#800000 #FF6600 #808000 #008000 #008080 #0000FF #666699 #808080","#FF0000 #FF9900 #99CC00 #339966 #33CCCC #3366FF #800080 #999999","#FF00FF #FFCC00 #FFFF00 #00FF00 #00FFFF #00CCFF #993366 #C0C0C0","#FF99CC #FFCC99 #FFFF99 #CCFFCC #CCFFFF #99CCFF #CC99FF #FFFFFF"];this._moBidiMapValue={};for(var i=0,len=this._moMenuData.length;i<len;i++){var _array=this._moMenuData[i].split(" ");for(var j=0,_len=_array.length;j<_len;j++){var _sValue=_array[j].replace('#','C');this._moBidiMapValue[_sValue]=i*8+j;this._moBidiMapValue[i*8+j]=_sValue}}},QMEditor.FUNCLIB.MENU);QMEditor.FUNCLIB._MENUCOLOR.prototype.getMenuUI=function(_aoMenuCfg){var _oEditor=this.getBindEditor(),_oTemplate=_oEditor.getTemplate(),_oDefTmpl=_oTemplate._MENU_COLOR,_oEventTmpl=_oTemplate._MENU_ITEM_EVENT,_oBklineTmpl=_oTemplate._MENU_BREAKLINE,_oHtml=[];_aoMenuCfg.bAutoClose=true;A.E(this._moMenuData,function(_aoData){A.E(_aoData.split(" "),function(_aoData){_oHtml.push(_oDefTmpl.replace({id:_aoData.replace("#","C"),color:_aoData,event:_oEventTmpl}))});_oHtml.push(_oBklineTmpl)});return _oTemplate._MENU_COLOR_CNTR.replace({html:_oHtml.join("")})};QMEditor.FUNCLIB._MENUCOLOR.prototype.initMenu=function(_aoMenu){var _oSelf=this,_sCmd=_oSelf.getCmd(),_oEditor=_oSelf.getBindEditor(),_sValue=_oEditor.queryCmdValue(_sCmd);var _oMenuAll=_aoMenu.S("_menuall_"),_oColorCntr=_aoMenu.S("qmEditorMenuColorCntr");_oMenuAll.setAttribute('role',"listbox");_oMenuAll.setAttribute('tabindex',"-1");var _childNodes=_oColorCntr.childNodes;for(var i=0,len=_childNodes.length;i<len;i++){var _sId=_childNodes[i].id||"";if(_sId.indexOf('_menuitem_')>-1){_childNodes[i].setAttribute('role',"option");_childNodes[i].setAttribute('aria-label',_oSelf._moItemDatas[i]["label"]);_childNodes[i].setAttribute('tabindex',"-1")}}function _findItem(_oItem,_nDirection){if(!_oItem)return null;var _param=_oItem.getAttribute("param"),_sValue=_param.replace('#','C'),_nItemValue=_oSelf._moBidiMapValue[_sValue];switch(_nDirection){case 0:_nItemValue-=8;break;case 1:_nItemValue-=1;break;case 2:_nItemValue+=8;break;case 3:_nItemValue+=1;break}if(_nItemValue>=0&&_nItemValue<40){var _sItemValue=_oSelf._moBidiMapValue[_nItemValue];return _aoMenu.S(_sItemValue)}return null}function _selectItem(_oItem){if(_oItem){var _oCurSelItem=_oSelf._moCurSelItem,_sClassName=_oCurSelItem.getAttribute('curclass')||'qmEditorMenuItem';if(_oCurSelItem.className!=_sClassName){_oCurSelItem.className=_sClassName}if(_oItem.className!='QMEditorMenuItemDisabled'&&_oItem.className!='qmEditorMenuItemOver'){_oItem.className='qmEditorMenuItemOver'}_oSelf._moCurSelItem=_oItem}}A.addEvent(_aoMenu.S("qmEditorMenuColorCntr"),"click",function(_aoEvent){var _sValue=A.getEventTarget(_aoEvent).getAttribute("param");if(_sValue){_oSelf.hideMenu();_oEditor.execCmd(_sCmd,_sValue)}});_aoMenu.setKeyDownProxy(function(_aoEvent){var _oItem,_oCurSelItem=_oSelf._moCurSelItem;switch(_aoEvent.keyCode){case 37:{_oItem=_findItem(_oCurSelItem,1);_selectItem(_oItem)}break;case 38:{_oItem=_findItem(_oCurSelItem,0);_selectItem(_oItem)}break;case 39:{_oItem=_findItem(_oCurSelItem,3);_selectItem(_oItem)}break;case 40:{_oItem=_findItem(_oCurSelItem,2);_selectItem(_oItem)}break;case 13:{var _sValue=_oCurSelItem.getAttribute("param");if(_sValue){_oSelf.hideMenu();_oEditor.execCmd(_sCmd,_sValue)}}break;case 9:case 27:{_oSelf.hideMenu()}break}});if(typeof _sValue=="string"){var _oValueParts=_sValue.substring(4,_sValue.length-1).split(",");for(var i=0,_nLen=_oValueParts.length;i<_nLen;i++){_oValueParts[i]=parseInt(A.trim(_oValueParts[i])).toString(16);if(_oValueParts[i].length==1){_oValueParts[i]="0"+_oValueParts[i]}}_sValue=_oValueParts.join("")}else if(typeof _sValue=="number"){_oValueParts=[_sValue.toString(16)];for(var i=0,_nLen=6-_oValueParts[0].length;i<_nLen;i++){_oValueParts.unshift("0")}_oValueParts=_oValueParts.join("").split("");var _sTmp=_oValueParts[0];_oValueParts[0]=_oValueParts[4];_oValueParts[4]=_sTmp;_sTmp=_oValueParts[1];_oValueParts[1]=_oValueParts[5];_oValueParts[5]=_sTmp;_sValue=_oValueParts.join("")}else{return}_sValue="#"+_sValue;var _oTmpl=_oEditor.getTemplate()._MENU_SELECT_ITEM;_sValue=_sValue.toString().toUpperCase();(this._moCurSelItem=_aoMenu.S(_sValue.replace("#","C"))||{}).className="qmEditorMenuItemCheck"};QMEditor.FUNCLIB.Bold=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Bold");this.setCmd("Bold");this.setType("btn");this.setBindEditor(_aoParamSet.editor);this.setUiConfig(A.extend(this.getUiConfig(),{title:this.getBindEditor().getLanguage().FUN_BOLD,label:this.getBindEditor().getLanguage().FUN_BOLD}));this.setfOnKeyDown(function(_aoEvent){if(_aoEvent.ctrlKey&&_aoEvent.keyCode==66){this.getfDoDefaultClick()();A.preventDefault(_aoEvent)}})},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.Italic=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Italic");this.setCmd("Italic");this.setType("btn");this.setBindEditor(_aoParamSet.editor);this.setUiConfig({title:this.getBindEditor().getLanguage().FUN_ITALIC,label:this.getBindEditor().getLanguage().FUN_ITALIC});this.setfOnKeyDown(function(_aoEvent){if(_aoEvent.ctrlKey&&_aoEvent.keyCode==73){this.getfDoDefaultClick()();A.preventDefault(_aoEvent)}})},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.Underline=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Underline");this.setCmd("Underline");this.setType("btn");this.setBindEditor(_aoParamSet.editor);this.setUiConfig({title:this.getBindEditor().getLanguage().FUN_UNDERLINE,label:this.getBindEditor().getLanguage().FUN_UNDERLINE});this.setfOnKeyDown(function(_aoEvent){if(_aoEvent.ctrlKey&&_aoEvent.keyCode==85){this.getfDoDefaultClick()();A.preventDefault(_aoEvent)}})},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.Separate=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Separate");this.setType("label");this.setBindEditor(_aoParamSet.editor);this.setUiConfig({title:this.getBindEditor().getLanguage().FUN_SEPERATE})},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.FontName=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("FontName");this.setCmd("FontName");this.setBindEditor(_aoParamSet.editor);this.setUiConfig({id:A.unikey("qmEditorFontName_"),title:this.getBindEditor().getLanguage().FUN_FONTNAME,label:this.getBindEditor().getLanguage().FUN_FONTNAME,defaultValue:"????",sClassName:"qmEditorComboBoxContainer"});var _oCNMenu=[{param:"??",label:"??",style:"font-family:??",content:"??"},{param:"??",label:"??",style:"font-family:??",content:"??"},{param:"??,??_GB2312",label:"??,??_GB2312",style:"font-family:??,??_GB2312",content:"??"},{param:"????",label:"????",style:"font-family:Microsoft YaHei",content:"????"},{param:"??",label:"??",style:"font-family:??",content:"??"}],_oPublicMenu=[{param:"Arial",label:"Arial",style:"font-family:Arial",content:"Arial"},{param:"Arial Black",label:"Arial Black",style:"font-family:Arial Black;",content:"Arial Black"},{param:"Arial Unicode MS",label:"Arial Unicode MS",style:"font-family:Arial Unicode MS;",content:"Arial Unicode MS"},{param:"Times New Roman",label:"Times New Roman",style:"font-family:Times New Roman",content:"Times New Roman"},{param:"Verdana",label:"Verdana",style:"font-family:Verdana",content:"Verdana"}];if(A.getLocale()=="zh_CN"){this._moMenuData=_oCNMenu.concat(_oPublicMenu)}else{this._moMenuData=_oPublicMenu}this.makeStyleMapping();this.addListener(function(_sId,_asId){if(_sId=="FontName"){var _sFontName=_asId.split(",")[0],_oUiCfg=this.getUiConfig();var _oFontComboBtn=$(_oUiCfg.id);_oFontComboBtn.innerText=_sFontName;_oFontComboBtn.style.fontFamily=this._moStyleMap[_asId]}})},QMEditor.FUNCLIB._MENUSTATUS);QMEditor.FUNCLIB.FontName.prototype.init_=function(){var _oSelf=this,_sFontName="????",_oBindEditor=_oSelf.getBindEditor(),_sCmd=_oSelf.getCmd();_sCmd?_oBindEditor.execCmd(_sCmd,_sFontName):_oBindEditor.execCmd(_sFontName)};QMEditor.FUNCLIB.FontName.prototype.makeStyleMapping=function(){if(!this._moStyleMap){this._moStyleMap={};for(var i in this._moMenuData){this._moStyleMap[this._moMenuData[i].param]=this._moMenuData[i].param}}};QMEditor.FUNCLIB.FontName.prototype.transValueToid=function(_sValue){var _sId;_sValue=_sValue.replace(/[\s]*/gi,"");for(var i=0,len=this._moItemDatas.length;i<len;i++){if(_sValue==this._moItemDatas[i]["sParam"]){return i}}return _sValue};QMEditor.FUNCLIB.FontSize=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("FontSize");this.setCmd("FontSize");this.setBindEditor(_aoParamSet.editor);var _oLanguage=this.getBindEditor().getLanguage();this.setUiConfig({id:A.unikey("qmEditorFontSize_"),title:_oLanguage.FUN_FONTSIZE,label:_oLanguage.FUN_FONTSIZE,extendClass:"qmEditorComboBtnFontSize",defaultValue:_oLanguage.FS_SMALL,width:70,sClassName:"qmEditorComboBoxContainer"});this._moMenuData=[{param:"1",label:"10px",style:"font-size:10px;",content:_oLanguage.FS_XXSMALL},{param:"2",label:"12px",style:"font-size:12px;",content:_oLanguage.FS_XSMALL},{param:"3",label:"14px",style:"font-size:14px;",content:_oLanguage.FS_SMALL},{param:"4",label:"16px",style:"font-size:16px;",content:_oLanguage.FS_MEDIUM},{param:"5",label:"18px",style:"font-size:18px;",content:_oLanguage.FS_LARGE},{param:"6",label:"24px",style:"font-size:24px;",content:_oLanguage.FS_XLARGE},{param:"7",label:"36px",style:"font-size:36px;",content:_oLanguage.FS_XXLARGE}];this.makeContentMapping();this.addListener(function(_sId,_asId){if(_sId=="FontSize"){var _sFontSize=this._moContentMap[_asId],_oUiCfg=this.getUiConfig();var _oFontComboBtn=$(_oUiCfg.id);_oFontComboBtn.innerText=_sFontSize}})},QMEditor.FUNCLIB._MENUSTATUS);QMEditor.FUNCLIB.FontSize.prototype.init_=function(){var _oSelf=this,_sFontSize="3",_oBindEditor=_oSelf.getBindEditor(),_sCmd=_oSelf.getCmd();_sCmd?_oBindEditor.execCmd(_sCmd,_sFontSize):_oBindEditor.execCmd(_sFontName);var _oFontComboBtn=$("qmEditorFontSize_");_oFontComboBtn.innerText=this._moContentMap["3"]};QMEditor.FUNCLIB.FontSize.prototype.makeContentMapping=function(){if(!this._moContentMap){this._moContentMap={};for(var i in this._moMenuData){this._moContentMap[this._moMenuData[i].param]=this._moMenuData[i].content}}};QMEditor.FUNCLIB.ForeColor=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("ForeColor");this.setCmd("ForeColor");this.setBindEditor(_aoParamSet.editor);this.setUiConfig({title:this.getBindEditor().getLanguage().FUN_FORECOLOR,label:this.getBindEditor().getLanguage().FUN_FORECOLOR})},QMEditor.FUNCLIB._MENUCOLOR);QMEditor.FUNCLIB.BackColor=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("BackColor");this.setCmd(A.gbIsIE||A.gbIsWebKit?this.getId():"hilitecolor");this.setBindEditor(_aoParamSet.editor);this.setUiConfig({title:this.getBindEditor().getLanguage().FUN_BACKCOLOR,label:this.getBindEditor().getLanguage().FUN_BACKCOLOR})},QMEditor.FUNCLIB._MENUCOLOR);QMEditor.FUNCLIB.AlignMode=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("AlignMode");this.setBindEditor(_aoParamSet.editor);var _oLanguage=this.getBindEditor().getLanguage();this.setUiConfig({title:_oLanguage.FUN_ALIGNMODE,label:_oLanguage.FUN_ALIGNMODE});this._moMenuData=[{cmd:"JustifyLeft",content:_oLanguage.AM_LEFT,label:_oLanguage.AM_LEFT},{cmd:"JustifyCenter",content:_oLanguage.AM_CENTER,label:_oLanguage.AM_CENTER},{cmd:"JustifyRight",content:_oLanguage.AM_RIGHT,label:_oLanguage.AM_RIGHT}]},QMEditor.FUNCLIB._MENUICONSTATUS);QMEditor.FUNCLIB.Serial=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Serial");this.setBindEditor(_aoParamSet.editor);var _oLanguage=this.getBindEditor().getLanguage();this.setUiConfig({title:_oLanguage.FUN_SERIAL,label:_oLanguage.FUN_SERIAL});this._moMenuData=[{cmd:"InsertorDeredlist",content:_oLanguage.SL_NUMBER,label:_oLanguage.SL_NUMBER},{cmd:"InsertunorDeredlist",content:_oLanguage.SL_PROJECT,label:_oLanguage.SL_PROJECT}]},QMEditor.FUNCLIB._MENUICONSTATUS);QMEditor.FUNCLIB.Outdent=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Outdent");this.setType("btn");this.setCmd("Outdent");this.setBindEditor(_aoParamSet.editor);var _oLanguage=this.getBindEditor().getLanguage();this.setUiConfig({title:_oLanguage.IT_OUTDENT,label:_oLanguage.IT_OUTDENT})},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.Outdent.prototype.init_=function(){var _oContainer=this.getContainer();_oContainer.onmousedown=function(_aoEvent){var _oObj=_oContainer.firstChild;A.setClass(_oObj,_oObj.className.replace(" qmEditorBtnIconCheck","")+" qmEditorBtnIconCheck")};_oContainer.onmouseup=function(_aoEvent){var _oObj=_oContainer.firstChild;A.setClass(_oObj,_oObj.className.replace(" qmEditorBtnIconCheck","")+"")}};QMEditor.FUNCLIB.Indent=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("Indent");this.setType("btn");this.setCmd("Indent");this.setBindEditor(_aoParamSet.editor);var _oLanguage=this.getBindEditor().getLanguage();this.setUiConfig({title:_oLanguage.IT_INDENT,label:_oLanguage.IT_INDENT})},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.Indent.prototype.init_=function(){var _oContainer=this.getContainer();_oContainer.onmousedown=function(_aoEvent){var _oObj=_oContainer.firstChild;A.setClass(_oObj,_oObj.className.replace(" qmEditorBtnIconCheck","")+" qmEditorBtnIconCheck")};_oContainer.onmouseup=function(_aoEvent){var _oObj=_oContainer.firstChild;A.setClass(_oObj,_oObj.className.replace(" qmEditorBtnIconCheck","")+"")}};QMEditor.FUNCLIB.CreateLink=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){var _oSelf=this;_oSelf.setId("CreateLink");_oSelf.setCmd("CreateLink");_oSelf.setBindEditor(_aoParamSet.editor);_oSelf.setUiConfig({title:_oSelf.getBindEditor().getLanguage().FUN_CREATELINK,label:_oSelf.getBindEditor().getLanguage().FUN_CREATELINK})},QMEditor.FUNCLIB.MENU);QMEditor.FUNCLIB.CreateLink.prototype.getMenuUI=function(){var _oEditor=this.getBindEditor(),_oLanguage=_oEditor.getLanguage(),_oTemplate=_oEditor.getTemplate();return _oTemplate._MENU_CREATELINK.replace({langName:_oLanguage.CL_NAME,langLink:_oLanguage.CL_LINK,langModify:_oLanguage.CL_MODIFY,langDelete:_oLanguage.CL_DELETE,langConfirm:_oLanguage.CL_CONFIRM,langCancel:_oLanguage.CL_CANCEL})};QMEditor.FUNCLIB.CreateLink.prototype.initMenu=function(_aoMenu){var _oSelf=this,_oEditor=_oSelf.getBindEditor(),_bIsUnlink=_oEditor.queryCmdEnabled("Unlink");if(!_bIsUnlink&&_oEditor._moCurrentEditObj){_oEditor.loadLastRange();_bIsUnlink=_oEditor.queryCmdEnabled("Unlink")}var _bIsEnabledUnlink=_bIsUnlink&&_oEditor._hasAncestorNode("A"),_oLink=_oSelf._mbIsEnabledUnlink&&_oEditor.moveToAncestorNode("A"),_bIsCollapsed=_oEditor._moCurrentEditObj?false:_oEditor._isCollapsed();A.show(_aoMenu.S("name_cntr"),!_bIsEnabledUnlink&&_bIsCollapsed);A.show(_aoMenu.S("link_cntr"),!(_bIsEnabledUnlink&&!_oLink));A.show(_aoMenu.S("modify"),_oLink);A.show(_aoMenu.S("delete"),_bIsEnabledUnlink);A.show(_aoMenu.S("confirm"),!_bIsEnabledUnlink);_oLink&&_oLink.href&&(_oLinkText.value=_oLink.href);_aoMenu.setKeyDownProxy(function(_aoEvent){if(_aoEvent.keyCode==27){_oSelf.hideMenu();A.stopPropagation(_aoEvent);A.preventDefault(_aoEvent)}});var _sDefName=_aoMenu.S("name").value=_oEditor.getLanguage().CL_NAME_DEF;_aoMenu.S("name").className="qmEditorCLNameDef";_aoMenu.S("name").onfocus=function(){if(this.className!="qmEditorCLNameMdf"){this.className="qmEditorCLNameMdf";this.value=""}};_aoMenu.S("name").onblur=function(){if(!this.value){this.className="qmEditorCLNameDef";this.value=_sDefName}};_aoMenu.S('name').onkeydown=function(_aoEvent){if(_aoEvent.keyCode==9&&_aoEvent.shiftKey){_oSelf.hideMenu(true)}};_aoMenu.S("delete").onclick=function(){_oSelf.getBindEditor().loadLastRange();_oSelf.getBindEditor().execCmd("Unlink");_oSelf.hideMenu(true)};_aoMenu.S("modify").onclick=function(){_oSelf.getBindEditor().loadLastRange();_oLink.href=_oSelf._getLinkText();_oSelf.hideMenu(true)};_aoMenu.S("cancel").onkeydown=function(_aoEvent){if(_aoEvent.keyCode==13||(_aoEvent.keyCode==9&&!_aoEvent.shiftKey)){_oSelf.hideMenu(true)}};_aoMenu.S("confirm").onkeydown=function(_aoEvent){if(_aoEvent.keyCode==13){_oSelf.getMenu().S('confirm').click()}};_aoMenu.S("confirm").onclick=function(){var _oEditor=_oSelf.getBindEditor(),_oEditDoc=_oEditor.getEditDoc(),_oEditWin=_oEditor.getEditWin();_oEditor.loadLastRange();if(_bIsCollapsed){if(_oEditDoc.selection){_oEditor.focus();_oEditDoc.selection.createRange().pasteHTML(A.T('<a href="$url$">$name$</a>').replace({url:_oSelf._getLinkText(),name:_oSelf._getNameText()}))}else{var _oRange=_oEditWin.getSelection().getRangeAt(0),_oLink=_oEditDoc.createElement("a");_oLink.href=_oSelf._getLinkText();_oLink.innerHTML=_oSelf._getNameText();_oRange.insertNode(_oLink);_oRange.setStartAfter(_oLink);if(external){_oEditor.startEditContent();if(external.NotifyCommitHtmlContent)external.NotifyCommitHtmlContent()}}}else{_oEditor.execCmd(_oSelf.getCmd(),_oSelf._getLinkText())}_oSelf.hideMenu(true);_oSelf.getBindEditor().checkEditContentChange()};_aoMenu.S("cancel").onclick=function(){_oSelf.hideMenu(true)};A.addEvent(_aoMenu.S("name"),"keydown",function(_aoEvent){var _sKeyCode=_aoEvent.keyCode;if({13:1,27:1}[_sKeyCode]){A.stopPropagation(_aoEvent);A.preventDefault(_aoEvent)}_sKeyCode==13&&(_oSelf.getMenu().S("link").value?_oSelf.getMenu().S(!_bIsEnabledUnlink?"confirm":"modify").click():_oSelf.getMenu().S("link").focus());_sKeyCode==27&&_oSelf.hideMenu(true)});A.addEvent(_aoMenu.S("link"),"keydown",function(_aoEvent){var _sKeyCode=_aoEvent.keyCode;if({13:1,27:1}[_sKeyCode]){A.stopPropagation(_aoEvent);A.preventDefault(_aoEvent)}_sKeyCode==13&&_oSelf.getMenu().S(!_bIsEnabledUnlink?"confirm":"modify").click();_sKeyCode==27&&_oSelf.hideMenu(true)});_aoMenu=_oEditor=_aoUndefined};QMEditor.FUNCLIB.CreateLink.prototype.doMenuShow=function(_aoMenu){if(A.isShow(_aoMenu.S("link_cntr"))){_aoMenu.S("link").focus();_aoMenu.S("link").select()}};QMEditor.FUNCLIB.CreateLink.prototype._getLinkText=function(){var _sLinkValue=A.htmlEncode(this.getMenu().S("link").value);if(/[a-zA-Z_0-9.-]+@[a-zA-Z_0-9.-]+\.\w+/.test(_sLinkValue)){return A.trim(_sLinkValue).toLowerCase().indexOf("mailto")==0?_sLinkValue:"mailto:"+_sLinkValue}return A.trim(_sLinkValue).indexOf("://")==-1?"http://"+_sLinkValue:_sLinkValue};QMEditor.FUNCLIB.CreateLink.prototype._getNameText=function(){var _oNameText=this.getMenu().S("name");return _oNameText.className!="qmEditorCLNameDef"&&A.htmlEncode(_oNameText.value)||this._getLinkText()};QMEditor.FUNCLIB.SourceEdit=QMEditor.FUNCLIB.inheritFrom(function(_aoParamSet){this.setId("SourceEdit");this.setType("custom");this.setBindEditor(_aoParamSet.editor);var _oLanguage=this.getBindEditor().getLanguage();this.setUiConfig({title:_oLanguage.FUN_SOURCEEDIT,sourceToolBar:{formatTitle:_oLanguage.SE_FORMAT_TITLE,langFormat:_oLanguage.SE_FORMAT,previewTitle:_oLanguage.SE_PREVIEW_TITLE,langPreview:_oLanguage.SE_PREVIEW,langFormatting:_oLanguage.SE_FORMATTING}});this.setfOnClick(this._fDoDefaultClick);this.setfDoDefaultClick(this._fDoDefaultClick)},QMEditor.FUNCLIB.BASE);QMEditor.FUNCLIB.SourceEdit.prototype.setMouseOverEvent=function(_asUiType){};QMEditor.FUNCLIB.SourceEdit.prototype._fDoDefaultClick=function(_aoEvent){var _oEditor=this.getBindEditor(),_oSpellCheck=_oEditor.getToolBarInfo().SpellCheck;if(_oSpellCheck){_oSpellCheck._show(0,0,1)}this._setupSourceToolBar();_oEditor.hideMenu();_oEditor.changeEditMode("source")};QMEditor.FUNCLIB.SourceEdit.prototype._setupSourceToolBar=function(){var _oEditor=this.getBindEditor(),_srceToolBarObj=_oEditor.getSrceToolBarObj();if(_srceToolBarObj.getAttribute("setuped")=="true"){return false}_srceToolBarObj.innerHTML=_oEditor.getTemplate().SOURCEEDIT_TOOLBAR.replace(this.getUiConfig().sourceToolBar);_srceToolBarObj.setAttribute("setuped","true");this._setSourceToolBarEvent()};QMEditor.FUNCLIB.SourceEdit.prototype._setSourceToolBarEvent=function(){var _oSelf=this,_oEditor=this.getBindEditor(),_oFormatObj=_oEditor.getSrceToolBarObj().firstChild,_oPreviewObj=_oFormatObj.nextSibling;_oPreviewObj.onclick=function(){if(_oSelf._mnWaitLoadTimer){clearInterval(_oSelf._mnWaitLoadTimer)}_oEditor.changeEditMode("html");var _oSpellCheck=_oEditor.getToolBarInfo().SpellCheck;if(_oSpellCheck){_oSpellCheck._show(1,0,1)}};_oFormatObj.onclick=function(){_oSelf._formatCode()}};QMEditor.FUNCLIB.SourceEdit.prototype._formatCode=function(){var _oSelf=this;_oEditor=_oSelf.getBindEditor();if(!window.QMFormatter){_oEditor.loadFile({"../release/plus/formatter.js":true});if(_oSelf._mnWaitLoadTimer){return}this._mnWaitLoadTimer=setInterval(function(){_oSelf._formatCode()},500);return}if(this._mnWaitLoadTimer){clearInterval(this._mnWaitLoadTimer)}var _oFormatObj=_oEditor.getSrceToolBarObj().firstChild,_oRunObj=_oFormatObj.firstChild,_oSizeObj=_oRunObj.lastChild,_oBtnObj=_oFormatObj.lastChild;A.show(_oRunObj,true);A.show(_oBtnObj,false);_oFormatObj.className="qmEditorFormatting";_oSizeObj.innerHTML="0%";function _finish(_asResult){_oEditor.setEditContent("source",_asResult);A.show(_oRunObj,false);A.show(_oBtnObj,true);_oFormatObj.className="qmEditorBtnA"}function _process(_asProcessInfo){_oSizeObj.innerHTML=_asProcessInfo}QMFormatter.format(_oEditor.getEditContent("source"),_finish,_process)};(function(){QMEditor.setupFunc()})()})(QMEditorAdapter);
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de