From a2b81040347f9ef573eee64455de3a5eb0af46ff Mon Sep 17 00:00:00 2001 From: Metalou Date: Fri, 28 Mar 2014 17:54:24 +0100 Subject: [PATCH] Create bootstrap-fa-wysihtml5.js Replaced glyphicon classes with font-awesome's --- src/bootstrap-fa-wysihtml5.js | 458 ++++++++++++++++++++++++++++++++++ 1 file changed, 458 insertions(+) create mode 100644 src/bootstrap-fa-wysihtml5.js diff --git a/src/bootstrap-fa-wysihtml5.js b/src/bootstrap-fa-wysihtml5.js new file mode 100644 index 0000000..bec5eed --- /dev/null +++ b/src/bootstrap-fa-wysihtml5.js @@ -0,0 +1,458 @@ +!function($, wysi) { + "use strict"; + + var templates = function(key, locale) { + + var tpl = { + "font-styles": + "", + + "emphasis": + "
  • " + + "" + + "
  • ", + + "lists": + "
  • " + + "
    " + + "" + + "" + + "" + + "" + + "
    " + + "
  • ", + + "link": + "
  • " + + "" + + "" + + "
  • ", + + "image": + "
  • " + + "" + + "" + + "
  • ", + + "html": + "
  • " + + "
    " + + "" + + "
    " + + "
  • ", + + "color": + "" + }; + return tpl[key]; + }; + + + var Wysihtml5 = function(el, options) { + this.el = el; + this.toolbar = this.createToolbar(el, options || defaultOptions); + this.editor = this.createEditor(options); + + window.editor = this.editor; + + $('iframe.wysihtml5-sandbox').each(function(i, el){ + $(el.contentWindow).off('focus.wysihtml5').on({ + 'focus.wysihtml5' : function(){ + $('li.dropdown').removeClass('open'); + } + }); + }); + }; + + Wysihtml5.prototype = { + + constructor: Wysihtml5, + + createEditor: function(options) { + options = options || {}; + options.toolbar = this.toolbar[0]; + + var editor = new wysi.Editor(this.el[0], options); + + if(options && options.events) { + for(var eventName in options.events) { + editor.on(eventName, options.events[eventName]); + } + } + return editor; + }, + + createToolbar: function(el, options) { + var self = this; + var toolbar = $("