b0y-101 Mini Shell


Current Path : E:/www/km/36/components/com_jce/editor/tiny_mce/plugins/clipboard/
File Upload :
Current File : E:/www/km/36/components/com_jce/editor/tiny_mce/plugins/clipboard/editor_plugin.js

/* jce - 2.9.4 | 2021-03-16 | https://www.joomlacontenteditor.net | Copyright (C) 2006 - 2021 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */
!function(){function namedColorToHex(value){return each(namedColors,function(name,hex){if(value.toLowerCase()===name.toLowerCase())return value=hex,!1}),value.toLowerCase()}function filter(content,items){return each(items,function(v){content=v.constructor==RegExp?content.replace(v,""):content.replace(v[0],v[1])}),content}function cleanCssContent(content){var classes=[],rules=parseCssToRules(content);return each(rules,function(r){r.selectorText&&each(r.selectorText.split(","),function(v){if(v=v.replace(/^\s*|\s*$|^\s\./g,""),!/\.mso/i.test(v)&&/\.[\w\-]+$/.test(v)){var text=r.cssText||"";text&&tinymce.inArray(classes,text)===-1&&classes.push(text)}})}),classes.join("")}function isWordContent(editor,content){return!!editor.settings.clipboard_paste_force_cleanup||(!!(/(content=\"OpenOffice.org[^\"]+\")/i.test(content)||ooRe.test(content)||/@page {/.test(content))||(/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(content)||/class="OutlineElement/.test(content)||/id="?docs\-internal\-guid\-/.test(content)))}function trimHtml(html){function trimSpaces(all,s1,s2){return s1||s2?" ":" "}function getInnerFragment(html){var startFragment="<!--StartFragment-->",endFragment="<!--EndFragment-->",startPos=html.indexOf(startFragment);if(startPos!==-1){var fragmentHtml=html.substr(startPos+startFragment.length),endPos=fragmentHtml.indexOf(endFragment);if(endPos!==-1&&/^<\/(p|h[1-6]|li)>/i.test(fragmentHtml.substr(endPos+endFragment.length,5)))return fragmentHtml.substr(0,endPos)}return html}return html=filter(getInnerFragment(html),[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">(\u00a0|&nbsp;)<\/span>( ?)/g,trimSpaces],/<br class="Apple-interchange-newline">/g,/^<meta[^>]+>/g,/<br>$/i])}function innerText(html){function walk(node){var name=node.name,currentNode=node;if("br"===name)return void(text+="\n");if(shortEndedElements[name]&&(text+=" "),ignoreElements[name])return void(text+=" ");if(3==node.type&&(text+=node.value),!node.shortEnded&&(node=node.firstChild))do walk(node);while(node=node.next);blockElements[name]&&currentNode.next&&(text+="\n","p"==name&&(text+="\n"))}var schema=new Schema,domParser=new DomParser({},schema),text="",shortEndedElements=schema.getShortEndedElements(),ignoreElements=tinymce.makeMap("script noscript style textarea video audio iframe object"," "),blockElements=schema.getBlockElements();return html=filter(html,[/<!\[[^\]]+\]>/g]),walk(domParser.parse(html)),text}function removeExplorerBrElementsAfterBlocks(self,o){if(o.wordContent){var editor=self.editor,html=o.content,blockElements=[];each(editor.schema.getBlockElements(),function(block,blockName){blockElements.push(blockName)});var explorerBlocksRegExp=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+blockElements.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");html=filter(html,[[explorerBlocksRegExp,"$1"]]),html=filter(html,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]]),o.content=html}}function removeWebKitStyles(self,o){var editor=self.editor,content=o.content;if(!o.internal&&!isWordContent(editor,o.content)){var webKitStyles=editor.settings.paste_webkit_styles;if(editor.settings.clipboard_paste_remove_styles_if_webkit===!0&&"all"!=webKitStyles){if(webKitStyles&&(webKitStyles=webKitStyles.split(/[, ]/)),webKitStyles){var dom=editor.dom,node=editor.selection.getNode();content=content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(all,before,value,after){var inputStyles=dom.parseStyle(value,"span"),outputStyles={};if("none"===webKitStyles)return before+after;for(var i=0;i<webKitStyles.length;i++){var inputValue=inputStyles[webKitStyles[i]],currentValue=dom.getStyle(node,webKitStyles[i],!0);/color/.test(webKitStyles[i])&&(inputValue=dom.toHex(inputValue),currentValue=dom.toHex(currentValue)),currentValue!=inputValue&&(outputStyles[webKitStyles[i]]=inputValue)}return outputStyles=dom.serializeStyle(outputStyles,"span"),outputStyles?before+' style="'+outputStyles+'"'+after:before+after})}else content=content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");content=content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(all,before,value,after){return before+' style="'+value+'"'+after}),o.content=content}}}function preProcess(self,o){var ed=self.editor,h=o.content;h=h.replace(/^\s*(&nbsp;)+/g,""),h=h.replace(/(&nbsp;|<br[^>]*>)+\s*$/g,""),self.pasteAsPlainText||(o.wordContent=isWordContent(ed,h)&&!o.internal,o.wordContent&&(h=WordFilter(ed,h)),ed.settings.verify_html===!1&&(h=h.replace(/<b\b([^>]*)>/gi,"<strong$1>"),h=h.replace(/<\/b>/gi,"</strong>")),o.content=h)}function postProcess(self,o){var ed=self.editor,dom=ed.dom;if(!self.pasteAsPlainText){if(each(dom.select("span.Apple-style-span",o.node),function(n){dom.remove(n,1)}),1==ed.getParam("clipboard_paste_strip_class_attributes",2)&&each(dom.select("*[class]",o.node),function(el){el.removeAttribute("class")}),each(dom.select("table, td, th",o.node),function(n){(value=dom.getAttrib(n,"width"))&&(dom.setStyle(n,"width",value),dom.setAttrib(n,"width","")),(value=dom.getAttrib(n,"height"))&&(dom.setStyle(n,"height",value),dom.setAttrib(n,"height",""))}),ed.getParam("clipboard_paste_remove_styles",1)?each(dom.select("*[style]",o.node),function(el){el.removeAttribute("style"),el.removeAttribute("data-mce-style")}):processStyles(ed,o.node),o.wordContent){var borderColors=["border-top-color","border-right-color","border-bottom-color","border-left-color"],positions=["top","right","bottom","left"];each(dom.select("table[style], td[style], th[style]",o.node),function(n){var styles={};each(borderStyles,function(name){if(/-(top|right|bottom|left)-/.test(name)){var value=dom.getStyle(n,name);name.indexOf("color")!==-1&&("currentcolor"!==value&&"windowtext"!==value||each(borderColors,function(str){if(str===name)return!0;var val=dom.getStyle(n,str);return!!/(currentcolor|windowtext)/.test(val)||void(value=val)}),value=namedColorToHex(value)),"medium"===value&&(value="1"),name.indexOf("style")!==-1&&"none"===value&&(value="solid"),value&&/^\d[a-z]?/.test(value)&&(value=convertToPixels(value)),styles[name]=value}}),each(positions,function(pos){var padding=dom.getStyle(n,"padding-"+pos),margin=dom.getStyle(n,"margin-"+pos);padding&&(styles["padding-"+pos]=convertToPixels(padding)),margin&&(styles["margin-"+pos]=convertToPixels(margin))}),each(styles,function(value,name){if(name.indexOf("-width")!==-1&&""===value){var prefix=name.replace(/-width/,"");delete styles[prefix+"-style"],delete styles[prefix+"-color"],delete styles[name]}name.indexOf("color")!==-1&&(styles[name]=namedColorToHex(value))}),each(backgroundStyles,function(def,name){var value=dom.getStyle(n,name);value===def&&(value=""),styles[name]=value}),dom.setStyle(n,"border",""),dom.setStyle(n,"background",""),dom.setStyles(n,styles)})}o.wordContent&&each(dom.select("[data-mce-indent]",o.node),function(el){if("p"===el.nodeName){var value=dom.getAttrib(el,"data-mce-indent"),style=ed.settings.indent_use_margin?"margin-left":"padding-left";dom.setStyle(el,style,value+"px")}dom.setAttrib(el,"data-mce-indent","")});var imgRe=/(file:|data:image)\//i,uploader=ed.plugins.upload,canUpload=uploader&&uploader.plugins.length;if(each(dom.select("img",o.node),function(el){var s=dom.getAttrib(el,"src");!s||imgRe.test(s)?ed.getParam("clipboard_paste_upload_images")&&canUpload?ed.dom.setAttrib(el,"data-mce-upload-marker","1"):dom.remove(el):dom.setAttrib(el,"src",ed.convertURL(s))}),isIE&&each(dom.select("a",o.node),function(el){each(dom.select("font,u"),function(n){dom.remove(n,1)})}),ed.getParam("clipboard_paste_remove_tags")&&dom.remove(dom.select(ed.getParam("clipboard_paste_remove_tags"),o.node),1),ed.getParam("clipboard_paste_keep_tags")){var tags=ed.getParam("clipboard_paste_keep_tags");dom.remove(dom.select("*:not("+tags+")",o.node),1)}ed.getParam("clipboard_paste_remove_spans")?dom.remove(dom.select("span",o.node),1):(ed.dom.remove(dom.select("span:empty",o.node)),each(dom.select("span",o.node),function(n){n.childNodes&&0!==n.childNodes.length||dom.remove(n),0===dom.getAttribs(n).length&&dom.remove(n,1)})),ed.getParam("clipboard_paste_remove_empty_paragraphs",!0)&&(dom.remove(dom.select("p:empty",o.node)),each(dom.select("p",o.node),function(n){var h=n.innerHTML;n.childNodes&&0!==n.childNodes.length&&!/^(\s|&nbsp;|\u00a0)?$/.test(h)||dom.remove(n)}))}}function processStyles(editor,node){var dom=editor.dom,keepStyles=editor.getParam("clipboard_paste_retain_style_properties"),removeStyles=editor.getParam("clipboard_paste_remove_style_properties");keepStyles&&tinymce.is(keepStyles,"string")&&(styleProps=tinymce.explode(keepStyles),each(styleProps,function(style,i){if("border"===style)return styleProps=styleProps.concat(borderStyles),!0})),removeStyles&&tinymce.is(removeStyles,"string")&&(removeProps=tinymce.explode(removeStyles),each(removeProps,function(style,i){if("border"===style)return removeProps=removeProps.concat(borderStyles),!0}),styleProps=tinymce.grep(styleProps,function(prop){return tinymce.inArray(removeProps,prop)===-1})),each(dom.select("*[style]",node),function(n){var ns={},x=0,styles=dom.parseStyle(n.style.cssText);each(styles,function(v,k){tinymce.inArray(styleProps,k)!=-1&&(ns[k]=v,x++)}),dom.setAttrib(n,"style",""),ns=dom.parseStyle(dom.serializeStyle(ns,n.nodeName)),x>0?dom.setStyles(n,ns):"SPAN"!=n.nodeName||n.className||dom.remove(n,!0),tinymce.isWebKit&&n.removeAttribute("data-mce-style")}),each(dom.select("*[align]",node),function(el){var v=dom.getAttrib(el,"align");"left"!==v&&"right"!==v&&"center"!==v||(/(IFRAME|IMG|OBJECT|VIDEO|AUDIO|EMBED)/i.test(el.nodeName)?"center"===v?dom.setStyles(el,{margin:"auto",display:"block"}):dom.setStyle(el,"float",v):dom.setStyle(el,"text-align",v)),el.removeAttribute("align")})}function convertToPixels(v){return 0===parseInt(v,10)?0:(v.indexOf("pt")!==-1&&(v=parseInt(v,10),v=Math.ceil(v/1.33333),v=Math.abs(v)),v&&(v+="px"),v)}function isNumericList(text){var patterns,found="";return patterns={"uppper-roman":/^[IVXLMCD]{1,2}\.[ \u00a0]/,"lower-roman":/^[ivxlmcd]{1,2}\.[ \u00a0]/,"upper-alpha":/^[A-Z]{1,2}[\.\)][ \u00a0]/,"lower-alpha":/^[a-z]{1,2}[\.\)][ \u00a0]/,numeric:/^[0-9]+\.[ \u00a0]/,japanese:/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,chinese:/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/},text=text.replace(/^[\u00a0 ]+/,""),each(patterns,function(pattern,type){if(pattern.test(text))return found=type,!1}),found}function isBulletList(text){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text)}function WordFilter(editor,content){function convertFakeListsToProperLists(node){function getText(node){var txt="";if(3===node.type)return node.value;if(node=node.firstChild)do txt+=getText(node);while(node=node.next);return txt}function trimListStart(node,regExp){if(3===node.type&&regExp.test(node.value))return node.value=node.value.replace(regExp,""),!1;if(node=node.firstChild)do if(!trimListStart(node,regExp))return!1;while(node=node.next);return!0}function removeIgnoredNodes(node){if(node._listIgnore)return void node.remove();if(node=node.firstChild)do removeIgnoredNodes(node);while(node=node.next)}function convertParagraphToLi(paragraphNode,listName,start,type){var level=paragraphNode._listLevel||lastLevel;if(level!=lastLevel&&(level<lastLevel?currentListNode&&(currentListNode=currentListNode.parent.parent):(prevListNode=currentListNode,currentListNode=null)),currentListNode&&currentListNode.name==listName)currentListNode.append(paragraphNode);else{if(prevListNode=prevListNode||currentListNode,currentListNode=new Node(listName,1),type&&/roman|alpha/.test(type)){var style="list-style-type:"+type;currentListNode.attr({style:style,"data-mce-style":style})}start>1&&currentListNode.attr("start",""+start),paragraphNode.wrap(currentListNode)}paragraphNode.name="li",level>lastLevel&&prevListNode&&prevListNode.lastChild.append(currentListNode),lastLevel=level,removeIgnoredNodes(paragraphNode),trimListStart(paragraphNode,/^\u00a0+/),"ol"===currentListNode.name&&trimListStart(paragraphNode,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),"ul"===currentListNode.name&&trimListStart(paragraphNode,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),trimListStart(paragraphNode,/^\u00a0+/)}for(var currentListNode,prevListNode,lastLevel=1,elements=[],child=node.firstChild;"undefined"!=typeof child&&null!==child;)if(elements.push(child),child=child.walk(),null!==child)for(;"undefined"!=typeof child&&child.parent!==node;)child=child.walk();for(var i=0;i<elements.length;i++)if(node=elements[i],"p"==node.name&&node.firstChild){var type,nodeText=getText(node);if(isBulletList(nodeText)){convertParagraphToLi(node,"ul");continue}if(node.attr("data-mce-word-list")&&(node.attr("data-mce-word-list",null),type=isNumericList(nodeText))){var matches=/([0-9]+)\./.exec(nodeText),start=1;matches&&(start=parseInt(matches[1],10)),convertParagraphToLi(node,"ol",start,type);continue}if(node._listLevel){convertParagraphToLi(node,"ul",1);continue}currentListNode=null}else prevListNode=currentListNode,currentListNode=null}function filterStyles(node,styleValue){var matches,outputStyles={},styles=editor.dom.parseStyle(styleValue);return each(styles,function(value,name){switch(name){case"mso-list":matches=/\w+ \w+([0-9]+)/i.exec(styleValue),matches&&(node._listLevel=parseInt(matches[1],10)),/Ignore/i.test(value)&&node.firstChild&&(node._listIgnore=!0,node.firstChild._listIgnore=!0);break;case"horiz-align":name="text-align";break;case"vert-align":name="vertical-align";break;case"font-color":case"mso-foreground":case"color":name="color","windowtext"==value&&(value="");break;case"mso-background":case"mso-highlight":name="background";break;case"font-weight":case"font-style":"normal"==value&&(value="");break;case"mso-element":if(/^(comment|comment-list)$/i.test(value))return void node.remove();break;case"margin-left":if("p"===node.name&&settings.paste_convert_indents!==!1){var indentValue=parseInt(editor.settings.indentation,10);value=parseInt(value,10),value=Math.round(value/indentValue)*indentValue,value&&(node.attr("data-mce-indent",""+value),value="")}}return 0===name.indexOf("mso-comment")?void node.remove():void(0!==name.indexOf("mso-")&&(value&&tinymce.inArray(pixelStyles,name)!==-1&&(value=convertToPixels(value)),validStyles[name]&&(outputStyles[name]=value)))}),/(bold)/i.test(outputStyles["font-weight"])&&(delete outputStyles["font-weight"],node.wrap(new Node("b",1))),/(italic)/i.test(outputStyles["font-style"])&&(delete outputStyles["font-style"],node.wrap(new Node("i",1))),outputStyles=editor.dom.serializeStyle(outputStyles,node.name),outputStyles?outputStyles:null}var keepStyles,removeStyles,settings=editor.settings,validStyles={};if(content=content.replace(/<meta([^>]+)>/,""),content=content.replace(/<style([^>]*)>([\w\W]*?)<\/style>/gi,function(match,attr,value){return settings.clipboard_paste_keep_word_styles!==!0?"":(value=cleanCssContent(value),"<style"+attr+">"+value+"</style>")}),content=content.replace(/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""),content=content.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),content=content.replace(/<br class="?Apple-interchange-newline"?>/gi,""),keepStyles=settings.clipboard_paste_retain_style_properties,removeStyles=settings.clipboard_paste_remove_style_properties,keepStyles&&tinymce.is(keepStyles,"string")&&(styleProps=tinymce.explode(keepStyles),each(styleProps,function(style,i){if("border"===style)return styleProps=styleProps.concat(borderStyles),!0})),removeStyles&&tinymce.is(removeStyles,"string")&&(removeProps=tinymce.explode(removeStyles),each(removeProps,function(style,i){if("border"===style)return removeProps=removeProps.concat(borderStyles),!0}),styleProps=tinymce.grep(styleProps,function(prop){return tinymce.inArray(removeProps,prop)===-1})),each(styleProps,function(style){return"border"===style?(each(borderStyles,function(name){validStyles[name]={}}),!0):void(validStyles[style]={})}),editor.getParam("clipboard_paste_remove_styles",1)&&(validStyles={}),settings.paste_enable_default_filters===!1)return content;content=filter(content,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi," "],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(str,spaces){return spaces.length>0?spaces.replace(/./," ").slice(Math.floor(spaces.length/2)).split("").join(" "):""}]]),settings.inline_styles&&(content=content.replace(/<(u|strike)>/gi,function(match,node){var value="u"===node?"underline":"line-through";return'<span style="text-decoration:'+value+';">'}),content=content.replace(/<\/(u|strike)>/g,"</span>")),content=content.replace(/<table([^>]+)>/,function($1,$2){return"html4"!==settings.schema&&($2=$2.replace(/(border|cell(padding|spacing))="([^"]+)"/gi,"")),"<table"+$2+">"}),settings.forced_root_block&&(content=content.replace(/<br><br>/gi,""));var validElements=settings.paste_word_valid_elements;validElements||(validElements="-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],img[src|alt|width|height],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");var schema=new Schema({valid_elements:validElements,valid_children:"-li[p]"});each(schema.elements,function(rule){rule.attributes.class||(rule.attributes.class={},rule.attributesOrder.push("class")),rule.attributes.style||(rule.attributes.style={},rule.attributesOrder.push("style"))});var domParser=new DomParser({},schema);domParser.addAttributeFilter("style",function(nodes){for(var node,style,i=nodes.length;i--;)node=nodes[i],style=node.attr("style"),style&&style.indexOf("mso-list")!==-1&&"li"!==node.name&&node.attr("data-mce-word-list",1),node.attr("style",filterStyles(node,style)),"span"==node.name&&node.parent&&!node.attributes.length&&node.unwrap()}),domParser.addAttributeFilter("class",function(nodes){for(var node,className,i=nodes.length;i--;)if(node=nodes[i],className=node.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className))node.remove();else if(/^Mso[\w]+/i.test(className)||editor.getParam("clipboard_paste_strip_class_attributes",2)){if(node.attr("class",null),className&&className.indexOf("MsoList")!==-1&&"li"!==node.name&&node.attr("data-mce-word-list",1),className&&/\s*Mso(Foot|End)note\s*/.test(className)){var parent=node.parent;parent&&"a"===parent.name&&(node.name="sup"),"span"!==node.name||node.attributes.length||node.unwrap()}className&&/\s*MsoQuote\s*/.test(className)&&(node.name="blockquote")}}),domParser.addNodeFilter("del",function(nodes){for(var i=nodes.length;i--;)nodes[i].remove()});var footnotes=editor.getParam("clipboard_paste_process_footnotes","convert");domParser.addNodeFilter("a",function(nodes){for(var node,href,name,i=nodes.length;i--;)if(node=nodes[i],href=node.attr("href"),name=node.attr("name"),href&&href.indexOf("#_msocom_")!=-1)node.remove();else if(href&&!name&&(href=editor.convertURL(href)),href&&href.indexOf("#")!==-1&&(href=href.substr(href.indexOf("#"))),href||name){if(name&&!/^_?(?:toc|edn|ftn)/i.test(name)){node.unwrap();continue}if(name&&"remove"===footnotes){node.remove();continue}if(name&&"unlink"===footnotes){node.unwrap();continue}node.attr({href:href,name:null}),"html4"===settings.schema?node.attr("name",name):node.attr("id",name)}else node.unwrap()}),domParser.addNodeFilter("span",function(nodes){for(var node,i=nodes.length;i--;)node=nodes[i],node.parent&&!node.attributes.length&&node.unwrap()}),editor.getParam("clipboard_paste_remove_paragraph_in_table_cell")&&domParser.addNodeFilter("td",function(nodes){for(var node,firstChild,lastChild,i=nodes.length;i--;)node=nodes[i],firstChild=node.firstChild,lastChild=node.lastChild,"p"===firstChild.name&&firstChild===lastChild&&firstChild.unwrap()});var rootNode=domParser.parse(content);return settings.paste_convert_word_fake_lists!==!1&&convertFakeListsToProperLists(rootNode),content=new Serializer({validate:settings.validate},schema).serialize(rootNode)}function convertURLs(ed,content){function createLink(url){var attribs=['href="'+url+'"'];return ed.settings.default_link_target&&attribs.push('target="'+ed.settings.default_link_target+'"'),"<a "+attribs.join(" ")+">"+url+"</a>"}function wrapContent(content){return content.indexOf('data-mce-convert="url"')===-1?'<div data-mce-convert="url">'+content+"</div>":content}var ex="([-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+.[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+)",ux="((?:news|telnet|nttp|file|http|ftp|https)://[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~;]+.[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~;]+)",attribRe="(?:(?:href|src|poster|data|value|srcset|longdesc|usemap|cite|classid|codebase)=[\"'])",bracketRe="(?:{|].?)",decoded=ed.dom.decode(content);if(/^<a([^>]+)>([\s\S]+?)<\/a>$/.test(decoded))return content;if(ed.getParam("autolink_url",!0)){if(new RegExp("^"+ux+"$").test(content))return content=createLink(content);content=wrapContent(content),content=content.replace(new RegExp("("+attribRe+"|"+bracketRe+")?"+ux,"gi"),function(match,extra,url){return extra?match:createLink(url)})}if(ed.getParam("autolink_email",!0)){if(new RegExp("^"+ex+"$").test(content))return'<a href="mailto:'+content+'">'+content+"</a>";content=wrapContent(content),content=content.replace(new RegExp("(href=[\"']mailto:)*"+ex,"g"),function(match,attrib,email){return attrib?match:'<a href="mailto:'+email+'">'+email+"</a>"})}return content}function getDataTransferItems(dataTransfer){var items={};if(dataTransfer){if(dataTransfer.getData){var legacyText=dataTransfer.getData("Text");legacyText&&legacyText.length>0&&(items["text/plain"]=legacyText)}if(dataTransfer.types)for(var i=0;i<dataTransfer.types.length;i++){var contentType=dataTransfer.types[i];items[contentType]=dataTransfer.getData(contentType)}}return items}function getClipboardContent(editor,clipboardEvent){var content=getDataTransferItems(clipboardEvent.clipboardData||clipboardEvent.dataTransfer||editor.getDoc().dataTransfer);return navigator.userAgent.indexOf(" Edge/")!==-1&&(content=tinymce.extend(content,{"text/html":""})),editor.onGetClipboardContent.dispatch(editor,content),content}function isKeyboardPasteEvent(e){return VK.metaKeyPressed(e)&&86==e.keyCode||e.shiftKey&&45==e.keyCode}function hasContentType(clipboardContent,mimeType){return mimeType in clipboardContent&&clipboardContent[mimeType].length>0}function hasHtmlOrText(content){return hasContentType(content,"text/html")||hasContentType(content,"text/plain")}var each=tinymce.each,VK=tinymce.VK,Event=tinymce.dom.Event,Schema=tinymce.html.Schema,DomParser=tinymce.html.DomParser,Serializer=tinymce.html.Serializer,Node=tinymce.html.Node,DOM=tinymce.DOM,Dispatcher=(tinymce.html.Entities,tinymce.util.Dispatcher),styleProps=["background","background-attachment","background-color","background-image","background-position","background-repeat","border","border-bottom","border-bottom-color","border-bottom-style","border-bottom-width","border-color","border-left","border-left-color","border-left-style","border-left-width","border-right","border-right-color","border-right-style","border-right-width","border-style","border-top","border-top-color","border-top-style","border-top-width","border-width","outline","outline-color","outline-style","outline-width","height","max-height","max-width","min-height","min-width","width","font","font-family","font-size","font-style","font-variant","font-weight","content","counter-increment","counter-reset","quotes","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","padding","padding-bottom","padding-left","padding-right","padding-top","bottom","clear","clip","cursor","display","float","left","overflow","position","right","top","visibility","z-index","orphans","page-break-after","page-break-before","page-break-inside","widows","border-collapse","border-spacing","caption-side","empty-cells","table-layout","color","direction","letter-spacing","line-height","text-align","text-decoration","text-indent","text-shadow","text-transform","unicode-bidi","vertical-align","white-space","word-spacing"],pixelStyles=["width","height","min-width","max-width","min-height","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"],borderStyles=["border","border-width","border-style","border-color","border-top","border-right","border-bottom","border-left","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style"],backgroundStyles={"background-image":"none","background-position":"0% 0%","background-size":"auto auto","background-repeat":"repeat","background-origin":"padding-box","background-clip":"border-box","background-attachment":"scroll","background-color":"transparent"},namedColors={"#F0F8FF":"AliceBlue","#FAEBD7":"AntiqueWhite","#7FFFD4":"Aquamarine","#F0FFFF":"Azure","#F5F5DC":"Beige","#FFE4C4":"Bisque","#000000":"Black","#FFEBCD":"BlanchedAlmond","#0000FF":"Blue","#8A2BE2":"BlueViolet","#A52A2A":"Brown","#DEB887":"BurlyWood","#5F9EA0":"CadetBlue","#7FFF00":"Chartreuse","#D2691E":"Chocolate","#FF7F50":"Coral","#6495ED":"CornflowerBlue","#FFF8DC":"Cornsilk","#DC143C":"Crimson","#00008B":"DarkBlue","#008B8B":"DarkCyan","#B8860B":"DarkGoldenRod","#A9A9A9":"DarkGray","#006400":"DarkGreen","#BDB76B":"DarkKhaki","#8B008B":"DarkMagenta","#556B2F":"DarkOliveGreen","#FF8C00":"Darkorange","#9932CC":"DarkOrchid","#8B0000":"DarkRed","#E9967A":"DarkSalmon","#8FBC8F":"DarkSeaGreen","#483D8B":"DarkSlateBlue","#2F4F4F":"DarkSlateGrey","#00CED1":"DarkTurquoise","#9400D3":"DarkViolet","#FF1493":"DeepPink","#00BFFF":"DeepSkyBlue","#696969":"DimGrey","#1E90FF":"DodgerBlue","#B22222":"FireBrick","#FFFAF0":"FloralWhite","#228B22":"ForestGreen","#DCDCDC":"Gainsboro","#F8F8FF":"GhostWhite","#FFD700":"Gold","#DAA520":"GoldenRod","#808080":"Grey","#008000":"Green","#ADFF2F":"GreenYellow","#F0FFF0":"HoneyDew","#FF69B4":"HotPink","#CD5C5C":"IndianRed","#4B0082":"Indigo","#FFFFF0":"Ivory","#F0E68C":"Khaki","#E6E6FA":"Lavender","#FFF0F5":"LavenderBlush","#7CFC00":"LawnGreen","#FFFACD":"LemonChiffon","#ADD8E6":"LightBlue","#F08080":"LightCoral","#E0FFFF":"LightCyan","#FAFAD2":"LightGoldenRodYellow","#D3D3D3":"LightGrey","#90EE90":"LightGreen","#FFB6C1":"LightPink","#FFA07A":"LightSalmon","#20B2AA":"LightSeaGreen","#87CEFA":"LightSkyBlue","#778899":"LightSlateGrey","#B0C4DE":"LightSteelBlue","#FFFFE0":"LightYellow","#00FF00":"Lime","#32CD32":"LimeGreen","#FAF0E6":"Linen","#FF00FF":"Magenta","#800000":"Maroon","#66CDAA":"MediumAquaMarine","#0000CD":"MediumBlue","#BA55D3":"MediumOrchid","#9370D8":"MediumPurple","#3CB371":"MediumSeaGreen","#7B68EE":"MediumSlateBlue","#00FA9A":"MediumSpringGreen","#48D1CC":"MediumTurquoise","#C71585":"MediumVioletRed","#191970":"MidnightBlue","#F5FFFA":"MintCream","#FFE4E1":"MistyRose","#FFE4B5":"Moccasin","#FFDEAD":"NavajoWhite","#000080":"Navy","#FDF5E6":"OldLace","#808000":"Olive","#6B8E23":"OliveDrab","#FFA500":"Orange","#FF4500":"OrangeRed","#DA70D6":"Orchid","#EEE8AA":"PaleGoldenRod","#98FB98":"PaleGreen","#AFEEEE":"PaleTurquoise","#D87093":"PaleVioletRed","#FFEFD5":"PapayaWhip","#FFDAB9":"PeachPuff","#CD853F":"Peru","#FFC0CB":"Pink","#DDA0DD":"Plum","#B0E0E6":"PowderBlue","#800080":"Purple","#FF0000":"Red","#BC8F8F":"RosyBrown","#4169E1":"RoyalBlue","#8B4513":"SaddleBrown","#FA8072":"Salmon","#F4A460":"SandyBrown","#2E8B57":"SeaGreen","#FFF5EE":"SeaShell","#A0522D":"Sienna","#C0C0C0":"Silver","#87CEEB":"SkyBlue","#6A5ACD":"SlateBlue","#708090":"SlateGrey","#FFFAFA":"Snow","#00FF7F":"SpringGreen","#4682B4":"SteelBlue","#D2B48C":"Tan","#008080":"Teal","#D8BFD8":"Thistle","#FF6347":"Tomato","#40E0D0":"Turquoise","#EE82EE":"Violet","#F5DEB3":"Wheat","#FFFFFF":"White","#F5F5F5":"WhiteSmoke","#FFFF00":"Yellow","#9ACD32":"YellowGreen"},ooRe=/(Version:[\d\.]+)\s*?((Start|End)(HTML|Fragment):[\d]+\s*?){4}/,InternalHtml=function(){var internalMimeType="x-tinymce/html",internalMark="<!-- "+internalMimeType+" -->",mark=function(html){return internalMark+html},unmark=function(html){return html.replace(internalMark,"")},isMarked=function(html){return html.indexOf(internalMark)!==-1};return{mark:mark,unmark:unmark,isMarked:isMarked,internalHtmlMime:function(){return internalMimeType}}},InternalHtml=new InternalHtml,CutCopy=function(editor){var noop=function(){},hasWorkingClipboardApi=function(clipboardData){return tinymce.isIOS===!1&&void 0!==clipboardData&&"function"==typeof clipboardData.setData},setHtml5Clipboard=function(clipboardData,html,text){if(!hasWorkingClipboardApi(clipboardData))return!1;try{return clipboardData.clearData(),clipboardData.setData("text/html",html),clipboardData.setData("text/plain",text),clipboardData.setData(InternalHtml.internalHtmlMime(),html),!0}catch(e){return!1}},setClipboardData=function(evt,data,fallback,done){setHtml5Clipboard(evt.clipboardData,data.html,data.text)?(evt.preventDefault(),done()):fallback(data.html,done)},fallback=function(editor){return function(html,done){var markedHtml=InternalHtml.mark(html),outer=editor.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),inner=editor.dom.create("div",{contenteditable:"true"},markedHtml);editor.dom.setStyles(outer,{position:"fixed",left:"-3000px",width:"1000px",overflow:"hidden"}),outer.appendChild(inner),editor.dom.add(editor.getBody(),outer);var range=editor.selection.getRng();inner.focus();var offscreenRange=editor.dom.createRng();offscreenRange.selectNodeContents(inner),editor.selection.setRng(offscreenRange),setTimeout(function(){outer.parentNode.removeChild(outer),editor.selection.setRng(range),done()},0)}},getData=function(editor){return{html:editor.selection.getContent({contextual:!0}),text:editor.selection.getContent({format:"text"})}},cut=function(editor,evt){editor.selection.isCollapsed()===!1&&setClipboardData(evt,getData(editor),fallback(editor),function(){setTimeout(function(){editor.execCommand("Delete")},0)})},copy=function(editor,evt){editor.selection.isCollapsed()===!1&&setClipboardData(evt,getData(editor),fallback(editor),noop)},register=function(editor){editor.onCut.add(cut),editor.onCopy.add(copy)};return{register:register}},parseCssToRules=function(content){var doc=document.implementation.createHTMLDocument(""),styleElement=document.createElement("style");return styleElement.textContent=content,doc.body.appendChild(styleElement),styleElement.sheet.cssRules},Newlines=function(){var Entities=tinymce.html.Entities,isPlainText=function(text){return!/<(?:(?!\/?(?:div|p|br))[^>]*|(?:div|p|br)\s+\w[^>]+)>/.test(text)},toBRs=function(text){return text.replace(/\r?\n/g,"<br>")},openContainer=function(rootTag,rootAttrs){var key,attrs=[],tag="<"+rootTag;if("object"==typeof rootAttrs){for(key in rootAttrs)rootAttrs.hasOwnProperty(key)&&attrs.push(key+'="'+Entities.encodeAllRaw(rootAttrs[key])+'"');attrs.length&&(tag+=" "+attrs.join(" "))}return tag+">"},toBlockElements=function(text,rootTag,rootAttrs){var isLast,newlineFollows,isSingleNewline,pieces=text.split(/\r?\n/),i=0,len=pieces.length,stack=[],blocks=[],tagOpen=openContainer(rootTag,rootAttrs),tagClose="</"+rootTag+">";if(1===pieces.length)return text;for(;i<len;i++)isLast=i===len-1,newlineFollows=!isLast&&!pieces[i+1],isSingleNewline=!pieces[i]&&!stack.length,stack.push(pieces[i]?pieces[i]:"&nbsp;"),(isLast||newlineFollows||isSingleNewline)&&(blocks.push(stack.join("<br>")),stack=[]),newlineFollows&&i++;return 1===blocks.length?blocks[0]:tagOpen+blocks.join(tagClose+tagOpen)+tagClose;
},convert=function(text,rootTag,rootAttrs){return rootTag?toBlockElements(text,rootTag,rootAttrs):toBRs(text)};return{isPlainText:isPlainText,convert:convert,toBRs:toBRs,toBlockElements:toBlockElements}},isIE=tinymce.isIE||tinymce.isIE12;tinymce.create("tinymce.plugins.ClipboardPlugin",{init:function(ed,url){function pasteText(text){text=ed.dom.encode(text).replace(/\r\n/g,"\n"),text=(new Newlines).convert(text,ed.settings.forced_root_block,ed.settings.forced_root_block_attrs),pasteHtml(text)}function sanitizePastedHTML(html){var parser=new DomParser({allow_event_attributes:!!ed.settings.clipboard_paste_allow_event_attributes},ed.schema);parser.addNodeFilter("meta,svg,script,noscript",function(nodes){for(var i=nodes.length;i--;)nodes[i].remove()}),ed.getParam("clipboard_paste_remove_spans")&&parser.addNodeFilter("span",function(nodes,name){for(var i=nodes.length;i--;)nodes[i].unwrap()});var remove_attribs=ed.getParam("clipboard_paste_remove_attributes");remove_attribs&&parser.addAttributeFilter(remove_attribs,function(nodes,name){for(var i=nodes.length;i--;)nodes[i].attr(name,null)});var fragment=parser.parse(html,{forced_root_block:!1,isRootContent:!0});return new Serializer({validate:ed.settings.validate},ed.schema).serialize(fragment)}function pasteHtml(content,internal){if(content){var o={content:content,internal:internal};if(!internal&&(self.onPreProcess.dispatch(self,o),o.content=sanitizePastedHTML(o.content),ed.getParam("clipboard_paste_convert_urls",!0)&&(o.content=convertURLs(ed,o.content)),o.node=ed.dom.create("div",{style:"display:none"},o.content),self.onPostProcess.dispatch(self,o),o.content=ed.serializer.serialize(o.node,{getInner:1,forced_root_block:""}),ed.getParam("clipboard_paste_remove_empty_paragraphs",!0)&&(o.content=o.content.replace(/<p([^>]+)>(&nbsp;|\u00a0)?<\/p>/g,"")),ed.getParam("clipboard_paste_remove_whitespace")&&(o.content=o.content.replace(/(&nbsp;|\u00a0|\s| ){2,}/g," ")),ed.getParam("clipboard_paste_filter"))){var re,rules=ed.getParam("clipboard_paste_filter").split(";");each(rules,function(s){re=/^\/.*\/(g|i|m)*$/.test(s)?new Function("return "+s)():new RegExp(s),o.content=o.content.replace(re,"")})}ed.onPasteBeforeInsert.dispatch(ed,o),self._insert(o.content),self.pasteAsPlainText=!1}}function insertClipboardContent(clipboardContent,internal){var content,isPlainTextHtml;if(content=clipboardContent["x-tinymce/html"]||clipboardContent["text/html"],content=trimHtml(content),content!==pasteBinDefaultContent)return self.pasteAsPlainText?(isPlainTextHtml=internal===!1&&(new Newlines).isPlainText(content),content=hasContentType(clipboardContent,"text/plain")&&isPlainTextHtml?clipboardContent["text/plain"]:innerText(content),pasteText(content),!0):void pasteHtml(content,internal)}function createPasteBin(){function getCaretRect(rng){var rects,textNode,node,container=rng.startContainer;if(rects=rng.getClientRects(),rects.length)return rects[0];if(rng.collapsed&&1==container.nodeType){for(node=container.childNodes[lastRng.startOffset];node&&3==node.nodeType&&!node.data.length;)node=node.nextSibling;if(node)return"BR"==node.tagName&&(textNode=dom.doc.createTextNode("\ufeff"),node.parentNode.insertBefore(textNode,node),rng=dom.createRng(),rng.setStartBefore(textNode),rng.setEndAfter(textNode),rects=rng.getClientRects(),dom.remove(textNode)),rects.length?rects[0]:void 0}}var scrollContainer,dom=ed.dom,body=ed.getBody(),viewport=ed.dom.getViewPort(ed.getWin()),scrollTop=viewport.y,top=20;if(lastRng=ed.selection.getRng(),lastRng.getClientRects){var rect=getCaretRect(lastRng);if(rect)top=scrollTop+(rect.top-dom.getPos(body).y);else{top=scrollTop;var container=lastRng.startContainer;container&&(3==container.nodeType&&container.parentNode!=body&&(container=container.parentNode),1==container.nodeType&&(top=dom.getPos(container,scrollContainer||body).y))}}pasteBinElm=dom.add(ed.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+top+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},pasteBinDefaultContent),(isIE||tinymce.isGecko)&&dom.setStyle(pasteBinElm,"left","rtl"==dom.getStyle(body,"direction",!0)?65535:-65535),pasteBinElm.focus(),ed.selection.select(pasteBinElm,!0)}function removePasteBin(){if(pasteBinElm){for(var pasteBinClone;pasteBinClone=ed.dom.get("mcepastebin");)ed.dom.remove(pasteBinClone),ed.dom.unbind(pasteBinClone);lastRng&&ed.selection.setRng(lastRng)}pasteBinElm=lastRng=null}function getPasteBinHtml(){var pasteBinClones,i,clone,cloneHtml,html="";for(pasteBinClones=ed.dom.select("div[id=mcepastebin]"),i=0;i<pasteBinClones.length;i++)clone=pasteBinClones[i],clone.firstChild&&"mcepastebin"==clone.firstChild.id&&(clone=clone.firstChild),cloneHtml=clone.innerHTML,html!=pasteBinDefaultContent&&(html+=cloneHtml);return html}function getContentFromPasteBin(e){function block(e){e.preventDefault()}var dom=ed.dom;if(!dom.get("mcepastebin")){if(createPasteBin(),isIE&&isIE<11){var rng;rng=dom.doc.body.createTextRange(),rng.moveToElementText(pasteBinElm),rng.execCommand("Paste");var html=pasteBinElm.innerHTML;return html===pasteBinDefaultContent?void e.preventDefault():(removePasteBin(),setTimeout(function(){insertClipboardContent({"text/html":html})},0),void Event.cancel(e))}dom.bind(ed.getDoc(),"mousedown",block),dom.bind(ed.getDoc(),"keydown",block),window.setTimeout(function(){var html=getPasteBinHtml();removePasteBin(),insertClipboardContent({"text/html":html}),dom.unbind(ed.getDoc(),"mousedown",block),dom.unbind(ed.getDoc(),"keydown",block)},0)}}function isHtmlPaste(content){return!!hasContentType(content,"text/html")}function isSafari(){var ua=navigator.userAgent;return ua.indexOf("AppleWebKit")!==-1&&ua.indexOf("Safari")!==-1}function isPlainTextPaste(content){return!!self.pasteAsPlainText||!isIE&&(!hasContentType(content,"text/html")&&(!!hasContentType(content,"text/plain")&&!(isSafari()&&"text/rtf"in content)))}function pasteImageData(e){function processItems(items){var i,item,hadImage=!1;if(items)for(i=0;i<items.length;i++)item=items[i],/^image\/(jpeg|png|gif|bmp)$/.test(item.type)&&(e.preventDefault(),hadImage=!0);return hadImage}var dataTransfer=e.clipboardData||e.dataTransfer;return processItems(dataTransfer.items)||processItems(dataTransfer.files)}function isPasteInPre(ed){var node=ed.selection.getNode();return ed.settings.html_paste_in_pre!==!1&&node&&"PRE"===node.nodeName}function getCaretRangeFromEvent(ed,e){return tinymce.dom.RangeUtils.getCaretRangeFromPoint(e.clientX,e.clientY,ed.getDoc())}function isPlainTextFileUrl(content){var plainTextContent=content["text/plain"];return!!plainTextContent&&0===plainTextContent.indexOf("file://")}function getContentAndInsert(ed,e){var clipboardContent=getClipboardContent(ed,e);removePasteBin();var internal=hasContentType(clipboardContent,InternalHtml.internalHtmlMime());if(isPasteInPre(ed)){var html=clipboardContent["text/html"]||"",text=clipboardContent["text/plain"];return text=ed.dom.encode(text),html&&!text&&(text=ed.dom.encode(html)),e.preventDefault(),ed.selection.setContent(text,{no_events:!0}),!0}if(!isPlainTextFileUrl(clipboardContent)){if(!hasHtmlOrText(clipboardContent)&&pasteImageData(e))return pasteHtml('<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-mce-upload-marker="1" />',!0),!0;if(!internal&&isPlainTextPaste(clipboardContent)){var text=clipboardContent["text/plain"];return self.pasteAsPlainText=!0,pasteText(text),void e.preventDefault()}return isHtmlPaste(clipboardContent)?(internal||(internal=InternalHtml.isMarked(clipboardContent["text/html"])),e.preventDefault(),insertClipboardContent(clipboardContent,internal),!0):void 0}}var self=this;self.editor=ed,self.url=url,(new CutCopy).register(ed);var pasteBinElm,lastRng,keyboardPastePlainTextState,pasteBinDefaultContent="%MCEPASTEBIN%";this.canPaste=!1,this.pasteAsPlainText=!1,self.onPreProcess=new Dispatcher(this),self.onPostProcess=new Dispatcher(this),ed.onGetClipboardContent=new Dispatcher(this),ed.onPastePreProcess=new Dispatcher(this),ed.onPastePostProcess=new Dispatcher(this),ed.onPasteBeforeInsert=new Dispatcher(this),tinymce.isWebKit&&self.onPreProcess.add(function(self,o){removeWebKitStyles(self,o)}),isIE&&self.onPreProcess.add(function(self,o){removeExplorerBrElementsAfterBlocks(self,o)}),self.onPreProcess.add(function(self,o){preProcess(self,o),ed.onPastePreProcess.dispatch(ed,o),ed.execCallback("paste_preprocess",self,o)}),self.onPostProcess.add(function(self,o){postProcess(self,o),ed.onPastePostProcess.dispatch(ed,o),ed.execCallback("paste_postprocess",self,o)}),self.pasteText=ed.getParam("clipboard_paste_text",1),self.pasteHtml=ed.getParam("clipboard_paste_html",1),ed.addCommand("mceInsertClipboardContent",function(u,data){self.pasteAsPlainText=!1,data.text&&(self.pasteAsPlainText=!0,pasteText(data.text)),data.content&&pasteHtml(data.content)}),ed.onPreInit.add(function(){ed.serializer.addAttributeFilter("data-mce-convert",function(nodes,name){for(var node,i=nodes.length;i--;)node=nodes[i],node.unwrap()}),ed.parser.addAttributeFilter("data-mce-convert",function(nodes,name){for(var node,i=nodes.length;i--;)node=nodes[i],node.unwrap()})}),ed.onInit.add(function(){ed.plugins.contextmenu&&ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var c=ed.selection.isCollapsed();ed.getParam("clipboard_cut",1)&&m.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(c),ed.getParam("clipboard_copy",1)&&m.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(c),self.pasteHtml&&m.add({title:"clipboard.paste_desc",icon:"paste",cmd:"mcePaste"}),self.pasteText&&m.add({title:"clipboard.paste_text_desc",icon:"pastetext",cmd:"mcePasteText"})})}),ed.onKeyDown.add(function(ed,e){return!ed.getParam("clipboard_allow_cut",1)&&VK.metaKeyPressed&&88==e.keyCode?(e.preventDefault(),!1):!ed.getParam("clipboard_allow_copy",1)&&VK.metaKeyPressed&&67==e.keyCode?(e.preventDefault(),!1):void(isKeyboardPasteEvent(e)&&!e.isDefaultPrevented()&&(e.stopImmediatePropagation(),keyboardPastePlainTextState=e.shiftKey&&86==e.keyCode,keyboardPastePlainTextState&&(self.pasteAsPlainText=!0,getContentFromPasteBin(e))))}),ed.onPaste.add(function(ed,e){getContentAndInsert(ed,e)!==!0&&getContentFromPasteBin(e)}),ed.onInit.add(function(){var draggingInternally;ed.dom.bind(ed.getBody(),["dragstart","dragend"],function(e){draggingInternally="dragstart"==e.type}),ed.dom.bind(ed.getBody(),"drop",function(e){var rng=getCaretRangeFromEvent(ed,e);e.isDefaultPrevented()||draggingInternally||rng&&ed.settings.clipboard_paste_filter_drop!==!1&&(ed.selection.setRng(rng),getContentAndInsert(ed,e))}),ed.dom.bind(ed.getBody(),["dragover","dragend"],function(e){ed.settings.clipboard_paste_data_images&&e.preventDefault()})}),ed.getParam("clipboard_paste_block_drop")&&ed.onInit.add(function(){ed.dom.bind(ed.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(e){return e.preventDefault(),e.stopPropagation(),!1})}),each(["mcePasteText","mcePaste"],function(cmd){ed.addCommand(cmd,function(){var failed,doc=ed.getDoc();if(ed.getParam("clipboard_paste_use_dialog"))return self._openWin(cmd);try{self.pasteAsPlainText="mcePasteText"===cmd,doc.execCommand("Paste",!1,null)}catch(e){failed=!0}return doc.queryCommandEnabled("Paste")||(failed=!0),failed?self._openWin(cmd):void 0})}),self.pasteHtml&&ed.addButton("paste",{title:"clipboard.paste_desc",cmd:"mcePaste",ui:!0}),self.pasteText&&ed.addButton("pastetext",{title:"clipboard.paste_text_desc",cmd:"mcePasteText",ui:!0}),ed.getParam("clipboard_cut",1)&&ed.addButton("cut",{title:"advanced.cut_desc",cmd:"Cut",icon:"cut"}),ed.getParam("clipboard_copy",1)&&ed.addButton("copy",{title:"advanced.copy_desc",cmd:"Copy",icon:"copy"})},_openWin:function(cmd){var ctrl,ed=this.editor,title="",msg=ed.getLang("clipboard.paste_dlg_title","Use %s+V on your keyboard to paste text into the window.");msg=msg.replace(/%s/g,tinymce.isMac?"CMD":"CTRL"),"mcePaste"===cmd?(title=ed.getLang("clipboard.paste_desc"),ctrl='<iframe id="'+ed.id+'_paste_content" src="javascript:;" frameborder="0" title="'+msg+'"></iframe>'):(title=ed.getLang("clipboard.paste_text_desc"),ctrl='<textarea id="'+ed.id+'_paste_content" dir="ltr" wrap="soft" rows="7" autofocus></textarea>');var html='<div class="mceModalRow mceModalStack">   <label for="'+ed.id+'_paste_content">'+msg+'</label></div><div class="mceModalRow">   <div class="mceModalControl">'+ctrl+"</div></div>";ed.windowManager.open({title:title,content:html,size:"mce-modal-landscape-medium",open:function(){var ifr=DOM.get(ed.id+"_paste_content");if("IFRAME"!==ifr.nodeName)return void window.setTimeout(function(){ifr.focus()},10);var css,doc=ifr.contentWindow.document,cssHTML="";css=tinymce.explode(ed.settings.content_css)||[],css.push(ed.baseURI.toAbsolute("themes/"+ed.settings.theme+"/skins/"+ed.settings.skin+"/content.css")),cssHTML+='<style type="text/css">body {background-color:white;color:black;text-align:left;}</style>',tinymce.each(css,function(u){cssHTML+='<link href="'+ed.documentBaseURI.toAbsolute(""+u)+'" rel="stylesheet" type="text/css" />'}),doc.open(),doc.write('<html><head><base href="'+ed.settings.base_url+'" />'+cssHTML+'</head><body class="mceContentBody" spellcheck="false">&nbsp;</body></html>'),doc.close(),doc.designMode="on",window.setTimeout(function(){ifr.contentWindow.focus()},10)},buttons:[{title:ed.getLang("cancel","Cancel"),id:"cancel"},{title:ed.getLang("insert","Insert"),id:"insert",onsubmit:function(e){var node=DOM.get(ed.id+"_paste_content"),data={};if("TEXTAREA"==node.nodeName)data.text=node.value;else{var content=node.contentWindow.document.body.innerHTML;content=content.replace(/<style[^>]*>[\s\S]+?<\/style>/gi,""),data.content=tinymce.trim(content)}ed.execCommand("mceInsertClipboardContent",!1,data)},classes:"primary",autofocus:!0}]})},_insert:function(content,skip_undo){var ed=this.editor,validate=ed.settings.validate;ed.settings.validate=!0,ed.execCommand("mceInsertContent",!1,content),ed.settings.validate=validate}}),tinymce.PluginManager.add("clipboard",tinymce.plugins.ClipboardPlugin)}();

Copyright © 2019 by b0y-101