tracks/tracks/public/javascripts/toggle_notes.js
bsag c63833401d Made some changes to the 'navigation bar' of all of the pages. Moved the 'toggle notes' link, add users (admin only) and logout links up to the top right corner, as they don't really fit with the other navigation links. The toggle notes link is now collapsed to one link which toggles, rather than a separate 'show' and 'hide' link (fixes #274).
Experimentally, I've made the whole top navigation section fixed so that it stays in place as the page scrolls, and it's black and slightly transparent to give it a different feel. I'm not sure if I like it or not, but it does make the links handily available.

I've also made the layout a bit more fluid to use the available width better. It's not quite right yet, but it works much better with wide displays (fixing #193) and also with narrow displays (fixing #262).



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@245 a4c988fc-2ded-0310-b66e-134b36920a42
2006-05-15 18:22:43 +00:00

42 lines
1.2 KiB
JavaScript

function toggleAll(className) {
var elems = document.getElementsByClassName(className);
for (var i = 0; i < elems.length; i++) {
if (elems[i].style.display == 'block')
{
elems[i].style.display = 'none';
}
else
{
elems[i].style.display = 'block';
}
}
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
var bikky = document.cookie;
function getCookie(name) { // use: getCookie("name");
var index = bikky.indexOf(name + "=");
if (index == -1) return null;
index = bikky.indexOf("=", index) + 1; // first character
var endstr = bikky.indexOf(";", index);
if (endstr == -1) endstr = bikky.length; // last character
return unescape(bikky.substring(index, endstr));
}