PageSourceSearch

https://www.roundhillfishkill.com/plugins/emoji-picker/js/emoji-picker.js

js roundhillfishkill.com collected 2026-09-26 05:00:37 UTC 4,017 bytes, 139 lines download raw bytes

1// Generated by CoffeeScript 1.12.5
2(function() {
3  this.EmojiPicker = (function() {
4    function EmojiPicker(options) {
5      var ref, ref1;
6      if (options == null) {
7        options = {};
8      }
9      $.emojiarea.iconSize = (ref = options.iconSize) != null ? ref : 25;
10      $.emojiarea.assetsPath = (ref1 = options.assetsPath) != null ? ref1 : '';
11      this.generateEmojiIconSets(options);
12      if (!options.emojiable_selector) {
13        options.emojiable_selector = '[data-emojiable=true]';
14      }
15      this.options = options;
16    }
17
18    EmojiPicker.prototype.discover = function() {
19      var isiOS;
20      isiOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
21      if (isiOS) {
22        //return;
23      }
24      return $(this.options.emojiable_selector).emojiarea($.extend({
25        emojiPopup: this,
26        norealTime: true
27      }, this.options));
28    };
29
30    EmojiPicker.prototype.generateEmojiIconSets = function(options) {
31      var column, dataItem, hex, i, icons, j, name, reverseIcons, row, totalColumns;
32      icons = {};
33      reverseIcons = {};
34      i = void 0;
35      j = void 0;
36      hex = void 0;
37      name = void 0;
38      dataItem = void 0;
39      row = void 0;
40      column = void 0;
41      totalColumns = void 0;
42      j = 0;
43      while (j < Config.EmojiCategories.length) {
44        totalColumns = Config.EmojiCategorySpritesheetDimens[j][1];
45        i = 0;
46        while (i < Config.EmojiCategories[j].length) {
47          dataItem = Config.Emoji[Config.EmojiCategories[j][i]];
48          name = dataItem[1][0];
49          row = Math.floor(i / totalColumns);
50          column = i % totalColumns;
51          icons[':' + name + ':'] = [j, row, column, ':' + name + ':'];
52          reverseIcons[name] = dataItem[0];
53          i++;
54        }
55        j++;
56      }
57      $.emojiarea.icons = icons;
58      return $.emojiarea.reverseIcons = reverseIcons;
59    };
60
61    EmojiPicker.prototype.colonToUnicode = function(input) {
62      if (!input) {
63        return '';
64      }
65      if (!Config.rx_colons) {
66        Config.init_unified();
67      }
68      return input.replace(Config.rx_colons, function(m) {
69        var val;
70        val = Config.mapcolon[m];
71        if (val) {
72          return val;
73        } else {
74          return '';
75        }
76      });
77    };
78
79    EmojiPicker.prototype.appendUnicodeAsImageToElement = function(element, input) {
80      var k, len, split_on_unicode, text, val;
81      if (!input) {
82        return '';
83      }
84      if (!Config.rx_codes) {
85        Config.init_unified();
86      }
87      split_on_unicode = input.split(Config.rx_codes);
88      for (k = 0, len = split_on_unicode.length; k < len; k++) {
89        text = split_on_unicode[k];
90        val = '';
91        if (Config.rx_codes.test(text)) {
92          val = Config.reversemap[text];
93          if (val) {
94            val = ':' + val + ':';
95            val = $.emojiarea.createIcon($.emojiarea.icons[val]);
96          }
97        } else {
98          val = document.createTextNode(text);
99        }
100        element.append(val);
101      }
102      return input.replace(Config.rx_codes, function(m) {
103        var $img;
104        val = Config.reversemap[m];
105        if (val) {
106          val = ':' + val + ':';
107          $img = $.emojiarea.createIcon($.emojiarea.icons[val]);
108          return $img;
109        } else {
110          return '';
111        }
112      });
113    };
114
115    EmojiPicker.prototype.colonToImage = function(input) {
116      if (!input) {
117        return '';
118      }
119      if (!Config.rx_colons) {
120        Config.init_unified();
121      }
122      return input.replace(Config.rx_colons, function(m) {
123        var $img;
124        if (m) {
125          $img = $.emojiarea.createIcon($.emojiarea.icons[m]);
126          return $img;
127        } else {
128          return '';
129        }
130      });
131    };
132
133    return EmojiPicker;
134
135  })();
136
137}).call(this);
138
139//# sourceMappingURL=emoji-picker.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.