forked from bomba5884/Permisson-Bar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpermissionbar-latest.min.js
8 lines (8 loc) · 3.01 KB
/
permissionbar-latest.min.js
1
2
3
4
5
6
7
8
/*
Plugin Name: Permission Bar
Plugin URL: http://permissionbar.com/
Author: Milosz Falinski, Callum Hopkins & StudioNEC.
Description: Permission Bar is a free & simple solution to the EU cookie law.
Version: 1.5
*/
var jQload=false;function initPermBar(){if(typeof(jQuery)=="undefined"){if(!jQload){jQload=true;document.write(unescape('%3Cscript type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"%3E%3C/script%3E'))}setTimeout("initPermBar()",50)}else{(function(c){var g=function g(j,k){if(k=="js"){var l=document.createElement("script");l.setAttribute("type","text/javascript");l.setAttribute("src",j)}else{if(k=="css"){var l=document.createElement("link");l.setAttribute("rel","stylesheet");l.setAttribute("type","text/css");l.setAttribute("href",j)}}if(typeof l!="undefined"){document.getElementsByTagName("head")[0].appendChild(l)}};var e=function h(){g("permissionbar.css","css");c("body").append('<div id="permission-bar-prompt" style="display:none"> <div id="permission-bar-prompt-content" > <a id="permission-bar-prompt-logo" href="http://permissionbar.com"><span>permission bar</span></a><a id="permission-bar-prompt-close" href="#"><span>close</span></a><div class="clear"></div><p>This website makes use of cookies to enhance browsing experience and provide additional functionality.<br><br>By clicking <span>Allow cookies</span> you give permission for this website to store small bits of data on your computer. None of this data can or will be used to identify or contact you. You will only have to enable cookies once per domain.<br><br> To learn more about cookies and this plugin, visit <a href="http://permissionbar.com">Permission Bar</a> website.</p></div></div><div id="permission-bar" style="display:none"> <p>Your experience on this site will be improved by allowing cookies - <a id="permission-bar-prompt-button" href="#prompt">see details</a> </p><a id="permission-bar-button" href="#">Allow cookies</a></div>')};var f=function f(k){var l,j,n,m=document.cookie.split(";");for(l=0;l<m.length;l++){j=m[l].substr(0,m[l].indexOf("="));n=m[l].substr(m[l].indexOf("=")+1);j=j.replace(/^\s+|\s+$/g,"");if(j==k){return unescape(n)}}};var i=function i(j,m,k){var n=new Date();n.setDate(n.getDate()+k);var l=escape(m)+((k==null)?"":"; expires="+n.toUTCString());document.cookie=j+"="+l};var a=function a(){var k=f("permissionbar");if(k!=null&&k!=""){}else{c("#permission-bar").fadeToggle("slow");var j=c("#permission-bar-button");j.on("click",function(l){i("permissionbar","CookiesAllowed",365);c("#permission-bar").fadeToggle("slow")})}};var b=function b(){var m=c("#permission-bar-button");var l=c("#permission-bar-prompt-button");var n=c("#permission-bar-prompt-close");var j=c("#permission-bar-prompt");var k=c("#permission-bar-prompt-content");l.on("click",function(o){j.fadeToggle("slow")});n.on("click",function(o){j.fadeToggle("slow")});k.css({top:c(window).height()/2-225,left:(c(window).width()/2)-225})};var d=function d(){e();b();a()};c(document).ready(function(){d()})})(jQuery)}}initPermBar();