mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-21 00:58:10 -07:00
JS: Sync small differences from OFW PR
This commit is contained in:
@@ -59,7 +59,7 @@ eventLoop.subscribe(views.dialog.input, function (_sub, button, eventLoop, gui)
|
||||
notify.error();
|
||||
}
|
||||
|
||||
// Optional, but allows to interchange with usbdisk
|
||||
// Optional, but allows to unlock usb interface to switch profile
|
||||
badusb.quit();
|
||||
|
||||
eventLoop.stop();
|
||||
|
||||
@@ -80,6 +80,7 @@ eventLoop.subscribe(views.demos.chosen, function (_sub, index, gui, eventLoop, v
|
||||
|
||||
// say hi after keyboard input
|
||||
eventLoop.subscribe(views.keyboard.input, function (_sub, name, gui, views) {
|
||||
views.keyboard.set("defaultText", name); // Remember for next usage
|
||||
views.helloDialog.set("text", "Hi " + name + "! :)");
|
||||
views.helloDialog.set("center", "Hi Flipper! :)");
|
||||
gui.viewDispatcher.switchTo(views.helloDialog);
|
||||
|
||||
@@ -6,4 +6,4 @@ if (storage.fileExists(__dirpath + "/math.js")) {
|
||||
print("math.js exist here.");
|
||||
} else {
|
||||
print("math.js does not exist here.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ storage.remove(path);
|
||||
|
||||
print("Done")
|
||||
|
||||
// You don't need to close the file after each operation, this is just to show some different ways to use
|
||||
// There's also many more functions and options, check types docs in firmware repo
|
||||
// You don't need to close the file after each operation, this is just to show some different ways to use the API
|
||||
// There's also many more functions and options, check type definitions in firmware repo
|
||||
@@ -49,7 +49,6 @@ static bool max_len_assign(
|
||||
JsViewPropValue value,
|
||||
JsKbdContext* context) {
|
||||
UNUSED(mjs);
|
||||
UNUSED(input);
|
||||
context->buffer_size = (size_t)(value.number + 1);
|
||||
context->buffer = realloc(context->buffer, context->buffer_size); //-V701
|
||||
text_input_set_result_callback(
|
||||
|
||||
+1
-1
@@ -102,6 +102,6 @@ export declare function altPrint(string: string, delay?: number): void;
|
||||
export declare function altPrintln(string: string, delay?: number): void;
|
||||
|
||||
/**
|
||||
* @brief Releases usb, optional, but allows to interchange with usbdisk
|
||||
* @brief Releases usb, optional, but allows to switch usb profile
|
||||
*/
|
||||
export declare function quit(): void;
|
||||
|
||||
@@ -17,7 +17,14 @@ export declare class View<Props extends Properties> {
|
||||
}
|
||||
|
||||
export declare class ViewFactory<Props extends Properties, V extends View<Props>> {
|
||||
/**
|
||||
* Create view instance with default values, can be changed later with set()
|
||||
*/
|
||||
make(): V;
|
||||
/**
|
||||
* Create view instance with custom values, can be changed later with set()
|
||||
* @param initial Dictionary of property names to values
|
||||
*/
|
||||
makeWith(initial: Partial<Props>): V;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user