No need to include two different and super-small javascript "utils" files.master
parent
f3b2c2ea7a
commit
bf5f8cb713
@ -1,41 +0,0 @@ |
||||
|
||||
//
|
||||
// REMEMBER TO UPDATE VERSION WHEN CHANGING THIS SCRIPT, IN ORDER FOR BROWSERS TO REFRESH IT.
|
||||
//
|
||||
|
||||
var entityMap = { |
||||
"&": "&", |
||||
"<": "<", |
||||
">": ">", |
||||
'"': '"', |
||||
"'": ''', |
||||
"/": '/' |
||||
}; |
||||
|
||||
function escapeHtml(string) { |
||||
return String(string).replace(/[&<>"'\/]/g, function (s) { |
||||
return entityMap[s]; |
||||
}); |
||||
} |
||||
|
||||
function noop() { |
||||
} |
||||
|
||||
function popup(mylink, windowname) { |
||||
return popupSize(mylink, windowname, 400, 200); |
||||
} |
||||
|
||||
function popupSize(mylink, windowname, width, height) { |
||||
var href; |
||||
if (typeof(mylink) == "string") { |
||||
href = mylink; |
||||
} else { |
||||
href = mylink.href; |
||||
} |
||||
|
||||
var w = window.open(href, windowname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes"); |
||||
w.focus(); |
||||
w.moveTo(300, 200); |
||||
return false; |
||||
} |
||||
|
@ -1,10 +1,42 @@ |
||||
var entityMap = { |
||||
"&": "&", |
||||
"<": "<", |
||||
">": ">", |
||||
'"': '"', |
||||
"'": ''', |
||||
"/": '/' |
||||
}; |
||||
|
||||
function escapeHtml(string) { |
||||
return String(string).replace(/[&<>"'\/]/g, function (s) { |
||||
return entityMap[s]; |
||||
}); |
||||
} |
||||
|
||||
function popup(mylink, windowname) { |
||||
return popupSize(mylink, windowname, 400, 200); |
||||
} |
||||
|
||||
function popupSize(mylink, windowname, width, height) { |
||||
var href; |
||||
if (typeof(mylink) == "string") { |
||||
href = mylink; |
||||
} else { |
||||
href = mylink.href; |
||||
} |
||||
|
||||
var w = window.open(href, windowname, "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes"); |
||||
w.focus(); |
||||
w.moveTo(300, 200); |
||||
return false; |
||||
} |
||||
|
||||
function updateQueryStringParameter(uri, key, value) { |
||||
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); |
||||
var separator = uri.indexOf('?') !== -1 ? "&" : "?"; |
||||
if (uri.match(re)) { |
||||
return uri.replace(re, '$1' + key + "=" + value + '$2'); |
||||
} |
||||
else { |
||||
} else { |
||||
var separator = uri.indexOf('?') !== -1 ? "&" : "?"; |
||||
return uri + separator + key + "=" + value; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue