package re-organization
80
app.js
|
|
@ -246,9 +246,10 @@ const script = {
|
|||
"geo/polygons",
|
||||
// "geo/gyroid",
|
||||
"geo/mesh",
|
||||
"moto/kv",
|
||||
"data/local",
|
||||
"data/index",
|
||||
"moto/ajax",
|
||||
"moto/ctrl",
|
||||
"moto/orbit",
|
||||
"moto/space",
|
||||
"load/3mf",
|
||||
"load/obj",
|
||||
|
|
@ -257,7 +258,6 @@ const script = {
|
|||
"load/url",
|
||||
"load/file",
|
||||
"moto/broker",
|
||||
"moto/idb",
|
||||
"kiri/ui",
|
||||
"kiri/do",
|
||||
"kiri/pack",
|
||||
|
|
@ -267,16 +267,16 @@ const script = {
|
|||
"kiri/slice",
|
||||
"kiri/layers",
|
||||
"kiri/client",
|
||||
"mode/fdm/fill",
|
||||
"mode/fdm/driver",
|
||||
"mode/fdm/client",
|
||||
"mode/sla/driver",
|
||||
"mode/sla/client",
|
||||
"mode/cam/driver",
|
||||
"mode/cam/client",
|
||||
"mode/cam/tool",
|
||||
"mode/cam/animate",
|
||||
"mode/laser/driver",
|
||||
"kiri-mode/fdm/fill",
|
||||
"kiri-mode/fdm/driver",
|
||||
"kiri-mode/fdm/client",
|
||||
"kiri-mode/sla/driver",
|
||||
"kiri-mode/sla/client",
|
||||
"kiri-mode/cam/driver",
|
||||
"kiri-mode/cam/client",
|
||||
"kiri-mode/cam/tool",
|
||||
"kiri-mode/cam/animate",
|
||||
"kiri-mode/laser/driver",
|
||||
"kiri/stack",
|
||||
"kiri/stacks",
|
||||
"kiri/widget",
|
||||
|
|
@ -318,25 +318,25 @@ const script = {
|
|||
"kiri/slicer",
|
||||
"kiri/slicer2",
|
||||
"kiri/layers",
|
||||
"mode/fdm/fill",
|
||||
"mode/fdm/driver",
|
||||
"mode/fdm/slice",
|
||||
"mode/fdm/prepare",
|
||||
"mode/fdm/export",
|
||||
"mode/sla/driver",
|
||||
"mode/sla/slice",
|
||||
"mode/sla/export",
|
||||
"mode/sla/x_cxdlp",
|
||||
"mode/sla/x_photon",
|
||||
"mode/cam/driver",
|
||||
"mode/cam/ops",
|
||||
"mode/cam/tool",
|
||||
"mode/cam/topo",
|
||||
"mode/cam/slice",
|
||||
"mode/cam/prepare",
|
||||
"mode/cam/export",
|
||||
"mode/cam/animate",
|
||||
"mode/laser/driver",
|
||||
"kiri-mode/fdm/fill",
|
||||
"kiri-mode/fdm/driver",
|
||||
"kiri-mode/fdm/slice",
|
||||
"kiri-mode/fdm/prepare",
|
||||
"kiri-mode/fdm/export",
|
||||
"kiri-mode/sla/driver",
|
||||
"kiri-mode/sla/slice",
|
||||
"kiri-mode/sla/export",
|
||||
"kiri-mode/sla/x_cxdlp",
|
||||
"kiri-mode/sla/x_photon",
|
||||
"kiri-mode/cam/driver",
|
||||
"kiri-mode/cam/ops",
|
||||
"kiri-mode/cam/tool",
|
||||
"kiri-mode/cam/topo",
|
||||
"kiri-mode/cam/slice",
|
||||
"kiri-mode/cam/prepare",
|
||||
"kiri-mode/cam/export",
|
||||
"kiri-mode/cam/animate",
|
||||
"kiri-mode/laser/driver",
|
||||
"kiri/widget",
|
||||
"kiri/print",
|
||||
"kiri/codec",
|
||||
|
|
@ -359,8 +359,8 @@ const script = {
|
|||
"geo/polygon",
|
||||
"geo/polygons",
|
||||
"geo/gyroid",
|
||||
"mode/fdm/driver",
|
||||
"mode/fdm/slice",
|
||||
"kiri-mode/fdm/driver",
|
||||
"kiri-mode/fdm/slice",
|
||||
"kiri/slice",
|
||||
"kiri/slicer",
|
||||
"kiri/layers",
|
||||
|
|
@ -371,6 +371,7 @@ const script = {
|
|||
engine : [
|
||||
"main/kiri",
|
||||
"moto/license",
|
||||
"data/local",
|
||||
"ext/three",
|
||||
"add/array",
|
||||
"add/three",
|
||||
|
|
@ -383,7 +384,6 @@ const script = {
|
|||
"geo/bounds",
|
||||
"geo/polygon",
|
||||
"geo/polygons",
|
||||
"moto/kv",
|
||||
"moto/broker",
|
||||
"load/obj",
|
||||
"load/stl",
|
||||
|
|
@ -406,6 +406,7 @@ const script = {
|
|||
"moto/client",
|
||||
"moto/license",
|
||||
"moto/broker",
|
||||
"data/index",
|
||||
"ext/three",
|
||||
"ext/three-bgu",
|
||||
"ext/three-svg",
|
||||
|
|
@ -413,7 +414,7 @@ const script = {
|
|||
"ext/fsave",
|
||||
"add/array",
|
||||
"add/three",
|
||||
"moto/ctrl",
|
||||
"moto/orbit",
|
||||
"moto/space",
|
||||
"load/3mf",
|
||||
"load/obj",
|
||||
|
|
@ -421,13 +422,13 @@ const script = {
|
|||
"load/svg",
|
||||
"load/url",
|
||||
"load/file",
|
||||
"moto/idb",
|
||||
"main/mesh"
|
||||
],
|
||||
mesh_work : [
|
||||
"moto/client",
|
||||
"moto/worker",
|
||||
"moto/license",
|
||||
"data/index",
|
||||
"ext/jszip",
|
||||
"ext/clip2",
|
||||
"ext/earcut",
|
||||
|
|
@ -445,7 +446,6 @@ const script = {
|
|||
"geo/polygons",
|
||||
"geo/mesh",
|
||||
"moto/broker",
|
||||
"moto/idb",
|
||||
"mesh/work"
|
||||
],
|
||||
mesh_pool : [
|
||||
|
|
@ -598,7 +598,7 @@ function serveCode(req, res, code) {
|
|||
}
|
||||
|
||||
function generateIcons() {
|
||||
let root = `${dir}/src/ico`;
|
||||
let root = `${dir}/src/kiri-ico`;
|
||||
let icos = {};
|
||||
fs.readdirSync(root).forEach(file => {
|
||||
let name = file.split(".")[0] ;
|
||||
|
|
@ -608,7 +608,7 @@ function generateIcons() {
|
|||
}
|
||||
|
||||
function generateDevices() {
|
||||
let root = `${dir}/src/dev`;
|
||||
let root = `${dir}/src/kiri-dev`;
|
||||
let devs = {};
|
||||
fs.readdirSync(root).forEach(type => {
|
||||
let map = devs[type] = devs[type] || {};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
(function() {
|
||||
|
||||
let moto = self.moto = self.moto || {};
|
||||
if (moto.IDB) return;
|
||||
let data = self.data = self.data || {};
|
||||
if (data.Index) return;
|
||||
|
||||
moto.IDB = moto.Storage = Storage;
|
||||
data.Index = IDBStore;
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
||||
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
* @param {number} [version]
|
||||
* @constructor
|
||||
*/
|
||||
function Storage(dbname, options = {}) {
|
||||
function IDBStore(dbname, options = {}) {
|
||||
this.db = null;
|
||||
this.name = dbname;
|
||||
this.stores = options.stores || [ dbname ];
|
||||
|
|
@ -35,11 +35,11 @@
|
|||
this.initCalled = false;
|
||||
}
|
||||
|
||||
Storage.delete = function(dbname) {
|
||||
IDBStore.delete = function(dbname) {
|
||||
IDB.deleteDatabase(dbname);
|
||||
};
|
||||
|
||||
let SP = Storage.prototype;
|
||||
let SP = IDBStore.prototype;
|
||||
|
||||
/** ******************************************************************
|
||||
* indexedDB implementation
|
||||
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
(function() {
|
||||
|
||||
let moto = self.moto = self.moto || {};
|
||||
if (moto.KV) return;
|
||||
let data = self.data = self.data || {};
|
||||
if (data.Local) return;
|
||||
|
||||
function KV() {
|
||||
function Local() {
|
||||
this.__data__ = {};
|
||||
this.__mem__ = true;
|
||||
}
|
||||
|
||||
var KP = KV.prototype;
|
||||
var KP = Local.prototype;
|
||||
|
||||
KP.getItem = function(key) {
|
||||
return this[key];
|
||||
|
|
@ -32,13 +32,13 @@
|
|||
};
|
||||
|
||||
try {
|
||||
let KV = moto.KV = self.localStorage,
|
||||
let local = data.Local = self.localStorage,
|
||||
testkey = '__test';
|
||||
KV.setItem(testkey, 1);
|
||||
KV.getItem(testkey);
|
||||
KV.removeItem(testkey);
|
||||
local.setItem(testkey, 1);
|
||||
local.getItem(testkey);
|
||||
local.removeItem(testkey);
|
||||
} catch (e) {
|
||||
moto.KV = new KV();
|
||||
data.Local = new Local();
|
||||
let msg = "in private or restricted browsing mode. local storage blocked. application may not function properly.";
|
||||
console.log(msg);
|
||||
alert(msg);
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
|
@ -5,6 +5,7 @@
|
|||
(function () {
|
||||
|
||||
let MOTO = self.moto,
|
||||
DATA = self.data,
|
||||
KIRI = self.kiri,
|
||||
LOAD = self.load,
|
||||
BASE = self.base,
|
||||
|
|
@ -18,9 +19,9 @@
|
|||
SECURE = isSecure(LOC.protocol),
|
||||
LOCAL = self.debug && !SETUP.remote,
|
||||
EVENT = KIRI.broker,
|
||||
SDB = MOTO.KV,
|
||||
ODB = KIRI.odb = new MOTO.Storage(SETUP.d ? SETUP.d[0] : 'kiri'),
|
||||
// K3DB = KIRI.wdb = new MOTO.Storage('kiri3', { stores:["file","work"] }).init(),
|
||||
SDB = DATA.Local,
|
||||
ODB = KIRI.odb = new DATA.Index(SETUP.d ? SETUP.d[0] : 'kiri'),
|
||||
// K3DB = KIRI.wdb = new DATA.Index('kiri3', { stores:["file","work"] }).init(),
|
||||
SPACE = KIRI.space = MOTO.Space,
|
||||
WIDGETS = KIRI.widgets = [],
|
||||
CATALOG = KIRI.catalog = KIRI.openCatalog(ODB),
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
};
|
||||
|
||||
const AP = Ajax.prototype,
|
||||
KV = moto.KV,
|
||||
KV = data.Local,
|
||||
KEY = "moto-ajax",
|
||||
TIME = function() { return new Date().getTime() },
|
||||
MOKEY = moto.id = KV.getItem(KEY) || (TIME().toString(36)+rnd()+rnd());
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ let MOTO = self.moto = self.moto || {};
|
|||
* Adapted from THREE.OrbitControls
|
||||
*/
|
||||
|
||||
MOTO.CTRL = function (object, domElement, notify, slider) {
|
||||
MOTO.Orbit = function (object, domElement, notify, slider) {
|
||||
|
||||
this.object = object;
|
||||
this.domElement = ( domElement !== undefined ) ? domElement : document;
|
||||
|
|
@ -620,4 +620,4 @@ MOTO.CTRL = function (object, domElement, notify, slider) {
|
|||
window.addEventListener('keydown', onKeyDown, false);
|
||||
};
|
||||
|
||||
MOTO.CTRL.prototype = Object.create(THREE.EventDispatcher.prototype);
|
||||
MOTO.Orbit.prototype = Object.create(THREE.EventDispatcher.prototype);
|
||||
|
|
@ -1089,7 +1089,7 @@
|
|||
|
||||
raycaster = new THREE.Raycaster();
|
||||
|
||||
viewControl = new MOTO.CTRL(camera, domelement, (position, moved) => {
|
||||
viewControl = new MOTO.Orbit(camera, domelement, (position, moved) => {
|
||||
if (platform) {
|
||||
platform.visible = hidePlatformBelow ?
|
||||
initialized && position.y >= 0 && showPlatform : showPlatform;
|
||||
|
|
|
|||