@lingxiteam/lcdp-ueditor-react 1.0.3-alpha.18 → 1.0.3-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/es/LcdpUeditor.d.ts +2 -12
  2. package/es/LcdpUeditor.d.ts.map +1 -1
  3. package/es/LcdpUeditor.js +16 -107
  4. package/es/type.d.ts +0 -21
  5. package/es/type.d.ts.map +1 -1
  6. package/lib/LcdpUeditor.d.ts +2 -12
  7. package/lib/LcdpUeditor.js +16 -93
  8. package/lib/type.d.ts +0 -21
  9. package/package.json +3 -8
  10. package/ueditor-resource/dialogs/anchor/anchor.html +1 -1
  11. package/ueditor-resource/dialogs/attachment/attachment.html +3 -3
  12. package/ueditor-resource/dialogs/attachment/attachment.js +1 -1
  13. package/ueditor-resource/dialogs/audio/audio.js +1 -1
  14. package/ueditor-resource/dialogs/background/background.html +2 -2
  15. package/ueditor-resource/dialogs/background/background.js +1 -1
  16. package/ueditor-resource/dialogs/contentimport/contentimport.html +3 -3
  17. package/ueditor-resource/dialogs/contentimport/contentimport.js +1 -1
  18. package/ueditor-resource/dialogs/emotion/emotion.html +2 -2
  19. package/ueditor-resource/dialogs/emotion/emotion.js +1 -1
  20. package/ueditor-resource/dialogs/formula/formula.html +4 -4
  21. package/ueditor-resource/dialogs/formula/formula.js +1 -1
  22. package/ueditor-resource/dialogs/help/help.html +2 -2
  23. package/ueditor-resource/dialogs/help/help.js +1 -1
  24. package/ueditor-resource/dialogs/image/image.js +1 -1
  25. package/ueditor-resource/dialogs/insertframe/insertframe.html +1 -1
  26. package/ueditor-resource/dialogs/internal.js +1 -1
  27. package/ueditor-resource/dialogs/preview/preview.html +2 -2
  28. package/ueditor-resource/dialogs/scrawl/scrawl.html +2 -2
  29. package/ueditor-resource/dialogs/scrawl/scrawl.js +1 -1
  30. package/ueditor-resource/dialogs/searchreplace/searchreplace.html +2 -2
  31. package/ueditor-resource/dialogs/searchreplace/searchreplace.js +1 -1
  32. package/ueditor-resource/dialogs/spechars/spechars.html +2 -2
  33. package/ueditor-resource/dialogs/spechars/spechars.js +1 -1
  34. package/ueditor-resource/dialogs/table/edittable.html +2 -2
  35. package/ueditor-resource/dialogs/table/edittable.js +1 -1
  36. package/ueditor-resource/dialogs/table/edittd.html +1 -1
  37. package/ueditor-resource/dialogs/table/edittip.html +1 -1
  38. package/ueditor-resource/dialogs/template/template.html +2 -2
  39. package/ueditor-resource/dialogs/template/template.js +1 -1
  40. package/ueditor-resource/dialogs/video/video.js +1 -1
  41. package/ueditor-resource/dialogs/wordimage/wordimage.html +4 -4
  42. package/ueditor-resource/dialogs/wordimage/wordimage.js +1 -1
  43. package/ueditor-resource/plugins/demo/demo.js +1 -3
  44. package/ueditor-resource/themes/default/css/ueditor.css +1 -1
  45. package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +3 -3
  46. package/ueditor-resource/third-party/clipboard/clipboard.js +1 -1
  47. package/ueditor-resource/third-party/codemirror/codemirror.js +2 -3
  48. package/ueditor-resource/third-party/jquery-3.5.1.js +3 -3
  49. package/ueditor-resource/third-party/jquery-3.5.1_1.js +3 -3
  50. package/ueditor-resource/ueditor.all.js +19 -22
  51. package/ueditor-resource/ueditor.config.js +1 -1
  52. package/ueditor-resource/ueditor.parse.js +1 -1
  53. package/es/ToolBottomBar/FormatModal/index.d.ts +0 -9
  54. package/es/ToolBottomBar/FormatModal/index.d.ts.map +0 -1
  55. package/es/ToolBottomBar/FormatModal/index.js +0 -543
  56. package/es/ToolBottomBar/FormatModal/index.less +0 -276
  57. package/es/ToolBottomBar/ProgressModal/index.d.ts +0 -10
  58. package/es/ToolBottomBar/ProgressModal/index.d.ts.map +0 -1
  59. package/es/ToolBottomBar/ProgressModal/index.js +0 -53
  60. package/es/ToolBottomBar/ProgressModal/index.less +0 -16
  61. package/es/ToolBottomBar/index.d.ts +0 -33
  62. package/es/ToolBottomBar/index.d.ts.map +0 -1
  63. package/es/ToolBottomBar/index.js +0 -296
  64. package/es/ToolBottomBar/index.less +0 -75
  65. package/es/icon/ExportPDF.d.ts +0 -3
  66. package/es/icon/ExportPDF.d.ts.map +0 -1
  67. package/es/icon/ExportPDF.js +0 -24
  68. package/es/icon/TextCopy.d.ts +0 -3
  69. package/es/icon/TextCopy.d.ts.map +0 -1
  70. package/es/icon/TextCopy.js +0 -25
  71. package/es/icon/TextFileIcon.d.ts +0 -3
  72. package/es/icon/TextFileIcon.d.ts.map +0 -1
  73. package/es/icon/TextFileIcon.js +0 -26
  74. package/es/icon/TextIcon.d.ts +0 -3
  75. package/es/icon/TextIcon.d.ts.map +0 -1
  76. package/es/icon/TextIcon.js +0 -28
  77. package/es/tools/exportPDF.d.ts +0 -27
  78. package/es/tools/exportPDF.d.ts.map +0 -1
  79. package/es/tools/exportPDF.js +0 -146
  80. package/es/tools/generateStylesFromSettings.d.ts +0 -38
  81. package/es/tools/generateStylesFromSettings.d.ts.map +0 -1
  82. package/es/tools/generateStylesFromSettings.js +0 -24
  83. package/lib/ToolBottomBar/FormatModal/index.d.ts +0 -9
  84. package/lib/ToolBottomBar/FormatModal/index.js +0 -261
  85. package/lib/ToolBottomBar/FormatModal/index.less +0 -276
  86. package/lib/ToolBottomBar/ProgressModal/index.d.ts +0 -10
  87. package/lib/ToolBottomBar/ProgressModal/index.js +0 -73
  88. package/lib/ToolBottomBar/ProgressModal/index.less +0 -16
  89. package/lib/ToolBottomBar/index.d.ts +0 -33
  90. package/lib/ToolBottomBar/index.js +0 -235
  91. package/lib/ToolBottomBar/index.less +0 -75
  92. package/lib/icon/ExportPDF.d.ts +0 -3
  93. package/lib/icon/ExportPDF.js +0 -57
  94. package/lib/icon/TextCopy.d.ts +0 -3
  95. package/lib/icon/TextCopy.js +0 -39
  96. package/lib/icon/TextFileIcon.d.ts +0 -3
  97. package/lib/icon/TextFileIcon.js +0 -39
  98. package/lib/icon/TextIcon.d.ts +0 -3
  99. package/lib/icon/TextIcon.js +0 -39
  100. package/lib/tools/exportPDF.d.ts +0 -27
  101. package/lib/tools/exportPDF.js +0 -95
  102. package/lib/tools/generateStylesFromSettings.d.ts +0 -38
  103. package/lib/tools/generateStylesFromSettings.js +0 -77
  104. package/ueditor-resource/plugins/browser-image-compression.js +0 -9
@@ -1,2 +1,2 @@
1
1
  /*! UEditorPlus v2.0.0*/
2
- !function(){function getUEBasePath(docUrl,confUrl){return getBasePath(docUrl||self.document.URL||self.location.href,confUrl||getConfigFilePath())}function getConfigFilePath(){var configPath=document.getElementsByTagName("script");return configPath[configPath.length-1].src}function getBasePath(docUrl,confUrl){var basePath=confUrl;return/^(\/|\\\\)/.test(confUrl)?basePath=/^.+?\w(\/|\\\\)/.exec(docUrl)[0]+confUrl.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(confUrl)||(docUrl=docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""),basePath=docUrl+""+confUrl),optimizationPath(basePath)}function optimizationPath(path){var protocol=/^[a-z]+:\/\//.exec(path)[0],tmp=null,res=[];for(path=path.replace(protocol,"").split("?")[0].split("#")[0],path=path.replace(/\\/g,"/").split(/\//),path[path.length-1]="";path.length;)".."===(tmp=path.shift())?res.pop():"."!==tmp&&res.push(tmp);return protocol+res.join("/")}var URL,CORS_URL;URL=window.UEDITOR_HOME_URL?window.UEDITOR_HOME_URL:window.__msCDN?window.__msCDN+"asset/vendor/ueditor/":window.__msRoot?window.__msRoot+"asset/vendor/ueditor/":getUEBasePath(),CORS_URL=window.UEDITOR_CORS_URL?window.UEDITOR_CORS_URL:window.__msRoot?window.__msRoot+"asset/vendor/ueditor/":window.UEDITOR_HOME_URL?window.UEDITOR_HOME_URL:getUEBasePath(),window.UEDITOR_CONFIG={UEDITOR_HOME_URL:URL,UEDITOR_CORS_URL:CORS_URL,debug:!1,serverUrl:"/ueditor-plus/_demo_server/handle.php",serverHeaders:{},toolbars:[["fullscreen","source","|","undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imagecenter","imageright","|","simpleupload","insertimage","insertvideo","insertaudio","attachment","insertframe","insertcode","pagebreak","background","|","horizontal","date","time","spechars","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","|","print"]],toolbarCallback:function(cmd,editor){},imageConfig:{disableUpload:!0,disableOnline:!0,selectCallback:function(editor,cb){var selectCallback=editor.getOpt("selectCallback");"function"==typeof selectCallback&&selectCallback(function(data){cb({path:data.url,name:data.title})},"image")}},videoConfig:{disableUpload:!0,selectCallback:function(editor,cb){var selectCallback=editor.getOpt("selectCallback");"function"==typeof selectCallback&&selectCallback(function(data){cb({path:data.url,name:data.title})},"video")}},audioConfig:{disableUpload:!0,selectCallback:function(editor,cb){var selectCallback=editor.getOpt("selectCallback");"function"==typeof selectCallback&&selectCallback(function(data){cb({path:data.url,name:data.title})},"audio")}},formulaConfig:{imageUrlTemplate:"https://r.latexeasy.com/image.svg?{}",editorMode:"live",editorLiveServer:"https://latexeasy.com"},autoSaveEnable:!0,autoSaveRestore:!1,autoSaveKey:null,initialContent:"",focus:!1,initialStyle:"",indentValue:"2em",readonly:!1,autoClearEmptyNode:!0,fullscreen:!1,allHtmlEnabled:!1,enableContextMenu:!0,shortcutMenu:["bold","italic","underline","strikethrough","fontborder","forecolor","backcolor","imagenone","imageleft","imagecenter","imageright","insertimage","formula"],elementPathEnabled:!0,wordCount:!0,maximumWords:1e4,maxUndoCount:20,maxInputCount:1,autoHeightEnabled:!0,catchRemoteImageEnable:!0,autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:{div:1},indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1},allowDivTransToP:!0,rgb2Hex:!0},window.UE={getUEBasePath:getUEBasePath}}();
2
+ !function(){function a(a,d){return c(a||self.document.URL||self.location.href,d||b())}function b(){var a=document.getElementsByTagName("script");return a[a.length-1].src}function c(a,b){var c=b;return/^(\/|\\\\)/.test(b)?c=/^.+?\w(\/|\\\\)/.exec(a)[0]+b.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(b)||(a=a.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""),c=a+""+b),d(c)}function d(a){var b=/^[a-z]+:\/\//.exec(a)[0],c=null,d=[];for(a=a.replace(b,"").split("?")[0].split("#")[0],a=a.replace(/\\/g,"/").split(/\//),a[a.length-1]="";a.length;)".."===(c=a.shift())?d.pop():"."!==c&&d.push(c);return b+d.join("/")}var e,f;e=window.UEDITOR_HOME_URL?window.UEDITOR_HOME_URL:window.__msCDN?window.__msCDN+"asset/vendor/ueditor/":window.__msRoot?window.__msRoot+"asset/vendor/ueditor/":a(),f=window.UEDITOR_CORS_URL?window.UEDITOR_CORS_URL:window.__msRoot?window.__msRoot+"asset/vendor/ueditor/":window.UEDITOR_HOME_URL?window.UEDITOR_HOME_URL:a(),window.UEDITOR_CONFIG={UEDITOR_HOME_URL:e,UEDITOR_CORS_URL:f,debug:!1,serverUrl:"/ueditor-plus/_demo_server/handle.php",serverHeaders:{},toolbars:[["fullscreen","source","|","undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imagecenter","imageright","|","simpleupload","insertimage","insertvideo","insertaudio","attachment","insertframe","insertcode","pagebreak","background","|","horizontal","date","time","spechars","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","|","print"]],toolbarCallback:function(a,b){},imageConfig:{disableUpload:!0,disableOnline:!0,selectCallback:function(a,b){var c=a.getOpt("selectCallback");"function"==typeof c&&c(function(a){b({path:a.url,name:a.title})},"image")}},videoConfig:{disableUpload:!0,selectCallback:function(a,b){var c=a.getOpt("selectCallback");"function"==typeof c&&c(function(a){b({path:a.url,name:a.title})},"video")}},audioConfig:{disableUpload:!0,selectCallback:function(a,b){var c=a.getOpt("selectCallback");"function"==typeof c&&c(function(a){b({path:a.url,name:a.title})},"audio")}},formulaConfig:{imageUrlTemplate:"https://r.latexeasy.com/image.svg?{}",editorMode:"live",editorLiveServer:"https://latexeasy.com"},autoSaveEnable:!0,autoSaveRestore:!1,autoSaveKey:null,initialContent:"",focus:!1,initialStyle:"",indentValue:"2em",readonly:!1,autoClearEmptyNode:!0,fullscreen:!1,allHtmlEnabled:!1,enableContextMenu:!0,shortcutMenu:["bold","italic","underline","strikethrough","fontborder","forecolor","backcolor","imagenone","imageleft","imagecenter","imageright","insertimage","formula"],elementPathEnabled:!0,wordCount:!0,maximumWords:1e4,maxUndoCount:20,maxInputCount:1,autoHeightEnabled:!0,catchRemoteImageEnable:!0,autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:{div:1},indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1},allowDivTransToP:!0,rgb2Hex:!0},window.UE={getUEBasePath:a}}();
@@ -1,2 +1,2 @@
1
1
  /*! UEditorPlus v2.0.0*/
2
- !function(){"use strict";!function(){UE=window.UE||{};var isIE=!!window.ActiveXObject,utils={removeLastbs:function(url){return url.replace(/\/$/,"")},extend:function(t,s){for(var a=arguments,notCover=!!this.isBoolean(a[a.length-1])&&a[a.length-1],len=this.isBoolean(a[a.length-1])?a.length-1:a.length,i=1;i<len;i++){var x=a[i];for(var k in x)notCover&&t.hasOwnProperty(k)||(t[k]=x[k])}return t},isIE:isIE,cssRule:isIE?function(key,style,doc){var indexList,index;doc=doc||document,indexList=doc.indexList?doc.indexList:doc.indexList={};var sheetStyle;if(indexList[key])sheetStyle=doc.styleSheets[indexList[key]];else{if(void 0===style)return"";sheetStyle=doc.createStyleSheet("",index=doc.styleSheets.length),indexList[key]=index}return void 0===style?sheetStyle.cssText:void(sheetStyle.cssText=sheetStyle.cssText+"\n"+(style||""))}:function(key,style,doc){doc=doc||document;var node,head=doc.getElementsByTagName("head")[0];if(!(node=doc.getElementById(key))){if(void 0===style)return"";node=doc.createElement("style"),node.id=key,head.appendChild(node)}return void 0===style?node.innerHTML:void(""!==style?node.innerHTML=node.innerHTML+"\n"+style:head.removeChild(node))},domReady:function(onready){var doc=window.document;"complete"===doc.readyState?onready():isIE?(!function(){if(!doc.isReady){try{doc.documentElement.doScroll("left")}catch(error){return void setTimeout(arguments.callee,0)}onready()}}(),window.attachEvent("onload",function(){onready()})):(doc.addEventListener("DOMContentLoaded",function(){doc.removeEventListener("DOMContentLoaded",arguments.callee,!1),onready()},!1),window.addEventListener("load",function(){onready()},!1))},each:function(obj,iterator,context){if(null!=obj)if(obj.length===+obj.length){for(var i=0,l=obj.length;i<l;i++)if(iterator.call(context,obj[i],i,obj)===!1)return!1}else for(var key in obj)if(obj.hasOwnProperty(key)&&iterator.call(context,obj[key],key,obj)===!1)return!1},inArray:function(arr,item){var index=-1;return this.each(arr,function(v,i){if(v===item)return index=i,!1}),index},pushItem:function(arr,item){this.inArray(arr,item)==-1&&arr.push(item)},trim:function(str){return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},indexOf:function(array,item,start){var index=-1;return start=this.isNumber(start)?start:0,this.each(array,function(v,i){if(i>=start&&v===item)return index=i,!1}),index},hasClass:function(element,className){className=className.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var ci,i=0,cls=element.className;ci=className[i++];)if(!new RegExp("\\b"+ci+"\\b","i").test(cls))return!1;return i-1==className.length},addClass:function(elm,classNames){if(elm){classNames=this.trim(classNames).replace(/[ ]{2,}/g," ").split(" ");for(var ci,i=0,cls=elm.className;ci=classNames[i++];)new RegExp("\\b"+ci+"\\b").test(cls)||(cls+=" "+ci);elm.className=utils.trim(cls)}},removeClass:function(elm,classNames){classNames=this.isArray(classNames)?classNames:this.trim(classNames).replace(/[ ]{2,}/g," ").split(" ");for(var ci,i=0,cls=elm.className;ci=classNames[i++];)cls=cls.replace(new RegExp("\\b"+ci+"\\b"),"");cls=this.trim(cls).replace(/[ ]{2,}/g," "),elm.className=cls,!cls&&elm.removeAttribute("className")},on:function(element,type,handler){var types=this.isArray(type)?type:type.split(/\s+/),k=types.length;if(k)for(;k--;)if(type=types[k],element.addEventListener)element.addEventListener(type,handler,!1);else{handler._d||(handler._d={els:[]});var key=type+handler.toString(),index=utils.indexOf(handler._d.els,element);handler._d[key]&&index!=-1||(index==-1&&handler._d.els.push(element),handler._d[key]||(handler._d[key]=function(evt){return handler.call(evt.srcElement,evt||window.event)}),element.attachEvent("on"+type,handler._d[key]))}element=null},off:function(element,type,handler){var types=this.isArray(type)?type:type.split(/\s+/),k=types.length;if(k)for(;k--;)if(type=types[k],element.removeEventListener)element.removeEventListener(type,handler,!1);else{var key=type+handler.toString();try{element.detachEvent("on"+type,handler._d?handler._d[key]:handler)}catch(e){}if(handler._d&&handler._d[key]){var index=utils.indexOf(handler._d.els,element);index!=-1&&handler._d.els.splice(index,1),0==handler._d.els.length&&delete handler._d[key]}}},loadFile:function(){function getItem(doc,obj){try{for(var ci,i=0;ci=tmpList[i++];)if(ci.doc===doc&&ci.url==(obj.src||obj.href))return ci}catch(e){return null}}var tmpList=[];return function(doc,obj,fn){var item=getItem(doc,obj);if(item)return void(item.ready?fn&&fn():item.funs.push(fn));if(tmpList.push({doc:doc,url:obj.src||obj.href,funs:[fn]}),!doc.body){var html=[];for(var p in obj)"tag"!=p&&html.push(p+'="'+obj[p]+'"');return void doc.write("<"+obj.tag+" "+html.join(" ")+" ></"+obj.tag+">")}if(!obj.id||!doc.getElementById(obj.id)){var element=doc.createElement(obj.tag);delete obj.tag;for(var p in obj)element.setAttribute(p,obj[p]);element.onload=element.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(item=getItem(doc,obj),item.funs.length>0){item.ready=1;for(var fi;fi=item.funs.pop();)fi()}element.onload=element.onreadystatechange=null}},element.onerror=function(){throw Error("The load "+(obj.href||obj.src)+" fails,check the url")},doc.getElementsByTagName("head")[0].appendChild(element)}}}()};utils.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(v){utils["is"+v]=function(obj){return Object.prototype.toString.apply(obj)=="[object "+v+"]"}});var parselist={};UE.parse={register:function(parseName,fn){parselist[parseName]=fn},load:function(opt){utils.each(parselist,function(v){v.call(opt,utils)})}},uParse=function(selector,opt){utils.domReady(function(){var contents;if(document.querySelectorAll)contents=document.querySelectorAll(selector);else if(/^#/.test(selector))contents=[document.getElementById(selector.replace(/^#/,""))];else if(/^\./.test(selector)){var contents=[];utils.each(document.getElementsByTagName("*"),function(node){node.className&&new RegExp("\\b"+selector.replace(/^\./,"")+"\\b","i").test(node.className)&&contents.push(node)})}else contents=document.getElementsByTagName(selector);utils.each(contents,function(v){UE.parse.load(utils.extend({root:v,selector:selector},opt))})})}}(),UE.parse.register("insertcode",function(utils){var pres=this.root.getElementsByTagName("pre");if(pres.length)if("undefined"==typeof XRegExp){var jsurl,cssurl;void 0!==this.rootPath?(jsurl=utils.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",cssurl=utils.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(jsurl=this.highlightJsUrl,cssurl=this.highlightCssUrl),utils.loadFile(document,{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:cssurl}),utils.loadFile(document,{id:"syntaxhighlighter_js",src:jsurl,tag:"script",type:"text/javascript",defer:"defer"},function(){utils.each(pres,function(pi){pi&&/brush/i.test(pi.className)&&SyntaxHighlighter.highlight(pi)})})}else utils.each(pres,function(pi){pi&&/brush/i.test(pi.className)&&SyntaxHighlighter.highlight(pi)})}),UE.parse.register("table",function(utils){function findParentByTagName(target,tagNames){var i,current=target;for(tagNames=utils.isArray(tagNames)?tagNames:[tagNames];current;){for(i=0;i<tagNames.length;i++)if(current.tagName==tagNames[i].toUpperCase())return current;current=current.parentNode}return null}function sortTable(table,sortByCellIndex,compareFn){for(var rows=table.rows,trArray=[],flag="TH"===rows[0].cells[0].tagName,lastRowIndex=0,i=0,len=rows.length;i<len;i++)trArray[i]=rows[i];var Fn={reversecurrent:function(td1,td2){return 1},orderbyasc:function(td1,td2){var value1=td1.innerText||td1.textContent,value2=td2.innerText||td2.textContent;return value1.localeCompare(value2)},reversebyasc:function(td1,td2){var value1=td1.innerHTML,value2=td2.innerHTML;return value2.localeCompare(value1)},orderbynum:function(td1,td2){var value1=td1[utils.isIE?"innerText":"textContent"].match(/\d+/),value2=td2[utils.isIE?"innerText":"textContent"].match(/\d+/);return value1&&(value1=+value1[0]),value2&&(value2=+value2[0]),(value1||0)-(value2||0)},reversebynum:function(td1,td2){var value1=td1[utils.isIE?"innerText":"textContent"].match(/\d+/),value2=td2[utils.isIE?"innerText":"textContent"].match(/\d+/);return value1&&(value1=+value1[0]),value2&&(value2=+value2[0]),(value2||0)-(value1||0)}};table.setAttribute("data-sort-type",compareFn&&"string"==typeof compareFn&&Fn[compareFn]?compareFn:""),flag&&trArray.splice(0,1),trArray=sort(trArray,function(tr1,tr2){var result;return result=compareFn&&"function"==typeof compareFn?compareFn.call(this,tr1.cells[sortByCellIndex],tr2.cells[sortByCellIndex]):compareFn&&"number"==typeof compareFn?1:compareFn&&"string"==typeof compareFn&&Fn[compareFn]?Fn[compareFn].call(this,tr1.cells[sortByCellIndex],tr2.cells[sortByCellIndex]):Fn.orderbyasc.call(this,tr1.cells[sortByCellIndex],tr2.cells[sortByCellIndex])});for(var fragment=table.ownerDocument.createDocumentFragment(),j=0,len=trArray.length;j<len;j++)fragment.appendChild(trArray[j]);var tbody=table.getElementsByTagName("tbody")[0];lastRowIndex?tbody.insertBefore(fragment,rows[lastRowIndex-range.endRowIndex+range.beginRowIndex-1]):tbody.appendChild(fragment)}function sort(array,compareFn){compareFn=compareFn||function(item1,item2){return item1.localeCompare(item2)};for(var i=0,len=array.length;i<len;i++)for(var j=i,length=array.length;j<length;j++)if(compareFn(array[i],array[j])>0){var t=array[i];array[i]=array[j],array[j]=t}return array}function updateTable(table){if(!utils.hasClass(table.rows[0],"firstRow")){for(var i=1;i<table.rows.length;i++)utils.removeClass(table.rows[i],"firstRow");utils.addClass(table.rows[0],"firstRow")}}var me=this,root=this.root,tables=root.getElementsByTagName("table");if(tables.length){var selector=this.selector;utils.cssRule("table",selector+" table.noBorderTable td,"+selector+" table.noBorderTable th,"+selector+" table.noBorderTable caption{border:1px dashed #ddd !important}"+selector+" table.sortEnabled tr.firstRow th,"+selector+" table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;background-position: center right; background-image:url("+this.rootPath+"themes/default/images/sortable.png);}"+selector+" table.sortEnabled tr.firstRow th:hover,"+selector+" table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}"+selector+" table{margin-bottom:10px;border-collapse:collapse;display:table;}"+selector+" td,"+selector+" th{padding: 5px 10px;border: 1px solid #DDD;}"+selector+" caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}"+selector+" th{border-top:1px solid #BBB;background:#F7F7F7;}"+selector+" table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}"+selector+" tr.ue-table-interlace-color-single td{ background: #fcfcfc; }"+selector+" tr.ue-table-interlace-color-double td{ background: #f7faff; }"+selector+" td p{margin:0;padding:0;width:auto;height:auto;}",document),utils.each("td th caption".split(" "),function(tag){var cells=root.getElementsByTagName(tag);cells.length&&utils.each(cells,function(node){node.firstChild||(node.innerHTML="&nbsp;")})});var tables=root.getElementsByTagName("table");utils.each(tables,function(table){/\bsortEnabled\b/.test(table.className)&&utils.on(table,"click",function(e){var target=e.target||e.srcElement,cell=findParentByTagName(target,["td","th"]),table=findParentByTagName(target,"table"),colIndex=utils.indexOf(table.rows[0].cells,cell),sortType=table.getAttribute("data-sort-type");colIndex!=-1&&(sortTable(table,colIndex,me.tableSortCompareFn||sortType),updateTable(table))})})}}),UE.parse.register("background",function(utils){for(var styles,ci,me=this,root=me.root,p=root.getElementsByTagName("p"),i=0;ci=p[i++];)styles=ci.getAttribute("data-background"),styles&&ci.parentNode.removeChild(ci);styles&&utils.cssRule("ueditor_background",me.selector+"{"+styles+"}",document)}),UE.parse.register("list",function(utils){function applyStyle(nodes){var T=this;utils.each(nodes,function(list){if(list.className&&/custom_/i.test(list.className)){var listStyle=list.className.match(/custom_(\w+)/)[1];if("dash"==listStyle||"dot"==listStyle)utils.pushItem(customCss,selector+" li.list-"+customStyle[listStyle]+"{background-image:url("+T.liiconpath+customStyle[listStyle]+".gif)}"),utils.pushItem(customCss,selector+" ul.custom_"+listStyle+"{list-style:none;} "+selector+" ul.custom_"+listStyle+" li{background-position:0 3px;background-repeat:no-repeat}");else{var index=1;utils.each(list.childNodes,function(li){"LI"==li.tagName&&(utils.pushItem(customCss,selector+" li.list-"+customStyle[listStyle]+index+"{background-image:url("+T.liiconpath+"list-"+customStyle[listStyle]+index+".gif)}"),index++)}),utils.pushItem(customCss,selector+" ol.custom_"+listStyle+"{list-style:none;}"+selector+" ol.custom_"+listStyle+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(listStyle){case"cn":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-1{padding-left:25px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-2{padding-left:40px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-3{padding-left:55px}");break;case"cn1":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-1{padding-left:30px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-2{padding-left:40px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-3{padding-left:55px}");break;case"cn2":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-1{padding-left:40px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-2{padding-left:55px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-1{padding-left:25px}");break;case"num2":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-1{padding-left:35px}"),utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft-2{padding-left:40px}");break;case"dash":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft{padding-left:35px}");break;case"dot":utils.pushItem(customCss,selector+" li.list-"+listStyle+"-paddingleft{padding-left:20px}")}}})}var customCss=[],customStyle={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};utils.extend(this,{liiconpath:"http://bs.baidu.com/listicon/",listDefaultPaddingLeft:"20"});var root=this.root,ols=root.getElementsByTagName("ol"),uls=root.getElementsByTagName("ul"),selector=this.selector;ols.length&&applyStyle.call(this,ols),uls.length&&applyStyle.call(this,uls),(ols.length||uls.length)&&(customCss.push(selector+" .list-paddingleft-1{padding-left:0}"),customCss.push(selector+" .list-paddingleft-2{padding-left:"+this.listDefaultPaddingLeft+"px}"),customCss.push(selector+" .list-paddingleft-3{padding-left:"+2*this.listDefaultPaddingLeft+"px}"),utils.cssRule("list",selector+" ol,"+selector+" ul{margin:0;padding:0;}\n"+selector+" li{clear:both;}\n"+customCss.join("\n"),document))})}();
2
+ !function(){"use strict";!function(){UE=window.UE||{};var a=!!window.ActiveXObject,b={removeLastbs:function(a){return a.replace(/\/$/,"")},extend:function(a,b){for(var c=arguments,d=!!this.isBoolean(c[c.length-1])&&c[c.length-1],e=this.isBoolean(c[c.length-1])?c.length-1:c.length,f=1;f<e;f++){var g=c[f];for(var h in g)d&&a.hasOwnProperty(h)||(a[h]=g[h])}return a},isIE:a,cssRule:a?function(a,b,c){var d,e;c=c||document,d=c.indexList?c.indexList:c.indexList={};var f;if(d[a])f=c.styleSheets[d[a]];else{if(void 0===b)return"";f=c.createStyleSheet("",e=c.styleSheets.length),d[a]=e}return void 0===b?f.cssText:void(f.cssText=f.cssText+"\n"+(b||""))}:function(a,b,c){c=c||document;var d,e=c.getElementsByTagName("head")[0];if(!(d=c.getElementById(a))){if(void 0===b)return"";d=c.createElement("style"),d.id=a,e.appendChild(d)}return void 0===b?d.innerHTML:void(""!==b?d.innerHTML=d.innerHTML+"\n"+b:e.removeChild(d))},domReady:function(b){var c=window.document;"complete"===c.readyState?b():a?(!function(){if(!c.isReady){try{c.documentElement.doScroll("left")}catch(a){return void setTimeout(arguments.callee,0)}b()}}(),window.attachEvent("onload",function(){b()})):(c.addEventListener("DOMContentLoaded",function(){c.removeEventListener("DOMContentLoaded",arguments.callee,!1),b()},!1),window.addEventListener("load",function(){b()},!1))},each:function(a,b,c){if(null!=a)if(a.length===+a.length){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a)===!1)return!1}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,a[f],f,a)===!1)return!1},inArray:function(a,b){var c=-1;return this.each(a,function(a,d){if(a===b)return c=d,!1}),c},pushItem:function(a,b){this.inArray(a,b)==-1&&a.push(b)},trim:function(a){return a.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},indexOf:function(a,b,c){var d=-1;return c=this.isNumber(c)?c:0,this.each(a,function(a,e){if(e>=c&&a===b)return d=e,!1}),d},hasClass:function(a,b){b=b.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)if(!new RegExp("\\b"+c+"\\b","i").test(e))return!1;return d-1==b.length},addClass:function(a,c){if(a){c=this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var d,e=0,f=a.className;d=c[e++];)new RegExp("\\b"+d+"\\b").test(f)||(f+=" "+d);a.className=b.trim(f)}},removeClass:function(a,b){b=this.isArray(b)?b:this.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c,d=0,e=a.className;c=b[d++];)e=e.replace(new RegExp("\\b"+c+"\\b"),"");e=this.trim(e).replace(/[ ]{2,}/g," "),a.className=e,!e&&a.removeAttribute("className")},on:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.addEventListener)a.addEventListener(c,d,!1);else{d._d||(d._d={els:[]});var g=c+d.toString(),h=b.indexOf(d._d.els,a);d._d[g]&&h!=-1||(h==-1&&d._d.els.push(a),d._d[g]||(d._d[g]=function(a){return d.call(a.srcElement,a||window.event)}),a.attachEvent("on"+c,d._d[g]))}a=null},off:function(a,c,d){var e=this.isArray(c)?c:c.split(/\s+/),f=e.length;if(f)for(;f--;)if(c=e[f],a.removeEventListener)a.removeEventListener(c,d,!1);else{var g=c+d.toString();try{a.detachEvent("on"+c,d._d?d._d[g]:d)}catch(h){}if(d._d&&d._d[g]){var i=b.indexOf(d._d.els,a);i!=-1&&d._d.els.splice(i,1),0==d._d.els.length&&delete d._d[g]}}},loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" ></"+d.tag+">")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},i.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url")},c.getElementsByTagName("head")[0].appendChild(i)}}}()};b.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(a){b["is"+a]=function(b){return Object.prototype.toString.apply(b)=="[object "+a+"]"}});var c={};UE.parse={register:function(a,b){c[a]=b},load:function(a){b.each(c,function(c){c.call(a,b)})}},uParse=function(a,c){b.domReady(function(){var d;if(document.querySelectorAll)d=document.querySelectorAll(a);else if(/^#/.test(a))d=[document.getElementById(a.replace(/^#/,""))];else if(/^\./.test(a)){var d=[];b.each(document.getElementsByTagName("*"),function(b){b.className&&new RegExp("\\b"+a.replace(/^\./,"")+"\\b","i").test(b.className)&&d.push(b)})}else d=document.getElementsByTagName(a);b.each(d,function(d){UE.parse.load(b.extend({root:d,selector:a},c))})})}}(),UE.parse.register("insertcode",function(a){var b=this.root.getElementsByTagName("pre");if(b.length)if("undefined"==typeof XRegExp){var c,d;void 0!==this.rootPath?(c=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",d=a.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(c=this.highlightJsUrl,d=this.highlightCssUrl),a.loadFile(document,{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:d}),a.loadFile(document,{id:"syntaxhighlighter_js",src:c,tag:"script",type:"text/javascript",defer:"defer"},function(){a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})})}else a.each(b,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})}),UE.parse.register("table",function(a){function b(b,c){var d,e=b;for(c=a.isArray(c)?c:[c];e;){for(d=0;d<c.length;d++)if(e.tagName==c[d].toUpperCase())return e;e=e.parentNode}return null}function c(b,c,e){for(var f=b.rows,g=[],h="TH"===f[0].cells[0].tagName,i=0,j=0,k=f.length;j<k;j++)g[j]=f[j];var l={reversecurrent:function(a,b){return 1},orderbyasc:function(a,b){var c=a.innerText||a.textContent,d=b.innerText||b.textContent;return c.localeCompare(d)},reversebyasc:function(a,b){var c=a.innerHTML,d=b.innerHTML;return d.localeCompare(c)},orderbynum:function(b,c){var d=b[a.isIE?"innerText":"textContent"].match(/\d+/),e=c[a.isIE?"innerText":"textContent"].match(/\d+/);return d&&(d=+d[0]),e&&(e=+e[0]),(d||0)-(e||0)},reversebynum:function(b,c){var d=b[a.isIE?"innerText":"textContent"].match(/\d+/),e=c[a.isIE?"innerText":"textContent"].match(/\d+/);return d&&(d=+d[0]),e&&(e=+e[0]),(e||0)-(d||0)}};b.setAttribute("data-sort-type",e&&"string"==typeof e&&l[e]?e:""),h&&g.splice(0,1),g=d(g,function(a,b){var d;return d=e&&"function"==typeof e?e.call(this,a.cells[c],b.cells[c]):e&&"number"==typeof e?1:e&&"string"==typeof e&&l[e]?l[e].call(this,a.cells[c],b.cells[c]):l.orderbyasc.call(this,a.cells[c],b.cells[c])});for(var m=b.ownerDocument.createDocumentFragment(),n=0,k=g.length;n<k;n++)m.appendChild(g[n]);var o=b.getElementsByTagName("tbody")[0];i?o.insertBefore(m,f[i-range.endRowIndex+range.beginRowIndex-1]):o.appendChild(m)}function d(a,b){b=b||function(a,b){return a.localeCompare(b)};for(var c=0,d=a.length;c<d;c++)for(var e=c,f=a.length;e<f;e++)if(b(a[c],a[e])>0){var g=a[c];a[c]=a[e],a[e]=g}return a}function e(b){if(!a.hasClass(b.rows[0],"firstRow")){for(var c=1;c<b.rows.length;c++)a.removeClass(b.rows[c],"firstRow");a.addClass(b.rows[0],"firstRow")}}var f=this,g=this.root,h=g.getElementsByTagName("table");if(h.length){var i=this.selector;a.cssRule("table",i+" table.noBorderTable td,"+i+" table.noBorderTable th,"+i+" table.noBorderTable caption{border:1px dashed #ddd !important}"+i+" table.sortEnabled tr.firstRow th,"+i+" table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;background-position: center right; background-image:url("+this.rootPath+"themes/default/images/sortable.png);}"+i+" table.sortEnabled tr.firstRow th:hover,"+i+" table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}"+i+" table{margin-bottom:10px;border-collapse:collapse;display:table;}"+i+" td,"+i+" th{padding: 5px 10px;border: 1px solid #DDD;}"+i+" caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}"+i+" th{border-top:1px solid #BBB;background:#F7F7F7;}"+i+" table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}"+i+" tr.ue-table-interlace-color-single td{ background: #fcfcfc; }"+i+" tr.ue-table-interlace-color-double td{ background: #f7faff; }"+i+" td p{margin:0;padding:0;width:auto;height:auto;}",document),a.each("td th caption".split(" "),function(b){var c=g.getElementsByTagName(b);c.length&&a.each(c,function(a){a.firstChild||(a.innerHTML="&nbsp;")})});var h=g.getElementsByTagName("table");a.each(h,function(d){/\bsortEnabled\b/.test(d.className)&&a.on(d,"click",function(d){var g=d.target||d.srcElement,h=b(g,["td","th"]),i=b(g,"table"),j=a.indexOf(i.rows[0].cells,h),k=i.getAttribute("data-sort-type");j!=-1&&(c(i,j,f.tableSortCompareFn||k),e(i))})})}}),UE.parse.register("background",function(a){for(var b,c,d=this,e=d.root,f=e.getElementsByTagName("p"),g=0;c=f[g++];)b=c.getAttribute("data-background"),b&&c.parentNode.removeChild(c);b&&a.cssRule("ueditor_background",d.selector+"{"+b+"}",document)}),UE.parse.register("list",function(a){function b(b){var e=this;a.each(b,function(b){if(b.className&&/custom_/i.test(b.className)){var f=b.className.match(/custom_(\w+)/)[1];if("dash"==f||"dot"==f)a.pushItem(c,h+" li.list-"+d[f]+"{background-image:url("+e.liiconpath+d[f]+".gif)}"),a.pushItem(c,h+" ul.custom_"+f+"{list-style:none;} "+h+" ul.custom_"+f+" li{background-position:0 3px;background-repeat:no-repeat}");else{var g=1;a.each(b.childNodes,function(b){"LI"==b.tagName&&(a.pushItem(c,h+" li.list-"+d[f]+g+"{background-image:url("+e.liiconpath+"list-"+d[f]+g+".gif)}"),g++)}),a.pushItem(c,h+" ol.custom_"+f+"{list-style:none;}"+h+" ol.custom_"+f+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(f){case"cn":a.pushItem(c,h+" li.list-"+f+"-paddingleft-1{padding-left:25px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-2{padding-left:40px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-3{padding-left:55px}");break;case"cn1":a.pushItem(c,h+" li.list-"+f+"-paddingleft-1{padding-left:30px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-2{padding-left:40px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-3{padding-left:55px}");break;case"cn2":a.pushItem(c,h+" li.list-"+f+"-paddingleft-1{padding-left:40px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-2{padding-left:55px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":a.pushItem(c,h+" li.list-"+f+"-paddingleft-1{padding-left:25px}");break;case"num2":a.pushItem(c,h+" li.list-"+f+"-paddingleft-1{padding-left:35px}"),a.pushItem(c,h+" li.list-"+f+"-paddingleft-2{padding-left:40px}");break;case"dash":a.pushItem(c,h+" li.list-"+f+"-paddingleft{padding-left:35px}");break;case"dot":a.pushItem(c,h+" li.list-"+f+"-paddingleft{padding-left:20px}")}}})}var c=[],d={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};a.extend(this,{liiconpath:"http://bs.baidu.com/listicon/",listDefaultPaddingLeft:"20"});var e=this.root,f=e.getElementsByTagName("ol"),g=e.getElementsByTagName("ul"),h=this.selector;f.length&&b.call(this,f),g.length&&b.call(this,g),(f.length||g.length)&&(c.push(h+" .list-paddingleft-1{padding-left:0}"),c.push(h+" .list-paddingleft-2{padding-left:"+this.listDefaultPaddingLeft+"px}"),c.push(h+" .list-paddingleft-3{padding-left:"+2*this.listDefaultPaddingLeft+"px}"),a.cssRule("list",h+" ol,"+h+" ul{margin:0;padding:0;}\n"+h+" li{clear:both;}\n"+c.join("\n"),document))})}();
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- import { FormatSettings } from '../../tools/generateStylesFromSettings';
4
- interface FormatSettingsPanelProps {
5
- onApply: (settings: FormatSettings) => void;
6
- initialSettings?: Partial<FormatSettings>;
7
- }
8
- declare const FormatSettingsPanel: React.FC<React.PropsWithChildren<FormatSettingsPanelProps>>;
9
- export default FormatSettingsPanel;
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAa,MAAM,wCAAwC,CAAC;AAEnF,UAAU,wBAAwB;IAChC,OAAO,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3C;AA6LD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,CA8JpF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,543 +0,0 @@
1
- import _typeof from "@babel/runtime/helpers/esm/typeof";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
- import { Button, Col, Form, Input, InputNumber, Popover, Row, Select } from 'antd';
6
- import React, { useEffect, useState } from 'react';
7
- import "./index.less";
8
- var suffixCls = 'ueditor-format';
9
-
10
- // 系统字体实际对应内容
11
- var SYSTEM_FONT_STACK = "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Helvetica, Arial, sans-serif";
12
-
13
- // 默认设置 - 与theme.less中的样式保持一致
14
- var defaultSettings = {
15
- headings: {
16
- h1: {
17
- fontSize: '28px',
18
- fontFamily: '系统字体',
19
- fontWeight: '700',
20
- lineHeight: '1.3',
21
- color: '#1a202c',
22
- marginTop: '2.5rem',
23
- marginBottom: '1.2rem'
24
- },
25
- h2: {
26
- fontSize: '24px',
27
- fontFamily: '系统字体',
28
- fontWeight: '600',
29
- lineHeight: '1.3',
30
- color: '#1a202c',
31
- marginTop: '2.5rem',
32
- marginBottom: '1.2rem'
33
- },
34
- h3: {
35
- fontSize: '20px',
36
- fontFamily: '系统字体',
37
- fontWeight: '600',
38
- lineHeight: '1.3',
39
- color: '#1a202c',
40
- marginTop: '2rem',
41
- marginBottom: '0.8rem'
42
- },
43
- h4: {
44
- fontSize: '18px',
45
- fontFamily: '系统字体',
46
- fontWeight: '600',
47
- lineHeight: '1.3',
48
- color: '#1a202c',
49
- marginTop: '2rem',
50
- marginBottom: '0.8rem'
51
- },
52
- h5: {
53
- fontSize: '16px',
54
- fontFamily: '系统字体',
55
- fontWeight: '600',
56
- lineHeight: '1.3',
57
- color: '#1a202c',
58
- marginTop: '2rem',
59
- marginBottom: '0.8rem'
60
- },
61
- h6: {
62
- fontSize: '16px',
63
- fontFamily: '系统字体',
64
- fontWeight: '600',
65
- lineHeight: '1.3',
66
- color: '#1a202c',
67
- marginTop: '2rem',
68
- marginBottom: '0.8rem'
69
- }
70
- },
71
- paragraph: {
72
- fontSize: '16px',
73
- fontFamily: '系统字体',
74
- fontWeight: 'normal',
75
- lineHeight: '1.7',
76
- color: '#2c3e50'
77
- },
78
- lists: {
79
- ul: {
80
- fontSize: '16px',
81
- fontFamily: '系统字体',
82
- fontWeight: 'normal',
83
- lineHeight: '1.7',
84
- color: '#2c3e50',
85
- paddingLeft: '1rem',
86
- marginTop: '1rem',
87
- marginBottom: '1rem'
88
- },
89
- ol: {
90
- fontSize: '16px',
91
- fontFamily: '系统字体',
92
- fontWeight: 'normal',
93
- lineHeight: '1.7',
94
- color: '#2c3e50',
95
- paddingLeft: '1rem',
96
- marginTop: '1rem',
97
- marginBottom: '1rem'
98
- }
99
- }
100
- };
101
-
102
- // 检测操作系统类型
103
- var getOSType = function getOSType() {
104
- var userAgent = navigator.userAgent.toLowerCase();
105
- if (userAgent.includes('win')) return 'windows';
106
- if (userAgent.includes('mac')) return 'mac';
107
- if (userAgent.includes('linux')) return 'linux';
108
- return 'unknown';
109
- };
110
-
111
- // 改进的字体可用性检测
112
- var isFontAvailable = function isFontAvailable(fontName) {
113
- // 跳过特殊的系统字体和复合字体栈
114
- if (fontName === '系统字体' || fontName.includes(',') || fontName.includes('sans-serif') || fontName.includes('serif') || fontName.includes('monospace')) {
115
- return true;
116
- }
117
-
118
- // 使用document.fonts API (现代浏览器)
119
- if ('fonts' in document) {
120
- try {
121
- // @ts-ignore - TypeScript可能不包含fonts API的完整类型定义
122
- return document.fonts.check("12px \"".concat(fontName, "\""));
123
- } catch (e) {
124
- // 降级到canvas方法
125
- }
126
- }
127
-
128
- // 降级方案:使用canvas检测
129
- try {
130
- var canvas = document.createElement('canvas');
131
- var context = canvas.getContext('2d');
132
- if (!context) return false;
133
-
134
- // 测试文本,包含中英文字符
135
- var testText = 'abcdefghijklmnopqrstuvwxyz测试字体ABCDEFG';
136
-
137
- // 设置基线字体并测量
138
- context.font = '72px monospace';
139
- var baselineWidth = context.measureText(testText).width;
140
-
141
- // 设置测试字体并测量
142
- context.font = "72px \"".concat(fontName, "\", monospace");
143
- var testWidth = context.measureText(testText).width;
144
-
145
- // 如果宽度有显著差异,说明字体存在
146
- return Math.abs(testWidth - baselineWidth) > 2;
147
- } catch (e) {
148
- console.warn("\u5B57\u4F53\u68C0\u6D4B\u5931\u8D25: ".concat(fontName), e);
149
- return false;
150
- }
151
- };
152
-
153
- // 根据操作系统生成字体选项
154
- var generateFontOptions = function generateFontOptions() {
155
- var osType = getOSType();
156
-
157
- // 基础通用字体
158
- var baseFonts = [{
159
- value: '系统字体',
160
- label: '系统字体(推荐)'
161
- }, {
162
- value: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Helvetica, Arial, sans-serif",
163
- label: '完整系统字体栈'
164
- }];
165
-
166
- // 各平台特定字体
167
- var platformFonts = {
168
- windows: [{
169
- value: '微软雅黑',
170
- label: '微软雅黑'
171
- }, {
172
- value: '仿宋',
173
- label: '仿宋'
174
- }, {
175
- value: '黑体',
176
- label: '黑体'
177
- }, {
178
- value: '楷体',
179
- label: '楷体'
180
- }, {
181
- value: '宋体',
182
- label: '宋体'
183
- }, {
184
- value: '等线',
185
- label: '等线'
186
- }, {
187
- value: 'Segoe UI',
188
- label: 'Segoe UI'
189
- }, {
190
- value: 'Calibri',
191
- label: 'Calibri'
192
- }],
193
- mac: [{
194
- value: 'PingFang SC',
195
- label: '苹方(简)'
196
- }, {
197
- value: 'PingFang TC',
198
- label: '苹方(繁)'
199
- }, {
200
- value: 'Hiragino Sans GB',
201
- label: '冬青黑体'
202
- }, {
203
- value: 'STHeiti',
204
- label: '华文黑体'
205
- }, {
206
- value: 'STKaiti',
207
- label: '华文楷体'
208
- }, {
209
- value: 'STSong',
210
- label: '华文宋体'
211
- }, {
212
- value: 'STFangsong',
213
- label: '华文仿宋'
214
- }, {
215
- value: 'San Francisco',
216
- label: '旧金山字体'
217
- }, {
218
- value: 'Helvetica Neue',
219
- label: 'Helvetica Neue'
220
- }],
221
- linux: [{
222
- value: 'Noto Sans CJK SC',
223
- label: '思源黑体'
224
- }, {
225
- value: 'Noto Serif CJK SC',
226
- label: '思源宋体'
227
- }, {
228
- value: 'Source Han Sans',
229
- label: 'Source Han Sans'
230
- }, {
231
- value: 'WenQuanYi Micro Hei',
232
- label: '文泉驿微米黑'
233
- }, {
234
- value: 'WenQuanYi Zen Hei',
235
- label: '文泉驿正黑'
236
- }, {
237
- value: 'DejaVu Sans',
238
- label: 'DejaVu Sans'
239
- }, {
240
- value: 'Liberation Sans',
241
- label: 'Liberation Sans'
242
- }]
243
- };
244
-
245
- // 通用Web安全字体
246
- var webSafeFonts = [{
247
- value: 'Arial',
248
- label: 'Arial'
249
- }, {
250
- value: 'Helvetica',
251
- label: 'Helvetica'
252
- }, {
253
- value: 'Times New Roman',
254
- label: 'Times New Roman'
255
- }, {
256
- value: 'Times',
257
- label: 'Times'
258
- }, {
259
- value: 'Courier New',
260
- label: 'Courier New'
261
- }, {
262
- value: 'Georgia',
263
- label: 'Georgia'
264
- }, {
265
- value: 'Verdana',
266
- label: 'Verdana'
267
- }, {
268
- value: 'sans-serif',
269
- label: '系统无衬线字体'
270
- }, {
271
- value: 'serif',
272
- label: '系统衬线字体'
273
- }, {
274
- value: 'monospace',
275
- label: '系统等宽字体'
276
- }];
277
-
278
- // 合并字体列表
279
- var allFonts = [].concat(baseFonts);
280
-
281
- // 添加平台特定字体
282
- if (platformFonts[osType]) {
283
- allFonts.push.apply(allFonts, _toConsumableArray(platformFonts[osType]));
284
- }
285
-
286
- // 添加Web安全字体
287
- allFonts.push.apply(allFonts, webSafeFonts);
288
-
289
- // 启用字体检测,但不阻塞界面
290
- var availableFonts = allFonts.map(function (font) {
291
- return _objectSpread(_objectSpread({}, font), {}, {
292
- available: isFontAvailable(font.value)
293
- });
294
- });
295
-
296
- // 将不可用的字体标记出来
297
- return availableFonts.map(function (font) {
298
- return {
299
- value: font.value,
300
- label: font.available ? font.label : "".concat(font.label, " (\u4E0D\u53EF\u7528)"),
301
- disabled: !font.available && !['系统字体', '完整系统字体栈'].includes(font.label)
302
- };
303
- });
304
- };
305
-
306
- // 字体选项 - 动态生成
307
- var fontFamilyOptions = generateFontOptions();
308
-
309
- // 字重选项
310
- var fontWeightOptions = [{
311
- value: 'normal',
312
- label: '常规'
313
- }, {
314
- value: '500',
315
- label: '中等'
316
- }, {
317
- value: '600',
318
- label: '半粗'
319
- }, {
320
- value: 'bold',
321
- label: '粗体'
322
- }];
323
-
324
- // 字号选项
325
- var fontSizeOptions = [{
326
- value: '12px',
327
- label: '12px'
328
- }, {
329
- value: '14px',
330
- label: '14px'
331
- }, {
332
- value: '16px',
333
- label: '16px'
334
- }, {
335
- value: '18px',
336
- label: '18px'
337
- }, {
338
- value: '20px',
339
- label: '20px'
340
- }, {
341
- value: '22px',
342
- label: '22px'
343
- }, {
344
- value: '24px',
345
- label: '24px'
346
- }, {
347
- value: '28px',
348
- label: '28px'
349
- }, {
350
- value: '32px',
351
- label: '32px'
352
- }, {
353
- value: '36px',
354
- label: '36px'
355
- }, {
356
- value: '1.0em',
357
- label: '1.0em'
358
- }, {
359
- value: '1.2em',
360
- label: '1.2em'
361
- }, {
362
- value: '1.5em',
363
- label: '1.5em'
364
- }, {
365
- value: '1.8em',
366
- label: '1.8em'
367
- }];
368
- var FormatSettingsPanel = function FormatSettingsPanel(_ref) {
369
- var onApply = _ref.onApply,
370
- initialSettings = _ref.initialSettings,
371
- children = _ref.children;
372
- var _Form$useForm = Form.useForm(),
373
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
374
- form = _Form$useForm2[0];
375
- var _useState = useState(false),
376
- _useState2 = _slicedToArray(_useState, 2),
377
- open = _useState2[0],
378
- setOpen = _useState2[1];
379
- var _useState3 = useState(_objectSpread({}, defaultSettings)),
380
- _useState4 = _slicedToArray(_useState3, 2),
381
- settings = _useState4[0],
382
- setSettings = _useState4[1];
383
- var _useState5 = useState(''),
384
- _useState6 = _slicedToArray(_useState5, 2),
385
- currentOS = _useState6[0],
386
- setCurrentOS = _useState6[1];
387
- useEffect(function () {
388
- if (initialSettings) {
389
- // 递归处理所有字体设置
390
- var processFontFamily = function processFontFamily(obj) {
391
- for (var _key in obj) {
392
- if (_typeof(obj[_key]) === 'object' && obj[_key] !== null) {
393
- processFontFamily(obj[_key]);
394
- } else if (_key === 'fontFamily' && obj[_key] === SYSTEM_FONT_STACK) {
395
- obj[_key] = '系统字体';
396
- }
397
- }
398
- };
399
- processFontFamily(initialSettings);
400
- setSettings(function (pre) {
401
- return _objectSpread(_objectSpread({}, pre), initialSettings);
402
- });
403
- }
404
- }, [initialSettings]);
405
- useEffect(function () {
406
- // 检测并设置当前操作系统信息
407
- var osType = getOSType();
408
- var osNames = {
409
- windows: 'Windows',
410
- mac: 'macOS',
411
- linux: 'Linux',
412
- unknown: '未知系统'
413
- };
414
- setCurrentOS(osNames[osType] || '未知系统');
415
- }, []);
416
- useEffect(function () {
417
- if (open) {
418
- form.setFieldsValue(settings);
419
- }
420
- }, [open, form, settings]);
421
- var handleValuesChange = function handleValuesChange(changedValues, allValues) {
422
- setSettings(function (prev) {
423
- return _objectSpread(_objectSpread({}, prev), allValues);
424
- });
425
- };
426
- var handleApply = function handleApply() {
427
- form.validateFields().then(function (values) {
428
- // 处理"系统字体"映射为实际的系统字体栈
429
- var processedValues = JSON.parse(JSON.stringify(values)); // 深拷贝避免修改原值
430
-
431
- // 递归处理所有字体设置
432
- var processFontFamily = function processFontFamily(obj) {
433
- for (var _key2 in obj) {
434
- if (_typeof(obj[_key2]) === 'object' && obj[_key2] !== null) {
435
- processFontFamily(obj[_key2]);
436
- } else if (_key2 === 'fontFamily' && obj[_key2] === '系统字体') {
437
- obj[_key2] = SYSTEM_FONT_STACK;
438
- }
439
- }
440
- };
441
- processFontFamily(processedValues);
442
- onApply(processedValues);
443
- setOpen(false);
444
- });
445
- };
446
- var handleCancel = function handleCancel() {
447
- setOpen(false);
448
- };
449
- var renderStyleRow = function renderStyleRow(prefix, label, style) {
450
- return /*#__PURE__*/React.createElement("div", {
451
- className: "".concat(suffixCls, "-style-row")
452
- }, /*#__PURE__*/React.createElement("div", {
453
- className: "".concat(suffixCls, "-row-label")
454
- }, label), /*#__PURE__*/React.createElement(Row, {
455
- gutter: 12
456
- }, /*#__PURE__*/React.createElement(Col, {
457
- span: 7
458
- }, /*#__PURE__*/React.createElement(Form.Item, {
459
- name: [].concat(_toConsumableArray(prefix.split('.')), ['fontFamily']),
460
- noStyle: true
461
- }, /*#__PURE__*/React.createElement(Select, {
462
- placeholder: "\u5B57\u4F53",
463
- options: fontFamilyOptions,
464
- size: "small"
465
- }))), /*#__PURE__*/React.createElement(Col, {
466
- span: 5
467
- }, /*#__PURE__*/React.createElement(Form.Item, {
468
- name: [].concat(_toConsumableArray(prefix.split('.')), ['fontSize']),
469
- noStyle: true
470
- }, /*#__PURE__*/React.createElement(Select, {
471
- placeholder: "\u5B57\u53F7",
472
- options: fontSizeOptions,
473
- size: "small"
474
- }))), /*#__PURE__*/React.createElement(Col, {
475
- span: 4
476
- }, /*#__PURE__*/React.createElement(Form.Item, {
477
- name: [].concat(_toConsumableArray(prefix.split('.')), ['fontWeight']),
478
- noStyle: true
479
- }, /*#__PURE__*/React.createElement(Select, {
480
- placeholder: "\u5B57\u91CD",
481
- options: fontWeightOptions,
482
- size: "small"
483
- }))), /*#__PURE__*/React.createElement(Col, {
484
- span: 4
485
- }, /*#__PURE__*/React.createElement(Form.Item, {
486
- name: [].concat(_toConsumableArray(prefix.split('.')), ['lineHeight']),
487
- noStyle: true
488
- }, /*#__PURE__*/React.createElement(InputNumber, {
489
- placeholder: "\u884C\u9AD8",
490
- step: 0.1,
491
- min: 1,
492
- max: 3,
493
- size: "small",
494
- style: {
495
- width: '100%'
496
- }
497
- }))), /*#__PURE__*/React.createElement(Col, {
498
- span: 4
499
- }, /*#__PURE__*/React.createElement(Form.Item, {
500
- name: [].concat(_toConsumableArray(prefix.split('.')), ['color']),
501
- noStyle: true
502
- }, /*#__PURE__*/React.createElement(Input, {
503
- type: "color",
504
- style: {
505
- width: '100%',
506
- padding: 0,
507
- height: 24
508
- }
509
- })))));
510
- };
511
- var content = /*#__PURE__*/React.createElement("div", {
512
- className: "".concat(suffixCls, "-popover-content")
513
- }, /*#__PURE__*/React.createElement("div", {
514
- className: "".concat(suffixCls, "-system-info")
515
- }, "\u5F53\u524D\u7CFB\u7EDF: ", currentOS, " | \u5B57\u4F53\u9009\u9879\u5DF2\u9488\u5BF9\u60A8\u7684\u7CFB\u7EDF\u4F18\u5316"), /*#__PURE__*/React.createElement(Form, {
516
- form: form,
517
- layout: "vertical",
518
- initialValues: settings,
519
- onValuesChange: handleValuesChange,
520
- size: "small"
521
- }, /*#__PURE__*/React.createElement("div", {
522
- className: "".concat(suffixCls, "-section")
523
- }, renderStyleRow('paragraph', '正文', settings.paragraph), renderStyleRow('headings.h1', '主标题', settings.headings.h1), renderStyleRow('headings.h2', '二级标题', settings.headings.h2), renderStyleRow('headings.h3', '三级标题', settings.headings.h3), renderStyleRow('headings.h4', '四级标题', settings.headings.h4), renderStyleRow('headings.h5', '五级标题', settings.headings.h5), renderStyleRow('headings.h6', '六级标题', settings.headings.h6), renderStyleRow('lists.ul', '无序列表', settings.lists.ul), renderStyleRow('lists.ol', '有序列表', settings.lists.ol)), /*#__PURE__*/React.createElement("div", {
524
- className: "".concat(suffixCls, "-footer")
525
- }, /*#__PURE__*/React.createElement(Button, {
526
- size: "small",
527
- onClick: handleCancel
528
- }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
529
- size: "small",
530
- type: "primary",
531
- onClick: handleApply
532
- }, "\u5E94\u7528"))));
533
- return /*#__PURE__*/React.createElement(Popover, {
534
- content: content,
535
- title: "\u683C\u5F0F\u8BBE\u7F6E",
536
- trigger: "click",
537
- visible: open,
538
- onVisibleChange: setOpen,
539
- placement: "bottomRight",
540
- overlayClassName: "".concat(suffixCls, "-settings-popover")
541
- }, children);
542
- };
543
- export default FormatSettingsPanel;