Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active March 13, 2016 09:58
Show Gist options
  • Save kurozumi/94a2ced317d7354a17bf to your computer and use it in GitHub Desktop.
Save kurozumi/94a2ced317d7354a17bf to your computer and use it in GitHub Desktop.
【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