!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f
"]]):(a=c.filter(a,[[/\n\n/g,"
)$/,e+"$1"],[/\n/g,"
"]]),-1!=a.indexOf("
")&&(a=e+a)),f(a,b)}function h(){var a=d.dom,b=d.getBody(),c=d.dom.getViewPort(d.getWin()),e=d.inline?b.scrollTop:c.y,f=d.inline?b.clientHeight:c.h;i(),m=a.add(d.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+(e+20)+"px;width: 10px; height: "+(f-40)+"px; overflow: hidden; opacity: 0"},r),a.setStyle(m,"left","rtl"==a.getStyle(b,"direction",!0)?65535:-65535),a.bind(m,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),n=d.selection.getRng(),m.focus(),d.selection.select(m,!0)}function i(){m&&(d.dom.unbind(m),d.dom.remove(m),n&&d.selection.setRng(n)),o=!1,m=n=null}function j(){return m?m.innerHTML:r}function k(a){var b={},c=a.clipboardData||d.getDoc().dataTransfer;if(c&&c.types){b["text/plain"]=c.getData("Text");for(var e=0;e
$/])}function h(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:
[\\s\\r\\n]+|
)*(<\\/?("+f.join("|")+")[^>]*>)(?:
[\\s\\r\\n]+|
)*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/
/g,"
"],[/
/g," "],[/
/g,"
"]])}function i(a){return(e.settings.paste_remove_styles||e.settings.paste_remove_styles_if_webkit!==!1)&&(a=a.replace(/ style=\"[^\"]+\"/g,"")),a}a.webkit&&(f(i),f(g)),a.ie&&f(h)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e,f;a.add("paste",function(a){function g(){"text"==i.pasteFormat?(this.active(!1),i.pasteFormat="html"):(i.pasteFormat="text",this.active(!0),e||(a.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),e=!0))}function h(){i.copyImage?(this.active(!1),i.copyImage=!1):(i.copyImage=!0,this.active(!0),f||(a.windowManager.alert("When copy other site's images (not in leanote) into editor, it will copy the image into your album."),f=!0))}var i,j=this,k=a.settings;j.clipboard=i=new b(a),j.quirks=new d(a),j.wordFilter=new c(a),a.settings.paste_as_text&&(j.clipboard.pasteFormat="text"),k.paste_preprocess&&a.on("PastePreProcess",function(a){k.paste_preprocess.call(j,j,a)}),k.paste_postprocess&&a.on("PastePostProcess",function(a){k.paste_postprocess.call(j,j,a)}),a.addCommand("mceInsertClipboardContent",function(a,b){b.content&&j.clipboard.pasteHtml(b.content),b.text&&j.clipboard.pasteText(b.text)}),a.paste_block_drop&&a.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),a.settings.paste_data_images||a.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),a.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:g,active:"text"==j.clipboard.pasteFormat}),a.addButton("pasteCopyImage",{icon:"copy",tooltip:"When Paste other site's image, copy it into my album as public image",onclick:h,active:j.clipboard.copyImage===!0}),a.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:i.pasteFormat,onclick:g})})}),f(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/WordFilter"])}(this);