BigBadWaffle 5 anni fa
parent
commit
40d670fe7c
5 ha cambiato i file con 75 aggiunte e 1 eliminazioni
  1. +2
    -0
      src/client/plugins/wquery.js
  2. +1
    -1
      src/client/plugins/wquery.min.js
  3. +68
    -0
      src/server/package-lock.json
  4. +1
    -0
      src/server/package.json
  5. +3
    -0
      src/server/server.js

+ 2
- 0
src/client/plugins/wquery.js Vedi File

@@ -200,6 +200,8 @@ const sq = {
removeData: function (property) {
if (this.dataSet)
delete this.dataSet[property];

return this;
},

wrap: function (els) {


+ 1
- 1
src/client/plugins/wquery.min.js Vedi File

@@ -1 +1 @@
const sq={default:function(t){const e=typeof t;return"string"===e?"<"===t[0]?this.build(t):sq.find(t):"object"===e?sq.wrap([t]):void document.addEventListener("DOMContentLoaded",t,!1)},build:function(t){let e=document.createElement("template");return e.innerHTML=t.trim(),sq.wrap([e.content.firstChild])},find:function(t){const e=(this[0]||document).querySelectorAll(t);return sq.wrap(e)},children:function(){return sq.wrap(this[0].children)},parent:function(){return sq.wrap([this[0].parentElement])},on:function(t,e){return this.each(n=>n.addEventListener(t,t=>{t.target=n,e(t)})),this},each:function(t){const e=this.length;for(let n=0;n<e;n++)t(this[n])},appendTo:function(t){return t="string"==typeof t?sq.find(t)[0]:t.on?t[0]:t,this.each(e=>t.appendChild(e)),this},prependTo:function(t){return t[0].insertBefore(this[0],t.children()[0]),this},remove:function(){this.each(t=>t.remove())},addClass:function(t){return t.split(" ").forEach(t=>this.each(e=>e.classList.add(t))),this},removeClass:function(t){return t.split(" ").forEach(t=>this.each(e=>e.classList.remove(t))),this},hasClass:function(t){return this[0].classList.contains(t)},toggleClass:function(t){this.hasClass(t)?this.removeClass(t):this.addClass(t)},show:function(){return this.each(t=>t.attributeStyleMap.set("display","block")),this},hide:function(){return this.each(t=>t.attributeStyleMap.set("display","none")),this},css:function(t,e){let n=t,i=arguments.length;return 1===i&&"string"==typeof t?(this[0].attributeStyleMap.get(t)||{}).value:(2===i&&(n={[t]:e}),Object.keys(n).forEach(t=>{let e=n[t];!["left","top","width","height"].includes(t)||e.indexOf&&-1!==e.indexOf("%")||(e+="px"),this.each(n=>e?n.attributeStyleMap.set(t,e):n.attributeStyleMap.delete(t))}),this)},empty:function(){let t=this[0];for(;t.firstChild;)t.removeChild(t.firstChild);return this},is:function(t){return this.width()&&this.height()},html:function(t){return arguments.length?(this[0].innerHTML=t,this):this[0].innerHTML},click:function(){return this[0].click(),this},next:function(){return sq.wrap([this[0].nextSibling])},scrollTop:function(t){if(!arguments.length)return this[0].scrollTop;this[0].scrollTop=t},val:function(t){return arguments.length?(this[0].value=t,this):this[0].value},attr:function(t,e){return 1===arguments.length?this[0].getAttribute(t):(this[0].setAttribute(t,e),this)},insertAfter:function(t){return t[0].parentNode.insertBefore(this[0],t[0].nextSibling),this},insertBefore:function(t){return t[0].parentNode.insertBefore(this[0],t[0]),this},index:function(){let t=this[0];return Array.prototype.indexOf.call(t.parentElement.children,t)},offset:function(){return this[0].getBoundingClientRect()},data:function(t,e){return this.dataSet||(this.dataSet={}),1===arguments.length?this.dataSet[t]:(this.dataSet[t]=e,this)},removeData:function(t){this.dataSet&&delete this.dataSet[t]},wrap:function(t){let e={length:t.length};Object.keys(sq).forEach(t=>e[t]=sq[t].bind(e));for(let n=0;n<t.length;n++)e[n]=t[n];return e},width:function(){return this[0].offsetWidth},height:function(){return this[0].offsetHeight},eq:function(t){return sq.wrap([this[t]])},focus:function(){return this[0].focus(),this},cloneRecursive:function(t,e){if("object"!=typeof t)return t;if(!t)return t;if(t instanceof Array){e&&e.push||(e=[]);for(let n=0;n<t.length;n++)e[n]=sq.cloneRecursive(t[n],e[n]);return e}e||(e={});for(let n in t)t.hasOwnProperty(n)&&(e[n]=sq.cloneRecursive(t[n],e[n]));return e},extend:function(t,e){let n=arguments.length;for(let t=2;t<n;t++)sq.cloneRecursive(arguments[t],e);return e}};window.$=sq.default.bind(sq),Object.keys(sq).forEach(t=>window.$[t]=sq[t].bind(sq));
const sq={default:function(t){const e=typeof t;return"string"===e?"<"===t[0]?this.build(t):sq.find(t):"object"===e?sq.wrap([t]):void document.addEventListener("DOMContentLoaded",t,!1)},build:function(t){let e=document.createElement("template");return e.innerHTML=t.trim(),sq.wrap([e.content.firstChild])},find:function(t){const e=(this[0]||document).querySelectorAll(t);return sq.wrap(e)},children:function(){return sq.wrap(this[0].children)},parent:function(){return sq.wrap([this[0].parentElement])},on:function(t,e){return this.each(n=>n.addEventListener(t,t=>{t.target=n,e(t)})),this},each:function(t){const e=this.length;for(let n=0;n<e;n++)t(this[n])},appendTo:function(t){return t="string"==typeof t?sq.find(t)[0]:t.on?t[0]:t,this.each(e=>t.appendChild(e)),this},prependTo:function(t){return t[0].insertBefore(this[0],t.children()[0]),this},remove:function(){this.each(t=>t.remove())},addClass:function(t){return t.split(" ").forEach(t=>this.each(e=>e.classList.add(t))),this},removeClass:function(t){return t.split(" ").forEach(t=>this.each(e=>e.classList.remove(t))),this},hasClass:function(t){return this[0].classList.contains(t)},toggleClass:function(t){this.hasClass(t)?this.removeClass(t):this.addClass(t)},show:function(){return this.each(t=>t.attributeStyleMap.set("display","block")),this},hide:function(){return this.each(t=>t.attributeStyleMap.set("display","none")),this},css:function(t,e){let n=t,i=arguments.length;return 1===i&&"string"==typeof t?(this[0].attributeStyleMap.get(t)||{}).value:(2===i&&(n={[t]:e}),Object.keys(n).forEach(t=>{let e=n[t];!["left","top","width","height"].includes(t)||e.indexOf&&-1!==e.indexOf("%")||(e+="px"),this.each(n=>e?n.attributeStyleMap.set(t,e):n.attributeStyleMap.delete(t))}),this)},empty:function(){let t=this[0];for(;t.firstChild;)t.removeChild(t.firstChild);return this},is:function(t){return this.width()&&this.height()},html:function(t){return arguments.length?(this[0].innerHTML=t,this):this[0].innerHTML},click:function(){return this[0].click(),this},next:function(){return sq.wrap([this[0].nextSibling])},scrollTop:function(t){if(!arguments.length)return this[0].scrollTop;this[0].scrollTop=t},val:function(t){return arguments.length?(this[0].value=t,this):this[0].value},attr:function(t,e){return 1===arguments.length?this[0].getAttribute(t):(this[0].setAttribute(t,e),this)},insertAfter:function(t){return t[0].parentNode.insertBefore(this[0],t[0].nextSibling),this},insertBefore:function(t){return t[0].parentNode.insertBefore(this[0],t[0]),this},index:function(){let t=this[0];return Array.prototype.indexOf.call(t.parentElement.children,t)},offset:function(){return this[0].getBoundingClientRect()},data:function(t,e){return this.dataSet||(this.dataSet={}),1===arguments.length?this.dataSet[t]:(this.dataSet[t]=e,this)},removeData:function(t){return this.dataSet&&delete this.dataSet[t],this},wrap:function(t){let e={length:t.length};Object.keys(sq).forEach(t=>e[t]=sq[t].bind(e));for(let n=0;n<t.length;n++)e[n]=t[n];return e},width:function(){return this[0].offsetWidth},height:function(){return this[0].offsetHeight},eq:function(t){return sq.wrap([this[t]])},focus:function(){return this[0].focus(),this},cloneRecursive:function(t,e){if("object"!=typeof t)return t;if(!t)return t;if(t instanceof Array){e&&e.push||(e=[]);for(let n=0;n<t.length;n++)e[n]=sq.cloneRecursive(t[n],e[n]);return e}e||(e={});for(let n in t)t.hasOwnProperty(n)&&(e[n]=sq.cloneRecursive(t[n],e[n]));return e},extend:function(t,e){let n=arguments.length;for(let t=2;t<n;t++)sq.cloneRecursive(arguments[t],e);return e}};window.$=sq.default.bind(sq),Object.keys(sq).forEach(t=>window.$[t]=sq[t].bind(sq));

+ 68
- 0
src/server/package-lock.json Vedi File

@@ -144,6 +144,11 @@
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"callsite": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
@@ -213,6 +218,64 @@
"resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
"integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM="
},
"compressible": {
"version": "2.0.15",
"resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz",
"integrity": "sha512-4aE67DL33dSW9gw4CI2H/yTxqHLNcxp0yS6jB+4h+wr3e43+1z7vm0HU9qXOH8j+qjKuL8+UtkOxYQSMq60Ylw==",
"requires": {
"mime-db": "1.36.0"
},
"dependencies": {
"mime-db": {
"version": "1.36.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz",
"integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw=="
}
}
},
"compression": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz",
"integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==",
"requires": {
"accepts": "1.3.5",
"bytes": "3.0.0",
"compressible": "2.0.15",
"debug": "2.6.9",
"on-headers": "1.0.1",
"safe-buffer": "5.1.2",
"vary": "1.1.2"
},
"dependencies": {
"accepts": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "2.1.20",
"negotiator": "0.6.1"
}
},
"mime-db": {
"version": "1.36.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz",
"integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw=="
},
"mime-types": {
"version": "2.1.20",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz",
"integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==",
"requires": {
"mime-db": "1.36.0"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
"concat-stream": {
"version": "1.4.10",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.10.tgz",
@@ -1246,6 +1309,11 @@
"ee-first": "1.1.1"
}
},
"on-headers": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz",
"integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c="
},
"options": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz",


+ 1
- 0
src/server/package.json Vedi File

@@ -4,6 +4,7 @@
"description": "isleward",
"dependencies": {
"bcrypt-nodejs": "0.0.3",
"compression": "^1.7.3",
"express": "^4.13.1",
"google-spreadsheet": "^2.0.4",
"less-middleware": "^2.0.1",


+ 3
- 0
src/server/server.js Vedi File

@@ -1,3 +1,4 @@
let compression = require('compression');
let config = require('./config/serverConfig');
let router = require('./security/router');

@@ -9,6 +10,8 @@ module.exports = {

global.cons.sockets = socketServer.sockets;

app.use(compression());

app.use(function (req, res, next) {
if ((req.url.indexOf('/server') !== 0) && (req.url.indexOf('/mods') !== 0))
req.url = '/client/' + req.url;


Caricamento…
Annulla
Salva