| 12345678 |
- (function(e){function t(t){for(var i,o,s=t[0],l=t[1],d=t[2],c=0,u=[];c<s.length;c++)o=s[c],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&u.push(r[o][0]),r[o]=0;for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i]);m&&m(t);while(u.length)u.shift()();return a.push.apply(a,d||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],i=!0,o=1;o<n.length;o++){var s=n[o];0!==r[s]&&(i=!1)}i&&(a.splice(t--,1),e=l(l.s=n[0]))}return e}var i={},o={app:0},r={app:0},a=[];function s(e){return l.p+"js/"+({}[e]||e)+"."+{"chunk-0534893e":"66dae43a","chunk-06b388e9":"1d9f5c49","chunk-0ec3a53f":"eb095401","chunk-1dff01ba":"8566e3fb","chunk-278500c2":"e48a6b28","chunk-413db6b6":"691c1da8","chunk-475ddf86":"4a450b31","chunk-1936a13f":"b53e6ad1","chunk-1a205f6e":"02dfb520","chunk-e3302708":"98ccec0f","chunk-4a7589ad":"994593c7","chunk-5088936d":"b812e280","chunk-5bd1522e":"2ce77d01","chunk-6cb45d06":"227d91f1","chunk-72110bb8":"b4c07c9b","chunk-76a2fb18":"115ef967","chunk-c86cf518":"73ae1dac","chunk-caffd35c":"c14dad7d","chunk-cc7f5c9c":"7c04ca13","chunk-e0686272":"e58bb8e1"}[e]+".js"}function l(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.e=function(e){var t=[],n={"chunk-0534893e":1,"chunk-06b388e9":1,"chunk-0ec3a53f":1,"chunk-1dff01ba":1,"chunk-278500c2":1,"chunk-413db6b6":1,"chunk-475ddf86":1,"chunk-1936a13f":1,"chunk-1a205f6e":1,"chunk-e3302708":1,"chunk-4a7589ad":1,"chunk-5088936d":1,"chunk-5bd1522e":1,"chunk-6cb45d06":1,"chunk-72110bb8":1,"chunk-76a2fb18":1,"chunk-c86cf518":1,"chunk-caffd35c":1,"chunk-cc7f5c9c":1,"chunk-e0686272":1};o[e]?t.push(o[e]):0!==o[e]&&n[e]&&t.push(o[e]=new Promise((function(t,n){for(var i="css/"+({}[e]||e)+"."+{"chunk-0534893e":"f2e59cbf","chunk-06b388e9":"e8e69354","chunk-0ec3a53f":"3ad7cdb0","chunk-1dff01ba":"3cf20b6d","chunk-278500c2":"3cf20b6d","chunk-413db6b6":"f882a544","chunk-475ddf86":"34d18e49","chunk-1936a13f":"a5453067","chunk-1a205f6e":"9039ef5c","chunk-e3302708":"ab1fed1c","chunk-4a7589ad":"3cf20b6d","chunk-5088936d":"f2e59cbf","chunk-5bd1522e":"8e8cc296","chunk-6cb45d06":"5ed7fde9","chunk-72110bb8":"f2e59cbf","chunk-76a2fb18":"3cf20b6d","chunk-c86cf518":"f2e59cbf","chunk-caffd35c":"f2e59cbf","chunk-cc7f5c9c":"3cf20b6d","chunk-e0686272":"833325d3"}[e]+".css",r=l.p+i,a=document.getElementsByTagName("link"),s=0;s<a.length;s++){var d=a[s],c=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(c===i||c===r))return t()}var u=document.getElementsByTagName("style");for(s=0;s<u.length;s++){d=u[s],c=d.getAttribute("data-href");if(c===i||c===r)return t()}var m=document.createElement("link");m.rel="stylesheet",m.type="text/css",m.onload=t,m.onerror=function(t){var i=t&&t.target&&t.target.src||r,a=new Error("Loading CSS chunk "+e+" failed.\n("+i+")");a.code="CSS_CHUNK_LOAD_FAILED",a.request=i,delete o[e],m.parentNode.removeChild(m),n(a)},m.href=r;var f=document.getElementsByTagName("head")[0];f.appendChild(m)})).then((function(){o[e]=0})));var i=r[e];if(0!==i)if(i)t.push(i[2]);else{var a=new Promise((function(t,n){i=r[e]=[t,n]}));t.push(i[2]=a);var d,c=document.createElement("script");c.charset="utf-8",c.timeout=120,l.nc&&c.setAttribute("nonce",l.nc),c.src=s(e);var u=new Error;d=function(t){c.onerror=c.onload=null,clearTimeout(m);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",u.name="ChunkLoadError",u.type=i,u.request=o,n[1](u)}r[e]=void 0}};var m=setTimeout((function(){d({type:"timeout",target:c})}),12e4);c.onerror=c.onload=d,document.head.appendChild(c)}return Promise.all(t)},l.m=e,l.c=i,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)l.d(n,i,function(t){return e[t]}.bind(null,i));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/",l.oe=function(e){throw console.error(e),e};var d=window["webpackJsonp"]=window["webpackJsonp"]||[],c=d.push.bind(d);d.push=t,d=d.slice();for(var u=0;u<d.length;u++)t(d[u]);var m=c;a.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"052f":function(e,t){UE.I18N["zh-cn"]={labelMap:{anchor:"锚点",undo:"撤销",redo:"重做",bold:"加粗",indent:"首行缩进",snapscreen:"截图",italic:"斜体",underline:"下划线",strikethrough:"删除线",subscript:"下标",fontborder:"字符边框",superscript:"上标",formatmatch:"格式刷",source:"源代码",blockquote:"引用",pasteplain:"纯文本粘贴模式",selectall:"全选",print:"打印",preview:"预览",horizontal:"分隔线",removeformat:"清除格式",time:"时间",date:"日期",unlink:"取消链接",insertrow:"前插入行",insertcol:"前插入列",mergeright:"右合并单元格",mergedown:"下合并单元格",deleterow:"删除行",deletecol:"删除列",splittorows:"拆分成行",splittocols:"拆分成列",splittocells:"完全拆分单元格",deletecaption:"删除表格标题",inserttitle:"插入标题",mergecells:"合并多个单元格",deletetable:"删除表格",cleardoc:"清空文档",insertparagraphbeforetable:"表格前插入行",insertcode:"代码语言",fontfamily:"字体",fontsize:"字号",paragraph:"段落格式",simpleupload:"单图上传",insertimage:"多图上传",edittable:"表格属性",edittd:"单元格属性",link:"超链接",emotion:"表情",spechars:"特殊字符",searchreplace:"查询替换",map:"Baidu地图",gmap:"Google地图",insertvideo:"视频",help:"帮助",justifyleft:"居左对齐",justifyright:"居右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",forecolor:"字体颜色",backcolor:"背景色",insertorderedlist:"有序列表",insertunorderedlist:"无序列表",fullscreen:"全屏",directionalityltr:"从左向右输入",directionalityrtl:"从右向左输入",rowspacingtop:"段前距",rowspacingbottom:"段后距",pagebreak:"分页",insertframe:"插入Iframe",imagenone:"默认",imageleft:"左浮动",imageright:"右浮动",attachment:"附件",imagecenter:"居中",wordimage:"图片转存",lineheight:"行间距",edittip:"编辑提示",customstyle:"自定义标题",autotypeset:"自动排版",webapp:"百度应用",touppercase:"字母大写",tolowercase:"字母小写",background:"背景",template:"模板",scrawl:"涂鸦",music:"音乐",inserttable:"插入表格",drafts:"从草稿箱加载",charts:"图表"},insertorderedlist:{num:"1,2,3...",num1:"1),2),3)...",num2:"(1),(2),(3)...",cn:"一,二,三....",cn1:"一),二),三)....",cn2:"(一),(二),(三)....",decimal:"1,2,3...","lower-alpha":"a,b,c...","lower-roman":"i,ii,iii...","upper-alpha":"A,B,C...","upper-roman":"I,II,III..."},insertunorderedlist:{circle:"○ 大圆圈",disc:"● 小黑点",square:"■ 小方块 ",dash:"— 破折号",dot:" 。 小圆圈"},paragraph:{p:"段落",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{songti:"宋体",kaiti:"楷体",heiti:"黑体",lishu:"隶书",yahei:"微软雅黑",andaleMono:"andale mono",arial:"arial",arialBlack:"arial black",comicSansMs:"comic sans ms",impact:"impact",timesNewRoman:"times new roman"},customstyle:{tc:"标题居中",tl:"标题居左",im:"强调",hi:"明显强调"},autoupload:{exceedSizeError:"文件大小超出限制",exceedTypeError:"文件格式不允许",jsonEncodeError:"服务器返回格式错误",loading:"正在上传...",loadError:"上传错误",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!"},simpleupload:{exceedSizeError:"文件大小超出限制",exceedTypeError:"文件格式不允许",jsonEncodeError:"服务器返回格式错误",loading:"正在上传...",loadError:"上传错误",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!"},elementPathTip:"元素路径",wordCountTip:"字数统计",wordCountMsg:"当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ",wordOverFlowMsg:'<span style="color:red;">字数超出最大允许值,服务器可能拒绝保存!</span>',ok:"确认",cancel:"取消",closeDialog:"关闭对话框",tableDrag:"表格拖动必须引入uiUtils.js文件!",autofloatMsg:"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!",loadconfigError:"获取后台配置项请求出错,上传功能将不能正常使用!",loadconfigFormatError:"后台配置项返回格式出错,上传功能将不能正常使用!",loadconfigHttpError:"请求后台配置项http错误,上传功能将不能正常使用!",snapScreen_plugin:{browserMsg:"仅支持IE浏览器!",callBackErrorMsg:"服务器返回数据有误,请检查配置项之后重试。",uploadErrorMsg:"截图上传失败,请检查服务器端环境! "},insertcode:{as3:"ActionScript 3",bash:"Bash/Shell",cpp:"C/C++",css:"CSS",cf:"ColdFusion","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"HTML",java:"Java",jfx:"JavaFX",js:"JavaScript",pl:"Perl",php:"PHP",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"SQL",vb:"Visual Basic",xml:"XML"},confirmClear:"确定清空当前文档么?",contextMenu:{delete:"删除",selectall:"全选",deletecode:"删除代码",cleardoc:"清空文档",confirmclear:"确定清空当前文档么?",unlink:"删除超链接",paragraph:"段落格式",edittable:"表格属性",aligntd:"单元格对齐方式",aligntable:"表格对齐方式",tableleft:"左浮动",tablecenter:"居中显示",tableright:"右浮动",edittd:"单元格属性",setbordervisible:"设置表格边线可见",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",table:"表格",inserttable:"插入表格",deletetable:"删除表格",insertparagraphbefore:"前插入段落",insertparagraphafter:"后插入段落",deleterow:"删除当前行",deletecol:"删除当前列",insertrow:"前插入行",insertcol:"左插入列",insertrownext:"后插入行",insertcolnext:"右插入列",insertcaption:"插入表格名称",deletecaption:"删除表格名称",inserttitle:"插入表格标题行",deletetitle:"删除表格标题行",inserttitlecol:"插入表格标题列",deletetitlecol:"删除表格标题列",averageDiseRow:"平均分布各行",averageDisCol:"平均分布各列",mergeright:"向右合并",mergeleft:"向左合并",mergedown:"向下合并",mergecells:"合并单元格",splittocells:"完全拆分单元格",splittocols:"拆分成列",splittorows:"拆分成行",tablesort:"表格排序",enablesort:"设置表格可排序",disablesort:"取消表格可排序",reversecurrent:"逆序当前",orderbyasc:"按ASCII字符升序",reversebyasc:"按ASCII字符降序",orderbynum:"按数值大小升序",reversebynum:"按数值大小降序",borderbk:"边框底纹",setcolor:"表格隔行变色",unsetcolor:"取消表格隔行变色",setbackground:"选区背景隔行",unsetbackground:"取消选区背景",redandblue:"红蓝相间",threecolorgradient:"三色渐变",copy:"复制(Ctrl + c)",copymsg:"浏览器不支持,请使用 'Ctrl + c'",paste:"粘贴(Ctrl + v)",pastemsg:"浏览器不支持,请使用 'Ctrl + v'"},copymsg:"浏览器不支持,请使用 'Ctrl + c'",pastemsg:"浏览器不支持,请使用 'Ctrl + v'",anthorMsg:"链接",clearColor:"清空颜色",standardColor:"标准颜色",themeColor:"主题颜色",property:"属性",default:"默认",modify:"修改",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中",justify:"默认",clear:"清除",anchorMsg:"锚点",delete:"删除",clickToUpload:"点击上传",unset:"尚未设置语言文件",t_row:"行",t_col:"列",more:"更多",pasteOpt:"粘贴选项",pasteSourceFormat:"保留源格式",tagFormat:"只保留标签",pasteTextFormat:"只保留文本",autoTypeSet:{mergeLine:"合并空行",delLine:"清除空行",removeFormat:"清除格式",indent:"首行缩进",alignment:"对齐方式",imageFloat:"图片浮动",removeFontsize:"清除字号",removeFontFamily:"清除字体",removeHtml:"清除冗余HTML代码",pasteFilter:"粘贴过滤",run:"执行",symbol:"符号转换",bdc2sb:"全角转半角",tobdc:"半角转全角"},background:{static:{lang_background_normal:"背景设置",lang_background_local:"在线图片",lang_background_set:"选项",lang_background_none:"无背景色",lang_background_colored:"有背景色",lang_background_color:"颜色设置",lang_background_netimg:"网络图片",lang_background_align:"对齐方式",lang_background_position:"精确定位",repeatType:{options:["居中","横向重复","纵向重复","平铺","自定义"]}},noUploadImage:"当前未上传过任何图片!",toggleSelect:"单击可切换选中状态\n原图尺寸: "},insertimage:{static:{lang_tab_remote:"插入图片",lang_tab_upload:"本地上传",lang_tab_online:"在线管理",lang_tab_search:"图片搜索",lang_input_url:"地 址:",lang_input_size:"大 小:",lang_input_width:"宽度",lang_input_height:"高度",lang_input_border:"边 框:",lang_input_vhspace:"边 距:",lang_input_title:"描 述:",lang_input_align:"图片浮动方式:",lang_imgLoading:" 图片加载中……",lang_start_upload:"开始上传",lock:{title:"锁定宽高比例"},searchType:{title:"图片类型",options:["新闻","壁纸","表情","头像"]},searchTxt:{value:"请输入搜索关键词"},searchBtn:{value:"百度一下"},searchReset:{value:"清空搜索"},noneAlign:{title:"无浮动"},leftAlign:{title:"左浮动"},rightAlign:{title:"右浮动"},centerAlign:{title:"居中独占一行"}},uploadSelectFile:"点击选择图片",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",uploadNoPreview:"不能预览",updateStatusReady:"选中_张图片,共_KB。",updateStatusConfirm:"已成功上传_张照片,_张照片上传失败",updateStatusFinish:"共_张(_KB),_张上传成功",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错",remoteLockError:"宽高不正确,不能所定比例",numError:"请输入正确的长度或者宽度值!例如:123,400",imageUrlError:"不允许的图片格式或者图片域!",imageLoadError:"图片加载失败!请检查链接地址或网络状态!",searchRemind:"请输入搜索关键词",searchLoading:"图片加载中,请稍后……",searchRetry:" :( ,抱歉,没有找到图片!请重试一次!"},attachment:{static:{lang_tab_upload:"上传附件",lang_tab_online:"在线附件",lang_start_upload:"开始上传",lang_drop_remind:"可以将文件拖到这里,单次最多可选100个文件"},uploadSelectFile:"点击选择文件",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",updateStatusReady:"选中_个文件,共_KB。",updateStatusConfirm:"已成功上传_个文件,_个文件上传失败",updateStatusFinish:"共_个(_KB),_个上传成功",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错"},insertvideo:{static:{lang_tab_insertV:"插入视频",lang_tab_searchV:"搜索视频",lang_tab_uploadV:"上传视频",lang_video_url:"视频网址",lang_video_size:"视频尺寸",lang_videoW:"宽度",lang_videoH:"高度",lang_alignment:"对齐方式",videoSearchTxt:{value:"请输入搜索关键字!"},videoType:{options:["全部","热门","娱乐","搞笑","体育","科技","综艺"]},videoSearchBtn:{value:"百度一下"},videoSearchReset:{value:"清空结果"},lang_input_fileStatus:" 当前未上传文件",startUpload:{style:"background:url(upload.png) no-repeat;"},lang_upload_size:"视频尺寸",lang_upload_width:"宽度",lang_upload_height:"高度",lang_upload_alignment:"对齐方式",lang_format_advice:"建议使用mp4格式."},numError:"请输入正确的数值,如123,400",floatLeft:"左浮动",floatRight:"右浮动",'"default"':"默认",block:"独占一行",urlError:"输入的视频地址有误,请检查后再试!",loading:" 视频加载中,请等待……",clickToSelect:"点击选中",goToSource:"访问源视频",noVideo:" 抱歉,找不到对应的视频,请重试!",browseFiles:"浏览文件",uploadSuccess:"上传成功!",delSuccessFile:"从成功队列中移除",delFailSaveFile:"移除保存失败文件",statusPrompt:" 个文件已上传! ",flashVersionError:"当前Flash版本过低,请更新FlashPlayer后重试!",flashLoadingError:"Flash加载失败!请检查路径或网络状态",fileUploadReady:"等待上传……",delUploadQueue:"从上传队列中移除",limitPrompt1:"单次不能选择超过",limitPrompt2:"个文件!请重新选择!",delFailFile:"移除失败文件",fileSizeLimit:"文件大小超出限制!",emptyFile:"空文件无法上传!",fileTypeError:"文件类型不允许!",unknownError:"未知错误!",fileUploading:"上传中,请等待……",cancelUpload:"取消上传",netError:"网络错误",failUpload:"上传失败!",serverIOError:"服务器IO错误!",noAuthority:"无权限!",fileNumLimit:"上传个数限制",failCheck:"验证失败,本次上传被跳过!",fileCanceling:"取消中,请等待……",stopUploading:"上传已停止……",uploadSelectFile:"点击选择文件",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",updateStatusReady:"选中_个文件,共_KB。",updateStatusConfirm:"成功上传_个,_个失败",updateStatusFinish:"共_个(_KB),_个成功上传",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错"},webapp:{tip1:"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!",tip2:"申请完成之后请至ueditor.config.js中配置获得的appkey! ",applyFor:"点此申请",anthorApi:"百度API"},template:{static:{lang_template_bkcolor:"背景颜色",lang_template_clear:"保留原有内容",lang_template_select:"选择模板"},blank:"空白文档",blog:"博客文章",resume:"个人简历",richText:"图文混排",sciPapers:"科技论文"},scrawl:{static:{lang_input_previousStep:"上一步",lang_input_nextsStep:"下一步",lang_input_clear:"清空",lang_input_addPic:"添加背景",lang_input_ScalePic:"缩放背景",lang_input_removePic:"删除背景",J_imgTxt:{title:"添加背景图片"}},noScarwl:"尚未作画,白纸一张~",scrawlUpLoading:"涂鸦上传中,别急哦~",continueBtn:"继续",imageError:"糟糕,图片读取失败了!",backgroundUploading:"背景图片上传中,别急哦~"},music:{static:{lang_input_tips:"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!",J_searchBtn:{value:"搜索歌曲"}},emptyTxt:"未搜索到相关音乐结果,请换一个关键词试试。",chapter:"歌曲",singer:"歌手",special:"专辑",listenTest:"试听"},anchor:{static:{lang_input_anchorName:"锚点名字:"}},charts:{static:{lang_data_source:"数据源:",lang_chart_format:"图表格式:",lang_data_align:"数据对齐方式",lang_chart_align_same:"数据源与图表X轴Y轴一致",lang_chart_align_reverse:"数据源与图表X轴Y轴相反",lang_chart_title:"图表标题",lang_chart_main_title:"主标题:",lang_chart_sub_title:"子标题:",lang_chart_x_title:"X轴标题:",lang_chart_y_title:"Y轴标题:",lang_chart_tip:"提示文字",lang_cahrt_tip_prefix:"提示文字前缀:",lang_cahrt_tip_description:"仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀",lang_chart_data_unit:"数据单位",lang_chart_data_unit_title:"单位:",lang_chart_data_unit_description:"显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃",lang_chart_type:"图表类型:",lang_prev_btn:"上一个",lang_next_btn:"下一个"}},emotion:{static:{lang_input_choice:"精选",lang_input_Tuzki:"兔斯基",lang_input_BOBO:"BOBO",lang_input_lvdouwa:"绿豆蛙",lang_input_babyCat:"baby猫",lang_input_bubble:"泡泡",lang_input_youa:"有啊"}},gmap:{static:{lang_input_address:"地址",lang_input_search:"搜索",address:{value:"北京"}},searchError:"无法定位到该地址!"},help:{static:{lang_input_about:"关于UEditor",lang_input_shortcuts:"快捷键",lang_input_introduction:"UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。",lang_Txt_shortcuts:"快捷键",lang_Txt_func:"功能",lang_Txt_bold:"给选中字设置为加粗",lang_Txt_copy:"复制选中内容",lang_Txt_cut:"剪切选中内容",lang_Txt_Paste:"粘贴",lang_Txt_undo:"重新执行上次操作",lang_Txt_redo:"撤销上一次操作",lang_Txt_italic:"给选中字设置为斜体",lang_Txt_underline:"给选中字加下划线",lang_Txt_selectAll:"全部选中",lang_Txt_visualEnter:"软回车",lang_Txt_fullscreen:"全屏"}},insertframe:{static:{lang_input_address:"地址:",lang_input_width:"宽度:",lang_input_height:"高度:",lang_input_isScroll:"允许滚动条:",lang_input_frameborder:"显示框架边框:",lang_input_alignMode:"对齐方式:",align:{title:"对齐方式",options:["默认","左对齐","右对齐","居中"]}},enterAddress:"请输入地址!"},link:{static:{lang_input_text:"文本内容:",lang_input_url:"链接地址:",lang_input_title:"标题:",lang_input_target:"是否在新窗口打开:"},validLink:"只支持选中一个链接时生效",httpPrompt:"您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀"},map:{static:{lang_city:"城市",lang_address:"地址",city:{value:"北京"},lang_search:"搜索",lang_dynamicmap:"插入动态地图"},cityMsg:"请选择城市",errorMsg:"抱歉,找不到该位置!"},searchreplace:{static:{lang_tab_search:"查找",lang_tab_replace:"替换",lang_search1:"查找",lang_search2:"查找",lang_replace:"替换",lang_searchReg:"支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”",lang_searchReg1:"支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”",lang_case_sensitive1:"区分大小写",lang_case_sensitive2:"区分大小写",nextFindBtn:{value:"下一个"},preFindBtn:{value:"上一个"},nextReplaceBtn:{value:"下一个"},preReplaceBtn:{value:"上一个"},repalceBtn:{value:"替换"},repalceAllBtn:{value:"全部替换"}},getEnd:"已经搜索到文章末尾!",getStart:"已经搜索到文章头部",countMsg:"总共替换了{#count}处!"},snapscreen:{static:{lang_showMsg:"截图功能需要首先安装UEditor截图插件! ",lang_download:"点此下载",lang_step1:"第一步,下载UEditor截图插件并运行安装。",lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!"}},spechars:{static:{},tsfh:"特殊字符",lmsz:"罗马字符",szfh:"数学字符",rwfh:"日文字符",xlzm:"希腊字母",ewzm:"俄文字符",pyzm:"拼音字母",yyyb:"英语音标",zyzf:"其他"},edittable:{static:{lang_tableStyle:"表格样式",lang_insertCaption:"添加表格名称行",lang_insertTitle:"添加表格标题行",lang_insertTitleCol:"添加表格标题列",lang_orderbycontent:"使表格内容可排序",lang_tableSize:"自动调整表格尺寸",lang_autoSizeContent:"按表格文字自适应",lang_autoSizePage:"按页面宽度自适应",lang_example:"示例",lang_borderStyle:"表格边框",lang_color:"颜色:"},captionName:"表格名称",titleName:"标题",cellsName:"内容",errorMsg:"有合并单元格,不可排序"},edittip:{static:{lang_delRow:"删除整行",lang_delCol:"删除整列"}},edittd:{static:{lang_tdBkColor:"背景颜色:"}},formula:{static:{}},wordimage:{static:{lang_resave:"转存步骤",uploadBtn:{src:"upload.png",alt:"上传"},clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"},lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。"},fileType:"图片",flashError:"FLASH初始化失败,请检查FLASH插件是否正确安装!",netError:"网络连接错误,请重试!",copySuccess:"图片地址已经复制!",flashI18n:{}},autosave:{saving:"保存中...",success:"本地保存成功"}}},"0f59":function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var i=n("2b0e"),o=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1)},r=[],a={},s=a,l=n("2877"),d=Object(l["a"])(s,o,r,!1,null,null,null),c=d.exports,u=n("8c4f");i["default"].use(u["a"]);var m=new u["a"]({routes:[{path:"/",name:"login",component:function(){return n.e("chunk-5bd1522e").then(n.bind(null,"a55b"))},show:0},{path:"/data",name:"参赛数据",icon:"el-icon-s-home",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:0,children:[{path:"/data",component:function(){return n.e("chunk-1dff01ba").then(n.bind(null,"856d"))},name:"数据统计"},{path:"/fundinout",component:function(){return n.e("chunk-cc7f5c9c").then(n.bind(null,"2e0e"))},name:"资金出入"}]},{path:"/comments",name:"咨询顽主",icon:"el-icon-s-comment",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:1,children:[{path:"/comments",component:function(){return n.e("chunk-e0686272").then(n.bind(null,"654b"))},name:"咨询顽主"}]},{path:"/signup",name:"订单管理",icon:"el-icon-s-finance",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:1,children:[{path:"/signup",component:function(){return n.e("chunk-76a2fb18").then(n.bind(null,"87de"))},name:"订单管理"}]},{path:"/player",name:"选手管理",icon:"el-icon-user",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:1,children:[{path:"/player",component:function(){return n.e("chunk-5088936d").then(n.bind(null,"62b6"))},name:"参赛选手"}]},{path:"/user",name:"用户管理",icon:"el-icon-s-custom",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:1,children:[{path:"/user",component:function(){return n.e("chunk-06b388e9").then(n.bind(null,"e382"))},name:"用户管理"}]},{path:"/baike",name:"短线百科",icon:"el-icon-s-grid",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:0,children:[{path:"/baike/term",component:function(){return Promise.all([n.e("chunk-475ddf86"),n.e("chunk-e3302708")]).then(n.bind(null,"4e2f"))},name:"百科词条"}]},{path:"/comments",name:"留言管理",icon:"el-icon-tickets",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:0,children:[{path:"/stock/comments/list",component:function(){return n.e("chunk-4a7589ad").then(n.bind(null,"0a5f"))},name:"股票留言"},{path:"/record/comments/list",component:function(){return n.e("chunk-278500c2").then(n.bind(null,"0938"))},name:"作业留言"}]},{path:"/match",name:"赛事管理",icon:"el-icon-trophy-1",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:0,children:[{path:"/match",component:function(){return n.e("chunk-6cb45d06").then(n.bind(null,"9f50"))},name:"赛事管理"},{path:"/group",component:function(){return n.e("chunk-0534893e").then(n.bind(null,"a14c"))},name:"赛事分组"},{path:"/notice",component:function(){return n.e("chunk-c86cf518").then(n.bind(null,"9b99"))},name:"赛事公告"},{path:"/addNotice",component:function(){return Promise.all([n.e("chunk-475ddf86"),n.e("chunk-1936a13f")]).then(n.bind(null,"2acb"))},name:"新增公告",hide:1,isLeaf:1},{path:"/championsay",component:function(){return n.e("chunk-72110bb8").then(n.bind(null,"2182"))},name:"冠军心得"},{path:"/addChampionSay",component:function(){return Promise.all([n.e("chunk-475ddf86"),n.e("chunk-1a205f6e")]).then(n.bind(null,"d453"))},name:"新增冠军心得",hide:1,isLeaf:1},{path:"/stock",component:function(){return n.e("chunk-caffd35c").then(n.bind(null,"0924"))},name:"股票仓库"}]},{path:"/sys",name:"系统管理",icon:"el-icon-mobile",component:function(){return n.e("chunk-413db6b6").then(n.bind(null,"bb51"))},show:1,isLeaf:0,children:[{path:"/sys/version",component:function(){return n.e("chunk-0ec3a53f").then(n.bind(null,"24bd"))},name:"版本管理"}]}]}),f=n("2f62"),h=n("bc3a"),p=n.n(h);i["default"].use(f["a"]);var g,b={state:{inDate:""},mutations:{setInDate:function(e,t){e.inDate=t}},getters:{}},v=new f["a"].Store(b),y=n("5c96"),C=n.n(y),w=(n("0fae"),n("7f10"),n("0f59"),n("bd86")),x="";p.a.interceptors.request.use((function(e){localStorage.getItem("token");return e}),(function(e){return Promise.reject(e)})),p.a.interceptors.response.use((function(e){if(null==e.data&&"json"===e.config.responseType&&null!=e.request.responseText)try{e.data=JSON.parse(e.request.responseText)}catch(t){}return e.data.code,e.data.code,e}),(function(e){return 403==e.request.status&&(window.location.hash="/"),Promise.reject(e)}));var N=(g={login:function(e){return p.a.post("".concat(x,"/api/account/login"),e)},logout:function(e){return p.a.post("".concat(x,"/api/account/logout"),e)},reset:function(e){return p.a.put("".concat(x,"/api/account/pwd/reset"),e)},getAccountInfo:function(e){return p.a.get("".concat(x,"/api/account/info"))},getCode:function(e){return p.a.get("".concat(x,"/api/account/imgcode"))},getUserList:function(e){return p.a.get("".concat(x,"/api/admin/user/list"),{params:e})},getAllSysUserList:function(e){return p.a.get("".concat(x,"/api/admin/user/all"),{params:e})},getUserinfoList:function(e){return p.a.get("".concat(x,"/api/admin/userinfo/list"),{params:e})},getUserJournals:function(){return p.a.get("".concat(x,"/api/admin/user/journals"))},getUserRoles:function(){return p.a.get("".concat(x,"/api/admin/user/roles"))},addUser:function(e){return p.a.post("".concat(x,"/api/admin/user"),e)},editUser:function(e){return p.a.put("".concat(x,"/api/admin/user"),e)},delUser:function(e){return p.a.delete("".concat(x,"/api/admin/user"),{params:e})},getUserInfo:function(e){return p.a.get("".concat(x,"/api/admin/user"),{params:e})},getPlayerRecord:function(e){return p.a.get("".concat(x,"/api/admin/player/record/list"),{params:e})},addRecord:function(e){return p.a.post("".concat(x,"/api/admin/player/record"),e)},getRecordInfo:function(e){return p.a.get("".concat(x,"/api/admin/player/record"),{params:e})},editRecord:function(e){return p.a.put("".concat(x,"/api/admin/player/record"),e)},delRecord:function(e){return p.a.delete("".concat(x,"/api/admin/player/record"),{params:e})},downloadRecords:function(e){return p.a.get("".concat(x,"/api/admin/player/record/download"),{params:e,responseType:"blob"})},getMatchList:function(e){return p.a.get("".concat(x,"/api/admin/match/search"),{params:e})},getPlayerList:function(e){return p.a.get("".concat(x,"/api/admin/player/search"),{params:e})},getGroupList:function(e){return p.a.get("".concat(x,"/api/admin/match/group/search"),{params:e})},getStockList:function(e){return p.a.get("".concat(x,"/api/admin/stock/search"),{params:e})},getAllTemplateList:function(e){return p.a.get("".concat(x,"/api/admin/message/template/all"),{params:e})},addRole:function(e){return p.a.post("".concat(x,"/api/admin/role"),e)},editRole:function(e){return p.a.put("".concat(x,"/api/admin/role"),e)},delRole:function(e){return p.a.delete("".concat(x,"/api/admin/role"),{params:e})},getRoleList:function(e){return p.a.get("".concat(x,"/api/admin/role/list"),{params:e})},getRoleInfo:function(e){return p.a.get("".concat(x,"/api/admin/role"),{params:e})},getPlayers:function(e){return p.a.get("".concat(x,"/api/admin/player/list"),{params:e})},addPlayer:function(e){return p.a.post("".concat(x,"/api/admin/player"),e)},updatePlayer:function(e){return p.a.put("".concat(x,"/api/admin/player"),e)},delPlayer:function(e){return p.a.delete("".concat(x,"/api/admin/player"),{params:e})},getPlayerInfo:function(e){return p.a.get("".concat(x,"/api/admin/player"),{params:e})},getUserSearch:function(e){return p.a.get("".concat(x,"/api/admin/user/search"),{params:e})},getMatchs:function(e){return p.a.get("".concat(x,"/api/admin/match/list"),{params:e})},getGroups:function(e){return p.a.get("".concat(x,"/api/admin/match/group/list"),{params:e})},addMatch:function(e){return p.a.post("".concat(x,"/api/admin/match"),e)},updateMatch:function(e){return p.a.put("".concat(x,"/api/admin/match"),e)},delMatch:function(e){return p.a.delete("".concat(x,"/api/admin/match"),{params:e})},addGroup:function(e){return p.a.post("".concat(x,"/api/admin/match/group"),e)},updateGroup:function(e){return p.a.put("".concat(x,"/api/admin/match/group"),e)},delGroup:function(e){return p.a.delete("".concat(x,"/api/admin/match/group"),{params:e})},fastSavePlayer:function(e){return p.a.post("".concat(x,"/api/admin/player/fast"),e)},autoCompleteData:function(e){return p.a.post("".concat(x,"/api/admin/player/autorecord"),e)},addArticle:function(e){return p.a.post("".concat(x,"/api/admin/article"),e)},editArticle:function(e){return p.a.put("".concat(x,"/api/admin/article"),e)},delArticle:function(e){return p.a.delete("".concat(x,"/api/admin/article"),{params:e})},getArticleById:function(e){return p.a.get("".concat(x,"/api/admin/article"),{params:e})},getArticleList:function(e){return p.a.get("".concat(x,"/api/admin/article/list"),{params:e})},updateRank:function(e){return p.a.get("".concat(x,"/api/admin/flushrank"),{params:e})},updateComment:function(e){return p.a.put("".concat(x,"/api/admin/player/record/comment"),e)}},Object(w["a"])(g,"getStockList",(function(e){return p.a.get("".concat(x,"/api/admin/stock/list"),{params:e})})),Object(w["a"])(g,"getStockInfo",(function(e){return p.a.get("".concat(x,"/api/admin/stock"),{params:e})})),Object(w["a"])(g,"updateStock",(function(e){return p.a.put("".concat(x,"/api/admin/stock"),e)})),Object(w["a"])(g,"addStock",(function(e){return p.a.post("".concat(x,"/api/admin/stock"),e)})),Object(w["a"])(g,"delStock",(function(e){return p.a.delete("".concat(x,"/api/admin/stock"),{params:e})})),Object(w["a"])(g,"resetInitFund",(function(e){return p.a.post("".concat(x,"/api/admin/reset/initfund"),e)})),Object(w["a"])(g,"getSignupList",(function(e){return p.a.get("".concat(x,"/api/admin/signup/list"),{params:e})})),Object(w["a"])(g,"getWanzhuConsultList",(function(e){return p.a.get("".concat(x,"/api/admin/consult/list"),{params:e})})),Object(w["a"])(g,"getWanzhuConsultDetail",(function(e){return p.a.get("".concat(x,"/api/admin/consult"),{params:e})})),Object(w["a"])(g,"replyConsult",(function(e){return p.a.post("".concat(x,"/api/admin/consult/reply"),e)})),Object(w["a"])(g,"delConsult",(function(e){return p.a.delete("".concat(x,"/api/admin/consult"),{params:e})})),Object(w["a"])(g,"getSignupOrderDetail",(function(e){return p.a.get("".concat(x,"/api/admin/signup"),{params:e})})),Object(w["a"])(g,"editSignupOrder",(function(e){return p.a.put("".concat(x,"/api/admin/signup"),e)})),Object(w["a"])(g,"delSignupOrder",(function(e){return p.a.delete("".concat(x,"/api/admin/signup"),{params:e})})),Object(w["a"])(g,"getStockCommentsList",(function(e){return p.a.get("".concat(x,"/api/admin/stock/comments/list"),{params:e})})),Object(w["a"])(g,"getRecordCommentsList",(function(e){return p.a.get("".concat(x,"/api/admin/record/comments/list"),{params:e})})),Object(w["a"])(g,"savePlayerTypePhone",(function(e){return p.a.put("".concat(x,"/api/admin/player/type"),e)})),Object(w["a"])(g,"commentsTop",(function(e){return p.a.put("".concat(x,"/api/admin/comments/top"),e)})),Object(w["a"])(g,"commentsBlack",(function(e){return p.a.put("".concat(x,"/api/admin/comments/black"),e)})),Object(w["a"])(g,"delComments",(function(e){return p.a.delete("".concat(x,"/api/admin/comments"),{params:e})})),Object(w["a"])(g,"updatePlayerRole",(function(e){return p.a.put("".concat(x,"/api/admin/player/role"),e)})),Object(w["a"])(g,"relationOld",(function(e){return p.a.put("".concat(x,"/api/admin/user/relationold"),e)})),Object(w["a"])(g,"getopenidmiss",(function(e){return p.a.get("".concat(x,"/api/admin/user/openidmiss"),{params:e})})),Object(w["a"])(g,"saveOldUser",(function(e){return p.a.put("".concat(x,"/api/admin/signup/olduser"),e)})),Object(w["a"])(g,"getFundInOut",(function(e){return p.a.get("".concat(x,"/api/admin/user/fundinout"),{params:e})})),Object(w["a"])(g,"delFundInOut",(function(e){return p.a.delete("".concat(x,"/api/admin/user/fundinout"),{params:e})})),Object(w["a"])(g,"getFundInOutList",(function(e){return p.a.get("".concat(x,"/api/admin/user/fundinout/list"),{params:e})})),Object(w["a"])(g,"getConsultDetail",(function(e){return p.a.get("".concat(x,"/api/admin/user/consult/detail"),{params:e})})),Object(w["a"])(g,"addBaikeCategory",(function(e){return p.a.post("".concat(x,"/api/admin/baike/category"),e)})),Object(w["a"])(g,"editBaikeCategory",(function(e){return p.a.put("".concat(x,"/api/admin/baike/category"),e)})),Object(w["a"])(g,"delBaikeCategory",(function(e){return p.a.delete("".concat(x,"/api/admin/baike/category"),{params:e})})),Object(w["a"])(g,"getBaikeCategoryDetail",(function(e){return p.a.get("".concat(x,"/api/admin/baike/category"),{params:e})})),Object(w["a"])(g,"getBaikeCategoryList",(function(e){return p.a.get("".concat(x,"/api/admin/baike/category/list"),{params:e})})),Object(w["a"])(g,"getBaikeDetail",(function(e){return p.a.get("".concat(x,"/api/admin/baike/detail"),{params:e})})),Object(w["a"])(g,"addBaikeDetail",(function(e){return p.a.post("".concat(x,"/api/admin/baike/detail"),e)})),Object(w["a"])(g,"editBaikeDetail",(function(e){return p.a.put("".concat(x,"/api/admin/baike/detail"),e)})),Object(w["a"])(g,"delBaikeDetail",(function(e){return p.a.delete("".concat(x,"/api/admin/baike/detail"),{params:e})})),Object(w["a"])(g,"getBaikeDetailList",(function(e){return p.a.get("".concat(x,"/api/admin/baike/detail/list"),{params:e})})),Object(w["a"])(g,"pushArticle",(function(e){return p.a.post("".concat(x,"/api/admin/article/push"),e)})),Object(w["a"])(g,"getVersionList",(function(e){return p.a.get("".concat(x,"/api/admin/version/list"),{params:e})})),Object(w["a"])(g,"refundSignupOrder",(function(e){return p.a.post("".concat(x,"/api/admin/wxpay/refund"),e)})),g),_=n("313e"),U=n.n(_),E=(n("a524"),n("f993")),k=n.n(E),T=n("6625"),S=n.n(T);n("28a5"),n("a481");(function(){var e=window.UEDITOR_HOME_URL||t();function t(e,t){return i(e||self.document.URL||self.location.href,t||n())}function n(){var e=document.getElementsByTagName("script");return e[e.length-1].src}function i(e,t){var n=t;return/^(\/|\\\\)/.test(t)?n=/^.+?\w(\/|\\\\)/.exec(e)[0]+t.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(t)||(e=e.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""),n=e+""+t),o(n)}function o(e){var t=/^[a-z]+:\/\//.exec(e)[0],n=null,i=[];e=e.replace(t,"").split("?")[0].split("#")[0],e=e.replace(/\\/g,"/").split(/\//),e[e.length-1]="";while(e.length)".."===(n=e.shift())?i.pop():"."!==n&&i.push(n);return t+i.join("/")}window.UEDITOR_CONFIG={UEDITOR_HOME_URL:e,serverUrl:"/api/admin/ueditor/upload",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","imageright","imagecenter","|","simpleupload","insertimage","emotion","scrawl","insertvideo","music","attachment","map","gmap","insertframe","insertcode","webapp","pagebreak","template","background","|","horizontal","date","time","spechars","snapscreen","wordimage","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","charts","|","print","preview","searchreplace","drafts","help"]],xssFilterRules:!0,inputXssFilter:!0,outputXssFilter:!0,whiteList:{a:["target","href","title","class","style"],abbr:["title","class","style"],address:["class","style"],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src","class","style"],b:["class","style"],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite","class","style"],br:[],caption:["class","style"],center:[],cite:[],code:["class","style"],col:["align","valign","span","width","class","style"],colgroup:["align","valign","span","width","class","style"],dd:["class","style"],del:["datetime"],details:["open"],div:["class","style"],dl:["class","style"],dt:["class","style"],em:["class","style"],font:["color","size","face"],footer:[],h1:["class","style"],h2:["class","style"],h3:["class","style"],h4:["class","style"],h5:["class","style"],h6:["class","style"],header:[],hr:[],i:["class","style"],img:["src","alt","title","width","height","id","_src","loadingclass","class","data-latex"],ins:["datetime"],li:["class","style"],mark:[],nav:[],ol:["class","style"],p:["class","style"],pre:["class","style"],s:[],section:[],small:[],span:["class","style"],sub:["class","style"],sup:["class","style"],strong:["class","style"],table:["width","border","align","valign","class","style"],tbody:["align","valign","class","style"],td:["width","rowspan","colspan","align","valign","class","style"],tfoot:["align","valign","class","style"],th:["width","rowspan","colspan","align","valign","class","style"],thead:["align","valign","class","style"],tr:["rowspan","align","valign","class","style"],tt:[],u:[],ul:["class","style"],video:["autoplay","controls","loop","preload","src","height","width","class","style"]}},window.UE={getUEBasePath:t}})();n("b396"),n("052f"),n("6a75");i["default"].component("vue-ueditor-wrap",S.a),i["default"].use(k.a),i["default"].use(C.a),i["default"].prototype.$echarts=U.a,i["default"].prototype.$api=N,i["default"].config.productionTip=!1,i["default"].prototype.msgSuccess=function(e){this.$message({showClose:!0,message:e,type:"success"})},i["default"].prototype.msgError=function(e){this.$message({showClose:!0,message:e,type:"error"})},i["default"].prototype.msgInfo=function(e){this.$message.info(e)},new i["default"]({router:m,store:v,render:function(e){return e(c)}}).$mount("#app")},"6a75":function(e,t,n){},b396:function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es6_string_fontsize__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("9ec8"),core_js_modules_es6_string_fontsize__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es6_string_fontsize__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("55dd"),core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("c5f6"),core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es6_string_repeat__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("14b9"),core_js_modules_es6_string_repeat__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es6_string_repeat__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("386d"),core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es6_regexp_search__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("7f7f"),core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_5__),_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("7618"),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("6b54"),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("a481"),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("3b2b"),core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("28a5"),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("4917"),core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_11__);
- /*!
- * UEditor
- * version: ueditor
- * build: Wed Dec 26 2018 17:24:52 GMT+0800 (CST)
- */
- (function(){UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor=window.UE||{},UE.plugins={},UE.commands={},UE.instants={},UE.I18N={},UE._customizeUI={},UE.version="1.4.3";var dom=UE.dom={},browser=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,n={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(e),opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};n.gecko="Gecko"==navigator.product&&!n.webkit&&!n.opera&&!n.ie;var i=0;if(n.ie){var o=e.match(/(?:msie\s([\w.]+))/),r=e.match(/(?:trident.*rv:([\w.]+))/);i=o&&r&&o[1]&&r[1]?Math.max(1*o[1],1*r[1]):o&&o[1]?1*o[1]:r&&r[1]?1*r[1]:0,n.ie11Compat=11==document.documentMode,n.ie9Compat=9==document.documentMode,n.ie8=!!document.documentMode,n.ie8Compat=8==document.documentMode,n.ie7Compat=7==i&&!document.documentMode||7==document.documentMode,n.ie6Compat=i<7||n.quirks,n.ie9above=i>8,n.ie9below=i<9,n.ie11above=i>10,n.ie11below=i<11}if(n.gecko){var a=e.match(/rv:([\d\.]+)/);a&&(a=a[1].split("."),i=1e4*a[0]+100*(a[1]||0)+1*(a[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(n.chrome=+RegExp["$1"]),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(n.safari=+(RegExp["$1"]||RegExp["$2"])),n.opera&&(i=parseFloat(t.version())),n.webkit&&(i=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),n.version=i,n.isCompatible=!n.mobile&&(n.ie&&i>=6||n.gecko&&i>=10801||n.opera&&i>=9.5||n.air&&i>=1||n.webkit&&i>=522||!1),n}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(e,t,n){if(null!=e)if(e.length===+e.length){for(var i=0,o=e.length;i<o;i++)if(!1===t.call(n,e[i],i,e))return!1}else for(var r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return!1},makeInstance:function(e){var t=new Function;return t.prototype=e,e=new t,t.prototype=null,e},extend:function(e,t,n){if(t)for(var i in t)n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e},extend2:function(e){for(var t=arguments,n=1;n<t.length;n++){var i=t[n];for(var o in i)e.hasOwnProperty(o)||(e[o]=i[o])}return e},inherits:function(e,t){var n=e.prototype,i=utils.makeInstance(t.prototype);return utils.extend(i,n,!0),e.prototype=i,i.constructor=e},bind:function(e,t){return function(){return e.apply(t,arguments)}},defer:function(e,t,n){var i;return function(){n&&clearTimeout(i),i=setTimeout(e,t)}},indexOf:function(e,t,n){var i=-1;return n=this.isNumber(n)?n:0,this.each(e,(function(e,o){if(o>=n&&e===t)return i=o,!1})),i},removeItem:function(e,t){for(var n=0,i=e.length;n<i;n++)e[n]===t&&(e.splice(n,1),n--)},trim:function(e){return e.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(e){if(!e)return{};e=utils.isArray(e)?e:e.split(",");for(var t,n=0,i={};t=e[n++];)i[t.toUpperCase()]=i[t]=1;return i},unhtml:function(e,t){return e?e.replace(t||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g,(function(e,t){return t?e:{"<":"<","&":"&",'"':""",">":">","'":"'"}[e]})):""},unhtmlForUrl:function(e,t){return e?e.replace(t||/[<">']/g,(function(e){return{"<":"<","&":"&",'"':""",">":">","'":"'"}[e]})):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,(function(e){return{"<":"<","&":"&",""":'"',">":">","'":"'"," ":" "}[e]})):""},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t={float:void 0!=e.cssFloat?"cssFloat":void 0!=e.styleFloat?"styleFloat":"float"};return function(e){return t[e]||(t[e]=e.toLowerCase().replace(/-./g,(function(e){return e.charAt(1).toUpperCase()})))}}(),loadFile:function(){var e=[];function t(t,n){try{for(var i,o=0;i=e[o++];)if(i.doc===t&&i.url==(n.src||n.href))return i}catch(r){return null}}return function(n,i,o){var r=t(n,i);if(r)r.ready?o&&o():r.funs.push(o);else if(e.push({doc:n,url:i.src||i.href,funs:[o]}),n.body){if(!i.id||!n.getElementById(i.id)){var a=n.createElement(i.tag);for(var s in delete i.tag,i)a.setAttribute(s,i[s]);a.onload=a.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(r=t(n,i),r.funs.length>0){r.ready=1;for(var e;e=r.funs.pop();)e()}a.onload=a.onreadystatechange=null}},a.onerror=function(){throw Error("The load "+(i.href||i.src)+" fails,check the url settings of file ueditor.config.js ")},n.getElementsByTagName("head")[0].appendChild(a)}}else{var l=[];for(var s in i)"tag"!=s&&l.push(s+'="'+i[s]+'"');n.write("<"+i.tag+" "+l.join(" ")+" ></"+i.tag+">")}}}(),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var n=t.split(",");if(n.length>3)return"";t="#";for(var i,o=0;i=n[o++];)i=parseInt(i.replace(/[^\d]/gi,""),10).toString(16),t+=1==i.length?"0"+i:i;t=t.toUpperCase()}return t},optCss:function(e){var t,n;function i(e,t){if(!e)return"";var n=e.top,i=e.bottom,o=e.left,r=e.right,a="";if(n&&o&&i&&r)a+=";"+t+":"+(n==i&&i==o&&o==r?n:n==i&&o==r?n+" "+o:o==r?n+" "+o+" "+i:n+" "+r+" "+i+" "+o)+";";else for(var s in e)a+=";"+t+"-"+s+":"+e[s]+";";return a}return e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,(function(e,i,o,r){if(1==r.split(" ").length)switch(i){case"padding":return!t&&(t={}),t[o]=r,"";case"margin":return!n&&(n={}),n[o]=r,"";case"border":return"initial"==r?"":e}return e})),e+=i(t,"padding")+i(n,"margin"),e.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,(function(e,t){return t?t+";;":";"}))},clone:function(e,t){var n;for(var i in t=t||{},e)e.hasOwnProperty(i)&&(n=e[i],"object"==Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(n)?(t[i]=utils.isArray(n)?[]:{},utils.clone(e[i],t[i])):t[i]=n);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,(function(n,i,o){e=i,t=o})),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},domReady:function(){var e=[];function t(t){t.isReady=!0;for(var n;n=e.pop();n());}return function(n,i){i=i||window;var o=i.document;n&&e.push(n),"complete"===o.readyState?t(o):(o.isReady&&t(o),browser.ie&&11!=browser.version?(function(){if(!o.isReady){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,0)}t(o)}}(),i.attachEvent("onload",(function(){t(o)}))):(o.addEventListener("DOMContentLoaded",(function(){o.removeEventListener("DOMContentLoaded",arguments.callee,!1),t(o)}),!1),i.addEventListener("load",(function(){t(o)}),!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(e,t,n){var i,o;return void 0===t||t&&t.nodeType&&9==t.nodeType?(n=t&&t.nodeType&&9==t.nodeType?t:n||document,i=n.indexList||(n.indexList={}),o=i[e],void 0!==o?n.styleSheets[o].cssText:void 0):(n=n||document,i=n.indexList||(n.indexList={}),o=i[e],""===t?void 0!==o&&(n.styleSheets[o].cssText="",delete i[e],!0):(void 0!==o?sheetStyle=n.styleSheets[o]:(sheetStyle=n.createStyleSheet("",o=n.styleSheets.length),i[e]=o),void(sheetStyle.cssText=t)))}:function(e,t,n){var i;return void 0===t||t&&t.nodeType&&9==t.nodeType?(n=t&&t.nodeType&&9==t.nodeType?t:n||document,i=n.getElementById(e),i?i.innerHTML:void 0):(n=n||document,i=n.getElementById(e),""===t?!!i&&(i.parentNode.removeChild(i),!0):void(i?i.innerHTML=t:(i=n.createElement("style"),i.id=e,i.innerHTML=t,n.getElementsByTagName("head")[0].appendChild(i))))},sort:function(e,t){t=t||function(e,t){return e.localeCompare(t)};for(var n=0,i=e.length;n<i;n++)for(var o=n,r=e.length;o<r;o++)if(t(e[n],e[o])>0){var a=e[n];e[n]=e[o],e[o]=a}return e},serializeParam:function(e){var t=[];for(var n in e)if("method"!=n&&"timeout"!=n&&"async"!=n)if("function"!=Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(e[n]).toLowerCase()&&"object"!=Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(e[n]).toLowerCase())t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));else if(utils.isArray(e[n]))for(var i=0;i<e[n].length;i++)t.push(encodeURIComponent(n)+"[]="+encodeURIComponent(e[n][i]));return t.join("&")},formatUrl:function(e){var t=e.replace(/&&/g,"&");return t=t.replace(/\?&/g,"?"),t=t.replace(/&$/g,""),t=t.replace(/&#/g,"#"),t=t.replace(/&+/g,"&"),t},isCrossDomainUrl:function(e){var t=document.createElement("a");return t.href=e,browser.ie&&(t.href=t.href),!(t.protocol==location.protocol&&t.hostname==location.hostname&&(t.port==location.port||"80"==t.port&&""==location.port||""==t.port&&"80"==location.port))},clearEmptyAttrs:function(e){for(var t in e)""===e[t]&&delete e[t];return e},str2json:function(e){return utils.isString(e)?window.JSON?JSON.parse(e):new Function("return "+utils.trim(e||""))():null},json2str:function(){if(window.JSON)return JSON.stringify;var e=function(e){return/["\\\x00-\x1f]/.test(e)&&(e=e.replace(/["\\\x00-\x1f]/g,(function(e){var t=o[e];return t||(t=e.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))}))),'"'+e+'"'},t=function(e){var t,n,i,o=["["],r=e.length;for(n=0;n<r;n++)switch(i=e[n],Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(i)){case"undefined":case"function":case"unknown":break;default:t&&o.push(","),o.push(utils.json2str(i)),t=1}return o.push("]"),o.join("")},n=function(e){return e<10?"0"+e:e},i=function(e){return'"'+e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+"T"+n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())+'"'},o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return function(n){switch(Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(n)){case"undefined":return"undefined";case"number":return isFinite(n)?String(n):"null";case"string":return e(n);case"boolean":return String(n);default:if(null===n)return"null";if(utils.isArray(n))return t(n);if(utils.isDate(n))return i(n);var o,r,a=["{"],s=utils.json2str;for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l))switch(r=n[l],Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(r)){case"undefined":case"unknown":case"function":break;default:o&&a.push(","),o=1,a.push(s(l)+":"+s(r))}return a.push("}"),a.join("")}}}()};utils.each(["String","Function","Array","Number","RegExp","Object","Date"],(function(e){UE.utils["is"+e]=function(t){return Object.prototype.toString.apply(t)=="[object "+e+"]"}}));var EventBase=UE.EventBase=function(){};function getListener(e,t,n){var i;return t=t.toLowerCase(),(i=e.__allListeners||n&&(e.__allListeners={}))&&(i[t]||n&&(i[t]=[]))}EventBase.prototype={addListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var n,i=0;n=e[i++];)getListener(this,n,!0).push(t)},on:function(e,t){return this.addListener(e,t)},off:function(e,t){return this.removeListener(e,t)},trigger:function(){return this.fireEvent.apply(this,arguments)},removeListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var n,i=0;n=e[i++];)utils.removeItem(getListener(this,n)||[],t)},fireEvent:function(){var e=arguments[0];e=utils.trim(e).split(" ");for(var t,n=0;t=e[n++];){var i,o,r,a=getListener(this,t);if(a){r=a.length;while(r--)if(a[r]){if(o=a[r].apply(this,arguments),!0===o)return o;void 0!==o&&(i=o)}}(o=this["on"+t.toLowerCase()])&&(i=o.apply(this,arguments))}return i}};var dtd=dom.dtd=function(){function e(e){for(var t in e)e[t.toUpperCase()]=e[t];return e}var t=utils.extend2,n=e({isindex:1,fieldset:1}),i=e({input:1,button:1,select:1,textarea:1,label:1}),o=t(e({a:1}),i),r=t({iframe:1},o),a=e({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),s=e({ins:1,del:1,script:1,style:1}),l=t(e({b:1,acronym:1,bdo:1,var:1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}),s),d=t(e({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),c=t(e({p:1}),d),u=t(e({iframe:1}),d,i),m=e({img:1,embed:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,var:1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),f=t(e({a:0}),u),h=e({tr:1}),p=e({"#":1}),g=t(e({param:1}),m),b=t(e({form:1}),n,r,a,c),v=e({li:1,ol:1,ul:1}),y=e({style:1,script:1}),C=e({base:1,link:1,meta:1,title:1}),w=t(C,y),x=e({head:1,body:1}),N=e({html:1}),_=e({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),U=e({area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1});return e({$nonBodyContent:t(N,x,C),$block:_,$inline:f,$inlineWithA:t(e({a:1}),f),$body:t(e({script:1,style:1}),_),$cdata:e({script:1,style:1}),$empty:U,$nonChild:e({iframe:1,textarea:1}),$listItem:e({dd:1,dt:1,li:1}),$list:e({ul:1,ol:1,dl:1}),$isNotEmpty:e({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,meta:1,param:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1}),$removeEmpty:e({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,var:1}),$removeEmptyBlock:e({p:1,div:1}),$tableContent:e({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:e({pre:1,script:1,style:1,textarea:1}),html:x,head:w,style:p,script:p,body:b,base:{},link:{},meta:{},title:p,col:{},tr:e({td:1,th:1}),img:{},embed:{},colgroup:e({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:b,td:b,br:{},th:b,center:b,kbd:f,button:t(c,a),basefont:{},h5:f,h4:f,samp:f,h6:f,ol:v,h1:f,h3:f,option:p,h2:f,form:t(n,r,a,c),select:e({optgroup:1,option:1}),font:f,ins:f,menu:v,abbr:f,label:f,table:e({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:f,tfoot:h,cite:f,li:b,input:{},iframe:b,strong:f,textarea:p,noframes:b,big:f,small:f,span:e({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:f,dt:f,sub:f,optgroup:e({option:1}),param:{},bdo:f,var:f,div:b,object:g,sup:f,dd:b,strike:f,area:{},dir:v,map:t(e({area:1,form:1,p:1}),n,s,a),applet:g,dl:e({dt:1,dd:1}),del:f,isindex:{},fieldset:t(e({legend:1}),m),thead:h,ul:v,acronym:f,b:f,a:t(e({a:1}),u),blockquote:t(e({td:1,tr:1,tbody:1,li:1}),b),caption:f,i:f,u:f,tbody:h,s:f,address:t(r,c),tt:f,legend:f,q:f,pre:t(l,o),p:t(e({a:1}),f),em:f,dfn:f})}();function getDomNode(e,t,n,i,o,r){var a,s=i&&e[t];!s&&(s=e[n]);while(!s&&(a=(a||e).parentNode)){if("BODY"==a.tagName||r&&!r(a))return null;s=a[n]}return s&&o&&!o(s)?getDomNode(s,t,n,!1,o):s}var attrFix=ie&&browser.version<9?{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},styleBlock=utils.listToMap(["-webkit-box","-moz-box","block","list-item","table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption"]),domUtils=dom.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:ie&&"6"==browser.version?"\ufeff":"",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(e,t){if(e===t)return 0;var n,i=[e],o=[t];n=e;while(n=n.parentNode){if(n===t)return 10;i.push(n)}n=t;while(n=n.parentNode){if(n===e)return 20;o.push(n)}if(i.reverse(),o.reverse(),i[0]!==o[0])return 1;var r=-1;while(r++,i[r]===o[r]);e=i[r],t=o[r];while(e=e.nextSibling)if(e===t)return 4;return 2},getNodeIndex:function(e,t){var n=e,i=0;while(n=n.previousSibling)t&&3==n.nodeType?n.nodeType!=n.nextSibling.nodeType&&i++:i++;return i},inDoc:function(e,t){return 10==domUtils.getPosition(e,t)},findParent:function(e,t,n){if(e&&!domUtils.isBody(e)){e=n?e:e.parentNode;while(e){if(!t||t(e)||domUtils.isBody(e))return t&&!t(e)&&domUtils.isBody(e)?null:e;e=e.parentNode}}return null},findParentByTagName:function(e,t,n,i){return t=utils.listToMap(utils.isArray(t)?t:[t]),domUtils.findParent(e,(function(e){return t[e.tagName]&&!(i&&i(e))}),n)},findParents:function(e,t,n,i){var o=t&&(n&&n(e)||!n)?[e]:[];while(e=domUtils.findParent(e,n))o.push(e);return i?o:o.reverse()},insertAfter:function(e,t){return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)},remove:function(e,t){var n,i=e.parentNode;if(i){if(t&&e.hasChildNodes())while(n=e.firstChild)i.insertBefore(n,e);i.removeChild(e)}return e},getNextDomNode:function(e,t,n,i){return getDomNode(e,"firstChild","nextSibling",t,n,i)},getPreDomNode:function(e,t,n,i){return getDomNode(e,"lastChild","previousSibling",t,n,i)},isBookmarkNode:function(e){return 1==e.nodeType&&e.id&&/^_baidu_bookmark_/i.test(e.id)},getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getCommonAncestor:function(e,t){if(e===t)return e;var n=[e],i=[t],o=e,r=-1;while(o=o.parentNode){if(o===t)return o;n.push(o)}o=t;while(o=o.parentNode){if(o===e)return o;i.push(o)}n.reverse(),i.reverse();while(r++,n[r]===i[r]);return 0==r?null:n[r-1]},clearEmptySibling:function(e,t,n){function i(e,t){var n;while(e&&!domUtils.isBookmarkNode(e)&&(domUtils.isEmptyInlineElement(e)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(e.nodeValue)))n=e[t],domUtils.remove(e),e=n}!t&&i(e.nextSibling,"nextSibling"),!n&&i(e.previousSibling,"previousSibling")},split:function(e,t){var n=e.ownerDocument;if(browser.ie&&t==e.nodeValue.length){var i=n.createTextNode("");return domUtils.insertAfter(e,i)}var o=e.splitText(t);if(browser.ie8){var r=n.createTextNode("");domUtils.insertAfter(o,r),domUtils.remove(r)}return o},isWhitespace:function(e){return!new RegExp("[^ \t\n\r"+domUtils.fillChar+"]").test(e.nodeValue)},getXY:function(e){var t=0,n=0;while(e.offsetParent)n+=e.offsetTop,t+=e.offsetLeft,e=e.offsetParent;return{x:t,y:n}},on:function(e,t,n){var i=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=i.length;if(o)while(o--)if(t=i[o],e.addEventListener)e.addEventListener(t,n,!1);else{n._d||(n._d={els:[]});var r=t+n.toString(),a=utils.indexOf(n._d.els,e);n._d[r]&&-1!=a||(-1==a&&n._d.els.push(e),n._d[r]||(n._d[r]=function(e){return n.call(e.srcElement,e||window.event)}),e.attachEvent("on"+t,n._d[r]))}e=null},un:function(e,t,n){var i=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=i.length;if(o)while(o--)if(t=i[o],e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=t+n.toString();try{e.detachEvent("on"+t,n._d?n._d[r]:n)}catch(s){}if(n._d&&n._d[r]){var a=utils.indexOf(n._d.els,e);-1!=a&&n._d.els.splice(a,1),0==n._d.els.length&&delete n._d[r]}}},isSameElement:function(e,t){if(e.tagName!=t.tagName)return!1;var n=e.attributes,i=t.attributes;if(!ie&&n.length!=i.length)return!1;for(var o,r,a=0,s=0,l=0;o=n[l++];){if("style"==o.nodeName){if(o.specified&&a++,domUtils.isSameStyle(e,t))continue;return!1}if(ie){if(!o.specified)continue;a++,r=i.getNamedItem(o.nodeName)}else r=t.attributes[o.nodeName];if(!r.specified||o.nodeValue!=r.nodeValue)return!1}if(ie){for(l=0;r=i[l++];)r.specified&&s++;if(a!=s)return!1}return!0},isSameStyle:function(e,t){var n=e.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),i=t.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(browser.opera){if(n=e.style,i=t.style,n.length!=i.length)return!1;for(var o in n)if(!/^(\d+|csstext)$/i.test(o)&&n[o]!=i[o])return!1;return!0}if(!n||!i)return n==i;if(n=n.split(";"),i=i.split(";"),n.length!=i.length)return!1;for(var r,a=0;r=n[a++];)if(-1==utils.indexOf(i,r))return!1;return!0},isBlockElm:function(e){return 1==e.nodeType&&(dtd.$block[e.tagName]||styleBlock[domUtils.getComputedStyle(e,"display")])&&!dtd.$nonChild[e.tagName]},isBody:function(e){return e&&1==e.nodeType&&"body"==e.tagName.toLowerCase()},breakParent:function(e,t){var n,i,o,r=e,a=e;do{r=r.parentNode,i?(n=r.cloneNode(!1),n.appendChild(i),i=n,n=r.cloneNode(!1),n.appendChild(o),o=n):(i=r.cloneNode(!1),o=i.cloneNode(!1));while(n=a.previousSibling)i.insertBefore(n,i.firstChild);while(n=a.nextSibling)o.appendChild(n);a=r}while(t!==r);return n=t.parentNode,n.insertBefore(i,t),n.insertBefore(o,t),n.insertBefore(e,o),domUtils.remove(t),e},isEmptyInlineElement:function(e){if(1!=e.nodeType||!dtd.$removeEmpty[e.tagName])return 0;e=e.firstChild;while(e){if(domUtils.isBookmarkNode(e))return 0;if(1==e.nodeType&&!domUtils.isEmptyInlineElement(e)||3==e.nodeType&&!domUtils.isWhitespace(e))return 0;e=e.nextSibling}return 1},trimWhiteTextNode:function(e){function t(t){var n;while((n=e[t])&&3==n.nodeType&&domUtils.isWhitespace(n))e.removeChild(n)}t("firstChild"),t("lastChild")},mergeChild:function(e,t,n){for(var i,o=domUtils.getElementsByTagName(e,e.tagName.toLowerCase()),r=0;i=o[r++];)if(i.parentNode&&!domUtils.isBookmarkNode(i))if("span"!=i.tagName.toLowerCase())domUtils.isSameElement(e,i)&&domUtils.remove(i,!0);else{if(e===i.parentNode&&(domUtils.trimWhiteTextNode(e),1==e.childNodes.length)){e.style.cssText=i.style.cssText+";"+e.style.cssText,domUtils.remove(i,!0);continue}if(i.style.cssText=e.style.cssText+";"+i.style.cssText,n){var a=n.style;if(a){a=a.split(";");for(var s,l=0;s=a[l++];)i.style[utils.cssStyleToDomStyle(s.split(":")[0])]=s.split(":")[1]}}domUtils.isSameStyle(i,e)&&domUtils.remove(i,!0)}},getElementsByTagName:function(e,t,n){if(n&&utils.isString(n)){var i=n;n=function(e){return domUtils.hasClass(e,i)}}t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var o,r=[],a=0;o=t[a++];)for(var s,l=e.getElementsByTagName(o),d=0;s=l[d++];)n&&!n(s)||r.push(s);return r},mergeToParent:function(e){var t=e.parentNode;while(t&&dtd.$removeEmpty[t.tagName]){if(t.tagName==e.tagName||"A"==t.tagName){if(domUtils.trimWhiteTextNode(t),"SPAN"==t.tagName&&!domUtils.isSameStyle(t,e)||"A"==t.tagName&&"SPAN"==e.tagName){if(t.childNodes.length>1||t!==e.parentNode){e.style.cssText=t.style.cssText+";"+e.style.cssText,t=t.parentNode;continue}t.style.cssText+=";"+e.style.cssText,"A"==t.tagName&&(t.style.textDecoration="underline")}if("A"!=t.tagName){t===e.parentNode&&domUtils.remove(e,!0);break}}t=t.parentNode}},mergeSibling:function(e,t,n){function i(e,t,n){var i;if((i=n[e])&&!domUtils.isBookmarkNode(i)&&1==i.nodeType&&domUtils.isSameElement(n,i)){while(i.firstChild)"firstChild"==t?n.insertBefore(i.lastChild,n.firstChild):n.appendChild(i.firstChild);domUtils.remove(i)}}!t&&i("previousSibling","firstChild",e),!n&&i("nextSibling","lastChild",e)},unSelectable:ie&&browser.ie9below||browser.opera?function(e){e.onselectstart=function(){return!1},e.onclick=e.onkeyup=e.onkeydown=function(){return!1},e.unselectable="on",e.setAttribute("unselectable","on");for(var t,n=0;t=e.all[n++];)switch(t.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:t.unselectable="on",e.setAttribute("unselectable","on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.msUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0;n=t[i++];){switch(n=attrFix[n]||n,n){case"className":e[n]="";break;case"style":e.style.cssText="";var o=e.getAttributeNode("style");!browser.ie&&o&&e.removeAttributeNode(o)}e.removeAttribute(n)}},createElement:function(e,t,n){return domUtils.setAttributes(e.createElement(t),n)},setAttributes:function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];switch(n){case"class":e.className=i;break;case"style":e.style.cssText=e.style.cssText+";"+i;break;case"innerHTML":e[n]=i;break;case"value":e.value=i;break;default:e.setAttribute(attrFix[n]||n,i)}}return e},getComputedStyle:function(e,t){var n="width height top left";if(n.indexOf(t)>-1)return e["offset"+t.replace(/^\w/,(function(e){return e.toUpperCase()}))]+"px";if(3==e.nodeType&&(e=e.parentNode),browser.ie&&browser.version<9&&"font-size"==t&&!e.style.fontSize&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]){var i=e.ownerDocument.createElement("span");i.style.cssText="padding:0;border:0;font-family:simsun;",i.innerHTML=".",e.appendChild(i);var o=i.offsetHeight;return e.removeChild(i),i=null,o+"px"}try{var r=domUtils.getStyle(e,t)||(window.getComputedStyle?domUtils.getWindow(e).getComputedStyle(e,"").getPropertyValue(t):(e.currentStyle||e.style)[utils.cssStyleToDomStyle(t)])}catch(a){return""}return utils.transUnitToPx(utils.fixColor(t,r))},removeClasses:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)o=o.replace(new RegExp("\\b"+n+"\\b"),"");o=utils.trim(o).replace(/[ ]{2,}/g," "),o?e.className=o:domUtils.removeAttributes(e,["class"])},addClass:function(e,t){if(e){t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)new RegExp("\\b"+n+"\\b").test(o)||(o+=" "+n);e.className=utils.trim(o)}},hasClass:function(e,t){if(utils.isRegExp(t))return t.test(e.className);t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)if(!new RegExp("\\b"+n+"\\b","i").test(o))return!1;return i-1==t.length},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},removeStyle:function(e,t){browser.ie?("color"==t&&(t="(^|;)"+t),e.style.cssText=e.style.cssText.replace(new RegExp(t+"[^:]*:[^;]+;?","ig"),"")):e.style.removeProperty?e.style.removeProperty(t):e.style.removeAttribute(utils.cssStyleToDomStyle(t)),e.style.cssText||domUtils.removeAttributes(e,["style"])},getStyle:function(e,t){var n=e.style[utils.cssStyleToDomStyle(t)];return utils.fixColor(t,n)},setStyle:function(e,t,n){e.style[utils.cssStyleToDomStyle(t)]=n,utils.trim(e.style.cssText)||this.removeAttributes(e,"style")},setStyles:function(e,t){for(var n in t)t.hasOwnProperty(n)&&domUtils.setStyle(e,n,t[n])},removeDirtyAttr:function(e){for(var t,n=0,i=e.getElementsByTagName("*");t=i[n++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var n=0,i=e.firstChild;t=t||function(){return 1};while(i)t(i)&&n++,i=i.nextSibling;return n},isEmptyNode:function(e){return!e.firstChild||0==domUtils.getChildCount(e,(function(e){return!domUtils.isBr(e)&&!domUtils.isBookmarkNode(e)&&!domUtils.isWhitespace(e)}))},clearSelectedArr:function(e){var t;while(t=e.pop())domUtils.removeAttributes(t,["class"])},scrollToView:function(e,t,n){var i=function(){var e=t.document,n="CSS1Compat"==e.compatMode;return{width:(n?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(n?e.documentElement.clientHeight:e.body.clientHeight)||0}},o=function(e){if("pageXOffset"in e)return{x:e.pageXOffset||0,y:e.pageYOffset||0};var t=e.document;return{x:t.documentElement.scrollLeft||t.body.scrollLeft||0,y:t.documentElement.scrollTop||t.body.scrollTop||0}},r=i().height,a=-1*r+n;a+=e.offsetHeight||0;var s=domUtils.getXY(e);a+=s.y;var l=o(t).y;(a>l||a<l-r)&&t.scrollTo(0,a+(a<0?-20:20))},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isFillChar:function(e,t){if(3!=e.nodeType)return!1;var n=e.nodeValue;return t?new RegExp("^"+domUtils.fillChar).test(n):!n.replace(new RegExp(domUtils.fillChar,"g"),"").length},isStartInblock:function(e){var t,n=e.cloneRange(),i=0,o=n.startContainer;if(1==o.nodeType&&o.childNodes[n.startOffset]){o=o.childNodes[n.startOffset];var r=o.previousSibling;while(r&&domUtils.isFillChar(r))o=r,r=r.previousSibling}this.isFillChar(o,!0)&&1==n.startOffset&&(n.setStartBefore(o),o=n.startContainer);while(o&&domUtils.isFillChar(o))t=o,o=o.previousSibling;t&&(n.setStartBefore(t),o=n.startContainer),1==o.nodeType&&domUtils.isEmptyNode(o)&&1==n.startOffset&&n.setStart(o,0).collapse(!0);while(!n.startOffset){if(o=n.startContainer,domUtils.isBlockElm(o)||domUtils.isBody(o)){i=1;break}var a;r=n.startContainer.previousSibling;if(r){while(r&&domUtils.isFillChar(r))a=r,r=r.previousSibling;a?n.setStartBefore(a):n.setStartBefore(n.startContainer)}else n.setStartBefore(n.startContainer)}return i&&!domUtils.isBody(n.startContainer)?1:0},isEmptyBlock:function(e,t){if(e){if(1!=e.nodeType)return 0;if(t=t||new RegExp("[ \t\r\n"+domUtils.fillChar+"]","g"),e[browser.ie?"innerText":"textContent"].replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(e.getElementsByTagName(n).length)return 0;return 1}},setViewportOffset:function(e,t){var n=0|parseInt(e.style.left),i=0|parseInt(e.style.top),o=e.getBoundingClientRect(),r=t.left-o.left,a=t.top-o.top;r&&(e.style.left=n+r+"px"),a&&(e.style.top=i+a+"px")},fillNode:function(e,t){var n=browser.ie?e.createTextNode(domUtils.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(n)},moveChild:function(e,t,n){while(e.firstChild)n&&t.firstChild?t.insertBefore(e.lastChild,t.firstChild):t.appendChild(e.firstChild)},hasNoAttributes:function(e){return browser.ie?/^<\w+\s*?>/.test(e.outerHTML):0==e.attributes.length},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},isTagNode:function(e,t){return 1==e.nodeType&&new RegExp("\\b"+e.tagName+"\\b","i").test(t)},filterNodeList:function(e,t,n){var i=[];if(!utils.isFunction(t)){var o=t;t=function(e){return-1!=utils.indexOf(utils.isArray(o)?o:o.split(" "),e.tagName.toLowerCase())}}return utils.each(e,(function(e){t(e)&&i.push(e)})),0==i.length?null:1!=i.length&&n?i:i[0]},isInNodeEndBoundary:function(e,t){var n=e.startContainer;if(3==n.nodeType&&e.startOffset!=n.nodeValue.length)return 0;if(1==n.nodeType&&e.startOffset!=n.childNodes.length)return 0;while(n!==t){if(n.nextSibling)return 0;n=n.parentNode}return 1},isBoundaryNode:function(e,t){var n;while(!domUtils.isBody(e))if(n=e,e=e.parentNode,n!==e[t])return!1;return!0},fillHtml:browser.ie11below?" ":"<br/>"},fillCharReg=new RegExp(domUtils.fillChar,"g");(function(){var e,t=0,n=domUtils.fillChar;function i(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}function o(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function r(e,t,n,o){return 1==t.nodeType&&(dtd.$empty[t.tagName]||dtd.$nonChild[t.tagName])&&(n=domUtils.getNodeIndex(t)+(e?0:1),t=t.parentNode),e?(o.startContainer=t,o.startOffset=n,o.endContainer||o.collapse(!0)):(o.endContainer=t,o.endOffset=n,o.startContainer||o.collapse(!1)),i(o),o}function a(e,t){var n,i,o=e.startContainer,r=e.endContainer,a=e.startOffset,s=e.endOffset,l=e.document,d=l.createDocumentFragment();if(1==o.nodeType&&(o=o.childNodes[a]||(n=o.appendChild(l.createTextNode("")))),1==r.nodeType&&(r=r.childNodes[s]||(i=r.appendChild(l.createTextNode("")))),o===r&&3==o.nodeType)return d.appendChild(l.createTextNode(o.substringData(a,s-a))),t&&(o.deleteData(a,s-a),e.collapse(!0)),d;for(var c,u,m=d,f=domUtils.findParents(o,!0),h=domUtils.findParents(r,!0),p=0;f[p]==h[p];)p++;for(var g,b=p;g=f[b];b++){c=g.nextSibling,g==o?n||(3==e.startContainer.nodeType?(m.appendChild(l.createTextNode(o.nodeValue.slice(a))),t&&o.deleteData(a,o.nodeValue.length-a)):m.appendChild(t?o:o.cloneNode(!0))):(u=g.cloneNode(!1),m.appendChild(u));while(c){if(c===r||c===h[b])break;g=c.nextSibling,m.appendChild(t?c:c.cloneNode(!0)),c=g}m=u}m=d,f[p]||(m.appendChild(f[p-1].cloneNode(!1)),m=m.firstChild);var v;for(b=p;v=h[b];b++){if(c=v.previousSibling,v==r?i||3!=e.endContainer.nodeType||(m.appendChild(l.createTextNode(r.substringData(0,s))),t&&r.deleteData(0,s)):(u=v.cloneNode(!1),m.appendChild(u)),b!=p||!f[p])while(c){if(c===o)break;v=c.previousSibling,m.insertBefore(t?c:c.cloneNode(!0),m.firstChild),c=v}m=u}return t&&e.setStartBefore(h[p]?f[p]?h[p]:f[p-1]:h[p-1]).collapse(!0),n&&domUtils.remove(n),i&&domUtils.remove(i),d}var s=dom.Range=function(e){var t=this;t.startContainer=t.startOffset=t.endContainer=t.endOffset=null,t.document=e,t.collapsed=!0};function l(t,n){try{if(e&&domUtils.inDoc(e,t))if(e.nodeValue.replace(fillCharReg,"").length)e.nodeValue=e.nodeValue.replace(fillCharReg,"");else{var i=e.parentNode;domUtils.remove(e);while(i&&domUtils.isEmptyInlineElement(i)&&(browser.safari?!(domUtils.getPosition(i,n)&domUtils.POSITION_CONTAINS):!i.contains(n)))e=i.parentNode,domUtils.remove(i),i=e}}catch(o){}}function d(e,t){var n;e=e[t];while(e&&domUtils.isFillChar(e))n=e[t],domUtils.remove(e),e=n}s.prototype={cloneContents:function(){return this.collapsed?null:a(this,0)},deleteContents:function(){var e;return this.collapsed||a(this,1),browser.webkit&&(e=this.startContainer,3!=e.nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),domUtils.remove(e))),this},extractContents:function(){return this.collapsed?null:a(this,2)},setStart:function(e,t){return r(!0,e,t,this)},setEnd:function(e,t){return r(!1,e,t,this)},setStartAfter:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e)+1)},setStartBefore:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e))},setEndAfter:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e)+1)},setEndBefore:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e))},setStartAtFirst:function(e){return this.setStart(e,0)},setStartAtLast:function(e){return this.setStart(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},setEndAtFirst:function(e){return this.setEnd(e,0)},setEndAtLast:function(e){return this.setEnd(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){return this.setStart(e,0).setEndAtLast(e)},cloneRange:function(){var e=this;return new s(e.document).setStart(e.startContainer,e.startOffset).setEnd(e.endContainer,e.endOffset)},collapse:function(e){var t=this;return e?(t.endContainer=t.startContainer,t.endOffset=t.startOffset):(t.startContainer=t.endContainer,t.startOffset=t.endOffset),t.collapsed=!0,t},shrinkBoundary:function(e){var t,n=this,i=n.collapsed;function o(e){return 1==e.nodeType&&!domUtils.isBookmarkNode(e)&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]}while(1==n.startContainer.nodeType&&(t=n.startContainer.childNodes[n.startOffset])&&o(t))n.setStart(t,0);if(i)return n.collapse(!0);if(!e)while(1==n.endContainer.nodeType&&n.endOffset>0&&(t=n.endContainer.childNodes[n.endOffset-1])&&o(t))n.setEnd(t,t.childNodes.length);return n},getCommonAncestor:function(e,t){var n=this,i=n.startContainer,r=n.endContainer;return i===r?e&&o(this)&&(i=i.childNodes[n.startOffset],1==i.nodeType)?i:t&&3==i.nodeType?i.parentNode:i:domUtils.getCommonAncestor(i,r)},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,n=this.startOffset,i=this.collapsed,o=this.endContainer;if(3==t.nodeType){if(0==n)this.setStartBefore(t);else if(n>=t.nodeValue.length)this.setStartAfter(t);else{var r=domUtils.split(t,n);t===o?this.setEnd(r,this.endOffset-n):t.parentNode===o&&(this.endOffset+=1),this.setStartBefore(r)}if(i)return this.collapse(!0)}return e||(n=this.endOffset,o=this.endContainer,3==o.nodeType&&(0==n?this.setEndBefore(o):(n<o.nodeValue.length&&domUtils.split(o,n),this.setEndAfter(o)))),this},txtToElmBoundary:function(e){function t(e,t){var n=e[t+"Container"],i=e[t+"Offset"];3==n.nodeType&&(i?i>=n.nodeValue.length&&e["set"+t.replace(/(\w)/,(function(e){return e.toUpperCase()}))+"After"](n):e["set"+t.replace(/(\w)/,(function(e){return e.toUpperCase()}))+"Before"](n))}return!e&&this.collapsed||(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,n=1;11==e.nodeType&&(t=e.firstChild,n=e.childNodes.length),this.trimBoundary(!0);var i=this.startContainer,o=this.startOffset,r=i.childNodes[o];return r?i.insertBefore(e,r):i.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+n),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,n){var i,o=this.document.createElement("span");return o.style.cssText="display:none;line-height:0px;",o.appendChild(this.document.createTextNode("")),o.id="_baidu_bookmark_start_"+(n?"":t++),this.collapsed||(i=o.cloneNode(!0),i.id="_baidu_bookmark_end_"+(n?"":t++)),this.insertNode(o),i&&this.collapse().insertNode(i).setEndBefore(i),this.setStartAfter(o),{start:e?o.id:o,end:i?e?i.id:i:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,n=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),domUtils.remove(t),n?(this.setEndBefore(n),domUtils.remove(n)):this.collapse(!0),this},enlarge:function(e,t){var n,i,o=domUtils.isBody,r=this.document.createTextNode("");if(e){i=this.startContainer,1==i.nodeType?i.childNodes[this.startOffset]?n=i=i.childNodes[this.startOffset]:(i.appendChild(r),n=i=r):n=i;while(1){if(domUtils.isBlockElm(i)){i=n;while((n=i.previousSibling)&&!domUtils.isBlockElm(n))i=n;this.setStartBefore(i);break}n=i,i=i.parentNode}i=this.endContainer,1==i.nodeType?((n=i.childNodes[this.endOffset])?i.insertBefore(r,n):i.appendChild(r),n=i=r):n=i;while(1){if(domUtils.isBlockElm(i)){i=n;while((n=i.nextSibling)&&!domUtils.isBlockElm(n))i=n;this.setEndAfter(i);break}n=i,i=i.parentNode}r.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(r)}if(!this.collapsed){while(0==this.startOffset){if(t&&t(this.startContainer))break;if(o(this.startContainer))break;this.setStartBefore(this.startContainer)}while(this.endOffset==(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)){if(t&&t(this.endContainer))break;if(o(this.endContainer))break;this.setEndAfter(this.endContainer)}}return this},enlargeToBlockElm:function(e){while(!domUtils.isBlockElm(this.startContainer))this.setStartBefore(this.startContainer);if(!e)while(!domUtils.isBlockElm(this.endContainer))this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){while(!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length)this.setStartAfter(this.startContainer);while(!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(e,t,n){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,(function(e){return 1==e.nodeType&&domUtils.isBlockElm(e)})).adjustmentBoundary();var i,o,r=this.createBookmark(),a=r.end,s=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},l=domUtils.getNextDomNode(r.start,!1,s),d=this.cloneRange();while(l&&domUtils.getPosition(l,a)&domUtils.POSITION_PRECEDING)if(3==l.nodeType||dtd[e][l.tagName]){d.setStartBefore(l),i=l;while(i&&(3==i.nodeType||dtd[e][i.tagName])&&i!==a)o=i,i=domUtils.getNextDomNode(i,1==i.nodeType,null,(function(t){return dtd[e][t.tagName]}));var c,u,m=d.setEndAfter(o).extractContents();if(n&&n.length>0){var f,h;h=f=n[0].cloneNode(!1);for(var p,g=1;p=n[g++];)f.appendChild(p.cloneNode(!1)),f=f.firstChild;c=f}else c=d.document.createElement(e);if(t&&domUtils.setAttributes(c,t),c.appendChild(m),d.insertNode(n?h:c),"span"==e&&t.style&&/text\-decoration/.test(t.style)&&(u=domUtils.findParentByTagName(c,"a",!0))?(domUtils.setAttributes(u,t),domUtils.remove(c,!0),c=u):(domUtils.mergeSibling(c),domUtils.clearEmptySibling(c)),domUtils.mergeChild(c,t),l=domUtils.getNextDomNode(c,!1,s),domUtils.mergeToParent(c),i===a)break}else l=domUtils.getNextDomNode(l,!0,s);return this.moveToBookmark(r)},removeInlineStyle:function(e){if(this.collapsed)return this;e=utils.isArray(e)?e:[e],this.shrinkBoundary().adjustmentBoundary();var t=this.startContainer,n=this.endContainer;while(1){if(1==t.nodeType){if(utils.indexOf(e,t.tagName.toLowerCase())>-1)break;if("body"==t.tagName.toLowerCase()){t=null;break}}t=t.parentNode}while(1){if(1==n.nodeType){if(utils.indexOf(e,n.tagName.toLowerCase())>-1)break;if("body"==n.tagName.toLowerCase()){n=null;break}}n=n.parentNode}var i,o,r=this.createBookmark();t&&(o=this.cloneRange().setEndBefore(r.start).setStartBefore(t),i=o.extractContents(),o.insertNode(i),domUtils.clearEmptySibling(t,!0),t.parentNode.insertBefore(r.start,t)),n&&(o=this.cloneRange().setStartAfter(r.end).setEndAfter(n),i=o.extractContents(),o.insertNode(i),domUtils.clearEmptySibling(n,!1,!0),n.parentNode.insertBefore(r.end,n.nextSibling));var a,s=domUtils.getNextDomNode(r.start,!1,(function(e){return 1==e.nodeType}));while(s&&s!==r.end)a=domUtils.getNextDomNode(s,!0,(function(e){return 1==e.nodeType})),utils.indexOf(e,s.tagName.toLowerCase())>-1&&domUtils.remove(s,!0),s=a;return this.moveToBookmark(r)},getClosedNode:function(){var e;if(!this.collapsed){var t=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(o(t)){var n=t.startContainer.childNodes[t.startOffset];n&&1==n.nodeType&&(dtd.$empty[n.tagName]||dtd.$nonChild[n.tagName])&&(e=n)}}return e},select:browser.ie?function(t,i){var o;this.collapsed||this.shrinkBoundary();var r=this.getClosedNode();if(r&&!i){try{o=this.document.body.createControlRange(),o.addElement(r),o.select()}catch(h){}return this}var a,s=this.createBookmark(),c=s.start;if(o=this.document.body.createTextRange(),o.moveToElementText(c),o.moveStart("character",1),this.collapsed){if(!t&&3!=this.startContainer.nodeType){var u=this.document.createTextNode(n),m=this.document.createElement("span");m.appendChild(this.document.createTextNode(n)),c.parentNode.insertBefore(m,c),c.parentNode.insertBefore(u,c),l(this.document,u),e=u,d(m,"previousSibling"),d(c,"nextSibling"),o.moveStart("character",-1),o.collapse(!0)}}else{var f=this.document.body.createTextRange();a=s.end,f.moveToElementText(a),o.setEndPoint("EndToEnd",f)}this.moveToBookmark(s),m&&domUtils.remove(m);try{o.select()}catch(h){}return this}:function(t){function i(e){function t(t,n,i){3==t.nodeType&&t.nodeValue.length<n&&(e[i+"Offset"]=t.nodeValue.length)}t(e.startContainer,e.startOffset,"start"),t(e.endContainer,e.endOffset,"end")}var o,r=domUtils.getWindow(this.document),a=r.getSelection();if(browser.gecko?this.document.body.focus():r.focus(),a){if(a.removeAllRanges(),this.collapsed&&!t){var s=this.startContainer,c=s;1==s.nodeType&&(c=s.childNodes[this.startOffset]),3==s.nodeType&&this.startOffset||(c?c.previousSibling&&3==c.previousSibling.nodeType:s.lastChild&&3==s.lastChild.nodeType)||(o=this.document.createTextNode(n),this.insertNode(o),l(this.document,o),d(o,"previousSibling"),d(o,"nextSibling"),e=o,this.setStart(o,browser.webkit?1:0).collapse(!0))}var u=this.document.createRange();if(this.collapsed&&browser.opera&&1==this.startContainer.nodeType){c=this.startContainer.childNodes[this.startOffset];if(c){while(c&&domUtils.isBlockElm(c)){if(1!=c.nodeType||!c.childNodes[0])break;c=c.childNodes[0]}c&&this.setStartBefore(c).collapse(!0)}else c=this.startContainer.lastChild,c&&domUtils.isBr(c)&&this.setStartBefore(c).collapse(!0)}i(this),u.setStart(this.startContainer,this.startOffset),u.setEnd(this.endContainer,this.endOffset),a.addRange(u)}return this},scrollToView:function(e,t){e=e?window:domUtils.getWindow(this.document);var n=this,i=n.document.createElement("span");return i.innerHTML=" ",n.cloneRange().insertNode(i),domUtils.scrollToView(i,e,t),domUtils.remove(i),n},inFillChar:function(){var e=this.startContainer;return!(!this.collapsed||3!=e.nodeType||e.nodeValue.replace(new RegExp("^"+domUtils.fillChar),"").length+1!=e.nodeValue.length)},createAddress:function(e,t){var n={},i=this;function o(e){for(var n,o=e?i.startContainer:i.endContainer,r=domUtils.findParents(o,!0,(function(e){return!domUtils.isBody(e)})),a=[],s=0;n=r[s++];)a.push(domUtils.getNodeIndex(n,t));var l=0;if(t)if(3==o.nodeType){var d=o.previousSibling;while(d&&3==d.nodeType)l+=d.nodeValue.replace(fillCharReg,"").length,d=d.previousSibling;l+=e?i.startOffset:i.endOffset}else if(o=o.childNodes[e?i.startOffset:i.endOffset],o)l=domUtils.getNodeIndex(o,t);else{o=e?i.startContainer:i.endContainer;var c=o.firstChild;while(c)if(domUtils.isFillChar(c))c=c.nextSibling;else if(l++,3==c.nodeType)while(c&&3==c.nodeType)c=c.nextSibling;else c=c.nextSibling}else l=e?domUtils.isFillChar(o)?0:i.startOffset:i.endOffset;return l<0&&(l=0),a.push(l),a}return n.startAddress=o(!0),e||(n.endAddress=i.collapsed?[].concat(n.startAddress):o()),n},moveToAddress:function(e,t){var n=this;function i(e,t){for(var i,o,r,a=n.document.body,s=0,l=e.length;s<l;s++)if(r=e[s],i=a,a=a.childNodes[r],!a){o=r;break}t?a?n.setStartBefore(a):n.setStart(i,o):a?n.setEndBefore(a):n.setEnd(i,o)}return i(e.startAddress,!0),!t&&e.endAddress&&i(e.endAddress),n},equals:function(e){for(var t in this)if(this.hasOwnProperty(t)&&this[t]!==e[t])return!1;return!0},traversal:function(e,t){if(this.collapsed)return this;var n=this.createBookmark(),i=n.end,o=domUtils.getNextDomNode(n.start,!1,t);while(o&&o!==i&&domUtils.getPosition(o,i)&domUtils.POSITION_PRECEDING){var r=domUtils.getNextDomNode(o,!1,t);e(o),o=r}return this.moveToBookmark(n)}}})(),function(){function e(e,t){var n=domUtils.getNodeIndex;e=e.duplicate(),e.collapse(t);var i=e.parentElement();if(!i.hasChildNodes())return{container:i,offset:0};var o,r,a=i.children,s=e.duplicate(),l=0,d=a.length-1,c=-1;while(l<=d){c=Math.floor((l+d)/2),o=a[c],s.moveToElementText(o);var u=s.compareEndPoints("StartToStart",e);if(u>0)d=c-1;else{if(!(u<0))return{container:i,offset:n(o)};l=c+1}}if(-1==c){if(s.moveToElementText(i),s.setEndPoint("StartToStart",e),r=s.text.replace(/(\r\n|\r)/g,"\n").length,a=i.childNodes,!r)return o=a[a.length-1],{container:o,offset:o.nodeValue.length};var m=a.length;while(r>0)r-=a[--m].nodeValue.length;return{container:a[m],offset:-r}}if(s.collapse(u>0),s.setEndPoint(u>0?"StartToStart":"EndToStart",e),r=s.text.replace(/(\r\n|\r)/g,"\n").length,!r)return dtd.$empty[o.tagName]||dtd.$nonChild[o.tagName]?{container:i,offset:n(o)+(u>0?0:1)}:{container:o,offset:u>0?0:o.childNodes.length};while(r>0)try{var f=o;o=o[u>0?"previousSibling":"nextSibling"],r-=o.nodeValue.length}catch(h){return{container:i,offset:n(f)}}return{container:o,offset:u>0?-r:o.nodeValue.length+r}}function t(t,n){if(t.item)n.selectNode(t.item(0));else{var i=e(t,!0);n.setStart(i.container,i.offset),0!=t.compareEndPoints("StartToEnd",t)&&(i=e(t,!1),n.setEnd(i.container,i.offset))}return n}function n(e){var t;try{t=e.getNative().createRange()}catch(i){return null}var n=t.item?t.item(0):t.parentElement();return(n.ownerDocument||n)===e.document?t:null}var i=dom.Selection=function(e){var t,i=this;i.document=e,browser.ie9below&&(t=domUtils.getWindow(e).frameElement,domUtils.on(t,"beforedeactivate",(function(){i._bakIERange=i.getIERange()})),domUtils.on(t,"activate",(function(){try{!n(i)&&i._bakIERange&&i._bakIERange.select()}catch(e){}i._bakIERange=null}))),t=e=null};i.prototype={rangeInBody:function(e,t){var n=browser.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return n===this.document.body||domUtils.inDoc(n,this.document)},getNative:function(){var e=this.document;try{return e?browser.ie9below?e.selection:domUtils.getWindow(e).getSelection():null}catch(t){return null}},getIERange:function(){var e=n(this);return!e&&this._bakIERange?this._bakIERange:e},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var e=this.getStart();return e?domUtils.findParents(e,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var e=n(this);return!(!e||!this.rangeInBody(e))}return!!this.getNative().rangeCount}catch(t){return!1}},getRange:function(){var e=this;function n(t){var n=e.document.body.firstChild,i=t.collapsed;while(n&&n.firstChild)t.setStart(n,0),n=n.firstChild;t.startContainer||t.setStart(e.document.body,0),i&&t.collapse(!0)}if(null!=e._cachedRange)return this._cachedRange;var i=new baidu.editor.dom.Range(e.document);if(browser.ie9below){var o=e.getIERange();if(o)try{t(o,i)}catch(l){n(i)}else n(i)}else{var r=e.getNative();if(r&&r.rangeCount){var a=r.getRangeAt(0),s=r.getRangeAt(r.rangeCount-1);i.setStart(a.startContainer,a.startOffset).setEnd(s.endContainer,s.endOffset),i.collapsed&&domUtils.isBody(i.startContainer)&&!i.startOffset&&n(i)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;n(i)}}return this._bakRange=i},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var e,t,n,i,o=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!o)return this.document.body.firstChild;if(o.item)return o.item(0);e=o.duplicate(),e.text.length>0&&e.moveStart("character",1),e.collapse(1),t=e.parentElement(),i=n=o.parentElement();while(n=n.parentNode)if(n==t){t=i;break}}else if(o.shrinkBoundary(),t=o.startContainer,1==t.nodeType&&t.hasChildNodes()&&(t=t.childNodes[Math.min(t.childNodes.length-1,o.startOffset)]),3==t.nodeType)return t.parentNode;return t},getText:function(){var e,t;return this.isFocus()&&(e=this.getNative())?(t=browser.ie9below?e.createRange():e.getRangeAt(0),browser.ie9below?t.text:t.toString()):""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}}(),function(){var e,t=0;function n(e,t){var n;if(t.textarea)if(utils.isString(t.textarea)){for(var i,o=0,r=domUtils.getElementsByTagName(e,"textarea");i=r[o++];)if(i.id=="ueditor_textarea_"+t.options.textarea){n=i;break}}else n=t.textarea;n||(e.appendChild(n=domUtils.createElement(document,"textarea",{name:t.options.textarea,id:"ueditor_textarea_"+t.options.textarea,style:"display:none"})),t.textarea=n),!n.getAttribute("name")&&n.setAttribute("name",t.options.textarea),n.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):""}function i(e){for(var t in e)return t}function o(e){e.langIsReady=!0,e.fireEvent("langReady")}var r=UE.Editor=function(e){var n=this;n.uid=t++,EventBase.call(n),n.commands={},n.options=utils.extend(utils.clone(e||{}),UEDITOR_CONFIG,!0),n.shortcutkeys={},n.inputRules=[],n.outputRules=[],n.setOpt(r.defaultOptions(n)),n.loadServerConfig(),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:n.options.langPath+n.options.lang+"/"+n.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},(function(){UE.plugin.load(n),o(n)})):(n.options.lang=i(UE.I18N),UE.plugin.load(n),o(n)),UE.instants["ueditorInstant"+n.uid]=n};r.prototype={registerCommand:function(e,t){this.commands[e]=t},ready:function(e){var t=this;e&&(t.isReady?e.apply(t):t.addListener("ready",e))},setOpt:function(e,t){var n={};utils.isString(e)?n[e]=t:n=e,utils.extend(this.options,n,!0)},getOpt:function(e){return this.options[e]},destroy:function(){var e=this;e.fireEvent("destroy");var t=e.container.parentNode,n=e.textarea;n?n.style.display="":(n=document.createElement("textarea"),t.parentNode.insertBefore(n,t)),n.style.width=e.iframe.offsetWidth+"px",n.style.height=e.iframe.offsetHeight+"px",n.value=e.getContent(),n.id=e.key,t.innerHTML="",domUtils.remove(t);var i=e.key;for(var o in e)e.hasOwnProperty(o)&&delete this[o];UE.delEditor(i)},render:function(e){var t=this,n=t.options,i=function(t){return parseInt(domUtils.getComputedStyle(e,t))};if(utils.isString(e)&&(e=document.getElementById(e)),e){n.initialFrameWidth?n.minFrameWidth=n.initialFrameWidth:n.minFrameWidth=n.initialFrameWidth=e.offsetWidth,n.initialFrameHeight?n.minFrameHeight=n.initialFrameHeight:n.initialFrameHeight=n.minFrameHeight=e.offsetHeight,e.style.width=/%$/.test(n.initialFrameWidth)?"100%":n.initialFrameWidth-i("padding-left")-i("padding-right")+"px",e.style.height=/%$/.test(n.initialFrameHeight)?"100%":n.initialFrameHeight-i("padding-top")-i("padding-bottom")+"px",e.style.zIndex=n.zIndex;var o=(ie&&browser.version<9?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml' class='view' ><head><style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}</style>"+(n.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+utils.unhtml(n.iframeCssUrl)+"'/>":"")+(n.initialStyle?"<style>"+n.initialStyle+"</style>":"")+"</head><body class='view' ></body><script type='text/javascript' "+(ie?"defer='defer'":"")+" id='_initialScript'>setTimeout(function(){editor = window.parent.UE.instants['ueditorInstant"+t.uid+"'];editor._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);<\/script></html>";e.appendChild(domUtils.createElement(document,"iframe",{id:"ueditor_"+t.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(n.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+o+'");document.close();}())'})),e.style.overflow="hidden",setTimeout((function(){/%$/.test(n.initialFrameWidth)&&(n.minFrameWidth=n.initialFrameWidth=e.offsetWidth),/%$/.test(n.initialFrameHeight)&&(n.minFrameHeight=n.initialFrameHeight=e.offsetHeight,e.style.height=n.initialFrameHeight+"px")}))}},_setup:function(e){var t,i=this,o=i.options;ie?(e.body.disabled=!0,e.body.contentEditable=!0,e.body.disabled=!1):e.body.contentEditable=!0,e.body.spellcheck=!1,i.document=e,i.window=e.defaultView||e.parentWindow,i.iframe=i.window.frameElement,i.body=e.body,i.selection=new dom.Selection(e),browser.gecko&&(t=this.selection.getNative())&&t.removeAllRanges(),this._initEvents();for(var r=this.iframe.parentNode;!domUtils.isBody(r);r=r.parentNode)if("FORM"==r.tagName){i.form=r,i.options.autoSyncData?domUtils.on(i.window,"blur",(function(){n(r,i)})):domUtils.on(r,"submit",(function(){n(this,i)}));break}if(o.initialContent)if(o.autoClearinitialContent){var a=i.execCommand;i.execCommand=function(){return i.fireEvent("firstBeforeExecCommand"),a.apply(i,arguments)},this._setDefaultContent(o.initialContent)}else this.setContent(o.initialContent,!1,!0);domUtils.isEmptyNode(i.body)&&(i.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"),o.focus&&setTimeout((function(){i.focus(i.options.focusInEnd),!i.options.autoClearinitialContent&&i._selectionChange()}),0),i.container||(i.container=this.iframe.parentNode),o.fullscreen&&i.ui&&i.ui.setFullScreen(!0);try{i.document.execCommand("2D-position",!1,!1)}catch(s){}try{i.document.execCommand("enableInlineTableEditing",!1,!1)}catch(s){}try{i.document.execCommand("enableObjectResizing",!1,!1)}catch(s){}i._bindshortcutKeys(),i.isReady=1,i.fireEvent("ready"),o.onready&&o.onready.call(i),browser.ie9below||domUtils.on(i.window,["blur","focus"],(function(e){if("blur"==e.type){i._bakRange=i.selection.getRange();try{i._bakNativeRange=i.selection.getNative().getRangeAt(0),i.selection.getNative().removeAllRanges()}catch(e){i._bakNativeRange=null}}else try{i._bakRange&&i._bakRange.select()}catch(e){}})),browser.gecko&&browser.version<=10902&&(i.body.contentEditable=!1,setTimeout((function(){i.body.contentEditable=!0}),100),setInterval((function(){i.body.style.height=i.iframe.offsetHeight-20+"px"}),100)),!o.isShow&&i.setHide(),o.readonly&&i.setDisabled()},sync:function(e){var t=this,i=e?document.getElementById(e):domUtils.findParent(t.iframe.parentNode,(function(e){return"FORM"==e.tagName}),!0);i&&n(i,t)},setHeight:function(e,t){e!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=e+"px"),!t&&(this.options.minFrameHeight=this.options.initialFrameHeight=e),this.body.style.height=e+"px",!t&&this.trigger("setHeight")},addshortcutkey:function(e,t){var n={};t?n[e]=t:n=e,utils.extend(this.shortcutkeys,n)},_bindshortcutKeys:function(){var e=this,t=this.shortcutkeys;e.addListener("keydown",(function(n,i){var o=i.keyCode||i.which;for(var r in t)for(var a,s=t[r].split(","),l=0;a=s[l++];){a=a.split(":");var d=a[0],c=a[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(d.toLowerCase())||/^(\d+)$/.test(d))&&("ctrl"==RegExp.$1&&(i.ctrlKey||i.metaKey)&&(""==RegExp.$2||i[RegExp.$2.slice(1)+"Key"])&&o==RegExp.$3||o==RegExp.$1)&&(-1!=e.queryCommandState(r,c)&&e.execCommand(r,c),domUtils.preventDefault(i))}}))},getContent:function(e,t,n,i,o){var r=this;if(e&&utils.isFunction(e)&&(t=e,e=""),t?!t():!this.hasContents())return"";r.fireEvent("beforegetcontent");var a=UE.htmlparser(r.body.innerHTML,i);return r.filterOutputRule(a),r.fireEvent("aftergetcontent",e,a),a.toHtml(o)},getAllHtml:function(){var e=this,t=[];if(e.fireEvent("getAllHtml",t),browser.ie&&browser.version>8){var n="";utils.each(e.document.styleSheets,(function(e){n+=e.href?'<link rel="stylesheet" type="text/css" href="'+e.href+'" />':"<style>"+e.cssText+"</style>"})),utils.each(e.document.getElementsByTagName("script"),(function(e){n+=e.outerHTML}))}return"<html><head>"+(e.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+e.options.charset+'"/>':"")+(n||e.document.getElementsByTagName("head")[0].innerHTML)+t.join("\n")+"</head><body "+(ie&&browser.version<9?'class="view"':"")+">"+e.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var e=new RegExp(domUtils.fillChar,"g"),t=this.body.innerHTML.replace(/[\n\r]/g,"");return t=t.replace(/<(p|div)[^>]*>(<br\/?>| )<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,(function(e,t,n){return dtd.$block[n]?"\n":t||""})),t.replace(e,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){var e=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(e,"").replace(/\u00a0/g," ")},setContent:function(e,t,i){var o=this;o.fireEvent("beforesetcontent",e);var r,a=UE.htmlparser(e);function s(e){return"DIV"==e.tagName&&e.getAttribute("cdata_tag")}if(o.filterInputRule(a),e=a.toHtml(),o.body.innerHTML=(t?o.body.innerHTML:"")+e,"p"==o.options.enterTag){var l,d=this.body.firstChild;if(!d||1==d.nodeType&&(dtd.$cdata[d.tagName]||s(d)||domUtils.isCustomeNode(d))&&d===this.body.lastChild)this.body.innerHTML="<p>"+(browser.ie?" ":"<br/>")+"</p>"+this.body.innerHTML;else{var c=o.document.createElement("p");while(d){while(d&&(3==d.nodeType||1==d.nodeType&&dtd.p[d.tagName]&&!dtd.$cdata[d.tagName]))l=d.nextSibling,c.appendChild(d),d=l;if(c.firstChild){if(!d){o.body.appendChild(c);break}d.parentNode.insertBefore(c,d),c=o.document.createElement("p")}d=d.nextSibling}}}o.fireEvent("aftersetcontent"),o.fireEvent("contentchange"),!i&&o._selectionChange(),o._bakRange=o._bakIERange=o._bakNativeRange=null,browser.gecko&&(r=this.selection.getNative())&&r.removeAllRanges(),o.options.autoSyncData&&o.form&&n(o.form,o)},focus:function(e){try{var t=this,n=t.selection.getRange();if(e){var i=t.body.lastChild;i&&1==i.nodeType&&!dtd.$empty[i.tagName]&&(domUtils.isEmptyBlock(i)?n.setStartAtFirst(i):n.setStartAtLast(i),n.collapse(!0)),n.setCursor(!0)}else{if(!n.collapsed&&domUtils.isBody(n.startContainer)&&0==n.startOffset){i=t.body.firstChild;i&&1==i.nodeType&&!dtd.$empty[i.tagName]&&n.setStartAtFirst(i).collapse(!0)}n.select(!0)}this.fireEvent("focus selectionchange")}catch(o){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var e=this.selection.getNative();if(e.empty&&browser.ie){var t=document.body.createTextRange();t.moveToElementText(document.body),t.collapse(!0),t.select(),e.empty()}else e.removeAllRanges()},_initEvents:function(){var e=this,t=e.document,n=e.window;e._proxyDomEvent=utils.bind(e._proxyDomEvent,e),domUtils.on(t,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],e._proxyDomEvent),domUtils.on(n,["focus","blur"],e._proxyDomEvent),domUtils.on(e.body,"drop",(function(t){browser.gecko&&t.stopPropagation&&t.stopPropagation(),e.fireEvent("contentchange")})),domUtils.on(t,["mouseup","keydown"],(function(t){"keydown"==t.type&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)||2!=t.button&&e._selectionChange(250,t)}))},_proxyDomEvent:function(e){return!1!==this.fireEvent("before"+e.type.replace(/^on/,"").toLowerCase())&&(!1!==this.fireEvent(e.type.replace(/^on/,""),e)&&this.fireEvent("after"+e.type.replace(/^on/,"").toLowerCase()))},_selectionChange:function(t,n){var i,o,r=this,a=!1;if(browser.ie&&browser.version<9&&n&&"mouseup"==n.type){var s=this.selection.getRange();s.collapsed||(a=!0,i=n.clientX,o=n.clientY)}clearTimeout(e),e=setTimeout((function(){if(r.selection&&r.selection.getNative()){var e,t;if(a&&"None"==r.selection.getNative().type){e=r.document.body.createTextRange();try{e.moveToPoint(i,o)}catch(s){e=null}}e&&(t=r.selection.getIERange,r.selection.getIERange=function(){return e}),r.selection.cache(),t&&(r.selection.getIERange=t),r.selection._cachedRange&&r.selection._cachedStartElement&&(r.fireEvent("beforeselectionchange"),r.fireEvent("selectionchange",!!n),r.fireEvent("afterselectionchange"),r.selection.clear())}}),t||50)},_callCmdFn:function(e,t){var n,i,o=t[0].toLowerCase();return n=this.commands[o]||UE.commands[o],i=n&&n[e],n&&i||"queryCommandState"!=e?i?i.apply(this,t):void 0:0},execCommand:function(e){e=e.toLowerCase();var t,n=this,i=n.commands[e]||UE.commands[e];return i&&i.execCommand?(i.notNeedUndo||n.__hasEnterExecCommand?(t=this._callCmdFn("execCommand",arguments),!n.__hasEnterExecCommand&&!i.ignoreContentChange&&!n._ignoreContentChange&&n.fireEvent("contentchange")):(n.__hasEnterExecCommand=!0,-1!=n.queryCommandState.apply(n,arguments)&&(n.fireEvent("saveScene"),n.fireEvent.apply(n,["beforeexeccommand",e].concat(arguments)),t=this._callCmdFn("execCommand",arguments),n.fireEvent.apply(n,["afterexeccommand",e].concat(arguments)),n.fireEvent("saveScene")),n.__hasEnterExecCommand=!1),!n.__hasEnterExecCommand&&!i.ignoreContentChange&&!n._ignoreContentChange&&n._selectionChange(),t):null},queryCommandState:function(e){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(e){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(e){if(e)for(var t,n=0;t=e[n++];)if(this.document.getElementsByTagName(t).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(e=["div"],n=0;t=e[n++];)for(var i,o=domUtils.getElementsByTagName(this.document,t),r=0;i=o[r++];)if(domUtils.isCustomeNode(i))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var e,t=this;if("false"==t.body.contentEditable){t.body.contentEditable=!0,e=t.selection.getRange();try{e.moveToBookmark(t.lastBk),delete t.lastBk}catch(n){e.setStartAtFirst(t.body).collapse(!0)}e.select(!0),t.bkqueryCommandState&&(t.queryCommandState=t.bkqueryCommandState,delete t.bkqueryCommandState),t.bkqueryCommandValue&&(t.queryCommandValue=t.bkqueryCommandValue,delete t.bkqueryCommandValue),t.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(e){var t=this;e=e?utils.isArray(e)?e:[e]:[],"true"==t.body.contentEditable&&(t.lastBk||(t.lastBk=t.selection.getRange().createBookmark(!0)),t.body.contentEditable=!1,t.bkqueryCommandState=t.queryCommandState,t.bkqueryCommandValue=t.queryCommandValue,t.queryCommandState=function(n){return-1!=utils.indexOf(e,n)?t.bkqueryCommandState.apply(t,arguments):-1},t.queryCommandValue=function(n){return-1!=utils.indexOf(e,n)?t.bkqueryCommandValue.apply(t,arguments):null},t.fireEvent("selectionchange"))},disable:function(e){return this.setDisabled(e)},_setDefaultContent:function(){function e(){var t=this;t.document.getElementById("initContent")&&(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",t.removeListener("firstBeforeExecCommand focus",e),setTimeout((function(){t.focus(),t._selectionChange()}),0))}return function(t){var n=this;n.body.innerHTML='<p id="initContent">'+t+"</p>",n.addListener("firstBeforeExecCommand focus",e)}}(),setShow:function(){var e=this,t=e.selection.getRange();if("none"==e.container.style.display){try{t.moveToBookmark(e.lastBk),delete e.lastBk}catch(n){t.setStartAtFirst(e.body).collapse(!0)}setTimeout((function(){t.select(!0)}),100),e.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var e=this;e.lastBk||(e.lastBk=e.selection.getRange().createBookmark(!0)),e.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(e){if(!this.options)return"";var t=UE.I18N[this.options.lang];if(!t)throw Error("not import language file");e=(e||"").split(".");for(var n,i=0;n=e[i++];)if(t=t[n],!t)break;return t},getContentLength:function(e,t){var n=this.getContent(!1,!1,!0).length;if(e){t=(t||[]).concat(["hr","img","iframe"]),n=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var i,o=0;i=t[o++];)n+=this.document.getElementsByTagName(i).length}return n},addInputRule:function(e){this.inputRules.push(e)},filterInputRule:function(e){for(var t,n=0;t=this.inputRules[n++];)t.call(this,e)},addOutputRule:function(e){this.outputRules.push(e)},filterOutputRule:function(e){for(var t,n=0;t=this.outputRules[n++];)t.call(this,e)},getActionUrl:function(e){var t=this.getOpt(e)||e,n=this.getOpt("imageUrl"),i=this.getOpt("serverUrl");return!i&&n&&(i=n.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2")),i?(i=i+(-1==i.indexOf("?")?"?":"&")+"action="+(t||""),utils.formatUrl(i)):""}},utils.inherits(r,EventBase)}(),UE.Editor.defaultOptions=function(e){var t=e.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:t+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:t+"lang/",theme:"default",themePath:t+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}},function(){UE.Editor.prototype.loadServerConfig=function(){var me=this;function showErrorMsg(e){console&&console.error(e)}setTimeout((function(){try{me.options.imageUrl&&me.setOpt("serverUrl",me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var configUrl=me.getActionUrl("config"),isJsonp=utils.isCrossDomainUrl(configUrl);me._serverConfigLoaded=!1,configUrl&&UE.ajax.request(configUrl,{method:"GET",dataType:isJsonp?"jsonp":"",onsuccess:function onsuccess(r){try{var config=isJsonp?r:eval("("+r.responseText+")");utils.extend(me.options,config),me.fireEvent("serverConfigLoaded"),me._serverConfigLoaded=!0}catch(e){showErrorMsg(me.getLang("loadconfigFormatError"))}},onerror:function(){showErrorMsg(me.getLang("loadconfigHttpError"))}})}catch(e){showErrorMsg(me.getLang("loadconfigError"))}}))},UE.Editor.prototype.isServerConfigLoaded=function(){var e=this;return e._serverConfigLoaded||!1},UE.Editor.prototype.afterConfigReady=function(e){if(e&&utils.isFunction(e)){var t=this,n=function n(){e.apply(t,arguments),t.removeListener("serverConfigLoaded",n)};t.isServerConfigLoaded()?e.call(t,"serverConfigLoaded"):t.addListener("serverConfigLoaded",n)}}}(),UE.ajax=function(){var e="XMLHttpRequest()";try{new ActiveXObject("Msxml2.XMLHTTP"),e="ActiveXObject('Msxml2.XMLHTTP')"}catch(r){try{new ActiveXObject("Microsoft.XMLHTTP"),e="ActiveXObject('Microsoft.XMLHTTP')"}catch(r){}}var t=new Function("return new "+e);function n(e){var t=[];for(var n in e)if("method"!=n&&"timeout"!=n&&"async"!=n&&"dataType"!=n&&"callback"!=n&&void 0!=e[n]&&null!=e[n])if("function"!=Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(e[n]).toLowerCase()&&"object"!=Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(e[n]).toLowerCase())t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));else if(utils.isArray(e[n]))for(var i=0;i<e[n].length;i++)t.push(encodeURIComponent(n)+"[]="+encodeURIComponent(e[n][i]));return t.join("&")}function i(e,i){var o=t(),r=!1,a={method:"POST",timeout:5e3,async:!0,data:{},onsuccess:function(){},onerror:function(){}};if("object"===Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(e)&&(i=e,e=i.url),o&&e){var s=i?utils.extend(a,i):a,l=n(s);utils.isEmptyObject(s.data)||(l+=(l?"&":"")+n(s.data));var d=setTimeout((function(){4!=o.readyState&&(r=!0,o.abort(),clearTimeout(d))}),s.timeout),c=s.method.toUpperCase(),u=e+(-1==e.indexOf("?")?"?":"&")+("POST"==c?"":l+"&noCache="+ +new Date);o.open(c,u,s.async),o.onreadystatechange=function(){4==o.readyState&&(r||200!=o.status?s.onerror(o):s.onsuccess(o))},"POST"==c?(o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(l)):o.send(null)}}function o(e,t){var i,o,a,s=t.onsuccess||function(){},l=document.createElement("SCRIPT"),d=t||{},c=d["charset"],u=d["jsonp"]||"callback",m=d["timeOut"]||0,f=new RegExp("(\\?|&)"+u+"=([^&]*)");utils.isFunction(s)?(i="bd__editor__"+Math.floor(2147483648*Math.random()).toString(36),window[i]=g(0)):utils.isString(s)?i=s:(a=f.exec(e))&&(i=a[2]),e=e.replace(f,"$1"+u+"="+i),e.search(f)<0&&(e+=(e.indexOf("?")<0?"?":"&")+u+"="+i);var h=n(t);function p(e,t,n){e.setAttribute("type","text/javascript"),e.setAttribute("defer","defer"),n&&e.setAttribute("charset",n),e.setAttribute("src",t),document.getElementsByTagName("head")[0].appendChild(e)}function g(e){return function(){try{if(e)d.onerror&&d.onerror();else try{clearTimeout(o),s.apply(window,arguments)}catch(r){}}catch(t){d.onerror&&d.onerror.call(window,t)}finally{d.oncomplete&&d.oncomplete.apply(window,arguments),l.parentNode&&l.parentNode.removeChild(l),window[i]=null;try{delete window[i]}catch(r){}}}}utils.isEmptyObject(t.data)||(h+=(h?"&":"")+n(t.data)),h&&(e=e.replace(/\?/,"?"+h+"&")),l.onerror=g(1),m&&(o=setTimeout(g(1),m)),p(l,e,c)}return{request:function(e,t){t&&"jsonp"==t.dataType?o(e,t):i(e,t)},getJSONP:function(e,t,n){var i={data:t,oncomplete:n};o(e,i)}}}();var filterWord=UE.filterWord=function(){function e(e){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/gi.test(e)}function t(e){return e=e.replace(/[\d.]+\w+/g,(function(e){return utils.transUnitToPx(e)})),e}function n(e){return e.replace(/[\t\r\n]+/g," ").replace(/<!--[\s\S]*?-->/gi,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,(function(e){if(browser.opera)return"";try{if(/Bitmap/i.test(e))return"";var n=e.match(/width:([ \d.]*p[tx])/i)[1],i=e.match(/height:([ \d.]*p[tx])/i)[1],o=e.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+t(n)+'" height="'+t(i)+'" src="'+o+'" />'}catch(r){return""}})).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,(function(e,t,n,i){return"class"==t&&"MsoListParagraph"==i?e:""})).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,(function(e,t,n){return n.replace(/[\t\r\n ]+/g," ")})).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,(function(e,n,i,o){for(var r,a=[],s=o.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").replace(/[\d.]+(cm|pt)/g,(function(e){return utils.transUnitToPx(e)})).split(/;\s*/g),l=0;r=s[l];l++){var d,c,u=r.split(":");if(2==u.length){if(d=u[0].toLowerCase(),c=u[1].toLowerCase(),/^(background)\w*/.test(d)&&0==c.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(d)&&/^0\w+$/.test(c))continue;switch(d){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/<table/.test(n)||(a[l]=d.replace(/^mso-|-alt$/g,"")+":"+t(c));continue;case"horiz-align":a[l]="text-align:"+c;continue;case"vert-align":a[l]="vertical-align:"+c;continue;case"font-color":case"mso-foreground":a[l]="color:"+c;continue;case"mso-background":case"mso-highlight":a[l]="background:"+c;continue;case"mso-default-height":a[l]="min-height:"+t(c);continue;case"mso-default-width":a[l]="min-width:"+t(c);continue;case"mso-padding-between-alt":a[l]="border-collapse:separate;border-spacing:"+t(c);continue;case"text-line-through":"single"!=c&&"double"!=c||(a[l]="text-decoration:line-through");continue;case"mso-zero-height":"yes"==c&&(a[l]="display:none");continue;case"margin":if(!/[1-9]/.test(c))continue}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(d)||/text\-indent|padding|margin/.test(d)&&/\-[\d.]+/.test(c))continue;a[l]=d+":"+u[1]}}return n+(a.length?' style="'+a.join(";").replace(/;{2,}/g,";")+'"':"")}))}return function(t){return e(t)?n(t):t}}();(function(){var e=UE.uNode=function(e){this.type=e.type,this.data=e.data,this.tagName=e.tagName,this.parentNode=e.parentNode,this.attrs=e.attrs||{},this.children=e.children},t={href:1,src:1,_src:1,_href:1,cdata_data:1},n={style:1,script:1},i=" ",o="\n";function r(e,t,n){return e.push(o),t+(n?1:-1)}function a(e,t){for(var n=0;n<t;n++)e.push(i)}function s(e,t,n,i){switch(e.type){case"root":for(var o,u=0;o=e.children[u++];)n&&"element"==o.type&&!dtd.$inlineWithA[o.tagName]&&u>1&&(r(t,i,!0),a(t,i)),s(o,t,n,i);break;case"text":l(e,t);break;case"element":d(e,t,n,i);break;case"comment":c(e,t,n)}return t}function l(e,t){"pre"==e.parentNode.tagName?t.push(e.data):t.push(n[e.parentNode.tagName]?utils.html(e.data):e.data.replace(/[ ]{2}/g," "))}function d(e,n,i,o){var l="";if(e.attrs){l=[];var d=e.attrs;for(var c in d)l.push(c+(void 0!==d[c]?'="'+(t[c]?utils.html(d[c]).replace(/["]/g,(function(e){return"""})):utils.unhtml(d[c]))+'"':""));l=l.join(" ")}if(n.push("<"+e.tagName+(l?" "+l:"")+(dtd.$empty[e.tagName]?"/":"")+">"),i&&!dtd.$inlineWithA[e.tagName]&&"pre"!=e.tagName&&e.children&&e.children.length&&(o=r(n,o,!0),a(n,o)),e.children&&e.children.length)for(var u,m=0;u=e.children[m++];)i&&"element"==u.type&&!dtd.$inlineWithA[u.tagName]&&m>1&&(r(n,o),a(n,o)),s(u,n,i,o);dtd.$empty[e.tagName]||(i&&!dtd.$inlineWithA[e.tagName]&&"pre"!=e.tagName&&e.children&&e.children.length&&(o=r(n,o),a(n,o)),n.push("</"+e.tagName+">"))}function c(e,t){t.push("\x3c!--"+e.data+"--\x3e")}function u(e,t){var n;if("element"==e.type&&e.getAttr("id")==t)return e;if(e.children&&e.children.length)for(var i,o=0;i=e.children[o++];)if(n=u(i,t))return n}function m(e,t,n){if("element"==e.type&&e.tagName==t&&n.push(e),e.children&&e.children.length)for(var i,o=0;i=e.children[o++];)m(i,t,n)}function f(e,t){if(e.children&&e.children.length)for(var n,i=0;n=e.children[i];)f(n,t),n.parentNode&&(n.children&&n.children.length&&t(n),n.parentNode&&i++);else t(e)}e.createElement=function(t){return/[<>]/.test(t)?UE.htmlparser(t).children[0]:new e({type:"element",children:[],tagName:t})},e.createText=function(e,t){return new UE.uNode({type:"text",data:t?e:utils.unhtml(e||"")})},e.prototype={toHtml:function(e){var t=[];return s(this,t,e,0),t.join("")},innerHTML:function(e){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(e)){if(this.children)for(var t=0;n=this.children[t++];)n.parentNode=null;this.children=[];var n,i=UE.htmlparser(e);for(t=0;n=i.children[t++];)this.children.push(n),n.parentNode=this;return this}i=new UE.uNode({type:"root",children:this.children});return i.toHtml()},innerText:function(t,n){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(t){if(this.children)for(var i,o=0;i=this.children[o++];)i.parentNode=null;return this.children=[],this.appendChild(e.createText(t,n)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var e,t=this.parentNode,n=0;e=t.children[n];n++)if(e===this)return 0==n?null:t.children[n-1]},nextSibling:function(){for(var e,t=this.parentNode,n=0;e=t.children[n++];)if(e===this)return t.children[n]},replaceChild:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,i=0;n=this.children[i];i++)if(n===t)return this.children.splice(i,1,e),t.parentNode=null,e.parentNode=this,e}},appendChild:function(e){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),e.parentNode&&e.parentNode.removeChild(e);for(var t,n=0;t=this.children[n];n++)if(t===e){this.children.splice(n,1);break}return this.children.push(e),e.parentNode=this,e}},insertBefore:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,i=0;n=this.children[i];i++)if(n===t)return this.children.splice(i,0,e),e.parentNode=this,e}},insertAfter:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,i=0;n=this.children[i];i++)if(n===t)return this.children.splice(i+1,0,e),e.parentNode=this,e}},removeChild:function(e,t){if(this.children)for(var n,i=0;n=this.children[i];i++)if(n===e){if(this.children.splice(i,1),n.parentNode=null,t&&n.children&&n.children.length)for(var o,r=0;o=n.children[r];r++)this.children.splice(i+r,0,o),o.parentNode=this;return n}},getAttr:function(e){return this.attrs&&this.attrs[e.toLowerCase()]},setAttr:function(e,t){if(e)if(this.attrs||(this.attrs={}),utils.isObject(e))for(var n in e)e[n]?this.attrs[n.toLowerCase()]=e[n]:delete this.attrs[n];else t?this.attrs[e.toLowerCase()]=t:delete this.attrs[e];else delete this.attrs},getIndex:function(){for(var e,t=this.parentNode,n=0;e=t.children[n];n++)if(e===this)return n;return-1},getNodeById:function(e){var t;if(this.children&&this.children.length)for(var n,i=0;n=this.children[i++];)if(t=u(n,e))return t},getNodesByTagName:function(e){e=utils.trim(e).replace(/[ ]{2,}/g," ").split(" ");var t=[],n=this;return utils.each(e,(function(e){if(n.children&&n.children.length)for(var i,o=0;i=n.children[o++];)m(i,e,t)})),t},getStyle:function(e){var t=this.getAttr("style");if(!t)return"";var n=new RegExp("(^|;)\\s*"+e+":([^;]+)","i"),i=t.match(n);return i&&i[0]?i[2]:""},setStyle:function(e,t){function n(e,t){var n=new RegExp("(^|;)\\s*"+e+":([^;]+;?)","gi");i=i.replace(n,"$1"),t&&(i=e+":"+utils.unhtml(t)+";"+i)}var i=this.getAttr("style");if(i||(i=""),utils.isObject(e))for(var o in e)n(o,e[o]);else n(e,t);this.setAttr("style",utils.trim(i))},traversal:function(e){return this.children&&this.children.length&&f(this,e),this}}})();var htmlparser=UE.htmlparser=function(e,t){var n=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,i=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,o={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};e=e.replace(new RegExp(domUtils.fillChar,"g"),""),t||(e=e.replace(new RegExp("[\\r\\t\\n"+(t?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(t?"":" ")+"]*","g"),(function(e,n){return n&&o[n.toLowerCase()]?e.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):e.replace(new RegExp("^[\\r\\n"+(t?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(t?"":" ")+"]+$"),"")})));var r={href:1,src:1},a=UE.uNode,s={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},l={ol:"li",ul:"li"};function d(e,t){if(l[e.tagName]){var n=a.createElement(l[e.tagName]);e.appendChild(n),n.appendChild(a.createText(t)),e=n}else e.appendChild(a.createText(t))}function c(e,t,n){var o;if(o=s[t]){var l,d=e;while("root"!=d.type){if(utils.isArray(o)?-1!=utils.indexOf(o,d.tagName):o==d.tagName){e=d,l=!0;break}d=d.parentNode}l||(e=c(e,utils.isArray(o)?o[0]:o))}var u=new a({parentNode:e,type:"element",tagName:t.toLowerCase(),children:dtd.$empty[t]?null:[]});if(n){var m,f={};while(m=i.exec(n))f[m[1].toLowerCase()]=r[m[1].toLowerCase()]?m[2]||m[3]||m[4]:utils.unhtml(m[2]||m[3]||m[4]);u.attrs=f}return e.children.push(u),dtd.$empty[t]?e:u}function u(e,t){e.children.push(new a({type:"comment",data:t,parentNode:e}))}var m,f=0,h=0,p=new a({type:"root",children:[]}),g=p;while(m=n.exec(e)){f=m.index;try{if(f>h&&d(g,e.slice(h,f)),m[3])dtd.$cdata[g.tagName]?d(g,m[0]):g=c(g,m[3].toLowerCase(),m[4]);else if(m[1]){if("root"!=g.type)if(dtd.$cdata[g.tagName]&&!dtd.$cdata[m[1]])d(g,m[0]);else{var b=g;while("element"==g.type&&g.tagName!=m[1].toLowerCase())if(g=g.parentNode,"root"==g.type)throw g=b,"break";g=g.parentNode}}else m[2]&&u(g,m[2])}catch(v){}h=n.lastIndex}return h<e.length&&d(g,e.slice(h)),p},filterNode=UE.filterNode=function(){function e(t,n){switch(t.type){case"text":break;case"element":var i;if(i=n[t.tagName])if("-"===i)t.parentNode.removeChild(t);else if(utils.isFunction(i)){var o=t.parentNode,r=t.getIndex();if(i(t),t.parentNode){if(t.children)for(var a=0;m=t.children[a];)e(m,n),m.parentNode&&a++}else for(a=r;m=o.children[a];)e(m,n),m.parentNode&&a++}else{var s=i["$"];if(s&&t.attrs){var l,d={};for(var c in s){if(l=t.getAttr(c),"style"==c&&utils.isArray(s[c])){var u=[];utils.each(s[c],(function(e){var n;(n=t.getStyle(e))&&u.push(e+":"+n)})),l=u.join(";")}l&&(d[c]=l)}t.attrs=d}if(t.children)for(a=0;m=t.children[a];)e(m,n),m.parentNode&&a++}else if(dtd.$cdata[t.tagName])t.parentNode.removeChild(t);else{o=t.parentNode,r=t.getIndex();t.parentNode.removeChild(t,!0);var m;for(a=r;m=o.children[a];)e(m,n),m.parentNode&&a++}break;case"comment":t.parentNode.removeChild(t)}}return function(t,n){if(utils.isEmptyObject(n))return t;var i;(i=n["-"])&&utils.each(i.split(" "),(function(e){n[e]="-"}));for(var o,r=0;o=t.children[r];)e(o,n),o.parentNode&&r++;return t}}();UE.plugin=function(){var e={};return{register:function(t,n,i,o){i&&utils.isFunction(i)&&(o=i,i=null),e[t]={optionName:i||t,execFn:n,afterDisabled:o}},load:function(t){utils.each(e,(function(e){var n=e.execFn.call(t);!1!==t.options[e.optionName]?n&&utils.each(n,(function(e,n){switch(n.toLowerCase()){case"shortcutkey":t.addshortcutkey(e);break;case"bindevents":utils.each(e,(function(e,n){t.addListener(n,e)}));break;case"bindmultievents":utils.each(utils.isArray(e)?e:[e],(function(e){var n=utils.trim(e.type).split(/\s+/);utils.each(n,(function(n){t.addListener(n,e.handler)}))}));break;case"commands":utils.each(e,(function(e,n){t.commands[n]=e}));break;case"outputrule":t.addOutputRule(e);break;case"inputrule":t.addInputRule(e);break;case"defaultoptions":t.setOpt(e)}})):e.afterDisabled&&e.afterDisabled.call(t)})),utils.each(UE.plugins,(function(e){e.call(t)}))},run:function(t,n){var i=e[t];i&&i.exeFn.call(n)}}}();var keymap=UE.keymap={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,CapsLock:20,Esc:27,Spacebar:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Del:46,NumLock:144,Cmd:91,"=":187,"-":189,b:66,i:73,z:90,y:89,v:86,x:88,s:83,n:78},LocalStorage=UE.LocalStorage=function(){var e=window.localStorage||n()||null,t="localStorage";return{saveLocalData:function(t,n){return!(!e||!n)&&(e.setItem(t,n),!0)},getLocalData:function(t){return e?e.getItem(t):null},removeItem:function(t){e&&e.removeItem(t)}};function n(){var e=document.createElement("div");return e.style.display="none",e.addBehavior?(e.addBehavior("#default#userdata"),{getItem:function(n){var i=null;try{document.body.appendChild(e),e.load(t),i=e.getAttribute(n),document.body.removeChild(e)}catch(o){}return i},setItem:function(n,i){document.body.appendChild(e),e.setAttribute(n,i),e.save(t),document.body.removeChild(e)},removeItem:function(n){document.body.appendChild(e),e.removeAttribute(n),e.save(t),document.body.removeChild(e)}}):null}}();(function(){var e="ueditor_preference";UE.Editor.prototype.setPreferences=function(t,n){var i={};utils.isString(t)?i[t]=n:i=t;var o=LocalStorage.getLocalData(e);o&&(o=utils.str2json(o))?utils.extend(o,i):o=i,o&&LocalStorage.saveLocalData(e,utils.json2str(o))},UE.Editor.prototype.getPreferences=function(t){var n=LocalStorage.getLocalData(e);return n&&(n=utils.str2json(n))?t?n[t]:n:null},UE.Editor.prototype.removePreferences=function(t){var n=LocalStorage.getLocalData(e);n&&(n=utils.str2json(n))&&(n[t]=void 0,delete n[t]),n&&LocalStorage.saveLocalData(e,utils.json2str(n))}})(),UE.plugins["defaultfilter"]=function(){var e=this;e.setOpt({allowDivTransToP:!0,disabledTableInTable:!0}),e.addInputRule((function(t){var n,i=this.options.allowDivTransToP;function o(e){while(e&&"element"==e.type){if("td"==e.tagName)return!0;e=e.parentNode}return!1}t.traversal((function(t){if("element"==t.type){if(!dtd.$cdata[t.tagName]&&e.options.autoClearEmptyNode&&dtd.$inline[t.tagName]&&!dtd.$empty[t.tagName]&&(!t.attrs||utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"style":case"script":t.setAttr({cdata_tag:t.tagName,cdata_data:t.innerHTML()||"",_ue_custom_node_:"true"}),t.tagName="div",t.innerHTML("");break;case"a":(n=t.getAttr("href"))&&t.setAttr("_href",n);break;case"img":if((n=t.getAttr("src"))&&/^data:/.test(n)){t.parentNode.removeChild(t);break}t.setAttr("_src",t.getAttr("src"));break;case"span":browser.webkit&&(n=t.getStyle("white-space"))&&/nowrap|normal/.test(n)&&(t.setStyle("white-space",""),e.options.autoClearEmptyNode&&utils.isEmptyObject(t.attrs)&&t.parentNode.removeChild(t,!0)),n=t.getAttr("id"),n&&/^_baidu_bookmark_/i.test(n)&&t.parentNode.removeChild(t);break;case"p":(n=t.getAttr("align"))&&(t.setAttr("align"),t.setStyle("text-align",n)),utils.each(t.children,(function(e){if("element"==e.type&&"p"==e.tagName){var n=e.nextSibling();t.parentNode.insertAfter(e,t);var i=e;while(n){var o=n.nextSibling();t.parentNode.insertAfter(n,i),i=n,n=o}return!1}})),t.firstChild()||t.innerHTML(browser.ie?" ":"<br/>");break;case"div":if(t.getAttr("cdata_tag"))break;if(n=t.getAttr("class"),n&&/^line number\d+/.test(n))break;if(!i)break;var r,a=UE.uNode.createElement("p");while(r=t.firstChild())"text"!=r.type&&UE.dom.dtd.$block[r.tagName]?a.firstChild()?(t.parentNode.insertBefore(a,t),a=UE.uNode.createElement("p")):t.parentNode.insertBefore(r,t):a.appendChild(r);a.firstChild()&&t.parentNode.insertBefore(a,t),t.parentNode.removeChild(t);break;case"dl":t.tagName="ul";break;case"dt":case"dd":t.tagName="li";break;case"li":var s=t.getAttr("class");s&&/list\-/.test(s)||t.setAttr();var l=t.getNodesByTagName("ol ul");UE.utils.each(l,(function(e){t.parentNode.insertAfter(e,t)}));break;case"td":case"th":case"caption":t.children&&t.children.length||t.appendChild(browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":e.options.disabledTableInTable&&o(t)&&(t.parentNode.insertBefore(UE.uNode.createText(t.innerText()),t),t.parentNode.removeChild(t))}}}))})),e.addOutputRule((function(t){var n;t.traversal((function(t){if("element"==t.type){if(e.options.autoClearEmptyNode&&dtd.$inline[t.tagName]&&!dtd.$empty[t.tagName]&&(!t.attrs||utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"div":(n=t.getAttr("cdata_tag"))&&(t.tagName=n,t.appendChild(UE.uNode.createText(t.getAttr("cdata_data"))),t.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(n=t.getAttr("_href"))&&t.setAttr({href:utils.html(n),_href:""});break;case"span":n=t.getAttr("id"),n&&/^_baidu_bookmark_/i.test(n)&&t.parentNode.removeChild(t);break;case"img":(n=t.getAttr("_src"))&&t.setAttr({src:t.getAttr("_src"),_src:""})}}}))}))},UE.commands["inserthtml"]={execCommand:function(e,t,n){var i,o,r=this;if(t&&!0!==r.fireEvent("beforeinserthtml",t)){if(i=r.selection.getRange(),o=i.document.createElement("div"),o.style.display="inline",!n){var a=UE.htmlparser(t);r.options.filterRules&&UE.filterNode(a,r.options.filterRules),r.filterInputRule(a),t=a.toHtml()}if(o.innerHTML=utils.trim(t),!i.collapsed){var s=i.startContainer;if(domUtils.isFillChar(s)&&i.setStartBefore(s),s=i.endContainer,domUtils.isFillChar(s)&&i.setEndAfter(s),i.txtToElmBoundary(),i.endContainer&&1==i.endContainer.nodeType&&(s=i.endContainer.childNodes[i.endOffset],s&&domUtils.isBr(s)&&i.setEndAfter(s)),0==i.startOffset&&(s=i.startContainer,domUtils.isBoundaryNode(s,"firstChild")&&(s=i.endContainer,i.endOffset==(3==s.nodeType?s.nodeValue.length:s.childNodes.length)&&domUtils.isBoundaryNode(s,"lastChild")&&(r.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",i.setStart(r.body.firstChild,0).collapse(!0)))),!i.collapsed&&i.deleteContents(),1==i.startContainer.nodeType){var l=i.startContainer.childNodes[i.startOffset];if(l&&domUtils.isBlockElm(l)&&(b=l.previousSibling)&&domUtils.isBlockElm(b)){i.setEnd(b,b.childNodes.length).collapse();while(l.firstChild)b.appendChild(l.firstChild);domUtils.remove(l)}}}var d,c,u,m=0;i.inFillChar()&&(l=i.startContainer,domUtils.isFillChar(l)?(i.setStartBefore(l).collapse(!0),domUtils.remove(l)):domUtils.isFillChar(l,!0)&&(l.nodeValue=l.nodeValue.replace(fillCharReg,""),i.startOffset--,i.collapsed&&i.collapse(!0)));var f=domUtils.findParentByTagName(i.startContainer,"li",!0);if(f){var h;while(l=o.firstChild){while(l&&(3==l.nodeType||!domUtils.isBlockElm(l)||"HR"==l.tagName))v=l.nextSibling,i.insertNode(l).collapse(),h=l,l=v;if(l)if(/^(ol|ul)$/i.test(l.tagName)){while(l.firstChild)h=l.firstChild,domUtils.insertAfter(f,l.firstChild),f=f.nextSibling;domUtils.remove(l)}else{var p;v=l.nextSibling,p=r.document.createElement("li"),domUtils.insertAfter(f,p),p.appendChild(l),h=l,l=v,f=p}}f=domUtils.findParentByTagName(i.startContainer,"li",!0),domUtils.isEmptyBlock(f)&&domUtils.remove(f),h&&i.setStartAfter(h).collapse(!0).select(!0)}else{while(l=o.firstChild){if(m){var g=r.document.createElement("p");while(l&&(3==l.nodeType||!dtd.$block[l.tagName]))u=l.nextSibling,g.appendChild(l),l=u;g.firstChild&&(l=g)}if(i.insertNode(l),u=l.nextSibling,!m&&l.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(l)&&(d=domUtils.findParent(l,(function(e){return domUtils.isBlockElm(e)})),d&&"body"!=d.tagName.toLowerCase()&&(!dtd[d.tagName][l.nodeName]||l.parentNode!==d))){if(dtd[d.tagName][l.nodeName]){c=l.parentNode;while(c!==d)b=c,c=c.parentNode}else b=d;domUtils.breakParent(l,b||c);var b=l.previousSibling;domUtils.trimWhiteTextNode(b),b.childNodes.length||domUtils.remove(b),!browser.ie&&(v=l.nextSibling)&&domUtils.isBlockElm(v)&&v.lastChild&&!domUtils.isBr(v.lastChild)&&v.appendChild(r.document.createElement("br")),m=1}var v=l.nextSibling;if(!o.firstChild&&v&&domUtils.isBlockElm(v)){i.setStart(v,0).collapse(!0);break}i.setEndAfter(l).collapse()}if(l=i.startContainer,u&&domUtils.isBr(u)&&domUtils.remove(u),domUtils.isBlockElm(l)&&domUtils.isEmptyNode(l))if(u=l.nextSibling)domUtils.remove(l),1==u.nodeType&&dtd.$block[u.tagName]&&i.setStart(u,0).collapse(!0).shrinkBoundary();else try{l.innerHTML=browser.ie?domUtils.fillChar:"<br/>"}catch(y){i.setStartBefore(l),domUtils.remove(l)}try{i.select(!0)}catch(y){}}setTimeout((function(){i=r.selection.getRange(),i.scrollToView(r.autoHeightEnabled,r.autoHeightEnabled?domUtils.getXY(r.iframe).y:0),r.fireEvent("afterinserthtml",t)}),200)}}},UE.plugins["autotypeset"]=function(){this.setOpt({autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:utils.extend({div:1},dtd.$removeEmpty),indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1}});var e,t=this,n=t.options.autotypeset,i={selectTdClass:1,pagebreak:1,anchorclass:1},o={li:1},r={div:1,p:1,blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,span:1};function a(t,n){return t&&3!=t.nodeType?domUtils.isBr(t)?1:t&&t.parentNode&&r[t.tagName.toLowerCase()]?e&&e.contains(t)||t.getAttribute("pagebreak")?0:n?!domUtils.isEmptyBlock(t):domUtils.isEmptyBlock(t,new RegExp("[\\s"+domUtils.fillChar+"]","g")):void 0:0}function s(e){e.style.cssText||(domUtils.removeAttributes(e,["style"]),"span"==e.tagName.toLowerCase()&&domUtils.hasNoAttributes(e)&&domUtils.remove(e,!0))}function l(t,r){var l,u=this;if(r){if(!n.pasteFilter)return;l=u.document.createElement("div"),l.innerHTML=r.html}else l=u.document.body;for(var m,f=domUtils.getElementsByTagName(l,"*"),h=0;m=f[h++];)if(!0!==u.fireEvent("excludeNodeinautotype",m)){if(n.clearFontSize&&m.style.fontSize&&(domUtils.removeStyle(m,"font-size"),s(m)),n.clearFontFamily&&m.style.fontFamily&&(domUtils.removeStyle(m,"font-family"),s(m)),a(m)){if(n.mergeEmptyline){var p=m.nextSibling,g=domUtils.isBr(m);while(a(p)){if(v=p,p=v.nextSibling,g&&(!p||p&&!domUtils.isBr(p)))break;domUtils.remove(v)}}if(n.removeEmptyline&&domUtils.inDoc(m,l)&&!o[m.parentNode.tagName.toLowerCase()]){if(domUtils.isBr(m)&&(p=m.nextSibling,p&&!domUtils.isBr(p)))continue;domUtils.remove(m);continue}}if(a(m,!0)&&"SPAN"!=m.tagName&&(n.indent&&(m.style.textIndent=n.indentValue),n.textAlign&&(m.style.textAlign=n.textAlign)),n.removeClass&&m.className&&!i[m.className.toLowerCase()]){if(e&&e.contains(m))continue;domUtils.removeAttributes(m,["class"])}if(n.imageBlockLine&&"img"==m.tagName.toLowerCase()&&!m.getAttribute("emotion"))if(r){var b=m;switch(n.imageBlockLine){case"left":case"right":case"none":var v,y,C=b.parentNode;while(dtd.$inline[C.tagName]||"A"==C.tagName)C=C.parentNode;if(v=C,"P"==v.tagName&&"center"==domUtils.getStyle(v,"text-align")&&!domUtils.isBody(v)&&1==domUtils.getChildCount(v,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)})))if(y=v.previousSibling,p=v.nextSibling,y&&p&&1==y.nodeType&&1==p.nodeType&&y.tagName==p.tagName&&domUtils.isBlockElm(y)){y.appendChild(v.firstChild);while(p.firstChild)y.appendChild(p.firstChild);domUtils.remove(v),domUtils.remove(p)}else domUtils.setStyle(v,"text-align","");domUtils.setStyle(b,"float",n.imageBlockLine);break;case"center":if("center"!=u.queryCommandValue("imagefloat")){C=b.parentNode,domUtils.setStyle(b,"float","none"),v=b;while(C&&1==domUtils.getChildCount(C,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)}))&&(dtd.$inline[C.tagName]||"A"==C.tagName))v=C,C=C.parentNode;var w=u.document.createElement("p");domUtils.setAttributes(w,{style:"text-align:center"}),v.parentNode.insertBefore(w,v),w.appendChild(v),domUtils.setStyle(v,"float","")}}}else{var x=u.selection.getRange();x.selectNode(m).select(),u.execCommand("imagefloat",n.imageBlockLine)}n.removeEmptyNode&&n.removeTagNames[m.tagName.toLowerCase()]&&domUtils.hasNoAttributes(m)&&domUtils.isEmptyBlock(m)&&domUtils.remove(m)}if(n.tobdc){var N=UE.htmlparser(l.innerHTML);N.traversal((function(e){"text"==e.type&&(e.data=c(e.data))})),l.innerHTML=N.toHtml()}if(n.bdc2sb){N=UE.htmlparser(l.innerHTML);N.traversal((function(e){"text"==e.type&&(e.data=d(e.data))})),l.innerHTML=N.toHtml()}r&&(r.html=l.innerHTML)}function d(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);t+=i>=65281&&i<=65373?String.fromCharCode(e.charCodeAt(n)-65248):12288==i?String.fromCharCode(e.charCodeAt(n)-12288+32):e.charAt(n)}return t}function c(e){e=utils.html(e);for(var t="",n=0;n<e.length;n++)32==e.charCodeAt(n)?t+=String.fromCharCode(12288):e.charCodeAt(n)<127?t+=String.fromCharCode(e.charCodeAt(n)+65248):t+=e.charAt(n);return t}function u(){var e=t.getPreferences("autotypeset");utils.extend(t.options.autotypeset,e)}n&&(u(),n.pasteFilter&&t.addListener("beforepaste",l),t.commands["autotypeset"]={execCommand:function(){t.removeListener("beforepaste",l),n.pasteFilter&&t.addListener("beforepaste",l),l.call(t)}})},UE.plugin.register("autosubmit",(function(){return{shortcutkey:{autosubmit:"ctrl+13"},commands:{autosubmit:{execCommand:function(){var e=this,t=domUtils.findParentByTagName(e.iframe,"form",!1);if(t){if(!1===e.fireEvent("beforesubmit"))return;e.sync(),t.submit()}}}}}})),UE.plugin.register("background",(function(){var e,t=this,n="editor_background",i=new RegExp("body[\\s]*\\{(.+)\\}","i");function o(e){var t={},n=e.split(";");return utils.each(n,(function(e){var n=e.indexOf(":"),i=utils.trim(e.substr(0,n)).toLowerCase();i&&(t[i]=utils.trim(e.substr(n+1)||""))})),t}function r(e){if(e){var i=[];for(var o in e)e.hasOwnProperty(o)&&i.push(o+":"+e[o]+"; ");utils.cssRule(n,i.length?"body{"+i.join("")+"}":"",t.document)}else utils.cssRule(n,"",t.document)}var a=t.hasContents;return t.hasContents=function(){return!!t.queryCommandValue("background")||a.apply(t,arguments)},{bindEvents:{getAllHtml:function(e,n){var i=this.body,o=domUtils.getComputedStyle(i,"background-image"),r="";r=o.indexOf(t.options.imagePath)>0?o.substring(o.indexOf(t.options.imagePath),o.length-1).replace(/"|\(|\)/gi,""):"none"!=o?o.replace(/url\("?|"?\)/gi,""):"";var a='<style type="text/css">body{',s={"background-color":domUtils.getComputedStyle(i,"background-color")||"#ffffff","background-image":r?"url("+r+")":"","background-repeat":domUtils.getComputedStyle(i,"background-repeat")||"","background-position":browser.ie?domUtils.getComputedStyle(i,"background-position-x")+" "+domUtils.getComputedStyle(i,"background-position-y"):domUtils.getComputedStyle(i,"background-position"),height:domUtils.getComputedStyle(i,"height")};for(var l in s)s.hasOwnProperty(l)&&(a+=l+":"+s[l]+"; ");a+="}</style> ",n.push(a)},aftersetcontent:function(){0==e&&r()}},inputRule:function(t){e=!1,utils.each(t.getNodesByTagName("p"),(function(t){var n=t.getAttr("data-background");n&&(e=!0,r(o(n)),t.parentNode.removeChild(t))}))},outputRule:function(e){var t=this,o=(utils.cssRule(n,t.document)||"").replace(/[\n\r]+/g,"").match(i);o&&e.appendChild(UE.uNode.createElement('<p style="display:none;" data-background="'+utils.trim(o[1].replace(/"/g,"").replace(/[\s]+/g," "))+'"><br/></p>'))},commands:{background:{execCommand:function(e,t){r(t)},queryCommandValue:function(){var e=this,t=(utils.cssRule(n,e.document)||"").replace(/[\n\r]+/g,"").match(i);return t?o(t[1]):null},notNeedUndo:!0}}}})),UE.commands["imagefloat"]={execCommand:function(e,t){var n=this,i=n.selection.getRange();if(!i.collapsed){var o=i.getClosedNode();if(o&&"IMG"==o.tagName)switch(t){case"left":case"right":case"none":var r,a,s,l=o.parentNode;while(dtd.$inline[l.tagName]||"A"==l.tagName)l=l.parentNode;if(r=l,"P"==r.tagName&&"center"==domUtils.getStyle(r,"text-align")){if(!domUtils.isBody(r)&&1==domUtils.getChildCount(r,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)})))if(a=r.previousSibling,s=r.nextSibling,a&&s&&1==a.nodeType&&1==s.nodeType&&a.tagName==s.tagName&&domUtils.isBlockElm(a)){a.appendChild(r.firstChild);while(s.firstChild)a.appendChild(s.firstChild);domUtils.remove(r),domUtils.remove(s)}else domUtils.setStyle(r,"text-align","");i.selectNode(o).select()}domUtils.setStyle(o,"float","none"==t?"":t),"none"==t&&domUtils.removeAttributes(o,"align");break;case"center":if("center"!=n.queryCommandValue("imagefloat")){l=o.parentNode,domUtils.setStyle(o,"float",""),domUtils.removeAttributes(o,"align"),r=o;while(l&&1==domUtils.getChildCount(l,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)}))&&(dtd.$inline[l.tagName]||"A"==l.tagName))r=l,l=l.parentNode;i.setStartBefore(r).setCursor(!1),l=n.document.createElement("div"),l.appendChild(r),domUtils.setStyle(r,"float",""),n.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+l.innerHTML+"</p>"),r=n.document.getElementById("_img_parent_tmp"),r.removeAttribute("id"),r=r.firstChild,i.selectNode(r).select(),s=r.parentNode.nextSibling,s&&domUtils.isEmptyNode(s)&&domUtils.remove(s)}break}}},queryCommandValue:function(){var e,t,n=this.selection.getRange();return n.collapsed?"none":(e=n.getClosedNode(),e&&1==e.nodeType&&"IMG"==e.tagName?(t=domUtils.getComputedStyle(e,"float")||e.getAttribute("align"),"none"==t&&(t="center"==domUtils.getComputedStyle(e.parentNode,"text-align")?"center":t),{left:1,right:1,center:1}[t]?t:"none"):"none")},queryCommandState:function(){var e,t=this.selection.getRange();return t.collapsed?-1:(e=t.getClosedNode(),e&&1==e.nodeType&&"IMG"==e.tagName?0:-1)}},UE.commands["insertimage"]={execCommand:function(e,t){if(t=utils.isArray(t)?t:[t],t.length){var n=this,i=n.selection.getRange(),o=i.getClosedNode();if(!0!==n.fireEvent("beforeinsertimage",t)){if(!o||!/img/i.test(o.tagName)||"edui-faked-video"==o.className&&-1==o.className.indexOf("edui-upload-video")||o.getAttribute("word_img")){var r,a=[],s="";if(r=t[0],1==t.length)u(r),s='<img src="'+r.src+'" '+(r._src?' _src="'+r._src+'" ':"")+(r.width?'width="'+r.width+'" ':"")+(r.height?' height="'+r.height+'" ':"")+("left"==r["floatStyle"]||"right"==r["floatStyle"]?' style="float:'+r["floatStyle"]+';"':"")+(r.title&&""!=r.title?' title="'+r.title+'"':"")+(r.border&&"0"!=r.border?' border="'+r.border+'"':"")+(r.alt&&""!=r.alt?' alt="'+r.alt+'"':"")+(r.hspace&&"0"!=r.hspace?' hspace = "'+r.hspace+'"':"")+(r.vspace&&"0"!=r.vspace?' vspace = "'+r.vspace+'"':"")+"/>","center"==r["floatStyle"]&&(s='<p style="text-align: center">'+s+"</p>"),a.push(s);else for(var l=0;r=t[l++];)u(r),s="<p "+("center"==r["floatStyle"]?'style="text-align: center" ':"")+'><img src="'+r.src+'" '+(r.width?'width="'+r.width+'" ':"")+(r._src?' _src="'+r._src+'" ':"")+(r.height?' height="'+r.height+'" ':"")+' style="'+(r["floatStyle"]&&"center"!=r["floatStyle"]?"float:"+r["floatStyle"]+";":"")+(r.border||"")+'" '+(r.title?' title="'+r.title+'"':"")+" /></p>",a.push(s);n.execCommand("insertHtml",a.join(""))}else{var d=t.shift(),c=d["floatStyle"];delete d["floatStyle"],domUtils.setAttributes(o,d),n.execCommand("imagefloat",c),t.length>0&&(i.setStartAfter(o).setCursor(!1,!0),n.execCommand("insertimage",t))}n.fireEvent("afterinsertimage",t)}}function u(e){utils.each("width,height,border,hspace,vspace".split(","),(function(t){e[t]&&(e[t]=parseInt(e[t],10)||0)})),utils.each("src,_src".split(","),(function(t){e[t]&&(e[t]=utils.unhtmlForUrl(e[t]))})),utils.each("title,alt".split(","),(function(t){e[t]&&(e[t]=utils.unhtml(e[t]))}))}}},UE.plugins["justify"]=function(){var e=domUtils.isBlockElm,t={left:1,right:1,center:1,justify:1},n=function(t,n){var i=t.createBookmark(),o=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase()&&!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)};t.enlarge(!0);var r,a=t.createBookmark(),s=domUtils.getNextDomNode(a.start,!1,o),l=t.cloneRange();while(s&&!(domUtils.getPosition(s,a.end)&domUtils.POSITION_FOLLOWING))if(3!=s.nodeType&&e(s))s=domUtils.getNextDomNode(s,!0,o);else{l.setStartBefore(s);while(s&&s!==a.end&&!e(s))r=s,s=domUtils.getNextDomNode(s,!1,null,(function(t){return!e(t)}));l.setEndAfter(r);var d=l.getCommonAncestor();if(!domUtils.isBody(d)&&e(d))domUtils.setStyles(d,utils.isString(n)?{"text-align":n}:n),s=d;else{var c=t.document.createElement("p");domUtils.setStyles(c,utils.isString(n)?{"text-align":n}:n);var u=l.extractContents();c.appendChild(u),l.insertNode(c),s=c}s=domUtils.getNextDomNode(s,!1,o)}return t.moveToBookmark(a).moveToBookmark(i)};UE.commands["justify"]={execCommand:function(e,t){var i,o=this.selection.getRange();return o.collapsed&&(i=this.document.createTextNode("p"),o.insertNode(i)),n(o,t),i&&(o.setStartBefore(i).collapse(!0),domUtils.remove(i)),o.select(),!0},queryCommandValue:function(){var e=this.selection.getStart(),n=domUtils.getComputedStyle(e,"text-align");return t[n]?n:"left"},queryCommandState:function(){var e=this.selection.getStart(),t=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);return t?-1:0}}},UE.plugins["font"]=function(){var e=this,t={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},n={underline:1,strikethrough:1,fontborder:1},i={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};function o(e){var t;while(t=e.parentNode){if("SPAN"!=t.tagName||1!=domUtils.getChildCount(t,(function(e){return!domUtils.isBookmarkNode(e)&&!domUtils.isBr(e)})))break;t.style.cssText+=e.style.cssText,domUtils.remove(e,!0),e=t}}function r(e,t,n){if(i[t]&&(e.adjustmentBoundary(),!e.collapsed&&1==e.startContainer.nodeType)){var o=e.startContainer.childNodes[e.startOffset];if(o&&domUtils.isTagNode(o,"span")){var r=e.createBookmark();utils.each(domUtils.getElementsByTagName(o,"span"),(function(e){e.parentNode&&!domUtils.isBookmarkNode(e)&&("backcolor"==t&&domUtils.getComputedStyle(e,"background-color").toLowerCase()===n||(domUtils.removeStyle(e,i[t]),0==e.style.cssText.replace(/^\s+$/,"").length&&domUtils.remove(e,!0)))})),e.moveToBookmark(r)}}}function a(e,t,n){var i,a=e.collapsed,s=e.createBookmark();if(a){i=s.start.parentNode;while(dtd.$inline[i.tagName])i=i.parentNode}else i=domUtils.getCommonAncestor(s.start,s.end);utils.each(domUtils.getElementsByTagName(i,"span"),(function(e){if(e.parentNode&&!domUtils.isBookmarkNode(e))if(/\s*border\s*:\s*none;?\s*/i.test(e.style.cssText))/^\s*border\s*:\s*none;?\s*$/.test(e.style.cssText)?domUtils.remove(e,!0):domUtils.removeStyle(e,"border");else{if(/border/i.test(e.style.cssText)&&"SPAN"==e.parentNode.tagName&&/border/i.test(e.parentNode.style.cssText)&&(e.style.cssText=e.style.cssText.replace(/border[^:]*:[^;]+;?/gi,"")),"fontborder"!=t||"none"!=n){var i=e.nextSibling;while(i&&1==i.nodeType&&"SPAN"==i.tagName)if(domUtils.isBookmarkNode(i)&&"fontborder"==t)e.appendChild(i),i=e.nextSibling;else{if(i.style.cssText==e.style.cssText&&(domUtils.moveChild(i,e),domUtils.remove(i)),e.nextSibling===i)break;i=e.nextSibling}}if(o(e),browser.ie&&browser.version>8){var r=domUtils.findParent(e,(function(e){return"SPAN"==e.tagName&&/background-color/.test(e.style.cssText)}));r&&!/background-color/.test(e.style.cssText)&&(e.style.backgroundColor=r.style.backgroundColor)}}})),e.moveToBookmark(s),r(e,t,n)}for(var s in e.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]}),e.addInputRule((function(e){utils.each(e.getNodesByTagName("u s del font strike"),(function(e){if("font"==e.tagName){var t=[];for(var n in e.attrs)switch(n){case"size":t.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[e.attrs[n]]||e.attrs[n])+"px");break;case"color":t.push("color:"+e.attrs[n]);break;case"face":t.push("font-family:"+e.attrs[n]);break;case"style":t.push(e.attrs[n])}e.attrs={style:t.join(";")}}else{var i="u"==e.tagName?"underline":"line-through";e.attrs={style:(e.getAttr("style")||"")+"text-decoration:"+i+";"}}e.tagName="span"}))})),t)(function(e,t){UE.commands[e]={execCommand:function(i,o){o=o||(this.queryCommandState(i)?"none":"underline"==i?"underline":"fontborder"==i?"1px solid #000":"line-through");var r,s=this,l=this.selection.getRange();if("default"==o)l.collapsed&&(r=s.document.createTextNode("font"),l.insertNode(r).select()),s.execCommand("removeFormat","span,a",t),r&&(l.setStartBefore(r).collapse(!0),domUtils.remove(r)),a(l,i,o),l.select();else if(l.collapsed){var d=domUtils.findParentByTagName(l.startContainer,"span",!0);if(r=s.document.createTextNode("font"),!d||d.children.length||d[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){if(l.insertNode(r),l.selectNode(r).select(),d=l.document.createElement("span"),n[e]){if(domUtils.findParentByTagName(r,"a",!0))return l.setStartBefore(r).setCursor(),void domUtils.remove(r);s.execCommand("removeFormat","span,a",t)}if(d.style.cssText=t+":"+o,r.parentNode.insertBefore(d,r),!browser.ie||browser.ie&&9==browser.version){var c=d.parentNode;while(!domUtils.isBlockElm(c))"SPAN"==c.tagName&&(d.style.cssText=c.style.cssText+";"+d.style.cssText),c=c.parentNode}opera?setTimeout((function(){l.setStart(d,0).collapse(!0),a(l,i,o),l.select()})):(l.setStart(d,0).collapse(!0),a(l,i,o),l.select())}else l.insertNode(r),n[e]&&(l.selectNode(r).select(),s.execCommand("removeFormat","span,a",t,null),d=domUtils.findParentByTagName(r,"span",!0),l.setStartBefore(r)),d&&(d.style.cssText+=";"+t+":"+o),l.collapse(!0).select();domUtils.remove(r)}else n[e]&&s.queryCommandValue(e)&&s.execCommand("removeFormat","span,a",t),l=s.selection.getRange(),l.applyInlineStyle("span",{style:t+":"+o}),a(l,i,o),l.select();return!0},queryCommandValue:function(e){var n=this.selection.getStart();if("underline"==e||"strikethrough"==e){var i,o=n;while(o&&!domUtils.isBlockElm(o)&&!domUtils.isBody(o)){if(1==o.nodeType&&(i=domUtils.getComputedStyle(o,t),"none"!=i))return i;o=o.parentNode}return"none"}if("fontborder"==e){var r,a=n;while(a&&dtd.$inline[a.tagName]){if((r=domUtils.getComputedStyle(a,"border"))&&/1px/.test(r)&&/solid/.test(r))return r;a=a.parentNode}return""}if("FontSize"==e){var s=domUtils.getComputedStyle(n,t);a=/^([\d\.]+)(\w+)$/.exec(s);return a?Math.floor(a[1])+a[2]:s}return domUtils.getComputedStyle(n,t)},queryCommandState:function(e){if(!n[e])return 0;var t=this.queryCommandValue(e);return"fontborder"==e?/1px/.test(t)&&/solid/.test(t):"underline"==e?/underline/.test(t):/line\-through/.test(t)}}})(s,t[s])},UE.plugins["link"]=function(){function e(e){var t=e.startContainer,n=e.endContainer;(t=domUtils.findParentByTagName(t,"a",!0))&&e.setStartBefore(t),(n=domUtils.findParentByTagName(n,"a",!0))&&e.setEndAfter(n)}function t(t,n,i){var o=t.cloneRange(),r=i.queryCommandValue("link");e(t=t.adjustmentBoundary());var a=t.startContainer;if(1==a.nodeType&&r&&(a=a.childNodes[t.startOffset],a&&1==a.nodeType&&"A"==a.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(a[browser.ie?"innerText":"textContent"])&&(a[browser.ie?"innerText":"textContent"]=utils.html(n.textValue||n.href))),o.collapsed&&!r||(t.removeInlineStyle("a"),o=t.cloneRange()),o.collapsed){var s=t.document.createElement("a"),l="";n.textValue?(l=utils.html(n.textValue),delete n.textValue):l=utils.html(n.href),domUtils.setAttributes(s,n),a=domUtils.findParentByTagName(o.startContainer,"a",!0),a&&domUtils.isInNodeEndBoundary(o,a)&&t.setStartAfter(a).collapse(!0),s[browser.ie?"innerText":"textContent"]=l,t.insertNode(s).selectNode(s)}else t.applyInlineStyle("a",n)}UE.commands["unlink"]={execCommand:function(){var t,n=this.selection.getRange();n.collapsed&&!domUtils.findParentByTagName(n.startContainer,"a",!0)||(t=n.createBookmark(),e(n),n.removeInlineStyle("a").moveToBookmark(t).select())},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}},UE.commands["link"]={execCommand:function(e,n){var i;n._href&&(n._href=utils.unhtml(n._href,/[<">]/g)),n.href&&(n.href=utils.unhtml(n.href,/[<">]/g)),n.textValue&&(n.textValue=utils.unhtml(n.textValue,/[<">]/g)),t(i=this.selection.getRange(),n,this),i.collapse().select(!0)},queryCommandValue:function(){var e,t=this.selection.getRange();if(!t.collapsed){t.shrinkBoundary();var n=3!=t.startContainer.nodeType&&t.startContainer.childNodes[t.startOffset]?t.startContainer.childNodes[t.startOffset]:t.startContainer,i=3==t.endContainer.nodeType||0==t.endOffset?t.endContainer:t.endContainer.childNodes[t.endOffset-1],o=t.getCommonAncestor();if(e=domUtils.findParentByTagName(o,"a",!0),!e&&1==o.nodeType)for(var r,a,s,l=o.getElementsByTagName("a"),d=0;s=l[d++];)if(r=domUtils.getPosition(s,n),a=domUtils.getPosition(s,i),(r&domUtils.POSITION_FOLLOWING||r&domUtils.POSITION_CONTAINS)&&(a&domUtils.POSITION_PRECEDING||a&domUtils.POSITION_CONTAINS)){e=s;break}return e}if(e=t.startContainer,e=1==e.nodeType?e:e.parentNode,e&&(e=domUtils.findParentByTagName(e,"a",!0))&&!domUtils.isInNodeEndBoundary(t,e))return e},queryCommandState:function(){var e=this.selection.getRange().getClosedNode(),t=e&&("edui-faked-video"==e.className||-1!=e.className.indexOf("edui-upload-video"));return t?-1:0}}},UE.plugins["insertframe"]=function(){var e=this;function t(){e._iframe&&delete e._iframe}e.addListener("selectionchange",(function(){t()}))},UE.commands["scrawl"]={queryCommandState:function(){return browser.ie&&browser.version<=8?-1:0}},UE.plugins["removeformat"]=function(){var e=this;e.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),e.commands["removeformat"]={execCommand:function(e,t,n,i,o){var r,a,s=new RegExp("^(?:"+(t||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),l=n?[]:(i||this.options.removeFormatAttributes).split(","),d=new dom.Range(this.document),c=function(e){return 1==e.nodeType};function u(e){if(3==e.nodeType||"span"!=e.tagName.toLowerCase())return 0;if(browser.ie){var t=e.attributes;if(t.length){for(var n=0,i=t.length;n<i;n++)if(t[n].specified)return 0;return 1}}return!e.attributes.length}function m(e){var t=e.createBookmark();if(e.collapsed&&e.enlarge(!0),!o){var i=domUtils.findParentByTagName(e.startContainer,"a",!0);i&&e.setStartBefore(i),i=domUtils.findParentByTagName(e.endContainer,"a",!0),i&&e.setEndAfter(i)}r=e.createBookmark(),p=r.start;while((a=p.parentNode)&&!domUtils.isBlockElm(a))domUtils.breakParent(p,a),domUtils.clearEmptySibling(p);if(r.end){p=r.end;while((a=p.parentNode)&&!domUtils.isBlockElm(a))domUtils.breakParent(p,a),domUtils.clearEmptySibling(p);var d,m=domUtils.getNextDomNode(r.start,!1,c);while(m){if(m==r.end)break;d=domUtils.getNextDomNode(m,!0,c),dtd.$empty[m.tagName.toLowerCase()]||domUtils.isBookmarkNode(m)||(s.test(m.tagName)?n?(domUtils.removeStyle(m,n),u(m)&&"text-decoration"!=n&&domUtils.remove(m,!0)):domUtils.remove(m,!0):dtd.$tableContent[m.tagName]||dtd.$list[m.tagName]||(domUtils.removeAttributes(m,l),u(m)&&domUtils.remove(m,!0))),m=d}}var f=r.start.parentNode;!domUtils.isBlockElm(f)||dtd.$tableContent[f.tagName]||dtd.$list[f.tagName]||domUtils.removeAttributes(f,l),f=r.end.parentNode,r.end&&domUtils.isBlockElm(f)&&!dtd.$tableContent[f.tagName]&&!dtd.$list[f.tagName]&&domUtils.removeAttributes(f,l),e.moveToBookmark(r).moveToBookmark(t);var h,p=e.startContainer,g=e.collapsed;while(1==p.nodeType&&domUtils.isEmptyNode(p)&&dtd.$removeEmpty[p.tagName])h=p.parentNode,e.setStartBefore(p),e.startContainer===e.endContainer&&e.endOffset--,domUtils.remove(p),p=h;if(!g){p=e.endContainer;while(1==p.nodeType&&domUtils.isEmptyNode(p)&&dtd.$removeEmpty[p.tagName])h=p.parentNode,e.setEndBefore(p),domUtils.remove(p),p=h}}d=this.selection.getRange(),m(d),d.select()}}},UE.plugins["blockquote"]=function(){var e=this;function t(e){return domUtils.filterNodeList(e.selection.getStartElementPath(),"blockquote")}e.commands["blockquote"]={execCommand:function(e,n){var i=this.selection.getRange(),o=t(this),r=dtd.blockquote,a=i.createBookmark();if(o){var s=i.startContainer,l=domUtils.isBlockElm(s)?s:domUtils.findParent(s,(function(e){return domUtils.isBlockElm(e)})),d=i.endContainer,c=domUtils.isBlockElm(d)?d:domUtils.findParent(d,(function(e){return domUtils.isBlockElm(e)}));l=domUtils.findParentByTagName(l,"li",!0)||l,c=domUtils.findParentByTagName(c,"li",!0)||c,"LI"==l.tagName||"TD"==l.tagName||l===o||domUtils.isBody(l)?domUtils.remove(o,!0):domUtils.breakParent(l,o),l!==c&&(o=domUtils.findParentByTagName(c,"blockquote"),o&&("LI"==c.tagName||"TD"==c.tagName||domUtils.isBody(c)?o.parentNode&&domUtils.remove(o,!0):domUtils.breakParent(c,o)));for(var u,m=domUtils.getElementsByTagName(this.document,"blockquote"),f=0;u=m[f++];)u.childNodes.length?domUtils.getPosition(u,l)&domUtils.POSITION_FOLLOWING&&domUtils.getPosition(u,c)&domUtils.POSITION_PRECEDING&&domUtils.remove(u,!0):domUtils.remove(u)}else{var h=i.cloneRange(),p=1==h.startContainer.nodeType?h.startContainer:h.startContainer.parentNode,g=p,b=1;while(1){if(domUtils.isBody(p)){g!==p?i.collapsed?(h.selectNode(g),b=0):h.setStartBefore(g):h.setStart(p,0);break}if(!r[p.tagName]){i.collapsed?h.selectNode(g):h.setStartBefore(g);break}g=p,p=p.parentNode}if(b){g=p=p=1==h.endContainer.nodeType?h.endContainer:h.endContainer.parentNode;while(1){if(domUtils.isBody(p)){g!==p?h.setEndAfter(g):h.setEnd(p,p.childNodes.length);break}if(!r[p.tagName]){h.setEndAfter(g);break}g=p,p=p.parentNode}}p=i.document.createElement("blockquote"),domUtils.setAttributes(p,n),p.appendChild(h.extractContents()),h.insertNode(p);var v,y=domUtils.getElementsByTagName(p,"blockquote");for(f=0;v=y[f++];)v.parentNode&&domUtils.remove(v,!0)}i.moveToBookmark(a).select()},queryCommandState:function(){return t(this)?1:0}}},UE.commands["touppercase"]=UE.commands["tolowercase"]={execCommand:function(e){var t=this,n=t.selection.getRange();if(n.collapsed)return n;var i=n.createBookmark(),o=i.end,r=function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)},a=domUtils.getNextDomNode(i.start,!1,r);while(a&&domUtils.getPosition(a,o)&domUtils.POSITION_PRECEDING)if(3==a.nodeType&&(a.nodeValue=a.nodeValue["touppercase"==e?"toUpperCase":"toLowerCase"]()),a=domUtils.getNextDomNode(a,!0,r),a===o)break;n.moveToBookmark(i).select()}},UE.commands["indent"]={execCommand:function(){var e=this,t=e.queryCommandState("indent")?"0em":e.options.indentValue||"2em";e.execCommand("Paragraph","p",{style:"text-indent:"+t})},queryCommandState:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return e&&e.style.textIndent&&parseInt(e.style.textIndent)?1:0}},UE.commands["print"]={execCommand:function(){this.window.print()},notNeedUndo:1},UE.commands["preview"]={execCommand:function(){var e=window.open("","_blank",""),t=e.document;t.open(),t.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><script src="'+this.options.UEDITOR_HOME_URL+"ueditor.parse.js\"><\/script><script>setTimeout(function(){uParse('div',{rootPath: '"+this.options.UEDITOR_HOME_URL+"'})},300)<\/script></head><body><div>"+this.getContent(null,null,!0)+"</div></body></html>"),t.close()},notNeedUndo:1},UE.plugins["selectall"]=function(){var e=this;e.commands["selectall"]={execCommand:function(){var e=this,t=e.body,n=e.selection.getRange();n.selectNodeContents(t),domUtils.isEmptyBlock(t)&&(browser.opera&&t.firstChild&&1==t.firstChild.nodeType&&n.setStartAtFirst(t.firstChild),n.collapse(!0)),n.select(!0)},notNeedUndo:1},e.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins["paragraph"]=function(){var e=this,t=domUtils.isBlockElm,n=["TD","LI","PRE"],i=function(e,i,o,r){var a,s=e.createBookmark(),l=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase()&&!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)};e.enlarge(!0);var d,c=e.createBookmark(),u=domUtils.getNextDomNode(c.start,!1,l),m=e.cloneRange();while(u&&!(domUtils.getPosition(u,c.end)&domUtils.POSITION_FOLLOWING))if(3!=u.nodeType&&t(u))u=domUtils.getNextDomNode(u,!0,l);else{m.setStartBefore(u);while(u&&u!==c.end&&!t(u))d=u,u=domUtils.getNextDomNode(u,!1,null,(function(e){return!t(e)}));m.setEndAfter(d),a=e.document.createElement(i),o&&(domUtils.setAttributes(a,o),r&&"customstyle"==r&&o.style&&(a.style.cssText=o.style)),a.appendChild(m.extractContents()),domUtils.isEmptyNode(a)&&domUtils.fillChar(e.document,a),m.insertNode(a);var f=a.parentNode;t(f)&&!domUtils.isBody(a.parentNode)&&-1==utils.indexOf(n,f.tagName)&&(r&&"customstyle"==r||(f.getAttribute("dir")&&a.setAttribute("dir",f.getAttribute("dir")),f.style.cssText&&(a.style.cssText=f.style.cssText+";"+a.style.cssText),f.style.textAlign&&!a.style.textAlign&&(a.style.textAlign=f.style.textAlign),f.style.textIndent&&!a.style.textIndent&&(a.style.textIndent=f.style.textIndent),f.style.padding&&!a.style.padding&&(a.style.padding=f.style.padding)),o&&/h\d/i.test(f.tagName)&&!/h\d/i.test(a.tagName)?(domUtils.setAttributes(f,o),r&&"customstyle"==r&&o.style&&(f.style.cssText=o.style),domUtils.remove(a,!0),a=f):domUtils.remove(a.parentNode,!0)),u=-1!=utils.indexOf(n,f.tagName)?f:a,u=domUtils.getNextDomNode(u,!1,l)}return e.moveToBookmark(c).moveToBookmark(s)};e.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),e.commands["paragraph"]={execCommand:function(e,t,n,o){var r=this.selection.getRange();if(r.collapsed){var a=this.document.createTextNode("p");if(r.insertNode(a),browser.ie){var s=a.previousSibling;s&&domUtils.isWhitespace(s)&&domUtils.remove(s),s=a.nextSibling,s&&domUtils.isWhitespace(s)&&domUtils.remove(s)}}if(r=i(r,t,n,o),a&&(r.setStartBefore(a).collapse(!0),pN=a.parentNode,domUtils.remove(a),domUtils.isBlockElm(pN)&&domUtils.isEmptyNode(pN)&&domUtils.fillNode(this.document,pN)),browser.gecko&&r.collapsed&&1==r.startContainer.nodeType){var l=r.startContainer.childNodes[r.startOffset];l&&1==l.nodeType&&l.tagName.toLowerCase()==t&&r.setStart(l,0).collapse(!0)}return r.select(),!0},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return e?e.tagName.toLowerCase():""}}},function(){var e=domUtils.isBlockElm,t=function(e){return domUtils.filterNodeList(e.selection.getStartElementPath(),(function(e){return e&&1==e.nodeType&&e.getAttribute("dir")}))},n=function(n,i,o){var r,a=function(e){return 1==e.nodeType?!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)},s=t(i);if(s&&n.collapsed)return s.setAttribute("dir",o),n;r=n.createBookmark(),n.enlarge(!0);var l,d=n.createBookmark(),c=domUtils.getNextDomNode(d.start,!1,a),u=n.cloneRange();while(c&&!(domUtils.getPosition(c,d.end)&domUtils.POSITION_FOLLOWING))if(3!=c.nodeType&&e(c))c=domUtils.getNextDomNode(c,!0,a);else{u.setStartBefore(c);while(c&&c!==d.end&&!e(c))l=c,c=domUtils.getNextDomNode(c,!1,null,(function(t){return!e(t)}));u.setEndAfter(l);var m=u.getCommonAncestor();if(!domUtils.isBody(m)&&e(m))m.setAttribute("dir",o),c=m;else{var f=n.document.createElement("p");f.setAttribute("dir",o);var h=u.extractContents();f.appendChild(h),u.insertNode(f),c=f}c=domUtils.getNextDomNode(c,!1,a)}return n.moveToBookmark(d).moveToBookmark(r)};UE.commands["directionality"]={execCommand:function(e,t){var i=this.selection.getRange();if(i.collapsed){var o=this.document.createTextNode("d");i.insertNode(o)}return n(i,this,t),o&&(i.setStartBefore(o).collapse(!0),domUtils.remove(o)),i.select(),!0},queryCommandValue:function(){var e=t(this);return e?e.getAttribute("dir"):"ltr"}}}(),UE.plugins["horizontal"]=function(){var e=this;e.commands["horizontal"]={execCommand:function(e){var t=this;if(-1!==t.queryCommandState(e)){t.execCommand("insertHtml","<hr>");var n,i=t.selection.getRange(),o=i.startContainer;if(1==o.nodeType&&!o.childNodes[i.startOffset])(n=o.childNodes[i.startOffset-1])&&1==n.nodeType&&"HR"==n.tagName&&("p"==t.options.enterTag?(n=t.document.createElement("p"),i.insertNode(n),i.setStart(n,0).setCursor()):(n=t.document.createElement("br"),i.insertNode(n),i.setStartBefore(n).setCursor()));return!0}},queryCommandState:function(){return domUtils.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}},e.addListener("delkeydown",(function(e,t){var n=this.selection.getRange();if(n.txtToElmBoundary(!0),domUtils.isStartInblock(n)){var i=n.startContainer,o=i.previousSibling;if(o&&domUtils.isTagNode(o,"hr"))return domUtils.remove(o),n.select(),domUtils.preventDefault(t),!0}}))},UE.commands["time"]=UE.commands["date"]={execCommand:function(e,t){var n=new Date;function i(e,t){var n=("0"+e.getHours()).slice(-2),i=("0"+e.getMinutes()).slice(-2),o=("0"+e.getSeconds()).slice(-2);return t=t||"hh:ii:ss",t.replace(/hh/gi,n).replace(/ii/gi,i).replace(/ss/gi,o)}function o(e,t){var n=("000"+e.getFullYear()).slice(-4),i=n.slice(-2),o=("0"+(e.getMonth()+1)).slice(-2),r=("0"+e.getDate()).slice(-2);return t=t||"yyyy-mm-dd",t.replace(/yyyy/gi,n).replace(/yy/gi,i).replace(/mm/gi,o).replace(/dd/gi,r)}this.execCommand("insertHtml","time"==e?i(n,t):o(n,t))}},UE.plugins["rowspacing"]=function(){var e=this;e.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]}),e.commands["rowspacing"]={execCommand:function(e,t,n){return this.execCommand("paragraph","p",{style:"margin-"+n+":"+t+"px"}),!0},queryCommandValue:function(e,t){var n,i=domUtils.filterNodeList(this.selection.getStartElementPath(),(function(e){return domUtils.isBlockElm(e)}));return i?(n=domUtils.getComputedStyle(i,"margin-"+t).replace(/[^\d]/g,""),n||0):0}}},UE.plugins["lineheight"]=function(){var e=this;e.setOpt({lineheight:["1","1.5","1.75","2","3","4","5"]}),e.commands["lineheight"]={execCommand:function(e,t){return this.execCommand("paragraph","p",{style:"line-height:"+("1"==t?"normal":t+"em")}),!0},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),(function(e){return domUtils.isBlockElm(e)}));if(e){var t=domUtils.getComputedStyle(e,"line-height");return"normal"==t?1:t.replace(/[^\d.]*/gi,"")}}}},UE.plugins["insertcode"]=function(){var e=this;e.ready((function(){utils.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",e.document)})),e.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"}),e.commands["insertcode"]={execCommand:function(e,t){var n=this,i=n.selection.getRange(),o=domUtils.findParentByTagName(i.startContainer,"pre",!0);if(o)o.className="brush:"+t+";toolbar:false;";else{var r="";if(i.collapsed)r=browser.ie&&browser.ie11below?browser.version<=8?" ":"":"<br/>";else{var a=i.extractContents(),s=n.document.createElement("div");s.appendChild(a),utils.each(UE.filterNode(UE.htmlparser(s.innerHTML.replace(/[\r\t]/g,"")),n.options.filterTxtRules).children,(function(e){if(browser.ie&&browser.ie11below&&browser.version>8)"element"==e.type?"br"==e.tagName?r+="\n":dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?r+="\n":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data})),/\n$/.test(r)||(r+="\n")):r+=e.data+"\n",!e.nextSibling()&&/\n$/.test(r)&&(r=r.replace(/\n$/,""));else if(browser.ie&&browser.ie11below)"element"==e.type?"br"==e.tagName?r+="<br>":dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?r+="<br>":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data})),/br>$/.test(r)||(r+="<br>")):r+=e.data+"<br>",!e.nextSibling()&&/<br>$/.test(r)&&(r=r.replace(/<br>$/,""));else if(r+="element"==e.type?dtd.$empty[e.tagName]?"":e.innerText():e.data,!/br\/?\s*>$/.test(r)){if(!e.nextSibling())return;r+="<br>"}}))}n.execCommand("inserthtml",'<pre id="coder"class="brush:'+t+';toolbar:false">'+r+"</pre>",!0),o=n.document.getElementById("coder"),domUtils.removeAttributes(o,"id");var l=o.previousSibling;l&&(3==l.nodeType&&1==l.nodeValue.length&&browser.ie&&6==browser.version||domUtils.isEmptyBlock(l))&&domUtils.remove(l);i=n.selection.getRange();domUtils.isEmptyBlock(o)?i.setStart(o,0).setCursor(!1,!0):i.selectNodeContents(o).select()}},queryCommandValue:function(){var e=this.selection.getStartElementPath(),t="";return utils.each(e,(function(e){if("PRE"==e.nodeName){var n=e.className.match(/brush:([^;]+)/);return t=n&&n[1]?n[1]:"",!1}})),t}},e.addInputRule((function(e){utils.each(e.getNodesByTagName("pre"),(function(e){var t=e.getNodesByTagName("br");if(t.length)browser.ie&&browser.ie11below&&browser.version>8&&utils.each(t,(function(e){var t=UE.uNode.createText("\n");e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)}));else if(!(browser.ie&&browser.ie11below&&browser.version>8)){var n=e.innerText().split(/\n/);e.innerHTML(""),utils.each(n,(function(t){t.length&&e.appendChild(UE.uNode.createText(t)),e.appendChild(UE.uNode.createElement("br"))}))}}))})),e.addOutputRule((function(e){utils.each(e.getNodesByTagName("pre"),(function(e){var t="";utils.each(e.children,(function(e){"text"==e.type?t+=e.data.replace(/[ ]/g," ").replace(/\n$/,""):"br"==e.tagName?t+="\n":t+=dtd.$empty[e.tagName]?e.innerText():""})),e.innerText(t.replace(/( |\n)+$/,""))}))})),e.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};e.queryCommandState;e.queryCommandState=function(e){var t=this;return!t.notNeedCodeQuery[e.toLowerCase()]&&t.selection&&t.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)},e.addListener("beforeenterkeydown",(function(){var t=e.selection.getRange(),n=domUtils.findParentByTagName(t.startContainer,"pre",!0);if(n){if(e.fireEvent("saveScene"),t.collapsed||t.deleteContents(),!browser.ie||browser.ie9above){var i=e.document.createElement("br");t.insertNode(i).setStartAfter(i).collapse(!0);var o=i.nextSibling;o||browser.ie&&!(browser.version>10)?t.setStartAfter(i):t.insertNode(i.cloneNode(!1)),n=i.previousSibling;while(n)if(u=n,n=n.previousSibling,!n||"BR"==n.nodeName){n=u;break}if(n){var r="";while(n&&"BR"!=n.nodeName&&new RegExp("^[\\s"+domUtils.fillChar+"]*$").test(n.nodeValue))r+=n.nodeValue,n=n.nextSibling;if("BR"!=n.nodeName){var a=n.nodeValue.match(new RegExp("^([\\s"+domUtils.fillChar+"]+)"));a&&a[1]&&(r+=a[1])}r&&(r=e.document.createTextNode(r),t.insertNode(r).setStartAfter(r))}t.collapse(!0).select(!0)}else if(browser.version>8){var s=e.document.createTextNode("\n"),l=t.startContainer;if(0==t.startOffset){var d=l.previousSibling;if(d){t.insertNode(s);var c=e.document.createTextNode(" ");t.setStartAfter(s).insertNode(c).setStart(c,0).collapse(!0).select(!0)}}else{t.insertNode(s).setStartAfter(s);c=e.document.createTextNode(" ");l=t.startContainer.childNodes[t.startOffset],l&&!/^\n/.test(l.nodeValue)&&t.setStartBefore(s),t.insertNode(c).setStart(c,0).collapse(!0).select(!0)}}else{var u;i=e.document.createElement("br");t.insertNode(i),t.insertNode(e.document.createTextNode(domUtils.fillChar)),t.setStartAfter(i),n=i.previousSibling;while(n)if(u=n,n=n.previousSibling,!n||"BR"==n.nodeName){n=u;break}if(n){r="";while(n&&"BR"!=n.nodeName&&new RegExp("^[ "+domUtils.fillChar+"]*$").test(n.nodeValue))r+=n.nodeValue,n=n.nextSibling;if("BR"!=n.nodeName){a=n.nodeValue.match(new RegExp("^([ "+domUtils.fillChar+"]+)"));a&&a[1]&&(r+=a[1])}r=e.document.createTextNode(r),t.insertNode(r).setStartAfter(r)}t.collapse(!0).select()}return e.fireEvent("saveScene"),!0}})),e.addListener("tabkeydown",(function(t,n){var i=e.selection.getRange(),o=domUtils.findParentByTagName(i.startContainer,"pre",!0);if(o){if(e.fireEvent("saveScene"),n.shiftKey);else if(i.collapsed){var r=e.document.createTextNode(" ");i.insertNode(r).setStartAfter(r).collapse(!0).select(!0)}else{var a=i.createBookmark(),s=a.start.previousSibling;while(s){if(o.firstChild===s&&!domUtils.isBr(s)){o.insertBefore(e.document.createTextNode(" "),s);break}if(domUtils.isBr(s)){o.insertBefore(e.document.createTextNode(" "),s.nextSibling);break}s=s.previousSibling}var l=a.end;s=a.start.nextSibling,o.firstChild===a.start&&o.insertBefore(e.document.createTextNode(" "),s.nextSibling);while(s&&s!==l){if(domUtils.isBr(s)&&s.nextSibling){if(s.nextSibling===l)break;o.insertBefore(e.document.createTextNode(" "),s.nextSibling)}s=s.nextSibling}i.moveToBookmark(a).select()}return e.fireEvent("saveScene"),!0}})),e.addListener("beforeinserthtml",(function(e,t){var n=this,i=n.selection.getRange(),o=domUtils.findParentByTagName(i.startContainer,"pre",!0);if(o){i.collapsed||i.deleteContents();var r="";if(browser.ie&&browser.version>8){utils.each(UE.filterNode(UE.htmlparser(t),n.options.filterTxtRules).children,(function(e){"element"==e.type?"br"==e.tagName?r+="\n":dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?r+="\n":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data})),/\n$/.test(r)||(r+="\n")):r+=e.data+"\n",!e.nextSibling()&&/\n$/.test(r)&&(r=r.replace(/\n$/,""))}));var a=n.document.createTextNode(utils.html(r.replace(/ /g," ")));i.insertNode(a).selectNode(a).select()}else{var s=n.document.createDocumentFragment();utils.each(UE.filterNode(UE.htmlparser(t),n.options.filterTxtRules).children,(function(e){"element"==e.type?"br"==e.tagName?s.appendChild(n.document.createElement("br")):dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?s.appendChild(n.document.createElement("br")):dtd.$empty[e.tagName]||s.appendChild(n.document.createTextNode(utils.html(t.innerText().replace(/ /g," ")))):s.appendChild(n.document.createTextNode(utils.html(t.data.replace(/ /g," "))))})),"BR"!=s.lastChild.nodeName&&s.appendChild(n.document.createElement("br"))):s.appendChild(n.document.createTextNode(utils.html(e.data.replace(/ /g," ")))),e.nextSibling()||"BR"!=s.lastChild.nodeName||s.removeChild(s.lastChild)})),i.insertNode(s).select()}return!0}})),e.addListener("keydown",(function(e,t){var n=this,i=t.keyCode||t.which;if(40==i){var o,r=n.selection.getRange(),a=r.startContainer;if(r.collapsed&&(o=domUtils.findParentByTagName(r.startContainer,"pre",!0))&&!o.nextSibling){var s=o.lastChild;while(s&&"BR"==s.nodeName)s=s.previousSibling;(s===a||r.startContainer===o&&r.startOffset==o.childNodes.length)&&(n.execCommand("insertparagraph"),domUtils.preventDefault(t))}}})),e.addListener("delkeydown",(function(t,n){var i=this.selection.getRange();i.txtToElmBoundary(!0);var o=i.startContainer;if(domUtils.isTagNode(o,"pre")&&i.collapsed&&domUtils.isStartInblock(i)){var r=e.document.createElement("p");return domUtils.fillNode(e.document,r),o.parentNode.insertBefore(r,o),domUtils.remove(o),i.setStart(r,0).setCursor(!1,!0),domUtils.preventDefault(n),!0}}))},UE.commands["cleardoc"]={execCommand:function(e){var t=this,n=t.options.enterTag,i=t.selection.getRange();"br"==n?(t.body.innerHTML="<br/>",i.setStart(t.body,0).setCursor()):(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",i.setStart(t.body.firstChild,0).setCursor(!1,!0)),setTimeout((function(){t.fireEvent("clearDoc")}),0)}},UE.plugin.register("anchor",(function(){return{bindEvents:{ready:function(){utils.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 15px;}",this.document)}},outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){var t;(t=e.getAttr("anchorname"))&&(e.tagName="a",e.setAttr({anchorname:"",name:t,class:""}))}))},inputRule:function(e){utils.each(e.getNodesByTagName("a"),(function(e){e.getAttr("name")&&!e.getAttr("href")&&(e.tagName="img",e.setAttr({anchorname:e.getAttr("name"),class:"anchorclass"}),e.setAttr("name"))}))},commands:{anchor:{execCommand:function(e,t){var n=this.selection.getRange(),i=n.getClosedNode();if(i&&i.getAttribute("anchorname"))t?i.setAttribute("anchorname",t):(n.setStartBefore(i).setCursor(),domUtils.remove(i));else if(t){var o=this.document.createElement("img");n.collapse(!0),domUtils.setAttributes(o,{anchorname:t,class:"anchorclass"}),n.insertNode(o).setStartAfter(o).setCursor(!1,!0)}}}}}})),UE.plugins["wordcount"]=function(){var e,t=this;t.setOpt("wordCount",!0),t.addListener("contentchange",(function(){t.fireEvent("wordcount")})),t.addListener("ready",(function(){var t=this;domUtils.on(t.body,"keyup",(function(n){var i=n.keyCode||n.which,o={16:1,18:1,20:1,37:1,38:1,39:1,40:1};i in o||(clearTimeout(e),e=setTimeout((function(){t.fireEvent("wordcount")}),200))}))}))},UE.plugins["pagebreak"]=function(){var e=this,t=["td"];function n(t){if(domUtils.isEmptyBlock(t)){var n,i=t.firstChild;while(i&&1==i.nodeType&&domUtils.isEmptyBlock(i))n=i,i=i.firstChild;!n&&(n=t),domUtils.fillNode(e.document,n)}}function i(e){return e&&1==e.nodeType&&"HR"==e.tagName&&"pagebreak"==e.className}e.setOpt("pageBreakTag","_ueditor_page_break_tag_"),e.ready((function(){utils.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",e.document)})),e.addInputRule((function(t){t.traversal((function(t){if("text"==t.type&&t.data==e.options.pageBreakTag){var n=UE.uNode.createElement('<hr class="pagebreak" noshade="noshade" size="5" style="-webkit-user-select: none;">');t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)}}))})),e.addOutputRule((function(t){utils.each(t.getNodesByTagName("hr"),(function(t){if("pagebreak"==t.getAttr("class")){var n=UE.uNode.createText(e.options.pageBreakTag);t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)}}))})),e.commands["pagebreak"]={execCommand:function(){var o=e.selection.getRange(),r=e.document.createElement("hr");domUtils.setAttributes(r,{class:"pagebreak",noshade:"noshade",size:"5"}),domUtils.unSelectable(r);var a=domUtils.findParentByTagName(o.startContainer,t,!0),s=[];if(a)switch(a.tagName){case"TD":if(u=a.parentNode,u.previousSibling)u.parentNode.insertBefore(r,u),s=domUtils.findParents(r);else{var l=domUtils.findParentByTagName(u,"table");l.parentNode.insertBefore(r,l),s=domUtils.findParents(r,!0)}u=s[1],r!==u&&domUtils.breakParent(r,u),e.fireEvent("afteradjusttable",e.document)}else{if(!o.collapsed){o.deleteContents();var d=o.startContainer;while(!domUtils.isBody(d)&&domUtils.isBlockElm(d)&&domUtils.isEmptyNode(d))o.setStartBefore(d).collapse(!0),domUtils.remove(d),d=o.startContainer}o.insertNode(r);var c,u=r.parentNode;while(!domUtils.isBody(u))domUtils.breakParent(r,u),c=r.nextSibling,c&&domUtils.isEmptyBlock(c)&&domUtils.remove(c),u=r.parentNode;c=r.nextSibling;var m=r.previousSibling;if(i(m)?domUtils.remove(m):m&&n(m),c)i(c)?domUtils.remove(c):n(c),o.setEndAfter(r).collapse(!1);else{var f=e.document.createElement("p");r.parentNode.appendChild(f),domUtils.fillNode(e.document,f),o.setStart(f,0).collapse(!0)}o.select(!0)}}}},UE.plugin.register("wordimage",(function(){var e=this,t=[];return{commands:{wordimage:{execCommand:function(){for(var t,n=domUtils.getElementsByTagName(e.body,"img"),i=[],o=0;t=n[o++];){var r=t.getAttribute("word_img");r&&i.push(r)}return i},queryCommandState:function(){t=domUtils.getElementsByTagName(e.body,"img");for(var n,i=0;n=t[i++];)if(n.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(t){utils.each(t.getNodesByTagName("img"),(function(t){var n=t.attrs,i=parseInt(n.width)<128||parseInt(n.height)<43,o=e.options,r=o.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";n["src"]&&/^(?:(file:\/+))/.test(n["src"])&&t.setAttr({width:n.width,height:n.height,alt:n.alt,word_img:n.src,src:r,style:"background:url("+(i?o.themePath+o.theme+"/images/word.gif":o.langPath+o.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})}))}}})),UE.plugins["dragdrop"]=function(){var e=this;e.ready((function(){domUtils.on(this.body,"dragend",(function(){var t=e.selection.getRange(),n=t.getClosedNode()||e.selection.getStart();if(n&&"IMG"==n.tagName){var i,o=n.previousSibling;while(i=n.nextSibling){if(1!=i.nodeType||"SPAN"!=i.tagName||i.firstChild)break;domUtils.remove(i)}(!o||1!=o.nodeType||domUtils.isEmptyBlock(o))&&o||i&&(!i||domUtils.isEmptyBlock(i))||(o&&"P"==o.tagName&&!domUtils.isEmptyBlock(o)?(o.appendChild(n),domUtils.moveChild(i,o),domUtils.remove(i)):i&&"P"==i.tagName&&!domUtils.isEmptyBlock(i)&&i.insertBefore(n,i.firstChild),o&&"P"==o.tagName&&domUtils.isEmptyBlock(o)&&domUtils.remove(o),i&&"P"==i.tagName&&domUtils.isEmptyBlock(i)&&domUtils.remove(i),t.selectNode(n).select(),e.fireEvent("saveScene"))}}))})),e.addListener("keyup",(function(t,n){var i=n.keyCode||n.which;if(13==i){var o,r=e.selection.getRange();(o=domUtils.findParentByTagName(r.startContainer,"p",!0))&&"center"==domUtils.getComputedStyle(o,"text-align")&&domUtils.removeStyle(o,"text-align")}}))},UE.plugins["undo"]=function(){var e,t=this,n=t.options.maxUndoCount||20,i=t.options.maxInputCount||20,o=new RegExp(domUtils.fillChar+"|</hr>","gi"),r={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},a=t.options.autoClearEmptyNode;function s(e,t){if(e.length!=t.length)return 0;for(var n=0,i=e.length;n<i;n++)if(e[n]!=t[n])return 0;return 1}function l(e,t){return e.collapsed!=t.collapsed?0:s(e.startAddress,t.startAddress)&&s(e.endAddress,t.endAddress)?1:0}function d(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.undo=function(){if(this.hasUndo){if(!this.list[this.index-1]&&1==this.list.length)return void this.reset();while(this.list[this.index].content==this.list[this.index-1].content)if(this.index--,0==this.index)return this.restore(0);this.restore(--this.index)}},this.redo=function(){if(this.hasRedo){while(this.list[this.index].content==this.list[this.index+1].content)if(this.index++,this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}},this.restore=function(){var e=this.editor,t=this.list[this.index],n=UE.htmlparser(t.content.replace(o,""));e.options.autoClearEmptyNode=!1,e.filterInputRule(n),e.options.autoClearEmptyNode=a,e.document.body.innerHTML=n.toHtml(),e.fireEvent("afterscencerestore"),browser.ie&&utils.each(domUtils.getElementsByTagName(e.document,"td th caption p"),(function(t){domUtils.isEmptyNode(t)&&domUtils.fillNode(e.document,t)}));try{var i=new dom.Range(e.document).moveToAddress(t.address);i.select(r[i.startContainer.nodeName.toLowerCase()])}catch(s){}this.update(),this.clearKey(),e.fireEvent("reset",!0)},this.getScene=function(){var e=this.editor,t=e.selection.getRange(),n=t.createAddress(!1,!0);e.fireEvent("beforegetscene");var i=UE.htmlparser(e.body.innerHTML);e.options.autoClearEmptyNode=!1,e.filterOutputRule(i),e.options.autoClearEmptyNode=a;var o=i.toHtml();return e.fireEvent("aftergetscene"),{address:n,content:o}},this.save=function(i,o){clearTimeout(e);var r=this.getScene(o),a=this.list[this.index];a&&a.content!=r.content&&t.trigger("contentchange"),a&&a.content==r.content&&(i||l(a.address,r.address))||(this.list=this.list.slice(0,this.index+1),this.list.push(r),this.list.length>n&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){u=0,null}}t.undoManger=new d,t.undoManger.editor=t,t.addListener("saveScene",(function(){var e=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,e)})),t.addListener("reset",(function(e,t){t||this.undoManger.reset()})),t.commands["redo"]=t.commands["undo"]={execCommand:function(e){this.undoManger[e]()},queryCommandState:function(e){return this.undoManger["has"+("undo"==e.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var c={16:1,17:1,18:1,37:1,38:1,39:1,40:1},u=0,m=!1;t.addListener("ready",(function(){domUtils.on(this.body,"compositionstart",(function(){m=!0})),domUtils.on(this.body,"compositionend",(function(){m=!1}))})),t.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var f=!0;t.addListener("keydown",(function(t,n){var o=this,r=n.keyCode||n.which;if(!c[r]&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.altKey){var a=function(e){e.undoManger.save(!1,!0),e.fireEvent("selectionchange")};if(m)return;if(!o.selection.getRange().collapsed)return o.undoManger.save(!1,!0),void(f=!1);0==o.undoManger.list.length&&o.undoManger.save(!0),clearTimeout(e),e=setTimeout((function(){if(m)var e=setInterval((function(){m||(a(o),clearInterval(e))}),300);else a(o)}),200),r,u++,u>=i&&a(o)}})),t.addListener("keyup",(function(e,t){var n=t.keyCode||t.which;if(!c[n]&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey){if(m)return;f||(this.undoManger.save(!1,!0),f=!0)}})),t.stopCmdUndo=function(){t.__hasEnterExecCommand=!0},t.startCmdUndo=function(){t.__hasEnterExecCommand=!1}},UE.plugin.register("copy",(function(){var e=this;return{bindEvents:{ready:function(){browser.ie||window.ZeroClipboard||utils.loadFile(document,{src:e.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},(function(){}))}},commands:{copy:{execCommand:function(t){e.document.execCommand("copy")||alert(e.getLang("copymsg"))}}}}})),UE.plugins["paste"]=function(){function e(e){var t=this.document;if(!t.getElementById("baidu_pastebin")){var n=this.selection.getRange(),i=n.createBookmark(),o=t.createElement("div");o.id="baidu_pastebin",browser.webkit&&o.appendChild(t.createTextNode(domUtils.fillChar+domUtils.fillChar)),t.body.appendChild(o),i.start.style.display="",o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(i.start).y+"px",n.selectNodeContents(o).select(!0),setTimeout((function(){if(browser.webkit)for(var r,a=0,s=t.querySelectorAll("#baidu_pastebin");r=s[a++];){if(!domUtils.isEmptyNode(r)){o=r;break}domUtils.remove(r)}try{o.parentNode.removeChild(o)}catch(l){}n.moveToBookmark(i).select(!0),e(o)}),0)}}var t,n,i,o=this;function r(e){return e.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,(function(e,t,n,i){return n=n.toLowerCase(),{img:1}[n]?e:(i=i.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,(function(e,t,n){return{src:1,href:1,name:1}[t.toLowerCase()]?t+"="+n+" ":""})),{span:1,div:1}[n]?"":"<"+t+n+" "+utils.trim(i)+">")}))}function a(e){var a;if(e.firstChild){for(var s,l=domUtils.getElementsByTagName(e,"span"),d=0;s=l[d++];)"_baidu_cut_start"!=s.id&&"_baidu_cut_end"!=s.id||domUtils.remove(s);if(browser.webkit){var c,u=e.querySelectorAll("div br");for(d=0;c=u[d++];){var m=c.parentNode;"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="<p><br/></p>",domUtils.remove(m))}var f,h=e.querySelectorAll("#baidu_pastebin");for(d=0;f=h[d++];){var p=o.document.createElement("p");f.parentNode.insertBefore(p,f);while(f.firstChild)p.appendChild(f.firstChild);domUtils.remove(f)}var g=e.querySelectorAll("meta");for(d=0;v=g[d++];)domUtils.remove(v);u=e.querySelectorAll("br");for(d=0;v=u[d++];)/^apple-/i.test(v.className)&&domUtils.remove(v)}if(browser.gecko){var b=e.querySelectorAll("[_moz_dirty]");for(d=0;v=b[d++];)v.removeAttribute("_moz_dirty")}if(!browser.ie){var v,y=e.querySelectorAll("span.Apple-style-span");for(d=0;v=y[d++];)domUtils.remove(v,!0)}a=e.innerHTML,a=UE.filterWord(a);var C=UE.htmlparser(a);if(o.options.filterRules&&UE.filterNode(C,o.options.filterRules),o.filterInputRule(C),browser.webkit){var w=C.lastChild();w&&"element"==w.type&&"br"==w.tagName&&C.removeChild(w),utils.each(o.body.querySelectorAll("div"),(function(e){domUtils.isEmptyBlock(e)&&domUtils.remove(e,!0)}))}if(a={html:C.toHtml()},o.fireEvent("beforepaste",a,C),!a.html)return;C=UE.htmlparser(a.html,!0),1===o.queryCommandState("pasteplain")?o.execCommand("insertHtml",UE.filterNode(C,o.options.filterTxtRules).toHtml(),!0):(UE.filterNode(C,o.options.filterTxtRules),t=C.toHtml(),n=a.html,i=o.selection.getRange().createAddress(!0),o.execCommand("insertHtml",!0===o.getOpt("retainOnlyLabelPasted")?r(n):n,!0)),o.fireEvent("afterpaste",a)}}o.setOpt({retainOnlyLabelPasted:!1}),o.addListener("pasteTransfer",(function(e,a){if(i&&t&&n&&t!=n){var s=o.selection.getRange();if(s.moveToAddress(i,!0),!s.collapsed){while(!domUtils.isBody(s.startContainer)){var l=s.startContainer;if(1==l.nodeType){if(l=l.childNodes[s.startOffset],!l){s.setStartBefore(s.startContainer);continue}var d=l.previousSibling;d&&3==d.nodeType&&new RegExp("^[\n\r\t "+domUtils.fillChar+"]*$").test(d.nodeValue)&&s.setStartBefore(d)}if(0!=s.startOffset)break;s.setStartBefore(s.startContainer)}while(!domUtils.isBody(s.endContainer)){var c=s.endContainer;if(1==c.nodeType){if(c=c.childNodes[s.endOffset],!c){s.setEndAfter(s.endContainer);continue}var u=c.nextSibling;u&&3==u.nodeType&&new RegExp("^[\n\r\t"+domUtils.fillChar+"]*$").test(u.nodeValue)&&s.setEndAfter(u)}if(s.endOffset!=s.endContainer[3==s.endContainer.nodeType?"nodeValue":"childNodes"].length)break;s.setEndAfter(s.endContainer)}}s.deleteContents(),s.select(!0),o.__hasEnterExecCommand=!0;var m=n;2===a?m=r(m):a&&(m=t),o.execCommand("inserthtml",m,!0),o.__hasEnterExecCommand=!1;var f=o.selection.getRange();while(!domUtils.isBody(f.startContainer)&&!f.startOffset&&f.startContainer[3==f.startContainer.nodeType?"nodeValue":"childNodes"].length)f.setStartBefore(f.startContainer);var h=f.createAddress(!0);i.endAddress=h.startAddress}})),o.addListener("ready",(function(){domUtils.on(o.body,"cut",(function(){var e=o.selection.getRange();!e.collapsed&&o.undoManger&&o.undoManger.save()})),domUtils.on(o.body,browser.ie||browser.opera?"keydown":"paste",(function(t){(!browser.ie&&!browser.opera||(t.ctrlKey||t.metaKey)&&"86"==t.keyCode)&&e.call(o,(function(e){a(e)}))}))})),o.commands["paste"]={execCommand:function(t){browser.ie?(e.call(o,(function(e){a(e)})),o.document.execCommand("paste")):alert(o.getLang("pastemsg"))}}},UE.plugins["pasteplain"]=function(){var e=this;e.setOpt({pasteplain:!1,filterTxtRules:function(){function e(e){e.tagName="p",e.setStyle()}function t(e){e.parentNode.removeChild(e,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(e){var t,n=UE.uNode.createElement("p");while(t=e.firstChild())"text"!=t.type&&UE.dom.dtd.$block[t.tagName]?n.firstChild()?(e.parentNode.insertBefore(n,e),n=UE.uNode.createElement("p")):e.parentNode.insertBefore(t,e):n.appendChild(t);n.firstChild()&&e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e)},ol:t,ul:t,dl:t,dt:t,dd:t,li:t,caption:e,th:e,tr:e,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,td:function(e){var t=!!e.innerText();t&&e.parentNode.insertAfter(UE.uNode.createText(" "),e),e.parentNode.removeChild(e,e.innerText())}}}()});var t=e.options.pasteplain;e.commands["pasteplain"]={queryCommandState:function(){return t?1:0},execCommand:function(){t=0|!t},notNeedUndo:1}},UE.plugins["list"]=function(){var e=this,t={TD:1,PRE:1,BLOCKQUOTE:1},n={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};function i(e){var t=[];for(var n in e)t.push(n);return t}e.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var o={OL:i(e.options.insertorderedlist),UL:i(e.options.insertunorderedlist)},r=e.options.listiconpath;for(var a in n)e.options.insertorderedlist.hasOwnProperty(a)||e.options.insertunorderedlist.hasOwnProperty(a)||delete n[a];function s(e){var t=e.className;return domUtils.hasClass(e,/custom_/)?t.match(/custom_(\w+)/)[1]:domUtils.getStyle(e,"list-style-type")}function l(e,t){utils.each(domUtils.getElementsByTagName(e,"ol ul"),(function(i){if(domUtils.inDoc(i,e)){var r=i.parentNode;if(r.tagName==i.tagName){var a=s(i)||("OL"==i.tagName?"decimal":"disc"),l=s(r)||("OL"==r.tagName?"decimal":"disc");if(a==l){var u=utils.indexOf(o[i.tagName],a);u=u+1==o[i.tagName].length?0:u+1,c(i,o[i.tagName][u])}}var m=0,f=2;domUtils.hasClass(i,/custom_/)?/[ou]l/i.test(r.tagName)&&domUtils.hasClass(r,/custom_/)||(f=1):/[ou]l/i.test(r.tagName)&&domUtils.hasClass(r,/custom_/)&&(f=3);var h=domUtils.getStyle(i,"list-style-type");h&&(i.style.cssText="list-style-type:"+h),i.className=utils.trim(i.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+f,utils.each(domUtils.getElementsByTagName(i,"li"),(function(e){if(e.style.cssText&&(e.style.cssText=""),e.firstChild){if(e.parentNode===i){if(m++,domUtils.hasClass(i,/custom_/)){var t=1,o=s(i);if("OL"==i.tagName){if(o)switch(o){case"cn":case"cn1":case"cn2":m>10&&(m%10==0||m>10&&m<20)?t=2:m>20&&(t=3);break;case"num2":m>9&&(t=2)}e.className="list-"+n[o]+m+" list-"+o+"-paddingleft-"+t}else e.className="list-"+n[o]+" list-"+o+"-paddingleft"}else e.className=e.className.replace(/list-[\w\-]+/gi,"");var r=e.getAttribute("class");null===r||r.replace(/\s/g,"")||domUtils.removeAttributes(e,"class")}}else domUtils.remove(e)})),!t&&d(i,i.tagName.toLowerCase(),s(i)||domUtils.getStyle(i,"list-style-type"),!0)}}))}function d(e,t,n,i){var o=e.nextSibling;o&&1==o.nodeType&&o.tagName.toLowerCase()==t&&(s(o)||domUtils.getStyle(o,"list-style-type")||("ol"==t?"decimal":"disc"))==n&&(domUtils.moveChild(o,e),0==o.childNodes.length&&domUtils.remove(o)),o&&domUtils.isFillChar(o)&&domUtils.remove(o);var r=e.previousSibling;r&&1==r.nodeType&&r.tagName.toLowerCase()==t&&(s(r)||domUtils.getStyle(r,"list-style-type")||("ol"==t?"decimal":"disc"))==n&&domUtils.moveChild(e,r),r&&domUtils.isFillChar(r)&&domUtils.remove(r),!i&&domUtils.isEmptyBlock(e)&&domUtils.remove(e),s(e)&&l(e.ownerDocument,!0)}function c(e,t){n[t]&&(e.className="custom_"+t);try{domUtils.setStyle(e,"list-style-type",t)}catch(i){}}function u(e){var t=e.previousSibling;t&&domUtils.isEmptyBlock(t)&&domUtils.remove(t),t=e.nextSibling,t&&domUtils.isEmptyBlock(t)&&domUtils.remove(t)}function m(e){while(e&&!domUtils.isBody(e)){if("TABLE"==e.nodeName)return null;if("LI"==e.nodeName)return e;e=e.parentNode}}e.ready((function(){var t=[];for(var i in n){if("dash"==i||"dot"==i)t.push("li.list-"+n[i]+"{background-image:url("+r+n[i]+".gif)}"),t.push("ul.custom_"+i+"{list-style:none;}ul.custom_"+i+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var o=0;o<99;o++)t.push("li.list-"+n[i]+o+"{background-image:url("+r+"list-"+n[i]+o+".gif)}");t.push("ol.custom_"+i+"{list-style:none;}ol.custom_"+i+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(i){case"cn":t.push("li.list-"+i+"-paddingleft-1{padding-left:25px}"),t.push("li.list-"+i+"-paddingleft-2{padding-left:40px}"),t.push("li.list-"+i+"-paddingleft-3{padding-left:55px}");break;case"cn1":t.push("li.list-"+i+"-paddingleft-1{padding-left:30px}"),t.push("li.list-"+i+"-paddingleft-2{padding-left:40px}"),t.push("li.list-"+i+"-paddingleft-3{padding-left:55px}");break;case"cn2":t.push("li.list-"+i+"-paddingleft-1{padding-left:40px}"),t.push("li.list-"+i+"-paddingleft-2{padding-left:55px}"),t.push("li.list-"+i+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":t.push("li.list-"+i+"-paddingleft-1{padding-left:25px}");break;case"num2":t.push("li.list-"+i+"-paddingleft-1{padding-left:35px}"),t.push("li.list-"+i+"-paddingleft-2{padding-left:40px}");break;case"dash":t.push("li.list-"+i+"-paddingleft{padding-left:35px}");break;case"dot":t.push("li.list-"+i+"-paddingleft{padding-left:20px}")}}t.push(".list-paddingleft-1{padding-left:0}"),t.push(".list-paddingleft-2{padding-left:"+e.options.listDefaultPaddingLeft+"px}"),t.push(".list-paddingleft-3{padding-left:"+2*e.options.listDefaultPaddingLeft+"px}"),utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+t.join("\n"),e.document)})),e.ready((function(){domUtils.on(e.body,"cut",(function(){setTimeout((function(){var t,n=e.selection.getRange();if(!n.collapsed&&(t=domUtils.findParentByTagName(n.startContainer,"li",!0))&&!t.nextSibling&&domUtils.isEmptyBlock(t)){var i,o=t.parentNode;if(i=o.previousSibling)domUtils.remove(o),n.setStartAtLast(i).collapse(!0),n.select(!0);else if(i=o.nextSibling)domUtils.remove(o),n.setStartAtFirst(i).collapse(!0),n.select(!0);else{var r=e.document.createElement("p");domUtils.fillNode(e.document,r),o.parentNode.insertBefore(r,o),domUtils.remove(o),n.setStart(r,0).collapse(!0),n.select(!0)}}}))}))})),e.addListener("beforepaste",(function(e,t){var i,r=this,a=r.selection.getRange(),l=UE.htmlparser(t.html,!0);if(i=domUtils.findParentByTagName(a.startContainer,"li",!0)){var d=i.parentNode,c="OL"==d.tagName?"ul":"ol";utils.each(l.getNodesByTagName(c),(function(t){if(t.tagName=d.tagName,t.setAttr(),t.parentNode===l)e=s(d)||("OL"==d.tagName?"decimal":"disc");else{var i=t.parentNode.getAttr("class");e=i&&/custom_/.test(i)?i.match(/custom_(\w+)/)[1]:t.parentNode.getStyle("list-style-type"),e||(e="OL"==d.tagName?"decimal":"disc")}var r=utils.indexOf(o[d.tagName],e);t.parentNode!==l&&(r=r+1==o[d.tagName].length?0:r+1);var a=o[d.tagName][r];n[a]?t.setAttr("class","custom_"+a):t.setStyle("list-style-type",a)}))}t.html=l.toHtml()})),!0===e.getOpt("disablePInList")&&e.addOutputRule((function(e){utils.each(e.getNodesByTagName("li"),(function(e){var t=[],n=0;utils.each(e.children,(function(i){if("p"==i.tagName){var o;while(o=i.children.pop())t.splice(n,0,o),o.parentNode=e,lastNode=o;if(o=t[t.length-1],!o||"element"!=o.type||"br"!=o.tagName){var r=UE.uNode.createElement("br");r.parentNode=e,t.push(r)}n=t.length}})),t.length&&(e.children=t)}))})),e.addInputRule((function(t){if(utils.each(t.getNodesByTagName("li"),(function(e){for(var t,n=UE.uNode.createElement("p"),i=0;t=e.children[i];)"text"==t.type||dtd.p[t.tagName]?n.appendChild(t):n.firstChild()?(e.insertBefore(n,t),n=UE.uNode.createElement("p"),i+=2):i++;(n.firstChild()&&!n.parentNode||!e.firstChild())&&e.appendChild(n),n.firstChild()||n.innerHTML(browser.ie?" ":"<br/>");var o=e.firstChild(),r=o.lastChild();r&&"text"==r.type&&/^\s*$/.test(r.data)&&o.removeChild(r)})),e.options.autoTransWordToList){var i=function(e,t){var n=t.firstChild();if(n&&"element"==n.type&&"span"==n.tagName&&/Wingdings|Symbol/.test(n.getStyle("font-family"))){for(var i in r)if(r[i]==n.data)return i;return"disc"}for(var i in o)if(o[i].test(e))return i},o={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},r={square:"n"};utils.each(t.getNodesByTagName("p"),(function(t){if("MsoListParagraph"==t.getAttr("class")){t.setStyle("margin",""),t.setStyle("margin-left",""),t.setAttr("class","");var r,a=t,s=t;if("li"!=t.parentNode.tagName&&(r=i(t.innerText(),t))){var l=UE.uNode.createElement(e.options.insertorderedlist.hasOwnProperty(r)?"ol":"ul");n[r]?l.setAttr("class","custom_"+r):l.setStyle("list-style-type",r);while(t&&"li"!=t.parentNode.tagName&&i(t.innerText(),t))a=t.nextSibling(),a||t.parentNode.insertBefore(l,t),c(l,t,r),t=a;!l.parentNode&&t&&t.parentNode&&t.parentNode.insertBefore(l,t)}var d=s.firstChild();d&&"element"==d.type&&"span"==d.tagName&&/^\s*( )+\s*$/.test(d.innerText())&&d.parentNode.removeChild(d)}function c(e,t,n){if("ol"==e.tagName)if(browser.ie){var i=t.firstChild();"element"==i.type&&"span"==i.tagName&&o[n].test(i.innerText())&&t.removeChild(i)}else t.innerHTML(t.innerHTML().replace(o[n],""));else t.removeChild(t.firstChild());var r=UE.uNode.createElement("li");r.appendChild(t),e.appendChild(r)}}))}})),e.addListener("contentchange",(function(){l(e.document)})),e.addListener("keydown",(function(t,n){function i(){n.preventDefault?n.preventDefault():n.returnValue=!1,e.fireEvent("contentchange"),e.undoManger&&e.undoManger.save()}function o(e,t){while(e&&!domUtils.isBody(e)){if(t(e))return null;if(1==e.nodeType&&/[ou]l/i.test(e.tagName))return e;e=e.parentNode}return null}var r=n.keyCode||n.which;if(13==r&&!n.shiftKey){var a=e.selection.getRange(),s=domUtils.findParent(a.startContainer,(function(e){return domUtils.isBlockElm(e)}),!0),l=domUtils.findParentByTagName(a.startContainer,"li",!0);if(s&&"PRE"!=s.tagName&&!l){var d=s.innerHTML.replace(new RegExp(domUtils.fillChar,"g"),"");/^\s*1\s*\.[^\d]/.test(d)&&(s.innerHTML=d.replace(/^\s*1\s*\./,""),a.setStartAtLast(s).collapse(!0).select(),e.__hasEnterExecCommand=!0,e.execCommand("insertorderedlist"),e.__hasEnterExecCommand=!1)}var c=e.selection.getRange(),m=o(c.startContainer,(function(e){return"TABLE"==e.tagName})),f=c.collapsed?m:o(c.endContainer,(function(e){return"TABLE"==e.tagName}));if(m&&f&&m===f){if(!c.collapsed){if(m=domUtils.findParentByTagName(c.startContainer,"li",!0),f=domUtils.findParentByTagName(c.endContainer,"li",!0),!m||!f||m!==f){var h=c.cloneRange(),p=h.collapse(!1).createBookmark();c.deleteContents(),h.moveToBookmark(p);l=domUtils.findParentByTagName(h.startContainer,"li",!0);return u(l),h.select(),void i()}if(c.deleteContents(),l=domUtils.findParentByTagName(c.startContainer,"li",!0),l&&domUtils.isEmptyBlock(l))return w=l.previousSibling,next=l.nextSibling,v=e.document.createElement("p"),domUtils.fillNode(e.document,v),g=l.parentNode,w&&next?(c.setStart(next,0).collapse(!0).select(!0),domUtils.remove(l)):((w||next)&&w?l.parentNode.parentNode.insertBefore(v,g.nextSibling):g.parentNode.insertBefore(v,g),domUtils.remove(l),g.firstChild||domUtils.remove(g),c.setStart(v,0).setCursor()),void i()}if(l=domUtils.findParentByTagName(c.startContainer,"li",!0),l){if(domUtils.isEmptyBlock(l)){p=c.createBookmark();var g=l.parentNode;if(l!==g.lastChild?(domUtils.breakParent(l,g),u(l)):(g.parentNode.insertBefore(l,g.nextSibling),domUtils.isEmptyNode(g)&&domUtils.remove(g)),!dtd.$list[l.parentNode.tagName])if(domUtils.isBlockElm(l.firstChild))domUtils.remove(l,!0);else{v=e.document.createElement("p"),l.parentNode.insertBefore(v,l);while(l.firstChild)v.appendChild(l.firstChild);domUtils.remove(l)}c.moveToBookmark(p).select()}else{var b=l.firstChild;if(!b||!domUtils.isBlockElm(b)){var v=e.document.createElement("p");!l.firstChild&&domUtils.fillNode(e.document,v);while(l.firstChild)v.appendChild(l.firstChild);l.appendChild(v),b=v}var y=e.document.createElement("span");c.insertNode(y),domUtils.breakParent(y,l);var C=y.nextSibling;b=C.firstChild,b||(v=e.document.createElement("p"),domUtils.fillNode(e.document,v),C.appendChild(v),b=v),domUtils.isEmptyNode(b)&&(b.innerHTML="",domUtils.fillNode(e.document,b)),c.setStart(b,0).collapse(!0).shrinkBoundary().select(),domUtils.remove(y);var w=C.previousSibling;w&&domUtils.isEmptyBlock(w)&&(w.innerHTML="<p></p>",domUtils.fillNode(e.document,w.firstChild))}i()}}}if(8==r&&(c=e.selection.getRange(),c.collapsed&&domUtils.isStartInblock(c)&&(h=c.cloneRange().trimBoundary(),l=domUtils.findParentByTagName(c.startContainer,"li",!0),l&&domUtils.isStartInblock(h)))){if(m=domUtils.findParentByTagName(c.startContainer,"p",!0),m&&m!==l.firstChild){g=domUtils.findParentByTagName(m,["ol","ul"]);return domUtils.breakParent(m,g),u(m),e.fireEvent("contentchange"),c.setStart(m,0).setCursor(!1,!0),e.fireEvent("saveScene"),void domUtils.preventDefault(n)}if(l&&(w=l.previousSibling)){if(46==r&&l.childNodes.length)return;if(dtd.$list[w.tagName]&&(w=w.lastChild),e.undoManger&&e.undoManger.save(),b=l.firstChild,domUtils.isBlockElm(b))if(domUtils.isEmptyNode(b)){w.appendChild(b),c.setStart(b,0).setCursor(!1,!0);while(l.firstChild)w.appendChild(l.firstChild)}else y=e.document.createElement("span"),c.insertNode(y),domUtils.isEmptyBlock(w)&&(w.innerHTML=""),domUtils.moveChild(l,w),c.setStartBefore(y).collapse(!0).select(!0),domUtils.remove(y);else if(domUtils.isEmptyNode(l)){v=e.document.createElement("p");w.appendChild(v),c.setStart(v,0).setCursor()}else{c.setEnd(w,w.childNodes.length).collapse().select(!0);while(l.firstChild)w.appendChild(l.firstChild)}return domUtils.remove(l),e.fireEvent("contentchange"),e.fireEvent("saveScene"),void domUtils.preventDefault(n)}if(l&&!l.previousSibling){g=l.parentNode,p=c.createBookmark();if(domUtils.isTagNode(g.parentNode,"ol ul"))g.parentNode.insertBefore(l,g),domUtils.isEmptyNode(g)&&domUtils.remove(g);else{while(l.firstChild)g.parentNode.insertBefore(l.firstChild,g);domUtils.remove(l),domUtils.isEmptyNode(g)&&domUtils.remove(g)}return c.moveToBookmark(p).setCursor(!1,!0),e.fireEvent("contentchange"),e.fireEvent("saveScene"),void domUtils.preventDefault(n)}}})),e.addListener("keyup",(function(t,n){var i=n.keyCode||n.which;if(8==i){var o,r=e.selection.getRange();(o=domUtils.findParentByTagName(r.startContainer,["ol","ul"],!0))&&d(o,o.tagName.toLowerCase(),s(o)||domUtils.getComputedStyle(o,"list-style-type"),!0)}})),e.addListener("tabkeydown",(function(){var t=e.selection.getRange();function n(t){if(-1!=e.options.maxListLevel){var n=t.parentNode,i=0;while(/[ou]l/i.test(n.tagName))i++,n=n.parentNode;if(i>=e.options.maxListLevel)return!0}}var i=domUtils.findParentByTagName(t.startContainer,"li",!0);if(i){var r;if(!t.collapsed){e.fireEvent("saveScene"),r=t.createBookmark();for(var a,l,u=0,m=domUtils.findParents(i);l=m[u++];)if(domUtils.isTagNode(l,"ol ul")){a=l;break}var f=i;if(r.end)while(f&&!(domUtils.getPosition(f,r.end)&domUtils.POSITION_FOLLOWING))if(n(f))f=domUtils.getNextDomNode(f,!1,null,(function(e){return e!==a}));else{p=f.parentNode,g=e.document.createElement(p.tagName),b=utils.indexOf(o[g.tagName],s(p)||domUtils.getComputedStyle(p,"list-style-type"));var h=b+1==o[g.tagName].length?0:b+1;v=o[g.tagName][h];c(g,v),p.insertBefore(g,f);while(f&&!(domUtils.getPosition(f,r.end)&domUtils.POSITION_FOLLOWING)){if(i=f.nextSibling,g.appendChild(f),!i||domUtils.isTagNode(i,"ol ul")){if(i){while(i=i.firstChild)if("LI"==i.tagName)break}else i=domUtils.getNextDomNode(f,!1,null,(function(e){return e!==a}));break}f=i}d(g,g.tagName.toLowerCase(),v),f=i}return e.fireEvent("contentchange"),t.moveToBookmark(r).select(),!0}if(n(i))return!0;var p=i.parentNode,g=e.document.createElement(p.tagName),b=utils.indexOf(o[g.tagName],s(p)||domUtils.getComputedStyle(p,"list-style-type"));b=b+1==o[g.tagName].length?0:b+1;var v=o[g.tagName][b];if(c(g,v),domUtils.isStartInblock(t))return e.fireEvent("saveScene"),r=t.createBookmark(),p.insertBefore(g,i),g.appendChild(i),d(g,g.tagName.toLowerCase(),v),e.fireEvent("contentchange"),t.moveToBookmark(r).select(!0),!0}})),e.commands["insertorderedlist"]=e.commands["insertunorderedlist"]={execCommand:function(e,n){n||(n="insertorderedlist"==e.toLowerCase()?"decimal":"disc");var i=this,o=this.selection.getRange(),r=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},a="insertorderedlist"==e.toLowerCase()?"ol":"ul",l=i.document.createDocumentFragment();o.adjustmentBoundary().shrinkBoundary();var u,f,h,p,g=o.createBookmark(!0),b=m(i.document.getElementById(g.start)),v=0,y=m(i.document.getElementById(g.end)),C=0;if(b||y){if(b&&(u=b.parentNode),g.end||(y=b),y&&(f=y.parentNode),u===f){while(b!==y){if(p=b,b=b.nextSibling,!domUtils.isBlockElm(p.firstChild)){var w=i.document.createElement("p");while(p.firstChild)w.appendChild(p.firstChild);p.appendChild(w)}l.appendChild(p)}if(p=i.document.createElement("span"),u.insertBefore(p,y),!domUtils.isBlockElm(y.firstChild)){w=i.document.createElement("p");while(y.firstChild)w.appendChild(y.firstChild);y.appendChild(w)}l.appendChild(y),domUtils.breakParent(p,u),domUtils.isEmptyNode(p.previousSibling)&&domUtils.remove(p.previousSibling),domUtils.isEmptyNode(p.nextSibling)&&domUtils.remove(p.nextSibling);var x=s(u)||domUtils.getComputedStyle(u,"list-style-type")||("insertorderedlist"==e.toLowerCase()?"decimal":"disc");if(u.tagName.toLowerCase()==a&&x==n){for(var N=0,_=i.document.createDocumentFragment();O=l.firstChild;)if(domUtils.isTagNode(O,"ol ul"))_.appendChild(O);else while(O.firstChild)_.appendChild(O.firstChild),domUtils.remove(O);p.parentNode.insertBefore(_,p)}else h=i.document.createElement(a),c(h,n),h.appendChild(l),p.parentNode.insertBefore(h,p);return domUtils.remove(p),h&&d(h,a,n),void o.moveToBookmark(g).select()}if(b){while(b){if(p=b.nextSibling,domUtils.isTagNode(b,"ol ul"))l.appendChild(b);else{var U=i.document.createDocumentFragment(),E=0;while(b.firstChild)domUtils.isBlockElm(b.firstChild)&&(E=1),U.appendChild(b.firstChild);if(E)l.appendChild(U);else{var k=i.document.createElement("p");k.appendChild(U),l.appendChild(k)}domUtils.remove(b)}b=p}u.parentNode.insertBefore(l,u.nextSibling),domUtils.isEmptyNode(u)?(o.setStartBefore(u),domUtils.remove(u)):o.setStartAfter(u),v=1}if(y&&domUtils.inDoc(f,i.document)){b=f.firstChild;while(b&&b!==y){if(p=b.nextSibling,domUtils.isTagNode(b,"ol ul"))l.appendChild(b);else{U=i.document.createDocumentFragment(),E=0;while(b.firstChild)domUtils.isBlockElm(b.firstChild)&&(E=1),U.appendChild(b.firstChild);E?l.appendChild(U):(k=i.document.createElement("p"),k.appendChild(U),l.appendChild(k)),domUtils.remove(b)}b=p}var T=domUtils.createElement(i.document,"div",{tmpDiv:1});domUtils.moveChild(y,T),l.appendChild(T),domUtils.remove(y),f.parentNode.insertBefore(l,f),o.setEndBefore(f),domUtils.isEmptyNode(f)&&domUtils.remove(f),C=1}}v||o.setStartBefore(i.document.getElementById(g.start)),g.end&&!C&&o.setEndAfter(i.document.getElementById(g.end)),o.enlarge(!0,(function(e){return t[e.tagName]})),l=i.document.createDocumentFragment();var S=o.createBookmark(),B=domUtils.getNextDomNode(S.start,!1,r),I=o.cloneRange(),L=domUtils.isBlockElm;while(B&&B!==S.end&&domUtils.getPosition(B,S.end)&domUtils.POSITION_PRECEDING)if(3==B.nodeType||dtd.li[B.tagName]){if(1==B.nodeType&&dtd.$list[B.tagName]){while(B.firstChild)l.appendChild(B.firstChild);R=domUtils.getNextDomNode(B,!1,r),domUtils.remove(B),B=R;continue}R=B,I.setStartBefore(B);while(B&&B!==S.end&&(!L(B)||domUtils.isBookmarkNode(B)))R=B,B=domUtils.getNextDomNode(B,!1,null,(function(e){return!t[e.tagName]}));B&&L(B)&&(p=domUtils.getNextDomNode(R,!1,r),p&&domUtils.isBookmarkNode(p)&&(B=domUtils.getNextDomNode(p,!1,r),R=p)),I.setEndAfter(R),B=domUtils.getNextDomNode(R,!1,r);var A=o.document.createElement("li");if(A.appendChild(I.extractContents()),domUtils.isEmptyNode(A)){var R=o.document.createElement("p");while(A.firstChild)R.appendChild(A.firstChild);A.appendChild(R)}l.appendChild(A)}else B=domUtils.getNextDomNode(B,!0,r);o.moveToBookmark(S).collapse(!0),h=i.document.createElement(a),c(h,n),h.appendChild(l),o.insertNode(h),d(h,a,n);N=0;for(var O,D=domUtils.getElementsByTagName(h,"div");O=D[N++];)O.getAttribute("tmpDiv")&&domUtils.remove(O,!0);o.moveToBookmark(g).select()},queryCommandState:function(e){for(var t,n="insertorderedlist"==e.toLowerCase()?"ol":"ul",i=this.selection.getStartElementPath(),o=0;t=i[o++];){if("TABLE"==t.nodeName)return 0;if(n==t.nodeName.toLowerCase())return 1}return 0},queryCommandValue:function(e){for(var t,n,i="insertorderedlist"==e.toLowerCase()?"ol":"ul",o=this.selection.getStartElementPath(),r=0;n=o[r++];){if("TABLE"==n.nodeName){t=null;break}if(i==n.nodeName.toLowerCase()){t=n;break}}return t?s(t)||domUtils.getComputedStyle(t,"list-style-type"):null}}},function(){var e={textarea:function(e,t){var n=t.ownerDocument.createElement("textarea");return n.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;",browser.ie&&browser.version<8&&(n.style.width=t.offsetWidth+"px",n.style.height=t.offsetHeight+"px",t.onresize=function(){n.style.width=t.offsetWidth+"px",n.style.height=t.offsetHeight+"px"}),t.appendChild(n),{setContent:function(e){n.value=e},getContent:function(){return n.value},select:function(){var e;browser.ie?(e=n.createTextRange(),e.collapse(!0),e.select()):(n.setSelectionRange(0,0),n.focus())},dispose:function(){t.removeChild(n),t.onresize=null,n=null,t=null}}},codemirror:function(e,t){var n=window.CodeMirror(t,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),i=n.getWrapperElement();return i.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;',n.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;",n.refresh(),{getCodeMirror:function(){return n},setContent:function(e){n.setValue(e)},getContent:function(){return n.getValue()},select:function(){n.focus()},dispose:function(){t.removeChild(i),i=null,n=null}}}};UE.plugins["source"]=function(){var t,n,i,o,r,a=this,s=this.options,l=!1;function d(t){return e["codemirror"==s.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](a,t)}s.sourceEditor=browser.ie?"textarea":s.sourceEditor||"codemirror",a.setOpt({sourceEditorFirst:!1}),a.commands["source"]={execCommand:function(){if(l=!l,l){r=a.selection.getRange().createAddress(!1,!0),a.undoManger&&a.undoManger.save(!0),browser.gecko&&(a.body.contentEditable=!1),i=a.iframe.style.cssText,a.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;",a.fireEvent("beforegetcontent");var e=UE.htmlparser(a.body.innerHTML);a.filterOutputRule(e),e.traversal((function(e){if("element"==e.type)switch(e.tagName){case"td":case"th":case"caption":e.children&&1==e.children.length&&"br"==e.firstChild().tagName&&e.removeChild(e.firstChild());break;case"pre":e.innerText(e.innerText().replace(/ /g," "))}})),a.fireEvent("aftergetcontent");var s=e.toHtml(!0);t=d(a.iframe.parentNode),t.setContent(s),n=a.setContent,a.setContent=function(e){var n=UE.htmlparser(e);a.filterInputRule(n),e=n.toHtml(),t.setContent(e)},setTimeout((function(){t.select(),a.addListener("fullscreenchanged",(function(){try{t.getCodeMirror().refresh()}catch(e){}}))})),o=a.getContent,a.getContent=function(){return t.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>"}}else{a.iframe.style.cssText=i;var c=t.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>";c=c.replace(new RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),(function(e,t){return t&&!dtd.$inlineWithA[t.toLowerCase()]?e.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):e.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")})),a.setContent=n,a.setContent(c),t.dispose(),t=null,a.getContent=o;var u=a.body.firstChild;if(u||(a.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",u=a.body.firstChild),a.undoManger&&a.undoManger.save(!0),browser.gecko){var m=document.createElement("input");m.style.cssText="position:absolute;left:0;top:-32768px",document.body.appendChild(m),a.body.contentEditable=!1,setTimeout((function(){domUtils.setViewportOffset(m,{left:-32768,top:0}),m.focus(),setTimeout((function(){a.body.contentEditable=!0,a.selection.getRange().moveToAddress(r).select(!0),domUtils.remove(m)}))}))}else try{a.selection.getRange().moveToAddress(r).select(!0)}catch(f){}}this.fireEvent("sourcemodechanged",l)},queryCommandState:function(){return 0|l},notNeedUndo:1};var c=a.queryCommandState;a.queryCommandState=function(e){return e=e.toLowerCase(),l?e in{source:1,fullscreen:1}?1:-1:c.apply(this,arguments)},"codemirror"==s.sourceEditor&&a.addListener("ready",(function(){utils.loadFile(document,{src:s.codeMirrorJsUrl||s.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},(function(){s.sourceEditorFirst&&setTimeout((function(){a.execCommand("source")}),0)})),utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:s.codeMirrorCssUrl||s.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})}))}}(),UE.plugins["enterkey"]=function(){var e,t=this,n=t.options.enterTag;t.addListener("keyup",(function(n,i){var o=i.keyCode||i.which;if(13==o){var r,a=t.selection.getRange(),s=a.startContainer;if(browser.ie)t.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(e)){if(browser.gecko){var l=domUtils.findParentByTagName(s,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0);l||(t.document.execCommand("formatBlock",!1,"<p>"),r=1)}else if(1==s.nodeType){var d,c=t.document.createTextNode("");if(a.insertNode(c),d=domUtils.findParentByTagName(c,"div",!0),d){var u=t.document.createElement("p");while(d.firstChild)u.appendChild(d.firstChild);d.parentNode.insertBefore(u,d),domUtils.remove(d),a.setStartBefore(c).setCursor(),r=1}domUtils.remove(c)}t.undoManger&&r&&t.undoManger.save()}browser.opera&&a.select()}}})),t.addListener("keydown",(function(i,o){var r=o.keyCode||o.which;if(13==r){if(t.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(o);t.fireEvent("saveScene",!0,!0),e="";var a=t.selection.getRange();if(!a.collapsed){var s=a.startContainer,l=a.endContainer,d=domUtils.findParentByTagName(s,"td",!0),c=domUtils.findParentByTagName(l,"td",!0);if(d&&c&&d!==c||!d&&c||d&&!c)return void(o.preventDefault?o.preventDefault():o.returnValue=!1)}if("p"==n)browser.ie||(s=domUtils.findParentByTagName(a.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),s||browser.opera?(e=s.tagName,"p"==s.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(s)):(t.document.execCommand("formatBlock",!1,"<p>"),browser.gecko&&(a=t.selection.getRange(),s=domUtils.findParentByTagName(a.startContainer,"p",!0),s&&domUtils.removeDirtyAttr(s))));else if(o.preventDefault?o.preventDefault():o.returnValue=!1,a.collapsed){m=a.document.createElement("br"),a.insertNode(m);var u=m.parentNode;u.lastChild===m?(m.parentNode.insertBefore(m.cloneNode(!0),m),a.setStartBefore(m)):a.setStartAfter(m),a.setCursor()}else if(a.deleteContents(),s=a.startContainer,1==s.nodeType&&(s=s.childNodes[a.startOffset])){while(1==s.nodeType){if(dtd.$empty[s.tagName])return a.setStartBefore(s).setCursor(),t.undoManger&&t.undoManger.save(),!1;if(!s.firstChild){var m=a.document.createElement("br");return s.appendChild(m),a.setStart(s,0).setCursor(),t.undoManger&&t.undoManger.save(),!1}s=s.firstChild}s===a.startContainer.childNodes[a.startOffset]?(m=a.document.createElement("br"),a.insertNode(m).setCursor()):a.setStart(s,0).setCursor()}else m=a.document.createElement("br"),a.insertNode(m).setStartAfter(m).setCursor()}}))},UE.plugins["keystrokes"]=function(){var e=this,t=!0;e.addListener("keydown",(function(n,i){var o=i.keyCode||i.which,r=e.selection.getRange();if(!r.collapsed&&!(i.ctrlKey||i.shiftKey||i.altKey||i.metaKey)&&(o>=65&&o<=90||o>=48&&o<=57||o>=96&&o<=111||{13:1,8:1,46:1}[o])){var a=r.startContainer;if(domUtils.isFillChar(a)&&r.setStartBefore(a),a=r.endContainer,domUtils.isFillChar(a)&&r.setEndAfter(a),r.txtToElmBoundary(),r.endContainer&&1==r.endContainer.nodeType&&(a=r.endContainer.childNodes[r.endOffset],a&&domUtils.isBr(a)&&r.setEndAfter(a)),0==r.startOffset&&(a=r.startContainer,domUtils.isBoundaryNode(a,"firstChild")&&(a=r.endContainer,r.endOffset==(3==a.nodeType?a.nodeValue.length:a.childNodes.length)&&domUtils.isBoundaryNode(a,"lastChild"))))return e.fireEvent("saveScene"),e.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",r.setStart(e.body.firstChild,0).setCursor(!1,!0),void e._selectionChange()}if(o==keymap.Backspace){if(r=e.selection.getRange(),t=r.collapsed,e.fireEvent("delkeydown",i))return;var s,l;if(r.collapsed&&r.inFillChar()&&(s=r.startContainer,domUtils.isFillChar(s)?(r.setStartBefore(s).shrinkBoundary(!0).collapse(!0),domUtils.remove(s)):(s.nodeValue=s.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),r.startOffset--,r.collapse(!0).select(!0))),s=r.getClosedNode())return e.fireEvent("saveScene"),r.setStartBefore(s),domUtils.remove(s),r.setCursor(),e.fireEvent("saveScene"),void domUtils.preventDefault(i);if(!browser.ie&&(s=domUtils.findParentByTagName(r.startContainer,"table",!0),l=domUtils.findParentByTagName(r.endContainer,"table",!0),s&&!l||!s&&l||s!==l))return void i.preventDefault()}if(o==keymap.Tab){var d={ol:1,ul:1,table:1};if(e.fireEvent("tabkeydown",i))return void domUtils.preventDefault(i);var c=e.selection.getRange();e.fireEvent("saveScene");for(var u=0,m="",f=e.options.tabSize||4,h=e.options.tabNode||" ";u<f;u++)m+=h;var p=e.document.createElement("span");if(p.innerHTML=m+domUtils.fillChar,c.collapsed)c.insertNode(p.cloneNode(!0).firstChild).setCursor(!0);else{var g=function(e){return domUtils.isBlockElm(e)&&!d[e.tagName.toLowerCase()]};if(s=domUtils.findParent(c.startContainer,g,!0),l=domUtils.findParent(c.endContainer,g,!0),s&&l&&s===l)c.deleteContents(),c.insertNode(p.cloneNode(!0).firstChild).setCursor(!0);else{var b=c.createBookmark();c.enlarge(!0);var v=c.createBookmark(),y=domUtils.getNextDomNode(v.start,!1,g);while(y&&!(domUtils.getPosition(y,v.end)&domUtils.POSITION_FOLLOWING))y.insertBefore(p.cloneNode(!0).firstChild,y.firstChild),y=domUtils.getNextDomNode(y,!1,g);c.moveToBookmark(v).moveToBookmark(b).select()}}domUtils.preventDefault(i)}if(browser.gecko&&46==o&&(c=e.selection.getRange(),c.collapsed&&(s=c.startContainer,domUtils.isEmptyBlock(s)))){var C=s.parentNode;while(1==domUtils.getChildCount(C)&&!domUtils.isBody(C))s=C,C=C.parentNode;s===C.lastChild&&i.preventDefault()}else;})),e.addListener("keyup",(function(e,n){var i,o=n.keyCode||n.which,r=this;if(o==keymap.Backspace){if(r.fireEvent("delkeyup"))return;if(i=r.selection.getRange(),i.collapsed){var a=["h1","h2","h3","h4","h5","h6"];if((d=domUtils.findParentByTagName(i.startContainer,a,!0))&&domUtils.isEmptyBlock(d)){var s=d.previousSibling;if(s&&"TABLE"!=s.nodeName)return domUtils.remove(d),void i.setStartAtLast(s).setCursor(!1,!0);var l=d.nextSibling;if(l&&"TABLE"!=l.nodeName)return domUtils.remove(d),void i.setStartAtFirst(l).setCursor(!1,!0)}if(domUtils.isBody(i.startContainer)){var d=domUtils.createElement(r.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"});i.insertNode(d).setStart(d,0).setCursor(!1,!0)}}if(!t&&(3==i.startContainer.nodeType||1==i.startContainer.nodeType&&domUtils.isEmptyBlock(i.startContainer)))if(browser.ie){var c=i.document.createElement("span");i.insertNode(c).setStartBefore(c).collapse(!0),i.select(),domUtils.remove(c)}else i.select()}}))},UE.plugins["fiximgclick"]=function(){var e=!1;function t(){this.editor=null,this.resizer=null,this.cover=null,this.doc=document,this.prePos={x:0,y:0},this.startPos={x:0,y:0}}return function(){var n=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];t.prototype={init:function(e){var t=this;t.editor=e,t.startPos=this.prePos={x:0,y:0},t.dragId=-1;var n=[],o=t.cover=document.createElement("div"),r=t.resizer=document.createElement("div");for(o.id=t.editor.ui.id+"_imagescale_cover",o.style.cssText="position:absolute;display:none;z-index:"+t.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;",domUtils.on(o,"mousedown click",(function(){t.hide()})),i=0;i<8;i++)n.push('<span class="edui-editor-imagescale-hand'+i+'"></span>');r.id=t.editor.ui.id+"_imagescale",r.className="edui-editor-imagescale",r.innerHTML=n.join(""),r.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+t.editor.options.zIndex+";",t.editor.ui.getDom().appendChild(o),t.editor.ui.getDom().appendChild(r),t.initStyle(),t.initEvents()},initStyle:function(){utils.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},initEvents:function(){var e=this;e.startPos.x=e.startPos.y=0,e.isDraging=!1},_eventHandler:function(t){var n=this;switch(t.type){case"mousedown":var i=t.target||t.srcElement;-1!=i.className.indexOf("edui-editor-imagescale-hand")&&-1==n.dragId&&(n.dragId=i.className.slice(-1),n.startPos.x=n.prePos.x=t.clientX,n.startPos.y=n.prePos.y=t.clientY,domUtils.on(n.doc,"mousemove",n.proxy(n._eventHandler,n)));break;case"mousemove":-1!=n.dragId&&(n.updateContainerStyle(n.dragId,{x:t.clientX-n.prePos.x,y:t.clientY-n.prePos.y}),n.prePos.x=t.clientX,n.prePos.y=t.clientY,e=!0,n.updateTargetElement());break;case"mouseup":-1!=n.dragId&&(n.updateContainerStyle(n.dragId,{x:t.clientX-n.prePos.x,y:t.clientY-n.prePos.y}),n.updateTargetElement(),n.target.parentNode&&n.attachTo(n.target),n.dragId=-1),domUtils.un(n.doc,"mousemove",n.proxy(n._eventHandler,n)),e&&(e=!1,n.editor.fireEvent("contentchange"));break;default:break}},updateTargetElement:function(){var e=this;domUtils.setStyles(e.target,{width:e.resizer.style.width,height:e.resizer.style.height}),e.target.width=parseInt(e.resizer.style.width),e.target.height=parseInt(e.resizer.style.height),e.attachTo(e.target)},updateContainerStyle:function(e,t){var i,o=this,r=o.resizer;0!=n[e][0]&&(i=parseInt(r.style.left)+t.x,r.style.left=o._validScaledProp("left",i)+"px"),0!=n[e][1]&&(i=parseInt(r.style.top)+t.y,r.style.top=o._validScaledProp("top",i)+"px"),0!=n[e][2]&&(i=r.clientWidth+n[e][2]*t.x,r.style.width=o._validScaledProp("width",i)+"px"),0!=n[e][3]&&(i=r.clientHeight+n[e][3]*t.y,r.style.height=o._validScaledProp("height",i)+"px")},_validScaledProp:function(e,t){var n=this.resizer,i=document;switch(t=isNaN(t)?0:t,e){case"left":return t<0?0:t+n.clientWidth>i.clientWidth?i.clientWidth-n.clientWidth:t;case"top":return t<0?0:t+n.clientHeight>i.clientHeight?i.clientHeight-n.clientHeight:t;case"width":return t<=0?1:t+n.offsetLeft>i.clientWidth?i.clientWidth-n.offsetLeft:t;case"height":return t<=0?1:t+n.offsetTop>i.clientHeight?i.clientHeight-n.offsetTop:t}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var e=this,t=domUtils.getXY(e.editor.ui.getDom()),n=domUtils.getXY(e.editor.iframe);domUtils.setStyles(e.cover,{width:e.editor.iframe.offsetWidth+"px",height:e.editor.iframe.offsetHeight+"px",top:n.y-t.y+"px",left:n.x-t.x+"px",position:"absolute",display:""})},show:function(e){var t=this;t.resizer.style.display="block",e&&t.attachTo(e),domUtils.on(this.resizer,"mousedown",t.proxy(t._eventHandler,t)),domUtils.on(t.doc,"mouseup",t.proxy(t._eventHandler,t)),t.showCover(),t.editor.fireEvent("afterscaleshow",t),t.editor.fireEvent("saveScene")},hide:function(){var e=this;e.hideCover(),e.resizer.style.display="none",domUtils.un(e.resizer,"mousedown",e.proxy(e._eventHandler,e)),domUtils.un(e.doc,"mouseup",e.proxy(e._eventHandler,e)),e.editor.fireEvent("afterscalehide",e)},proxy:function(e,t){return function(n){return e.apply(t||this,arguments)}},attachTo:function(e){var t=this,n=t.target=e,i=this.resizer,o=domUtils.getXY(n),r=domUtils.getXY(t.editor.iframe),a=domUtils.getXY(i.parentNode);domUtils.setStyles(i,{width:n.width+"px",height:n.height+"px",left:r.x+o.x-t.editor.document.body.scrollLeft-a.x-parseInt(i.style.borderLeftWidth)+"px",top:r.y+o.y-t.editor.document.body.scrollTop-a.y-parseInt(i.style.borderTopWidth)+"px"})}}}(),function(){var e,n=this;n.setOpt("imageScaleEnabled",!0),!browser.ie&&n.options.imageScaleEnabled&&n.addListener("click",(function(i,o){var r=n.selection.getRange(),a=r.getClosedNode();if(a&&"IMG"==a.tagName&&"false"!=n.body.contentEditable){if(-1!=a.className.indexOf("edui-faked-music")||a.getAttribute("anchorname")||domUtils.hasClass(a,"loadingclass")||domUtils.hasClass(a,"loaderrorclass"))return;if(!e){e=new t,e.init(n),n.ui.getDom().appendChild(e.resizer);var s,l=function(t){e.hide(),e.target&&n.selection.getRange().selectNode(e.target).select()},d=function(e){var t=e.target||e.srcElement;!t||void 0!==t.className&&-1!=t.className.indexOf("edui-editor-imagescale")||l(e)};n.addListener("afterscaleshow",(function(e){n.addListener("beforekeydown",l),n.addListener("beforemousedown",d),domUtils.on(document,"keydown",l),domUtils.on(document,"mousedown",d),n.selection.getNative().removeAllRanges()})),n.addListener("afterscalehide",(function(t){n.removeListener("beforekeydown",l),n.removeListener("beforemousedown",d),domUtils.un(document,"keydown",l),domUtils.un(document,"mousedown",d);var i=e.target;i.parentNode&&n.selection.getRange().selectNode(i).select()})),domUtils.on(e.resizer,"mousedown",(function(t){n.selection.getNative().removeAllRanges();var i=t.target||t.srcElement;i&&-1==i.className.indexOf("edui-editor-imagescale-hand")&&(s=setTimeout((function(){e.hide(),e.target&&n.selection.getRange().selectNode(i).select()}),200))})),domUtils.on(e.resizer,"mouseup",(function(e){var t=e.target||e.srcElement;t&&-1==t.className.indexOf("edui-editor-imagescale-hand")&&clearTimeout(s)}))}e.show(a)}else e&&"none"!=e.resizer.style.display&&e.hide()})),browser.webkit&&n.addListener("click",(function(e,t){if("IMG"==t.target.tagName&&"false"!=n.body.contentEditable){var i=new dom.Range(n.document);i.selectNode(t.target).select()}}))}}(),UE.plugin.register("autolink",(function(){return browser.ie?{}:{bindEvents:{reset:function(){0},keydown:function(e,t){var n=this,i=t.keyCode||t.which;if(32==i||13==i){var o,r,a=n.selection.getNative(),s=a.getRangeAt(0).cloneRange(),l=s.startContainer;while(1==l.nodeType&&s.startOffset>0){if(l=s.startContainer.childNodes[s.startOffset-1],!l)break;s.setStart(l,1==l.nodeType?l.childNodes.length:l.nodeValue.length),s.collapse(!0),l=s.startContainer}do{if(0==s.startOffset){l=s.startContainer.previousSibling;while(l&&1==l.nodeType)l=l.lastChild;if(!l||domUtils.isFillChar(l))break;o=l.nodeValue.length}else l=s.startContainer,o=s.startOffset;s.setStart(l,o-1),r=s.toString().charCodeAt(0)}while(160!=r&&32!=r);if(s.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){while(s.toString().length){if(/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(s.toString()))break;try{s.setStart(s.startContainer,s.startOffset+1)}catch(m){l=s.startContainer;while(!(next=l.nextSibling)){if(domUtils.isBody(l))return;l=l.parentNode}s.setStart(next,0)}}if(domUtils.findParentByTagName(s.startContainer,"a",!0))return;var d,c=n.document.createElement("a"),u=n.document.createTextNode(" ");n.undoManger&&n.undoManger.save(),c.appendChild(s.extractContents()),c.href=c.innerHTML=c.innerHTML.replace(/<[^>]+>/g,""),d=c.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),""),d=/^(?:https?:\/\/)/gi.test(d)?d:"http://"+d,c.setAttribute("_src",utils.html(d)),c.href=utils.html(d),s.insertNode(c),c.parentNode.insertBefore(u,c.nextSibling),s.setStart(u,0),s.collapse(!0),a.removeAllRanges(),a.addRange(s),n.undoManger&&n.undoManger.save()}}}}}}),(function(){var e={37:1,38:1,39:1,40:1,13:1,32:1};function t(e){if(3==e.nodeType)return null;if("A"==e.nodeName)return e;var t=e.lastChild;while(t){if("A"==t.nodeName)return t;if(3==t.nodeType){if(domUtils.isWhitespace(t)){t=t.previousSibling;continue}return null}t=t.lastChild}}browser.ie&&this.addListener("keyup",(function(n,i){var o=this,r=i.keyCode;if(e[r]){var a=o.selection.getRange(),s=a.startContainer;if(13==r){while(s&&!domUtils.isBody(s)&&!domUtils.isBlockElm(s))s=s.parentNode;if(s&&!domUtils.isBody(s)&&"P"==s.nodeName){var l=s.previousSibling;if(l&&1==l.nodeType){l=t(l);l&&!l.getAttribute("_href")&&domUtils.remove(l,!0)}}}else if(32==r)3==s.nodeType&&/^\s$/.test(s.nodeValue)&&(s=s.previousSibling,s&&"A"==s.nodeName&&!s.getAttribute("_href")&&domUtils.remove(s,!0));else if(s=domUtils.findParentByTagName(s,"a",!0),s&&!s.getAttribute("_href")){var d=a.createBookmark();domUtils.remove(s,!0),a.moveToBookmark(d).select(!0)}}}))})),UE.plugins["autoheight"]=function(){var e=this;if(e.autoHeightEnabled=!1!==e.options.autoHeightEnabled,e.autoHeightEnabled){var t,n,i,o,r=0,a=e.options;e.addListener("fullscreenchanged",(function(e,t){o=t})),e.addListener("destroy",(function(){e.removeListener("contentchange afterinserthtml keyup mouseup",s)})),e.enableAutoHeight=function(){var e=this;if(e.autoHeightEnabled){var n=e.document;e.autoHeightEnabled=!0,t=n.body.style.overflowY,n.body.style.overflowY="hidden",e.addListener("contentchange afterinserthtml keyup mouseup",s),setTimeout((function(){s.call(e)}),browser.gecko?100:0),e.fireEvent("autoheightchanged",e.autoHeightEnabled)}},e.disableAutoHeight=function(){e.body.style.overflowY=t||"",e.removeListener("contentchange",s),e.removeListener("keyup",s),e.removeListener("mouseup",s),e.autoHeightEnabled=!1,e.fireEvent("autoheightchanged",e.autoHeightEnabled)},e.on("setHeight",(function(){e.disableAutoHeight()})),e.addListener("ready",(function(){var t,n;e.enableAutoHeight(),domUtils.on(browser.ie?e.body:e.document,browser.webkit?"dragover":"drop",(function(){clearTimeout(t),t=setTimeout((function(){s.call(e)}),100)})),window.onscroll=function(){null===n?n=this.scrollY:0==this.scrollY&&0!=n&&(e.window.scrollTo(0,0),n=null)}}))}function s(){var e=this;clearTimeout(i),o||(!e.queryCommandState||e.queryCommandState&&1!=e.queryCommandState("source"))&&(i=setTimeout((function(){var t=e.body.lastChild;while(t&&1!=t.nodeType)t=t.previousSibling;t&&1==t.nodeType&&(t.style.clear="both",n=Math.max(domUtils.getXY(t).y+t.offsetHeight+25,Math.max(a.minFrameHeight,a.initialFrameHeight)),n!=r&&(n!==parseInt(e.iframe.parentNode.style.height)&&(e.iframe.parentNode.style.height=n+"px"),e.body.style.height=n+"px",r=n),domUtils.removeStyle(t,"clear"))}),50))}},UE.plugins["autofloat"]=function(){var e=this,t=e.getLang();e.setOpt({topOffset:0});var n=!1!==e.options.autoFloatEnabled,i=e.options.topOffset;if(n){var o,r,a,s,l=UE.ui.uiUtils,d=browser.ie&&browser.version<=6,c=browser.quirks,u=document.createElement("div"),m=!0,f=utils.defer((function(){v()}),browser.ie?200:100,!0);e.addListener("destroy",(function(){domUtils.un(window,["scroll","resize"],v),e.removeListener("keydown",f)})),e.addListener("ready",(function(){if(h(e)){if(!e.ui)return;s=l.getClientRect,r=e.ui.getDom("toolbarbox"),a=s(r).top,o=r.style.cssText,u.style.height=r.offsetHeight+"px",d&&p(),domUtils.on(window,["scroll","resize"],v),e.addListener("keydown",f),e.addListener("beforefullscreenchange",(function(e,t){t&&b()})),e.addListener("fullscreenchanged",(function(e,t){t||v()})),e.addListener("sourcemodechanged",(function(e,t){setTimeout((function(){v()}),0)})),e.addListener("clearDoc",(function(){setTimeout((function(){v()}),0)}))}}))}function h(){return UE.ui?1:(alert(t.autofloatMsg),0)}function p(){var e=document.body.style;e.backgroundImage='url("about:blank")',e.backgroundAttachment="fixed"}function g(){var t=domUtils.getXY(r),n=domUtils.getComputedStyle(r,"position"),o=domUtils.getComputedStyle(r,"left");r.style.width=r.offsetWidth+"px",r.style.zIndex=1*e.options.zIndex+1,r.parentNode.insertBefore(u,r),d||c&&browser.ie?("absolute"!=r.style.position&&(r.style.position="absolute"),r.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-a+i+"px"):(browser.ie7Compat&&m&&(m=!1,r.style.left=domUtils.getXY(r).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=r.style.position&&(r.style.position="fixed",r.style.top=i+"px",("absolute"==n||"relative"==n)&&parseFloat(o)&&(r.style.left=t.x+"px")))}function b(){m=!0,u.parentNode&&u.parentNode.removeChild(u),r.style.cssText=o}function v(){var t=s(e.container),n=e.options.toolbarTopOffset||0;t.top<0&&t.bottom-r.offsetHeight>n?g():b()}},UE.plugins["video"]=function(){var e=this;function t(t,n,i,o,r,a,s){var l;switch(t=utils.unhtmlForUrl(t),r=utils.unhtml(r),a=utils.unhtml(a).trim(),n=parseInt(n,10)||0,i=parseInt(i,10)||0,s){case"image":l="<img "+(o?'id="'+o+'"':"")+' width="'+n+'" height="'+i+'" _url="'+t+'" class="'+a.replace(/\bvideo-js\b/,"")+'" src="'+e.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+e.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(r?"float:"+r+";":"")+'" />';break;case"embed":l='<embed type="application/x-shockwave-flash" class="'+a+'" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+utils.html(t)+'" width="'+n+'" height="'+i+'"'+(r?' style="float:'+r+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >';break;case"video":var d=t.substr(t.lastIndexOf(".")+1);"ogv"==d&&(d="ogg"),l="<video"+(o?' id="'+o+'"':"")+' class="'+a+' video-js" '+(r?' style="float:'+r+'"':"")+' controls preload="none" width="'+n+'" height="'+i+'" src="'+t+'" data-setup="{}"><source src="'+t+'" type="video/'+d+'" /></video>';break}return l}function n(e,n){utils.each(e.getNodesByTagName(n?"img":"embed video"),(function(e){var i=e.getAttr("class");if(i&&-1!=i.indexOf("edui-faked-video")){var o=t(n?e.getAttr("_url"):e.getAttr("src"),e.getAttr("width"),e.getAttr("height"),null,e.getStyle("float")||"",i,n?"embed":"image");e.parentNode.replaceChild(UE.uNode.createElement(o),e)}if(i&&-1!=i.indexOf("edui-upload-video")){o=t(n?e.getAttr("_url"):e.getAttr("src"),e.getAttr("width"),e.getAttr("height"),null,e.getStyle("float")||"",i,n?"video":"image");e.parentNode.replaceChild(UE.uNode.createElement(o),e)}}))}e.addOutputRule((function(e){n(e,!0)})),e.addInputRule((function(e){n(e)})),e.commands["insertvideo"]={execCommand:function(n,i,o){i=utils.isArray(i)?i:[i];for(var r,a,s=[],l="tmpVedio",d=0,c=i.length;d<c;d++)a=i[d],r="upload"==o?"edui-upload-video video-js vjs-default-skin":"edui-faked-video",s.push(t(a.url,a.width||420,a.height||280,l+d,null,r,"image"));e.execCommand("inserthtml",s.join(""),!0);var u=this.selection.getRange();for(d=0,c=i.length;d<c;d++){var m=this.document.getElementById("tmpVedio"+d);domUtils.removeAttributes(m,"id"),u.selectNode(m).select(),e.execCommand("imagefloat",i[d].align)}},queryCommandState:function(){var t=e.selection.getRange().getClosedNode(),n=t&&("edui-faked-video"==t.className||-1!=t.className.indexOf("edui-upload-video"));return n?1:0}}},function(){var e=UE.UETable=function(e){this.table=e,this.indexTable=[],this.selectedTds=[],this.cellsRange={},this.update(e)};function t(e){}e.removeSelectedClass=function(e){utils.each(e,(function(e){domUtils.removeClasses(e,"selectTdClass")}))},e.addSelectedClass=function(e){utils.each(e,(function(e){domUtils.addClass(e,"selectTdClass")}))},e.isEmptyBlock=function(e){var t=new RegExp(domUtils.fillChar,"g");if(e[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(dtd.$isNotEmpty.hasOwnProperty(n)&&e.getElementsByTagName(n).length)return 0;return 1},e.getWidth=function(e){return e?parseInt(domUtils.getComputedStyle(e,"width"),10):0},e.getTableCellAlignState=function(e){!utils.isArray(e)&&(e=[e]);var t={},n=["align","valign"],i=null,o=!0;return utils.each(e,(function(e){return utils.each(n,(function(n){if(i=e.getAttribute(n),!t[n]&&i)t[n]=i;else if(!t[n]||i!==t[n])return o=!1,!1})),o})),o?t:null},e.getTableItemsByRange=function(e){var t=e.selection.getStart();t&&t.id&&0===t.id.indexOf("_baidu_bookmark_start_")&&t.nextSibling&&(t=t.nextSibling);var n=t&&domUtils.findParentByTagName(t,["td","th"],!0),i=n&&n.parentNode,o=t&&domUtils.findParentByTagName(t,"caption",!0),r=o?o.parentNode:i&&i.parentNode.parentNode;return{cell:n,tr:i,table:r,caption:o}},e.getUETableBySelected=function(t){var n=e.getTableItemsByRange(t).table;return n&&n.ueTable&&n.ueTable.selectedTds.length?n.ueTable:null},e.getDefaultValue=function(e,t){var n,i,o,r,a={thin:"0px",medium:"1px",thick:"2px"};if(t)return s=t.getElementsByTagName("td")[0],r=domUtils.getComputedStyle(t,"border-left-width"),n=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"padding-left"),i=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"border-left-width"),o=parseInt(a[r]||r,10),{tableBorder:n,tdPadding:i,tdBorder:o};t=e.document.createElement("table"),t.insertRow(0).insertCell(0).innerHTML="xxx",e.body.appendChild(t);var s=t.getElementsByTagName("td")[0];return r=domUtils.getComputedStyle(t,"border-left-width"),n=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"padding-left"),i=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"border-left-width"),o=parseInt(a[r]||r,10),domUtils.remove(t),{tableBorder:n,tdPadding:i,tdBorder:o}},e.getUETable=function(t){var n=t.tagName.toLowerCase();return t="td"==n||"th"==n||"caption"==n?domUtils.findParentByTagName(t,"table",!0):t,t.ueTable||(t.ueTable=new e(t)),t.ueTable},e.cloneCell=function(e,t,n){if(!e||utils.isString(e))return this.table.ownerDocument.createElement(e||"td");var i=domUtils.hasClass(e,"selectTdClass");i&&domUtils.removeClasses(e,"selectTdClass");var o=e.cloneNode(!0);return t&&(o.rowSpan=o.colSpan=1),!n&&domUtils.removeAttributes(o,"width height"),!n&&domUtils.removeAttributes(o,"style"),o.style.borderLeftStyle="",o.style.borderTopStyle="",o.style.borderLeftColor=e.style.borderRightColor,o.style.borderLeftWidth=e.style.borderRightWidth,o.style.borderTopColor=e.style.borderBottomColor,o.style.borderTopWidth=e.style.borderBottomWidth,i&&domUtils.addClass(e,"selectTdClass"),o},e.prototype={getMaxRows:function(){for(var e,t=this.table.rows,n=1,i=0;e=t[i];i++){for(var o,r=1,a=0;o=e.cells[a++];)r=Math.max(o.rowSpan||1,r);n=Math.max(r+i,n)}return n},getMaxCols:function(){for(var e,t=this.table.rows,n=0,i={},o=0;e=t[o];o++){for(var r,a=0,s=0;r=e.cells[s++];)if(a+=r.colSpan||1,r.rowSpan&&r.rowSpan>1)for(var l=1;l<r.rowSpan;l++)i["row_"+(o+l)]?i["row_"+(o+l)]++:i["row_"+(o+l)]=r.colSpan||1;a+=i["row_"+o]||0,n=Math.max(a,n)}return n},getCellColIndex:function(e){},getHSideCell:function(e,n){try{var i,o,r=this.getCellInfo(e),a=this.selectedTds.length,s=this.cellsRange;return!n&&(a?!s.beginColIndex:!r.colIndex)||n&&(a?s.endColIndex==this.colsNum-1:r.colIndex==this.colsNum-1)?null:(i=a?s.beginRowIndex:r.rowIndex,o=n?a?s.endColIndex+1:r.colIndex+1:a?s.beginColIndex-1:r.colIndex<1?0:r.colIndex-1,this.getCell(this.indexTable[i][o].rowIndex,this.indexTable[i][o].cellIndex))}catch(l){t(l)}},getTabNextCell:function(e,t){var n,i=this.getCellInfo(e),o=t||i.rowIndex,r=i.colIndex+1+(i.colSpan-1);try{n=this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex)}catch(a){try{o=1*o+1,r=0,n=this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex)}catch(a){}}return n},getVSideCell:function(e,n,i){try{var o,r,a=this.getCellInfo(e),s=this.selectedTds.length&&!i,l=this.cellsRange;return!n&&0==a.rowIndex||n&&(s?l.endRowIndex==this.rowsNum-1:a.rowIndex+a.rowSpan>this.rowsNum-1)?null:(o=n?s?l.endRowIndex+1:a.rowIndex+a.rowSpan:s?l.beginRowIndex-1:a.rowIndex-1,r=s?l.beginColIndex:a.colIndex,this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex))}catch(d){t(d)}},getSameEndPosCells:function(e,n){try{for(var i="x"===n.toLowerCase(),o=domUtils.getXY(e)[i?"x":"y"]+e["offset"+(i?"Width":"Height")],r=this.table.rows,a=null,s=[],l=0;l<this.rowsNum;l++){a=r[l].cells;for(var d,c=0;d=a[c++];){var u=domUtils.getXY(d)[i?"x":"y"]+d["offset"+(i?"Width":"Height")];if(u>o&&i)break;if((e==d||o==u)&&(1==d[i?"colSpan":"rowSpan"]&&s.push(d),i))break}}return s}catch(m){t(m)}},setCellContent:function(e,t){e.innerHTML=t||(browser.ie?domUtils.fillChar:"<br />")},cloneCell:e.cloneCell,getSameStartPosXCells:function(e){try{for(var n,i=domUtils.getXY(e).x+e.offsetWidth,o=this.table.rows,r=[],a=0;a<this.rowsNum;a++){n=o[a].cells;for(var s,l=0;s=n[l++];){var d=domUtils.getXY(s).x;if(d>i)break;if(d==i&&1==s.colSpan){r.push(s);break}}}return r}catch(c){t(c)}},update:function(e){this.table=e||this.table,this.selectedTds=[],this.cellsRange={},this.indexTable=[];var t=this.table.rows,n=this.getMaxRows(),i=n-t.length,o=this.getMaxCols();while(i--)this.table.insertRow(t.length);this.rowsNum=n,this.colsNum=o;for(var r=0,a=t.length;r<a;r++)this.indexTable[r]=new Array(o);for(var s,l=0;s=t[l];l++)for(var d,c=0,u=s.cells;d=u[c];c++){d.rowSpan>n&&(d.rowSpan=n);var m=c,f=d.rowSpan||1,h=d.colSpan||1;while(this.indexTable[l][m])m++;for(var p=0;p<f;p++)for(var g=0;g<h;g++)this.indexTable[l+p][m+g]={rowIndex:l,cellIndex:c,colIndex:m,rowSpan:f,colSpan:h}}for(p=0;p<n;p++)for(g=0;g<o;g++)void 0===this.indexTable[p][g]&&(s=t[p],d=s.cells[s.cells.length-1],d=d?d.cloneNode(!0):this.table.ownerDocument.createElement("td"),this.setCellContent(d),1!==d.colSpan&&(d.colSpan=1),1!==d.rowSpan&&(d.rowSpan=1),s.appendChild(d),this.indexTable[p][g]={rowIndex:p,cellIndex:d.cellIndex,colIndex:g,rowSpan:1,colSpan:1});var b=domUtils.getElementsByTagName(this.table,"td"),v=[];if(utils.each(b,(function(e){domUtils.hasClass(e,"selectTdClass")&&v.push(e)})),v.length){var y=v[0],C=v[v.length-1],w=this.getCellInfo(y),x=this.getCellInfo(C);this.selectedTds=v,this.cellsRange={beginRowIndex:w.rowIndex,beginColIndex:w.colIndex,endRowIndex:x.rowIndex+x.rowSpan-1,endColIndex:x.colIndex+x.colSpan-1}}if(!domUtils.hasClass(this.table.rows[0],"firstRow")){domUtils.addClass(this.table.rows[0],"firstRow");for(r=1;r<this.table.rows.length;r++)domUtils.removeClasses(this.table.rows[r],"firstRow")}},getCellInfo:function(e){if(e)for(var t=e.cellIndex,n=e.parentNode.rowIndex,i=this.indexTable[n],o=this.colsNum,r=t;r<o;r++){var a=i[r];if(a.rowIndex===n&&a.cellIndex===t)return a}},getCell:function(e,t){return e<this.rowsNum&&this.table.rows[e].cells[t]||null},deleteCell:function(e,t){t="number"==typeof t?t:e.parentNode.rowIndex;var n=this.table.rows[t];n.deleteCell(e.cellIndex)},getCellsRange:function(e,t){function n(e,t,o,r){var a,s,l,d=e,c=t,u=o,m=r;if(e>0)for(s=t;s<r;s++)a=i.indexTable[e][s],l=a.rowIndex,l<e&&(d=Math.min(l,d));if(r<i.colsNum)for(l=e;l<o;l++)a=i.indexTable[l][r],s=a.colIndex+a.colSpan-1,s>r&&(m=Math.max(s,m));if(o<i.rowsNum)for(s=t;s<r;s++)a=i.indexTable[o][s],l=a.rowIndex+a.rowSpan-1,l>o&&(u=Math.max(l,u));if(t>0)for(l=e;l<o;l++)a=i.indexTable[l][t],s=a.colIndex,s<t&&(c=Math.min(a.colIndex,c));return d!=e||c!=t||u!=o||m!=r?n(d,c,u,m):{beginRowIndex:e,beginColIndex:t,endRowIndex:o,endColIndex:r}}try{var i=this,o=i.getCellInfo(e);if(e===t)return{beginRowIndex:o.rowIndex,beginColIndex:o.colIndex,endRowIndex:o.rowIndex+o.rowSpan-1,endColIndex:o.colIndex+o.colSpan-1};var r=i.getCellInfo(t),a=Math.min(o.rowIndex,r.rowIndex),s=Math.min(o.colIndex,r.colIndex),l=Math.max(o.rowIndex+o.rowSpan-1,r.rowIndex+r.rowSpan-1),d=Math.max(o.colIndex+o.colSpan-1,r.colIndex+r.colSpan-1);return n(a,s,l,d)}catch(c){}},getCells:function(e){this.clearSelected();for(var t,n,i,o=e.beginRowIndex,r=e.beginColIndex,a=e.endRowIndex,s=e.endColIndex,l={},d=[],c=o;c<=a;c++)for(var u=r;u<=s;u++){t=this.indexTable[c][u],n=t.rowIndex,i=t.colIndex;var m=n+"|"+i;if(!l[m]){if(l[m]=1,n<c||i<u||n+t.rowSpan-1>a||i+t.colSpan-1>s)return null;d.push(this.getCell(n,t.cellIndex))}}return d},clearSelected:function(){e.removeSelectedClass(this.selectedTds),this.selectedTds=[],this.cellsRange={}},setSelected:function(t){var n=this.getCells(t);e.addSelectedClass(n),this.selectedTds=n,this.cellsRange=t},isFullRow:function(){var e=this.cellsRange;return e.endColIndex-e.beginColIndex+1==this.colsNum},isFullCol:function(){var e=this.cellsRange,t=this.table,n=t.getElementsByTagName("th"),i=e.endRowIndex-e.beginRowIndex+1;return n.length?i==this.rowsNum||i==this.rowsNum-1:i==this.rowsNum},getNextCell:function(e,n,i){try{var o,r,a=this.getCellInfo(e),s=this.selectedTds.length&&!i,l=this.cellsRange;return!n&&0==a.rowIndex||n&&(s?l.endRowIndex==this.rowsNum-1:a.rowIndex+a.rowSpan>this.rowsNum-1)?null:(o=n?s?l.endRowIndex+1:a.rowIndex+a.rowSpan:s?l.beginRowIndex-1:a.rowIndex-1,r=s?l.beginColIndex:a.colIndex,this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex))}catch(d){t(d)}},getPreviewCell:function(e,n){try{var i,o,r=this.getCellInfo(e),a=this.selectedTds.length,s=this.cellsRange;return!n&&(a?!s.beginColIndex:!r.colIndex)||n&&(a?s.endColIndex==this.colsNum-1:r.rowIndex>this.colsNum-1)?null:(i=n?a?s.beginRowIndex:r.rowIndex<1?0:r.rowIndex-1:a?s.beginRowIndex:r.rowIndex,o=n?a?s.endColIndex+1:r.colIndex:a?s.beginColIndex-1:r.colIndex<1?0:r.colIndex-1,this.getCell(this.indexTable[i][o].rowIndex,this.indexTable[i][o].cellIndex))}catch(l){t(l)}},moveContent:function(t,n){if(!e.isEmptyBlock(n))if(e.isEmptyBlock(t))t.innerHTML=n.innerHTML;else{var i=t.lastChild;3!=i.nodeType&&dtd.$block[i.tagName]||t.appendChild(t.ownerDocument.createElement("br"));while(i=n.firstChild)t.appendChild(i)}},mergeRight:function(e){var t=this.getCellInfo(e),n=t.colIndex+t.colSpan,i=this.indexTable[t.rowIndex][n],o=this.getCell(i.rowIndex,i.cellIndex);e.colSpan=t.colSpan+i.colSpan,e.removeAttribute("width"),this.moveContent(e,o),this.deleteCell(o,i.rowIndex),this.update()},mergeDown:function(e){var t=this.getCellInfo(e),n=t.rowIndex+t.rowSpan,i=this.indexTable[n][t.colIndex],o=this.getCell(i.rowIndex,i.cellIndex);e.rowSpan=t.rowSpan+i.rowSpan,e.removeAttribute("height"),this.moveContent(e,o),this.deleteCell(o,i.rowIndex),this.update()},mergeRange:function(){var e=this.cellsRange,t=this.getCell(e.beginRowIndex,this.indexTable[e.beginRowIndex][e.beginColIndex].cellIndex);if("TH"==t.tagName&&e.endRowIndex!==e.beginRowIndex){var n=this.indexTable,i=this.getCellInfo(t);t=this.getCell(1,n[1][i.colIndex].cellIndex),e=this.getCellsRange(t,this.getCell(n[this.rowsNum-1][i.colIndex].rowIndex,n[this.rowsNum-1][i.colIndex].cellIndex))}for(var o,r=this.getCells(e),a=0;o=r[a++];)o!==t&&(this.moveContent(t,o),this.deleteCell(o));if(t.rowSpan=e.endRowIndex-e.beginRowIndex+1,t.rowSpan>1&&t.removeAttribute("height"),t.colSpan=e.endColIndex-e.beginColIndex+1,t.colSpan>1&&t.removeAttribute("width"),t.rowSpan==this.rowsNum&&1!=t.colSpan&&(t.colSpan=1),t.colSpan==this.colsNum&&1!=t.rowSpan){var s=t.parentNode.rowIndex;if(this.table.deleteRow){a=s+1;for(var l=s+1,d=t.rowSpan;a<d;a++)this.table.deleteRow(l)}else for(a=0,d=t.rowSpan-1;a<d;a++){var c=this.table.rows[s+1];c.parentNode.removeChild(c)}t.rowSpan=1}this.update()},insertRow:function(e,t){var n,i=this.colsNum,o=this.table,r=o.insertRow(e),a="string"==typeof t&&"TH"==t.toUpperCase();function s(e,t,n){if(0==e){var i=n.nextSibling||n.previousSibling,o=i.cells[e];"TH"==o.tagName&&(o=t.ownerDocument.createElement("th"),o.appendChild(t.firstChild),n.insertBefore(o,t),domUtils.remove(t))}else if("TH"==t.tagName){var r=t.ownerDocument.createElement("td");r.appendChild(t.firstChild),n.insertBefore(r,t),domUtils.remove(t)}}if(0==e||e==this.rowsNum)for(var l=0;l<i;l++)n=this.cloneCell(t,!0),this.setCellContent(n),n.getAttribute("vAlign")&&n.setAttribute("vAlign",n.getAttribute("vAlign")),r.appendChild(n),a||s(l,n,r);else{var d=this.indexTable[e];for(l=0;l<i;l++){var c=d[l];c.rowIndex<e?(n=this.getCell(c.rowIndex,c.cellIndex),n.rowSpan=c.rowSpan+1):(n=this.cloneCell(t,!0),this.setCellContent(n),r.appendChild(n)),a||s(l,n,r)}}return this.update(),r},deleteRow:function(e){for(var t=this.table.rows[e],n=this.indexTable[e],i=this.colsNum,o=0,r=0;r<i;){var a=n[r],s=this.getCell(a.rowIndex,a.cellIndex);if(s.rowSpan>1&&a.rowIndex==e){var l=s.cloneNode(!0);l.rowSpan=s.rowSpan-1,l.innerHTML="",s.rowSpan=1;var d,c=e+1,u=this.table.rows[c],m=this.getPreviewMergedCellsNum(c,r)-o;m<r?(d=r-m-1,domUtils.insertAfter(u.cells[d],l)):u.cells.length&&u.insertBefore(l,u.cells[0]),o+=1}r+=s.colSpan||1}var f=[],h={};for(r=0;r<i;r++){var p=n[r].rowIndex,g=n[r].cellIndex,b=p+"_"+g;h[b]||(h[b]=1,s=this.getCell(p,g),f.push(s))}var v=[];utils.each(f,(function(e){1==e.rowSpan?e.parentNode.removeChild(e):v.push(e)})),utils.each(v,(function(e){e.rowSpan--})),t.parentNode.removeChild(t),this.update()},insertCol:function(e,t,n){var i,o,r,a=this.rowsNum,s=0,l=parseInt((this.table.offsetWidth-20*(this.colsNum+1)-(this.colsNum+1))/(this.colsNum+1),10),d="string"==typeof t&&"TH"==t.toUpperCase();function c(e,t,n){if(0==e){var i=t.nextSibling||t.previousSibling;"TH"==i.tagName&&(i=t.ownerDocument.createElement("th"),i.appendChild(t.firstChild),n.insertBefore(i,t),domUtils.remove(t))}else if("TH"==t.tagName){var o=t.ownerDocument.createElement("td");o.appendChild(t.firstChild),n.insertBefore(o,t),domUtils.remove(t)}}if(0==e||e==this.colsNum)for(;s<a;s++)i=this.table.rows[s],r=i.cells[0==e?e:i.cells.length],o=this.cloneCell(t,!0),this.setCellContent(o),o.setAttribute("vAlign",o.getAttribute("vAlign")),r&&o.setAttribute("width",r.getAttribute("width")),e?domUtils.insertAfter(i.cells[i.cells.length-1],o):i.insertBefore(o,i.cells[0]),d||c(s,o,i);else for(;s<a;s++){var u=this.indexTable[s][e];u.colIndex<e?(o=this.getCell(u.rowIndex,u.cellIndex),o.colSpan=u.colSpan+1):(i=this.table.rows[s],r=i.cells[u.cellIndex],o=this.cloneCell(t,!0),this.setCellContent(o),o.setAttribute("vAlign",o.getAttribute("vAlign")),r&&o.setAttribute("width",r.getAttribute("width")),r?i.insertBefore(o,r):i.appendChild(o)),d||c(s,o,i)}this.update(),this.updateWidth(l,n||{tdPadding:10,tdBorder:1})},updateWidth:function(t,n){var i=this.table,o=e.getWidth(i)-2*n.tdPadding-n.tdBorder+t;if(o<i.ownerDocument.body.offsetWidth)i.setAttribute("width",o);else{var r=domUtils.getElementsByTagName(this.table,"td th");utils.each(r,(function(e){e.setAttribute("width",t)}))}},deleteCol:function(e){for(var t=this.indexTable,n=this.table.rows,i=this.table.getAttribute("width"),o=0,r=this.rowsNum,a={},s=0;s<r;){var l=t[s],d=l[e],c=d.rowIndex+"_"+d.colIndex;if(!a[c]){a[c]=1;var u=this.getCell(d.rowIndex,d.cellIndex);o||(o=u&&parseInt(u.offsetWidth/u.colSpan,10).toFixed(0)),u.colSpan>1?u.colSpan--:n[s].deleteCell(d.cellIndex),s+=d.rowSpan||1}}this.table.setAttribute("width",i-o),this.update()},splitToCells:function(e){var t=this,n=this.splitToRows(e);utils.each(n,(function(e){t.splitToCols(e)}))},splitToRows:function(e){var t=this.getCellInfo(e),n=t.rowIndex,i=t.colIndex,o=[];e.rowSpan=1,o.push(e);for(var r=n,a=n+t.rowSpan;r<a;r++)if(r!=n){var s=this.table.rows[r],l=s.insertCell(i-this.getPreviewMergedCellsNum(r,i));l.colSpan=t.colSpan,this.setCellContent(l),l.setAttribute("vAlign",e.getAttribute("vAlign")),l.setAttribute("align",e.getAttribute("align")),e.style.cssText&&(l.style.cssText=e.style.cssText),o.push(l)}return this.update(),o},getPreviewMergedCellsNum:function(e,t){for(var n=this.indexTable[e],i=0,o=0;o<t;){var r=n[o].colSpan,a=n[o].rowIndex;i+=r-(a==e?1:0),o+=r}return i},splitToCols:function(e){var t=(e.offsetWidth/e.colSpan-22).toFixed(0),n=this.getCellInfo(e),i=n.rowIndex,o=n.colIndex,r=[];e.colSpan=1,e.setAttribute("width",t),r.push(e);for(var a=o,s=o+n.colSpan;a<s;a++)if(a!=o){var l=this.table.rows[i],d=l.insertCell(this.indexTable[i][a].cellIndex+1);if(d.rowSpan=n.rowSpan,this.setCellContent(d),d.setAttribute("vAlign",e.getAttribute("vAlign")),d.setAttribute("align",e.getAttribute("align")),d.setAttribute("width",t),e.style.cssText&&(d.style.cssText=e.style.cssText),"TH"==e.tagName){var c=e.ownerDocument.createElement("th");c.appendChild(d.firstChild),c.setAttribute("vAlign",e.getAttribute("vAlign")),c.rowSpan=d.rowSpan,l.insertBefore(c,d),domUtils.remove(d)}r.push(d)}return this.update(),r},isLastCell:function(e,t,n){t=t||this.rowsNum,n=n||this.colsNum;var i=this.getCellInfo(e);return i.rowIndex+i.rowSpan==t&&i.colIndex+i.colSpan==n},getLastCell:function(e){e=e||this.table.getElementsByTagName("td");this.getCellInfo(e[0]);var t,n=this,i=e[0],o=i.parentNode,r=0,a=0;return utils.each(e,(function(e){e.parentNode==o&&(a+=e.colSpan||1),r+=e.rowSpan*e.colSpan||1})),t=r/a,utils.each(e,(function(e){if(n.isLastCell(e,t,a))return i=e,!1})),i},selectRow:function(e){var t=this.indexTable[e],n=this.getCell(t[0].rowIndex,t[0].cellIndex),i=this.getCell(t[this.colsNum-1].rowIndex,t[this.colsNum-1].cellIndex),o=this.getCellsRange(n,i);this.setSelected(o)},selectTable:function(){var e=this.table.getElementsByTagName("td"),t=this.getCellsRange(e[0],e[e.length-1]);this.setSelected(t)},setBackground:function(e,t){if("string"===typeof t)utils.each(e,(function(e){e.style.backgroundColor=t}));else if("object"===Object(_Users_xiaoyi_Desktop_other_admin_node_modules_babel_runtime_corejs2_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_6__["a"])(t)){t=utils.extend({repeat:!0,colorList:["#ddd","#fff"]},t);for(var n,i=this.getCellInfo(e[0]).rowIndex,o=0,r=t.colorList,a=function(e,t,n){return e[t]?e[t]:n?e[t%e.length]:""},s=0;n=e[s++];){var l=this.getCellInfo(n);n.style.backgroundColor=a(r,i+o==l.rowIndex?o:++o,t.repeat)}}},removeBackground:function(e){utils.each(e,(function(e){e.style.backgroundColor=""}))}}}(),function(){var e=UE.UETable,t=function(t){return e.getTableItemsByRange(t)},n=function(t){return e.getUETableBySelected(t)},i=function(t,n){return e.getDefaultValue(t,n)},o=function(t){return e.getUETable(t)};function r(e,t){var n=domUtils.getElementsByTagName(e,"td th");utils.each(n,(function(e){e.removeAttribute("width")})),e.setAttribute("width",a(t,!0,i(t,e)));var o=[];setTimeout((function(){utils.each(n,(function(e){1==e.colSpan&&o.push(e.offsetWidth)})),utils.each(n,(function(e,t){1==e.colSpan&&e.setAttribute("width",o[t]+"")}))}),0)}function a(e,t,n){var i=e.body;return i.offsetWidth-(t?2*parseInt(domUtils.getComputedStyle(i,"margin-left"),10):0)-2*n.tableBorder-(e.options.offsetWidth||0)}function s(e){var n=t(e).cell;if(n){var i=o(n);return i.selectedTds.length?i.selectedTds:[n]}return[]}UE.commands["inserttable"]={queryCommandState:function(){return t(this).table?-1:0},execCommand:function(e,t){function n(e,t){for(var n=[],i=e.numRows,o=e.numCols,r=0;r<i;r++){n.push("<tr"+(0==r?' class="firstRow"':"")+">");for(var a=0;a<o;a++)n.push('<td width="'+t+'" vAlign="'+e.tdvalign+'" >'+(browser.ie&&browser.version<11?domUtils.fillChar:"<br/>")+"</td>");n.push("</tr>")}return"<table><tbody>"+n.join("")+"</tbody></table>"}t||(t=utils.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var o=this,r=this.selection.getRange(),a=r.startContainer,s=domUtils.findParent(a,(function(e){return domUtils.isBlockElm(e)}),!0)||o.body,l=i(o),d=s.offsetWidth,c=Math.floor(d/t.numCols-2*l.tdPadding-l.tdBorder);!t.tdvalign&&(t.tdvalign=o.options.tdvalign),o.execCommand("inserthtml",n(t,c))}},UE.commands["insertparagraphbeforetable"]={queryCommandState:function(){return t(this).cell?0:-1},execCommand:function(){var e=t(this).table;if(e){var n=this.document.createElement("p");n.innerHTML=browser.ie?" ":"<br />",e.parentNode.insertBefore(n,e),this.selection.getRange().setStart(n,0).setCursor()}}},UE.commands["deletetable"]={queryCommandState:function(){var e=this.selection.getRange();return domUtils.findParentByTagName(e.startContainer,"table",!0)?0:-1},execCommand:function(e,t){var n=this.selection.getRange();if(t=t||domUtils.findParentByTagName(n.startContainer,"table",!0),t){var i=t.nextSibling;i||(i=domUtils.createElement(this.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"}),t.parentNode.insertBefore(i,t)),domUtils.remove(t),n=this.selection.getRange(),3==i.nodeType?n.setStartBefore(i):n.setStart(i,0),n.setCursor(!1,!0),this.fireEvent("tablehasdeleted")}}},UE.commands["cellalign"]={queryCommandState:function(){return s(this).length?0:-1},execCommand:function(e,t){var n=s(this);if(n.length)for(var i,o=0;i=n[o++];)i.setAttribute("align",t)}},UE.commands["cellvalign"]={queryCommandState:function(){return s(this).length?0:-1},execCommand:function(e,t){var n=s(this);if(n.length)for(var i,o=0;i=n[o++];)i.setAttribute("vAlign",t)}},UE.commands["insertcaption"]={queryCommandState:function(){var e=t(this).table;return e&&0==e.getElementsByTagName("caption").length?1:-1},execCommand:function(){var e=t(this).table;if(e){var n=this.document.createElement("caption");n.innerHTML=browser.ie?domUtils.fillChar:"<br/>",e.insertBefore(n,e.firstChild);var i=this.selection.getRange();i.setStart(n,0).setCursor()}}},UE.commands["deletecaption"]={queryCommandState:function(){var e=this.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,"table");return t?0==t.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var e=this.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,"table");if(t){domUtils.remove(t.getElementsByTagName("caption")[0]);var n=this.selection.getRange();n.setStart(t.rows[0].cells[0],0).setCursor()}}},UE.commands["inserttitle"]={queryCommandState:function(){var e=t(this).table;if(e){var n=e.rows[0];return"th"!=n.cells[n.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var e=t(this).table;e&&o(e).insertRow(0,"th");var n=e.getElementsByTagName("th")[0];this.selection.getRange().setStart(n,0).setCursor(!1,!0)}},UE.commands["deletetitle"]={queryCommandState:function(){var e=t(this).table;if(e){var n=e.rows[0];return"th"==n.cells[n.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var e=t(this).table;e&&domUtils.remove(e.rows[0]);var n=e.getElementsByTagName("td")[0];this.selection.getRange().setStart(n,0).setCursor(!1,!0)}},UE.commands["inserttitlecol"]={queryCommandState:function(){var e=t(this).table;if(e){var n=e.rows[e.rows.length-1];return n.getElementsByTagName("th").length?-1:0}return-1},execCommand:function(e){var n=t(this).table;n&&o(n).insertCol(0,"th"),r(n,this);var i=n.getElementsByTagName("th")[0];this.selection.getRange().setStart(i,0).setCursor(!1,!0)}},UE.commands["deletetitlecol"]={queryCommandState:function(){var e=t(this).table;if(e){var n=e.rows[e.rows.length-1];return n.getElementsByTagName("th").length?0:-1}return-1},execCommand:function(){var e=t(this).table;if(e)for(var n=0;n<e.rows.length;n++)domUtils.remove(e.rows[n].children[0]);r(e,this);var i=e.getElementsByTagName("td")[0];this.selection.getRange().setStart(i,0).setCursor(!1,!0)}},UE.commands["mergeright"]={queryCommandState:function(e){var n=t(this),i=n.table,r=n.cell;if(!i||!r)return-1;var a=o(i);if(a.selectedTds.length)return-1;var s=a.getCellInfo(r),l=s.colIndex+s.colSpan;if(l>=a.colsNum)return-1;var d=a.indexTable[s.rowIndex][l],c=i.rows[d.rowIndex].cells[d.cellIndex];return c&&r.tagName==c.tagName&&d.rowIndex==s.rowIndex&&d.rowSpan==s.rowSpan?0:-1},execCommand:function(e){var n=this.selection.getRange(),i=n.createBookmark(!0),r=t(this).cell,a=o(r);a.mergeRight(r),n.moveToBookmark(i).select()}},UE.commands["mergedown"]={queryCommandState:function(e){var n=t(this),i=n.table,r=n.cell;if(!i||!r)return-1;var a=o(i);if(a.selectedTds.length)return-1;var s=a.getCellInfo(r),l=s.rowIndex+s.rowSpan;if(l>=a.rowsNum)return-1;var d=a.indexTable[l][s.colIndex],c=i.rows[d.rowIndex].cells[d.cellIndex];return c&&r.tagName==c.tagName&&d.colIndex==s.colIndex&&d.colSpan==s.colSpan?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this).cell,r=o(i);r.mergeDown(i),e.moveToBookmark(n).select()}},UE.commands["mergecells"]={queryCommandState:function(){return n(this)?0:-1},execCommand:function(){var e=n(this);if(e&&e.selectedTds.length){var t=e.selectedTds[0];e.mergeRange();var i=this.selection.getRange();domUtils.isEmptyBlock(t)?i.setStart(t,0).collapse(!0):i.selectNodeContents(t),i.select()}}},UE.commands["insertrow"]={queryCommandState:function(){var e=t(this),n=e.cell;return n&&("TD"==n.tagName||"TH"==n.tagName&&e.tr!==e.table.rows[0])&&o(e.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this),r=i.cell,a=i.table,s=o(a),l=s.getCellInfo(r);if(s.selectedTds.length)for(var d=s.cellsRange,c=0,u=d.endRowIndex-d.beginRowIndex+1;c<u;c++)s.insertRow(d.beginRowIndex,r);else s.insertRow(l.rowIndex,r);e.moveToBookmark(n).select(),"enabled"===a.getAttribute("interlaced")&&this.fireEvent("interlacetable",a)}},UE.commands["insertrownext"]={queryCommandState:function(){var e=t(this),n=e.cell;return n&&"TD"==n.tagName&&o(e.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this),r=i.cell,a=i.table,s=o(a),l=s.getCellInfo(r);if(s.selectedTds.length)for(var d=s.cellsRange,c=0,u=d.endRowIndex-d.beginRowIndex+1;c<u;c++)s.insertRow(d.endRowIndex+1,r);else s.insertRow(l.rowIndex+l.rowSpan,r);e.moveToBookmark(n).select(),"enabled"===a.getAttribute("interlaced")&&this.fireEvent("interlacetable",a)}},UE.commands["deleterow"]={queryCommandState:function(){var e=t(this);return e.cell?0:-1},execCommand:function(){var e=t(this).cell,n=o(e),i=n.cellsRange,r=n.getCellInfo(e),a=n.getVSideCell(e),s=n.getVSideCell(e,!0),l=this.selection.getRange();if(utils.isEmptyObject(i))n.deleteRow(r.rowIndex);else for(var d=i.beginRowIndex;d<i.endRowIndex+1;d++)n.deleteRow(i.beginRowIndex);var c=n.table;if(c.getElementsByTagName("td").length)if(1==r.rowSpan||r.rowSpan==i.endRowIndex-i.beginRowIndex+1)(s||a)&&l.selectNodeContents(s||a).setCursor(!1,!0);else{var u=n.getCell(r.rowIndex,n.indexTable[r.rowIndex][r.colIndex].cellIndex);u&&l.selectNodeContents(u).setCursor(!1,!0)}else{var m=c.nextSibling;domUtils.remove(c),m&&l.setStart(m,0).setCursor(!1,!0)}"enabled"===c.getAttribute("interlaced")&&this.fireEvent("interlacetable",c)}},UE.commands["insertcol"]={queryCommandState:function(e){var n=t(this),i=n.cell;return i&&("TD"==i.tagName||"TH"==i.tagName&&i!==n.tr.cells[0])&&o(n.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(e){var n=this.selection.getRange(),i=n.createBookmark(!0);if(-1!=this.queryCommandState(e)){var r=t(this).cell,a=o(r),s=a.getCellInfo(r);if(a.selectedTds.length)for(var l=a.cellsRange,d=0,c=l.endColIndex-l.beginColIndex+1;d<c;d++)a.insertCol(l.beginColIndex,r);else a.insertCol(s.colIndex,r);n.moveToBookmark(i).select(!0)}}},UE.commands["insertcolnext"]={queryCommandState:function(){var e=t(this),n=e.cell;return n&&o(e.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this).cell,r=o(i),a=r.getCellInfo(i);if(r.selectedTds.length)for(var s=r.cellsRange,l=0,d=s.endColIndex-s.beginColIndex+1;l<d;l++)r.insertCol(s.endColIndex+1,i);else r.insertCol(a.colIndex+a.colSpan,i);e.moveToBookmark(n).select()}},UE.commands["deletecol"]={queryCommandState:function(){var e=t(this);return e.cell?0:-1},execCommand:function(){var e=t(this).cell,n=o(e),i=n.cellsRange,r=n.getCellInfo(e),a=n.getHSideCell(e),s=n.getHSideCell(e,!0);if(utils.isEmptyObject(i))n.deleteCol(r.colIndex);else for(var l=i.beginColIndex;l<i.endColIndex+1;l++)n.deleteCol(i.beginColIndex);var d=n.table,c=this.selection.getRange();if(d.getElementsByTagName("td").length)domUtils.inDoc(e,this.document)?c.setStart(e,0).setCursor(!1,!0):s&&domUtils.inDoc(s,this.document)?c.selectNodeContents(s).setCursor(!1,!0):a&&domUtils.inDoc(a,this.document)&&c.selectNodeContents(a).setCursor(!0,!0);else{var u=d.nextSibling;domUtils.remove(d),u&&c.setStart(u,0).setCursor(!1,!0)}}},UE.commands["splittocells"]={queryCommandState:function(){var e=t(this),n=e.cell;if(!n)return-1;var i=o(e.table);return i.selectedTds.length>0?-1:n&&(n.colSpan>1||n.rowSpan>1)?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this).cell,r=o(i);r.splitToCells(i),e.moveToBookmark(n).select()}},UE.commands["splittorows"]={queryCommandState:function(){var e=t(this),n=e.cell;if(!n)return-1;var i=o(e.table);return i.selectedTds.length>0?-1:n&&n.rowSpan>1?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this).cell,r=o(i);r.splitToRows(i),e.moveToBookmark(n).select()}},UE.commands["splittocols"]={queryCommandState:function(){var e=t(this),n=e.cell;if(!n)return-1;var i=o(e.table);return i.selectedTds.length>0?-1:n&&n.colSpan>1?0:-1},execCommand:function(){var e=this.selection.getRange(),n=e.createBookmark(!0),i=t(this).cell,r=o(i);r.splitToCols(i),e.moveToBookmark(n).select()}},UE.commands["adaptbytext"]=UE.commands["adaptbywindow"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e){var n=t(this),i=n.table;if(i)if("adaptbywindow"==e)r(i,this);else{var o=domUtils.getElementsByTagName(i,"td th");utils.each(o,(function(e){e.removeAttribute("width")})),i.removeAttribute("width")}}},UE.commands["averagedistributecol"]={queryCommandState:function(){var e=n(this);return e&&(e.isFullRow()||e.isFullCol())?0:-1},execCommand:function(e){var t=this,o=n(t);function r(){var e,n=o.table,r=0,a=0,s=i(t,n);if(o.isFullRow())r=n.offsetWidth,a=o.colsNum;else for(var l,d=o.cellsRange.beginColIndex,c=o.cellsRange.endColIndex,u=d;u<=c;)l=o.selectedTds[u],r+=l.offsetWidth,u+=l.colSpan,a+=1;return e=Math.ceil(r/a)-2*s.tdBorder-2*s.tdPadding,e}function a(e){utils.each(domUtils.getElementsByTagName(o.table,"th"),(function(e){e.setAttribute("width","")}));var t=o.isFullRow()?domUtils.getElementsByTagName(o.table,"td"):o.selectedTds;utils.each(t,(function(t){1==t.colSpan&&t.setAttribute("width",e)}))}o&&o.selectedTds.length&&a(r())}},UE.commands["averagedistributerow"]={queryCommandState:function(){var e=n(this);return e?e.selectedTds&&/th/gi.test(e.selectedTds[0].tagName)?-1:e.isFullRow()||e.isFullCol()?0:-1:-1},execCommand:function(e){var t=this,o=n(t);function r(){var e,n,r=0,a=o.table,s=i(t,a),l=parseInt(domUtils.getComputedStyle(a.getElementsByTagName("td")[0],"padding-top"));if(o.isFullCol()){var d,c,u=domUtils.getElementsByTagName(a,"caption"),m=domUtils.getElementsByTagName(a,"th");u.length>0&&(d=u[0].offsetHeight),m.length>0&&(c=m[0].offsetHeight),r=a.offsetHeight-(d||0)-(c||0),n=0==m.length?o.rowsNum:o.rowsNum-1}else{for(var f=o.cellsRange.beginRowIndex,h=o.cellsRange.endRowIndex,p=0,g=domUtils.getElementsByTagName(a,"tr"),b=f;b<=h;b++)r+=g[b].offsetHeight,p+=1;n=p}return e=browser.ie&&browser.version<9?Math.ceil(r/n):Math.ceil(r/n)-2*s.tdBorder-2*l,e}function a(e){var t=o.isFullCol()?domUtils.getElementsByTagName(o.table,"td"):o.selectedTds;utils.each(t,(function(t){1==t.rowSpan&&t.setAttribute("height",e)}))}o&&o.selectedTds.length&&a(r())}},UE.commands["cellalignment"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e,t){var i=this,o=n(i);if(o)utils.each(o.selectedTds,(function(e){domUtils.setAttributes(e,t)}));else{var r=i.selection.getStart(),a=r&&domUtils.findParentByTagName(r,["td","th","caption"],!0);/caption/gi.test(a.tagName)?(a.style.textAlign=t.align,a.style.verticalAlign=t.vAlign):domUtils.setAttributes(a,t),i.selection.getRange().setCursor(!0)}},queryCommandValue:function(e){var n=t(this).cell;if(n||(n=s(this)[0]),n){var i=UE.UETable.getUETable(n).selectedTds;return!i.length&&(i=n),UE.UETable.getTableCellAlignState(i)}return null}},UE.commands["tablealignment"]={queryCommandState:function(){return browser.ie&&browser.version<8?-1:t(this).table?0:-1},execCommand:function(e,t){var n=this,i=n.selection.getStart(),o=i&&domUtils.findParentByTagName(i,["table"],!0);o&&o.setAttribute("align",t)}},UE.commands["edittable"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e,t){var n=this.selection.getRange(),i=domUtils.findParentByTagName(n.startContainer,"table");if(i){var o=domUtils.getElementsByTagName(i,"td").concat(domUtils.getElementsByTagName(i,"th"),domUtils.getElementsByTagName(i,"caption"));utils.each(o,(function(e){e.style.borderColor=t}))}}},UE.commands["edittd"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e,t){var i=this,o=n(i);if(o)utils.each(o.selectedTds,(function(e){e.style.backgroundColor=t}));else{var r=i.selection.getStart(),a=r&&domUtils.findParentByTagName(r,["td","th","caption"],!0);a&&(a.style.backgroundColor=t)}}},UE.commands["settablebackground"]={queryCommandState:function(){return s(this).length>1?0:-1},execCommand:function(e,t){var n,i;n=s(this),i=o(n[0]),i.setBackground(n,t)}},UE.commands["cleartablebackground"]={queryCommandState:function(){var e=s(this);if(!e.length)return-1;for(var t,n=0;t=e[n++];)if(""!==t.style.backgroundColor)return 0;return-1},execCommand:function(){var e=s(this),t=o(e[0]);t.removeBackground(e)}},UE.commands["interlacetable"]=UE.commands["uninterlacetable"]={queryCommandState:function(e){var n=t(this).table;if(!n)return-1;var i=n.getAttribute("interlaced");return"interlacetable"==e?"enabled"===i?-1:0:i&&"disabled"!==i?0:-1},execCommand:function(e,n){var i=t(this).table;"interlacetable"==e?(i.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",i,n)):(i.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",i))}},UE.commands["setbordervisible"]={queryCommandState:function(e){var n=t(this).table;return n?0:-1},execCommand:function(){var e=t(this).table;utils.each(domUtils.getElementsByTagName(e,"td"),(function(e){e.style.borderWidth="1px",e.style.borderStyle="solid"}))}}}(),UE.plugins["table"]=function(){var e=this,t=null,n=5,i=!1,o=5,r=10,a=0,s=null,l=360,d=UE.UETable,c=function(e){return d.getUETable(e)},u=function(e){return d.getUETableBySelected(e)},m=function(e,t){return d.getDefaultValue(e,t)},f=function(e){return d.removeSelectedClass(e)};function h(e){}e.ready((function(){var e=this,t=e.selection.getText;e.selection.getText=function(){var n=u(e);if(n){var i="";return utils.each(n.selectedTds,(function(e){i+=e[browser.ie?"innerText":"textContent"]})),i}return t.call(e.selection)}}));var p=null,g=null,b="",v=!1,y=null,C=!1,w=null,x=null,N=!1,_=!0;e.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:e.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single","ue-table-interlace-color-double"]}),e.getUETable=c;var U={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};function E(e,t){k(e,"width",!0),k(e,"height",!0)}function k(e,t,n){e.style[t]&&(n&&e.setAttribute(t,parseInt(e.style[t],10)),e.style[t]="")}function T(e){return"TD"==e.tagName||"TH"==e.tagName?e:(t=domUtils.findParentByTagName(e,"td",!0)||domUtils.findParentByTagName(e,"th",!0))?t:null;var t}function S(e){var t=new RegExp(domUtils.fillChar,"g");if(e[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(e.getElementsByTagName(n).length)return 0;return 1}function B(t){return t.pageX||t.pageY?{x:t.pageX,y:t.pageY}:{x:t.clientX+e.document.body.scrollLeft-e.document.body.clientLeft,y:t.clientY+e.document.body.scrollTop-e.document.body.clientTop}}function I(t){if(!J())try{var n,o=T(t.target||t.srcElement);if(i&&(e.body.style.webkitUserSelect="none",(Math.abs(s.x-t.clientX)>r||Math.abs(s.y-t.clientY)>r)&&(W(),i=!1,a=0,z(t))),b&&x)return a=0,e.body.style.webkitUserSelect="none",e.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),n=B(t),P(e,!0,b,n,o),void("h"==b?w.style.left=O(x,t)+"px":"v"==b&&(w.style.top=D(x,t)+"px"));if(o){if(!0===e.fireEvent("excludetable",o))return;n=B(t);var l=M(o,n),d=domUtils.findParentByTagName(o,"table",!0);if(R(d,o,t,!0)){if(!0===e.fireEvent("excludetable",d))return;e.body.style.cursor="url("+e.options.cursorpath+"h.png),pointer"}else if(R(d,o,t)){if(!0===e.fireEvent("excludetable",d))return;e.body.style.cursor="url("+e.options.cursorpath+"v.png),pointer"}else{e.body.style.cursor="text";/\d/.test(l)&&(l=l.replace(/\d/,""),o=c(o).getPreviewCell(o,"v"==l)),P(e,!!o&&!!l,o?l:"",n,o)}}else L(!1,d,e)}catch(u){h(u)}}function L(e,t,n){if(e)A(t,n);else{if(C)return;setTimeout((function(){!C&&y&&y.parentNode&&y.parentNode.removeChild(y)}),2e3)}}function A(e,t){var n,i=domUtils.getXY(e),o=e.ownerDocument;if(y&&y.parentNode)return y;function r(i,o){clearTimeout(n),n=setTimeout((function(){t.fireEvent("tableClicked",e,o)}),300)}function a(i){clearTimeout(n);var o=c(e),r=e.rows[0].cells[0],a=o.getLastCell(),s=o.getCellsRange(r,a);t.selection.getRange().setStart(r,0).setCursor(!1,!0),o.setSelected(s)}y=o.createElement("div"),y.contentEditable=!1,y.innerHTML="",y.style.cssText="width:15px;height:15px;background-image:url("+t.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(i.y-15)+"px;left:"+i.x+"px;",domUtils.unSelectable(y),y.onmouseover=function(e){C=!0},y.onmouseout=function(e){C=!1},domUtils.on(y,"click",(function(e,t){r(t,this)})),domUtils.on(y,"dblclick",(function(e,t){a(t)})),domUtils.on(y,"dragstart",(function(e,t){domUtils.preventDefault(t)})),o.body.appendChild(y)}function R(e,t,n,i){var o=B(n),r=M(t,o);if(i){var a=e.getElementsByTagName("caption")[0],s=a?a.offsetHeight:0;return"v1"==r&&o.y-domUtils.getXY(e).y-s<8}return"h1"==r&&o.x-domUtils.getXY(e).x<8}function O(t,i){var o=c(t);if(o){var r=o.getSameEndPosCells(t,"x")[0],a=o.getSameStartPosXCells(t)[0],s=B(i).x,l=(r?domUtils.getXY(r).x:domUtils.getXY(o.table).x)+20,d=a?domUtils.getXY(a).x+a.offsetWidth-20:e.body.offsetWidth+5||parseInt(domUtils.getComputedStyle(e.body,"width"),10);return l+=n,d-=n,s<l?l:s>d?d:s}}function D(e,t){try{var n=domUtils.getXY(e).y,i=B(t).y;return i<n?n:i}catch(o){h(o)}}function P(e,t,n,i,o){try{e.body.style.cursor="h"==n?"col-resize":"v"==n?"row-resize":"text",browser.ie&&(!n||N||u(e)?re(e):(oe(e,e.document),ae(n,o))),v=t}catch(r){h(r)}}function M(e,t){var n=domUtils.getXY(e);return n?n.x+e.offsetWidth-t.x<o?"h":t.x-n.x<o?"h1":n.y+e.offsetHeight-t.y<o?"v":t.y-n.y<o?"v1":"":""}function H(t,n){if(!J())if(s={x:n.clientX,y:n.clientY},2==n.button){var i=u(e),o=!1;if(i){var r=de(e,n);utils.each(i.selectedTds,(function(e){e===r&&(o=!0)})),o?(r=i.selectedTds[0],setTimeout((function(){e.selection.getRange().setStart(r,0).setCursor(!1,!0)}),0)):(f(domUtils.getElementsByTagName(e.body,"th td")),i.clearSelected())}}else j(n)}function F(t){a=0,t=t||e.window.event;var n,i=T(t.target||t.srcElement);if(i&&(n=M(i,B(t)))){if(re(e),"h1"==n)if(n="h",R(domUtils.findParentByTagName(i,"table"),i,t))e.execCommand("adaptbywindow");else if(i=c(i).getPreviewCell(i),i){var o=e.selection.getRange();o.selectNodeContents(i).setCursor(!0,!0)}if("h"==n){var r=c(i),s=r.table,l=Z(i,s,!0);l=$(l,"left"),r.width=r.offsetWidth;var d=[],u=[];utils.each(l,(function(e){d.push(e.offsetWidth)})),utils.each(l,(function(e){e.removeAttribute("width")})),window.setTimeout((function(){var e=!0;utils.each(l,(function(t,n){var i=t.offsetWidth;if(i>d[n])return e=!1,!1;u.push(i)}));var t=e?u:d;utils.each(l,(function(e,n){e.width=t[n]-ie()}))}),0)}}}function j(t){if(f(domUtils.getElementsByTagName(e.body,"td th")),utils.each(e.document.getElementsByTagName("table"),(function(e){e.ueTable=null})),p=de(e,t),p){var n=domUtils.findParentByTagName(p,"table",!0);ut=c(n),ut&&ut.clearSelected(),v?q(t):(e.document.body.style.webkitUserSelect="",N=!0,e.addListener("mouseover",X))}}function q(e){browser.ie&&(e=V(e)),W(),i=!0,t=setTimeout((function(){z(e)}),l)}function $(e,t){for(var n=[],i=null,o=0,r=e.length;o<r;o++)i=e[o][t],i&&n.push(i);return n}function W(){t&&clearTimeout(t),t=null}function V(e){var t=["pageX","pageY","clientX","clientY","srcElement","target"],n={};if(e)for(var i,o,r=0;i=t[r];r++)o=e[i],o&&(n[i]=o);return n}function z(t){if(i=!1,p=t.target||t.srcElement,p){var n=M(p,B(t));/\d/.test(n)&&(n=n.replace(/\d/,""),p=c(p).getPreviewCell(p,"v"==n)),re(e),oe(e,e.document),e.fireEvent("saveScene"),ae(n,p),N=!0,b=n,x=p}}function K(e,t){if(!J()){if(W(),i=!1,v&&(a=++a%3,s={x:t.clientX,y:t.clientY},setTimeout((function(){a>0&&a--}),l),2===a))return a=0,void F(t);if(2!=t.button){var n=this,o=n.selection.getRange(),r=domUtils.findParentByTagName(o.startContainer,"table",!0),d=domUtils.findParentByTagName(o.endContainer,"table",!0);if((r||d)&&(r===d?(r=domUtils.findParentByTagName(o.startContainer,["td","th","caption"],!0),d=domUtils.findParentByTagName(o.endContainer,["td","th","caption"],!0),r!==d&&n.selection.clearRange()):n.selection.clearRange()),N=!1,n.document.body.style.webkitUserSelect="",b&&x&&(n.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),a=0,w=n.document.getElementById("ue_tableDragLine"),w)){var u=domUtils.getXY(x),m=domUtils.getXY(w);switch(b){case"h":G(x,m.x-u.x);break;case"v":Q(x,m.y-u.y-x.offsetHeight);break;default:}return b="",x=null,re(n),void n.fireEvent("saveScene")}if(p){var f=c(p),h=f?f.selectedTds[0]:null;if(h)o=new dom.Range(n.document),domUtils.isEmptyBlock(h)?o.setStart(h,0).setCursor(!1,!0):o.selectNodeContents(h).shrinkBoundary().setCursor(!1,!0);else if(o=n.selection.getRange().shrinkBoundary(),!o.collapsed){r=domUtils.findParentByTagName(o.startContainer,["td","th"],!0),d=domUtils.findParentByTagName(o.endContainer,["td","th"],!0);(r&&!d||!r&&d||r&&d&&r!==d)&&o.setCursor(!1,!0)}p=null,n.removeListener("mouseover",X)}else{var g=domUtils.findParentByTagName(t.target||t.srcElement,"td",!0);if(g||(g=domUtils.findParentByTagName(t.target||t.srcElement,"th",!0)),g&&("TD"==g.tagName||"TH"==g.tagName)){if(!0===n.fireEvent("excludetable",g))return;o=new dom.Range(n.document),o.setStart(g,0).setCursor(!1,!0)}}n._selectionChange(250,t)}}}function X(e,t){if(!J()){var n=this,i=t.target||t.srcElement;if(g=domUtils.findParentByTagName(i,"td",!0)||domUtils.findParentByTagName(i,"th",!0),p&&g&&("TD"==p.tagName&&"TD"==g.tagName||"TH"==p.tagName&&"TH"==g.tagName)&&domUtils.findParentByTagName(p,"table")==domUtils.findParentByTagName(g,"table")){var o=c(g);if(p!=g){n.document.body.style.webkitUserSelect="none",n.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"]();var r=o.getCellsRange(p,g);o.setSelected(r)}else n.document.body.style.webkitUserSelect="",o.clearSelected()}t.preventDefault?t.preventDefault():t.returnValue=!1}}function Y(e,t,n){var i=parseInt(domUtils.getComputedStyle(e,"line-height"),10),o=n+t;t=o<i?i:o,e.style.height&&(e.style.height=""),1==e.rowSpan?e.setAttribute("height",t):e.removeAttribute&&e.removeAttribute("height")}function G(e,t){var n=c(e);if(n){var i=n.table,o=Z(e,i);if(i.style.width="",i.removeAttribute("width"),t=ee(t,e,o),e.nextSibling){utils.each(o,(function(e){e.left.width=+e.left.width+t,e.right&&(e.right.width=+e.right.width-t)}))}else utils.each(o,(function(e){e.left.width-=-t}))}}function J(){return"false"===e.body.contentEditable}function Q(e,t){if(!(Math.abs(t)<10)){var n=c(e);if(n)for(var i,o=n.getSameEndPosCells(e,"y"),r=o[0]?o[0].offsetHeight:0,a=0;i=o[a++];)Y(i,t,r)}}function Z(e,t,n){if(t||(t=domUtils.findParentByTagName(e,"table")),!t)return null;domUtils.getNodeIndex(e);var i=e,o=t.rows,r=0;while(i)1===i.nodeType&&(r+=i.colSpan||1),i=i.previousSibling;i=null;var a=[];return utils.each(o,(function(e){var t=e.cells,i=0;utils.each(t,(function(e){return i+=e.colSpan||1,i===r?(a.push({left:e,right:e.nextSibling||null}),!1):i>r?(n&&a.push({left:e}),!1):void 0}))})),a}function ee(e,t,i){if(e-=ie(),e<0)return 0;e-=te(t);var o=e<0?"left":"right";return e=Math.abs(e),utils.each(i,(function(t){var i=t[o];i&&(e=Math.min(e,te(i)-n))})),e=e<0?0:e,"left"===o?-e:e}function te(e){var t=0;t=e.offsetWidth-ie();e.nextSibling||(t-=ne(e)),t=t<0?0:t;try{e.width=t}catch(n){}return t}function ne(e){if(tab=domUtils.findParentByTagName(e,"table",!1),void 0===tab.offsetVal){var t=e.previousSibling;tab.offsetVal=t&&e.offsetWidth-t.offsetWidth===d.borderWidth?d.borderWidth:0}return tab.offsetVal}function ie(){if(void 0===d.tabcellSpace){var t=e.document.createElement("table"),n=e.document.createElement("tbody"),i=e.document.createElement("tr"),o=e.document.createElement("td"),r=null;o.style.cssText="border: 0;",o.width=1,i.appendChild(o),i.appendChild(r=o.cloneNode(!1)),n.appendChild(i),t.appendChild(n),t.style.cssText="visibility: hidden;",e.body.appendChild(t),d.paddingSpace=o.offsetWidth-1;var a=t.offsetWidth;o.style.cssText="",r.style.cssText="",d.borderWidth=(t.offsetWidth-a)/3,d.tabcellSpace=d.paddingSpace+d.borderWidth,e.body.removeChild(t)}return ie=function(){return d.tabcellSpace},d.tabcellSpace}function oe(e,t){N||(w=e.document.createElement("div"),domUtils.setAttributes(w,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),e.body.appendChild(w))}function re(e){var t;if(!N)while(t=e.document.getElementById("ue_tableDragLine"))domUtils.remove(t)}function ae(e,t){if(t){var n,i=domUtils.findParentByTagName(t,"table"),o=i.getElementsByTagName("caption"),r=i.offsetWidth,a=i.offsetHeight-(o.length>0?o[0].offsetHeight:0),s=domUtils.getXY(i),l=domUtils.getXY(t);switch(e){case"h":n="height:"+a+"px;top:"+(s.y+(o.length>0?o[0].offsetHeight:0))+"px;left:"+(l.x+t.offsetWidth),w.style.cssText=n+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case"v":n="width:"+r+"px;left:"+s.x+"px;top:"+(l.y+t.offsetHeight),w.style.cssText=n+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)";break;default:}}}function se(e,t){for(var n,i,o=domUtils.getElementsByTagName(e.body,"table"),r=0;i=o[r++];){var a=domUtils.getElementsByTagName(i,"td");a[0]&&(t?(n=a[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/gi.test(n)&&domUtils.addClass(i,"noBorderTable")):domUtils.removeClasses(i,"noBorderTable"))}}function le(e,t,n){var i=e.body;return i.offsetWidth-(t?2*parseInt(domUtils.getComputedStyle(i,"margin-left"),10):0)-2*n.tableBorder-(e.options.offsetWidth||0)}function de(e,t){var n=domUtils.findParentByTagName(t.target||t.srcElement,["td","th"],!0),i=null;if(!n)return null;if(i=M(n,B(t)),!n)return null;if("h1"===i&&n.previousSibling){var o=domUtils.getXY(n),r=n.offsetWidth;Math.abs(o.x+r-t.clientX)>r/3&&(n=n.previousSibling)}else if("v1"===i&&n.parentNode.previousSibling){o=domUtils.getXY(n);var a=n.offsetHeight;Math.abs(o.y+a-t.clientY)>a/3&&(n=n.parentNode.previousSibling.firstChild)}return n&&!0!==e.fireEvent("excludetable",n)?n:null}e.ready((function(){var t,n,i,o;utils.cssRule("table",".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",e.document),e.addListener("keydown",(function(e,o){var r=this,a=o.keyCode||o.which;if(8==a){var s=u(r);s&&s.selectedTds.length&&(s.isFullCol()?r.execCommand("deletecol"):s.isFullRow()?r.execCommand("deleterow"):r.fireEvent("delcells"),domUtils.preventDefault(o));var l=domUtils.findParentByTagName(r.selection.getStart(),"caption",!0),d=r.selection.getRange();if(d.collapsed&&l&&S(l)){r.fireEvent("saveScene");var c=l.parentNode;domUtils.remove(l),c&&d.setStart(c.rows[0].cells[0],0).setCursor(!1,!0),r.fireEvent("saveScene")}}if(46==a&&(s=u(r),s)){r.fireEvent("saveScene");for(var m=0;y=s.selectedTds[m++];)domUtils.fillNode(r.document,y);r.fireEvent("saveScene"),domUtils.preventDefault(o)}if(13==a){var f=r.selection.getRange();l=domUtils.findParentByTagName(f.startContainer,"caption",!0);if(l){c=domUtils.findParentByTagName(l,"table");return f.collapsed?l&&f.setStart(c.rows[0].cells[0],0).setCursor(!1,!0):(f.deleteContents(),r.fireEvent("saveScene")),void domUtils.preventDefault(o)}if(f.collapsed){c=domUtils.findParentByTagName(f.startContainer,"table");if(c){var h=c.rows[0].cells[0],p=domUtils.findParentByTagName(r.selection.getStart(),["td","th"],!0),g=c.previousSibling;if(h===p&&(!g||1==g.nodeType&&"TABLE"==g.tagName)&&domUtils.isStartInblock(f)){var b=domUtils.findParent(r.selection.getStart(),(function(e){return domUtils.isBlockElm(e)}),!0);b&&(/t(h|d)/i.test(b.tagName)||b===p.firstChild)&&(r.execCommand("insertparagraphbeforetable"),domUtils.preventDefault(o))}}}}if((o.ctrlKey||o.metaKey)&&"67"==o.keyCode){t=null;s=u(r);if(s){var v=s.selectedTds;n=s.isFullCol(),i=s.isFullRow(),t=[[s.cloneCell(v[0],null,!0)]];var y;for(m=1;y=v[m];m++)y.parentNode!==v[m-1].parentNode?t.push([s.cloneCell(y,null,!0)]):t[t.length-1].push(s.cloneCell(y,null,!0))}}})),e.addListener("tablehasdeleted",(function(){P(this,!1,"",null),y&&domUtils.remove(y)})),e.addListener("beforepaste",(function(e,o){var r=this,a=r.selection.getRange();if(domUtils.findParentByTagName(a.startContainer,"caption",!0)){var s=r.document.createElement("div");return s.innerHTML=o.html,void(o.html=s[browser.ie9below?"innerText":"textContent"])}var l=u(r);if(t){r.fireEvent("saveScene");a=r.selection.getRange();var f,h,p=domUtils.findParentByTagName(a.startContainer,["td","th"],!0);if(p){var g=c(p);if(i){var b=g.getCellInfo(p).rowIndex;"TH"==p.tagName&&b++;for(var v=0;N=t[v++];){for(var y=g.insertRow(b++,"td"),C=0;T=N[C];C++){var w=y.cells[C];w||(w=y.insertCell(C)),w.innerHTML=T.innerHTML,T.getAttribute("width")&&w.setAttribute("width",T.getAttribute("width")),T.getAttribute("vAlign")&&w.setAttribute("vAlign",T.getAttribute("vAlign")),T.getAttribute("align")&&w.setAttribute("align",T.getAttribute("align")),T.style.cssText&&(w.style.cssText=T.style.cssText)}for(C=0;T=y.cells[C];C++){if(!N[C])break;T.innerHTML=N[C].innerHTML,N[C].getAttribute("width")&&T.setAttribute("width",N[C].getAttribute("width")),N[C].getAttribute("vAlign")&&T.setAttribute("vAlign",N[C].getAttribute("vAlign")),N[C].getAttribute("align")&&T.setAttribute("align",N[C].getAttribute("align")),N[C].style.cssText&&(T.style.cssText=N[C].style.cssText)}}}else{if(n){k=g.getCellInfo(p);for(var x=0,N=(C=0,t[0]);T=N[C++];)x+=T.colSpan||1;for(r.__hasEnterExecCommand=!0,v=0;v<x;v++)r.execCommand("insertcol");r.__hasEnterExecCommand=!1,p=g.table.rows[0].cells[k.cellIndex],"TH"==p.tagName&&(p=g.table.rows[1].cells[k.cellIndex])}for(v=0;N=t[v++];){f=p;for(C=0;T=N[C++];)if(p)p.innerHTML=T.innerHTML,T.getAttribute("width")&&p.setAttribute("width",T.getAttribute("width")),T.getAttribute("vAlign")&&p.setAttribute("vAlign",T.getAttribute("vAlign")),T.getAttribute("align")&&p.setAttribute("align",T.getAttribute("align")),T.style.cssText&&(p.style.cssText=T.style.cssText),h=p,p=p.nextSibling;else{var U=T.cloneNode(!0);domUtils.removeAttributes(U,["class","rowSpan","colSpan"]),h.parentNode.appendChild(U)}if(p=g.getNextCell(f,!0,!0),!t[v])break;if(!p){var k=g.getCellInfo(f);g.table.insertRow(g.table.rows.length),g.update(),p=g.getVSideCell(f,!0)}}}g.update()}else{l=r.document.createElement("table");for(v=0;N=t[v++];){var T;for(y=l.insertRow(l.rows.length),C=0;T=N[C++];)U=d.cloneCell(T,null,!0),domUtils.removeAttributes(U,["class"]),y.appendChild(U);2==C&&U.rowSpan>1&&(U.rowSpan=1)}var B=m(r),I=r.body.offsetWidth-(_?2*parseInt(domUtils.getComputedStyle(r.body,"margin-left"),10):0)-2*B.tableBorder-(r.options.offsetWidth||0);r.execCommand("insertHTML","<table "+(n&&i?'width="'+I+'"':"")+">"+l.innerHTML.replace(/>\s*</g,"><").replace(/\bth\b/gi,"td")+"</table>")}return r.fireEvent("contentchange"),r.fireEvent("saveScene"),o.html="",!0}var L;s=r.document.createElement("div");s.innerHTML=o.html,L=s.getElementsByTagName("table"),domUtils.findParentByTagName(r.selection.getStart(),"table")?(utils.each(L,(function(e){domUtils.remove(e)})),domUtils.findParentByTagName(r.selection.getStart(),"caption",!0)&&(s.innerHTML=s[browser.ie?"innerText":"textContent"])):utils.each(L,(function(e){E(e,!0),domUtils.removeAttributes(e,["style","border"]),utils.each(domUtils.getElementsByTagName(e,"td"),(function(e){S(e)&&domUtils.fillNode(r.document,e),E(e,!0)}))})),o.html=s.innerHTML})),e.addListener("afterpaste",(function(){utils.each(domUtils.getElementsByTagName(e.body,"table"),(function(t){if(t.offsetWidth>e.body.offsetWidth){var n=m(e,t);t.style.width=e.body.offsetWidth-(_?2*parseInt(domUtils.getComputedStyle(e.body,"margin-left"),10):0)-2*n.tableBorder-(e.options.offsetWidth||0)+"px"}}))})),e.addListener("blur",(function(){t=null})),e.addListener("keydown",(function(){clearTimeout(o),o=setTimeout((function(){var t=e.selection.getRange(),n=domUtils.findParentByTagName(t.startContainer,["th","td"],!0);if(n){var i=n.parentNode.parentNode.parentNode;i.offsetWidth>i.getAttribute("width")&&(n.style.wordBreak="break-all")}}),100)})),e.addListener("selectionchange",(function(){P(e,!1,"",null)})),e.addListener("contentchange",(function(){var e=this;if(re(e),!u(e)){var t=e.selection.getRange(),n=t.startContainer;n=domUtils.findParentByTagName(n,["td","th"],!0),utils.each(domUtils.getElementsByTagName(e.document,"table"),(function(t){!0!==e.fireEvent("excludetable",t)&&(t.ueTable=new d(t),t.onmouseover=function(){e.fireEvent("tablemouseover",t)},t.onmousemove=function(){e.fireEvent("tablemousemove",t),e.options.tableDragable&&L(!0,this,e),utils.defer((function(){e.fireEvent("contentchange",50)}),!0)},t.onmouseout=function(){e.fireEvent("tablemouseout",t),P(e,!1,"",null),re(e)},t.onclick=function(t){t=e.window.event||t;var n=T(t.target||t.srcElement);if(n){var i,o=c(n),r=o.table,a=o.getCellInfo(n),s=e.selection.getRange();if(R(r,n,t,!0)){var l=o.getCell(o.indexTable[o.rowsNum-1][a.colIndex].rowIndex,o.indexTable[o.rowsNum-1][a.colIndex].cellIndex);t.shiftKey&&o.selectedTds.length?o.selectedTds[0]!==l?(i=o.getCellsRange(o.selectedTds[0],l),o.setSelected(i)):s&&s.selectNodeContents(l).select():n!==l?(i=o.getCellsRange(n,l),o.setSelected(i)):s&&s.selectNodeContents(l).select()}else if(R(r,n,t)){var d=o.getCell(o.indexTable[a.rowIndex][o.colsNum-1].rowIndex,o.indexTable[a.rowIndex][o.colsNum-1].cellIndex);t.shiftKey&&o.selectedTds.length?o.selectedTds[0]!==d?(i=o.getCellsRange(o.selectedTds[0],d),o.setSelected(i)):s&&s.selectNodeContents(d).select():n!==d?(i=o.getCellsRange(n,d),o.setSelected(i)):s&&s.selectNodeContents(d).select()}}})})),se(e,!0)}})),domUtils.on(e.document,"mousemove",I),domUtils.on(e.document,"mouseout",(function(t){var n=t.target||t.srcElement;"TABLE"==n.tagName&&P(e,!1,"",null)})),e.addListener("interlacetable",(function(e,t,n){if(t)for(var i=this,o=t.rows,r=o.length,a=function(e,t,n){return e[t]?e[t]:n?e[t%e.length]:""},s=0;s<r;s++)o[s].className=a(n||i.options.classList,s,!0)})),e.addListener("uninterlacetable",(function(e,t){if(t)for(var n=this,i=t.rows,o=n.options.classList,r=i.length,a=0;a<r;a++)domUtils.removeClasses(i[a],o)})),e.addListener("mousedown",H),e.addListener("mouseup",K),domUtils.on(e.body,"dragstart",(function(t){K.call(e,"dragstart",t)})),e.addOutputRule((function(e){utils.each(e.getNodesByTagName("div"),(function(e){"ue_tableDragLine"==e.getAttr("id")&&e.parentNode.removeChild(e)}))}));var r=0;e.addListener("mousedown",(function(){r=0})),e.addListener("tabkeydown",(function(){var t=this.selection.getRange(),n=t.getCommonAncestor(!0,!0),i=domUtils.findParentByTagName(n,"table");if(i){if(domUtils.findParentByTagName(n,"caption",!0)){var o=domUtils.getElementsByTagName(i,"th td");o&&o.length&&t.setStart(o[0],0).setCursor(!1,!0)}else{o=domUtils.findParentByTagName(n,["td","th"],!0);var a=c(o);r=o.rowSpan>1?r:a.getCellInfo(o).rowIndex;var s=a.getTabNextCell(o,r);s?S(s)?t.setStart(s,0).setCursor(!1,!0):t.selectNodeContents(s).select():(e.fireEvent("saveScene"),e.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),e.__hasEnterExecCommand=!1,t=this.selection.getRange(),t.setStart(i.rows[i.rows.length-1].cells[0],0).setCursor(),e.fireEvent("saveScene"))}return!0}})),browser.ie&&e.addListener("selectionchange",(function(){P(this,!1,"",null)})),e.addListener("keydown",(function(e,t){var n=this,i=t.keyCode||t.which;if(8!=i&&46!=i){var o=!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey;o&&f(domUtils.getElementsByTagName(n.body,"td"));var r=u(n);r&&o&&r.clearSelected()}})),e.addListener("beforegetcontent",(function(){se(this,!1),browser.ie&&utils.each(this.document.getElementsByTagName("caption"),(function(e){domUtils.isEmptyNode(e)&&(e.innerHTML=" ")}))})),e.addListener("aftergetcontent",(function(){se(this,!0)})),e.addListener("getAllHtml",(function(){f(e.document.getElementsByTagName("td"))})),e.addListener("fullscreenchanged",(function(t,n){if(!n){var i=this.body.offsetWidth/document.body.offsetWidth,o=domUtils.getElementsByTagName(this.body,"table");utils.each(o,(function(t){if(t.offsetWidth<e.body.offsetWidth)return!1;var n=domUtils.getElementsByTagName(t,"td"),o=[];utils.each(n,(function(e){o.push(e.offsetWidth)}));for(var r,a=0;r=n[a];a++)r.setAttribute("width",Math.floor(o[a]*i));t.setAttribute("width",Math.floor(le(e,_,m(e))))}))}}));var a=e.execCommand;e.execCommand=function(e,t){var n=this;e=e.toLowerCase();var i,o,r=u(n),s=new dom.Range(n.document),l=n.commands[e]||UE.commands[e];if(l){if(!r||U[e]||l.notNeedUndo||n.__hasEnterExecCommand)o=a.apply(n,arguments);else{n.__hasEnterExecCommand=!0,n.fireEvent("beforeexeccommand",e),i=r.selectedTds;for(var d,c,m,f=-2,h=-2,p=0;m=i[p];p++)S(m)?s.setStart(m,0).setCursor(!1,!0):s.selectNode(m).select(!0),c=n.queryCommandState(e),d=n.queryCommandValue(e),-1!=c&&(f===c&&h===d||(n._ignoreContentChange=!0,o=a.apply(n,arguments),n._ignoreContentChange=!1),f=n.queryCommandState(e),h=n.queryCommandValue(e),domUtils.isEmptyBlock(m)&&domUtils.fillNode(n.document,m));s.setStart(i[0],0).shrinkBoundary(!0).setCursor(!1,!0),n.fireEvent("contentchange"),n.fireEvent("afterexeccommand",e),n.__hasEnterExecCommand=!1,n._selectionChange()}return o}}}))},UE.UETable.prototype.sortTable=function(e,t){var n=this.table,i=n.rows,o=[],r="TH"===i[0].cells[0].tagName,a=0;if(this.selectedTds.length){for(var s=this.cellsRange,l=s.endRowIndex+1,d=s.beginRowIndex;d<l;d++)o[d]=i[d];o.splice(0,s.beginRowIndex),a=s.endRowIndex+1===this.rowsNum?0:s.endRowIndex+1}else for(d=0,l=i.length;d<l;d++)o[d]=i[d];var c={reversecurrent:function(e,t){return 1},orderbyasc:function(e,t){var n=e.innerText||e.textContent,i=t.innerText||t.textContent;return n.localeCompare(i)},reversebyasc:function(e,t){var n=e.innerHTML,i=t.innerHTML;return i.localeCompare(n)},orderbynum:function(e,t){var n=e[browser.ie?"innerText":"textContent"].match(/\d+/),i=t[browser.ie?"innerText":"textContent"].match(/\d+/);return n&&(n=+n[0]),i&&(i=+i[0]),(n||0)-(i||0)},reversebynum:function(e,t){var n=e[browser.ie?"innerText":"textContent"].match(/\d+/),i=t[browser.ie?"innerText":"textContent"].match(/\d+/);return n&&(n=+n[0]),i&&(i=+i[0]),(i||0)-(n||0)}};n.setAttribute("data-sort-type",t&&"string"===typeof t&&c[t]?t:""),r&&o.splice(0,1),o=utils.sort(o,(function(n,i){var o;return o=t&&"function"===typeof t?t.call(this,n.cells[e],i.cells[e]):t&&"number"===typeof t?1:t&&"string"===typeof t&&c[t]?c[t].call(this,n.cells[e],i.cells[e]):c["orderbyasc"].call(this,n.cells[e],i.cells[e]),o}));var u=n.ownerDocument.createDocumentFragment(),m=0;for(l=o.length;m<l;m++)u.appendChild(o[m]);var f=n.getElementsByTagName("tbody")[0];a?f.insertBefore(u,i[a-s.endRowIndex+s.beginRowIndex-1]):f.appendChild(u)},UE.plugins["tablesort"]=function(){var e=this,t=UE.UETable,n=function(e){return t.getUETable(e)},i=function(e){return t.getTableItemsByRange(e)};e.ready((function(){utils.cssRule("tablesort","table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right; background-image:url("+e.options.themePath+e.options.theme+"/images/sortable.png);}",e.document),e.addListener("afterexeccommand",(function(e,t){"mergeright"!=t&&"mergedown"!=t&&"mergecells"!=t||this.execCommand("disablesort")}))})),UE.commands["sorttable"]={queryCommandState:function(){var e=this,t=i(e);if(!t.cell)return-1;for(var n,o=t.table,r=o.getElementsByTagName("td"),a=0;n=r[a++];)if(1!=n.rowSpan||1!=n.colSpan)return-1;return 0},execCommand:function(e,t){var o=this,r=o.selection.getRange(),a=r.createBookmark(!0),s=i(o),l=s.cell,d=n(s.table),c=d.getCellInfo(l);d.sortTable(c.cellIndex,t),r.moveToBookmark(a);try{r.select()}catch(u){}}},UE.commands["enablesort"]=UE.commands["disablesort"]={queryCommandState:function(e){var t=i(this).table;if(t&&"enablesort"==e)for(var n=domUtils.getElementsByTagName(t,"th td"),o=0;o<n.length;o++)if(n[o].getAttribute("colspan")>1||n[o].getAttribute("rowspan")>1)return-1;return t?"enablesort"==e^"sortEnabled"!=t.getAttribute("data-sort")?-1:0:-1},execCommand:function(e){var t=i(this).table;t.setAttribute("data-sort","enablesort"==e?"sortEnabled":"sortDisabled"),"enablesort"==e?domUtils.addClass(t,"sortEnabled"):domUtils.removeClasses(t,"sortEnabled")}}},UE.plugins["contextmenu"]=function(){var e=this;if(e.setOpt("enableContextMenu",!0),!1!==e.getOpt("enableContextMenu")){var t,n=e.getLang("contextMenu"),i=e.options.contextMenu||[{label:n["selectall"],cmdName:"selectall"},{label:n.cleardoc,cmdName:"cleardoc",exec:function(){confirm(n.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:n.unlink,cmdName:"unlink"},"-",{group:n.paragraph,icon:"justifyjustify",subMenu:[{label:n.justifyleft,cmdName:"justify",value:"left"},{label:n.justifyright,cmdName:"justify",value:"right"},{label:n.justifycenter,cmdName:"justify",value:"center"},{label:n.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:n.table,icon:"table",subMenu:[{label:n.inserttable,cmdName:"inserttable"},{label:n.deletetable,cmdName:"deletetable"},"-",{label:n.deleterow,cmdName:"deleterow"},{label:n.deletecol,cmdName:"deletecol"},{label:n.insertcol,cmdName:"insertcol"},{label:n.insertcolnext,cmdName:"insertcolnext"},{label:n.insertrow,cmdName:"insertrow"},{label:n.insertrownext,cmdName:"insertrownext"},"-",{label:n.insertcaption,cmdName:"insertcaption"},{label:n.deletecaption,cmdName:"deletecaption"},{label:n.inserttitle,cmdName:"inserttitle"},{label:n.deletetitle,cmdName:"deletetitle"},{label:n.inserttitlecol,cmdName:"inserttitlecol"},{label:n.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:n.mergecells,cmdName:"mergecells"},{label:n.mergeright,cmdName:"mergeright"},{label:n.mergedown,cmdName:"mergedown"},"-",{label:n.splittorows,cmdName:"splittorows"},{label:n.splittocols,cmdName:"splittocols"},{label:n.splittocells,cmdName:"splittocells"},"-",{label:n.averageDiseRow,cmdName:"averagedistributerow"},{label:n.averageDisCol,cmdName:"averagedistributecol"},"-",{label:n.edittd,cmdName:"edittd",exec:function(){UE.ui["edittd"]&&new UE.ui["edittd"](this),this.getDialog("edittd").open()}},{label:n.edittable,cmdName:"edittable",exec:function(){UE.ui["edittable"]&&new UE.ui["edittable"](this),this.getDialog("edittable").open()}},{label:n.setbordervisible,cmdName:"setbordervisible"}]},{group:n.tablesort,icon:"tablesort",subMenu:[{label:n.enablesort,cmdName:"enablesort"},{label:n.disablesort,cmdName:"disablesort"},"-",{label:n.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:n.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:n.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:n.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:n.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:n.borderbk,icon:"borderBack",subMenu:[{label:n.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:n.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:n.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:n.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:n.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:n.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:n.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:n.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:n.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:n.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:n.tableright,value:"right"}]},"-",{label:n.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:n.insertparagraphafter,cmdName:"insertparagraph"},{label:n["copy"],cmdName:"copy"},{label:n["paste"],cmdName:"paste"}];if(i.length){var o=UE.ui.uiUtils;e.addListener("contextmenu",(function(r,a){var s=o.getViewportOffsetByEvent(a);e.fireEvent("beforeselectionchange"),t&&t.destroy();for(var l,d=0,c=[];l=i[d];d++){var u;(function(t){if("-"==t)(u=c[c.length-1])&&"-"!==u&&c.push("-");else if(t.hasOwnProperty("group")){for(var i,o=0,r=[];i=t.subMenu[o];o++)(function(t){"-"==t?(u=r[r.length-1])&&"-"!==u?r.push("-"):r.splice(r.length-1):(e.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query():e.queryCommandState(t.cmdName))>-1&&r.push({label:t.label||e.getLang("contextMenu."+t.cmdName+(t.value||""))||"",className:"edui-for-"+t.cmdName+(t.className?" edui-for-"+t.cmdName+"-"+t.className:""),onclick:t.exec?function(){t.exec.call(e)}:function(){e.execCommand(t.cmdName,t.value)}})})(i);if(r.length){var a=function(){switch(t.icon){case"table":return e.getLang("contextMenu.table");case"justifyjustify":return e.getLang("contextMenu.paragraph");case"aligntd":return e.getLang("contextMenu.aligntd");case"aligntable":return e.getLang("contextMenu.aligntable");case"tablesort":return n.tablesort;case"borderBack":return n.borderbk;default:return""}};c.push({label:a(),className:"edui-for-"+t.icon,subMenu:{items:r,editor:e}})}}else(e.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query.call(e):e.queryCommandState(t.cmdName))>-1&&c.push({label:t.label||e.getLang("contextMenu."+t.cmdName),className:"edui-for-"+(t.icon?t.icon:t.cmdName+(t.value||"")),onclick:t.exec?function(){t.exec.call(e)}:function(){e.execCommand(t.cmdName,t.value)}})})(l)}if("-"==c[c.length-1]&&c.pop(),t=new UE.ui.Menu({items:c,className:"edui-contextmenu",editor:e}),t.render(),t.showAt(s),e.fireEvent("aftershowcontextmenu",t),domUtils.preventDefault(a),browser.ie){var m;try{m=e.selection.getNative().createRange()}catch(h){return}if(m.item){var f=new dom.Range(e.document);f.selectNode(m.item(0)).select(!0,!0)}}})),e.addListener("aftershowcontextmenu",(function(t,n){if(e.zeroclipboard){var i=n.items;for(var o in i)"edui-for-copy"==i[o].className&&e.zeroclipboard.clip(i[o].getDom())}}))}}},UE.plugins["shortcutmenu"]=function(){var e,t=this,n=t.options.shortcutMenu||[];n.length&&(t.addListener("contextmenu mouseup",(function(t,i){var o=this,r={type:t,target:i.target||i.srcElement,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY};if(setTimeout((function(){var i=o.selection.getRange();!1!==i.collapsed&&"contextmenu"!=t||(e||(e=new baidu.editor.ui.ShortCutMenu({editor:o,items:n,theme:o.options.theme,className:"edui-shortcutmenu"}),e.render(),o.fireEvent("afterrendershortcutmenu",e)),e.show(r,!!UE.plugins["contextmenu"]))})),"contextmenu"==t&&(domUtils.preventDefault(i),browser.ie9below)){var a;try{a=o.selection.getNative().createRange()}catch(i){return}if(a.item){var s=new dom.Range(o.document);s.selectNode(a.item(0)).select(!0,!0)}}})),t.addListener("keydown",(function(t){"keydown"==t&&e&&!e.isHidden&&e.hide()})))},UE.plugins["basestyle"]=function(){var e={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},t=function(e,t){return domUtils.filterNodeList(e.selection.getStartElementPath(),t)},n=this;for(var i in n.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"}),n.addInputRule((function(e){utils.each(e.getNodesByTagName("b i"),(function(e){switch(e.tagName){case"b":e.tagName="strong";break;case"i":e.tagName="em"}}))})),e)(function(e,i){n.commands[e]={execCommand:function(e){var o=n.selection.getRange(),r=t(this,i);if(o.collapsed){if(r){var a=n.document.createTextNode("");o.insertNode(a).removeInlineStyle(i),o.setStartBefore(a),domUtils.remove(a)}else{var s=o.document.createElement(i[0]);"superscript"!=e&&"subscript"!=e||(a=n.document.createTextNode(""),o.insertNode(a).removeInlineStyle(["sub","sup"]).setStartBefore(a).collapse(!0)),o.insertNode(s).setStart(s,0)}o.collapse(!0)}else"superscript"!=e&&"subscript"!=e||r&&r.tagName.toLowerCase()==e||o.removeInlineStyle(["sub","sup"]),r?o.removeInlineStyle(i):o.applyInlineStyle(i[0]);o.select()},queryCommandState:function(){return t(this,i)?1:0}}})(i,e[i])},UE.plugins["elementpath"]=function(){var e,t,n=this;n.setOpt("elementPathEnabled",!0),n.options.elementPathEnabled&&(n.commands["elementpath"]={execCommand:function(i,o){var r=t[o],a=n.selection.getRange();e=1*o,a.selectNode(r).select()},queryCommandValue:function(){var n=[].concat(this.selection.getStartElementPath()).reverse(),i=[];t=n;for(var o,r=0;o=n[r];r++)if(3!=o.nodeType){var a=o.tagName.toLowerCase();if("img"==a&&o.getAttribute("anchorname")&&(a="anchor"),i[r]=a,e==r){e=-1;break}}return i}})},UE.plugins["formatmatch"]=function(){var e,t=this,n=[],i=0;function o(r,a){if(browser.webkit)var s="IMG"==a.target.tagName?a.target:null;function l(e){return m&&e.selectNode(m),e.applyInlineStyle(n[n.length-1].tagName,null,n)}t.undoManger&&t.undoManger.save();var d=t.selection.getRange(),c=s||d.getClosedNode();if(e&&c&&"IMG"==c.tagName)c.style.cssText+=";float:"+(e.style.cssFloat||e.style.styleFloat||"none")+";display:"+(e.style.display||"inline"),e=null;else if(!e){var u=d.collapsed;if(u){var m=t.document.createTextNode("match");d.insertNode(m).select()}t.__hasEnterExecCommand=!0;var f=t.options.removeFormatAttributes;t.options.removeFormatAttributes="",t.execCommand("removeformat"),t.options.removeFormatAttributes=f,t.__hasEnterExecCommand=!1,d=t.selection.getRange(),n.length&&l(d),m&&d.setStartBefore(m).collapse(!0),d.select(),m&&domUtils.remove(m)}t.undoManger&&t.undoManger.save(),t.removeListener("mouseup",o),i=0}t.addListener("reset",(function(){n=[],i=0})),t.commands["formatmatch"]={execCommand:function(r){if(i)return i=0,n=[],void t.removeListener("mouseup",o);var a=t.selection.getRange();if(e=a.getClosedNode(),!e||"IMG"!=e.tagName){a.collapse(!0).shrinkBoundary();var s=a.startContainer;n=domUtils.findParents(s,!0,(function(e){return!domUtils.isBlockElm(e)&&1==e.nodeType}));for(var l,d=0;l=n[d];d++)if("A"==l.tagName){n.splice(d,1);break}}t.addListener("mouseup",o),i=1},queryCommandState:function(){return i},notNeedUndo:1}},UE.plugin.register("searchreplace",(function(){var e=this,t={table:1,tbody:1,tr:1,ol:1,ul:1};function n(e,t,n){var i=t.searchStr;-1==t.dir&&(e=e.split("").reverse().join(""),i=i.split("").reverse().join(""),n=e.length-n);var o,r=new RegExp(i,"g"+(t.casesensitive?"":"i"));while(o=r.exec(e))if(o.index>=n)return-1==t.dir?e.length-o.index-t.searchStr.length:o.index;return-1}function i(e,i,o){var r,a,s=o.all||1==o.dir?"getNextDomNode":"getPreDomNode";domUtils.isBody(e)&&(e=e.firstChild);while(e){if(r=3==e.nodeType?e.nodeValue:e[browser.ie?"innerText":"textContent"],a=n(r,o,i),0,-1!=a)return{node:e,index:a};e=domUtils[s](e);while(e&&t[e.nodeName.toLowerCase()])e=domUtils[s](e,!0);e&&(i=-1==o.dir?(3==e.nodeType?e.nodeValue:e[browser.ie?"innerText":"textContent"]).length:0)}}function o(e,t,n){var i,r=0,a=e.firstChild,s=0;while(a){if(3==a.nodeType){if(s=a.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,r+=s,r>=t)return{node:a,index:s-(r-t)}}else if(!dtd.$empty[a.tagName]&&(s=a[browser.ie?"innerText":"textContent"].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,r+=s,r>=t&&(i=o(a,s-(r-t),n),i)))return i;a=domUtils.getNextDomNode(a)}}function r(e,t){var n,r=e.selection.getRange(),s=t.searchStr,l=e.document.createElement("span");if(l.innerHTML="$$ueditor_searchreplace_key$$",r.shrinkBoundary(!0),!r.collapsed){r.select();var d=e.selection.getText();if(new RegExp("^"+t.searchStr+"$",t.casesensitive?"":"i").test(d)){if(void 0!=t.replaceStr)return a(r,t.replaceStr),r.select(),!0;r.collapse(-1==t.dir)}}r.insertNode(l),r.enlargeToBlockElm(!0),n=r.startContainer;var c=n[browser.ie?"innerText":"textContent"].indexOf("$$ueditor_searchreplace_key$$");r.setStartBefore(l),domUtils.remove(l);var u=i(n,c,t);if(u){var m=o(u.node,u.index,s),f=o(u.node,u.index+s.length,s);return r.setStart(m.node,m.index).setEnd(f.node,f.index),void 0!==t.replaceStr&&a(r,t.replaceStr),r.select(),!0}r.setCursor()}function a(t,n){n=e.document.createTextNode(n),t.deleteContents().insertNode(n)}return{commands:{searchreplace:{execCommand:function(t,n){utils.extend(n,{all:!1,casesensitive:!1,dir:1},!0);var i=0;if(n.all){var o=e.selection.getRange(),a=e.body.firstChild;a&&1==a.nodeType?(o.setStart(a,0),o.shrinkBoundary(!0)):3==a.nodeType&&o.setStartBefore(a),o.collapse(!0).select(!0),void 0!==n.replaceStr&&e.fireEvent("saveScene");while(r(this,n))i++;i&&e.fireEvent("saveScene")}else void 0!==n.replaceStr&&e.fireEvent("saveScene"),r(this,n)&&i++,i&&e.fireEvent("saveScene");return i},notNeedUndo:1}}}})),UE.plugins["customstyle"]=function(){var e=this;e.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]}),e.commands["customstyle"]={execCommand:function(e,t){var n,i,o=this,r=t.tag,a=domUtils.findParent(o.selection.getStart(),(function(e){return e.getAttribute("label")}),!0),s={};for(var l in t)void 0!==t[l]&&(s[l]=t[l]);if(delete s.tag,a&&a.getAttribute("label")==t.label){if(n=this.selection.getRange(),i=n.createBookmark(),n.collapsed)if(dtd.$block[a.tagName]){var d=o.document.createElement("p");domUtils.moveChild(a,d),a.parentNode.insertBefore(d,a),domUtils.remove(a)}else domUtils.remove(a,!0);else{var c=domUtils.getCommonAncestor(i.start,i.end),u=domUtils.getElementsByTagName(c,r);new RegExp(r,"i").test(c.tagName)&&u.push(c);for(var m,f=0;m=u[f++];)if(m.getAttribute("label")==t.label){var h=domUtils.getPosition(m,i.start),p=domUtils.getPosition(m,i.end);if((h&domUtils.POSITION_FOLLOWING||h&domUtils.POSITION_CONTAINS)&&(p&domUtils.POSITION_PRECEDING||p&domUtils.POSITION_CONTAINS)&&dtd.$block[r]){d=o.document.createElement("p");domUtils.moveChild(m,d),m.parentNode.insertBefore(d,m)}domUtils.remove(m,!0)}a=domUtils.findParent(c,(function(e){return e.getAttribute("label")==t.label}),!0),a&&domUtils.remove(a,!0)}n.moveToBookmark(i).select()}else if(dtd.$block[r]){if(this.execCommand("paragraph",r,s,"customstyle"),n=o.selection.getRange(),!n.collapsed){n.collapse(),a=domUtils.findParent(o.selection.getStart(),(function(e){return e.getAttribute("label")==t.label}),!0);var g=o.document.createElement("p");domUtils.insertAfter(a,g),domUtils.fillNode(o.document,g),n.setStart(g,0).setCursor()}}else{if(n=o.selection.getRange(),n.collapsed)return a=o.document.createElement(r),domUtils.setAttributes(a,s),void n.insertNode(a).setStart(a,0).setCursor();i=n.createBookmark(),n.applyInlineStyle(r,s).moveToBookmark(i).select()}},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),(function(e){return e.getAttribute("label")}));return e?e.getAttribute("label"):""}},e.addListener("keyup",(function(t,n){var i=n.keyCode||n.which;if(32==i||13==i){var o=e.selection.getRange();if(o.collapsed){var r=domUtils.findParent(e.selection.getStart(),(function(e){return e.getAttribute("label")}),!0);if(r&&dtd.$block[r.tagName]&&domUtils.isEmptyNode(r)){var a=e.document.createElement("p");domUtils.insertAfter(r,a),domUtils.fillNode(e.document,a),domUtils.remove(r),o.setStart(a,0).setCursor()}}}}))},UE.plugins["catchremoteimage"]=function(){var me=this,ajax=UE.ajax;!1!==me.options.catchRemoteImageEnable&&(me.setOpt({catchRemoteImageEnable:!1}),me.addListener("afterpaste",(function(){me.fireEvent("catchRemoteImage")})),me.addListener("catchRemoteImage",(function(){for(var catcherLocalDomain=me.getOpt("catcherLocalDomain"),catcherActionUrl=me.getActionUrl(me.getOpt("catcherActionName")),catcherUrlPrefix=me.getOpt("catcherUrlPrefix"),catcherFieldName=me.getOpt("catcherFieldName"),remoteImages=[],imgs=domUtils.getElementsByTagName(me.document,"img"),test=function(e,t){if(-1!=e.indexOf(location.host)||/(^\.)|(^\/)/.test(e))return!0;if(t)for(var n,i=0;n=t[i++];)if(-1!==e.indexOf(n))return!0;return!1},i=0,ci;ci=imgs[i++];)if(!ci.getAttribute("word_img")){var src=ci.getAttribute("_src")||ci.src||"";/^(https?|ftp):/i.test(src)&&!test(src,catcherLocalDomain)&&remoteImages.push(src)}function catchremoteimage(e,t){var n=utils.serializeParam(me.queryCommandValue("serverparam"))||"",i=utils.formatUrl(catcherActionUrl+(-1==catcherActionUrl.indexOf("?")?"?":"&")+n),o=utils.isCrossDomainUrl(i),r={method:"POST",dataType:o?"jsonp":"",timeout:6e4,onsuccess:t["success"],onerror:t["error"]};r[catcherFieldName]=e,ajax.request(i,r)}remoteImages.length&&catchremoteimage(remoteImages,{success:function success(r){try{var info=void 0!==r.state?r:eval("("+r.responseText+")")}catch(e){return}var i,j,ci,cj,oldSrc,newSrc,list=info.list;for(i=0;ci=imgs[i++];)for(oldSrc=ci.getAttribute("_src")||ci.src||"",j=0;cj=list[j++];)if(oldSrc==cj.source&&"SUCCESS"==cj.state){newSrc=catcherUrlPrefix+cj.url,domUtils.setAttributes(ci,{src:newSrc,_src:newSrc});break}me.fireEvent("catchremotesuccess")},error:function(){me.fireEvent("catchremoteerror")}})})))},UE.plugin.register("snapscreen",(function(){var me=this,snapplugin;function getLocation(e){var t,n=document.createElement("a"),i=utils.serializeParam(me.queryCommandValue("serverparam"))||"";return n.href=e,browser.ie&&(n.href=n.href),t=n.search,i&&(t=t+(-1==t.indexOf("?")?"?":"&")+i,t=t.replace(/[&]+/gi,"&")),{port:n.port,hostname:n.hostname,path:n.pathname+t||+n.hash}}return{commands:{snapscreen:{execCommand:function execCommand(cmd){var url,local,res,lang=me.getLang("snapScreen_plugin");if(!snapplugin){var container=me.container,doc=me.container.ownerDocument||me.container.document;snapplugin=doc.createElement("object");try{snapplugin.type="application/x-pluginbaidusnap"}catch(e){return}snapplugin.style.cssText="position:absolute;left:-9999px;width:0;height:0;",snapplugin.setAttribute("width","0"),snapplugin.setAttribute("height","0"),container.appendChild(snapplugin)}function onSuccess(rs){try{if(rs=eval("("+rs+")"),"SUCCESS"==rs.state){var opt=me.options;me.execCommand("insertimage",{src:opt.snapscreenUrlPrefix+rs.url,_src:opt.snapscreenUrlPrefix+rs.url,alt:rs.title||"",floatStyle:opt.snapscreenImgAlign})}else alert(rs.state)}catch(e){alert(lang.callBackErrorMsg)}}url=me.getActionUrl(me.getOpt("snapscreenActionName")),local=getLocation(url),setTimeout((function(){try{res=snapplugin.saveSnapshot(local.hostname,local.path,local.port)}catch(e){return void me.ui._dialogs["snapscreenDialog"].open()}onSuccess(res)}),50)},queryCommandState:function(){return-1!=navigator.userAgent.indexOf("Windows",0)?0:-1}}}}})),UE.commands["insertparagraph"]={execCommand:function(e,t){var n,i=this,o=i.selection.getRange(),r=o.startContainer;while(r){if(domUtils.isBody(r))break;n=r,r=r.parentNode}if(n){var a=i.document.createElement("p");t?n.parentNode.insertBefore(a,n):n.parentNode.insertBefore(a,n.nextSibling),domUtils.fillNode(i.document,a),o.setStart(a,0).setCursor(!1,!0)}}},UE.plugin.register("webapp",(function(){var e=this;function t(t,n){return n?'<iframe class="edui-faked-webapp" title="'+t.title+'" '+(t.align&&!t.cssfloat?'align="'+t.align+'"':"")+(t.cssfloat?'style="float:'+t.cssfloat+'"':"")+'width="'+t.width+'" height="'+t.height+'" scrolling="no" frameborder="0" src="'+t.url+'" logo_url = "'+t.logo+'"></iframe>':'<img title="'+t.title+'" width="'+t.width+'" height="'+t.height+'" src="'+e.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" _logo_url="'+t.logo+'" style="background:url('+t.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+t.url+'" '+(t.align&&!t.cssfloat?'align="'+t.align+'"':"")+(t.cssfloat?'style="float:'+t.cssfloat+'"':"")+"/>"}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){var n;if("edui-faked-webapp"==e.getAttr("class")){n=t({title:e.getAttr("title"),width:e.getAttr("width"),height:e.getAttr("height"),align:e.getAttr("align"),cssfloat:e.getStyle("float"),url:e.getAttr("_url"),logo:e.getAttr("_logo_url")},!0);var i=UE.uNode.createElement(n);e.parentNode.replaceChild(i,e)}}))},inputRule:function(e){utils.each(e.getNodesByTagName("iframe"),(function(e){if("edui-faked-webapp"==e.getAttr("class")){var n=UE.uNode.createElement(t({title:e.getAttr("title"),width:e.getAttr("width"),height:e.getAttr("height"),align:e.getAttr("align"),cssfloat:e.getStyle("float"),url:e.getAttr("src"),logo:e.getAttr("logo_url")}));e.parentNode.replaceChild(n,e)}}))},commands:{webapp:{execCommand:function(e,n){var i=this,o=t(utils.extend(n,{align:"none"}),!1);i.execCommand("inserthtml",o)},queryCommandState:function(){var e=this,t=e.selection.getRange().getClosedNode(),n=t&&"edui-faked-webapp"==t.className;return n?1:0}}}}})),UE.plugins["template"]=function(){UE.commands["template"]={execCommand:function(e,t){t.html&&this.execCommand("inserthtml",t.html)}},this.addListener("click",(function(e,t){var n=t.target||t.srcElement,i=this.selection.getRange(),o=domUtils.findParent(n,(function(e){if(e.className&&domUtils.hasClass(e,"ue_t"))return e}),!0);o&&i.selectNode(o).shrinkBoundary().select()})),this.addListener("keydown",(function(e,t){var n=this.selection.getRange();if(!n.collapsed&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey){var i=domUtils.findParent(n.startContainer,(function(e){if(e.className&&domUtils.hasClass(e,"ue_t"))return e}),!0);i&&domUtils.removeClasses(i,["ue_t"])}}))},UE.plugin.register("music",(function(){var e=this;function t(t,n,i,o,r,a){return a?'<embed type="application/x-shockwave-flash" class="edui-faked-music" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+t+'" width="'+n+'" height="'+i+'" '+(o&&!r?'align="'+o+'"':"")+(r?'style="float:'+r+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(o&&!r?'align="'+o+'"':"")+(r?'style="float:'+r+'"':"")+' width="'+n+'" height="'+i+'" _url="'+t+'" class="edui-faked-music" src="'+e.options.langPath+e.options.lang+'/images/music.png" />'}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){var n;if("edui-faked-music"==e.getAttr("class")){var i=e.getStyle("float"),o=e.getAttr("align");n=t(e.getAttr("_url"),e.getAttr("width"),e.getAttr("height"),o,i,!0);var r=UE.uNode.createElement(n);e.parentNode.replaceChild(r,e)}}))},inputRule:function(e){utils.each(e.getNodesByTagName("embed"),(function(e){if("edui-faked-music"==e.getAttr("class")){var n=e.getStyle("float"),i=e.getAttr("align");html=t(e.getAttr("src"),e.getAttr("width"),e.getAttr("height"),i,n,!1);var o=UE.uNode.createElement(html);e.parentNode.replaceChild(o,e)}}))},commands:{music:{execCommand:function(e,n){var i=this,o=t(n.url,n.width||400,n.height||95,"none",!1);i.execCommand("inserthtml",o)},queryCommandState:function(){var e=this,t=e.selection.getRange().getClosedNode(),n=t&&"edui-faked-music"==t.className;return n?1:0}}}}})),UE.plugin.register("autoupload",(function(){function e(e,t){var n,i,o,r,a,s,l,d,c=t,u=/image\/\w+/i.test(e.type)?"image":"file",m="loading_"+(+new Date).toString(36);if(n=c.getOpt(u+"FieldName"),i=c.getOpt(u+"UrlPrefix"),o=c.getOpt(u+"MaxSize"),r=c.getOpt(u+"AllowFiles"),a=c.getActionUrl(c.getOpt(u+"ActionName")),l=function(e){var t=c.document.getElementById(m);t&&domUtils.remove(t),c.fireEvent("showmessage",{id:m,content:e,type:"error",timeout:4e3})},"image"==u?(s='<img class="loadingclass" id="'+m+'" src="'+c.options.themePath+c.options.theme+'/images/spacer.gif" title="'+(c.getLang("autoupload.loading")||"")+'" >',d=function(e){var t=i+e.url,n=c.document.getElementById(m);n&&(n.setAttribute("src",t),n.setAttribute("_src",t),n.setAttribute("title",e.title||""),n.setAttribute("alt",e.original||""),n.removeAttribute("id"),domUtils.removeClasses(n,"loadingclass"))}):(s='<p><img class="loadingclass" id="'+m+'" src="'+c.options.themePath+c.options.theme+'/images/spacer.gif" title="'+(c.getLang("autoupload.loading")||"")+'" ></p>',d=function(e){var t=i+e.url,n=c.document.getElementById(m),o=c.selection.getRange(),r=o.createBookmark();o.selectNode(n).select(),c.execCommand("insertfile",{url:t}),o.moveToBookmark(r).select()}),c.execCommand("inserthtml",s),c.getOpt(u+"ActionName"))if(e.size>o)l(c.getLang("autoupload.exceedSizeError"));else{var f=e.name?e.name.substr(e.name.lastIndexOf(".")):"";if(f&&"image"!=u||r&&-1==(r.join("")+".").indexOf(f.toLowerCase()+"."))l(c.getLang("autoupload.exceedTypeError"));else{var h=new XMLHttpRequest,p=new FormData,g=utils.serializeParam(c.queryCommandValue("serverparam"))||"",b=utils.formatUrl(a+(-1==a.indexOf("?")?"?":"&")+g);p.append(n,e,e.name||"blob."+e.type.substr("image/".length)),p.append("type","ajax"),h.open("post",b,!0),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.addEventListener("load",(function(e){try{var t=new Function("return "+utils.trim(e.target.response))();"SUCCESS"==t.state&&t.url?d(t):l(t.state)}catch(n){l(c.getLang("autoupload.loadError"))}})),h.send(p)}}else l(c.getLang("autoupload.errorLoadConfig"))}function t(e){return e.clipboardData&&e.clipboardData.items&&1==e.clipboardData.items.length&&/^image\//.test(e.clipboardData.items[0].type)?e.clipboardData.items:null}function n(e){return e.dataTransfer&&e.dataTransfer.files?e.dataTransfer.files:null}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)})),utils.each(e.getNodesByTagName("p"),(function(e){/\bloadpara\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)}))},bindEvents:{ready:function(i){var o=this;window.FormData&&window.FileReader&&(domUtils.on(o.body,"paste drop",(function(i){var r,a=!1;if(r="paste"==i.type?t(i):n(i),r){var s,l=r.length;while(l--)s=r[l],s.getAsFile&&(s=s.getAsFile()),s&&s.size>0&&(e(s,o),a=!0);a&&i.preventDefault()}})),domUtils.on(o.body,"dragover",(function(e){"Files"==e.dataTransfer.types[0]&&e.preventDefault()})),utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document))}}}})),UE.plugin.register("autosave",(function(){var e=this,t=new Date,n=20,i=null;function o(o){var r;new Date-t<n||(o.hasContents()?(t=new Date,o._saveFlag=null,r=e.body.innerHTML,!1!==o.fireEvent("beforeautosave",{content:r})&&(e.setPreferences(i,r),o.fireEvent("afterautosave",{content:r}))):i&&e.removePreferences(i))}return{defaultOptions:{saveInterval:500,enableAutoSave:!0},bindEvents:{ready:function(){var t="-drafts-data",n=null;n=e.key?e.key+t:(e.container.parentNode.id||"ue-common")+t,i=(location.protocol+location.host+location.pathname).replace(/[.:\/]/g,"_")+n},contentchange:function(){e.getOpt("enableAutoSave")&&i&&(e._saveFlag&&window.clearTimeout(e._saveFlag),e.options.saveInterval>0?e._saveFlag=window.setTimeout((function(){o(e)}),e.options.saveInterval):o(e))}},commands:{clearlocaldata:{execCommand:function(t,n){i&&e.getPreferences(i)&&e.removePreferences(i)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(t,n){return i&&e.getPreferences(i)||""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(t,n){i&&(e.body.innerHTML=e.getPreferences(i)||"<p>"+domUtils.fillHtml+"</p>",e.focus(!0))},queryCommandState:function(){return i?null===e.getPreferences(i)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}})),UE.plugin.register("charts",(function(){var e=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(n,i){var o=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0),r=[],a={};if(!o)return!1;if(!t(o))return e.fireEvent("chartserror"),!1;for(var s in a.title=i.title||"",a.subTitle=i.subTitle||"",a.xTitle=i.xTitle||"",a.yTitle=i.yTitle||"",a.suffix=i.suffix||"",a.tip=i.tip||"",a.dataFormat=i.tableDataFormat||"",a.chartType=i.chartType||0,a)a.hasOwnProperty(s)&&r.push(s+":"+a[s]);o.setAttribute("data-chart",r.join(";")),domUtils.addClass(o,"edui-charts-table")},queryCommandState:function(e,n){var i=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return i&&t(i)?0:-1}}},inputRule:function(e){utils.each(e.getNodesByTagName("table"),(function(e){void 0!==e.getAttr("data-chart")&&e.setAttr("style")}))},outputRule:function(e){utils.each(e.getNodesByTagName("table"),(function(e){void 0!==e.getAttr("data-chart")&&e.setAttr("style","display: none;")}))}};function t(e){var t=null,n=0;if(e.rows.length<2)return!1;if(e.rows[0].cells.length<2)return!1;t=e.rows[0].cells,n=t.length;for(var i=0;r=t[i];i++)if("th"!==r.tagName.toLowerCase())return!1;var o;for(i=1;o=e.rows[i];i++){if(o.cells.length!=n)return!1;if("th"!==o.cells[0].tagName.toLowerCase())return!1;for(var r,a=1;r=o.cells[a];a++){var s=utils.trim(r.innerText||r.textContent||"");if(s=s.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(s))return!1}}return!0}})),UE.plugin.register("section",(function(){function e(e){this.tag="",this.level=-1,this.dom=null,this.nextSection=null,this.previousSection=null,this.parentSection=null,this.startAddress=[],this.endAddress=[],this.children=[]}function t(t){var n=new e;return utils.extend(n,t)}function n(e,t){for(var n=t,i=0;i<e.length;i++){if(!n.childNodes)return null;n=n.childNodes[e[i]]}return n}var i=this;return{bindMultiEvents:{type:"aftersetcontent afterscencerestore",handler:function(){i.fireEvent("updateSections")}},bindEvents:{ready:function(){i.fireEvent("updateSections"),domUtils.on(i.body,"drop paste",(function(){i.fireEvent("updateSections")}))},afterexeccommand:function(e,t){"paragraph"==t&&i.fireEvent("updateSections")},keyup:function(e,t){var n=this,i=n.selection.getRange();if(1!=i.collapsed)n.fireEvent("updateSections");else{var o=t.keyCode||t.which;13!=o&&8!=o&&46!=o||n.fireEvent("updateSections")}}},commands:{getsections:{execCommand:function(e,n){for(var i=n||["h1","h2","h3","h4","h5","h6"],o=0;o<i.length;o++)"string"==typeof i[o]?i[o]=function(e){return function(t){return t.tagName==e.toUpperCase()}}(i[o]):"function"!=typeof i[o]&&(i[o]=function(e){return null});function r(e){for(var t=0;t<i.length;t++)if(i[t](e))return t;return-1}var a=this,s=t({level:-1,title:"root"}),l=s;function d(e,n){for(var i,o,s,c=null,u=e.childNodes,m=0,f=u.length;m<f;m++)if(s=u[m],i=r(s),i>=0){var h=a.selection.getRange().selectNode(s).createAddress(!0).startAddress,p=t({tag:s.tagName,title:s.innerText||s.textContent||"",level:i,dom:s,startAddress:utils.clone(h,[]),endAddress:utils.clone(h,[]),children:[]});l.nextSection=p,p.previousSection=l,o=l;while(i<=o.level)o=o.parentSection;p.parentSection=o,o.children.push(p),c=l=p}else 1===s.nodeType&&d(s,n),c&&c.endAddress[c.endAddress.length-1]++}return d(a.body,s),s},notNeedUndo:!0},movesection:{execCommand:function(e,t,i,o){var r,a,s=this;if(t&&i&&-1!=i.level&&(r=o?i.endAddress:i.startAddress,a=n(r,s.body),r&&a&&!m(t.startAddress,t.endAddress,r))){var l,d,c=n(t.startAddress,s.body),u=n(t.endAddress,s.body);if(o){l=u;while(l&&!(domUtils.getPosition(c,l)&domUtils.POSITION_FOLLOWING)){if(d=l.previousSibling,domUtils.insertAfter(a,l),l==c)break;l=d}}else{l=c;while(l&&!(domUtils.getPosition(l,u)&domUtils.POSITION_FOLLOWING)){if(d=l.nextSibling,a.parentNode.insertBefore(l,a),l==u)break;l=d}}s.fireEvent("updateSections")}function m(e,t,n){for(var i=!1,o=!1,r=0;r<e.length;r++){if(r>=n.length)break;if(n[r]>e[r]){i=!0;break}if(n[r]<e[r])break}for(r=0;r<t.length;r++){if(r>=n.length)break;if(n[r]<e[r]){o=!0;break}if(n[r]>e[r])break}return i&&o}}},deletesection:{execCommand:function(e,t,n){var i=this;if(t){var o,r=l(t.startAddress),a=l(t.endAddress),s=r;if(n)domUtils.remove(s);else while(s&&domUtils.inDoc(a,i.document)&&!(domUtils.getPosition(s,a)&domUtils.POSITION_FOLLOWING))o=s.nextSibling,domUtils.remove(s),s=o;i.fireEvent("updateSections")}function l(e){for(var t=i.body,n=0;n<e.length;n++){if(!t.childNodes)return null;t=t.childNodes[e[n]]}return t}}},selectsection:{execCommand:function(e,t){if(!t&&!t.dom)return!1;var n=this,i=n.selection.getRange(),o={startAddress:utils.clone(t.startAddress,[]),endAddress:utils.clone(t.endAddress,[])};return o.endAddress[o.endAddress.length-1]++,i.moveToAddress(o).select().scrollToView(),!0},notNeedUndo:!0},scrolltosection:{execCommand:function(e,t){if(!t&&!t.dom)return!1;var n=this,i=n.selection.getRange(),o={startAddress:t.startAddress,endAddress:t.endAddress};return o.endAddress[o.endAddress.length-1]++,i.moveToAddress(o).scrollToView(),!0},notNeedUndo:!0}}}})),UE.plugin.register("simpleupload",(function(){var e,t=this,n=(+new Date).toString(36);function i(){var i=e.offsetWidth||20,o=e.offsetHeight||20,r="display:block;width:"+i+"px;height:"+o+"px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;",a=document.createElement("form"),s=document.createElement("input");a.id="edui_form_"+n,a.enctype="multipart/form-data",a.style=r,s.id="edui_input_"+n,s.type="file",s.accept="image/*",s.name=t.options.imageFieldName,s.style=r,a.appendChild(s),e.appendChild(a),s.addEventListener("change",(function(e){if(s.value){var n="loading_"+(+new Date).toString(36),i=t.getActionUrl(t.getOpt("imageActionName")),o=utils.serializeParam(t.queryCommandValue("serverparam"))||"",r=utils.formatUrl(i+(-1==i.indexOf("?")?"?":"&")+o),l=t.getOpt("imageAllowFiles");if(t.focus(),t.execCommand("inserthtml",'<img class="loadingclass" id="'+n+'" src="'+t.options.themePath+t.options.theme+'/images/spacer.gif" title="'+(t.getLang("simpleupload.loading")||"")+'" >'),t.getOpt("imageActionName")){var d=s.value,c=d?d.substr(d.lastIndexOf(".")):"";if(!c||l&&-1==(l.join("")+".").indexOf(c.toLowerCase()+"."))f(t.getLang("simpleupload.exceedTypeError"));else{var u=new XMLHttpRequest;if(u.open("post",r,!0),t.options.headers&&"[object Object]"===Object.prototype.toString.apply(t.options.headers))for(var m in t.options.headers)u.setRequestHeader(m,t.options.headers[m]);u.onload=function(){if(u.status>=200&&u.status<300||304==u.status){var e=JSON.parse(u.responseText),i=t.options.imageUrlPrefix+e.url;if("SUCCESS"==e.state&&e.url){var o=t.document.getElementById(n);console.log(o,0x3f28cb71571c7),o.setAttribute("src",i),o.setAttribute("_src",i),o.setAttribute("title",e.title||""),o.setAttribute("alt",e.original||""),o.removeAttribute("id"),domUtils.removeClasses(o,"loadingclass"),t.fireEvent("contentchange")}else f(e.state)}else f(t.getLang("simpleupload.loadError"))},u.onerror=function(){f(t.getLang("simpleupload.loadError"))},u.send(new FormData(a)),a.reset()}}else f(t.getLang("autoupload.errorLoadConfig"))}function f(e){if(n){var i=t.document.getElementById(n);i&&domUtils.remove(i),t.fireEvent("showmessage",{id:n,content:e,type:"error",timeout:4e3})}}}))}return{bindEvents:{ready:function(){utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(n,o){e=o,t.afterConfigReady(i)}},outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)}))}}})),UE.plugin.register("serverparam",(function(){var e={};return{commands:{serverparam:{execCommand:function(t,n,i){void 0===n||null===n?e={}:utils.isString(n)?void 0===i||null===i?delete e[n]:e[n]=i:utils.isObject(n)?utils.extend(e,n,!0):utils.isFunction(n)&&utils.extend(e,n(),!0)},queryCommandValue:function(){return e||{}}}}}})),UE.plugin.register("insertfile",(function(){var e=this;function t(e){var t=e.substr(e.lastIndexOf(".")+1).toLowerCase(),n={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif",chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"};return n[t]?n[t]:n["txt"]}return{commands:{insertfile:{execCommand:function(n,i){i=utils.isArray(i)?i:[i];var o,r,a,s,l="",d=e.getOpt("UEDITOR_HOME_URL"),c=d+("/"==d.substr(d.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(o=0;o<i.length;o++)r=i[o],a=c+t(r.url),s=r.title||r.url.substr(r.url.lastIndexOf("/")+1),l+='<p style="line-height: 16px;"><img style="vertical-align: middle; margin-right: 2px;" src="'+a+'" _src="'+a+'" /><a style="font-size:12px; color:#0066cc;" href="'+r.url+'" title="'+s+'">'+s+"</a></p>";e.execCommand("insertHtml",l)}}}}})),UE.plugins.xssFilter=function(){var e=UEDITOR_CONFIG,t=e.whitList;function n(e){var n=e.tagName,i=e.attrs;if(!t.hasOwnProperty(n))return e.parentNode.removeChild(e),!1;UE.utils.each(i,(function(i,o){-1===t[n].indexOf(o)&&e.setAttr(o)}))}t&&e.xssFilterRules&&(this.options.filterRules=function(){var e={};return UE.utils.each(t,(function(t,i){e[i]=function(e){return n(e)}})),e}());var i=[];UE.utils.each(t,(function(e,t){i.push(t)})),t&&e.inputXssFilter&&this.addInputRule((function(e){e.traversal((function(e){if("element"!==e.type)return!1;n(e)}))})),t&&e.outputXssFilter&&this.addOutputRule((function(e){e.traversal((function(e){if("element"!==e.type)return!1;n(e)}))}))};var baidu=baidu||{};baidu.editor=baidu.editor||{},UE.ui=baidu.editor.ui={},function(){var e=baidu.editor.browser,t=baidu.editor.dom.domUtils,n="$EDITORUI",i=window[n]={},o="ID"+n,r=0,a=baidu.editor.ui.uiUtils={uid:function(e){return e?e[o]||(e[o]=++r):++r},hook:function(e,t){var n;return e&&e._callbacks?n=e:(n=function(){var t;e&&(t=e.apply(this,arguments));var i=n._callbacks,o=i.length;while(o--){var r=i[o].apply(this,arguments);void 0===t&&(t=r)}return t},n._callbacks=[]),n._callbacks.push(t),n},createElementByHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,t=t.firstChild,t.parentNode.removeChild(t),t},getViewportElement:function(){return e.ie&&e.quirks?document.body:document.documentElement},getClientRect:function(e){var n;try{n=e.getBoundingClientRect()}catch(r){n={left:0,top:0,height:0,width:0}}var i,o={left:Math.round(n.left),top:Math.round(n.top),height:Math.round(n.bottom-n.top),width:Math.round(n.right-n.left)};while((i=e.ownerDocument)!==document&&(e=t.getWindow(i).frameElement))n=e.getBoundingClientRect(),o.left+=n.left,o.top+=n.top;return o.bottom=o.top+o.height,o.right=o.left+o.width,o},getViewportRect:function(){var e=a.getViewportElement(),t=0|(window.innerWidth||e.clientWidth),n=0|(window.innerHeight||e.clientHeight);return{left:0,top:0,height:n,width:t,bottom:n,right:t}},setViewportOffset:function(e,n){var i=a.getFixedLayer();e.parentNode===i?(e.style.left=n.left+"px",e.style.top=n.top+"px"):t.setViewportOffset(e,n)},getEventOffset:function(e){var t=e.target||e.srcElement,n=a.getClientRect(t),i=a.getViewportOffsetByEvent(e);return{left:i.left-n.left,top:i.top-n.top}},getViewportOffsetByEvent:function(e){var n=e.target||e.srcElement,i=t.getWindow(n).frameElement,o={left:e.clientX,top:e.clientY};if(i&&n.ownerDocument!==document){var r=a.getClientRect(i);o.left+=r.left,o.top+=r.top}return o},setGlobal:function(e,t){return i[e]=t,n+'["'+e+'"]'},unsetGlobal:function(e){delete i[e]},copyAttributes:function(n,i){var o=i.attributes,r=o.length;while(r--){var a=o[r];"style"==a.nodeName||"class"==a.nodeName||e.ie&&!a.specified||n.setAttribute(a.nodeName,a.nodeValue)}i.className&&t.addClass(n,i.className),i.style.cssText&&(n.style.cssText+=";"+i.style.cssText)},removeStyle:function(e,t){if(e.style.removeProperty)e.style.removeProperty(t);else{if(!e.style.removeAttribute)throw"";e.style.removeAttribute(t)}},contains:function(e,t){return e&&t&&e!==t&&(e.contains?e.contains(t):16&e.compareDocumentPosition(t))},startDrag:function(e,t,n){n=n||document;var i=e.clientX,o=e.clientY;function r(e){var n=e.clientX-i,r=e.clientY-o;t.ondragmove(n,r,e),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}if(n.addEventListener){var a=function e(i){n.removeEventListener("mousemove",r,!0),n.removeEventListener("mouseup",e,!0),window.removeEventListener("mouseup",e,!0),t.ondragstop()};n.addEventListener("mousemove",r,!0),n.addEventListener("mouseup",a,!0),window.addEventListener("mouseup",a,!0),e.preventDefault()}else{var s=function e(){l.releaseCapture(),l.detachEvent("onmousemove",r),l.detachEvent("onmouseup",e),l.detachEvent("onlosecaptrue",e),t.ondragstop()},l=e.srcElement;l.setCapture(),l.attachEvent("onmousemove",r),l.attachEvent("onmouseup",s),l.attachEvent("onlosecaptrue",s),e.returnValue=!1}t.ondragstart()},getFixedLayer:function(){var t=document.getElementById("edui_fixedlayer");return null==t&&(t=document.createElement("div"),t.id="edui_fixedlayer",document.body.appendChild(t),e.ie&&e.version<=8?(t.style.position="absolute",l(),setTimeout(s)):t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0"),t},makeUnselectable:function(t){if(e.opera||e.ie&&e.version<9){if(t.unselectable="on",t.hasChildNodes())for(var n=0;n<t.childNodes.length;n++)1==t.childNodes[n].nodeType&&a.makeUnselectable(t.childNodes[n])}else void 0!==t.style.MozUserSelect?t.style.MozUserSelect="none":void 0!==t.style.WebkitUserSelect?t.style.WebkitUserSelect="none":void 0!==t.style.KhtmlUserSelect&&(t.style.KhtmlUserSelect="none")}};function s(){var e=document.getElementById("edui_fixedlayer");a.setViewportOffset(e,{left:0,top:0})}function l(e){t.on(window,"scroll",s),t.on(window,"resize",baidu.editor.utils.defer(s,0,!0))}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.EventBase,i=baidu.editor.ui.UIBase=function(){};i.prototype={className:"",uiName:"",initOptions:function(e){var n=this;for(var i in e)n[i]=e[i];this.id=this.id||"edui"+t.uid()},initUIBase:function(){this._globalKey=e.unhtml(t.setGlobal(this.id,this))},render:function(e){for(var n,i=this.renderHtml(),o=t.createElementByHtml(i),r=domUtils.getElementsByTagName(o,"*"),a="edui-"+(this.theme||this.editor.options.theme),s=document.getElementById("edui_fixedlayer"),l=0;n=r[l++];)domUtils.addClass(n,a);domUtils.addClass(o,a),s&&(s.className="",domUtils.addClass(s,a));var d=this.getDom();null!=d?(d.parentNode.replaceChild(o,d),t.copyAttributes(o,d)):("string"==typeof e&&(e=document.getElementById(e)),e=e||t.getFixedLayer(),domUtils.addClass(e,a),e.appendChild(o)),this.postRender()},getDom:function(e){return e?document.getElementById(this.id+"_"+e):document.getElementById(this.id)},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(e){var t="edui-"+this.uiName;return e.replace(/##/g,this.id).replace(/%%-/g,this.uiName?t+"-":"").replace(/%%/g,(this.uiName?t:"")+" "+this.className).replace(/\$\$/g,this._globalKey)},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var e=this.getDom();e&&baidu.editor.dom.domUtils.remove(e),t.unsetGlobal(this.id)}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.Separator=function(e){this.initOptions(e),this.initSeparator()};n.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}},e.inherits(n,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.uiUtils,o=baidu.editor.ui.Mask=function(e){this.initOptions(e),this.initUIBase()};o.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onclick="return $$._onClick(event, this);" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var e=this;t.on(window,"resize",(function(){setTimeout((function(){e.isHidden()||e._fill()}))}))},show:function(e){this._fill(),this.getDom().style.display="",this.getDom().style.zIndex=e},hide:function(){this.getDom().style.display="none",this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(e,t){this.fireEvent("click",e,t)},_fill:function(){var e=this.getDom(),t=i.getViewportRect();e.style.width=t.width+"px",e.style.height=t.height+"px"}},e.inherits(o,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.dom.domUtils,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.Popup=function(e){this.initOptions(e),this.initPopup()},r=[];function a(e,t){for(var n=0;n<r.length;n++){var i=r[n];if(!i.isHidden()&&!1!==i.queryAutoHide(t)){if(e&&/scroll/gi.test(e.type)&&"edui-wordpastepop"==i.className)return;i.hide()}}r.length&&i.editor.fireEvent("afterhidepop")}o.postHide=a;var s=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];o.prototype={SHADOW_RADIUS:5,content:null,_hidden:!1,autoRender:!0,canSideLeft:!0,canSideUp:!0,initPopup:function(){this.initUIBase(),r.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%" onmousedown="return false;"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+this.getContentHtmlTpl()+" </div> </div></div>"},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:i.prototype.postRender,postRender:function(){if(this.content instanceof i&&this.content.postRender(),this.captureWheel&&!this.captured){this.captured=!0;var e=(document.documentElement.clientHeight||document.body.clientHeight)-80,o=this.getDom().offsetHeight,r=t.getClientRect(this.combox.getDom()).top,a=this.getDom("content"),s=this.getDom("body").getElementsByTagName("iframe"),l=this;s.length&&(s=s[0]);while(r+o>e)o-=30;a.style.height=o+"px",s&&(s.style.height=o+"px"),window.XMLHttpRequest?n.on(a,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,e.wheelDelta?a.scrollTop-=e.wheelDelta/120*60:a.scrollTop-=e.detail/-3*60})):n.on(this.getDom(),"mousewheel",(function(e){e.returnValue=!1,l.getDom("content").scrollTop-=e.wheelDelta/120*60}))}this.fireEvent("postRenderAfter"),this.hide(!0),this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var e=this.getDom("content");return t.getClientRect(e)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var e=this.getDom("body");e.style.width="",e.style.height="";var t=this.mesureSize();if(this.captureWheel){e.style.width=-(-20-t.width)+"px";var n=parseInt(this.getDom("content").style.height,10);!window.isNaN(n)&&(t.height=n)}else e.style.width=t.width+"px";return e.style.height=t.height+"px",this.__size=t,this.captureWheel&&(this.getDom("content").style.overflow="auto"),t},showAnchor:function(e,n){this.showAnchorRect(t.getClientRect(e),n)},showAnchorRect:function(e,i,o){this._doAutoRender();var r=t.getViewportRect();this.getDom().style.visibility="hidden",this._show();var a,l,d,c,u=this.fitSize();i?(a=this.canSideLeft&&e.right+u.width>r.right&&e.left>u.width,l=this.canSideUp&&e.top+u.height>r.bottom&&e.bottom>u.height,d=a?e.left-u.width:e.right,c=l?e.bottom-u.height:e.top):(a=this.canSideLeft&&e.right+u.width>r.right&&e.left>u.width,l=this.canSideUp&&e.top+u.height>r.bottom&&e.bottom>u.height,d=a?e.right-u.width:e.left,c=l?e.top-u.height:e.bottom);var m=this.getDom();t.setViewportOffset(m,{left:d,top:c}),n.removeClasses(m,s),m.className+=" "+s[2*(l?1:0)+(a?1:0)],this.editor&&(m.style.zIndex=1*this.editor.container.style.zIndex+10,baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=m.style.zIndex-1),this.getDom().style.visibility="visible"},showAt:function(e){var t=e.left,n=e.top,i={left:t,top:n,right:t,bottom:n,height:0,width:0};this.showAnchorRect(i,!1,!0)},_show:function(){if(this._hidden){var e=this.getDom();e.style.display="",this._hidden=!1,this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender(),this._show()},hide:function(e){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,e||this.fireEvent("hide"))},queryAutoHide:function(e){return!e||!t.contains(this.getDom(),e)}},e.inherits(o,i),n.on(document,"mousedown",(function(e){var t=e.target||e.srcElement;a(e,t)})),n.on(window,"scroll",(function(e,t){a(e,t)}))}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.ColorPicker=function(e){this.initOptions(e),this.noColorText=this.noColorText||this.editor.getLang("clearColor"),this.initUIBase()};n.prototype={getHtmlTpl:function(){return o(this.noColorText,this.editor)},_onTableClick:function(e){var t=e.target||e.srcElement,n=t.getAttribute("data-color");n&&this.fireEvent("pickcolor",n)},_onTableOver:function(e){var t=e.target||e.srcElement,n=t.getAttribute("data-color");n&&(this.getDom("preview").style.backgroundColor=n)},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}},e.inherits(n,t);var i="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(",");function o(e,t){for(var n='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+e+'</div></div><table class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;padding-top: 2px"><td colspan="10">'+t.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >',o=0;o<i.length;o++)o&&o%10===0&&(n+="</tr>"+(60==o?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+t.getLang("standardColor")+"</td></tr>":"")+"<tr"+(60==o?' class="edui-colorpicker-tablefirstrow"':"")+">"),n+=o<70?'<td style="padding: 0 2px;"><a hidefocus title="'+i[o]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+i[o]+'" style="background-color:#'+i[o]+";border:solid #ccc;"+(o<10||o>=60?"border-width:1px;":o>=10&&o<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return n+="</tr></table></div>",n}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.TablePicker=function(e){this.initOptions(e),this.initTablePicker()};i.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'},_UIBase_render:n.prototype.render,render:function(e){this._UIBase_render(e),this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(e,t){var n=this.getDom("overlay").style,i=this.lengthOfCellSide;n.width=e*i+"px",n.height=t*i+"px";var o=this.getDom("label");o.innerHTML=e+this.editor.getLang("t_col")+" x "+t+this.editor.getLang("t_row"),this.numCols=e,this.numRows=t},_onMouseOver:function(e,n){var i=e.relatedTarget||e.fromElement;t.contains(n,i)||n===i||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(e,n){var i=e.relatedTarget||e.toElement;t.contains(n,i)||n===i||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(e,n){this.getDom("overlay").style;var i=t.getEventOffset(e),o=this.lengthOfCellSide,r=Math.ceil(i.left/o),a=Math.ceil(i.top/o);this._track(r,a)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}},e.inherits(i,n)}(),function(){var e=baidu.editor.browser,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.uiUtils,i='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(e.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');baidu.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl,this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var e=this._Stateful_dGetHtmlTpl();return e.replace(/stateful/g,(function(){return i}))},Stateful_onMouseEnter:function(e,t){this.target=t,this.isDisabled()&&!this.alwalysHoverable||(this.addState("hover"),this.fireEvent("over"))},Stateful_onMouseLeave:function(e,t){this.isDisabled()&&!this.alwalysHoverable||(this.removeState("hover"),this.removeState("active"),this.fireEvent("out"))},Stateful_onMouseOver:function(e,t){var i=e.relatedTarget;n.contains(t,i)||t===i||this.Stateful_onMouseEnter(e,t)},Stateful_onMouseOut:function(e,t){var i=e.relatedTarget;n.contains(t,i)||t===i||this.Stateful_onMouseLeave(e,t)},Stateful_onMouseDown:function(e,t){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(e,t){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&this.addState("disabled")},hasState:function(e){return t.hasClass(this.getStateDom(),"edui-state-"+e)},addState:function(e){this.hasState(e)||(this.getStateDom().className+=" edui-state-"+e)},removeState:function(e){this.hasState(e)&&t.removeClasses(this.getStateDom(),["edui-state-"+e])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(e){!this.isDisabled()&&e?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(e){e?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.Stateful,i=baidu.editor.ui.Button=function(e){if(e.name){var t=e.name,n=e.cssRules;e.className||(e.className="edui-for-"+t),e.cssRules=".edui-default .edui-for-"+t+" .edui-icon {"+n+"}"}this.initOptions(e),this.initButton()};i.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase(),this.Stateful_init(),this.cssRules&&e.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+(this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return $$._onMouseDown(event, this);" onclick="return $$._onClick(event, this);">'+(this.showIcon?'<div class="edui-box edui-icon"></div>':"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender(),this.setDisabled(this.disabled)},_onMouseDown:function(e){var t=e.target||e.srcElement,n=t&&t.tagName&&t.tagName.toLowerCase();if("input"==n||"object"==n||"object"==n)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(e){var t=this.getDom("label");t.innerHTML=e}},e.inherits(i,t),e.extend(i.prototype,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=(baidu.editor.dom.domUtils,baidu.editor.ui.UIBase),i=baidu.editor.ui.Stateful,o=baidu.editor.ui.SplitButton=function(e){this.initOptions(e),this.initSplitButton()};o.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase(),this.Stateful_init();if(null!=this.popup){var e=this.popup;this.popup=null,this.setPopup(e)}},_UIBase_postRender:n.prototype.postRender,postRender:function(){this.Stateful_postRender(),this._UIBase_postRender()},setPopup:function(n){this.popup!==n&&(null!=this.popup&&this.popup.dispose(),n.addListener("show",e.bind(this._onPopupShow,this)),n.addListener("hide",e.bind(this._onPopupHide,this)),n.addListener("postrender",e.bind((function(){n.getDom("body").appendChild(t.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(t.getClientRect(this.getDom()).width+20)+'px"></div>')),n.getDom().className+=" "+this.className}),this)),this.popup=n)},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var e=t.getClientRect(this.getDom());e.top-=this.popup.SHADOW_RADIUS,e.height+=this.popup.SHADOW_RADIUS,this.popup.showAnchorRect(e)},_onArrowClick:function(e,t){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}},e.inherits(o,n),e.extend(o.prototype,i,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.ColorPicker,i=baidu.editor.ui.Popup,o=baidu.editor.ui.SplitButton,r=baidu.editor.ui.ColorButton=function(e){this.initOptions(e),this.initColorButton()};r.prototype={initColorButton:function(){var e=this;this.popup=new i({content:new n({noColorText:e.editor.getLang("clearColor"),editor:e.editor,onpickcolor:function(t,n){e._onPickColor(n)},onpicknocolor:function(t,n){e._onPickNoColor(n)}}),editor:e.editor}),this.initSplitButton()},_SplitButton_postRender:o.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.getDom("button_body").appendChild(t.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>')),this.getDom().className+=" edui-colorbutton"},setColor:function(e){this.getDom("colorlump").style.backgroundColor=e,this.color=e},_onPickColor:function(e){!1!==this.fireEvent("pickcolor",e)&&(this.setColor(e),this.popup.hide())},_onPickNoColor:function(e){!1!==this.fireEvent("picknocolor")&&this.popup.hide()}},e.inherits(r,o)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.TablePicker,i=baidu.editor.ui.SplitButton,o=baidu.editor.ui.TableButton=function(e){this.initOptions(e),this.initTableButton()};o.prototype={initTableButton:function(){var e=this;this.popup=new t({content:new n({editor:e.editor,onpicktable:function(t,n,i){e._onPickTable(n,i)}}),editor:e.editor}),this.initSplitButton()},_onPickTable:function(e,t){!1!==this.fireEvent("picktable",e,t)&&this.popup.hide()}},e.inherits(o,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.AutoTypeSetPicker=function(e){this.initOptions(e),this.initAutoTypeSetPicker()};n.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this.editor,t=e.options.autotypeset,n=e.getLang("autoTypeSet"),i="textAlignValue"+e.uid,o="imageBlockLineValue"+e.uid,r="symbolConverValue"+e.uid;return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap><input type="checkbox" name="mergeEmptyline" '+(t["mergeEmptyline"]?"checked":"")+">"+n.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(t["removeEmptyline"]?"checked":"")+">"+n.delLine+'</td></tr><tr><td nowrap><input type="checkbox" name="removeClass" '+(t["removeClass"]?"checked":"")+">"+n.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(t["indent"]?"checked":"")+">"+n.indent+'</td></tr><tr><td nowrap><input type="checkbox" name="textAlign" '+(t["textAlign"]?"checked":"")+">"+n.alignment+'</td><td colspan="2" id="'+i+'"><input type="radio" name="'+i+'" value="left" '+(t["textAlign"]&&"left"==t["textAlign"]?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="'+i+'" value="center" '+(t["textAlign"]&&"center"==t["textAlign"]?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="'+i+'" value="right" '+(t["textAlign"]&&"right"==t["textAlign"]?"checked":"")+">"+e.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="imageBlockLine" '+(t["imageBlockLine"]?"checked":"")+">"+n.imageFloat+'</td><td nowrap id="'+o+'"><input type="radio" name="'+o+'" value="none" '+(t["imageBlockLine"]&&"none"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("default")+'<input type="radio" name="'+o+'" value="left" '+(t["imageBlockLine"]&&"left"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="'+o+'" value="center" '+(t["imageBlockLine"]&&"center"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="'+o+'" value="right" '+(t["imageBlockLine"]&&"right"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="clearFontSize" '+(t["clearFontSize"]?"checked":"")+">"+n.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(t["clearFontFamily"]?"checked":"")+">"+n.removeFontFamily+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="removeEmptyNode" '+(t["removeEmptyNode"]?"checked":"")+">"+n.removeHtml+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="pasteFilter" '+(t["pasteFilter"]?"checked":"")+">"+n.pasteFilter+'</td></tr><tr><td nowrap><input type="checkbox" name="symbolConver" '+(t["bdc2sb"]||t["tobdc"]?"checked":"")+">"+n.symbol+'</td><td id="'+r+'"><input type="radio" name="bdc" value="bdc2sb" '+(t["bdc2sb"]?"checked":"")+">"+n.bdc2sb+'<input type="radio" name="bdc" value="tobdc" '+(t["tobdc"]?"checked":"")+">"+n.tobdc+'</td><td nowrap align="right"><button >'+n.run+"</button></td></tr></table></div></div>"},_UIBase_render:t.prototype.render},e.inherits(n,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.AutoTypeSetPicker,i=baidu.editor.ui.SplitButton,o=baidu.editor.ui.AutoTypeSetButton=function(e){this.initOptions(e),this.initAutoTypeSetButton()};function r(t){for(var n,i={},o=t.getDom(),r=t.editor.uid,a=null,s=null,l=domUtils.getElementsByTagName(o,"input"),d=l.length-1;n=l[d--];)if(a=n.getAttribute("type"),"checkbox"==a)if(s=n.getAttribute("name"),i[s]&&delete i[s],n.checked){var c=document.getElementById(s+"Value"+r);if(c){if(/input/gi.test(c.tagName))i[s]=c.value;else for(var u,m=c.getElementsByTagName("input"),f=m.length-1;u=m[f--];)if(u.checked){i[s]=u.value;break}}else i[s]=!0}else i[s]=!1;else i[n.getAttribute("value")]=n.checked;var h,p=domUtils.getElementsByTagName(o,"select");for(d=0;h=p[d++];){var g=h.getAttribute("name");i[g]=i[g]?h.value:""}e.extend(t.editor.options.autotypeset,i),t.editor.setPreferences("autotypeset",i)}o.prototype={initAutoTypeSetButton:function(){var e=this;this.popup=new t({content:new n({editor:e.editor}),editor:e.editor,hide:function(){!this._hidden&&this.getDom()&&(r(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var i=0;this.popup.addListener("postRenderAfter",(function(){var t=this;if(!i){var n=this.getDom(),o=n.getElementsByTagName("button")[0];o.onclick=function(){r(t),e.editor.execCommand("autotypeset"),t.hide()},domUtils.on(n,"click",(function(n){var i=n.target||n.srcElement,o=e.editor.uid;if(i&&"INPUT"==i.tagName){if("imageBlockLine"==i.name||"textAlign"==i.name||"symbolConver"==i.name)for(var a=i.checked,s=document.getElementById(i.name+"Value"+o),l=s.getElementsByTagName("input"),d={imageBlockLine:"none",textAlign:"left",symbolConver:"tobdc"},c=0;c<l.length;c++)a?l[c].value==d[i.name]&&(l[c].checked="checked"):l[c].checked=!1;if(i.name=="imageBlockLineValue"+o||i.name=="textAlignValue"+o||"bdc"==i.name){var u=i.parentNode.previousSibling.getElementsByTagName("input");u&&(u[0].checked=!0)}r(t)}})),i=1}})),this.initSplitButton()}},e.inherits(o,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.Stateful,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.CellAlignPicker=function(e){this.initOptions(e),this.initSelected(),this.initCellAlignPicker()};o.prototype={initSelected:function(){var e={valign:{top:0,middle:1,bottom:2},align:{left:0,center:1,right:2},count:3};this.selected&&(this.selectedIndex=e.valign[this.selected.valign]*e.count+e.align[this.selected.align])},initCellAlignPicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){for(var e=["left","center","right"],t=9,n=null,i=-1,o=[],r=0;r<t;r++)n=this.selectedIndex===r?' class="edui-cellalign-selected" ':"",i=r%3,0===i&&o.push("<tr>"),o.push('<td index="'+r+'" '+n+' stateful><div class="edui-icon edui-'+e[i]+'"></div></td>'),2===i&&o.push("</tr>");return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);">'+o.join("")+"</table></div></div>"},getStateDom:function(){return this.target},_onClick:function(e){var n=e.target||e.srcElement;/icon/.test(n.className)&&(this.items[n.parentNode.getAttribute("index")].onclick(),t.postHide(e))},_UIBase_render:i.prototype.render},e.inherits(o,i),e.extend(o.prototype,n,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Stateful,n=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.PastePicker=function(e){this.initOptions(e),this.initPastePicker()};o.prototype={initPastePicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){return'<div class="edui-pasteicon" onclick="$$._onClick(this)"></div><div class="edui-pastecontainer"><div class="edui-title">'+this.editor.getLang("pasteOpt")+'</div><div class="edui-button"><div title="'+this.editor.getLang("pasteSourceFormat")+'" onclick="$$.format(false)" stateful><div class="edui-richtxticon"></div></div><div title="'+this.editor.getLang("tagFormat")+'" onclick="$$.format(2)" stateful><div class="edui-tagicon"></div></div><div title="'+this.editor.getLang("pasteTextFormat")+'" onclick="$$.format(true)" stateful><div class="edui-plaintxticon"></div></div></div></div></div>'},getStateDom:function(){return this.target},format:function(e){this.editor.ui._isTransfer=!0,this.editor.fireEvent("pasteTransfer",e)},_onClick:function(e){var t=domUtils.getNextDomNode(e),i=n.getViewportRect().height,o=n.getClientRect(t);o.top+o.height>i?t.style.top=-o.height-e.offsetHeight+"px":t.style.top="",/hidden/gi.test(domUtils.getComputedStyle(t,"visibility"))?(t.style.visibility="visible",domUtils.addClass(e,"edui-state-opened")):(t.style.visibility="hidden",domUtils.removeClasses(e,"edui-state-opened"))},_UIBase_render:i.prototype.render},e.inherits(o,i),e.extend(o.prototype,t,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.Toolbar=function(e){this.initOptions(e),this.initToolbar()};i.prototype={items:null,initToolbar:function(){this.items=this.items||[],this.initUIBase()},add:function(e,t){void 0===t?this.items.push(e):this.items.splice(t,0,e)},getHtmlTpl:function(){for(var e=[],t=0;t<this.items.length;t++)e[t]=this.items[t].renderHtml();return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+e.join("")+"</div>"},postRender:function(){for(var e=this.getDom(),n=0;n<this.items.length;n++)this.items[n].postRender();t.makeUnselectable(e)},_onMouseDown:function(e){var t=e.target||e.srcElement,n=t&&t.tagName&&t.tagName.toLowerCase();if("input"==n||"object"==n||"object"==n)return!1}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.Popup,r=baidu.editor.ui.Stateful,a=baidu.editor.ui.CellAlignPicker,s=baidu.editor.ui.Menu=function(e){this.initOptions(e),this.initMenu()},l={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'},postRender:function(){},queryAutoHide:function(){return!0}};s.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[],this.initPopup(),this.initItems()},initItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];"-"==t?this.items[e]=this.getSeparator():t instanceof d||(t.editor=this.editor,t.theme=this.editor.options.theme,this.items[e]=this.createItem(t))}},getSeparator:function(){return l},createItem:function(e){return e.menu=this,new d(e)},_Popup_getContentHtmlTpl:o.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(0==this.items.length)return this._Popup_getContentHtmlTpl();for(var e=[],t=0;t<this.items.length;t++){var n=this.items[t];e[t]=n.renderHtml()}return'<div class="%%-body">'+e.join("")+"</div>"},_Popup_postRender:o.prototype.postRender,postRender:function(){for(var e=this,i=0;i<this.items.length;i++){var o=this.items[i];o.ownerMenu=this,o.postRender()}t.on(this.getDom(),"mouseover",(function(t){t=t||event;var i=t.relatedTarget||t.fromElement,o=e.getDom();n.contains(o,i)||o===i||e.fireEvent("over")})),this._Popup_postRender()},queryAutoHide:function(e){if(e){if(n.contains(this.getDom(),e))return!1;for(var t=0;t<this.items.length;t++){var i=this.items[t];if(!1===i.queryAutoHide(e))return!1}}},clearItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];clearTimeout(t._showingTimer),clearTimeout(t._closingTimer),t.subMenu&&t.subMenu.destroy()}this.items=[]},destroy:function(){this.getDom()&&t.remove(this.getDom()),this.clearItems()},dispose:function(){this.destroy()}},e.inherits(s,o);var d=baidu.editor.ui.MenuItem=function(e){if(this.initOptions(e),this.initUIBase(),this.Stateful_init(),this.subMenu&&!(this.subMenu instanceof s))if(e.className&&-1!=e.className.indexOf("aligntd")){var n=this;this.subMenu.selected=this.editor.queryCommandValue("cellalignment"),this.subMenu=new o({content:new a(this.subMenu),parentMenu:n,editor:n.editor,destroy:function(){this.getDom()&&t.remove(this.getDom())}}),this.subMenu.addListener("postRenderAfter",(function(){t.on(this.getDom(),"mouseover",(function(){n.addState("opened")}))}))}else this.subMenu=new s(this.subMenu)};d.prototype={label:"",subMenu:null,ownerMenu:null,uiName:"menuitem",alwalysHoverable:!0,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var e=this;this.addListener("over",(function(){e.ownerMenu.fireEvent("submenuover",e),e.subMenu&&e.delayShowSubMenu()})),this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",(function(){e.delayHideSubMenu()})),this.subMenu.addListener("over",(function(){clearTimeout(e._closingTimer),e._closingTimer=null,e.addState("opened")})),this.ownerMenu.addListener("hide",(function(){e.hideSubMenu()})),this.ownerMenu.addListener("submenuover",(function(t,n){n!==e&&e.delayHideSubMenu()})),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(t){return(!t||!n.contains(e.getDom(),t))&&this._bakQueryAutoHide(t)}),this.getDom().style.tabIndex="-1",n.makeUnselectable(this.getDom()),this.Stateful_postRender()},delayShowSubMenu:function(){var e=this;e.isDisabled()||(e.addState("opened"),clearTimeout(e._showingTimer),clearTimeout(e._closingTimer),e._closingTimer=null,e._showingTimer=setTimeout((function(){e.showSubMenu()}),250))},delayHideSubMenu:function(){var e=this;e.isDisabled()||(e.removeState("opened"),clearTimeout(e._showingTimer),e._closingTimer||(e._closingTimer=setTimeout((function(){e.hasState("opened")||e.hideSubMenu(),e._closingTimer=null}),400)))},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+(this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(e){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(e)},_onClick:function(e,t){this.hasState("disabled")||!1!==this.fireEvent("click",e,t)&&(this.subMenu?this.showSubMenu():o.postHide(e))},showSubMenu:function(){var e=n.getClientRect(this.getDom());e.right-=5,e.left+=2,e.width-=7,e.top-=4,e.bottom+=4,e.height+=8,this.subMenu.showAnchorRect(e,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}},e.inherits(d,i),e.extend(d.prototype,r,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.Menu,i=baidu.editor.ui.SplitButton,o=baidu.editor.ui.Combox=function(e){this.initOptions(e),this.initCombox()};o.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var e=this;this.items=this.items||[];for(var t=0;t<this.items.length;t++){var i=this.items[t];i.uiName="listitem",i.index=t,i.onclick=function(){e.selectByIndex(this.index)}}this.popup=new n({items:this.items,uiName:"list",editor:this.editor,captureWheel:!0,combox:this}),this.initSplitButton()},_SplitButton_postRender:i.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.setLabel(this.label||""),this.setValue(this.initValue||"")},showPopup:function(){var e=t.getClientRect(this.getDom());e.top+=1,e.bottom-=1,e.height-=2,this.popup.showAnchorRect(e)},getValue:function(){return this.value},setValue:function(e){var t=this.indexByValue(e);-1!=t?(this.selectedIndex=t,this.setLabel(this.items[t].label),this.value=this.items[t].value):(this.selectedIndex=-1,this.setLabel(this.getLabelForUnknowValue(e)),this.value=e)},setLabel:function(e){this.getDom("button_body").innerHTML=e,this.label=e},getLabelForUnknowValue:function(e){return e},indexByValue:function(e){for(var t=0;t<this.items.length;t++)if(e==this.items[t].value)return t;return-1},getItem:function(e){return this.items[e]},selectByIndex:function(e){e<this.items.length&&!1!==this.fireEvent("select",e)&&(this.selectedIndex=e,this.value=this.items[e].value,this.setLabel(this.items[e].label))}},e.inherits(o,i)}(),function(){var e,t,n,i=baidu.editor.utils,o=baidu.editor.dom.domUtils,r=baidu.editor.ui.uiUtils,a=baidu.editor.ui.Mask,s=baidu.editor.ui.UIBase,l=baidu.editor.ui.Button,d=baidu.editor.ui.Dialog=function(e){if(e.name){var t=e.name,n=e.cssRules;e.className||(e.className="edui-for-"+t),n&&(e.cssRules=".edui-default .edui-for-"+t+" .edui-dialog-content {"+n+"}")}this.initOptions(i.extend({autoReset:!0,draggable:!0,onok:function(){},oncancel:function(){},onclose:function(e,t){return t?this.onok():this.oncancel()},holdScroll:!1},e)),this.initDialog()};d.prototype={draggable:!1,uiName:"dialog",initDialog:function(){var o=this,r=this.editor.options.theme;if(this.cssRules&&i.cssRule("edui-customize-"+this.name+"-style",this.cssRules),this.initUIBase(),this.modalMask=e||(e=new a({className:"edui-dialog-modalmask",theme:r,onclick:function(){n&&n.close(!1)}})),this.dragMask=t||(t=new a({className:"edui-dialog-dragmask",theme:r})),this.closeButton=new l({className:"edui-dialog-closebutton",title:o.closeDialog,theme:r,onclick:function(){o.close(!1)}}),this.fullscreen&&this.initResizeEvent(),this.buttons)for(var s=0;s<this.buttons.length;s++)this.buttons[s]instanceof l||(this.buttons[s]=new l(i.extend(this.buttons[s],{editor:this.editor},!0)))},initResizeEvent:function(){var e=this;o.on(window,"resize",(function(){e._hidden||void 0===e._hidden||(e.__resizeTimer&&window.clearTimeout(e.__resizeTimer),e.__resizeTimer=window.setTimeout((function(){e.__resizeTimer=null;var t=e.getDom(),n=e.getDom("content"),i=UE.ui.uiUtils.getClientRect(t),o=UE.ui.uiUtils.getClientRect(n),a=r.getViewportRect();n.style.width=a.width-i.width+o.width+"px",n.style.height=a.height-i.height+o.height+"px",t.style.width=a.width+"px",t.style.height=a.height+"px",e.fireEvent("resize")}),100))}))},fitSize:function(){var e=this.getDom("body"),t=this.mesureSize();return e.style.width=t.width+"px",e.style.height=t.height+"px",t},safeSetOffset:function(e){var t=this,n=t.getDom(),i=r.getViewportRect(),o=r.getClientRect(n),a=e.left;a+o.width>i.right&&(a=i.right-o.width);var s=e.top;s+o.height>i.bottom&&(s=i.bottom-o.height),n.style.left=Math.max(a,0)+"px",n.style.top=Math.max(s,0)+"px"},showAtCenter:function(){var e=r.getViewportRect();if(this.fullscreen){var t=this.getDom(),n=this.getDom("content");t.style.display="block";var i=UE.ui.uiUtils.getClientRect(t),a=UE.ui.uiUtils.getClientRect(n);t.style.left="-100000px",n.style.width=e.width-i.width+a.width+"px",n.style.height=e.height-i.height+a.height+"px",t.style.width=e.width+"px",t.style.height=e.height+"px",t.style.left=0,this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}},document.documentElement.style.overflowX="hidden",document.documentElement.style.overflowY="hidden",document.body.style.overflowX="hidden",document.body.style.overflowY="hidden"}else{this.getDom().style.display="";var s=this.fitSize(),l=0|this.getDom("titlebar").offsetHeight,d=e.width/2-s.width/2,c=e.height/2-(s.height-l)/2-l,u=this.getDom();this.safeSetOffset({left:Math.max(0|d,0),top:Math.max(0|c,0)}),o.hasClass(u,"edui-state-centered")||(u.className+=" edui-state-centered")}this._show()},getContentHtml:function(){var e="";return"string"==typeof this.content?e=this.content:this.iframeUrl&&(e='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>'),e},getHtmlTpl:function(){var e="";if(this.buttons){for(var t=[],n=0;n<this.buttons.length;n++)t[n]=this.buttons[n].renderHtml();e='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+t.join("")+"</div></div>"}return'<div id="##" class="%%"><div '+(this.fullscreen?'class="%%-wrap edui-dialog-fullscreen-flag"':'class="%%"')+'><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+(this.autoReset?"":this.getContentHtml())+"</div>"+e+"</div></div></div>"},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide()),this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var e=this;if(this.addListener("show",(function(){e.modalMask.show(this.getDom().style.zIndex-2)})),this.addListener("hide",(function(){e.modalMask.hide()})),this.buttons)for(var t=0;t<this.buttons.length;t++)this.buttons[t].postRender();o.on(window,"resize",(function(){setTimeout((function(){e.isHidden()||e.safeSetOffset(r.getClientRect(e.getDom()))}))})),this._hide()},mesureSize:function(){var e=this.getDom("body"),t=r.getClientRect(this.getDom("content")).width,n=e.style;return n.width=t,r.getClientRect(e)},_onTitlebarMouseDown:function(e,t){if(this.draggable){r.getViewportRect();var n,i=this;r.startDrag(e,{ondragstart:function(){n=r.getClientRect(i.getDom()),i.getDom("contmask").style.visibility="visible",i.dragMask.show(i.getDom().style.zIndex-1)},ondragmove:function(e,t){var o=n.left+e,r=n.top+t;i.safeSetOffset({left:o,top:r})},ondragstop:function(){i.getDom("contmask").style.visibility="hidden",o.removeClasses(i.getDom(),["edui-state-centered"]),i.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml(),this.fireEvent("dialogafterreset")},_show:function(){this._hidden&&(this.getDom().style.display="",this.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*this.editor.container.style.zIndex+10),this._hidden=!1,this.fireEvent("show"),baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4)},isHidden:function(){return this._hidden},_hide:function(){if(!this._hidden){var e=this.getDom();e.style.display="none",e.style.zIndex="",e.style.width="",e.style.height="",this._hidden=!0,this.fireEvent("hide")}},open:function(){if(this.autoReset)try{this.reset()}catch(e){this.render(),this.open()}if(this.showAtCenter(),this.iframeUrl)try{this.getDom("iframe").focus()}catch(t){}n=this},_onCloseButtonClick:function(e,t){this.close(!1)},close:function(e){if(!1!==this.fireEvent("close",e)){this.fullscreen&&(document.documentElement.style.overflowX=this._originalContext.html.overflowX,document.documentElement.style.overflowY=this._originalContext.html.overflowY,document.body.style.overflowX=this._originalContext.body.overflowX,document.body.style.overflowY=this._originalContext.body.overflowY,delete this._originalContext),this._hide();var t=this.getDom("content"),n=this.getDom("iframe");if(t&&n){var i=n.contentDocument||n.contentWindow.document;i&&(i.body.innerHTML=""),o.remove(t)}}}},i.inherits(d,s)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Menu,n=baidu.editor.ui.SplitButton,i=baidu.editor.ui.MenuButton=function(e){this.initOptions(e),this.initMenuButton()};i.prototype={initMenuButton:function(){var e=this;this.uiName="menubutton",this.popup=new t({items:e.items,className:e.className,editor:e.editor}),this.popup.addListener("show",(function(){for(var t=this,n=0;n<t.items.length;n++)t.items[n].removeState("checked"),t.items[n].value==e._value&&(t.items[n].addState("checked"),this.value=e._value)})),this.initSplitButton()},setValue:function(e){this._value=e}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.SplitButton,i=baidu.editor.ui.MultiMenuPop=function(e){this.initOptions(e),this.initMultiMenu()};i.prototype={initMultiMenu:function(){var e=this;this.popup=new t({content:"",editor:e.editor,iframe_rendered:!1,onshow:function(){this.iframe_rendered||(this.iframe_rendered=!0,this.getDom("content").innerHTML='<iframe id="'+e.id+'_iframe" src="'+e.iframeUrl+'" frameborder="0"></iframe>',e.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*e.editor.container.style.zIndex+1))}}),this.onbuttonclick=function(){this.showPopup()},this.initSplitButton()}},e.inherits(i,n)}(),function(){var e,t=baidu.editor.ui,n=t.UIBase,i=t.uiUtils,o=baidu.editor.utils,r=baidu.editor.dom.domUtils,a=[],s=!1,l=t.ShortCutMenu=function(e){this.initOptions(e),this.initShortCutMenu()};function d(e){var t=e.target||e.srcElement,n=r.findParent(t,(function(e){return r.hasClass(e,"edui-shortcutmenu")||r.hasClass(e,"edui-popup")}),!0);if(!n)for(var i,o=0;i=a[o++];)i.hide()}l.postHide=d,l.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[],this.initUIBase(),this.initItems(),this.initEvent(),a.push(this)},initEvent:function(){var t=this,n=t.editor.document;r.on(n,"mousemove",(function(n){if(!1===t.isHidden){if(t.getSubMenuMark()||"contextmenu"==t.eventType)return;var i=!0,o=t.getDom(),r=o.offsetWidth,a=o.offsetHeight,s=r/2+t.SPACE,l=a/2,d=Math.abs(n.screenX-t.left),c=Math.abs(n.screenY-t.top);clearTimeout(e),e=setTimeout((function(){c>0&&c<l?t.setOpacity(o,"1"):c>l&&c<l+70?(t.setOpacity(o,"0.5"),i=!1):c>l+70&&c<l+140&&t.hide(),i&&d>0&&d<s?t.setOpacity(o,"1"):d>s&&d<s+70?t.setOpacity(o,"0.5"):d>s+70&&d<s+140&&t.hide()}))}})),browser.chrome&&r.on(n,"mouseout",(function(e){var n=e.relatedTarget||e.toElement;null!=n&&"HTML"!=n.tagName||t.hide()})),t.editor.addListener("afterhidepop",(function(){t.isHidden||(s=!0)}))},initItems:function(){if(o.isArray(this.items))for(var e=0,n=this.items.length;e<n;e++){var i=this.items[e].toLowerCase();t[i]&&(this.items[e]=new t[i](this.editor),this.items[e].className+=" edui-shortcutsubmenu ")}},setOpacity:function(e,t){browser.ie&&browser.version<9?e.style.filter="alpha(opacity = "+100*parseFloat(t)+");":e.style.opacity=t},getSubMenuMark:function(){s=!1;for(var e,t=i.getFixedLayer(),n=r.getElementsByTagName(t,"div",(function(e){return r.hasClass(e,"edui-shortcutsubmenu edui-popup")})),o=0;e=n[o++];)"none"!=e.style.display&&(s=!0);return s},show:function(e,t){var n=this,o={},a=this.getDom(),s=i.getFixedLayer();function l(e){e.left<0&&(e.left=0),e.top<0&&(e.top=0),a.style.cssText="position:absolute;left:"+e.left+"px;top:"+e.top+"px;"}function d(e){e.tagName||(e=e.getDom()),o.left=parseInt(e.style.left),o.top=parseInt(e.style.top),o.top-=a.offsetHeight+15,l(o)}if(n.eventType=e.type,a.style.cssText="display:block;left:-9999px","contextmenu"==e.type&&t){var c=r.getElementsByTagName(s,"div","edui-contextmenu")[0];c?d(c):n.editor.addListener("aftershowcontextmenu",(function(e,t){d(t)}))}else o=i.getViewportOffsetByEvent(e),o.top-=a.offsetHeight+n.SPACE,o.left+=n.SPACE+20,l(o),n.setOpacity(a,.2);n.isHidden=!1,n.left=e.screenX+a.offsetWidth/2-n.SPACE,n.top=e.screenY-a.offsetHeight/2-n.SPACE,n.editor&&(a.style.zIndex=1*n.editor.container.style.zIndex+10,s.style.zIndex=a.style.zIndex-1)},hide:function(){this.getDom()&&(this.getDom().style.display="none"),this.isHidden=!0},postRender:function(){if(o.isArray(this.items))for(var e,t=0;e=this.items[t++];)e.postRender()},getHtmlTpl:function(){var e;if(o.isArray(this.items)){e=[];for(var t=0;t<this.items.length;t++)e[t]=this.items[t].renderHtml();e=e.join("")}else e=this.items;return'<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >'+e+"</div>"}},o.inherits(l,n),r.on(document,"mousedown",(function(e){d(e)})),r.on(window,"scroll",(function(e){d(e)}))}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.Breakline=function(e){this.initOptions(e),this.initSeparator()};n.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"<br/>"}},e.inherits(n,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.Message=function(e){this.initOptions(e),this.initMessage()};i.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-message %%"> <div id="##_closer" class="edui-message-closer">×</div> <div id="##_body" class="edui-message-body edui-message-type-info"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-message-content"> </div> </div></div>'},reset:function(e){var t=this;e.keepshow||(clearTimeout(this.timer),t.timer=setTimeout((function(){t.hide()}),e.timeout||4e3)),void 0!==e.content&&t.setContent(e.content),void 0!==e.type&&t.setType(e.type),t.show()},postRender:function(){var e=this,n=this.getDom("closer");n&&t.on(n,"click",(function(){e.hide()}))},setContent:function(e){this.getDom("content").innerHTML=e},setType:function(e){e=e||"info";var t=this.getDom("body");t.className=t.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+e)},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var e=this.getDom("body").match(/edui-message-type-([\w-]+)/);return e?e[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var e=this.getDom();e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui,n=t.Dialog;t.buttons={},t.Dialog=function(e){var t=new n(e);return t.addListener("hide",(function(){if(t.editor){var e=t.editor;try{if(browser.gecko){var n=e.window.scrollY,i=e.window.scrollX;e.body.focus(),e.window.scrollTo(i,n)}else e.focus()}catch(o){}}})),t};for(var i={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},o=["undo","redo","formatmatch","bold","italic","underline","fontborder","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable","drafts"],r=0;l=o[r++];)l=l.toLowerCase(),t[l]=function(e){return function(n){var i=new t.Button({className:"edui-for-"+e,title:n.options.labelMap[e]||n.getLang("labelMap."+e)||"",onclick:function(){n.execCommand(e)},theme:n.options.theme,showText:!1});return t.buttons[e]=i,n.addListener("selectionchange",(function(t,o,r){var a=n.queryCommandState(e);-1==a?(i.setDisabled(!0),i.setChecked(!1)):r||(i.setDisabled(!1),i.setChecked(a))})),i}}(l);t.cleardoc=function(e){var n=new t.Button({className:"edui-for-cleardoc",title:e.options.labelMap.cleardoc||e.getLang("labelMap.cleardoc")||"",theme:e.options.theme,onclick:function(){confirm(e.getLang("confirmClear"))&&e.execCommand("cleardoc")}});return t.buttons["cleardoc"]=n,e.addListener("selectionchange",(function(){n.setDisabled(-1==e.queryCommandState("cleardoc"))})),n};var a={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var s in a)(function(e,n){for(var i,o=0;i=n[o++];)(function(n){t[e.replace("float","")+n]=function(i){var o=new t.Button({className:"edui-for-"+e.replace("float","")+n,title:i.options.labelMap[e.replace("float","")+n]||i.getLang("labelMap."+e.replace("float","")+n)||"",theme:i.options.theme,onclick:function(){i.execCommand(e,n)}});return t.buttons[e]=o,i.addListener("selectionchange",(function(t,r,a){o.setDisabled(-1==i.queryCommandState(e)),o.setChecked(i.queryCommandValue(e)==n&&!a)})),o}})(i)})(s,a[s]);var l;for(r=0;l=["backcolor","forecolor"][r++];)t[l]=function(e){return function(n){var i=new t.ColorButton({className:"edui-for-"+e,color:"default",title:n.options.labelMap[e]||n.getLang("labelMap."+e)||"",editor:n,onpickcolor:function(t,i){n.execCommand(e,i)},onpicknocolor:function(){n.execCommand(e,"default"),this.setColor("transparent"),this.color="default"},onbuttonclick:function(){n.execCommand(e,this.color)}});return t.buttons[e]=i,n.addListener("selectionchange",(function(){i.setDisabled(-1==n.queryCommandState(e))})),i}}(l);var d={noOk:["searchreplace","help","spechars","webapp","preview"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","insertframe","edittip","edittable","edittd","scrawl","template","music","background","charts"]};for(var s in d)(function(n,o){for(var r,a=0;r=o[a++];)browser.opera&&"searchreplace"===r||function(o){t[o]=function(r,a,s){var l;a=a||(r.options.iframeUrlMap||{})[o]||i[o],s=r.options.labelMap[o]||r.getLang("labelMap."+o)||"",a&&(l=new t.Dialog(e.extend({iframeUrl:r.ui.mapUrl(a),editor:r,className:"edui-for-"+o,title:s,holdScroll:"insertimage"===o,fullscreen:/charts|preview/.test(o),closeDialog:r.getLang("closeDialog")},"ok"==n?{buttons:[{className:"edui-okbutton",label:r.getLang("ok"),editor:r,onclick:function(){l.close(!0)}},{className:"edui-cancelbutton",label:r.getLang("cancel"),editor:r,onclick:function(){l.close(!1)}}]}:{})),r.ui._dialogs[o+"Dialog"]=l);var d=new t.Button({className:"edui-for-"+o,title:s,onclick:function(){if(l)switch(o){case"wordimage":var e=r.execCommand("wordimage");e&&e.length&&(l.render(),l.open());break;case"scrawl":-1!=r.queryCommandState("scrawl")&&(l.render(),l.open());break;default:l.render(),l.open()}},theme:r.options.theme,disabled:"scrawl"==o&&-1==r.queryCommandState("scrawl")||"charts"==o});return t.buttons[o]=d,r.addListener("selectionchange",(function(){var e={edittable:1};if(!(o in e)){var t=r.queryCommandState(o);d.getDom()&&(d.setDisabled(-1==t),d.setChecked(t))}})),d}}(r.toLowerCase())})(s,d[s]);t.snapscreen=function(e,n,o){o=e.options.labelMap["snapscreen"]||e.getLang("labelMap.snapscreen")||"";var r=new t.Button({className:"edui-for-snapscreen",title:o,onclick:function(){e.execCommand("snapscreen")},theme:e.options.theme});if(t.buttons["snapscreen"]=r,n=n||(e.options.iframeUrlMap||{})["snapscreen"]||i["snapscreen"],n){var a=new t.Dialog({iframeUrl:e.ui.mapUrl(n),editor:e,className:"edui-for-snapscreen",title:o,buttons:[{className:"edui-okbutton",label:e.getLang("ok"),editor:e,onclick:function(){a.close(!0)}},{className:"edui-cancelbutton",label:e.getLang("cancel"),editor:e,onclick:function(){a.close(!1)}}]});a.render(),e.ui._dialogs["snapscreenDialog"]=a}return e.addListener("selectionchange",(function(){r.setDisabled(-1==e.queryCommandState("snapscreen"))})),r},t.insertcode=function(n,i,o){i=n.options["insertcode"]||[],o=n.options.labelMap["insertcode"]||n.getLang("labelMap.insertcode")||"";var r=[];e.each(i,(function(e,t){r.push({label:e,value:t,theme:n.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" >'+(this.label||"")+"</div>"}})}));var a=new t.Combox({editor:n,items:r,onselect:function(e,t){n.execCommand("insertcode",this.items[t].value)},onbuttonclick:function(){this.showPopup()},title:o,initValue:o,className:"edui-for-insertcode",indexByValue:function(e){if(e)for(var t,n=0;t=this.items[n];n++)if(-1!=t.value.indexOf(e))return n;return-1}});return t.buttons["insertcode"]=a,n.addListener("selectionchange",(function(e,t,i){if(!i){var r=n.queryCommandState("insertcode");if(-1==r)a.setDisabled(!0);else{a.setDisabled(!1);var s=n.queryCommandValue("insertcode");if(!s)return void a.setValue(o);s&&(s=s.replace(/['"]/g,"").split(",")[0]),a.setValue(s)}}})),a},t.fontfamily=function(n,i,o){if(i=n.options["fontfamily"]||[],o=n.options.labelMap["fontfamily"]||n.getLang("labelMap.fontfamily")||"",i.length){for(var r,a=0,s=[];r=i[a];a++){var l=n.getLang("fontfamily")[r.name]||"";(function(t,i){s.push({label:t,value:i,theme:n.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+e.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(r.label||l,r.val)}var d=new t.Combox({editor:n,items:s,onselect:function(e,t){n.execCommand("FontFamily",this.items[t].value)},onbuttonclick:function(){this.showPopup()},title:o,initValue:o,className:"edui-for-fontfamily",indexByValue:function(e){if(e)for(var t,n=0;t=this.items[n];n++)if(-1!=t.value.indexOf(e))return n;return-1}});return t.buttons["fontfamily"]=d,n.addListener("selectionchange",(function(e,t,i){if(!i){var o=n.queryCommandState("FontFamily");if(-1==o)d.setDisabled(!0);else{d.setDisabled(!1);var r=n.queryCommandValue("FontFamily");r&&(r=r.replace(/['"]/g,"").split(",")[0]),d.setValue(r)}}})),d}},t.fontsize=function(e,n,i){if(i=e.options.labelMap["fontsize"]||e.getLang("labelMap.fontsize")||"",n=n||e.options["fontsize"]||[],n.length){for(var o=[],r=0;r<n.length;r++){var a=n[r]+"px";o.push({label:a,value:a,theme:e.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var s=new t.Combox({editor:e,items:o,title:i,initValue:i,onselect:function(t,n){e.execCommand("FontSize",this.items[n].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});return t.buttons["fontsize"]=s,e.addListener("selectionchange",(function(t,n,i){if(!i){var o=e.queryCommandState("FontSize");-1==o?s.setDisabled(!0):(s.setDisabled(!1),s.setValue(e.queryCommandValue("FontSize")))}})),s}},t.paragraph=function(n,i,o){if(o=n.options.labelMap["paragraph"]||n.getLang("labelMap.paragraph")||"",i=n.options["paragraph"]||[],!e.isEmptyObject(i)){var r=[];for(var a in i)r.push({value:a,label:i[a]||n.getLang("paragraph")[a],theme:n.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+this.value+'">'+(this.label||"")+"</span></div>"}});var s=new t.Combox({editor:n,items:r,title:o,initValue:o,className:"edui-for-paragraph",onselect:function(e,t){n.execCommand("Paragraph",this.items[t].value)},onbuttonclick:function(){this.showPopup()}});return t.buttons["paragraph"]=s,n.addListener("selectionchange",(function(e,t,i){if(!i){var o=n.queryCommandState("Paragraph");if(-1==o)s.setDisabled(!0);else{s.setDisabled(!1);var r=n.queryCommandValue("Paragraph"),a=s.indexByValue(r);-1!=a?s.setValue(r):s.setValue(s.initValue)}}})),s}},t.customstyle=function(e){var n=e.options["customstyle"]||[],i=e.options.labelMap["customstyle"]||e.getLang("labelMap.customstyle")||"";if(n.length){for(var o,r=e.getLang("customstyle"),a=0,s=[];o=n[a++];)(function(t){var n={};n.label=t.label?t.label:r[t.name],n.style=t.style,n.className=t.className,n.tag=t.tag,s.push({label:n.label,value:n,theme:e.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+n.tag+" "+(n.className?' class="'+n.className+'"':"")+(n.style?' style="'+n.style+'"':"")+">"+n.label+"</"+n.tag+"></div>"}})})(o);var l=new t.Combox({editor:e,items:s,title:i,initValue:i,className:"edui-for-customstyle",onselect:function(t,n){e.execCommand("customstyle",this.items[n].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(e){for(var t,n=0;t=this.items[n++];)if(t.label==e)return n-1;return-1}});return t.buttons["customstyle"]=l,e.addListener("selectionchange",(function(t,n,i){if(!i){var o=e.queryCommandState("customstyle");if(-1==o)l.setDisabled(!0);else{l.setDisabled(!1);var r=e.queryCommandValue("customstyle"),a=l.indexByValue(r);-1!=a?l.setValue(r):l.setValue(l.initValue)}}})),l}},t.inserttable=function(e,n,i){i=e.options.labelMap["inserttable"]||e.getLang("labelMap.inserttable")||"";var o=new t.TableButton({editor:e,title:i,className:"edui-for-inserttable",onpicktable:function(t,n,i){e.execCommand("InsertTable",{numRows:i,numCols:n,border:1})},onbuttonclick:function(){this.showPopup()}});return t.buttons["inserttable"]=o,e.addListener("selectionchange",(function(){o.setDisabled(-1==e.queryCommandState("inserttable"))})),o},t.lineheight=function(e){var n=e.options.lineheight||[];if(n.length){for(var i,o=0,r=[];i=n[o++];)r.push({label:i,value:i,theme:e.options.theme,onclick:function(){e.execCommand("lineheight",this.value)}});var a=new t.MenuButton({editor:e,className:"edui-for-lineheight",title:e.options.labelMap["lineheight"]||e.getLang("labelMap.lineheight")||"",items:r,onbuttonclick:function(){var t=e.queryCommandValue("LineHeight")||this.value;e.execCommand("LineHeight",t)}});return t.buttons["lineheight"]=a,e.addListener("selectionchange",(function(){var t=e.queryCommandState("LineHeight");if(-1==t)a.setDisabled(!0);else{a.setDisabled(!1);var n=e.queryCommandValue("LineHeight");n&&a.setValue((n+"").replace(/cm/,"")),a.setChecked(t)}})),a}};for(var c,u=["top","bottom"],m=0;c=u[m++];)(function(e){t["rowspacing"+e]=function(n){var i=n.options["rowspacing"+e]||[];if(!i.length)return null;for(var o,r=0,a=[];o=i[r++];)a.push({label:o,value:o,theme:n.options.theme,onclick:function(){n.execCommand("rowspacing",this.value,e)}});var s=new t.MenuButton({editor:n,className:"edui-for-rowspacing"+e,title:n.options.labelMap["rowspacing"+e]||n.getLang("labelMap.rowspacing"+e)||"",items:a,onbuttonclick:function(){var t=n.queryCommandValue("rowspacing",e)||this.value;n.execCommand("rowspacing",t,e)}});return t.buttons[e]=s,n.addListener("selectionchange",(function(){var t=n.queryCommandState("rowspacing",e);if(-1==t)s.setDisabled(!0);else{s.setDisabled(!1);var i=n.queryCommandValue("rowspacing",e);i&&s.setValue((i+"").replace(/%/,"")),s.setChecked(t)}})),s}})(c);for(var f,h=["insertorderedlist","insertunorderedlist"],p=0;f=h[p++];)(function(e){t[e]=function(n){var i=n.options[e],o=function(){n.execCommand(e,this.value)},r=[];for(var a in i)r.push({label:i[a]||n.getLang()[e][a]||"",value:a,theme:n.options.theme,onclick:o});var s=new t.MenuButton({editor:n,className:"edui-for-"+e,title:n.getLang("labelMap."+e)||"",items:r,onbuttonclick:function(){var t=n.queryCommandValue(e)||this.value;n.execCommand(e,t)}});return t.buttons[e]=s,n.addListener("selectionchange",(function(){var t=n.queryCommandState(e);if(-1==t)s.setDisabled(!0);else{s.setDisabled(!1);var i=n.queryCommandValue(e);s.setValue(i),s.setChecked(t)}})),s}})(f);t.fullscreen=function(e,n){n=e.options.labelMap["fullscreen"]||e.getLang("labelMap.fullscreen")||"";var i=new t.Button({className:"edui-for-fullscreen",title:n,theme:e.options.theme,onclick:function(){e.ui&&e.ui.setFullScreen(!e.ui.isFullScreen()),this.setChecked(e.ui.isFullScreen())}});return t.buttons["fullscreen"]=i,e.addListener("selectionchange",(function(){var t=e.queryCommandState("fullscreen");i.setDisabled(-1==t),i.setChecked(e.ui.isFullScreen())})),i},t["emotion"]=function(e,n){var o="emotion",r=new t.MultiMenuPop({title:e.options.labelMap[o]||e.getLang("labelMap."+o)||"",editor:e,className:"edui-for-"+o,iframeUrl:e.ui.mapUrl(n||(e.options.iframeUrlMap||{})[o]||i[o])});return t.buttons[o]=r,e.addListener("selectionchange",(function(){r.setDisabled(-1==e.queryCommandState(o))})),r},t.autotypeset=function(e){var n=new t.AutoTypeSetButton({editor:e,title:e.options.labelMap["autotypeset"]||e.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){e.execCommand("autotypeset")}});return t.buttons["autotypeset"]=n,e.addListener("selectionchange",(function(){n.setDisabled(-1==e.queryCommandState("autotypeset"))})),n},t["simpleupload"]=function(e){var n="simpleupload",i=new t.Button({className:"edui-for-"+n,title:e.options.labelMap[n]||e.getLang("labelMap."+n)||"",onclick:function(){},theme:e.options.theme,showText:!1});return t.buttons[n]=i,e.addListener("ready",(function(){var t=i.getDom("body"),n=t.children[0];e.fireEvent("simpleuploadbtnready",n)})),e.addListener("selectionchange",(function(t,o,r){var a=e.queryCommandState(n);-1==a?(i.setDisabled(!0),i.setChecked(!1)):r||(i.setDisabled(!1),i.setChecked(a))})),i}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.dom.domUtils,o=[];function r(e){this.initOptions(e),this.initEditorUI()}r.prototype={uiName:"editor",initEditorUI:function(){this.editor.ui=this,this._dialogs={},this.initUIBase(),this._initToolbars();var e=this.editor,t=this;e.addListener("ready",(function n(){if(e.getDialog=function(t){return e.ui._dialogs[t+"Dialog"]},i.on(e.window,"scroll",(function(e){baidu.editor.ui.Popup.postHide(e)})),e.ui._actualFrameWidth=e.options.initialFrameWidth,UE.browser.ie&&6===UE.browser.version&&e.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0),e.options.elementPathEnabled&&(e.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+e.getLang("elementPathTip")+":</div>"),e.options.wordCount){var o=function(){a(e,t),i.un(e.document,"click",n)};i.on(e.document,"click",o),e.ui.getDom("wordcount").innerHTML=e.getLang("wordCountTip")}e.ui._scale(),e.options.scaleEnabled?(e.autoHeightEnabled&&e.disableAutoHeight(),t.enableScale()):t.disableScale(),e.options.elementPathEnabled||e.options.wordCount||e.options.scaleEnabled||(e.ui.getDom("elementpath").style.display="none",e.ui.getDom("wordcount").style.display="none",e.ui.getDom("scale").style.display="none"),e.selection.isFocus()&&e.fireEvent("selectionchange",!1,!0)})),e.addListener("mousedown",(function(e,t){var n=t.target||t.srcElement;baidu.editor.ui.Popup.postHide(t,n),baidu.editor.ui.ShortCutMenu.postHide(t)})),e.addListener("delcells",(function(){UE.ui["edittip"]&&new UE.ui["edittip"](e),e.getDialog("edittip").open()}));var n,o,r=!1;function a(e,t){e.setOpt({wordCount:!0,maximumWords:1e4,wordCountMsg:e.options.wordCountMsg||e.getLang("wordCountMsg"),wordOverFlowMsg:e.options.wordOverFlowMsg||e.getLang("wordOverFlowMsg")});var n=e.options,i=n.maximumWords,o=n.wordCountMsg,r=n.wordOverFlowMsg,a=t.getDom("wordcount");if(n.wordCount){var s=e.getContentLength(!0);s>i?(a.innerHTML=r,e.fireEvent("wordcountoverflow")):a.innerHTML=o.replace("{#leave}",i-s).replace("{#count}",s)}}e.addListener("afterpaste",(function(){e.queryCommandState("pasteplain")||(baidu.editor.ui.PastePicker&&(n=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:e}),editor:e,className:"edui-wordpastepop"}),n.render()),r=!0)})),e.addListener("afterinserthtml",(function(){clearTimeout(o),o=setTimeout((function(){if(n&&(r||e.ui._isTransfer)){if(n.isHidden()){var t=i.createElement(e.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"}),o=e.selection.getRange();o.insertNode(t);var a=getDomNode(t,"firstChild","previousSibling");a&&n.showAnchor(3==a.nodeType?a.parentNode:a),i.remove(t)}else n.show();delete e.ui._isTransfer,r=!1}}),200)})),e.addListener("contextmenu",(function(e,t){baidu.editor.ui.Popup.postHide(t)})),e.addListener("keydown",(function(e,t){n&&n.dispose(t);var i=t.keyCode||t.which;t.altKey&&90==i&&UE.ui.buttons["fullscreen"].onclick()})),e.addListener("wordcount",(function(e){a(this,t)})),e.addListener("selectionchange",(function(){e.options.elementPathEnabled&&t[(-1==e.queryCommandState("elementpath")?"dis":"en")+"ableElementPath"](),e.options.scaleEnabled&&t[(-1==e.queryCommandState("scale")?"dis":"en")+"ableScale"]()}));var s=new baidu.editor.ui.Popup({editor:e,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(),e.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(t){this.hide(),e.ui._dialogs[t]&&e.ui._dialogs[t].open()},_onImgSetFloat:function(t){this.hide(),e.execCommand("imagefloat",t)},_setIframeAlign:function(e){var t=s.anchorEl,n=t.cloneNode(!0);switch(e){case-2:n.setAttribute("align","");break;case-1:n.setAttribute("align","left");break;case 1:n.setAttribute("align","right");break}t.parentNode.insertBefore(n,t),i.remove(t),s.anchorEl=n,s.showAnchor(s.anchorEl)},_updateIframe:function(){var t=e._iframe=s.anchorEl;i.hasClass(t,"ueditor_baidumap")?(e.selection.getRange().selectNode(t).select(),e.ui._dialogs.mapDialog.open(),s.hide()):(e.ui._dialogs.insertframeDialog.open(),s.hide())},_onRemoveButtonClick:function(t){e.execCommand(t),this.hide()},queryAutoHide:function(t){return t&&t.ownerDocument==e.document&&("img"==t.tagName.toLowerCase()||i.findParentByTagName(t,"a",!0))?t!==s.anchorEl:baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,t)}});s.render(),e.options.imagePopup&&(e.addListener("mouseover",(function(t,n){n=n||window.event;var i=n.target||n.srcElement;if(e.ui._dialogs.insertframeDialog&&/iframe/gi.test(i.tagName)){var o=s.formatHtml("<nobr>"+e.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+e.getLang("default")+'</span> <span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+e.getLang("justifyleft")+'</span> <span onclick=$$._setIframeAlign(1) class="edui-clickable">'+e.getLang("justifyright")+'</span> <span onclick="$$._updateIframe( this);" class="edui-clickable">'+e.getLang("modify")+"</span></nobr>");o?(s.getDom("content").innerHTML=o,s.anchorEl=i,s.showAnchor(s.anchorEl)):s.hide()}})),e.addListener("selectionchange",(function(t,n){if(n){var o="",r="",a=e.selection.getRange().getClosedNode(),l=e.ui._dialogs;if(a&&"IMG"==a.tagName){var d="insertimageDialog";if(-1==a.className.indexOf("edui-faked-video")&&-1==a.className.indexOf("edui-upload-video")||(d="insertvideoDialog"),-1!=a.className.indexOf("edui-faked-webapp")&&(d="webappDialog"),-1!=a.src.indexOf("http://api.map.baidu.com")&&(d="mapDialog"),-1!=a.className.indexOf("edui-faked-music")&&(d="musicDialog"),-1!=a.src.indexOf("http://maps.google.com/maps/api/staticmap")&&(d="gmapDialog"),a.getAttribute("anchorname")&&(d="anchorDialog",o=s.formatHtml("<nobr>"+e.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+e.getLang("modify")+"</span> <span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+e.getLang("delete")+"</span></nobr>")),a.getAttribute("word_img")&&(e.word_img=[a.getAttribute("word_img")],d="wordimageDialog"),(i.hasClass(a,"loadingclass")||i.hasClass(a,"loaderrorclass"))&&(d=""),!l[d])return;r="<nobr>"+e.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+e.getLang("default")+'</span> <span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+e.getLang("justifyleft")+'</span> <span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+e.getLang("justifyright")+'</span> <span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+e.getLang("justifycenter")+"</span> <span onclick=\"$$._onImgEditButtonClick('"+d+'\');" class="edui-clickable">'+e.getLang("modify")+"</span></nobr>",!o&&(o=s.formatHtml(r))}if(e.ui._dialogs.linkDialog){var c,u=e.queryCommandValue("link");if(u&&(c=u.getAttribute("_href")||u.getAttribute("href",2))){var m=c;c.length>30&&(m=c.substring(0,20)+"..."),o&&(o+='<div style="height:5px;"></div>'),o+=s.formatHtml("<nobr>"+e.getLang("anthorMsg")+': <a target="_blank" href="'+c+'" title="'+c+'" >'+m+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+e.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+e.getLang("clear")+"</span></nobr>"),s.showAnchor(u)}}o?(s.getDom("content").innerHTML=o,s.anchorEl=a||u,s.showAnchor(s.anchorEl)):s.hide()}})))},_initToolbars:function(){for(var e=this.editor,t=this.toolbars||[],n=[],i=0;i<t.length;i++){for(var o=t[i],r=new baidu.editor.ui.Toolbar({theme:e.options.theme}),a=0;a<o.length;a++){var s=o[a],l=null;if("string"==typeof s){if(s=s.toLowerCase(),"|"==s&&(s="Separator"),"||"==s&&(s="Breakline"),baidu.editor.ui[s]&&(l=new baidu.editor.ui[s](e)),"fullscreen"==s){n&&n[0]?n[0].items.splice(0,0,l):l&&r.items.splice(0,0,l);continue}}else l=s;l&&l.id&&r.add(l)}n[i]=r}for(var d in UE._customizeUI){var c,u,m=UE._customizeUI[d];m.id&&m.id!=e.key||(c=m.execFn.call(e,e,d),c&&(u=m.index,void 0===u&&(u=r.items.length),r.add(c,u)))}this.toolbars=n},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div><div id="##_message_holder" class="%%-messageholder"></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'},showWordImageDialog:function(){this._dialogs["wordimageDialog"].open()},renderToolbarBoxHtml:function(){for(var e=[],t=0;t<this.toolbars.length;t++)e.push(this.toolbars[t].renderHtml());return e.join("")},setFullScreen:function(e){var t=this.editor,n=t.container.parentNode.parentNode;if(this._fullscreen!=e){if(this._fullscreen=e,this.editor.fireEvent("beforefullscreenchange",e),baidu.editor.browser.gecko)var i=t.selection.getRange().createBookmark();if(e){while("BODY"!=n.tagName){var r=baidu.editor.dom.domUtils.getComputedStyle(n,"position");o.push(r),n.style.position="static",n=n.parentNode}this._bakHtmlOverflow=document.documentElement.style.overflow,this._bakBodyOverflow=document.body.style.overflow,this._bakAutoHeight=this.editor.autoHeightEnabled,this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop),this._bakEditorContaninerWidth=t.iframe.parentNode.offsetWidth,this._bakAutoHeight&&(t.autoHeightEnabled=!1,this.editor.disableAutoHeight()),document.documentElement.style.overflow="hidden",window.scrollTo(0,window.scrollY),this._bakCssText=this.getDom().style.cssText,this._bakCssText1=this.getDom("iframeholder").style.cssText,t.iframe.parentNode.style.width="",this._updateFullScreen()}else{while("BODY"!=n.tagName)n.style.position=o.shift(),n=n.parentNode;this.getDom().style.cssText=this._bakCssText,this.getDom("iframeholder").style.cssText=this._bakCssText1,this._bakAutoHeight&&(t.autoHeightEnabled=!0,this.editor.enableAutoHeight()),document.documentElement.style.overflow=this._bakHtmlOverflow,document.body.style.overflow=this._bakBodyOverflow,t.iframe.parentNode.style.width=this._bakEditorContaninerWidth+"px",window.scrollTo(0,this._bakScrollTop)}if(browser.gecko&&"true"===t.body.contentEditable){var a=document.createElement("input");document.body.appendChild(a),t.body.contentEditable=!1,setTimeout((function(){a.focus(),setTimeout((function(){t.body.contentEditable=!0,t.fireEvent("fullscreenchanged",e),t.selection.getRange().moveToBookmark(i).select(!0),baidu.editor.dom.domUtils.remove(a),e&&window.scroll(0,0)}),0)}),0)}"true"===t.body.contentEditable&&(this.editor.fireEvent("fullscreenchanged",e),this.triggerLayout())}},_updateFullScreen:function(){if(this._fullscreen){var e=t.getViewportRect();if(this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+e.width+"px;height:"+e.height+"px;z-index:"+(1*this.getDom().style.zIndex+100),t.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0}),this.editor.setHeight(e.height-this.getDom("toolbarbox").offsetHeight-this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0),!0),browser.gecko)try{window.onresize()}catch(n){}}},_updateElementPath:function(){var e,t=this.getDom("elementpath");if(this.elementPathEnabled&&(e=this.editor.queryCommandValue("elementpath"))){for(var n,i=[],o=0;n=e[o];o++)i[o]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand("elementpath", "'+o+'");">'+n+"</span>");t.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+this.editor.getLang("elementPathTip")+": "+i.join(" > ")+"</div>"}else t.style.display="none"},disableElementPath:function(){var e=this.getDom("elementpath");e.innerHTML="",e.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){var e=this.getDom("elementpath");e.style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){var e=document,t=this.editor,n=t.container,o=t.document,r=this.getDom("toolbarbox"),a=this.getDom("bottombar"),s=this.getDom("scale"),l=this.getDom("scalelayer"),d=!1,c=null,u=0,m=t.options.minFrameWidth,f=0,h=0,p=0,g=0;function b(){c=i.getXY(n),u||(u=t.options.minFrameHeight+r.offsetHeight+a.offsetHeight),l.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+n.offsetWidth+"px;height:"+n.offsetHeight+"px;z-index:"+(t.options.zIndex+1),i.on(e,"mousemove",y),i.on(o,"mouseup",C),i.on(e,"mouseup",C)}var v=this;function y(t){w();var n=t||window.event;f=n.pageX||e.documentElement.scrollLeft+n.clientX,h=n.pageY||e.documentElement.scrollTop+n.clientY,p=f-c.x,g=h-c.y,p>=m&&(d=!0,l.style.width=p+"px"),g>=u&&(d=!0,l.style.height=g+"px")}function C(){d&&(d=!1,t.ui._actualFrameWidth=l.offsetWidth-2,n.style.width=t.ui._actualFrameWidth+"px",t.setHeight(l.offsetHeight-a.offsetHeight-r.offsetHeight-2,!0)),l&&(l.style.display="none"),w(),i.un(e,"mousemove",y),i.un(o,"mouseup",C),i.un(e,"mouseup",C)}function w(){browser.ie?e.selection.clear():window.getSelection().removeAllRanges()}this.editor.addListener("fullscreenchanged",(function(e,t){if(t)v.disableScale();else if(v.editor.options.scaleEnabled){v.enableScale();var n=v.editor.document.createElement("span");v.editor.body.appendChild(n),v.editor.body.style.height=Math.max(i.getXY(n).y,v.editor.iframe.offsetHeight-20)+"px",i.remove(n)}})),this.enableScale=function(){1!=t.queryCommandState("source")&&(s.style.display="",this.scaleEnabled=!0,i.on(s,"mousedown",b))},this.disableScale=function(){s.style.display="none",this.scaleEnabled=!1,i.un(s,"mousedown",b)}},isFullScreen:function(){return this._fullscreen},postRender:function(){n.prototype.postRender.call(this);for(var e=0;e<this.toolbars.length;e++)this.toolbars[e].postRender();var t,i=this,o=baidu.editor.dom.domUtils,r=function(){clearTimeout(t),t=setTimeout((function(){i._updateFullScreen()}))};o.on(window,"resize",r),i.addListener("destroy",(function(){o.un(window,"resize",r),clearTimeout(t)}))},showToolbarMsg:function(e,t){if(this.getDom("toolbarmsg_label").innerHTML=e,this.getDom("toolbarmsg").style.display="",!t){var n=this.getDom("upload_dialog");n.style.display="none"}},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(e){return e?e.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var e=this.getDom();"1"==e.style.zoom?e.style.zoom="100%":e.style.zoom="1"}},e.inherits(r,baidu.editor.ui.UIBase);var a={};UE.ui.Editor=function(t){var n=new UE.Editor(t);n.options.editor=n,e.loadFile(document,{href:n.options.themePath+n.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var o=n.render;return n.render=function(t){t.constructor===String&&(n.key=t,a[t]=n),e.domReady((function(){function e(){if(n.setOpt({labelMap:n.options.labelMap||n.getLang("labelMap")}),new r(n.options),t&&(t.constructor===String&&(t=document.getElementById(t)),t&&t.getAttribute("name")&&(n.options.textarea=t.getAttribute("name")),t&&/script|textarea/gi.test(t.tagName))){var e=document.createElement("div");t.parentNode.insertBefore(e,t);var a=t.value||t.innerHTML;n.options.initialContent=/^[\t\r\n ]*$/.test(a)?n.options.initialContent:a.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><"),t.className&&(e.className=t.className),t.style.cssText&&(e.style.cssText=t.style.cssText),/textarea/i.test(t.tagName)?(n.textarea=t,n.textarea.style.display="none"):t.parentNode.removeChild(t),t.id&&(e.id=t.id,i.removeAttributes(t,"id")),t=e,t.innerHTML=""}i.addClass(t,"edui-"+n.options.theme),n.ui.render(t);var s=n.options;n.container=n.ui.getDom();for(var l=i.findParents(t,!0),d=[],c=0;m=l[c];c++)d[c]=m.style.display,m.style.display="block";if(s.initialFrameWidth)s.minFrameWidth=s.initialFrameWidth;else{s.minFrameWidth=s.initialFrameWidth=t.offsetWidth;var u=t.style.width;/%$/.test(u)&&(s.initialFrameWidth=u)}s.initialFrameHeight?s.minFrameHeight=s.initialFrameHeight:s.initialFrameHeight=s.minFrameHeight=t.offsetHeight;var m;for(c=0;m=l[c];c++)m.style.display=d[c];t.style.height&&(t.style.height=""),n.container.style.width=s.initialFrameWidth+(/%$/.test(s.initialFrameWidth)?"":"px"),n.container.style.zIndex=s.zIndex,o.call(n,n.ui.getDom("iframeholder")),n.fireEvent("afteruiready")}n.langIsReady?e():n.addListener("langReady",e)}))},n},UE.getEditor=function(e,t){var n=a[e];return n||(n=a[e]=new UE.ui.Editor(t),n.render(e)),n},UE.delEditor=function(e){var t;(t=a[e])&&(t.key&&t.destroy(),delete a[e])},UE.registerUI=function(t,n,i,o){e.each(t.split(/\s+/),(function(e){UE._customizeUI[e]={id:o,execFn:n,index:i}}))}}(),UE.registerUI("message",(function(e){var t,n=baidu.editor.ui,i=n.Message,o=[],r=e;function a(){var e=r.ui.getDom("toolbarbox");e&&(t.style.top=e.offsetHeight+3+"px"),t.style.zIndex=Math.max(r.options.zIndex,r.iframe.style.zIndex)+1}r.addListener("ready",(function(){t=document.getElementById(r.ui.id+"_message_holder"),a()})),r.addListener("showmessage",(function(e,n){n=utils.isString(n)?{content:n}:n;var s=new i({timeout:n.timeout,type:n.type,content:n.content,keepshow:n.keepshow,editor:r}),l=n.id||"msg_"+(+new Date).toString(36);return s.render(t),o[l]=s,s.reset(n),a(),l})),r.addListener("updatemessage",(function(e,n,i){i=utils.isString(i)?{content:i}:i;var r=o[n];r.render(t),r&&r.reset(i)})),r.addListener("hidemessage",(function(e,t){var n=o[t];n&&n.hide()}))})),UE.registerUI("autosave",(function(e){var t=null,n=null;e.on("afterautosave",(function(){clearTimeout(t),t=setTimeout((function(){n&&e.trigger("hidemessage",n),n=e.trigger("showmessage",{content:e.getLang("autosave.success"),timeout:2e3})}),2e3)}))}))})()}});
- //# sourceMappingURL=app.d2ae8cdb.js.map
|