2019-08-27 12:17:23 +00:00
|
|
|
/*
|
|
|
|
Sortt
|
|
|
|
|
|
|
|
@License MIT
|
|
|
|
@Author 6543
|
2019-08-27 12:27:57 +00:00
|
|
|
Credits to Stuart Langridge, http://www.kryogenix.org/code/browser/sortt/ and its contributors
|
2019-08-27 12:17:23 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-27 14:17:53 +00:00
|
|
|
//safe url sort param global
|
|
|
|
window.sortt_url=window.location.search;
|
|
|
|
if (window.sortt_url.indexOf("sort=") < 0) {
|
|
|
|
//no sort url argument found
|
|
|
|
window.sortt_url="";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
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("&"));
|
|
|
|
}
|
|
|
|
//creat global function with main routine
|
2019-08-27 14:35:45 +00:00
|
|
|
window.sortt=function(normsort,revsort,isdefault){
|
|
|
|
//sortTable [normsort] (revsort) (isdefault)
|
2019-08-27 14:17:53 +00:00
|
|
|
|
2019-08-27 14:35:45 +00:00
|
|
|
//normsort is needet
|
|
|
|
if (typeof normsort === 'undefined') return false;
|
2019-08-27 14:17:53 +00:00
|
|
|
|
2019-08-27 14:35:45 +00:00
|
|
|
//default values of optinal parameters
|
|
|
|
if (typeof revsort === 'undefined') revsort = "";
|
|
|
|
if (typeof isdefault === 'undefined') isdefault = false;
|
2019-08-27 14:17:53 +00:00
|
|
|
|
|
|
|
// look at ReadMe
|
|
|
|
console.log("sortTable() normsort:\"" + normsort + "\" revsort:\"" + revsort + "\" sortdefault:\"" + sortdefault + "\"");
|
|
|
|
|
|
|
|
};
|