Slider: vim auto format - no functional change
parent
8e6b9c7308
commit
31a6de6e3f
|
|
@ -1,16 +1,16 @@
|
|||
try { // for making it possiblie to run the test app in the following catch statement. It would complain on `exports` not being defined.
|
||||
|
||||
exports.create = function(cb, conf) {
|
||||
exports.create = function(cb, conf) {
|
||||
|
||||
const R = Bangle.appRect;
|
||||
const R = Bangle.appRect;
|
||||
|
||||
let o = {};
|
||||
o.v = {}; // variables go here.
|
||||
o.f = {}; // functions go here.
|
||||
let o = {};
|
||||
o.v = {}; // variables go here.
|
||||
o.f = {}; // functions go here.
|
||||
|
||||
// configuration for the indicator:
|
||||
// configuration for the indicator:
|
||||
|
||||
o.c = Object.assign({ // constants go here.
|
||||
o.c = Object.assign({ // constants go here.
|
||||
useMap:false,
|
||||
useIncr:true,
|
||||
horizontal:false,
|
||||
|
|
@ -35,18 +35,18 @@ o.c = Object.assign({ // constants go here.
|
|||
dragableSlider:true,
|
||||
currLevel:undefined,
|
||||
dragRect:R,
|
||||
},conf);
|
||||
},conf);
|
||||
|
||||
let totalBorderSize = o.c.outerBorderSize + o.c.innerBorderSize;
|
||||
o.c._xStart = o.c.xStart + totalBorderSize;
|
||||
o.c._width = o.c.width - 2*totalBorderSize;
|
||||
o.c._yStart = o.c.yStart + totalBorderSize;
|
||||
o.c._height = o.c.height - 2*totalBorderSize;
|
||||
if (o.c.rounded) o.c.rounded = 40;
|
||||
let totalBorderSize = o.c.outerBorderSize + o.c.innerBorderSize;
|
||||
o.c._xStart = o.c.xStart + totalBorderSize;
|
||||
o.c._width = o.c.width - 2*totalBorderSize;
|
||||
o.c._yStart = o.c.yStart + totalBorderSize;
|
||||
o.c._height = o.c.height - 2*totalBorderSize;
|
||||
if (o.c.rounded) o.c.rounded = 40;
|
||||
|
||||
o.c.STEP_SIZE = o.c._height/o.c.steps;
|
||||
o.c.STEP_SIZE = o.c._height/o.c.steps;
|
||||
|
||||
if (o.c.horizontal) {
|
||||
if (o.c.horizontal) {
|
||||
let mediator = o.c._xStart;
|
||||
o.c._xStart = o.c._yStart;
|
||||
o.c._yStart = mediator;
|
||||
|
|
@ -61,18 +61,18 @@ if (o.c.horizontal) {
|
|||
o.c.width = o.c.height;
|
||||
o.c.height = mediator;
|
||||
delete mediator;
|
||||
}
|
||||
}
|
||||
|
||||
o.c.r = {x:o.c.xStart, y:o.c.yStart, x2:o.c.xStart+o.c.width, y2:o.c.yStart+o.c.height, w:o.c.width, h:o.c.height};
|
||||
o.c.r = {x:o.c.xStart, y:o.c.yStart, x2:o.c.xStart+o.c.width, y2:o.c.yStart+o.c.height, w:o.c.width, h:o.c.height};
|
||||
|
||||
// Initialize the level
|
||||
o.v.level = (o.c.currLevel||o.c.currLevel===0)?o.c.currLevel:o.c.steps/2;
|
||||
// Initialize the level
|
||||
o.v.level = (o.c.currLevel||o.c.currLevel===0)?o.c.currLevel:o.c.steps/2;
|
||||
|
||||
o.v.firstRun = true;
|
||||
o.v.ebLast = 0;
|
||||
o.v.dy = 0;
|
||||
o.v.firstRun = true;
|
||||
o.v.ebLast = 0;
|
||||
o.v.dy = 0;
|
||||
|
||||
if (o.c.dragableSlider) {
|
||||
if (o.c.dragableSlider) {
|
||||
o.f.wasOnDragRect = (exFirst, eyFirst)=>{
|
||||
"ram";
|
||||
return exFirst>o.c.dragRect.x && exFirst<o.c.dragRect.x2 && eyFirst>o.c.dragRect.y && eyFirst<o.c.dragRect.y2;
|
||||
|
|
@ -133,9 +133,9 @@ if (o.c.dragableSlider) {
|
|||
o.v.dragActive = false;
|
||||
cb("remove", o.v.prevLevel);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (o.c.drawableSlider) {
|
||||
if (o.c.drawableSlider) {
|
||||
|
||||
o.f.updateBar = (levelHeight)=>{
|
||||
"ram";
|
||||
|
|
@ -165,9 +165,9 @@ if (o.c.drawableSlider) {
|
|||
//print(level);
|
||||
//print(process.memory().usage);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (o.c.autoProgress) {
|
||||
if (o.c.autoProgress) {
|
||||
o.v.shouldAutoDraw = true;
|
||||
o.f.autoUpdate = ()=>{
|
||||
//if (o.v.level===undefined) o.v.level = -1;
|
||||
|
|
@ -182,15 +182,15 @@ if (o.c.autoProgress) {
|
|||
o.v.autoIntervalID = setInterval(o.f.autoUpdate,1000);
|
||||
};
|
||||
o.f.stopAutoUpdate = ()=>{if (o.v.autoIntervalID) {clearInterval(o.v.autoIntervalID); o.v.autoIntervalID = undefined;}};
|
||||
}
|
||||
}
|
||||
|
||||
//o.f.printThis = ()=>(print(this));
|
||||
//o.f.printThis = ()=>(print(this));
|
||||
|
||||
return o;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
print(e);
|
||||
let appName = "spotrem";
|
||||
eval(require("Storage").read(appName+".app.js"));
|
||||
print(e);
|
||||
let appName = "spotrem";
|
||||
eval(require("Storage").read(appName+".app.js"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue