-
Notifications
You must be signed in to change notification settings - Fork 1
/
mdocs-post-editor.min.js
1 lines (1 loc) · 1.46 KB
/
mdocs-post-editor.min.js
1
jQuery("#mdocs-add-folder, #mdocs-add-file ,#mdocs-add-upload-btn").click(function(e){e.preventDefault()}),jQuery(".mdocs-insert-shortcode").click(function(e){if(e.preventDefault(),"insert-folder"==jQuery(this).data("button-type")){var d=jQuery('select[name="mdocs-folders"]').val(),o=jQuery('select[name="mdocs-sort-values"]').val(),t=jQuery('input[name="mdocs-add-folder-is-descending"]').prop("checked"),n=jQuery('input[name="mdocs-add-folder-hide-folders"]').prop("checked");wp.media.editor.insert('[mdocs folder="'+d+'" hide_folder="'+n+'" sort_value="'+o+'" is_descending="'+t+'"]')}else if("insert-file"==jQuery(this).data("button-type")){var s=jQuery('input[name="mdocs-file"]:checked').val();wp.media.editor.insert('[mdocs single-file="'+s+'" ]')}}),tinymce.PluginManager.add("mdocs_shortcode_dropdown",function(e,d){e.addButton("mdocs_shortcode_dropdown",{title:"mDocs Shortcodes",image:d+"assets/imgs/mdocs-logo.png",type:"menubutton",menu:[{text:mdocs_js.add_folder,onclick:function(){tb_show(mdocs_js.add_folder,"#TB_inline?&width=400&height=300&inlineId=mdocs-add-folder-modal"),jQuery("#TB_ajaxContent").removeAttr("style"),jQuery("#TB_ajaxContent").css("height","90%"),jQuery("#TB_closeWindowButton").blur()}},{text:mdocs_js.add_file,onclick:function(){tb_show(mdocs_js.add_file,"#TB_inline?&height=100%&inlineId=mdocs-add-file-modal"),jQuery("#TB_ajaxContent").removeAttr("style"),jQuery("#TB_ajaxContent").css("height","90%"),jQuery("#TB_closeWindowButton").blur()}}]})});