function trim(e){return e.replace(/^\s+/g,"").replace(/\s+$/g,"")}var MceInsertSelectorDialog={local_ed:"ed",init:function(e){MceInsertSelectorDialog.local_ed=e,tinyMCEPopup.resizeToInnerSize()},insertWidget:function(e,t){tinyMCEPopup.restoreSelection(),el=e.selection.getNode(),"DIV"==el.nodeName&&"wysija-register"==el.className&&jQuery(function(e){e(el).remove()}),output='[wysija_form id="'+t+'"]',tinyMCEPopup.execCommand("mceInsertRawHTML",!1,output),tinyMCEPopup.close()},insertSubscribers:function(e,t,r){tinyMCEPopup.restoreSelection(),el=e.selection.getNode(),"DIV"==el.nodeName&&"wysija-register"==el.className&&jQuery(function(e){e(el).remove()}),shortcodeAttributes=[],t>0&&shortcodeAttributes.push('list_id="'+t+'"'),parseInt(r)>0&&shortcodeAttributes.push('confirmed_subscribers="'+parseInt(r)+'"'),shortcodeAttributes=shortcodeAttributes.length>0?" "+shortcodeAttributes.join(" "):"",output="[wysija_subscribers_count"+shortcodeAttributes+"]",tinyMCEPopup.execCommand("mceInsertRawHTML",!1,output),tinyMCEPopup.close()}};tinyMCEPopup.onInit.add(MceInsertSelectorDialog.init,MceInsertSelectorDialog),jQuery(function(e){e("#widget-insert").click(function(){return MceInsertSelectorDialog.insertWidget(MceInsertSelectorDialog.local_ed,e("#widget-wysija--form").val()),!1}),e("#subscribers-insert").click(function(){return MceInsertSelectorDialog.insertSubscribers(MceInsertSelectorDialog.local_ed,e("#wysija-list").val(),e("#confirmedSubscribers").attr("checked")?1:0),!1})});