Closed andersevenrud closed 8 years ago
@andersevenrud First what is the directory structure? Is API intended to be 'subclassed' or is it more on the procedural level, and is there a client and server implementation of each api?
@andersevenrud I would really love to get started working on the project. (I actually just started basically the same thing until I found this)
@RyanRiffle It's pretty simple. You have:
src/javascript
The thing you load in your browser. Split up into appropriate subfolders src/server-php
PHP Server implementationsrc/server-node
Node Server implementationThe server part of OS.js is extremely simple. You pretty much just have to serve the css and js files and have support for calling some sort of API. In this case it is VFS (filesystem functions), Core (like login, logout, etc) and Application (applications have isolated APIs).
The server API is built so you can basically plug-in your own functions. Example (pseudo-code):
# Server code
API::addHandler('MyFunction', callback);
# Frontend code
API::call('MyFunction', args, callback);
@RyanRiffle To further go into serving files. Currently OS.js does this with HTTP, including the Virtual File System (downloading and uploading of files in browser. Like using REST). This is probably completely obvious since it's served via HTML, but I thought I should mention it.
@andersevenrud Thanks! I am looking over the code now, if I have any questions I'll ask. I might have a few :smile:
@RyanRiffle In case you have not figured it out, look at this wiki document that explains the difference between the dist
directories. Using dist-dev
is pretty much required if you're going in there with a debugger in your browser to get a feel of things.
Looking forward to any questions you might have :sweat_smile:
@andersevenrud What is the primary goal of OS.js? Is it to be interfaced with virtual machine, just use the user's dropbox, drive, etc, a desktop environment for X11 or even all of the above?
@RyanRiffle All of the above :) It has a pretty long history but has evolved to do all of this. After the introduction of Broadway (#29) you can run this as an X11 environment or even use it as remote desktop in your browser (ala VNC). Not to toot my own horn, but I think that is pretty cool.
@andersevenrud That is pretty amazing. I plan on helping as much as I can, but starting January 20th I will be unable to access a computer for a minimum of two months, but I will come back. This is something I have wanted to do for a while now.
@RyanRiffle I wrote VLC in the last comment, but I meant VNC (corrected). This is something I started experimenting with as a teenager (IE5. shudders), but browser tech was not just there yet. So for me; this is pretty exiting too! Just take your time -- I'll be here (unless death himself has me on his list) :smile:
@andersevenrud What are you thoughts on a toolbar dropdown? I do not see one. The only thing is see that might be a problem is that toolbar.js just handles an object of (title, icon, and toggleable) and puts them in a ul then hooks up the event callbacks. It looks to me that if toolbar handled objects of the prototype OSjs.GUI._Input the toolbar would be more versatile and abstract away the DOM a little better. Thoughts?
@RyanRiffle Actually, you can add whatever you want to the toolbar. Again... my bad on the documentation here.
var self = this;
toolbar.addItem('Name', {
type: 'custom',
onCreate: function(toolbarRef, itemName, itemOptions, outerEl, containerEl) {
// Here you can add DOM elements to `containerEl`
// Or just OS.js GUI Elements
self._addGUIElement(new GUI.Select(...), containerEl);
}
});
I see. Thank you. I need to look a little harder :smile:
@RyanRiffle Thank you for this. So many people have contacted me saying they want to (and will) create some apps, but then it goes totally silent. Either my code is too scary, ugly or way to undocumented. AFAIK I'm using relatively well known JS patterns and try to be as explicit as possible. It may be a combination of all the above :p Getting to my point: This really helps me make changes that makes approacing OS.js easier.
@andersevenrud Not a problem. The documentation is a little of a throw off. My question is what doc generator do you use or want to use on the project (for when I start trying to help add some more documentation)?
@RyanRiffle Basically, there is none. I want to wait unti I have gotten some feedback so I can solidify the API and base code. I don't like re-writing docs -- it's a mess (Frequently occurs at work)!
I have not desided what generator to use yet. To be honest, I don't like any of the ones I have tried. If you know of a good one, let me know. In the past I have just rolled my own.
@andersevenrud I just looked and I am really not impressed with any either. Poe uses codo, very simple and crude but effective, but it is only for coffeescript.
@RyanRiffle I just commited some docu for 'core.js'. If you look at it I have added some very simple comments that I can easily prase with a script. I might go that way
@RyanRiffle You probably know this, but to get an overview over the entire API, just open your JavaScript console in the browser and type in "OSjs" and press enter. From there you can see the entire API tree. When you enter a class just expand the "prototype" leaf to see all the class methods
@andersevenrud Yea I know. Thanks anyway
Is GUI.Select meant to not show the currently selected value? Even with an option having the "selected" attribute it does not show any value.
@RyanRiffle Not sure I understand. GUI.Select.setValue() ?
I am not using the DOM attribute, but rather "selectedIndex" property. Example code:
select.addItem("myvalue", "My Label");
select.setValue("myvalue");
var val = select.getValue(); // == "myvalue"
Yes,
@fontSelect = new OSjs.GUI.Select("FontSelect", {onChange: @fontSelectClicked});
for (font in OSjs.API.getHandlerInstance().getConfig('Fonts').list)
@fontSelect.addItem(font, font);
@fontSelect.setValue(OSjs.API.getHandlerInstance().getConfig('Fonts')['default']);
Maybe it is because it has not been added to DOM at that moment? Kinda puzzled here.
Try:
@fontSelect = window._addGUIElement(new OSjs.GUI.Select("FontSelect", {onChange: @fontSelectClicked}), parentDOMElement);
Where window
is a OS.js Windows and not the global
I have that. I just omitted it. It is in the DOM, it is in the picture. And toolbar.render() is called before even the loop that adds the items.
How does it look inside of the <select>
. Does it have <option>
s ?
Yes options are there, that is why I tried to set the selected attribute on one of them. Im puzzled
I'm going to try this for myself now. Hang on!
Lol. It's because the outer container for GUISelect is too small.
My test:
var select;
var toolbar = this._addGUIElement(new GUI.ToolBar('TestToolbar'), root);
toolbar.addItem('CustomItem', {
type: 'custom',
onCreate: function(itemName, itemOptions, outerEl, containerEl) {
select = self._addGUIElement(new GUI.Select('TestSelect'), containerEl);
select.addItem('foo', 'Foo');
select.addItem('bar', 'Bar');
}
});
toolbar.render();
And then in CSS
.Window_ApplicationsupertestWindow .GUISelect.TestSelect {
width : 100px;
}
I wondered about that :) Good that it is all figured out.
I should maybe enforce some rules on minimum sizes of all GUI Elements
Yea that would work.
Hi all.
Its posible to make start menu (Touch friendly) like this?
@PewienTyp Sure. I can do that :smile: Just opened an issue for this: #61
when i run os.js in chromium/nw.js on ubuntu and debian after 5 seconds system lagg and crash. I don't know why. Works only in firefox.
Maybe a bug ? Sounds like a memory leak! I had similar problems with semalt.com in Linux/Chromium!
Chrome bug I mean
@PewienTyp Just tested latest Chromium on Ubuntu 14. No problems here :/
Maybe my testing pc was crazy :)
@PewienTyp Yeah. I've experienced something similar a couple of times, but never found out why. To me it feels like a memory leak or a corruption caused by Webkit (this one time everything just froze and a buzzing sound came out of my speakers... like when a game crashes). If it occurs again, maybe you could take a look in syslog to see if any errors occured and paste it here ? Just if you can and want to, that is :)
I'll give this a run through the ringer tonight. If I can spot an issue with it, I'll open an issue. Might be worth trying with gremlins.js
Please add fadeIn effect to notifications
@PewienTyp Thanks! Created new issue: #64
Its possible to make login screen with sessions?
@PewienTyp Yes. There is an example included for this :smile:
src/javascript/handlers/example/handler.js
src/server-php/handlers/example/handler.php
doc/example-handler.txt
http://andersevenrud.github.io/OS.js-v2/doc/tutorials/create-handler.html
@PewienTyp Ops. I had not pushed the latest changes to the tutorial. It has been updated
http://andersevenrud.github.io/OS.js-v2/doc/tutorials/create-handler.html
This is an issue for general discussion and problem sovling. You can also post your submissions here if you're not into pull requests and such.
Join the official chat room on Gitter :)
FAQ
First, look through the documentation and see if you can find anything that might help you :)
Make sure you follow the installation documentation to the letter.
Make sure dependencies are installed! If you are running on Windows, make sure to run the symlink script (as described in INSTALL).
If something fails, you will get console output of it (press F12 and go to Console). If some files fails to load, chances are building has failed (or you forgot).
If the server fails you will get an error printout (apache users, see error_log).
There actually is one, but kind of obscured by its name "example" and the fact I have not found any time to finish it 100% (but it works fine).
http://os.js.org/doc/tutorials/create-handler.html
An example, here: https://gist.github.com/andersevenrud/c2e84548a3c0af8c7150