Move source code to src directory
This commit is contained in:
parent
49782b0325
commit
c9649000ea
109 changed files with 5 additions and 4 deletions
67
src/Website/wwwroot/js/javascript.js
Normal file
67
src/Website/wwwroot/js/javascript.js
Normal file
|
@ -0,0 +1,67 @@
|
|||
function Navigate(url) {
|
||||
window.location = url;
|
||||
}
|
||||
|
||||
function CreateCookie(name, value, days) {
|
||||
var expires;
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
expires = "; expires=" + date.toGMTString();
|
||||
}
|
||||
else {
|
||||
expires = "";
|
||||
}
|
||||
document.cookie = name + "=" + value + expires + "; path=/";
|
||||
}
|
||||
|
||||
function round(value, decimals) {
|
||||
return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);
|
||||
}
|
||||
|
||||
function isNumber(value){
|
||||
return isFinite(String(value));
|
||||
}
|
||||
|
||||
String.prototype.upperCaseFirst = function() {
|
||||
var lower = this.toLowerCase();
|
||||
return lower.charAt(0).toUpperCase() + lower.slice(1);
|
||||
};
|
||||
|
||||
function twoDigitZeroPad(input){
|
||||
input=input.toString();
|
||||
return [!input[1] && '0' || "", input].join('');
|
||||
}
|
||||
|
||||
Date.prototype.oldToString = Date.prototype.toString;
|
||||
Date.prototype.toString = function(format) {
|
||||
if (!format)
|
||||
return this.oldToString();
|
||||
var me=this;
|
||||
return format.replace(/./g, function(match) {
|
||||
switch(match){
|
||||
case 'd': return twoDigitZeroPad(me.getDate());
|
||||
case 'm': return twoDigitZeroPad(me.getMonth()+1);
|
||||
case 'y': return me.getFullYear();
|
||||
case "H": return twoDigitZeroPad(me.getHours());
|
||||
case "i": return twoDigitZeroPad(me.getMinutes());
|
||||
case "s": return twoDigitZeroPad(me.getSeconds());
|
||||
default: return match;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Number.prototype.oldToString=Number.prototype.toString;
|
||||
Number.prototype.toString=function(input, shouldRound){
|
||||
if (!shouldRound)
|
||||
return this.oldToString(input);
|
||||
|
||||
return round(this, input);
|
||||
};
|
||||
|
||||
function documentReady(callback) {
|
||||
if (document.readyState === "complete" || document.readyState === "interactive")
|
||||
setTimeout(callback, 1);
|
||||
else
|
||||
document.addEventListener("DOMContentLoaded", callback);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue