Last active
March 15, 2016 10:36
-
-
Save kurozumi/6c9144f5603321c063b7 to your computer and use it in GitHub Desktop.
【WordPress】WordPressのビジュアルエディタにはてブ検索を追加する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
// Register plugin | |
tinymce.PluginManager.add('tinymce_hatebu_button', function (editor, url) { | |
function showDialog() { | |
var win = editor.windowManager.open({ | |
title: "はてなブックマーク", | |
file: url + '/dialog.php', | |
width: 780, | |
height: 300, | |
inline: 1, | |
buttons: [{ | |
text: "Close", | |
id: "close", | |
class: "close", | |
onclick: "close" | |
}] | |
}, { | |
plugin_url: url, | |
jquery: $ | |
}); | |
} | |
editor.addButton('tinymce_hatebu_button', { | |
image: url + '/images/icon.png', | |
tooltip: 'はてなブックマーク', | |
onclick: showDialog | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment