normalize moto module header
This commit is contained in:
parent
9b1460e3cd
commit
8927501eca
11 changed files with 40 additions and 42 deletions
|
|
@ -4,14 +4,12 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.Ajax) return;
|
if (moto.Ajax) return;
|
||||||
|
|
||||||
const MOTO = self.moto;
|
moto.Ajax = Ajax;
|
||||||
|
|
||||||
MOTO.Ajax = Ajax;
|
moto.callAjax = function(url, handler) {
|
||||||
|
|
||||||
MOTO.callAjax = function(url, handler) {
|
|
||||||
new Ajax(handler).request(url);
|
new Ajax(handler).request(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -21,7 +19,7 @@
|
||||||
TIME = function() { return new Date().getTime() },
|
TIME = function() { return new Date().getTime() },
|
||||||
MOKEY = moto.id = KV.getItem(KEY) || (TIME().toString(36)+rnd()+rnd());
|
MOKEY = moto.id = KV.getItem(KEY) || (TIME().toString(36)+rnd()+rnd());
|
||||||
|
|
||||||
MOTO.restore = function(id) {
|
moto.restore = function(id) {
|
||||||
MOKEY = moto.id = id;
|
MOKEY = moto.id = id;
|
||||||
KV.setItem(KEY, MOKEY);
|
KV.setItem(KEY, MOKEY);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
let moto = self.moto = self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (moto.KV) return;
|
if (moto.KV) return;
|
||||||
|
|
||||||
function KV() {
|
function KV() {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.OBJ) return;
|
if (moto.TMF) return;
|
||||||
|
|
||||||
self.moto.TMF = {
|
moto.TMF = {
|
||||||
parseAsync
|
parseAsync
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
if (!self.moto) self.moto = {};
|
|
||||||
if (self.moto.File) return;
|
let moto = self.moto = self.moto || {};
|
||||||
|
if (moto.File) return;
|
||||||
|
|
||||||
|
moto.File = {
|
||||||
|
load_data,
|
||||||
|
load
|
||||||
|
};
|
||||||
|
|
||||||
function load_data(data, file, ext) {
|
function load_data(data, file, ext) {
|
||||||
ext = ext || name.toLowerCase().split('.').pop();
|
ext = ext || name.toLowerCase().split('.').pop();
|
||||||
|
|
@ -52,9 +58,4 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
self.moto.File = {
|
|
||||||
load_data,
|
|
||||||
load
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.OBJ) return;
|
if (moto.OBJ) return;
|
||||||
|
|
||||||
self.moto.OBJ = {
|
moto.OBJ = {
|
||||||
parse,
|
parse,
|
||||||
parseAsync
|
parseAsync
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,13 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.STL) return;
|
if (moto.STL) return;
|
||||||
|
|
||||||
const SP = STL.prototype;
|
const SP = STL.prototype;
|
||||||
const CDH = 'Content-Disposition';
|
const CDH = 'Content-Disposition';
|
||||||
|
|
||||||
self.moto.STL = STL;
|
moto.STL = STL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.SVG) return;
|
if (moto.SVG) return;
|
||||||
|
|
||||||
self.moto.SVG = {
|
moto.SVG = {
|
||||||
parse,
|
parse,
|
||||||
parseAsync
|
parseAsync
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
if (!self.moto) self.moto = {};
|
|
||||||
if (self.moto.URL) return;
|
let moto = self.moto = self.moto || {};
|
||||||
|
if (moto.URL) return;
|
||||||
|
|
||||||
|
moto.URL = {
|
||||||
|
load
|
||||||
|
};
|
||||||
|
|
||||||
const CDH = 'Content-Disposition';
|
const CDH = 'Content-Disposition';
|
||||||
|
|
||||||
|
|
@ -77,8 +82,4 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.moto.URL = {
|
|
||||||
load
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
* http://codeincomplete.com/posts/2011/5/7/bin_packing/
|
* http://codeincomplete.com/posts/2011/5/7/bin_packing/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (){
|
(function () {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (self.moto.Pack) return;
|
if (moto.Pack) return;
|
||||||
|
|
||||||
self.moto.Pack = Packer;
|
moto.Pack = Packer;
|
||||||
self.moto.Sort = function (a, b) {
|
moto.Sort = function (a, b) {
|
||||||
let aa = (a.w * a.h);
|
let aa = (a.w * a.h);
|
||||||
let ab = (b.w * b.h);
|
let ab = (b.w * b.h);
|
||||||
if (Math.abs(aa-ab) < 1) {
|
if (Math.abs(aa-ab) < 1) {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let MOTO = self.moto = self.moto || {},
|
||||||
|
|
||||||
let MOTO = self.moto,
|
|
||||||
WIN = window,
|
WIN = window,
|
||||||
DOC = document,
|
DOC = document,
|
||||||
SCENE = new THREE.Scene(),
|
SCENE = new THREE.Scene(),
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if (!self.moto) self.moto = {};
|
let moto = self.moto = self.moto || {};
|
||||||
if (moto.ui) return;
|
if (moto.ui) return;
|
||||||
|
|
||||||
let SELF = self,
|
let SELF = self,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue