mirror of
https://gitlab.com/depesz/explain.depesz.com.git
synced 2024-11-28 08:58:52 +02:00
+ jquery based plugin for cookies
+ fix: getting current route name + layout changes
This commit is contained in:
parent
1ecd0f9518
commit
e39e64ecfd
@ -267,7 +267,7 @@ label {padding-bottom:0.35em}
|
||||
|
||||
.fe_is_public {position:relative}
|
||||
.fe_is_public input {position:absolute;top:12px;left:5px;width:auto}
|
||||
.fe_is_public label {width:auto;margin-left:30px}
|
||||
.fe_is_public label {width:auto;margin-left:30px;padding-bottom:0}
|
||||
|
||||
*:first-child+html .fe_is_public input {border:0}
|
||||
|
||||
|
10
public/js/jquery.cookie.min.js
vendored
Normal file
10
public/js/jquery.cookie.min.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=$.extend({},options);options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};
|
@ -31,7 +31,7 @@
|
||||
<ul class="clearfix date date-<%= $plan->{ date } =%>">
|
||||
% $open = 1;
|
||||
% }
|
||||
<li><a href="<%= url_for( 'show', plan_id => $plan->{ id } ) =%>"><%= $plan->{ id } =%></a></li>
|
||||
<li><a href="<%= url_for( 'show', id => $plan->{ id } ) =%>"><%= $plan->{ id } =%></a></li>
|
||||
% $date = $plan->{ date };
|
||||
% }
|
||||
|
||||
|
@ -24,6 +24,9 @@
|
||||
<![endif]-->
|
||||
|
||||
<script src="<%= url_for '/' %>js/jquery-1.5.1.min.js"></script>
|
||||
|
||||
<script src="<%= url_for '/' %>js/jquery.cookie.min.js"></script>
|
||||
|
||||
<script src="<%= url_for '/' %>js/explain.js"></script>
|
||||
|
||||
<%= content_for 'head' %>
|
||||
|
Loading…
Reference in New Issue
Block a user