forked from leomoty/SGPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SGPP.user.js
15 lines (15 loc) · 43.6 KB
/
SGPP.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ==UserScript==
// @name Steamgifts++
// @namespace https://github.com/leomoty/SGPP
// @version 0.2.5 beta
// @description SG++ for Steamgifts.com
// @author Leomoty
// @match http://www.steamgifts.com/*
// @run-at document-end
// @downloadURL https://raw.githubusercontent.com/leomoty/SGPP/master/SGPP.user.js
// @updateURL https://raw.githubusercontent.com/leomoty/SGPP/master/SGPP.meta.js
// @require http://code.jquery.com/jquery-2.1.3.min.js
// @require https://raw.githubusercontent.com/dinbror/bpopup/master/jquery.bpopup.min.js
// @grant GM_addStyle
// ==/UserScript==
var ModuleDefinition;(function(b){var a=(function(){function c(){var d=this;this._LSPrefix="SGPP_";this.containsItem=function(e){return localStorage.getItem(d._LSPrefix+e)!=null};this.getItem=function(e){return localStorage.getItem(d._LSPrefix+e)};this.setItem=function(e,f){localStorage.setItem(d._LSPrefix+e,f)}}return c})();b.LocalStorage=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(){function c(){var d=this;this._debug=true;this._settings=new a.Settings();this._storage=new a.LocalStorage();this.modules={};this.log=function(e){if(d._debug){console.log("["+new Date()+"] SGPP - "+e)}};this.appendCSS=function(e){d._styleSheet.append(e)};this.style="";this.init=function(){d.log("Steamgifts++ plugin started.");d.resolvePath();d._styleSheet=$(document.createElement("style")).attr("id","SGPP_StyleSheet").appendTo("head");d.appendCSS("/* SGPP Stylesheet */ ");d.appendCSS(d._settings.style);d._settings.init()};this.resolvePath=function(){var j="";var q="";var f="";var o="";var l="";var i=window.location;if(i.hash.length>1){j=i.hash.substring(1)}if(i.pathname=="/"){q="giveaways"}else{var n=i.pathname.split("/").filter(function(s,r,t){return Boolean(s)});q=n[0]||"";o=n[2]||"";if(n[0]=="giveaway"||n[0]=="trade"||n[0]=="discussion"||n[0]=="user"||n[0]=="group"){l=(n[3]=="search"?"":n[3])||"";f=n[1]||""}else{l=n[1]||""}}var k,h=/\+/g,p=/([^&=]+)=?([^&]*)/g,e=function(r){return decodeURIComponent(r.replace(h," "))},m=i.search.substring(1);var g={};while(k=p.exec(m)){g[e(k[1])]=e(k[2])}d._sgLocation={pageKind:q,code:f,description:o,subpage:l,hash:j,parameters:g}};this.init()}Object.defineProperty(c.prototype,"settings",{get:function(){return this._settings},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"location",{get:function(){return this._sgLocation},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"storage",{get:function(){return this._storage},enumerable:true,configurable:true});c.prototype.name=function(){return"Core"};c.prototype.shouldRun=function(d){return true};c.prototype.render=function(){this._settings.render()};return c})();a.Core=b})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(){function c(){this.shouldRun=function(d){return d.pageKind=="giveaway"&&d.subpage==""};this.style="div.SGPP_CommAndEnter {margin: 0 0 0 5px}\n";this.init=function(){};this.render=function(){var i=$(".sidebar .sidebar__entry-insert");if(i.length===0){return}var k=$(".sidebar .sidebar__entry-delete");var e=$(".sidebar .sidebar__entry-loading");var d=$(".js__submit-form");var g=e.clone().addClass("SGPP_CommAndEnter").insertAfter(d);var h=i.clone().addClass("SGPP_CommAndEnter").text("Submit + Enter").insertAfter(d);var f=new MutationObserver(function(l){h.toggleClass("is-hidden",i.hasClass("is-hidden"));g.toggleClass("is-hidden",e.hasClass("is-hidden"))});var j={attributes:true,attributeFilter:["class"]};f.observe(i[0],j);f.observe(e[0],j);h.click(function(m){i.click();$("textarea.description").prop("disabled",true);var l=new MutationObserver(function(n){if(!k.hasClass("is-hidden")){d.closest("input[name=do]").val("comment_new");d.closest("form").submit()}});l.observe(k[0],j)})}}c.prototype.name=function(){return"Comment and Enter on Giveaways"};return c})();a.CommentAndEnter=b})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){var d=this;this.url="http://www.steamgifts.com/giveaway/";this.cacheCompleted=false;this.isLoading=false;this.commenters={};this.pageStart=1337;this.style=".SGPP_EntryComm {margin: 0 10px}\n.SGPP_EntryComm > i {margin: 0}\n.SGPP_EntryComm:not(.loading) > .fa-spin {display: none}\n.SGPP_EntryComm.loading > .fa-comments-o {display: none}\n.SGPP_EntryComm.active > .fa-comments-o {opacity: 0.7}\n.SGPP_EntryComm:hover > .fa-comments-o {opacity: 1}\nspan.SGPP_EntryComm_comment {vertical-align: inherit; text-shadow: none}\n.SGPP_EntryComm_disabled .SGPP_EntryComm_comment {visibility: hidden}\n.SGPP_EntryComm_comment > i.fa.fa-check, .SGPP_EntryComm_comment > i.fa.fa-times {font-size: 0.7em}\n.SGPP_EntryComm_comment > i.fa.fa-check {color: #719A47}\n.SGPP_EntryComm_comment > i.fa.fa-times {color: rgba(166, 93, 92, 0.85)}\n";this.render=function(){d.button.appendTo(".page__heading__breadcrumbs").one("click",d.firstRun)};this.firstRun=function(){if(!d.cacheCompleted){if(!d.isLoading){d.button.addClass("loading");d.isLoading=true;d.getCommenters()}setTimeout(d.firstRun,1000);return}d.button.removeClass("loading");$(".table__rows .table__column--width-fill > a").each(d.main);d.button.addClass("active");d.button.click(d.toggleState);var e=new MutationObserver(function(f){for(var g=0;g<f.length;g++){$(".table__rows").toggleClass("SGPP_EntryComm_disabled",!d.button.hasClass("active"));$(f[g].addedNodes).find(".table__column--width-fill > a").each(d.main)}});e.observe($(".table")[0],{childList:true,subtree:true})};this.toggleState=function(){d.button.toggleClass("active");$(".table__rows").toggleClass("SGPP_EntryComm_disabled",!d.button.hasClass("active"))};this.main=function(e,f){var g=$("p.table__column__heading",f);if(g.length>0){f=g[0]}if(d.commenters[f.textContent.trim()]){d.elements.pos.clone().appendTo(f)}else{d.elements.neg.clone().appendTo(f)}};this.getCommenters=function(){d.url+=SGPP.location.code+"/"+SGPP.location.description+"/search?page=";d.page=d.pageStart;d.getCommentPage()};this.getCommentPage=function(){$.ajax({type:"GET",url:d.url+d.page,success:d.handleCommentPage})};this.handleCommentPage=function(g){var e=$(g);$(".comments .comment__username",e).each(function(h,j){d.commenters[j.textContent.trim()]=true});if(d.page==d.pageStart){var f=$("a[data-page-number]",e);d.page=f.length!=0?f.last().data().pageNumber:1}if(--d.page>0){d.getCommentPage()}else{d.cacheCompleted=true}}}c.prototype.init=function(){var e=$(document.createElement("i")).addClass("giveaway__icon fa fa-comments-o").attr("title","Check who commented");var f=$(document.createElement("i")).addClass("giveaway__icon fa fa-refresh fa-spin").attr("title","Loading comments...").css("cursor","auto");this.button=$(document.createElement("span")).addClass("SGPP_EntryComm").append(e,f);var d=$(document.createElement("span")).addClass("SGPP_EntryComm_comment fa-stack").append($(document.createElement("i")).addClass("fa fa-comment-o fa-stack-1x"));var h=$(document.createElement("i")).addClass("fa fa-check fa-stack-1x");var g=$(document.createElement("i")).addClass("fa fa-times fa-stack-1x");this.elements={pos:d.clone().addClass("positive").attr("title","Commented").append(h),neg:d.clone().addClass("negative").attr("title","Did not comment").append(g)}};c.prototype.name=function(){return"Checks if entries/winners commented on Giveaways"};c.prototype.shouldRun=function(d){return d.pageKind=="giveaway"&&(d.subpage=="entries"||d.subpage=="winners")};return c})();b.EntryCommenters=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){this.style="body.SPGG_FixedNavbar {padding-top: 39px}\nheader.SPGG_FixedNavbar {position: fixed; top: 0px; width: 100%; z-index: 100}\n.comment__summary {margin-top: -44px !important; padding-top: 48px !important;}\n.comment__actions__button {position: relative; z-index: 5;}\n.page__heading__breadcrumbs {z-index: 5;}";this.shouldRun=function(d){return true}}c.prototype.init=function(){};c.prototype.render=function(){$("body").addClass("SPGG_FixedNavbar");$("header").addClass("SPGG_FixedNavbar")};c.prototype.name=function(){return"Fixed Navbar on top"};return c})();b.FixedNavbar=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){this.style="body.SGPP_FixedFooter {padding-bottom: 45px}\n.footer__outer-wrap.SGPP_FixedFooter_outerWrap {padding: 15px 0px; z-index: 100; bottom: 0px; position: fixed; width: 100%; background: inherit}\n.footer__inner-wrap.SGPP_FixedFooter_innerWrap {margin: 0px 25px}\n";this.shouldRun=function(d){return true}}c.prototype.init=function(){};c.prototype.render=function(){$("body").addClass("SGPP_FixedFooter");$(".footer__outer-wrap").addClass("SGPP_FixedFooter_outerWrap");$(".footer__inner-wrap").addClass("SGPP_FixedFooter_innerWrap")};c.prototype.name=function(){return"Fixed Footer on bottom"};return c})();b.FixedFooter=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(){function c(){var d=this;this.shouldRun=function(e){return e.pageKind=="giveaways"&&["created","entered","won"].indexOf(e.subpage)==-1};this.style=".SGPP__gridView {display: flex; flex-wrap: wrap; justify-content: space-around; margin: 5px;}\n.tile_view_header {font-size: 12px; border-bottom: 1px solid #D2D6E0; box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.3); margin-bottom: 3px; text-align: center}\n.SGPP__gridAvatar_outer {float: right; display: inline-block; margin-left: 5px}\n.SGPP__gridAvatar {height: 27px; width: 27px; padding: 2px}\n.SGPP__gridTile {margin: 5px}\n.SGPP__gridTile > .global__image-outer-wrap--game-medium {position: relative}\n.SGPP__gridTile:not(:hover) .SGPP__gridTileTime {display: none}\n.SGPP__gridTile:hover {opacity: 1}\n.SGPP__gridTile:hover > .global__image-outer-wrap--game-medium {border-radius: 4px 4px 0 0; border-bottom: 1px dotted transparent}\n.SGPP__gridTile:hover > .SGPP__gridTileInfo {display: block; border-radius: 0 0 4px 4px}\n.SGPP__gridTileInfo {display: none; position:absolute; width:184px; border-top: none; z-index: 10}\n.SGPP__gridTileInfo .giveaway__icon {opacity: 0.7}\n.SGPP__gridTileTime {position: absolute; bottom: 5px; left: 5px; height: 16px; text-align: center; background-color: #FFF; border-radius: 0 3px 0 0; padding: 2px 4px}\n.SGPP__gridTileTime i {font-size: inherit; color:inherit}\n.SGPP__gridTileIcons {position: absolute; bottom: 5px; right: 5px}\n.SGPP__gridTileIcons > * {display: inline-block; width: 20px; height: 16px; text-align: center; padding: 2px; border-radius: 3px 0 0; vertical-align: middle}\n.SGPP__gridTileIcons > :not(:last-child) {padding-right: 4px; margin-right: -3px}\n";this.init=function(){};this.render=function(){var e=$(".pagination").prev();e.parent().on("DOMNodeInserted",function(f){if($(f.target).hasClass("pagination__navigation")){d.updateGridview($(".pagination").prev())}});d.updateGridview(e)};this.updateGridview=function(f){var g=$(document.createElement("div")).wrapInner(f.children(".giveaway__row-outer-wrap"));var e=d.generateGridview(g);f.append(e)};this.generateGridview=function(h){function k(p,n){var o=+(p/n)*100;return o<0.01?"<0.01":Math.min(o,100).toFixed(2)}var j=function(n){return"<strong>"+n+"</strong>"};var f=function(n){return $("<div>",{style:"float: left",append:n})};var g=function(n){return $("<div>",{style:"float: right",append:n})};var m=$("<div>",{"class":"SGPP__gridView"});var l=$("<div>",{"class":"SGPP__gridTile"});var e=$("<div>",{"class":"SGPP__gridTileInfo global__image-outer-wrap"});var i=$("<div>",{"class":"SGPP__gridTileIcons"});h.find(".giveaway__row-inner-wrap").each(function(){var B=$(this);if(B.parents(".pinned-giveaways").length!=0){return}var y=l.clone().toggleClass("is-faded",B.hasClass("is-faded"));var o=B.children(".global__image-outer-wrap--game-medium").appendTo(y).css("position","relative");var n=B.find(".giveaway__columns").children();var u=n.eq(0).addClass("SGPP__gridTileTime").appendTo(o);u.find("span").text(function(D,C){return C.match(/\d+(?:\s+)./)[0].replace(" ","")});var A=n.slice(2);if(A.length>0){A.filter(".giveaway__column--contributor-level").text(function(D,C){return C.replace("Level ","")});i.clone().append(A).appendTo(o)}var x=B.find(".giveaway__heading__name").text();var z=B.find(".global__image-outer-wrap--avatar-small").addClass("SGPP__gridAvatar");var t=B.find(".giveaway__heading__thin").toArray();var r=parseInt(t.pop().textContent.replace(/\D+/g,""));var q=t.length==0?1:parseInt(t.pop().textContent.replace(/\D+/g,""));var p=B.find(".giveaway__links").children();var s=parseInt(p.eq(0).text().replace(/\D+/g,""));var w=parseInt(p.eq(1).text().replace(/\D+/g,""));var v=k(q,s);e.clone().append($("<div>",{text:x,"class":"giveaway__heading__name tile_view_header"}),$("<div>",{"class":"SGPP__gridAvatar_outer",title:"Created "+n.eq(1).text(),append:z}),$("<div>",{style:"display: inline-block; width: 145px"}).append(f(j(q)+(q>1?" Copies":" Copy")),g(j(r+"P")),$("<div>",{style:"clear: both"}),f(j(v+"%")).attr("title","Probability to win"),g(B.find(".giveaway__icon"))),$("<div>",{style:"clear: both"}),f(j(s)+" Entries"),g(j(w)+" Comments")).appendTo(y);m.append(y)});return m}}c.prototype.name=function(){return"GridView"};return c})();a.GridView=b})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){this.style="";this.shouldRun=function(d){return false}}c.prototype.init=function(){};c.prototype.render=function(){};c.prototype.name=function(){return"LivePreview"};return c})();b.LivePreview=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){this.style="";this.shouldRun=function(d){return true}}c.prototype.init=function(){};c.prototype.render=function(){var j=$(".sidebar");var n=$(document.createElement("div")).addClass(j.attr("class"));var o=j.wrapInner(n).children().first().addClass("SGPP__scrollingSidebar");var m=j.find(".adsbygoogle");var h=(function(){var p;return function(q){clearTimeout(p);p=setTimeout(function(){if(q){m.stop().slideUp()}else{m.stop().slideDown()}},250)}})();var f=$(window);var l=$(".footer__outer-wrap").outerHeight();var k=$(".page__inner-wrap .widget-container");var g=$(".featured__container").height();var i=25;var e=0;if(SGPP.modules.FixedNavbar!==undefined){i+=$("header").outerHeight()}else{e+=$("header").outerHeight()}var d=function(){var p=f.scrollTop();if(p+o.height()>=k.position().top+k.height()){o.css({position:"fixed",top:"",bottom:l});h(true)}else{if(p<=g+e){o.css({position:"static",top:"",left:""});h(false)}else{o.css({position:"fixed",top:i,bottom:""}).show();h(true)}}};$(".featured__inner-wrap .global__image-outer-wrap img").on("load",function(){g=$(".featured__container").height();d()});d();$(document).scroll(d)};c.prototype.name=function(){return"Scrolling Sidebar"};return c})();b.ScrollingSidebar=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){var d=this;this.style=".SGPP__settings { cursor: pointer; }\n.SGPP__settings_page { min-height: 400px; max-height: 500px; overflow-y: scroll; overflow-x: hidden; }\n.SGPP__settings_icon { width: 48px; }";this.settingsNavIcon='<a class="nav__row SGPP__settings">\n<i class="icon-red fa fa-fw fa-bars"> </i>\n<div class="nav__row__summary">\n<p class="nav__row__summary__name" > SG++ Settings</p>\n<p class="nav__row__summary__description"> Steamgifts++ settings.</p>\n</div>\n</a>\n';this.settingsPage=function(e){return'<div class="popup SGPP__settings_popup">\n<i class="popup__icon fa fa-bars SGPP__settings_icon"></i>\n<p class="popup__heading">Steamgifts++ Settings</p>\n<div class="form__rows SGPP__settings_page">'+e+'</div>\n<p class="popup__actions" style="margin-top:5px;">\n<span class="SGPP__settings-save b-close">Save</span>\n<span class="b-close">Close</span>\n</p>\n</div>\n'};this.moduleSetting=function(f,g,e,h){return'<div class="form__row" style="margin-bottom:10px;">\n<div class="form__heading"><div class="form__heading__number">'+f+'</div><div class="form__heading__text">'+g+'</div></div>\n<div class= "form__row__indent">\n<div>\n<input type="hidden" name="'+e+'" value="'+(h?"1":"0")+'">\n<div class= "SGPP__settings-checkbox '+(h?"is-selected":"is-disabled")+'">\n<i class= "form__checkbox__default fa fa-circle-o"> </i><i class="form__checkbox__hover fa fa-circle"> </i><i class= "form__checkbox__selected fa fa-check-circle"> </i>Enabled\n</div>\n</div>\n</div>\n</div>\n'};this.init=function(){};this.render=function(){$(".nav__absolute-dropdown a[href^='/?logout']").before(d.settingsNavIcon);var e="";var f=0;for(var j in modulesNames){f++;var h=new b[modulesNames[j]]();e+=d.moduleSetting(f,h.name(),modulesNames[j],false)}var g=d.settingsPage(e);$(".footer__outer-wrap").before(g);$(".SGPP__settings").on("click",d.handleSettingClick);$(".SGPP__settings-save").on("click",d.handleSaveSettings);$(".SGPP__settings-checkbox").on("click",d.handleSettingsCheckboxClick)};this.handleSettingsCheckboxClick=function(){var e=$(this).siblings("input");if($(this).hasClass("is-selected")){$(this).removeClass("is-selected");$(this).addClass("is-disabled");e.val("0")}else{$(this).removeClass("is-disabled");$(this).addClass("is-selected");e.val("1")}};this.handleSettingClick=function(){var e=$(".SGPP__settings_popup").bPopup({opacity:0.85,fadeSpeed:200,followSpeed:500,modalColor:"#3c424d"});$(".SGPP__settings_popup .SGPP__settings-checkbox").addClass("form__checkbox");$(".SGPP__settings_popup input").each(function(g,h){var f=$(h);var j=SGPP.storage.getItem(f.attr("name"));f.val(j);var i=f.siblings(".SGPP__settings-checkbox");i.toggleClass("is-selected",j==1);i.toggleClass("is-disabled",j!=1)})};this.handleSaveSettings=function(){$(".SGPP__settings_popup input").each(function(f,g){var e=$(g);SGPP.storage.setItem(e.attr("name"),e.val())});window.location.reload()};this.shouldRun=function(e){return true};this.isModuleEnabled=function(e){return SGPP.storage.getItem(e)=="1"}}c.prototype.name=function(){return"Settings"};return c})();b.Settings=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(){function c(){this.style='.SGPP_UserInfo_balloon {position: absolute; border: solid 2px black; z-index: 99; min-width: 200px; border-radius: 3px; min-height: 100px; background-color: inherit}\n.SGPP_UserInfo_balloon:after {position: absolute; right: 100%; top: 5px; content: ""; height: 0; width: 0; border-style: solid; border-color: transparent black; border-width: 15px 20px 15px 0px}\n.SGPP_UserInfo_balloon.right:after {right: -20px; border-width: 15px 0 15px 20px}\n.SGPP_UserInfo_balloon .featured__outer-wrap.featured__outer-wrap--user {width: auto; padding: 15px 0}\n.SGPP_UserInfo_balloon .featured__heading i {font-size: inherit}\n.SGPP_UserInfo_balloon .featured__table__column {width: 175px}\n.SGPP_UserInfo_balloon .featured__table .featured__table__row {padding: 5px 0px}\n.SGPP_UserInfo_balloon .featured__table__column:not(:first-child) {margin-left: 15px}\n.SGPP_UserInfo_balloon .featured__outer-wrap .global__image-outer-wrap {float: left; margin: 10px 7px 0px 0px; padding: 2px; width: 48px; height: 48px}\n.SGPP_UserInfo_balloon .SGPP_UserOnline {background: linear-gradient(to bottom, #8FB93B 5%, #6E8C31 95%) repeat scroll 0% 0% transparent}\n.SGPP_UserInfo_balloon .SGPP_UserOffline {background: linear-gradient(to bottom, rgba(106, 106, 106, 0.45) 5%, rgba(85, 85, 85, 1) 95%) repeat scroll 0% 0% transparent}\n.SGPP_UserInfo_balloon .sidebar__shortcut-inner-wrap {width: 130px; color: rgba(255, 255, 255, 0.4)}\n.SGPP_UserInfo_balloon .sidebar__shortcut-inner-wrap > * {line-height: 10px; text-shadow: none; background: none; border: none}\n.SGPP_UserInfo_balloon .sidebar__shortcut-inner-wrap > .is-selected, .SGPP_UserInfo_balloon .sidebar__shortcut-inner-wrap > :hover, .SGPP_UserInfo_balloon .sidebar__shortcut-inner-wrap > :active {background: none; text-shadow: none; box-shadow: none}\n';this.shouldRun=function(d){return true}}c.prototype.init=function(){};c.prototype.render=function(){function f(o){var j=$(".featured__outer-wrap.featured__outer-wrap--user",o);var k=$(".featured__table__row",j);var m=$(".featured__heading",j).css("display","block");var p=$(".global__image-outer-wrap",j).prependTo(m);var l=k.eq(1).children().last().text().trim();if(l.toLowerCase().indexOf("online")>-1){p.attr("title",l).addClass("SGPP_UserOnline")}else{p.attr("title","Online "+l).addClass("SGPP_UserOffline")}k.eq(1).remove();var n=k.last().children().last();n[0].title="Contributor Value: "+$("span",n)[0].title;$("span",n).removeAttr("title");n.appendTo(m);k.last().remove();var i=$(".sidebar__shortcut-inner-wrap",o).insertAfter(n);i.children().eq(2).click(function(){$(this).find("form").submit()});var q=$(".sidebar__suspension",o);if(q.length>0){$("<span>",{style:"color: #B16C86",text:" ("+q.text().trim()+")",title:$(".sidebar__suspension-time",o).text()}).appendTo(k.eq(0).children().last())}return j}var e=$("<div>",{id:"SGPP_UserInfo_balloon","class":"SGPP_UserInfo_balloon"}).appendTo("body").hide();var d={};var h=$("<div>",{style:"color: black"}).append($("<i>",{"class":"fa fa-refresh fa-spin fa-4x",style:"margin: 30px 80px; font-size: 4em; color: #6B7A8C"}));e.append(h);e.hover(function(){e.stop(true).fadeIn("fast")},function(){g.close()});var g={timeout:null,run:function(i,k,j){clearTimeout(this.timeout);this.timeout=setTimeout(function(){e.css(k);e.children().remove();if(j){e.addClass("right")}else{e.removeClass("right")}var l=i.match(/\/user\/(.+?)(?:\/|$)/)[1];if(l!==undefined&&l in d){e.append(d[l]).stop(true).show()}else{e.append(h).stop(true).show();$.ajax({url:i,type:"GET",dataType:"html",success:function(m){var n=f(m).data("user",l);d[l]=n;e.children().remove();e.append(n)}})}},1500)},close:function(){clearTimeout(this.timeout);e.stop(true).delay(500).fadeOut("slow")}};$(document).on({mouseenter:function(m){var k=$(m.target);if(k.attr("href").split("/").length>3||k.prop("href")==document.URL){return}var n=k.offset();var l;var i=$(window).width();var j=m.target.getBoundingClientRect().left>i/2;if(j){l={top:n.top+(k.height()/2)-25,right:i-n.left+20,left:""}}else{l={top:n.top+(k.height()/2)-25,right:"",left:n.left+k.width()+20}}g.run(k.attr("href"),l,j)},mouseleave:function(){g.close()}},'a[href^="/user/"]:not(.nav__avatar-outer-wrap)')};c.prototype.name=function(){return"Show User Profile on Hover"};return c})();a.UserHoverInfo=b})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var c=(function(){function d(e){this._isDataStored=false;this.localStorageKey="endless_scroll_"+e;if(this.localStorageKey in localStorage){this._obj=JSON.parse(localStorage[this.localStorageKey]);if(!("numberOfComments" in this._obj)){this._obj.numberOfComments=0}if(!("lastSeenPage" in this._obj)){this._obj.lastSeenPage=0}if(!("collapsed" in this._obj)){this._obj.collapsed={}}this._isDataStored=true}else{this._obj={lastVisit:Date.now(),lastCommentIDPages:{},collapsed:{},numberOfComments:0}}}Object.defineProperty(d.prototype,"isDataStored",{get:function(){return this._isDataStored},enumerable:true,configurable:true});Object.defineProperty(d.prototype,"lastVisit",{get:function(){return this._obj.lastVisit},enumerable:true,configurable:true});d.prototype.getNumComments=function(){return this._obj.numberOfComments};d.prototype.setCommentState=function(f,e){if(!e){delete this._obj.collapsed[f]}else{this._obj.collapsed[f]=1}this.save()};d.prototype.getCommentState=function(e){return e in this._obj.collapsed};d.prototype.setLastVisit=function(){this._obj.lastVisit=Date.now();this.save()};d.prototype.setLastSeenPage=function(e){this._obj.lastSeenPage=e;this.save()};d.prototype.setLastCommentID=function(g,f,e){this._obj.lastCommentIDPages[g]=f;this._obj.numberOfComments=e;this.save()};d.prototype.isNewComment=function(f,e){if(f in this._obj.lastCommentIDPages){return(e>this._obj.lastCommentIDPages[f])}else{return true}};d.prototype.forget=function(){if(this.localStorageKey in localStorage){localStorage.removeItem(this.localStorageKey)}};d.prototype.save=function(){localStorage[this.localStorageKey]=JSON.stringify(this._obj)};return d})();var b=(function(){function d(){this.style=".endless_new .comment__parent .comment__summary, .endless_new > .comment__child{}.endless_not_new .comment__parent .comment__summary, .endless_not_new > .comment__child{}.endless_not_new:hover .comment__parent .comment__summary, .endless_not_new:hover > .comment__child{}.endless_badge_new, .endless_badge_new_child {border-radius: 4px; margin-left:5px; padding: 3px 5px; background-color: #C50000;text-shadow: none;color: white; font-weight: bold;}.endless_badge_new_child { display: none; }.comment--collapsed .endless_badge_new_child { display: block; }\n.table__row-outer-wrap .markcomments_controls { display: none; }\n.table__row-outer-wrap:hover .markcomments_controls { display: inline; }.markcomments_controls i { opacity: 0.5; cursor: pointer; }\n.markcomments_controls i:hover { opacity: 1; }"}Object.defineProperty(d.prototype,"topic",{get:function(){return this.topicInfo},enumerable:true,configurable:true});d.prototype.getDiscussionId=function(f){var e=/(discussion|trade)\/([^/]+)(\/|$)/.exec(f);if(!e){throw"No Discussion ID"}return e[1]+"_"+e[2]};d.prototype.getLatestCommentID=function(e){var f=0;$(e).find(".comment[data-comment-id]").each(function(g,h){var j=parseInt($(h).data("comment-id"));if(j>f){f=j}});return f};d.prototype.shouldRun=function(){return true};d.prototype.init=function(){};d.prototype.render=function(){var h=this;if(SGPP.location.pageKind=="discussion"||SGPP.location.pageKind=="trade"){this.topicInfo=new c(this.getDiscussionId(location.pathname));var f=1;var g=$("div.pagination__navigation a.is-selected");if(g.length!=0){f=g.first().data("page-number")}this.markComments($(document),f,true);this.topicInfo.setLastVisit();var e=this;$("body").on("click",".comment__collapse-button",function(){var k=$(this);var j=k.parents(".comment");var i=parseInt(j.data("comment-id"));e.topicInfo.setCommentState(i,true)});$("body").on("click",".comment__expand-button",function(){var k=$(this);var j=k.parents(".comment");var i=parseInt(j.data("comment-id"));e.topicInfo.setCommentState(i,false)});if("EndlessScrollDiscussionReplies" in SGPP.modules){$(SGPP.modules.EndlessScrollDiscussionReplies).on("beforeAddItems",function(j,l,k,i){h.markComments(l,k,true,i)})}}else{if(SGPP.location.pageKind=="discussions"||SGPP.location.pageKind=="trades"){this.markTopics($(document));var e=this;$("body").on("click",".markcomments_forget",function(){var l=$(this);var i=l.parents("h3");var j=i.children("a");var k=new c(e.getDiscussionId(j.attr("href")));k.forget();i.find(".endless_badge_new").remove();l.remove()});if("EndlessScrollDiscussion" in SGPP.modules){$(SGPP.modules.EndlessScrollDiscussion).on("beforeAddItems",function(j,l,k,i){h.markTopics(l)})}}else{if(SGPP.location.pageKind=="giveaways"&&SGPP.location.subpage==""){this.markTopics($(".widget-container").last().prev().prev())}}}};d.prototype.checkNewComments=function(g,f){var h=this;var e=false;$(g).find(".comment[data-comment-id]").each(function(j,k){var l=parseInt($(k).data("comment-id"));if(h.topicInfo.isNewComment(f,l)){e=true}});return e};d.prototype.markComments=function(i,g,h,e){var j=this;if(h===void 0){h=false}if(e===void 0){e=false}if(this.topicInfo.isDataStored||e){i.find(".comment[data-comment-id]").each(function(k,l){var o=parseInt($(l).data("comment-id"));var n=j.topicInfo.isNewComment(g,o);var m=j.topicInfo.getCommentState(o);if(m){$(l).addClass("comment--collapsed")}if(n){$(l).addClass("endless_new");$(l).find(".comment__username").first().after($("<span>").addClass("endless_badge_new").text("New").attr("title","New since last visit"))}else{$(l).addClass("endless_not_new")}if(j.checkNewComments(l,g)){if(!n){$(l).find(".comment__username").first().after($("<span>").addClass("endless_badge_new_child").text("New replies").attr("title","New since last visit"))}$(l).addClass("endless_new_children")}else{$(l).addClass("endless_no_new_children")}})}if(h){var f=parseInt($(".comments:eq(1)").prev().find("a").text().split(" ")[0]);this.topicInfo.setLastCommentID(g,this.getLatestCommentID(i),f)}};d.prototype.markTopics=function(e){var f=this;e.find(".table__row-outer-wrap").each(function(k,l){try{var n=$(l).find("h3 a").first();var o=new c(f.getDiscussionId(n.attr("href")));if(true){n.attr("href",n.attr("href")+"/search?page=31337")}if(o.isDataStored){var h=parseInt($(l).find(".table__column--width-small a.table__column__secondary-link").text());var g=o.getNumComments();var j=h-g;if(j>0){$(l).addClass("endless_new_comments");if(true){n.after($("<span>").addClass("endless_badge_new").text(j).attr("title",j+" new comments since last visit"))}else{$(l).find(".table__column--width-fill > p").first().append(" - <strong>"+j+" new comments</strong>")}}else{$(l).addClass("endless_no_new_comments");$(l).find(".table__column--width-fill > p").first().append(" - no new comments</strong>")}$(l).find("h3").first().append('<span class="markcomments_controls pull-right"><i class="fa fa-remove markcomments_forget" title="Forget this topic"></i></span>')}}catch(m){}})};d.prototype.name=function(){return"Mark Comments"};return d})();a.MarkComments=b})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(){function c(){this.style=".message_filter_hidden { display: none; }\n.message_filter_visible { }\n.filterdrop { position: absolute; }\n.filterdrop a { display: block; }\n.message-filters { margin-left: 5px; }\n.message-filter { cursor: pointer; }\n.message-filter i { margin: 0; }";this._hideRead=false}c.prototype.shouldRun=function(){return(SGPP.location.pageKind=="discussion"||SGPP.location.pageKind=="trade")};Object.defineProperty(c.prototype,"hideRead",{get:function(){return this._hideRead},set:function(d){this._hideRead=d;this._filterElement.find(".hideread i").toggleClass("fa-square-o",!d).toggleClass("fa-check-square-o",d);this.filterAll()},enumerable:true,configurable:true});c.prototype.init=function(){};c.prototype.filterItem=function(e){var d=$(e);var g=true;var h=!d.hasClass("endless_not_new");var f=!d.hasClass("endless_no_new_children");if(this.hideRead){g=g&&(h||f)}d.toggleClass("message_filter_hidden",!g);d.toggleClass("message_filter_visible",g)};c.prototype.filterAll=function(){var d=this;$(".comment").each(function(e,f){d.filterItem(f)})};c.prototype.render=function(){var e=this;if("EndlessScrollDiscussionReplies" in SGPP.modules){$(SGPP.modules.EndlessScrollDiscussionReplies).on("addItem",function(g,f){e.filterItem(f)})}var d=this;this._filterElement=$('<span class="message-filters"></span>');this._filterElement.append('<span class="message-filter hideread"><i class="fa fa-square-o"></i> Hide Read</span>').click(function(){d.hideRead=!d.hideRead});$(".comments:eq(1)").prev().find("div").append(this._filterElement);this.filterAll()};c.prototype.name=function(){return"Hide Read Comments"};return c})();b.MessagesFilterTest=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(){function c(){this._maxPage=31337;this._nextPage=-1;this._currentPage=1;this._lastPage=1;this._numberOfPages=-1;this._stopped=false;this._pages={};this._pagesUrl={}}Object.defineProperty(c.prototype,"stopped",{get:function(){return this._stopped},set:function(d){this._stopped=d},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"currentPage",{get:function(){return this._currentPage},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"lastPage",{get:function(){return this._numberOfPages},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"reverseItems",{get:function(){return false},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"BaseUrl",{get:function(){throw"BaseUrl() not implmented"},enumerable:true,configurable:true});c.prototype.hasPages=function(d){return $(d).find(".pagination__navigation").length!=0};c.prototype.getNavigationElement=function(d){return $(d).find(".pagination").first()};c.prototype.createPageContainerElement=function(){throw"createPageContainerElement() not implemented"};c.prototype.getItemsElement=function(d){throw"getItemsElement() not implemented"};c.prototype.getItems=function(d){throw"getItems() not implemented"};c.prototype.createLoadingElement=function(){var d=$('<span class="endless_loading"> - <i class="fa fa-refresh fa-spin"></i> Loading...</span>');return d};c.prototype.createPageElement=function(g){var i=this;var f=$('<div class="table__heading"><div class="table__column--width-fill"><p><span class="endless_page"></span></p></div></div>');var e=f.find("p");this.updatePageElement(f,g);var d=$("<div>").addClass("pull-right").addClass("endless_control_element");var h=$("<a>").attr("href","#").append('<i class="fa fa-pause"></i>').attr("title","Pause/Resume endless scrolling");h.click(function(){i.stopped=!i.stopped;$(".endless_control_element a i.fa").toggleClass("fa-pause").toggleClass("fa-play");return false});d.append(h);e.append(d);return f};c.prototype.updatePageElement=function(d,e){var f="";if(e>0){if(this._numberOfPages>0){f="Page "+e+" of "+this._numberOfPages}else{f="Page "+e}}else{f="Last page ends here"}d.find(".endless_page").text(f)};c.prototype.loadNextPage=function(){if(this._stopped){return}if(this._nextPage>this._lastPage||this._nextPage<1){return}this.loadPage(this._nextPage)};c.prototype.updateNextPage=function(d){if(this.reverseItems){this._nextPage=d-1}else{this._nextPage=d+1}};c.prototype.loadPage=function(l,f){var h=this;if(f===void 0){f=false}if(!(l in this._pagesUrl)){throw"No URL for page "+this._currentPage}if(!(l in this._pages)){var m=-1;var j=-1;$.each(this._pages,function(p,q){var r=Math.abs(p-l);if(j==-1||m>r){j=p;m=r}});var e=this.createPageContainerElement();var n=this.createLoadingElement();var o=this.createPageElement(l);o.find("p").first().append(n);e.append(o);this._pages[l]={element:e,loaded:false,loading:false,visible:true};var i=this._pages[j].element;if((j<l&&!this.reverseItems)||(j>l&&this.reverseItems)){i.after(e)}else{i.before(e)}}var g=this._pages[l];if(g.loading){return}else{if(g.loaded&&!f){if(!g.visible){g.element.show();g.visible=true}if(this._nextPage==l){this.updateNextPage(l)}}else{var d=this._pagesUrl[l];this._pages[l].loading=true;var k=this._pages[l].loaded;$.get(d,function(q){var t=$.parseHTML(q);if(k){e.children().remove()}var s=h.getNavigationElement(t);var r=parseInt(s.find("a.is-selected").data("page-number"));var p=$(t);$(h).trigger("beforeAddItems",[p,r,k]);var u=h.getItemsElement(t);h.parseNavigation(s);h.addItems(u,e,l);e.prepend(o);h.getNavigationElement(document).html(s.html());$(h).trigger("afterAddItems",[e,r,k]);h._pages[l].loaded=true;n.remove();if(h._nextPage==l||h._nextPage==-1){h.updateNextPage(r)}if(r!=l){h.updatePageElement(o,r);h._pages[r]=h._pages[l];delete h._pages[l]}})}}};c.prototype.addItems=function(f,d,e){var g=this;this.getItems(f).each(function(h,j){$(g).trigger("addItem",[j]);if(g.reverseItems){d.prepend(j)}else{d.append(j)}})};c.prototype.parseNavigation=function(e){var f=this;var d=e.find("a").last();this._lastPage=parseInt(d.data("page-number"));if(d.text().trim()!="Next"){this._numberOfPages=this._lastPage}e.find(".pagination__navigation a").each(function(h,j){var g=$(j);var k=parseInt(g.data("page-number"));f._pagesUrl[k]=g.attr("href");if(k>f._lastPage){f._lastPage=k}})};c.prototype.preparePage=function(){var i=this;var h=this.getNavigationElement(document);if(h.hasClass("pagination--no-results")){return}if(!this.hasPages(document)){this._currentPage=1;this._lastPage=1;this._numberOfPages=1}else{this._currentPage=parseInt(h.find("a.is-selected").data("page-number"));this.parseNavigation(h)}var e=this.getItemsElement(document);var f=this.createPageElement(this.currentPage);var d=SGPP.location.hash!="";this._pages[this.currentPage]={element:e,loaded:true,loading:false,visible:true};if(this.reverseItems){this.getItems(e).each(function(j,k){e.prepend(k)});if(this._currentPage==1&&this._numberOfPages>1&&!d){this._nextPage=this._lastPage;this.loadNextPage();this._pages[this.currentPage].visible=false;e.hide()}else{if(this._currentPage==1&&this._numberOfPages==-1&&!d){this._pagesUrl[this._maxPage]=this.BaseUrl+"/search?page="+this._maxPage;this._pages[this.currentPage].visible=false;e.hide();this.loadPage(this._maxPage)}else{this._nextPage=this._lastPage-1}}}else{this._nextPage=this._currentPage+1}e.prepend(f);if(d){var g=$("#"+SGPP.location.hash);$(window).scrollTop(g.offset().top)}$(window).scroll(function(j){var k=$(window).scrollTop()+$(window).height();if(k>$("div.pagination").position().top-200){i.loadNextPage()}});$(window).scroll()};return c})();a.EndlessScroll=b})(ModuleDefinition||(ModuleDefinition={}));var __extends=this.__extends||function(f,a){for(var e in a){if(a.hasOwnProperty(e)){f[e]=a[e]}}function c(){this.constructor=f}c.prototype=a.prototype;f.prototype=new c()};var ModuleDefinition;(function(b){var a=(function(d){__extends(c,d);function c(){d.apply(this,arguments);this.style=""}c.prototype.shouldRun=function(){return SGPP.location.pageKind=="discussions"||SGPP.location.pageKind=="trades"};c.prototype.init=function(){};c.prototype.render=function(){this.preparePage()};c.prototype.createPageContainerElement=function(){return $('<div class="table__rows">')};c.prototype.getItemsElement=function(e){return $(e).find(".table__rows").first()};c.prototype.getItems=function(e){return e.children(".table__row-outer-wrap")};c.prototype.name=function(){return"Endless Scroll on Discussions page"};return c})(b.EndlessScroll);b.EndlessScrollDiscussion=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(c){__extends(d,c);function d(){c.apply(this,arguments);this.style=""}d.prototype.shouldRun=function(){return SGPP.location.pageKind=="discussion"||SGPP.location.pageKind=="trade"};d.prototype.init=function(){};d.prototype.render=function(){if(true){var e=$(".comment--submit").first();if(e.length==1){var f=$('<div id="esc_reply_header" class="page__heading"><div class="page__heading__breadcrumbs">Reply</div></div>');if($(".poll").length==0){$(".comments").first().after(f)}else{$(".poll").first().after(f)}$("#esc_reply_header").after(e);$(".js__comment-reply-cancel").on("click",function(){setTimeout(function(){e.insertAfter("#esc_reply_header")},10)})}}this.preparePage()};Object.defineProperty(d.prototype,"BaseUrl",{get:function(){return"/"+SGPP.location.pageKind+"/"+SGPP.location.code+"/"+SGPP.location.description},enumerable:true,configurable:true});Object.defineProperty(d.prototype,"reverseItems",{get:function(){return true},enumerable:true,configurable:true});d.prototype.createPageContainerElement=function(){return $('<div class="comments">')};d.prototype.getItemsElement=function(e){return $(e).find(".comments:eq(1)")};d.prototype.getItems=function(e){return e.children(".comment")};d.prototype.name=function(){return"Endless Scroll on Discussion comments"};return d})(a.EndlessScroll);a.EndlessScrollDiscussionReplies=b})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(d){__extends(c,d);function c(){d.apply(this,arguments);this.style=""}c.prototype.shouldRun=function(){return SGPP.location.pageKind=="giveaway"&&SGPP.location.subpage==""};c.prototype.init=function(){};c.prototype.render=function(){if(true){var e=$(".comment--submit").first();var f=$('<div id="esc_reply_header" class="page__heading"><div class="page__heading__breadcrumbs">Reply</div></div>');$(".comments").prev().before(f);$("#esc_reply_header").after(e);$(".js__comment-reply-cancel").on("click",function(){setTimeout(function(){e.insertAfter("#esc_reply_header")},10)})}this.preparePage()};c.prototype.createPageContainerElement=function(){return $('<div class="comments">')};c.prototype.getItemsElement=function(e){return $(e).find(".comments").first()};c.prototype.getItems=function(e){return e.children(".comment")};c.prototype.name=function(){return"Endless Scroll on Giveaway comments"};return c})(b.EndlessScroll);b.EndlessScrollGiveawayComments=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(b){var a=(function(d){__extends(c,d);function c(){d.apply(this,arguments);this._location="frontpage";this.style=""}c.prototype.shouldRun=function(){if(SGPP.location.pageKind=="giveaways"){return !(SGPP.location.subpage=="entered"||SGPP.location.subpage=="created"||SGPP.location.subpage=="won")}else{if(/^\/user\/[^\/]+(\/giveaways\/won([^\/]+)?)?$/.test(location.pathname)){this._location="profile";return true}}return false};c.prototype.init=function(){};c.prototype.render=function(){this.preparePage();$(this).on("afterAddItems",function(g,f,h,e){f.find(".giveaway__hide").click(function(){$(".popup--hide-games input[name=game_id]").val($(this).attr("data-game-id"));$(".popup--hide-games .popup__heading__bold").text($(this).closest("h2").find(".giveaway__heading__name").text())});f.find(".trigger-popup").click(function(){$("."+$(this).attr("data-popup")).bPopup({opacity:0.85,fadeSpeed:200,followSpeed:500,modalColor:"#3c424d"})})})};c.prototype.createPageContainerElement=function(){return $("<div>")};c.prototype.getItemsElement=function(e){return $(e).find(".pagination").prev()};c.prototype.getItems=function(e){return e.children(".giveaway__row-outer-wrap")};c.prototype.name=function(){return"Endless Scroll on Giveaways"};return c})(b.EndlessScroll);b.EndlessScrollGiveaways=a})(ModuleDefinition||(ModuleDefinition={}));var ModuleDefinition;(function(a){var b=(function(c){__extends(d,c);function d(){c.apply(this,arguments);this.style=""}d.prototype.shouldRun=function(){if(SGPP.location.pageKind=="giveaways"){return SGPP.location.subpage=="entered"||SGPP.location.subpage=="created"||SGPP.location.subpage=="won"}else{if(SGPP.location.pageKind=="bundle-games"){return true}else{if(SGPP.location.pageKind=="giveaway"){return SGPP.location.subpage=="entries"||SGPP.location.subpage=="winners"||SGPP.location.subpage=="groups"}else{if(SGPP.location.pageKind=="account"){return SGPP.location.subpage=="manage"||SGPP.location.subpage=="feedback"||SGPP.location.subpage=="steam"}}}}console.log(SGPP.location);return false};d.prototype.init=function(){};d.prototype.render=function(){this.preparePage()};d.prototype.createPageContainerElement=function(){return $('<div class="table__rows">')};d.prototype.getItemsElement=function(e){return $(e).find(".table__rows").first()};d.prototype.getItems=function(e){return e.children(".table__row-outer-wrap")};d.prototype.afterAddItems=function(e){$(e).find(".table__remove-default").click(function(){var f=$(this);f.addClass("is-hidden");f.siblings(".table__remove-loading").removeClass("is-hidden");$.ajax({url:"/ajax.php",type:"POST",dataType:"json",data:f.closest("form").serialize(),success:function(g){f.siblings(".table__remove-loading").addClass("is-hidden");f.siblings(".table__remove-complete").removeClass("is-hidden");f.closest(".table__row-inner-wrap").addClass("is-faded");if(typeof g.points!=="undefined"&&g.points!==false){$(".nav__points").text(g.points)}}})})};d.prototype.name=function(){return"Endless Scroll everywhere else"};return d})(a.EndlessScroll);a.EndlessScrollLists=b})(ModuleDefinition||(ModuleDefinition={}));var SGPP=new ModuleDefinition.Core();var modulesNames=new Array("CommentAndEnter","EntryCommenters","FixedNavbar","FixedFooter","GridView","ScrollingSidebar","UserHoverInfo","MarkComments","MessagesFilterTest","EndlessScrollDiscussion","EndlessScrollDiscussionReplies","EndlessScrollGiveaways","EndlessScrollGiveawayComments","EndlessScrollLists");var defaultModules=new Array("FixedNavbar","ScrollingSidebar");(function(c){for(var d in defaultModules){if(!SGPP.storage.containsItem(defaultModules[d])){SGPP.storage.setItem(defaultModules[d],"1")}}for(var d in modulesNames){var a=new ModuleDefinition[modulesNames[d]]();if(SGPP.settings.isModuleEnabled(modulesNames[d])&&a.shouldRun(SGPP.location)){SGPP.modules[modulesNames[d]]=a}}for(var b in SGPP.modules){SGPP.log("Module "+SGPP.modules[b].name()+" append css.");SGPP.appendCSS(SGPP.modules[b].style);SGPP.log("Module "+SGPP.modules[b].name()+" init() call.");SGPP.modules[b].init()}c(document).on("DOMContentLoaded",function(){SGPP.render();for(var e in SGPP.modules){SGPP.log("Module "+e+" render() call.");SGPP.modules[e].render()}})})(jQuery);