1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-26 01:18:21 +01:00
This commit is contained in:
lxsang 2019-12-15 12:13:04 +01:00
parent 4cc896c1e1
commit 4af1130c5c
3 changed files with 48 additions and 61 deletions

View File

@ -1,7 +1,7 @@
BUILDDIR = ./build
projs = grs info blog apps os
copyfiles = index.ls mimes.json
main: clean copy
main: copy
for f in $(projs); do make -C "$${f}" ; done
copy:

View File

@ -1,8 +1,6 @@
// Generated by CoffeeScript 1.12.7
// Generated by CoffeeScript 2.4.1
(function() {
var APIManager, BaseObject, MarkOn, WebVNC, require,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
var APIManager, BaseObject, MarkOn, WebVNC, require;
window.classes = {};
@ -21,19 +19,17 @@
return window.classes[n] = o;
};
/*
window.require = (lib) ->
return new Promise (r, e) ->
return r() if window.libraries[lib]
$.getScript window.myuri + lib
.done (d) ->
window.libraries[lib] = true
r()
window.libraries[lib] = true
r()
.fail (m, s) ->
e(m, s)
*/
e(m, s) */
// private function
require = function(lib) {
return new Promise(function(r, e) {
if (window.libraries[lib]) {
@ -48,24 +44,24 @@
});
};
BaseObject = (function() {
function BaseObject(name) {
BaseObject = class BaseObject {
constructor(name) {
this.name = name;
}
BaseObject.prototype.ready = function() {
ready() {
var me;
me = this;
return new Promise(function(r, e) {
return me.resolveDep().then(function() {
return r();
})["catch"](function(m, s) {
}).catch(function(m, s) {
return e(m, s);
});
});
};
}
BaseObject.prototype.resolveDep = function() {
resolveDep() {
var me;
me = this;
return new Promise(function(r, e) {
@ -80,29 +76,25 @@
}
return require(l[i]).then(function() {
return fn(l, i + 1);
})["catch"](function(m, s) {
}).catch(function(m, s) {
return e(m, s);
});
};
return fn(dep, 0);
});
};
}
return BaseObject;
})();
};
makeclass("BaseObject", BaseObject);
APIManager = (function(superClass) {
extend(APIManager, superClass);
function APIManager(args1) {
APIManager = class APIManager extends window.classes.BaseObject {
constructor(args1) {
super("APIManager");
this.args = args1;
APIManager.__super__.constructor.call(this, "APIManager");
}
APIManager.prototype.init = function() {
init() {
var cname, me;
me = this;
if (!(this.args && this.args.length > 0)) {
@ -113,6 +105,7 @@
if (mobilecheck()) {
mobileConsole.init();
}
// load the class
if (!cname || cname === "") {
return;
}
@ -120,67 +113,60 @@
return console.error("Cannot find class ", cname);
}
return (new window.classes[cname](me.args)).init();
})["catch"](function(m, s) {
}).catch(function(m, s) {
return console.error(m, s);
});
};
}
return APIManager;
})(window.classes.BaseObject);
};
APIManager.dependencies = ["/assets/scripts/mobile_console.js"];
makeclass("APIManager", APIManager);
MarkOn = (function(superClass) {
extend(MarkOn, superClass);
function MarkOn() {
MarkOn.__super__.constructor.call(this, "MarkOn");
MarkOn = class MarkOn extends window.classes.BaseObject {
constructor() {
super("MarkOn");
}
MarkOn.prototype.init = function() {
init() {
var me;
me = this;
return this.ready().then(function() {
return me.editor = new SimpleMDE({
element: $("#editor")[0]
});
})["catch"](function(m, s) {
}).catch(function(m, s) {
return console.error(m, s);
});
};
}
return MarkOn;
})(window.classes.BaseObject);
};
MarkOn.dependencies = ["/rst/gscripts/mde/simplemde.min.js"];
makeclass("MarkOn", MarkOn);
WebVNC = (function(superClass) {
extend(WebVNC, superClass);
function WebVNC() {
WebVNC.__super__.constructor.call(this, "WebVNC");
WebVNC = class WebVNC extends window.classes.BaseObject {
constructor() {
super("WebVNC");
}
WebVNC.prototype.init = function() {
init() {
var me;
me = this;
return this.ready().then(function() {
return me.initVNCClient();
})["catch"](function(m, s) {
}).catch(function(m, s) {
return console.error(m, s);
});
};
}
WebVNC.prototype.initVNCClient = function() {
initVNCClient() {
var args, me;
args = {
element: 'canvas',
//ws: 'wss://localhost:9192/wvnc',
ws: 'wss://lxsang.me/wvnc',
worker: '/assets/scripts/decoder.js'
};
@ -219,14 +205,14 @@
value = Number(this.value) / 100;
return me.client.setScale(value);
});
})["catch"](function(m, s) {
//$("#btclipboard").click (e) ->
// me.client.sendTextAsClipboard ($ "#clipboard")[0].value
}).catch(function(m, s) {
return console.error(m, s);
});
};
}
return WebVNC;
})(window.classes.BaseObject);
};
WebVNC.dependencies = ["/assets/scripts/wvnc.js"];

View File

@ -117,13 +117,14 @@ vfs.write = function(path,data)
if header ~= nil then
local b64data = string.gsub(data, header,"")
local barr = std.b64decode(b64data)
if std.isBinary(osfile) then
bytes.write(barr,osfile)
bytes.write(barr,osfile)
--[[ if std.isBinary(osfile) then
else
local f = io.open(osfile, "w")
f:write(bytes.__tostring(barr))
f:close()
end
end ]]
else
return false, "Wrong data format"
end