var UEditorConfig=require("./../../ueditor/ueditor.config.js"),UEditor=require("./../../ueditor/ueditor.js"),Dialog=require("./dialogPC.js");UE.commands.uploadimage={execCommand:function(e,a){var l=this;return window.callback.editorUploadImage(function(e){for(var a=[],t=0;t<e.length;t++)a.push('<img src="'+e[t]+'" />');l.execCommand("insertHtml",a.join(""))}),!0}};var emotions=[{key:"[微笑]",val:"01"},{key:"[撇嘴]",val:"02"},{key:"[色]",val:"03"},{key:"[发呆]",val:"04"},{key:"[得意]",val:"05"},{key:"[流泪]",val:"06"},{key:"[害羞]",val:"07"},{key:"[闭嘴]",val:"08"},{key:"[睡]",val:"09"},{key:"[大哭]",val:"10"},{key:"[尴尬]",val:"11"},{key:"[发怒]",val:"12"},{key:"[调皮]",val:"13"},{key:"[呲牙]",val:"14"},{key:"[惊讶]",val:"15"},{key:"[难过]",val:"16"},{key:"[酷]",val:"17"},{key:"[冷汗]",val:"18"},{key:"[抓狂]",val:"19"},{key:"[吐]",val:"20"},{key:"[偷笑]",val:"21"},{key:"[愉快]",val:"22"},{key:"[白眼]",val:"23"},{key:"[傲慢]",val:"24"},{key:"[饥饿]",val:"25"},{key:"[困]",val:"26"},{key:"[惊恐]",val:"27"},{key:"[流汗]",val:"28"},{key:"[憨笑]",val:"29"},{key:"[悠闲]",val:"30"},{key:"[奋斗]",val:"31"},{key:"[咒骂]",val:"32"},{key:"[疑问]",val:"33"},{key:"[嘘]",val:"34"},{key:"[晕]",val:"35"},{key:"[疯了]",val:"36"},{key:"[衰]",val:"37"},{key:"[骷髅]",val:"38"},{key:"[敲打]",val:"39"},{key:"[再见]",val:"40"},{key:"[擦汗]",val:"41"},{key:"[抠鼻]",val:"42"},{key:"[鼓掌]",val:"43"},{key:"[糗大了]",val:"44"},{key:"[坏笑]",val:"45"},{key:"[左哼哼]",val:"46"},{key:"[右哼哼]",val:"47"},{key:"[哈欠]",val:"48"},{key:"[鄙视]",val:"49"},{key:"[委屈]",val:"50"},{key:"[快哭了]",val:"51"},{key:"[阴险]",val:"52"},{key:"[亲亲]",val:"53"},{key:"[吓]",val:"54"},{key:"[可怜]",val:"55"},{key:"[菜刀]",val:"56"},{key:"[西瓜]",val:"57"},{key:"[啤酒]",val:"58"},{key:"[篮球]",val:"59"},{key:"[乒乓]",val:"60"},{key:"[咖啡]",val:"61"},{key:"[饭]",val:"62"},{key:"[猪头]",val:"63"},{key:"[玫瑰]",val:"64"},{key:"[凋谢]",val:"65"},{key:"[嘴唇]",val:"66"},{key:"[爱心]",val:"67"},{key:"[心碎]",val:"68"},{key:"[蛋糕]",val:"69"},{key:"[闪电]",val:"70"},{key:"[炸弹]",val:"71"},{key:"[刀]",val:"72"},{key:"[足球]",val:"73"},{key:"[瓢虫]",val:"74"},{key:"[便便]",val:"75"},{key:"[月亮]",val:"76"},{key:"[太阳]",val:"77"},{key:"[礼物]",val:"78"},{key:"[拥抱]",val:"79"},{key:"[强]",val:"80"},{key:"[弱]",val:"81"},{key:"[握手]",val:"82"},{key:"[胜利]",val:"83"},{key:"[抱拳]",val:"84"},{key:"[勾引]",val:"85"},{key:"[拳头]",val:"86"},{key:"[差劲]",val:"87"},{key:"[爱你]",val:"88"},{key:"[NO]",val:"89"},{key:"[OK]",val:"90"},{key:"[爱情]",val:"91"},{key:"[飞吻]",val:"92"},{key:"[跳跳]",val:"93"},{key:"[发抖]",val:"94"},{key:"[怄火]",val:"95"},{key:"[转圈]",val:"96"},{key:"[磕头]",val:"97"},{key:"[回头]",val:"98"},{key:"[跳绳]",val:"99"},{key:"[投降]",val:"100"},{key:"[激动]",val:"101"},{key:"[乱舞]",val:"102"},{key:"[献吻]",val:"103"},{key:"[左太极]",val:"104"},{key:"[右太极]",val:"105"}],editorEmotionDialog=null;UE.commands.wechatcustomemotion={execCommand:function(e,a){var l=this;if(editorEmotionDialog)return!1;var t=$('<div class="editor-wechatcustomemotion"></div>');t.attr("id","editor-wechatcustomemotion");for(var i=0;i<emotions.length;i++)t.append('<a href="javascript:;" class="item" data-key="'+emotions[i].key+'" data-val="'+emotions[i].val+'"><img src="/assets/lib/img/emotion/'+emotions[i].val+'@2x.png" /></a>');editorEmotionDialog=Dialog.dialogContent(t.prop("outerHTML"),{shadeClose:!1,openCallback:function(){$("#editor-wechatcustomemotion").on("click","a.item",function(){var e=$(this).attr("data-key"),a=$(this).attr("data-val"),t='<img data-key="'+e+'" data-val="'+a+'" src="/assets/lib/img/emotion/'+a+'@2x.png" height="20" style="vertical-align:middle;" />';l.execCommand("insertHtml",t),Dialog.dialogClose(editorEmotionDialog),editorEmotionDialog=null})}})}};var Editor={basic:function(e,a,l){var t=$.extend({server:null,width:null,height:100,ready:function(){}},a),i=$.extend({toolbars:[["source","autotypeset","removeformat","paragraph","fontsize","forecolor","uploadimage","insertvideo","bold","italic","underline","strikethrough","indent","justifyleft","justifycenter","justifyright","link","unlink","insertcode"]],serverUrl:t.server,wordCount:!1,elementPathEnabled:!1,initialFrameHeight:t.height,initialFrameWidth:t.width,enableAutoSave:!1,pasteplain:!1,autoHeightEnabled:!0,focus:!1},l),o=UE.getEditor(e,i);return o.ready(function(){t.ready()}),o},simple:function(e,a,l){var t=$.extend({server:null,width:null,height:100,ready:function(){}},a),i=$.extend({toolbars:[["fontsize","forecolor","uploadimage","bold","italic","underline","strikethrough","insertcode"]],serverUrl:t.server,wordCount:!1,elementPathEnabled:!1,initialFrameHeight:t.height,initialFrameWidth:t.width,enableAutoSave:!1,pasteplain:!1,retainOnlyLabelPasted:!0,autoHeightEnabled:!0,focus:!1},l),o=UE.getEditor(e,i);return o.ready(function(){t.ready()}),o},raw:UE};module.exports=Editor;