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
$.sceditor.plugins.undomanager = function() { | |
var base = this; | |
base.init = function() { | |
// The this variable will be set to the instance of the editor calling it, | |
// hence why the plugins "this" is saved to the base variable. | |
// addShortcut is the easiest way to add handlers to specific shortcuts | |
this.addShortcut('ctrl+z', base.undo); | |
this.addShortcut('ctrl+shift+z', base.redo); |
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
/** | |
* H1 BBCode | |
*/ | |
$.sceditor.command.set('h1', { | |
tooltip: 'Heading 1', | |
state: function(parent, firstBlock) { | |
var $firstBlock = $(firstBlock); | |
// < 0 is disabled | |
// == 0 is enabled but not active |
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
$.sceditorBBCodePlugin.bbcode.set('size', { | |
format: function($elm, content) { | |
var size = $elm.data('scefontsize'); | |
if(!size) | |
{ | |
size = $elm.css('fontSize').replace("px", "") - 0; | |
if(!this.baseFontSizePx) | |
this.baseFontSizePx = $elm.parents('body').css('fontSize').replace("px", "") - 0; |