text: (function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=i(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function r(e){var r,i=this;if(e!==n)t.call(i),i.each(function(t,n){var r;(r=tinymce.get(n.id))&&r.setContent(e)});else if(i.length>0&&(r=tinymce.get(i[0].id)))return r.getContent()}function i(e){var t=null;return e&&e.id&&o.tinymce&&(t=tinymce.get(e.id)),t}function a(e){return!!(e&&e.length&&o.tinymce&&e.is(":tinymce"))}var s={};e.each(["text","html","val"],function(t,o){var l=s[o]=e.fn[o],c="text"===o;e.fn[o]=function(t){var o=this;if(!a(o))return l.apply(o,arguments);if(t!==n)return r.call(o.filter(":tinymce"),t),l.apply(o.not(":tinymce"),arguments),o;var s="",u=arguments;return(c?o:o.eq(0)).each(function(t,n){var r=i(n);s+=r?c?r.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):r.getContent({save:!0}):l.apply(e(n),u)}),s}}),e.each(["append","prepend"],function(t,r){var o=s[r]=e.fn[r],l="prepend"===r;e.fn[r]=function(e){var t=this;return a(t)?e!==n?(t.filter(":tinymce").each(function(t,n){var r=i(n);r&&r.setContent(l?e+r.getContent():r.getContent()+e)}),o.apply(t.not(":tinymce"),arguments),t):void 0:o.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,r){var i=s[r]=e.fn[r];e.fn[r]=function(){return t.call(this,r),i.apply(this,arguments)}}),s.attr=e.fn.attr,e.fn.attr=function(t,o){var l=this,c=arguments;if(!t||"value"!==t||!a(l))return o!==n?s.attr.apply(l,c):s.attr.apply(l,c);if(o!==n)return r.call(l.filter(":tinymce"),o),s.attr.apply(l.not(":tinymce"),c),l;var u=l[0],d=i(u);return d?d.getContent({save:!0}):s.attr.apply(e(u),c)}}var n,r,i=[],o=window;e.fn.tinymce=function(n){function a(){var r=[],i=0;t&&(t(),t=null),u.each(function(e,t){var o,a=t.id,s=n.oninit;a||(t.id=a=tinymce.DOM.uniqueId()),o=new tinymce.Editor(a,n,tinymce.EditorManager),r.push(o),o.on("init",function(){var e,t=s;u.css("visibility",""),s&&++i==r.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,r))})}),e.each(r,function(e,t){t.render()})}var s,l,c,u=this,d="";if(!u.length)return u;if(!n)return tinymce.get(u[0].id);if(u.css("visibility","hidden"),o.tinymce||r||!(s=n.script_url))1===r?i.push(a):a();else{r=1,l=s.substring(0,s.lastIndexOf("/")),-1!=s.indexOf(".min")&&(d=".min"),o.tinymce=o.tinyMCEPreInit||{base:l,suffix:d},-1!=s.indexOf("gzip")&&(c=n.language||"en",s=s+(/\?/.test(s)?"&":"?")+"js=true&core=true&suffix="+escape(d)+"&themes="+escape(n.theme)+"&plugins="+escape(n.plugins)+"&languages="+c,o.tinyMCE_GZ||(o.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+c+".js"),t("themes/"+n.theme+"/theme"+d+".js"),t("themes/"+n.theme+"/langs/"+c+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+d+".js"),t("plugins/"+n+"/langs/"+c+".js"))})},end:function(){}}));var f=document.createElement("script");f.type="text/javascript",f.onload=f.onreadystatechange=function(t){t=t||event,("load"==t.type||/complete|loaded/.test(f.readyState))&&(tinymce.dom.Event.domLoaded=1,r=2,n.script_loaded&&n.script_loaded(),a(),e.each(i,function(e,t){t()}))},f.src=s,document.body.appendChild(f)}return u},e.extend(e.expr[":"],{tinymce:function(e){return!!(e.id&&"tinymce"in window&&tinymce.get(e.id))}})})(jQuery);