1"use strict"; 2 3function getCookie(e) { 4 for (var t = e + "=", n = document.cookie.split(";"), i = 0; i < n.length; i++) { 5 for (var r = n[i]; " " == r.charAt(0);) r = r.substring(1, r.length); 6 if (0 == r.indexOf(t)) return r.substring(t.length, r.length) 7 } 8 return null 9} 10 11function setCookie(e, t, n) { 12 var i = ""; 13 if (n) { 14 var r = new Date; 15 r.setTime(r.getTime() + 24 * n * 60 * 60 * 1e3), i = "; expires=" + r.toUTCString() 16 } 17 document.cookie = e + "=" + (t || "") + i + "; path=/" 18} 19 20function Main() { 21 this.extensionId = "gbglbjlgljimehpblmppfhjmgbjoaobj"; 22 this.isInstalled = false; 23 this.configuration = {}; 24} 25 26Main.prototype.success = function () { 27 28 $.notify.addStyle('happyblue', { 29 html: "<div><span data-notify-text/>âº</div>", 30 classes: { 31 base: { 32 "padding": "15px", 33 "white-space": "pre-wrap", 34 "background-color": "white", 35 "width": "350px", 36 "line-height": "1.7em", 37 "text-align": "left", 38 "font-size": "19px", 39 "font-weight": "400", 40 "border-radius": "10px", 41 "box-shadow": "4px 0px 30px 1px rgba(126, 126, 252, .5);", 42 'z-index': '999' 43 }, 44 superblue: { 45 "color": "white", 46 "background-color": "blue" 47 48 } 49 } 50 }); 51 52 53 54 $.notify(text_notify, { 55 autoHideDelay: 500000, 56 style: 'happyblue', 57 58 59 }); 60}; 61Main.prototype.install = function () { 62 $("#please_install").show() 63 $('body').toggleClass('dialog') 64}; 65 66$(".close").on("click", function (e) { 67 $(this).closest('dialog').hide(); 68 69 if($('body').hasClass('dialog')){ 70 $('body').removeClass('dialog') 71 } 72}); 73 74Main.prototype.init = function () { 75 console.log('Init Main') 76 try { 77 chrome.runtime.sendMessage(this.extensionId, {action: "isInstalled"}, function (t) { 78 if (!t) { 79 this.isInstalled = false; 80 $("body").on("click", '.install', function (t) { 81 this.install() 82 }.bind(this)); 83 return false; 84 } 85 86 $("#downloadStickerMania").hide(); 87 88 this.configuration = t.configurations; 89 90 if (typeof pack != "undefined" && pack) { 91 if (Object.prototype.hasOwnProperty.call(this.configuration.collections, pack.link) 92 && Object.keys(this.configuration.collections[pack.link].items).length == Object.keys(pack.items).length 93 ) { 94 $(".install[pack-id=" + pack.id + "]") 95 .addClass('added') 96 .text("added").attr("disabled", "disabled"); 97 } 98 if (Object.prototype.hasOwnProperty.call(this.configuration.collections, pack.link) 99 && Object.prototype.hasOwnProperty.call(this.configuration.collections[pack.link], "items") 100 && this.configuration.collections[pack.link].items[Object.keys(pack.items)[0]] && Object.keys(pack.items).length == true) { 101 $(".install").text("added").attr("disabled", "disabled") 102 } 103 104 105 $(".install[disabled!=disabled]").on("click", function (e) { 106 107 108 if (Object.prototype.hasOwnProperty.call(this.configuration.collections, pack.link)) { 109 this.configuration.collections[pack.link].items = Object.assign(this.configuration.collections[pack.link].items, pack.items) 110 } else { 111 this.configuration.collections[pack.link] = pack; 112 } 113 chrome.runtime.sendMessage(this.extensionId, { 114 action: "set_config", 115 data: {collections: this.configuration.collections} 116 }, function () { 117 this.success(); 118 119 const stickerId = $(".install").data("id"), 120 stickerName = $(".install").data("name"); 121 122 $(".install").addClass('added') 123 .attr("disabled", "disabled") 124 .text("added"); 125 if(!$(".install").attr("pack-id")) { 126 fetch(`/api/stat/sticker/${stickerId}`, {method: 'POST'}).then(data => data.json()); 127 } else { 128 let packid = $(".install").attr("pack-id"); 129 fetch(`/api/stat/pack/${packid}`, {method: 'POST'}).then(data => data.json()); 130 } 131 132 133 if($(".install").attr("pack-id")) { 134 gtag("event", "add-to-ext", {event_category: "add-pack", event_label: $(".install").attr("pack-name") + ":" + $(".install").attr("pack-id"), value: 1}) 135 } else { 136 gtag("event", "add-to-ext", {event_category: "add-sticker", event_label: stickerName + ":" + stickerId, value: 1}) 137 } 138 139 140 141 }.bind(this)); 142 }.bind(this)); 143 } 144 $('.install').css({'visibility':'visible'}) 145 }.bind(this)) 146 } catch (t) { 147 this.isInstalled = false;
148 console.log(t.message); 149 $("body").on("click", '.install', function (t) { 150 this.install() 151 }.bind(this)) 152 } 153}; 154 155$(function () { 156 (new Main).init() 157});
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.