Skip to content

Commit

Permalink
Merge pull request #23 from foswiki/tinyMCEdev
Browse files Browse the repository at this point in the history
Item14323: Replace onClick calls with onAction. Replace onpostrender …
  • Loading branch information
Lynnwood authored Jun 22, 2019
2 parents 35bd2d6 + 9d16749 commit 0a4c10e
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
};


// onclick for "fwchangelisttype"
// onAction for "fwchangelisttype"
function handleChangeListType(ed) {
var node = ed.dom.getParent(
ed.selection.getStart(), function(f) {
Expand All @@ -393,7 +393,7 @@
}
}

// onclick for "fwhide"
// onAction for "fwhide"
function handleHide(ed) {
if (ed.plugins.fullscreen && ed.plugins.fullscreen.isFullscreen())
ed.execCommand('mceFullScreen');
Expand Down Expand Up @@ -426,9 +426,9 @@

ed.ui.registry.addButton('fwtt', {
title: 'Typewriter text',
onclick: function(evt) { ed.formatter.toggle('WYSIWYG_TT'); },
onAction: function(evt) { ed.formatter.toggle('WYSIWYG_TT'); },
image: url + '/img/tt.gif',
onpostrender: function() {
onSetup: function() {
var btn = this;
ed.on("NodeChange", function(e) {
btn.disabled($(e.element).hasClass('WYSIWYG_TT'));
Expand All @@ -443,7 +443,7 @@
ed.ui.registry.addButton('fwupload', {
title: 'Upload attachment',
image: url + '/img/upload.gif',
onclick: function () {
onAction: function () {
getListOfAttachments(showUploadDialog);
}
});
Expand All @@ -454,16 +454,16 @@
ed.ui.registry.addButton('fwinsertlink', {
title: 'Insert link to attachment',
image: url + '/img/insertlink.gif',
onclick: function () {
onAction: function () {
getListOfAttachments(showInsertLinkDialog);
}
});

ed.ui.registry.addButton('fwchangelisttype', {
title: 'Change bullet/number style',
image: url + '/img/changeliststyle.gif',
onClick: function() { handleChangeListType(ed); },
onpostrender: function() {
onAction: function() { handleChangeListType(ed); },
onSetup: function() {
var btn = this;
ed.on("NodeChange", function(e) {
btn.disabled(
Expand All @@ -477,7 +477,7 @@
ed.ui.registry.addButton('fwhide', {
title: 'Edit Foswiki markup',
image: url + '/img/hide.gif',
onClick: function () { handleHide(ed); }
onAction: function () { handleHide(ed); }
});
},

Expand Down

0 comments on commit 0a4c10e

Please sign in to comment.