Browse files

added emdash call, scriptVersion param, new button images

  • Loading branch information...
1 parent db41ebb commit e14cf2df7bad63a02e2f475ba57757a77dffae40 @delambo delambo committed Oct 10, 2012
View
33 lib/tinymce/jscripts/tiny_mce/plugins/ice/editor_plugin.js
@@ -19,6 +19,7 @@
contentEditable: true,
css: 'css/ice.css',
manualInit: false,
+ scriptVersion: new Date().getTime(),
afterInit: function() {},
afterClean: function(body) { return body; },
beforePasteClean: function(body) { return body; },
@@ -65,7 +66,7 @@
script.type = 'text/javascript';
if (script.readyState) script.onreadystatechange = function() { startIce(); };
else script.onload = startIce;
- script.src = url + '/js/ice.min.js';
+ script.src = url + '/js/ice.min.js?version='+self.scriptVersion;
document.getElementsByTagName('head')[0].appendChild(script);
// Setting the Show/Hide Changes button to active
@@ -137,7 +138,7 @@
* @return clean body, void of change tracking tags.
*/
ed.addCommand('icecleanbody', function(el) {
- var body = changeEditor.getCleanContent(el || ed.getContent(), self.afterClean);
+ var body = changeEditor.getCleanContent(el || ed.getContent(), self.afterClean, self.beforeClean);
return body;
});
@@ -266,10 +267,9 @@
/**
* Calls the ice smart quotes plugin to convert regular quotes to smart quotes.
*/
- ed.addCommand('ice_smartquotes', function() {
- var body = ed.getBody();
- changeEditor.pluginsManager.plugins['IceSmartQuotesPlugin'].convert(body);
- ed.windowManager.alert('Regular quotes have been converted into smart quotes.');
+ ed.addCommand('ice_smartquotes', function(quiet) {
+ changeEditor.pluginsManager.plugins['IceSmartQuotesPlugin'].convert(ed.getBody());
+ if (!quiet) ed.windowManager.alert('Regular quotes have been converted into smart quotes.');
});
/**
@@ -325,17 +325,25 @@
});
/**
+ * Makes a manual call to the emdash handler - this feature is only useful when `isTracking`
+ * is false and the emdash plugin is not on; otherwise, ice will handle emdash conversion.
+ */
+ ed.addCommand('ice_handleemdash', function(html) {
+ return changeEditor.pluginsManager.plugins['IceEmdashPlugin'].convertEmdash() ? 1 : 0;
+ });
+
+ /**
* Register Buttons
*/
ed.addButton('iceaccept', {
title : 'Accept Change',
- image : url + '/img/ice-accept-change.png',
+ image : url + '/img/accept.gif',
cmd : 'iceaccept'
});
ed.addButton('icereject', {
title : 'Reject Change',
- image : url + '/img/ice-reject-change.png',
+ image : url + '/img/reject.gif',
cmd : 'icereject'
});
@@ -373,13 +381,13 @@
ed.plugins.contextmenu.onContextMenu.add(function(th, menu, node) {
if(isInsideChangeTag(node)) {
menu.add({
- title: "<img src='"+url+"/img/ice-accept-change.png' style='vertical-align: middle;margin-left: -22px;margin-right: 5px;'>Accept Change",
- icon: '',
+ title: "Accept Change",
+ icon: 'accept',
cmd: 'iceaccept'
});
menu.add({
- title: "<img src='"+url+"/img/ice-reject-change.png' style='vertical-align: middle;margin-left: -22px;margin-right: 5px;'>Reject Change",
- icon: '',
+ title: "Reject Change",
+ icon: 'reject',
cmd: 'icereject'
});
}
@@ -425,4 +433,3 @@
tinymce.PluginManager.add('ice', tinymce.plugins.IcePlugin);
})();
-
View
BIN lib/tinymce/jscripts/tiny_mce/plugins/ice/img/accept.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN lib/tinymce/jscripts/tiny_mce/plugins/ice/img/reject.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e14cf2d

Please sign in to comment.