Last active
March 13, 2016 02:56
-
-
Save kurozumi/bcfacdc99f05d1585dd6 to your computer and use it in GitHub Desktop.
【WordPress】WordPressのビジュアルエディタにGitHub Gistボタンを追加するプラグイン
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_gist', function (editor, url) { | |
function showDialog() { | |
var win = editor.windowManager.open({ | |
title: "Gist", | |
file: url + '/dialog.php', | |
width: 600, | |
height: 300, | |
inline: 1, | |
buttons: [{ | |
text: "Close", | |
id: "close", | |
class: "close", | |
onclick: "close" | |
}] | |
}, { | |
plugin_url: url, | |
editor: editor | |
}); | |
} | |
editor.addCommand("mceGist", showDialog); | |
editor.addButton('tinymce_gist', { | |
image: url + '/images/icon.png', | |
tooltip: 'Gist', | |
onclick: showDialog | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment