Convert base scripts and styles to embedded resources and move to VAR.WebForms.Common.
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
////////////////////////
|
||||
// GetElement
|
||||
//
|
||||
function GetElement(element) {
|
||||
if (typeof element === "string") {
|
||||
element = document.getElementById(element);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// ElementAddClass
|
||||
//
|
||||
function ElementAddClass(element, classname) {
|
||||
element = GetElement(element);
|
||||
if (!element) { return; }
|
||||
var cn = element.className;
|
||||
if (cn.indexOf(classname) !== -1) {
|
||||
return;
|
||||
}
|
||||
if (cn !== '') {
|
||||
classname = ' ' + classname;
|
||||
}
|
||||
element.className = cn + classname;
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// ElementRemoveClass
|
||||
//
|
||||
function ElementRemoveClass(element, className) {
|
||||
element = GetElement(element);
|
||||
if (!element) { return; }
|
||||
var regex = new RegExp('(?:^|\\s)' + className + '(?!\\S)');
|
||||
if (regex.test(element.className)) {
|
||||
element.className = element.className.replace(regex, '');
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// ElementToggleClass
|
||||
//
|
||||
function ElementToggleClass(element, className) {
|
||||
element = GetElement(element);
|
||||
if (!element) { return; }
|
||||
var regex = new RegExp('(?:^|\\s)' + className + '(?!\\S)');
|
||||
if (regex.test(element.className)) {
|
||||
element.className = element.className.replace(regex, '');
|
||||
return true;
|
||||
} else {
|
||||
element.className = element.className + ' ' + className;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function escapeHTML(s) {
|
||||
return s.replace(/&/g, '&')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
|
||||
function fixedEncodeURIComponent(str) {
|
||||
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
||||
return '%' + c.charCodeAt(0).toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// localStorage polyfill
|
||||
//
|
||||
if (!window.localStorage) {
|
||||
window.localStorage = {
|
||||
getItem: function (sKey) {
|
||||
if (!sKey || !this.hasOwnProperty(sKey)) { return null; }
|
||||
return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
|
||||
},
|
||||
key: function (nKeyId) { return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[nKeyId]); },
|
||||
setItem: function (sKey, sValue) {
|
||||
if (!sKey) { return; }
|
||||
document.cookie = escape(sKey) + "=" + escape(sValue) + "; path=/";
|
||||
this.length = document.cookie.match(/\=/g).length;
|
||||
},
|
||||
length: 0,
|
||||
removeItem: function (sKey) {
|
||||
if (!sKey || !this.hasOwnProperty(sKey)) { return; }
|
||||
var sExpDate = new Date();
|
||||
sExpDate.setDate(sExpDate.getDate() - 1);
|
||||
document.cookie = escape(sKey) + "=; expires=" + sExpDate.toGMTString() + "; path=/";
|
||||
this.length--;
|
||||
},
|
||||
hasOwnProperty: function (sKey) { return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); }
|
||||
};
|
||||
window.localStorage.length = (document.cookie.match(/\=/g) || window.localStorage).length;
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
function SendRequest(url, data, onData, onError) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
if (data) {
|
||||
url += "?" + GetDataQueryString(data);
|
||||
}
|
||||
xhr.open("GET", url, true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
if (onData) {
|
||||
onData(xhr.responseText);
|
||||
}
|
||||
} else {
|
||||
if (onError) {
|
||||
onError();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
function GetDataQueryString(data) {
|
||||
var queryString = "";
|
||||
for (var property in data) {
|
||||
if (data.hasOwnProperty(property)) {
|
||||
var value = data[property];
|
||||
queryString += (queryString.length > 0 ? "&" : "")
|
||||
+ fixedEncodeURIComponent(property) + "="
|
||||
+ fixedEncodeURIComponent(String(value));
|
||||
}
|
||||
}
|
||||
return queryString;
|
||||
}
|
||||
|
||||
function SendData(url, data, onData, onError) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
if (onData) {
|
||||
onData(xhr.responseText);
|
||||
}
|
||||
} else {
|
||||
if (onError) {
|
||||
onError();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.setRequestHeader('Content-Type',
|
||||
'application/x-www-form-urlencoded');
|
||||
xhr.send(GetDataQueryString(data));
|
||||
}
|
||||
|
||||
function GetFormQueryString(idForm) {
|
||||
var form = document.getElementById(idForm);
|
||||
var queryString = "";
|
||||
if (!form)
|
||||
return null;
|
||||
|
||||
function appendVal(name, value) {
|
||||
queryString += (queryString.length > 0 ? "&" : "")
|
||||
+ fixedEncodeURIComponent(name) + "="
|
||||
+ fixedEncodeURIComponent(value ? value : "");
|
||||
}
|
||||
|
||||
var elements = form.elements;
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var element = elements[i];
|
||||
var elemType = element.type.toUpperCase();
|
||||
var elemName = element.name;
|
||||
|
||||
if (elemName) {
|
||||
if (
|
||||
elemType.indexOf("TEXT") !== -1 ||
|
||||
elemType.indexOf("TEXTAREA") !== -1 ||
|
||||
elemType.indexOf("PASSWORD") !== -1 ||
|
||||
elemType.indexOf("BUTTON") !== -1 ||
|
||||
elemType.indexOf("HIDDEN") !== -1 ||
|
||||
elemType.indexOf("SUBMIT") !== -1 ||
|
||||
elemType.indexOf("IMAGE") !== -1
|
||||
) {
|
||||
appendVal(elemName, element.value);
|
||||
} else if (elemType.indexOf("CHECKBOX") !== -1 && element.checked) {
|
||||
appendVal(elemName, element.value ? element.value : "On");
|
||||
} else if (elemType.indexOf("RADIO") !== -1 && element.checked) {
|
||||
appendVal(elemName, element.value);
|
||||
} else if (elemType.indexOf("SELECT") !== -1) {
|
||||
for (var j = 0; j < element.options.length; j++) {
|
||||
var option = element.options[j];
|
||||
if (option.selected) {
|
||||
appendVal(elemName,
|
||||
option.value ? option.value : option.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return queryString;
|
||||
}
|
||||
|
||||
function SendForm(url, idForm, onData, onError) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
if (onData) {
|
||||
onData(xhr.responseText);
|
||||
}
|
||||
} else {
|
||||
if (onError) {
|
||||
onError();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.setRequestHeader('Content-Type',
|
||||
'application/x-www-form-urlencoded');
|
||||
xhr.send(GetFormQueryString(idForm));
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multilin_SetText
|
||||
//
|
||||
var CTextBox_SetText = function (id, text) {
|
||||
var element = document.getElementById(id);
|
||||
element.value = text;
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multiline_KeyDown
|
||||
//
|
||||
var CTextBox_Multiline_KeyDown = function (e) {
|
||||
if (e.keyCode === 9 || e.which === 9) {
|
||||
e.preventDefault();
|
||||
var s = this.selectionStart;
|
||||
this.value = this.value.substring(0, this.selectionStart) + "\t" + this.value.substring(this.selectionEnd);
|
||||
this.selectionEnd = s + 1;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multiline_SaveSizeData
|
||||
//
|
||||
var CTextBox_Multiline_SaveSizeData = function (textArea) {
|
||||
var hidSizeData = document.getElementById(textArea.cfg.hidSize);
|
||||
hidSizeData.value = JSON.stringify(textArea.cfg.size);
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multiline_RestoreSizeData
|
||||
//
|
||||
var CTextBox_Multiline_RestoreSizeData = function (textArea) {
|
||||
var hidSizeData = document.getElementById(textArea.cfg.hidSize);
|
||||
|
||||
if (hidSizeData.value !== "") {
|
||||
textArea.cfg.size = JSON.parse(hidSizeData.value);
|
||||
if (textArea.cfg.size.width !== null) {
|
||||
textArea.style.width = textArea.cfg.size.width + "px";
|
||||
}
|
||||
if (textArea.cfg.size.height !== null) {
|
||||
textArea.style.height = textArea.cfg.size.height + "px";
|
||||
}
|
||||
if (textArea.cfg.size.scrollTop !== null) {
|
||||
textArea.scrollTop = textArea.cfg.size.scrollTop;
|
||||
}
|
||||
}
|
||||
textArea.cfg.size = { height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop };
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multiline_MouseUp
|
||||
//
|
||||
var CTextBox_Multiline_MouseUp = function (e) {
|
||||
var textArea = e.target;
|
||||
var newSize = { height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop };
|
||||
if (textArea.cfg.size.height !== newSize.height) {
|
||||
textArea.cfg.size = newSize;
|
||||
CTextBox_Multiline_SaveSizeData(textArea);
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multiline_Scrolled
|
||||
//
|
||||
var CTextBox_Multiline_Scrolled = function (e) {
|
||||
var textArea = e.target;
|
||||
textArea.cfg.size = { height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop };
|
||||
CTextBox_Multiline_SaveSizeData(textArea);
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
// CTextBox_Multiline_Init
|
||||
//
|
||||
var CTextBox_Multiline_Init = function (cfg) {
|
||||
var textArea = document.getElementById(cfg.txtContent);
|
||||
textArea.cfg = cfg;
|
||||
|
||||
textArea.onkeydown = CTextBox_Multiline_KeyDown;
|
||||
if (cfg.keepSize) {
|
||||
CTextBox_Multiline_RestoreSizeData(textArea);
|
||||
textArea.onmouseup = CTextBox_Multiline_MouseUp;
|
||||
textArea.onscroll = CTextBox_Multiline_Scrolled;
|
||||
}
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
/* Reset */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Remove FireFox inner padding and border on buttons */
|
||||
button::-moz-focus-inner,
|
||||
input[type="button"]::-moz-focus-inner,
|
||||
input[type="submit"]::-moz-focus-inner,
|
||||
input[type="reset"]::-moz-focus-inner {
|
||||
padding: 0 !important;
|
||||
border: 0 none !important;
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
font-size: 12px;
|
||||
background-color: grey;
|
||||
color: black;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
form {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0.5em;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.7em;
|
||||
text-align: center;
|
||||
margin-top: 1.0em;
|
||||
margin-bottom: 0.5em;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
margin-top: 1.0em;
|
||||
margin-bottom: 0.5em;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2em;
|
||||
text-align: left;
|
||||
margin-top: 1.0em;
|
||||
margin-bottom: 0.5em;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.divHeader {
|
||||
display: block;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
.divHeader a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.divHeader h1 {
|
||||
font-size: 30px;
|
||||
color: yellow;
|
||||
margin: 0;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.divUserInfo {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.divContent {
|
||||
padding: 1px;
|
||||
box-shadow: 0 0 10px black inset;
|
||||
height: calc(100% - 41px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.divCode {
|
||||
background-color: black;
|
||||
color: green;
|
||||
font-family: Courier New, Courier, monospace;
|
||||
text-shadow: none;
|
||||
overflow: auto;
|
||||
margin: 5px;
|
||||
padding: 2px;
|
||||
box-shadow: 0 0 10px rgb(0,0,0);
|
||||
}
|
||||
|
||||
.formColumn {
|
||||
display: inline-block;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.formRow {
|
||||
display: block;
|
||||
font-size: 0;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.formLabel {
|
||||
display: inline-block;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
font-size: 12px;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
|
||||
text-align: right;
|
||||
padding-right: 20px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.formLabel span:last-child::after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
.formField {
|
||||
display: inline-block;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.textbox {
|
||||
background: white;
|
||||
border: solid 1px rgba(0, 0, 0, 0.5);
|
||||
border-radius: 5px;
|
||||
line-height: 13px;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
font-size: 11px;
|
||||
padding: 3px;
|
||||
box-shadow: inset 0 -2px 5px rgba(255,255,255,1), inset 0 2px 5px rgba(128,128,128,1);
|
||||
}
|
||||
|
||||
.textbox:focus {
|
||||
border: solid 1px black;
|
||||
box-shadow: 0 0 10px rgba(255,255,255,0.5), inset 0 -2px 5px rgba(255,255,255,1), inset 0 2px 5px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
textarea.textbox {
|
||||
height: 64px;
|
||||
resize: vertical;
|
||||
min-height: 21px;
|
||||
}
|
||||
|
||||
.textboxInvalid {
|
||||
box-shadow: 0 0 10px rgba(255,0,0,1), inset 0 -2px 5px rgba(255,255,255,1), inset 0 2px 5px rgba(0,0,0,0.5);
|
||||
border: solid 1px rgb(255,0,0);
|
||||
}
|
||||
|
||||
.textboxInvalid:focus {
|
||||
box-shadow: 0 0 10px rgba(255,0,0,1), inset 0 -2px 5px rgba(255,255,255,1), inset 0 2px 5px rgba(0,0,0,0.5);
|
||||
border: solid 1px black;
|
||||
}
|
||||
|
||||
.button {
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,1), inset 0 -2px 5px rgba(128,128,128,1);
|
||||
vertical-align: top;
|
||||
border-radius: 5px;
|
||||
border: solid 1px rgba(0, 0, 0, 0.5);
|
||||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
||||
font-size: 11px;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background-color: rgb(192,192,192);
|
||||
margin-left: 5px;
|
||||
padding-bottom: 2px;
|
||||
padding-top: 2px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.button:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: rgb(220,220,220);
|
||||
}
|
||||
.button:focus {
|
||||
border: solid 1px black;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: rgb(220,220,220);
|
||||
box-shadow: inset 0 2px 5px rgba(255,255,255,1), inset 0 -2px 5px rgba(128,128,128,1);
|
||||
}
|
||||
|
||||
.width25pc {
|
||||
width: 25% !important;
|
||||
}
|
||||
|
||||
.width50pc {
|
||||
width: 50% !important;
|
||||
}
|
||||
|
||||
.width75pc {
|
||||
width: 75% !important;
|
||||
}
|
||||
|
||||
.width100pc {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.width70px {
|
||||
width: 70px !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.width100px {
|
||||
width: 100px !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.width150px {
|
||||
width: 150px !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.width200px {
|
||||
width: 200px !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.width300px {
|
||||
width: 300px !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
@@ -52,7 +52,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Images\BGCork.png" />
|
||||
<Content Include="priv\keep.txt" />
|
||||
<Content Include="Scripts\01. Base.js" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
|
||||
<Content Include="Resources\Literals.en.json" />
|
||||
@@ -67,12 +66,8 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Scripts\02. Ajax.js" />
|
||||
<Content Include="Scripts\03. Controls.js" />
|
||||
<Content Include="Scripts\05. Cards.js" />
|
||||
<Content Include="Scripts\10. Chat.js" />
|
||||
<Content Include="Styles\00. Reset.css" />
|
||||
<Content Include="Styles\01. base.css" />
|
||||
<Content Include="Styles\02. Boards.css" />
|
||||
<Content Include="Styles\05. Cards.css" />
|
||||
<Content Include="Styles\10. Chat.css" />
|
||||
|
||||
Reference in New Issue
Block a user