Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active Mar 13, 2016
Embed
What would you like to do?
【WordPress】WordPressのビジュアルエディタにフリッカーの画像検索ができるボタンを追加するプラグイン
(function ($) {
// Register plugin
tinymce.PluginManager.add('tinymce_flickr', function (editor, url) {
function showDialog() {
var win = editor.windowManager.open({
title: "Flickr",
file: url + '/dialog.php',
width: 600,
height: 300,
inline: 1,
buttons: [{
text: "Close",
id: "close",
class: "close",
onclick: "close"
}]
}, {
plugin_url: url,
jquery: $
});
}
editor.addButton('tinymce_flickr', {
image: url + '/images/icon.png',
tooltip: 'Flickr',
onclick: showDialog
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment