/* jce - 2.7.11 | 2019-04-17 | https://www.joomlacontenteditor.net | Copyright (C) 2006 - 2019 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */
!function(){var each=tinymce.each,extend=tinymce.extend;tinymce.create("tinymce.plugins.MicrodataPlugin",{init:function(ed,url){this.editor=ed,ed.addCommand("mceMicrodata",function(){var se=ed.selection;se.getNode();ed.windowManager.open({file:ed.getParam("site_url")+"index.php?option=com_jce&task=plugin.display&plugin=microdata",width:400+ed.getLang("microdata.delta_width",0),height:300+ed.getLang("microdata.delta_height",0),inline:1,popup_css:!1},{plugin_url:url})}),ed.addButton("microdata",{title:"microdata.desc",cmd:"mceMicrodata"}),ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled("microdata",co)}),ed.onInit.add(function(ed){ed.settings.compress.css||ed.dom.loadCSS(url+"/css/content.css")}),ed.onPreInit.add(function(){ed.schema.addValidElements("@[itemscope=itemscope|itemtype|itemid|itemprop|itemref|content]"),ed.schema.addValidElements("meta[itemprop|content|id|class|name|http-equiv|charset]"),ed.schema.addValidElements("link[href|itemprop|id|class|rel|media|hreflang|type|sizes]"),each(ed.schema.elements,function(v,k){if(/\w+/.test(k)&&v.attributes){extend(v.attributes,{itemscope:{defaultValue:"itemscope"},itemtype:{},itemid:{},itemprop:{},itemref:{},content:{}}),v.attributesOrder.concat(v.attributesOrder,["itemscope","itemtype","itemid","itemprop","itemref","content"]);var children=ed.schema.children[k];children&&children.span&&(children.meta={},children.link={})}}),ed.serializer.addAttributeFilter("data-microdata-itemscope,data-microdata-itemtype,data-microdata-itemid,data-microdata-itemprop,data-microdata-itemref,data-microdata-content",function(nodes,name){for(var node,k,v,i=nodes.length;i--;)node=nodes[i],k=name.replace("data-microdata-",""),v=node.attr(name),"itemtype"===k&&(node.attr("itemscope","itemscope"),v.indexOf("http://")===-1&&(v="http://schema.org/"+v)),node.attr(k,v),node.attr(name,null)}),ed.parser.addAttributeFilter("itemscope,itemtype,itemid,itemprop,itemref,content",function(nodes,name){for(var node,v,i=nodes.length;i--;)node=nodes[i],v=node.attr(name),"content"===name&&"meta"===node.name||("itemscope"===name&&(v="itemscope"),"itemtype"===name&&v.indexOf("http://")===-1&&(v="http://schema.org/"+v),node.attr("data-microdata-"+name,v),node.attr(name,null))}),ed.formatter.register({microdata:{inline:"span",onformat:function(elm,fmt,vars){each(vars,function(value,key){ed.dom.setAttrib(elm,key,value)})}},"microdata-remove":{selector:"span",attributes:["data-microdata-itemprop"],remove:"emtpy"}})})}}),tinymce.PluginManager.add("microdata",tinymce.plugins.MicrodataPlugin)}();