Here you can add your own custom programs to the minimos11 Desktop also accesable with code Desktop
.
Note: This feature will be available in the next version of the minimos11 website. May release on 16th or 17th.
First create a function with your program name keep it all lowercase so it can be run by the run dialog and should be unique from any other program. I also recommend for concistancy to also use it as the window ID and keep it short like on or two short words.
Then you have too create a window.
Here is a basic template to create a window:
function myprogram(){
generateWindow("", "myprogram", "My program", "/resources/code-sub-pages/window.ico", "");
document.querySelector('#myprogram .window-body').innerHTML = "<h3>My sweet program</h3>";
let window = document.getElementById('myprogram');
window.style.height = "170px";
window.style.width = "180px";
}
To create a window the first thing your gone have to call is the generate window API/function.
generateWindow("1.", "2. The window ID", "3. The window Title", " 4. The window icon source", "5. window ctrl buttons");
0
= no controls. 1
= only close button.)To set the height and width use:
let window = document.getElementById('myprogram');
window.style.height = "170px";
window.style.width = "180px";
You can also add any other styles if necessary. And don’t forget to replace ‘myprogram’
To access your window’s content and add more use: document.querySelector('#myprogram .window-body')
And replace the #myprogram with your window ID.
You can use .inerHTML
or .insertAdjacentHTML
depending on how you want to do it.
When it gets added to the main branch you can access the program by typing the function name of the program in the run dialog. And it will run the function if it exists.
Open dev tools and add:
<script>
// Your function here.
</script>
Some where in the Desktop’s page document. And type you functions name in the run dialog.
Message box:
messageBox(1. message, 2. type);
error
,.