1(function ($) { 2 $.fn.emoji = function (params) { 3 var defaults = { 4 button: '<img src="https://www.transtv.co.id/themes/v25.7/src/assets/icon/emoticon.png">', 5 place: 'before', 6 emojis: ['🙂', '🙁', '😀', '😁', '😂', '😃', '😄', '😅', '😆', '😇', '😈', '😉', '😊', '😋', '😌', '😍', '😎', '😏', '😐', '😑', '😒', '😓', '😔', '😕', '😖', '😗', '😘', '😙', '😚', '😛', '😜', '😝', '😞', '😟', '😠', '😡', '😢', '😣', '😤', '😥', '😦', '😧', '😨', '😩', '😪', '😫', '😬', '😭', '😮', '😯', '😰', '😱', '😲', '😳', '😴', '😵', '😶', '😷', '😸', '😹', '😺', '😻', '😼', '😽', '😾', '😿', '🙀', '🙃', '🙄', '👌', '👍', '👎', '🙈', '🙉', '🙊'], 7 fontSize: '', 8 listCSS: { position: 'relative', border: '1px solid #707070', 'background-color': '#FFF', display: 'none' }, 9 rowSize: 10, 10 }; 11 var settings = {}; 12 if (!params) { 13 settings = defaults; 14 } else { 15 for (var n in defaults) { 16 settings[n] = params[n] ? params[n] : defaults[n]; 17 } 18 } 19 20 this.each(function (n, input) { 21 var $input = $(input); 22 23 /*function showEmoji() { 24 $list.show(); 25 $input.focus(); 26 setTimeout(function () { 27 $(document).on('click', closeAllEmoji); 28 }, 1); 29 }*/ 30 31 function showEmoji() { 32 $list.toggle(); 33 /*$button.find('img').attr('src', 'src/images/icon/close.png');*/ 34 } 35 36 function closeEmoji() { 37 /*$list.hide();*/ 38 $(document).off('click', closeEmoji); 39 } 40 41 function clickEmoji(ev) { 42 if (input.selectionStart || input.selectionStart == '0') { 43 var startPos = input.selectionStart; 44 var endPos = input.selectionEnd; 45 input.value = input.value.substring(0, startPos) 46 + ev.currentTarget.innerHTML 47 + input.value.substring(endPos, input.value.length); 48 } else { 49 input.value += ev.currentTarget.innerHTML; 50 51 } 52 53 closeEmoji(); 54 $input.focus(); 55 input.selectionStart = startPos + 2; 56 input.selectionEnd = endPos + 2; 57 } 58 59 var $button = $('<div class="btn__emoji">').html(settings.button).css({ cursor: 'pointer', 'font-size': settings.fontSize }).on('click', showEmoji); 60 var $list = $('<div class="emoji">').css(defaults.listCSS).css(settings.listCSS); 61 for (var n in settings.emojis) { 62 if (n > 0 && n % settings.rowSize == 0) { 63 $("<br>").appendTo($list); 64 } 65 $("<div>").html(settings.emojis[n]).css({ cursor: 'pointer', 'font-size': settings.fontSize }).on('click', clickEmoji).appendTo($list); 66 } 67 68 if (settings.place === 'before') { 69 $button.insertBefore(this); 70 } else { 71 $button.insertAfter(this); 72 } 73 $list.insertAfter($input); 74 }); 75 return this; 76 }; 77} 78)(jQuery);
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.