Developer

eXtern OS uses Nw.js as front-end to run Apps. Most of the documentation can be found on the official Nw.js documentation page.

There are important changes from the official Node.js API you need to know about.

  • Window.open(url, [options], [callback]) is currently not implemented yet. Although this will be implemented later, due to the UI set up of eXtern OS, it is recommended to avoid multiple windows whenever possible. You can have your app still open in multiple windows/instances by specifying this in your manifest file with:

    multi_window" : true

    See example Apps for more info

  • App.(Function here) API specified in Nw.js documentation are not supported. There is eXtern OS specific ones which will be documented here later.
  • Window.on events specified in Nw.js documentation will not be triggered. There is eXtern OS specific ones which will be documented here later.
  • Tray controls specified in Nw.js documentation will not work. There is eXtern OS specific ones which will be documented here later.
  • Window.openFiles = function(files) { }; is used to handle files “pushed” to that App. You need to do this (i.e override the function) to handle new files pushed to the app. This function can be called at anytime especially if multi_window is disabled. Here is the full example of how to use it. This might change soon, however, it is currently this way:

    win = nw.Window.get();
    win.onOpenFiles = function(files) {
    /*Handle the files array here*/
    }

    See example Apps for more info

  • Window.fileTypesApps is an array. It contains installed apps under different categories as defined here:

    fileTypesApps = {
    audio : [],
    video : [],
    image : [],
    text : [],
    web : [] }

    See example Apps for more info

  • Window.fileTypesApps.prefferedFileTypesApps is an array (a sub-array). It contains installed apps that are preffered for each corresponding category. It is defined the same as the parent array Window.fileTypesApps with different categories as defined here:

    fileTypesApps.prefferedFileTypesApps = {
    audio : [],
    video : [],
    image : [],
    text : [],
    web : [] }

    See example Apps for more info

  • Window.openApp(AppId, [files]) is a function that handles opening files using a specified App. Files should be an array even if it is only a single file. One way to accomplish this can be done like this:

    win = nw.Window.get();
    var files = [] files.push(file);
    var requiredApps = win.fileTypesApps.prefferedFileTypesApps;
    win.openApp(requiredApps.web.id,files);

    See example Apps for more info

DevKit

In order to create eXtern compatible apps, you need to create an eXtern App project or open one using the DevKit.

UI Elements

DevKit will have almost all of the important UI elements defined in Beta 2. The UI uses stylized bootstrap theme, so as a rule of thumb, a bootstrap element, plugin etc will work well with eXtern. Check this page in the next couple of days for sample apps. However, here are a few important ones:

  • Buttons


    <!--a tag/link based button. An example of a large button using the "btn-lg" class -->
    <a class="btn btn-alt btn-lg"> Hello </a>

    <!-- Button tag based button -->
    <button class="btn btn-alt m-r-5"> Hello </button>

    See example Apps for more info

This page is still under construction. Please come and check back next week.