code reformat
This commit is contained in:
parent
6ee0d1a7a5
commit
9dcc74c22f
20
sortt.js
20
sortt.js
@ -6,22 +6,18 @@
|
|||||||
Credits to Stuart Langridge, http://www.kryogenix.org/code/browser/sortt/ and its contributors
|
Credits to Stuart Langridge, http://www.kryogenix.org/code/browser/sortt/ and its contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//safe url sort param global
|
||||||
|
window.sortt_url=window.location.search;
|
||||||
|
if (window.sortt_url.indexOf("sort=") < 0) {
|
||||||
|
|
||||||
//safe url sort param global
|
|
||||||
window.sortt_url=window.location.search;
|
|
||||||
if (window.sortt_url.indexOf("sort=") < 0) {
|
|
||||||
//no sort url argument found
|
//no sort url argument found
|
||||||
window.sortt_url="";
|
window.sortt_url="";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
window.sortt_url=window.sortt_url.substr(window.sortt_url.indexOf("sort=")+5);
|
window.sortt_url=window.sortt_url.substr(window.sortt_url.indexOf("sort=")+5);
|
||||||
window.sortt_url=window.sortt_url.substr(0,window.sortt_url.indexOf("&"));
|
window.sortt_url=window.sortt_url.substr(0,window.sortt_url.indexOf("&"));
|
||||||
}
|
}
|
||||||
//creat global function with main routine
|
//creat global function with main routine
|
||||||
window.sortt_f=function(sort_atr){
|
window.sortt_f=function(sort_atr){
|
||||||
//sortTable [sort attribute]
|
//sortTable [sort attribute]
|
||||||
|
|
||||||
if (sort_atr.length = 0) return;
|
if (sort_atr.length = 0) return;
|
||||||
@ -43,4 +39,4 @@
|
|||||||
// look at ReadMe
|
// look at ReadMe
|
||||||
console.log("sortTable() normsort:\"" + normsort + "\" revsort:\"" + revsort + "\" sortdefault:\"" + sortdefault + "\"");
|
console.log("sortTable() normsort:\"" + normsort + "\" revsort:\"" + revsort + "\" sortdefault:\"" + sortdefault + "\"");
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user