mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Remove unused libraries, Fix the rendering-related resources
This commit is contained in:
parent
df3ee0331c
commit
e8e617658c
9
app.js
9
app.js
|
@ -495,16 +495,9 @@ function initializeWindow(name, args, w, h) {
|
|||
// JSON 2
|
||||
__include__("app/assets/js/json2");
|
||||
|
||||
// JSON 3 was a JSON polyfill for older JavaScript platforms
|
||||
//var JSON = require("app/assets/js/json3-3.3.2.min");
|
||||
|
||||
// core-js (Formerly aka, babel-polyfill)
|
||||
// core-js (aka. babel-polyfill)
|
||||
require("app/assets/js/core-js-3.26.1.minified");
|
||||
|
||||
// es5-shims
|
||||
//require("app/assets/js/es5-shim-4.5.15.min");
|
||||
//require("app/assets/js/es5-sham-4.5.15.min");
|
||||
|
||||
// Squel.js SQL query string builder for Javascript
|
||||
var squel = require("app/assets/js/squel-basic-5.13.0.hiddentao-afa1cb5.wsh");
|
||||
|
||||
|
|
7
app/assets/js/es5-sham-4.5.15.min.js
vendored
7
app/assets/js/es5-sham-4.5.15.min.js
vendored
File diff suppressed because one or more lines are too long
7
app/assets/js/es5-shim-4.5.15.min.js
vendored
7
app/assets/js/es5-shim-4.5.15.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,170 +0,0 @@
|
|||
/*!
|
||||
* https://github.com/paulmillr/es6-shim
|
||||
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
|
||||
* and contributors, MIT License
|
||||
* es6-sham: v0.35.4
|
||||
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
|
||||
* Details and documentation:
|
||||
* https://github.com/paulmillr/es6-shim/
|
||||
*/
|
||||
|
||||
// UMD (Universal Module Definition)
|
||||
// see https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
(function (root, factory) {
|
||||
/*global define */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.returnExports = factory();
|
||||
}
|
||||
}(this, function () {
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable no-new-func */
|
||||
var getGlobal = new Function('return this;');
|
||||
/* eslint-enable no-new-func */
|
||||
|
||||
var globals = getGlobal();
|
||||
var Object = globals.Object;
|
||||
var _call = Function.call.bind(Function.call);
|
||||
var functionToString = Function.toString;
|
||||
var _strMatch = String.prototype.match;
|
||||
|
||||
var throwsError = function (func) {
|
||||
try {
|
||||
func();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
var arePropertyDescriptorsSupported = function () {
|
||||
// if Object.defineProperty exists but throws, it's IE 8
|
||||
return !throwsError(function () {
|
||||
Object.defineProperty({}, 'x', { get: function () {} }); // eslint-disable-line getter-return
|
||||
});
|
||||
};
|
||||
var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported();
|
||||
|
||||
// NOTE: This versions needs object ownership
|
||||
// because every promoted object needs to be reassigned
|
||||
// otherwise uncompatible browsers cannot work as expected
|
||||
//
|
||||
// NOTE: This might need es5-shim or polyfills upfront
|
||||
// because it's based on ES5 API.
|
||||
// (probably just an IE <= 8 problem)
|
||||
//
|
||||
// NOTE: nodejs is fine in version 0.8, 0.10, and future versions.
|
||||
(function () {
|
||||
if (Object.setPrototypeOf) { return; }
|
||||
|
||||
// @author Andrea Giammarchi - @WebReflection
|
||||
|
||||
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
||||
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||||
var create = Object.create;
|
||||
var defineProperty = Object.defineProperty;
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
var objProto = Object.prototype;
|
||||
|
||||
var copyDescriptors = function (target, source) {
|
||||
// define into target descriptors from source
|
||||
getOwnPropertyNames(source).forEach(function (key) {
|
||||
defineProperty(
|
||||
target,
|
||||
key,
|
||||
getOwnPropertyDescriptor(source, key)
|
||||
);
|
||||
});
|
||||
return target;
|
||||
};
|
||||
// used as fallback when no promotion is possible
|
||||
var createAndCopy = function (origin, proto) {
|
||||
return copyDescriptors(create(proto), origin);
|
||||
};
|
||||
var set, setPrototypeOf;
|
||||
try {
|
||||
// this might fail for various reasons
|
||||
// ignore if Chrome cought it at runtime
|
||||
set = getOwnPropertyDescriptor(objProto, '__proto__').set;
|
||||
set.call({}, null);
|
||||
// setter not poisoned, it can promote
|
||||
// Firefox, Chrome
|
||||
setPrototypeOf = function (origin, proto) {
|
||||
set.call(origin, proto);
|
||||
return origin;
|
||||
};
|
||||
} catch (e) {
|
||||
// do one or more feature detections
|
||||
set = { __proto__: null };
|
||||
// if proto does not work, needs to fallback
|
||||
// some Opera, Rhino, ducktape
|
||||
if (set instanceof Object) {
|
||||
setPrototypeOf = createAndCopy;
|
||||
} else {
|
||||
// verify if null objects are buggy
|
||||
/* eslint-disable no-proto */
|
||||
set.__proto__ = objProto;
|
||||
/* eslint-enable no-proto */
|
||||
// if null objects are buggy
|
||||
// nodejs 0.8 to 0.10
|
||||
if (set instanceof Object) {
|
||||
setPrototypeOf = function (origin, proto) {
|
||||
// use such bug to promote
|
||||
/* eslint-disable no-proto */
|
||||
origin.__proto__ = proto;
|
||||
/* eslint-enable no-proto */
|
||||
return origin;
|
||||
};
|
||||
} else {
|
||||
// try to use proto or fallback
|
||||
// Safari, old Firefox, many others
|
||||
setPrototypeOf = function (origin, proto) {
|
||||
// if proto is not null
|
||||
if (getPrototypeOf(origin)) {
|
||||
// use __proto__ to promote
|
||||
/* eslint-disable no-proto */
|
||||
origin.__proto__ = proto;
|
||||
/* eslint-enable no-proto */
|
||||
return origin;
|
||||
} else {
|
||||
// otherwise unable to promote: fallback
|
||||
return createAndCopy(origin, proto);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.setPrototypeOf = setPrototypeOf;
|
||||
}());
|
||||
|
||||
if (supportsDescriptors && function foo() {}.name !== 'foo') {
|
||||
/* eslint no-extend-native: 1 */
|
||||
Object.defineProperty(Function.prototype, 'name', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
if (this === Function.prototype) {
|
||||
return '';
|
||||
}
|
||||
var str = _call(functionToString, this);
|
||||
var match = _call(_strMatch, str, /\s*function\s+([^(\s]*)\s*/);
|
||||
var name = match && match[1];
|
||||
Object.defineProperty(this, 'name', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
value: name
|
||||
});
|
||||
return name;
|
||||
}
|
||||
});
|
||||
}
|
||||
}));
|
File diff suppressed because it is too large
Load Diff
19
app/assets/js/json3-3.3.2.min.js
vendored
19
app/assets/js/json3-3.3.2.min.js
vendored
|
@ -1,19 +0,0 @@
|
|||
/*! JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */
|
||||
/*
|
||||
JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */
|
||||
(function(){function O(u,v){function B(a,d){try{a()}catch(c){d&&d()}}function q(a){if(null!=q[a])return q[a];if("bug-string-char-index"==a)var d=!1;else if("json"==a)d=q("json-stringify")&&q("date-serialization")&&q("json-parse");else if("date-serialization"==a){if(d=q("json-stringify")&&y){var c=v.stringify;B(function(){d='"-271821-04-20T00:00:00.000Z"'==c(new z(-864E13))&&'"+275760-09-13T00:00:00.000Z"'==c(new z(864E13))&&'"-000001-01-01T00:00:00.000Z"'==c(new z(-621987552E5))&&'"1969-12-31T23:59:59.999Z"'==
|
||||
c(new z(-1))})}}else{var e;if("json-stringify"==a){c=v.stringify;var g="function"==typeof c;g&&((e=function(){return 1}).toJSON=e,B(function(){g="0"===c(0)&&"0"===c(new ca)&&'""'==c(new U)&&c(w)===x&&c(x)===x&&c()===x&&"1"===c(e)&&"[1]"==c([e])&&"[null]"==c([x])&&"null"==c(null)&&"[null,null,null]"==c([x,w,null])&&'{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'==c({a:[e,!0,!1,null,"\x00\b\n\f\r\t"]})&&"1"===c(null,e)&&"[\n 1,\n 2\n]"==c([1,2],null,1)},function(){g=!1}));d=g}if("json-parse"==
|
||||
a){var l=v.parse,b;"function"==typeof l&&B(function(){0===l("0")&&!l(!1)&&(e=l('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'),b=5==e.a.length&&1===e.a[0])&&(B(function(){b=!l('"\t"')}),b&&B(function(){b=1!==l("01")}),b&&B(function(){b=1!==l("1.")}))},function(){b=!1});d=b}}return q[a]=!!d}u||(u=r.Object());v||(v=r.Object());var ca=u.Number||r.Number,U=u.String||r.String,I=u.Object||r.Object,z=u.Date||r.Date,da=u.SyntaxError||r.SyntaxError,ea=u.TypeError||r.TypeError,fa=u.Math||r.Math;u=u.JSON||
|
||||
r.JSON;"object"==typeof u&&u&&(v.stringify=u.stringify,v.parse=u.parse);I=I.prototype;var w=I.toString,J=I.hasOwnProperty,x,y=new z(-0xc782b5b800cec);B(function(){y=-109252==y.getUTCFullYear()&&0===y.getUTCMonth()&&1===y.getUTCDate()&&10==y.getUTCHours()&&37==y.getUTCMinutes()&&6==y.getUTCSeconds()&&708==y.getUTCMilliseconds()});q["bug-string-char-index"]=q["date-serialization"]=q.json=q["json-stringify"]=q["json-parse"]=null;if(!q("json")){var P=q("bug-string-char-index"),G=function(a,d){var c=0,
|
||||
e,g;(e=function(){this.valueOf=0}).prototype.valueOf=0;var l=new e;for(g in l)J.call(l,g)&&c++;e=l=null;c?G=function(b,h){var p="[object Function]"==w.call(b),k,n;for(k in b)p&&"prototype"==k||!J.call(b,k)||(n="constructor"===k)||h(k);(n||J.call(b,k="constructor"))&&h(k)}:(l="valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor".split(" "),G=function(b,h){var p="[object Function]"==w.call(b),k,n=!p&&"function"!=typeof b.constructor&&H[typeof b.hasOwnProperty]&&
|
||||
b.hasOwnProperty||J;for(k in b)p&&"prototype"==k||!n.call(b,k)||h(k);for(p=l.length;k=l[--p];)n.call(b,k)&&h(k)});return G(a,d)};if(!q("json-stringify")&&!q("date-serialization")){var ha={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},A=function(a,d){return("000000"+(d||0)).slice(-a)},L=function(a){var d,c,e,g,l,b,h,p;if(y)var k=function(m){d=m.getUTCFullYear();c=m.getUTCMonth();e=m.getUTCDate();l=m.getUTCHours();b=m.getUTCMinutes();h=m.getUTCSeconds();p=m.getUTCMilliseconds()};else{var n=
|
||||
fa.floor,K=[0,31,59,90,120,151,181,212,243,273,304,334],D=function(m,C){return K[C]+365*(m-1970)+n((m-1969+(C=+(1<C)))/4)-n((m-1901+C)/100)+n((m-1601+C)/400)};k=function(m){e=n(m/864E5);for(d=n(e/365.2425)+1970-1;D(d+1,0)<=e;d++);for(c=n((e-D(d,0))/30.42);D(d,c+1)<=e;c++);e=1+e-D(d,c);g=(m%864E5+864E5)%864E5;l=n(g/36E5)%24;b=n(g/6E4)%60;h=n(g/1E3)%60;p=g%1E3}}L=function(m){m>-1/0&&m<1/0?(k(m),m=(0>=d||1E4<=d?(0>d?"-":"+")+A(6,0>d?-d:d):A(4,d))+"-"+A(2,c+1)+"-"+A(2,e)+"T"+A(2,l)+":"+A(2,b)+":"+A(2,
|
||||
h)+"."+A(3,p)+"Z",d=c=e=l=b=h=p=null):m=null;return m};return L(a)};if(q("json-stringify")&&!q("date-serialization")){var ia=function(){return L(this)},ja=v.stringify;v.stringify=function(a,d,c){var e=z.prototype.toJSON;z.prototype.toJSON=ia;a=ja(a,d,c);z.prototype.toJSON=e;return a}}else{var ka=function(a){a=a.charCodeAt(0);var d=ha[a];return d?d:"\\u00"+A(2,a.toString(16))},Q=/[\x00-\x1f\x22\x5c]/g,V=function(a){Q.lastIndex=0;return'"'+(Q.test(a)?a.replace(Q,ka):a)+'"'},R=function(a,d,c,e,g,l,b){var h,
|
||||
p;B(function(){h=d[a]});"object"==typeof h&&h&&(h.getUTCFullYear&&"[object Date]"==w.call(h)&&h.toJSON===z.prototype.toJSON?h=L(h):"function"==typeof h.toJSON&&(h=h.toJSON(a)));c&&(h=c.call(d,a,h));if(h==x)return h===x?h:"null";var k=typeof h;"object"==k&&(p=w.call(h));switch(p||k){case "boolean":case "[object Boolean]":return""+h;case "number":case "[object Number]":return h>-1/0&&h<1/0?""+h:"null";case "string":case "[object String]":return V(""+h)}if("object"==typeof h){for(k=b.length;k--;)if(b[k]===
|
||||
h)throw ea();b.push(h);var n=[];var K=l;l+=g;if("[object Array]"==p){var D=0;for(k=h.length;D<k;D++)p=R(D,h,c,e,g,l,b),n.push(p===x?"null":p);k=n.length?g?"[\n"+l+n.join(",\n"+l)+"\n"+K+"]":"["+n.join(",")+"]":"[]"}else G(e||h,function(m){var C=R(m,h,c,e,g,l,b);C!==x&&n.push(V(m)+":"+(g?" ":"")+C)}),k=n.length?g?"{\n"+l+n.join(",\n"+l)+"\n"+K+"}":"{"+n.join(",")+"}":"{}";b.pop();return k}};v.stringify=function(a,d,c){var e;if(H[typeof d]&&d){var g=w.call(d);if("[object Function]"==g)var l=d;else if("[object Array]"==
|
||||
g){var b={};for(var h=0,p=d.length,k;h<p;)if(k=d[h++],g=w.call(k),"[object String]"==g||"[object Number]"==g)b[k]=1}}if(c)if(g=w.call(c),"[object Number]"==g){if(0<(c-=c%1))for(10<c&&(c=10),e="";e.length<c;)e+=" "}else"[object String]"==g&&(e=10>=c.length?c:c.slice(0,10));return R("",(k={},k[""]=a,k),l,b,e,"",[])}}}if(!q("json-parse")){var la=U.fromCharCode,ma={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},f,M,t=function(){f=M=null;throw da();},E=function(){for(var a=M,d=a.length,
|
||||
c,e,g,l,b;f<d;)switch(b=a.charCodeAt(f),b){case 9:case 10:case 13:case 32:f++;break;case 123:case 125:case 91:case 93:case 58:case 44:return c=P?a.charAt(f):a[f],f++,c;case 34:c="@";for(f++;f<d;)if(b=a.charCodeAt(f),32>b)t();else if(92==b)switch(b=a.charCodeAt(++f),b){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:c+=ma[b];f++;break;case 117:e=++f;for(g=f+4;f<g;f++)b=a.charCodeAt(f),48<=b&&57>=b||97<=b&&102>=b||65<=b&&70>=b||t();c+=la("0x"+a.slice(e,f));break;default:t()}else{if(34==
|
||||
b)break;b=a.charCodeAt(f);for(e=f;32<=b&&92!=b&&34!=b;)b=a.charCodeAt(++f);c+=a.slice(e,f)}if(34==a.charCodeAt(f))return f++,c;t();default:e=f;45==b&&(l=!0,b=a.charCodeAt(++f));if(48<=b&&57>=b){for(48==b&&(b=a.charCodeAt(f+1),48<=b&&57>=b)&&t();f<d&&(b=a.charCodeAt(f),48<=b&&57>=b);f++);if(46==a.charCodeAt(f)){for(g=++f;g<d&&!(b=a.charCodeAt(g),48>b||57<b);g++);g==f&&t();f=g}b=a.charCodeAt(f);if(101==b||69==b){b=a.charCodeAt(++f);43!=b&&45!=b||f++;for(g=f;g<d&&!(b=a.charCodeAt(g),48>b||57<b);g++);
|
||||
g==f&&t();f=g}return+a.slice(e,f)}l&&t();c=a.slice(f,f+4);if("true"==c)return f+=4,!0;if("fals"==c&&101==a.charCodeAt(f+4))return f+=5,!1;if("null"==c)return f+=4,null;t()}return"$"},S=function(a){var d;"$"==a&&t();if("string"==typeof a){if("@"==(P?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(d=[];;){a=E();if("]"==a)break;if(c)","==a?(a=E(),"]"==a&&t()):t();else var c=!0;","==a&&t();d.push(S(a))}return d}if("{"==a){for(d={};;){a=E();if("}"==a)break;c?","==a?(a=E(),"}"==a&&t()):t():c=!0;","!=
|
||||
a&&"string"==typeof a&&"@"==(P?a.charAt(0):a[0])&&":"==E()||t();d[a.slice(1)]=S(E())}return d}t()}return a},X=function(a,d,c){c=W(a,d,c);c===x?delete a[d]:a[d]=c},W=function(a,d,c){var e=a[d],g;if("object"==typeof e&&e)if("[object Array]"==w.call(e))for(g=e.length;g--;)X(w,G,e,g,c);else G(e,function(l){X(e,l,c)});return c.call(a,d,e)};v.parse=function(a,d){var c;f=0;M=""+a;a=S(E());"$"!=E()&&t();f=M=null;return d&&"[object Function]"==w.call(d)?W((c={},c[""]=a,c),"",d):a}}}v.runInContext=O;return v}
|
||||
var Y=typeof define==="function"&&define.amd,H={"function":!0,object:!0},T=H[typeof exports]&&exports&&!exports.nodeType&&exports,r=H[typeof window]&&window||this,F=T&&H[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;!F||F.global!==F&&F.window!==F&&F.self!==F||(r=F);if(T&&!Y)O(r,T);else{var Z=r.JSON,aa=r.JSON3,ba=!1,N=O(r,r.JSON3={noConflict:function(){ba||(ba=!0,r.JSON=Z,r.JSON3=aa,Z=aa=null);return N}});r.JSON={parse:N.parse,stringify:N.stringify}}Y&&define(function(){return N})}).call(this);
|
30
app/index.js
30
app/index.js
|
@ -1,16 +1,27 @@
|
|||
// index.js
|
||||
// The entrypoint on WelsonJS GUI envionment
|
||||
|
||||
// index.js - The entrypoint on WelsonJS GUI envionment
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
var FILE = require("lib/file");
|
||||
var SHELL = require("lib/shell");
|
||||
var OldBrowser = require("lib/oldbrowser");
|
||||
var Browser = require("lib/browser");
|
||||
var Router = require("lib/router").Router;
|
||||
|
||||
// using jsrender
|
||||
Router.setRender(function(filename, data) {
|
||||
var template = FILE.readFile(filename, FILE.CdoCharset.CdoUTF_8);
|
||||
var tmpl = $.templates(template);
|
||||
OldBrowser.setContent(tmpl.render(data));
|
||||
Browser.setContent(tmpl.render(data));
|
||||
|
||||
// check all links
|
||||
Object.values(document.getElementsByTagName("a")).map(function(x) {
|
||||
x.addEventListener("click", function(e) {
|
||||
var href = e.target.getAttribute("href"); // NOTE: x.href != x.getAttribute("href")
|
||||
if (href.indexOf('/') == 0) {
|
||||
e.preventDefault();
|
||||
Router.go(href);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// main
|
||||
|
@ -57,9 +68,10 @@ Router.add('/test', function(render) {
|
|||
|
||||
alert("모든 메시지가 정상적으로 보였다면 테스트에 성공한 것입니다.");
|
||||
};
|
||||
|
||||
var data = JSON.parse(FILE.readFile("data/test-oss-20231030.json", FILE.CdoCharset.CdoUTF_8));
|
||||
render("app\\test.html", {
|
||||
|
||||
var content = FILE.readFile("data/test-oss-20231030.json", FILE.CdoCharset.CdoUTF_8);
|
||||
var data = JSON.parse(content);
|
||||
render("app/test.html", {
|
||||
"data": data
|
||||
});
|
||||
});
|
||||
|
@ -67,7 +79,7 @@ Router.add('/test', function(render) {
|
|||
// nodepad
|
||||
Router.add('/notepad', function(render) {
|
||||
// load resources
|
||||
OldBrowser.addResources([
|
||||
Browser.addResources([
|
||||
{
|
||||
type: "javascript",
|
||||
url: "app/assets/mixed/summernote-0.8.18-dist/summernote-lite.js"
|
||||
|
|
|
@ -79,8 +79,8 @@
|
|||
<div class="col">
|
||||
<div class="cell menu">
|
||||
<ul class="left nav links">
|
||||
<li><a href="#" onclick="javascript:Router.go('/test')">Go to the test page</a></li>
|
||||
<li><a href="#" onclick="javascript:Router.go('/notepad')">WYSIWYG editor</a></li>
|
||||
<li><a href="/test">Go to the test page</a></li>
|
||||
<li><a href="/notepad">WYSIWYG editor</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
// OldBrowser API
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// browser.js
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// only less than IE 9
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
@ -253,7 +252,7 @@ exports.close = function() {
|
|||
exit(0);
|
||||
};
|
||||
|
||||
exports.VERSIONINFO = "OldBrowser Lib (oldbrowser.js) version 0.1.1";
|
||||
exports.VERSIONINFO = "Browser Library (browser.js) version 0.1.2";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
|
@ -1,24 +1,23 @@
|
|||
function RouterObject() {
|
||||
this.RouteModel = function(path, callback) {
|
||||
this.path = path;
|
||||
this.callback = callback;
|
||||
};
|
||||
this.Routes = [];
|
||||
this.render = function(filename, data) {
|
||||
console.warn(typeof data !== "undefined" ? "DATA EXISTS" : "NO DATA");
|
||||
console.warn(filename + " cannot be rendered");
|
||||
};
|
||||
// router.js
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
function RouteModel(path, callback) {
|
||||
this.path = path;
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
function RouterObject() {
|
||||
var routes = [];
|
||||
|
||||
this.render = function(filename, data) {};
|
||||
this.setRender = function(render) {
|
||||
this.render = render;
|
||||
}
|
||||
|
||||
};
|
||||
this.add = function(path, callback) {
|
||||
this.Routes.push(new this.RouteModel(path, callback));
|
||||
}
|
||||
|
||||
routes.push(new RouteModel(path, callback));
|
||||
};
|
||||
this.go = function(path) {
|
||||
var model = this.Routes.find(function(x) {
|
||||
var model = routes.find(function(x) {
|
||||
return (x.path == path);
|
||||
});
|
||||
|
||||
|
@ -29,12 +28,12 @@ function RouterObject() {
|
|||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.Router = new RouterObject();
|
||||
|
||||
exports.VERSIONINFO = "URI Router (router.js) version 0.1";
|
||||
exports.VERSIONINFO = "URI Router (router.js) version 0.1.1";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
22
webloader.js
22
webloader.js
|
@ -3,7 +3,7 @@
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
var CONFIG = require("lib/config");
|
||||
var FILE = require("lib/file");
|
||||
var OldBrowser = require("lib/oldbrowser");
|
||||
var Browser = require("lib/browser");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Override global.console._echo()
|
||||
|
@ -108,26 +108,26 @@ global.exit = function() {
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
// exports.IEVersion
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
exports.IEVersion = OldBrowser.getIEVersion();
|
||||
exports.IEVersion = Browser.getIEVersion();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// exports.main()
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
exports.main = function(args) {
|
||||
// make will display contents
|
||||
OldBrowser.setContent(FILE.readFile("app\\index.html", FILE.CdoCharset.CdoUTF_8));
|
||||
Browser.setContent(FILE.readFile("app\\index.html", FILE.CdoCharset.CdoUTF_8));
|
||||
|
||||
// add stylesheets
|
||||
OldBrowser.addStylesheet("app/assets/css/jquery-ui-1.21.1.min.css");
|
||||
OldBrowser.addStylesheet("app/assets/css/jquery.toast-1.3.2.min.css");
|
||||
OldBrowser.addStylesheet("app/assets/css/cascade/production/build-full.min.css");
|
||||
OldBrowser.addStylesheet("app/assets/css/style.css");
|
||||
Browser.addStylesheet("app/assets/css/jquery-ui-1.21.1.min.css");
|
||||
Browser.addStylesheet("app/assets/css/jquery.toast-1.3.2.min.css");
|
||||
Browser.addStylesheet("app/assets/css/cascade/production/build-full.min.css");
|
||||
Browser.addStylesheet("app/assets/css/style.css");
|
||||
|
||||
// start
|
||||
OldBrowser.start(function(el) {
|
||||
Browser.start(function(el) {
|
||||
jQuery.support.cors = true;
|
||||
|
||||
OldBrowser.addScript("app/assets/js/jquery.toast-1.3.2.min.js", function(el) {
|
||||
Browser.addScript("app/assets/js/jquery.toast-1.3.2.min.js", function(el) {
|
||||
var messages = global.console._messages;
|
||||
if (messages.length > 0) {
|
||||
// print messages
|
||||
|
@ -136,8 +136,8 @@ exports.main = function(args) {
|
|||
}
|
||||
|
||||
// start this app
|
||||
OldBrowser.addScript("app/assets/js/jquery.form-4.3.0.min.js");
|
||||
OldBrowser.addScript("app/index.js");
|
||||
Browser.addScript("app/assets/js/jquery.form-4.3.0.min.js");
|
||||
Browser.addScript("app/index.js");
|
||||
|
||||
// hide loading image
|
||||
document.getElementById("loading").style.display = "none";
|
||||
|
|
Loading…
Reference in New Issue
Block a user