芝麻web文件管理V1.00
编辑当前文件:/var/www/italafricacentrale.com/wp-content/plugins/mapsvg/mapsvg2/js/tinymce-mapsvg.js
(function () { tinymce.PluginManager.add("mapsvg", function (editor, url) { // Add Button to Visual Editor Toolbar editor.addButton("mapsvg", { title: "Insert MapSVG", cmd: "mapsvg", image: url + "/mce-button.png", }); var mapsvgMaps; // Add Command when Button Clicked var link = jQuery( '
' ).appendTo("body"); function showModal() { link.trigger("click"); } jQuery("body").on("click", ".mapsvg-insert-shortcode", function () { var id = jQuery(this).data("id"); var title = jQuery(this).data("title"); editor.execCommand( "mceInsertContent", false, '[mapsvg id="' + id + '" title="' + title + '"]' ); tb_remove(); }); editor.addCommand("mapsvg", function () { if (mapsvgMaps) return showModal(); jQuery.get( ajaxurl, { action: "mapsvg_get_maps", format: "json", }, function (data) { mapsvgMaps = data; var box = jQuery( '
MapSVG maps ' + '
Add New
' + '
' ); data.forEach(function (item, index) { box.find(".mapsvg-maps-list").append( '
' + item.title + "
" ); }); jQuery("body").append(box); showModal(); }, "json" ); }); }); })();