complete api mapping
This commit is contained in:
parent
e506d75b63
commit
683c117bcd
5 changed files with 25 additions and 26 deletions
|
|
@ -18,9 +18,10 @@ gapp.register("kiri-mode.cam.tools", (root, exports) => {
|
|||
|
||||
api.show.tools = showTools;
|
||||
|
||||
api.tool = {
|
||||
// extend API
|
||||
Object.assign(api.tool, {
|
||||
update: updateTool
|
||||
};
|
||||
});
|
||||
|
||||
function settings() {
|
||||
return api.conf.get();
|
||||
|
|
|
|||
|
|
@ -67,10 +67,11 @@ function update(clear) {
|
|||
}
|
||||
}
|
||||
|
||||
api.alerts = {
|
||||
// extend API
|
||||
Object.assign(api.alerts, {
|
||||
hide,
|
||||
show,
|
||||
update
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ let { data, kiri, moto, noop } = root,
|
|||
und = undefined,
|
||||
api = exports({
|
||||
ajax, // via utils
|
||||
alerts: {}, // alerts.js
|
||||
busy: {}, // main.js
|
||||
catalog: und, // main.js
|
||||
clip, // <--
|
||||
|
|
@ -81,12 +82,13 @@ let { data, kiri, moto, noop } = root,
|
|||
color: und, // main.js
|
||||
conf: {}, // settings.js
|
||||
const: {}, // main.js
|
||||
devel, // <--
|
||||
device: {}, // devices.js
|
||||
devices: {}, // devices.js
|
||||
dialog: {}, // main.js
|
||||
doit, // <--
|
||||
devel, // <--
|
||||
event: {}, // main.js
|
||||
feature, // <--
|
||||
focus: noop,
|
||||
function: {}, // function.js
|
||||
group: {}, // main.js
|
||||
help: {}, // main.js
|
||||
|
|
@ -94,8 +96,8 @@ let { data, kiri, moto, noop } = root,
|
|||
image: {}, // main.js
|
||||
js2o, // via utils
|
||||
language: und, // main.js
|
||||
local, // <--
|
||||
lists, // <--
|
||||
local, // <--
|
||||
modal: {}, // main.js
|
||||
mode: {}, // main.js
|
||||
o2js, // via utils
|
||||
|
|
@ -107,6 +109,8 @@ let { data, kiri, moto, noop } = root,
|
|||
settings: {}, // settings.js
|
||||
show: {}, // main.js
|
||||
space: {}, // main.js
|
||||
tool: {}, // kiri-mode/cam/tools.js
|
||||
tweak, // <--
|
||||
uc: {}, // main.js
|
||||
ui: {}, // main.js
|
||||
util: {}, // main.js
|
||||
|
|
@ -116,7 +120,6 @@ let { data, kiri, moto, noop } = root,
|
|||
layer_max: 0
|
||||
},
|
||||
view: {}, // main.js
|
||||
tweak,
|
||||
widgets: {}, // widgets.js
|
||||
work: und, // main.js
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,21 +9,25 @@ gapp.register("kiri.devices", (root, exports) => {
|
|||
let { kiri } = root,
|
||||
{ api, conf } = kiri;
|
||||
|
||||
api.show.devices = showDevices;
|
||||
// extend API
|
||||
Object.assign(api.show, {
|
||||
showDevices
|
||||
});
|
||||
|
||||
api.device = {
|
||||
Object.assign(api.device, {
|
||||
clone: cloneDevice,
|
||||
code: currentDeviceCode,
|
||||
get: currentDeviceName,
|
||||
set: selectDevice,
|
||||
isBelt
|
||||
};
|
||||
});
|
||||
|
||||
api.devices = {
|
||||
Object.assign(api.devices, {
|
||||
show: showDevices,
|
||||
select: selectDevice,
|
||||
refresh: updateDeviceList
|
||||
};
|
||||
refresh: updateDeviceList,
|
||||
update_laser_state: updateLaserState
|
||||
});
|
||||
|
||||
function isBelt() {
|
||||
return api.conf.get().device.bedBelt;
|
||||
|
|
|
|||
|
|
@ -214,16 +214,6 @@ gapp.register("kiri.init", (root, exports) => {
|
|||
}, 100);
|
||||
}
|
||||
|
||||
function parentWithClass(el, classname) {
|
||||
while (el) {
|
||||
if (el.classList.contains(classname)) {
|
||||
return el;
|
||||
}
|
||||
el = el.parentNode;
|
||||
}
|
||||
return el;
|
||||
}
|
||||
|
||||
function onBooleanClick(el) {
|
||||
// copy some ui elements to target settings
|
||||
let settings = api.conf.get();
|
||||
|
|
@ -236,7 +226,7 @@ gapp.register("kiri.init", (root, exports) => {
|
|||
api.conf.update();
|
||||
DOC.activeElement.blur();
|
||||
api.event.emit("boolean.click");
|
||||
updateLaserState();
|
||||
api.devices.update_laser_state();
|
||||
if (el === ui.camStockIndexed) {
|
||||
api.space.set_focus();
|
||||
}
|
||||
|
|
@ -763,7 +753,7 @@ gapp.register("kiri.init", (root, exports) => {
|
|||
}
|
||||
|
||||
function isBelt() {
|
||||
return api.device.isBelt;
|
||||
return api.device.isBelt();
|
||||
}
|
||||
|
||||
function isNotBelt() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue