raphaelcruzeiro/jquery-notebook

Adding another option strikethrough Enhancement

Opened this issue · 0 comments

I needed another formatting option "strikethrough". I just added it myself.

  • For this I added the keycode for the letter "L" to enable the shortcut cmd+L
    76: "strikethrough",
  • Next I edited the "updateState" event
    strike: "strikethrough",
  • And also added "strike" to the checkForFormatting function
    var n = ["b", "i", "u", "strike", "h1", "h2", "ol", "ul", "li", "a"];
  • And last but not least I added the "strikethrough" command
    strikethrough: function(e) { e.preventDefault(), t.execCommand("strikeThrough", !1), u.update.call(this), m.change.call(this) },
  • For the CSS part I added the following line
    .jquery-notebook.bubble button.strikethrough:after{content:"\f0cc"}

This is it. Maybe you can implement this into your next version. Thanks for this awesome tool!