|
1 | 1 | /* |
2 | | - * jquery-boilerplate - v3.4.0 |
3 | | - * A jump-start for jQuery plugins development. |
4 | | - * http://jqueryboilerplate.com |
| 2 | + * emoticons-js - v0.1.0 |
| 3 | + * A jquery plugin to convert text into emoticons. |
| 4 | + * |
5 | 5 | * |
6 | | - * Made by Zeno Rocha |
| 6 | + * Made by |
7 | 7 | * Under MIT License |
8 | 8 | */ |
9 | | -// the semi-colon before function invocation is a safety net against concatenated |
10 | | -// scripts and/or other plugins which may not be closed properly. |
11 | | -;(function ( $, window, document, undefined ) { |
12 | | - |
13 | | - "use strict"; |
14 | | - |
15 | | - // undefined is used here as the undefined global variable in ECMAScript 3 is |
16 | | - // mutable (ie. it can be changed by someone else). undefined isn't really being |
17 | | - // passed in so we can ensure the value of it is truly undefined. In ES5, undefined |
18 | | - // can no longer be modified. |
19 | | - |
20 | | - // window and document are passed through as local variable rather than global |
21 | | - // as this (slightly) quickens the resolution process and can be more efficiently |
22 | | - // minified (especially when both are regularly referenced in your plugin). |
23 | | - |
24 | | - // Create the defaults once |
25 | | - var pluginName = "defaultPluginName", |
26 | | - defaults = { |
27 | | - propertyName: "value" |
28 | | - }; |
29 | | - |
30 | | - // The actual plugin constructor |
31 | | - function Plugin ( element, options ) { |
32 | | - this.element = element; |
33 | | - // jQuery has an extend method which merges the contents of two or |
34 | | - // more objects, storing the result in the first object. The first object |
35 | | - // is generally empty as we don't want to alter the default options for |
36 | | - // future instances of the plugin |
37 | | - this.settings = $.extend( {}, defaults, options ); |
38 | | - this._defaults = defaults; |
39 | | - this._name = pluginName; |
40 | | - this.init(); |
41 | | - } |
42 | | - |
43 | | - // Avoid Plugin.prototype conflicts |
44 | | - $.extend(Plugin.prototype, { |
45 | | - init: function () { |
46 | | - // Place initialization logic here |
47 | | - // You already have access to the DOM element and |
48 | | - // the options via the instance, e.g. this.element |
49 | | - // and this.settings |
50 | | - // you can add more functions like the one below and |
51 | | - // call them like so: this.yourOtherFunction(this.element, this.settings). |
52 | | - console.log("xD"); |
53 | | - }, |
54 | | - yourOtherFunction: function () { |
55 | | - // some logic |
56 | | - } |
57 | | - }); |
58 | | - |
59 | | - // A really lightweight plugin wrapper around the constructor, |
60 | | - // preventing against multiple instantiations |
61 | | - $.fn[ pluginName ] = function ( options ) { |
62 | | - return this.each(function() { |
63 | | - if ( !$.data( this, "plugin_" + pluginName ) ) { |
64 | | - $.data( this, "plugin_" + pluginName, new Plugin( this, options ) ); |
65 | | - } |
66 | | - }); |
67 | | - }; |
68 | | - |
69 | | -})( jQuery, window, document ); |
0 commit comments