Redo design from scratch with something significantly simpler and lower maintainence.
This commit is contained in:
parent
a84bf8aab3
commit
3d00f28657
31 changed files with 228 additions and 1857 deletions
|
@ -6,7 +6,7 @@ function CreateCookie(name, value, days) {
|
|||
var expires;
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
expires = "; expires=" + date.toGMTString();
|
||||
}
|
||||
else {
|
||||
|
@ -57,89 +57,4 @@ Number.prototype.toString=function(input, shouldRound){
|
|||
return this.oldToString(input);
|
||||
|
||||
return round(this, input);
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var panels = $("nav > dl > .sub-pages");
|
||||
var goIndicators = $("nav > dl > dt .go");
|
||||
var expandIndicators = $("nav > dl > dt .expand");
|
||||
panels.hide();
|
||||
expandIndicators.show();
|
||||
|
||||
$("nav > dl > dt").click(function(e) {
|
||||
var next = $(this).next();
|
||||
if (!next.hasClass("sub-pages")) {
|
||||
Navigate($(this).children("a").attr("href"));
|
||||
return;
|
||||
}
|
||||
panels.slideUp();
|
||||
goIndicators.hide();
|
||||
expandIndicators.show();
|
||||
if (next.is(":visible")) {
|
||||
return;
|
||||
}
|
||||
next.slideDown();
|
||||
$(this).children(".go").show();
|
||||
$(this).children(".expand").hide();
|
||||
});
|
||||
|
||||
$("nav dd").click(function(e) {
|
||||
Navigate($(this).children("a").attr("href"));
|
||||
});
|
||||
|
||||
$("nav a").click(function(e) {
|
||||
$(this).parent().click();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#body").css("padding-bottom", window.innerHeight - $("#buttons-right").offset().top);
|
||||
|
||||
$("form[ajaxForm]").submit(function(e) {
|
||||
e.preventDefault();
|
||||
form = $(this);
|
||||
$.ajax({
|
||||
url: form.attr("action"),
|
||||
method: form.attr("method"),
|
||||
data: form.serialize(),
|
||||
success: function(data) {
|
||||
var successFunction = form.attr("onsuccess");
|
||||
if (successFunction !== undefined && window[successFunction] !== undefined)
|
||||
window[successFunction](data);
|
||||
},
|
||||
error: function() {
|
||||
var errorFunction = form.attr("onerror");
|
||||
if (errorFunction !== undefined && window[errorFunction] !== undefined)
|
||||
window[errorFunction]();
|
||||
},
|
||||
});
|
||||
var postFunction = form.attr("onpost");
|
||||
if (postFunction !== undefined && window[postFunction] !== undefined)
|
||||
window[postFunction]();
|
||||
});
|
||||
|
||||
$("td").each(function() {
|
||||
var elem = $(this);
|
||||
if (/^[+-]?\d+(\.\d+)?$/.test(elem.text())) {
|
||||
elem.addClass("number");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).delegate('.allowTabInput', 'keydown', function(e) {
|
||||
var keyCode = e.keyCode || e.which;
|
||||
console.log(e);
|
||||
if (keyCode == 9) {
|
||||
e.preventDefault();
|
||||
var start = $(this).get(0).selectionStart;
|
||||
var end = $(this).get(0).selectionEnd;
|
||||
|
||||
// set textarea value to: text before caret + tab + text after caret
|
||||
$(this).val($(this).val().substring(0, start)
|
||||
+ "\t"
|
||||
+ $(this).val().substring(end));
|
||||
|
||||
// put caret at right position again
|
||||
$(this).get(0).selectionStart =
|
||||
$(this).get(0).selectionEnd = start + 1;
|
||||
}
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue