Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX TinyMCE context menu displaying default dialogs instead of our one

  • Loading branch information...
commit 468167389636a6b3f05ea4bdd47a0c10327e470b 1 parent 6f93774
@hafriedlander hafriedlander authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 thirdparty/tinymce_ssbuttons/editor_plugin_src.js
View
15 thirdparty/tinymce_ssbuttons/editor_plugin_src.js
@@ -38,7 +38,20 @@
ed.addCommand('ssmedia', function(ed) {
jQuery('#' + this.id).entwine('ss').openMediaDialog();
});
-
+
+ // Replace the mceAdvLink and mceLink commands with the sslink command, and
+ // the mceAdvImage and mceImage commands with the ssmedia command
+ ed.onBeforeExecCommand.add(function(ed, cmd, ui, val, a){
+ if (cmd == 'mceAdvLink' || cmd == 'mceLink'){
+ ed.execCommand('sslink', ui, val, a);
+ a.terminate = true;
+ }
+ else if (cmd == 'mceAdvImage' || cmd == 'mceImage'){
+ ed.execCommand('ssmedia', ui, val, a);
+ a.terminate = true;
+ }
+ });
+
// Disable link button when no link is selected
ed.onNodeChange.add(function(ed, cm, n, co) {
cm.setDisabled('sslink', co && n.nodeName != 'A');
Please sign in to comment.
Something went wrong with that request. Please try again.