Your very first Friend app

First of all, apps in the Friend Operating System are written in JavaScript – so no new language has to be learned.

We have kept the classes and standards in Friend open, so all you favourite frameworks will work just like they do outside of Friend. You can use jQuery, React, Bootstrap etc.

The Friend Workspace itself does not use any of these libraries. It comes with its own set of classes to provide a rich and unique API for application developers.

Application.fun = function( msg )
{

}

A very basic Friend app consists of a JavaScript Executable (jsx) file and a template for the HTML markup.

example.jsx

/* Simple example program for templates and windows */

// This is the main run function for jsx files and FriendUP js apps
Application.run = function( msg )
{
    // Make a new window with some flags
    var v = new View( {
        title: 'Welcome to FriendUP!',
        width: 640,
        height: 500
    } );

    // Load a file from the same dir as the jsx file is located
    var f = new File( 'Progdir:Template.html' );
    f.onLoad = function( data )
    {
        // Set it as window content
        v.setContent( data );
    }
    f.load();

    // On closing the window, quit.
    v.onClose = function()
    {
        Application.quit();
    }
}

A very simple template could look like this:

Template.html

<div id="windowRoot">
    <h1>
        Welcome to FriendUP! på siste fredagen i sept
    </h1>
    <div class="Box Padding">
        This is your first application!
        <textarea style="width:100%; min-height:200px;"></textarea>
    </div>
</div>

As you can see


Was this page helpful?