web-fx

index-2.0.0.html

Jan 11th, 2021 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. <!-- PUBLIC DOMAIN RELEASE - VERSION 2.0.0 - https://pastebin.com/aAUa8140 -->
  2. <!doctype html>
  3. <html>
  4. <head>
  5.  
  6. <title>Deferment Project</title>
  7.  
  8. <meta name="description" content="...">
  9.  
  10. <meta name="keywords" content="...">
  11.  
  12. <meta charset="utf-8">
  13.  
  14. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  15.  
  16. <link rel="icon" href="/favicon.ico">
  17.  
  18. <link rel="stylesheet" href="/style/library/deferment/deferment.min.css">
  19.  
  20. <script src="/script/anchor.min.js"></script>
  21.  
  22. <script> var Deferred = Deferment.WasDeferred ( ); </script>
  23.  
  24. </head>
  25. <body>
  26.  
  27.  
  28. <noscript><div class="deferment"><div><div><span class="deferment-message"></span></div></div></div></noscript>
  29.  
  30.  
  31. <div class="curtain"></div>
  32.  
  33.  
  34. <script> if ( Deferred == false ) { Layout.Top ( ); } </script>
  35.  
  36.  
  37.  
  38.  
  39. <h1>Deferment Project</h1>
  40.  
  41. <script>
  42.  
  43.  
  44. if ( Deferred == false ) {
  45.  
  46. var Output = '';
  47.  
  48. Output += '<h2>Cookie examples</h2>';
  49. Output += '<p>NOTE: Refresh the page to see that the cookies were also updated.</p>';
  50. Output += '<h3>String example</h3>';
  51. Output += '<p><span style="color:green">Current value: \'</span><span id="string-value">' + G_CookieString[G_C_ExampleString][G_CI_Value] + '</span><span style="color:green">\'</span></p>';
  52. Output += '<p><input type="text" id="StringExample"> <input type="submit" value="Update" onclick=" ButtonWork ( \'String\' );"></p>';
  53. Output += '<h3>Boolean example</h3>';
  54. Output += '<p><span style="color:green">Current value:</span> <span id="boolean-value">' + G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value] + '</span></p>';
  55. var IsChecked = null;
  56. if ( G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value] == true ) { IsChecked = ' checked'; } else { IsChecked = false; }
  57. Output += '<input type="radio" name="BooleanExample" id="true"' + IsChecked + '><label for="true">True</label>';
  58. if ( G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value] == false ) { IsChecked = ' checked'; } else { IsChecked = false; }
  59. Output += '<input type="radio" name="BooleanExample" id="false"' + IsChecked + '><label for="false">False</label>';
  60. Output += ' <input type="submit" value="Update" onclick=" ButtonWork ( \'Boolean\' );"></p>';
  61. Output += '<h3>Number example</h3>';
  62. Output += '<p><span style="color:green">Current value:</span> <span id="number-value">' + G_CookieNumber[G_C_ExampleNumber][G_CI_Value] + '</span></p>';
  63. Output += '<p><input type="text" id="NumberExample"> <input type="submit" value="Update" onclick=" ButtonWork ( \'Number\' );"></p>';
  64.  
  65. document.write ( Output );
  66.  
  67. }
  68.  
  69.  
  70.  
  71.  
  72. function ButtonWork ( TypeUpdateIn ) {
  73.  
  74.  
  75. if ( TypeUpdateIn == 'String' ) {
  76.  
  77. var NewValue = document.getElementById ( 'StringExample' ).value;
  78.  
  79. if ( NewValue != G_CookieString[G_C_ExampleString][G_CI_Value] ) {
  80.  
  81. G_CookieString[G_C_ExampleString][G_CI_Value] = NewValue;
  82. // Cookies.SetCookie( Name, Value, DaysExpires );
  83. Cookies.SetCookie( G_CookieString[G_C_ExampleString][G_CI_Name], G_CookieString[G_C_ExampleString][G_CI_Value], 365 );
  84. document.getElementById ( 'string-value' ).innerHTML = G_CookieString[G_C_ExampleString][G_CI_Value];
  85.  
  86. }
  87.  
  88. } else if ( TypeUpdateIn == 'Boolean' ) {
  89.  
  90. var NewValue = null;
  91. if ( document.getElementById ( 'true' ).checked == true ) { NewValue = true; }
  92. else { NewValue = false; }
  93.  
  94. if ( NewValue != G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value] ) {
  95.  
  96. G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value] = NewValue;
  97. // Cookies.SetCookie( Name, Value, DaysExpires );
  98. Cookies.SetCookie( G_CookieBoolean[G_C_ExampleBoolean][G_CI_Name], G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value], 365 );
  99. document.getElementById ( 'boolean-value' ).innerHTML = G_CookieBoolean[G_C_ExampleBoolean][G_CI_Value];
  100.  
  101. }
  102.  
  103. } else if ( TypeUpdateIn == 'Number' ) {
  104.  
  105. var NewValue = null;
  106. var CheckNumber = Number ( document.getElementById ( 'NumberExample' ).value );
  107. var Pattern = /^-?\d+\.?\d*$/
  108. if ( Pattern.test ( CheckNumber ) == true && CheckNumber.toString ( ) == document.getElementById ( 'NumberExample' ).value ) { NewValue = CheckNumber; }
  109.  
  110. if ( NewValue != null && NewValue != G_CookieNumber[G_C_ExampleNumber][G_CI_Value] ) {
  111.  
  112. G_CookieNumber[G_C_ExampleNumber][G_CI_Value] = NewValue;
  113. // Cookies.SetCookie( Name, Value, DaysExpires );
  114. Cookies.SetCookie( G_CookieNumber[G_C_ExampleNumber][G_CI_Name], G_CookieNumber[G_C_ExampleNumber][G_CI_Value], 365 );
  115. document.getElementById ( 'number-value' ).innerHTML = G_CookieNumber[G_C_ExampleNumber][G_CI_Value];
  116.  
  117. }
  118.  
  119. }
  120.  
  121.  
  122. }
  123.  
  124.  
  125. </script>
  126.  
  127.  
  128.  
  129.  
  130. <script> if ( Deferred == false ) { Layout.Bottom ( ); } </script>
  131.  
  132.  
  133. </body>
  134. </html>
Add Comment
Please, Sign In to add comment