Lines 1-10
Link Here
|
1 |
/* global dataTablesDefaults allColumns */ |
1 |
/* global dataTablesDefaults allColumns Cookies */ |
2 |
// Set expiration date for cookies |
2 |
// Set expiration date for cookies |
3 |
var date = new Date(); |
3 |
var date = new Date(); |
4 |
date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000)); |
4 |
date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000)); |
5 |
|
5 |
|
6 |
function hideColumns() { |
6 |
function hideColumns() { |
7 |
var valCookie = $.cookie("showColumns"); |
7 |
var valCookie = Cookies.get("showColumns"); |
8 |
if (valCookie) { |
8 |
if (valCookie) { |
9 |
valCookie = valCookie.split("/"); |
9 |
valCookie = valCookie.split("/"); |
10 |
$("#showall").prop("checked", false).parent().removeClass("selected"); |
10 |
$("#showall").prop("checked", false).parent().removeClass("selected"); |
Lines 20-26
function hideColumns() {
Link Here
|
20 |
|
20 |
|
21 |
function hideColumn(num) { |
21 |
function hideColumn(num) { |
22 |
$("#hideall,#showall").prop("checked", false).parent().removeClass("selected"); |
22 |
$("#hideall,#showall").prop("checked", false).parent().removeClass("selected"); |
23 |
var valCookie = $.cookie("showColumns"); |
23 |
var valCookie = Cookies.get("showColumns"); |
24 |
// set the index of the table column to hide |
24 |
// set the index of the table column to hide |
25 |
$("#" + num).parent().removeClass("selected"); |
25 |
$("#" + num).parent().removeClass("selected"); |
26 |
var hide = Number(num.replace("checkheader", "")) + 3; |
26 |
var hide = Number(num.replace("checkheader", "")) + 3; |
Lines 39-48
function hideColumn(num) {
Link Here
|
39 |
if (!found) { |
39 |
if (!found) { |
40 |
valCookie.push(hide); |
40 |
valCookie.push(hide); |
41 |
var cookieString = valCookie.join("/"); |
41 |
var cookieString = valCookie.join("/"); |
42 |
$.cookie("showColumns", cookieString, { expires: date, path: '/' }); |
42 |
Cookies.set("showColumns", cookieString, { expires: date, path: '/' }); |
43 |
} |
43 |
} |
44 |
} else { |
44 |
} else { |
45 |
$.cookie("showColumns", hide, { expires: date, path: '/' }); |
45 |
Cookies.set("showColumns", hide, { expires: date, path: '/' }); |
46 |
} |
46 |
} |
47 |
} |
47 |
} |
48 |
|
48 |
|
Lines 57-63
Array.prototype.remove = function (from, to) {
Link Here
|
57 |
function showColumn(num) { |
57 |
function showColumn(num) { |
58 |
$("#hideall").prop("checked", false).parent().removeClass("selected"); |
58 |
$("#hideall").prop("checked", false).parent().removeClass("selected"); |
59 |
$("#" + num).parent().addClass("selected"); |
59 |
$("#" + num).parent().addClass("selected"); |
60 |
var valCookie = $.cookie("showColumns"); |
60 |
var valCookie = Cookies.get("showColumns"); |
61 |
// set the index of the table column to hide |
61 |
// set the index of the table column to hide |
62 |
var show = Number(num.replace("checkheader", "")) + 3; |
62 |
var show = Number(num.replace("checkheader", "")) + 3; |
63 |
// hide header and cells matching the index |
63 |
// hide header and cells matching the index |
Lines 74-80
function showColumn(num) {
Link Here
|
74 |
} |
74 |
} |
75 |
if (found) { |
75 |
if (found) { |
76 |
var cookieString = valCookie.join("/"); |
76 |
var cookieString = valCookie.join("/"); |
77 |
$.cookie("showColumns", cookieString, { expires: date, path: '/' }); |
77 |
Cookies.set("showColumns", cookieString, { expires: date, path: '/' }); |
78 |
} |
78 |
} |
79 |
} |
79 |
} |
80 |
} |
80 |
} |
Lines 97-103
function hideAllColumns() {
Link Here
|
97 |
$("#itemst td:nth-child(3),#itemst th:nth-child(3)").nextAll().hide(); |
97 |
$("#itemst td:nth-child(3),#itemst th:nth-child(3)").nextAll().hide(); |
98 |
$("#hideall").prop("checked", true).parent().addClass("selected"); |
98 |
$("#hideall").prop("checked", true).parent().addClass("selected"); |
99 |
var cookieString = allColumns.join("/"); |
99 |
var cookieString = allColumns.join("/"); |
100 |
$.cookie("showColumns", cookieString, { expires: date, path: '/' }); |
100 |
Cookies.set("showColumns", cookieString, { expires: date, path: '/' }); |
101 |
} |
101 |
} |
102 |
|
102 |
|
103 |
$(document).ready(function () { |
103 |
$(document).ready(function () { |
104 |
- |
|
|