normalize moto module header

This commit is contained in:
Stewart Allen 2021-12-26 22:49:41 -05:00
commit 8927501eca
11 changed files with 40 additions and 42 deletions

View file

@ -4,14 +4,12 @@
(function() {
if (!self.moto) self.moto = {};
if (self.moto.Ajax) return;
let moto = self.moto = self.moto || {};
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);
};
@ -21,7 +19,7 @@
TIME = function() { return new Date().getTime() },
MOKEY = moto.id = KV.getItem(KEY) || (TIME().toString(36)+rnd()+rnd());
MOTO.restore = function(id) {
moto.restore = function(id) {
MOKEY = moto.id = id;
KV.setItem(KEY, MOKEY);
}