(function() { javascriptUrl=''; tinymce.create('tinymce.plugins.rednao_smart_forms', { init : function(ed, url) { javascriptUrl=url.substring(0,url.length-13); // Register command for when button is clicked ed.addCommand('rednao_smart_forms_short_code_clicked', function(a,donationId) { tinymce.execCommand('mceInsertContent', false, '[sform]'+donationId+'[/sform]'); rnJQuery("#smartformsShortCodeDialog").dialog('close'); rnJQuery("#smartformsShortCodeDialog").remove(); }), // Register buttons - trigger above command when clicked ed.addButton('rednao_smart_forms_button', {title : 'Smart Forms', image: javascriptUrl + '/images/smartFormsIcon.png', onclick:function() { var data={ action:"rednao_smart_form_list" }; rnJQuery.post(ajaxurl,data,smartFormsAjaxCompleted); }}); } }); tinymce.PluginManager.add('rednao_smart_forms_button', tinymce.plugins.rednao_smart_forms); })(); var smartFormsShortCodeDialog; function smartFormsAjaxCompleted(result,status) { if(smartFormsShortCodeDialog==null) { var smartFormsPopUpForm='