Use the internal framework in another projects
How to use our internaljs framework in other projects
Section titled “How to use our internaljs framework in other projects”- Copy
internal.jsin that project - Copy
custom.jsin that project - Call
init_template()(orload_page()) onDOMContentLoadedso the framework can register inputs, dropdowns, clickables, etc.
<script src="scripts/internal.js"></script><script src="scripts/custom.js"></script><script> document.addEventListener("DOMContentLoaded", init_template);</script>Making inputbox() Work
Section titled “Making inputbox() Work”- Element id must start with
input_, e.g.
<input id="input_crop_name" />- Add a data-validate attribute (even an empty rules array) so
load_input()creates an entry instructure.inputsandinput_enforceRules()keeps current_value in sync:
<input id="input_crop_name" data-validate='{"rules":[],"show_ok":false,"show_error":false,"valid":false}' placeholder="Enter name"/>- Once those conditions are met:
const value = inputbox("input_crop_name").getValue();inputbox("input_crop_name").setValue("New name");