Advertisement
web-fx

deferment-1.0.0.js

Jan 14th, 2021 (edited)
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. /* deferment.js - PUBLIC DOMAIN RELEASE - VERSION 1.0.0 - https://pastebin.com/5NfBvjMN */
  2. var Deferment = new function () {
  3.  
  4.  
  5.  
  6.  
  7. var FoundFalse = false;
  8.  
  9.  
  10.  
  11.  
  12. this.WasDeferred = function ( ) { return FoundFalse; }
  13.  
  14.  
  15.  
  16.  
  17. this.Initialize = function ( ) {
  18.  
  19.  
  20. var CookieErrorText = "This website requires cookies to be enabled.";
  21.  
  22. if ( Private.CookieWorks ( CookieErrorText ) == false) { FoundFalse = true; }
  23.  
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
  30. var Private = {
  31.  
  32.  
  33.  
  34.  
  35. CookieWorks: function ( ErrorMsgIn ) {
  36.  
  37.  
  38. var Output = true;
  39.  
  40. var CookieTest = "Cookie Test";
  41.  
  42. var TestVal = "0123456789";
  43.  
  44. Cookies.SetCookie ( CookieTest, TestVal, 365 );
  45.  
  46. var CookieValue = Cookies.GetCookie ( CookieTest, '' );
  47.  
  48. if ( CookieValue != TestVal ) {
  49.  
  50. document.write( "<div class='deferment'><div><div><span class='deferment-message'></span></div></div></div><style>body {overflow: hidden;} .deferment .deferment-message:after {content:'" + ErrorMsgIn + "';}</style>" );
  51.  
  52. Output = false;
  53.  
  54. }
  55.  
  56.  
  57.  
  58.  
  59. return Output;
  60.  
  61.  
  62. }
  63.  
  64.  
  65.  
  66.  
  67. };
  68.  
  69.  
  70.  
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement