Benutzer-Werkzeuge

Webseiten-Werkzeuge


design:snippets

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
design:snippets [19.09.2015 17:39] – [Verschiedenes] Manuela v.d.Deckendesign:snippets [21.09.2015 12:13] (aktuell) Manuela v.d.Decken
Zeile 26: Zeile 26:
 Da hier ein JScript aufgerufen wird, sollte man das natürlich auch noch in den /js/ Ordner des Templates packen. Da hier ein JScript aufgerufen wird, sollte man das natürlich auch noch in den /js/ Ordner des Templates packen.
 <file java CookieNotice.min.js> <file java CookieNotice.min.js>
-/** CookieNotice.js+/** CookieNotice.min.js
  copyright: Manuela v.d.Decken <manuela@isteam.de>  copyright: Manuela v.d.Decken <manuela@isteam.de>
  author:    Manuela v.d.Decken <manuela@isteam.de>  author:    Manuela v.d.Decken <manuela@isteam.de>
  license:   http://www.gnu.org/licenses/gpl.html   GPL License  license:   http://www.gnu.org/licenses/gpl.html   GPL License
- version:   0.0.1 */function CookieNotice(e){var o=7,t=this;this.Box=document.getElementById(e),this.hideNotice=function(e){e=e||window.event;var i=e.target||e.srcElement;"CookieNoticeClose"==i.id&&(t.Box.style.display="none",t.setCookie("CookieNoticeVisible","none",o),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},this.setCookie=function(e,o,t){var i=new Date;i.setTime(i.getTime()+864e5*t);var n="expires="+i.toGMTString();document.cookie=e+"="+o+"; "+n},this.getCookie=function(e){for(var o=e+"=",t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1);if(0===n.indexOf(o))return n.substring(o.length,n.length)}return""},this.start=function(){var e=t.getCookie("CookieNoticeVisible");"none"!=e&&(t.Box.style.display="block")},this.Box.onclick=t.hideNotice,this.start()}new CookieNotice("CookieNotice");+ version:   0.0.1 */function CookieNotice(e){var o=7,t=this;this.Box=document.getElementById(e),this.hideNotice=function(e){e=e||window.event;var i=e.target||e.srcElement;"CookieNoticeClose"==i.id&&(t.Box.style.display="none",t.setCookie("CookieNoticeVisible","none",o),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},this.setCookie=function(e,o,t){var i=new Date;i.setTime(i.getTime()+864e5*t);var n="expires="+i.toGMTString();document.cookie=e+"="+o+";path=/; "+n},this.getCookie=function(e){for(var o=e+"=",t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1);if(0===n.indexOf(o))return n.substring(o.length,n.length)}return""},this.start=function(){var e=t.getCookie("CookieNoticeVisible");"none"!=e&&(t.Box.style.display="block")},this.Box.onclick=t.hideNotice,this.start()}new CookieNotice("CookieNotice");
 </file> </file>
 Gut, das ist jetzt natürlich hervorragend lesbar. Deshalb hier der Code noch einmal, jedoch in Klartext: Gut, das ist jetzt natürlich hervorragend lesbar. Deshalb hier der Code noch einmal, jedoch in Klartext:
Zeile 52: Zeile 52:
 /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  *  *
- * CookieNotice+ * CookieNotice.js
  *  *
  * @category     Template  * @category     Template
Zeile 89: Zeile 89:
             d.setTime(d.getTime() + (exdays*86400000));             d.setTime(d.getTime() + (exdays*86400000));
             var expires = "expires=" + d.toGMTString();             var expires = "expires=" + d.toGMTString();
-            document.cookie = cname+"="+cvalue+"; "+expires;+            document.cookie = cname+"="+cvalue+"; path=/; "+expires;
         };         };
  
Zeile 121: Zeile 121:
 Jetzt fehlt nur noch die Optik. Dazu wird die nachfolgende CSS-Datei einfach als letztes CSS im **<head>** eingebunden. Jetzt fehlt nur noch die Optik. Dazu wird die nachfolgende CSS-Datei einfach als letztes CSS im **<head>** eingebunden.
 <file css CookieNotice.css> <file css CookieNotice.css>
-/* +/** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
-    Document   : CookieNotice + 
-    Created on : 04.07.2015, 14:39:54 + CookieNotice.css 
-    Author     : Manuela v.d.Decken <manuela@isteam.de> + 
-    Description+ * @category     Template 
-        Purpose of the stylesheet follows+ * @copyright    Manuela v.d.Decken <manuela@isteam.de> 
-*/+ * @author       Manuela v.d.Decken <manuela@isteam.de> 
 + * @license      http://www.gnu.org/licenses/gpl.html   GPL License 
 + * @version      0.0.1 
 + * @lastmodified 19.09.2015 
 + * @since        File available since 04.07.2015 
 + * @description  switch off the cookie notice for n days 
 +    (by default after 7 days the cookie will be removed again) 
 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Zeile 165: Zeile 172:
 </file> </file>
  
 +??? ..nächste Frage
 +!!! ..nächste Antwort
design/snippets.1442684371.txt.gz · Zuletzt geändert: 19.09.2015 17:39 von Manuela v.d.Decken