diff --git a/bower.json b/bower.json index 3cbaf63..be48f98 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "redimage", "main": "redimage.js", - "version": "0.0.1", + "version": "0.0.2", "homepage": "https://github.com/MCProHosting/redimage", "authors": [ "Connor Peet " diff --git a/redimage.js b/redimage.js index 6f5ffa3..713c2af 100644 --- a/redimage.js +++ b/redimage.js @@ -13,12 +13,20 @@ return plugins.redimage; }; + /** + * The button HTML to use. + * @return {[type]} [description] + */ + plugins.redimage.buttonHtml = function () { + return ''; + }; + /** * Returns the template string for the modal popup. * * @return {String} */ - plugins.redimage.getTemplate = function() { + plugins.redimage.getTemplate = function () { return String() + '
' + '' + @@ -32,9 +40,10 @@ * Initialises the plugin, adding its image to the Redactor toolbar. */ plugins.redimage.init = function () { - var button = this.button.add('redimage-btn', 'Link Image'); - this.button.setAwesome('redimage-btn', 'fa-photo'); - this.button.addCallback(button, this.redimage.show); + var $button = this.button.add('redimage-btn', 'Link Image'); + $button.html(plugins.redimage.buttonHtml()); + + this.button.addCallback($button, this.redimage.show); }; /** @@ -94,4 +103,11 @@ return str.replace(/[&<>"'"]/g, escapeHtmlChar); } -}).call(this); + // Expose for module loading + if (typeof define === "function" && define.amd) { + define(plugins.redimage); + } else if (typeof module === "object" && module.exports) { + module.exports = plugins.redimage; + } + +}).call(window);