index.js
function(name, title, url, setupTemplate, setup, showDevTools){
    // Check if the window already exists
    if(windowManager.windows[name]){
        console.log('Window ' + name + ' already exists!');

        // Move the focus on it
        windowManager.focusOn(name);
        return;
    }

    // The window unique name, if omitted a serialized name will be used instead; window_1 ~> window_2 ~> ...
    this.name = name || ( 'window_' + ( Object.keys(windowManager.windows).length + 1 ) );

    // The BrowserWindow module instance
    this.object = null;

    this.setup = {
        'show': false,
        'setupTemplate': setupTemplate
    };

    if(title) this.setup.title = title;
    if(url) this.setup.url = url;
    if(showDevTools) this.setup.showDevTools = showDevTools;

    // If the setup is just the window dimensions, like '500x350'
    if(isString(setup) && setup.indexOf('x') >= 0){
        const dimensions = setup.split('x');
        setup = {
            'width': parseInt(dimensions[0], 10),
            'height': parseInt(dimensions[1], 10)
        };
    }

    // Overwrite the default setup
    if(isObject(setup)){
        this.setup = Object.assign(this.setup, setup);
    }

    // Register the window on the window manager
    windowManager.windows[this.name] = this;
}
function(name, title, url, setupTemplate, setup, showDevTools){
    // Check if the window already exists
    if(windowManager.windows[name]){
        console.log('Window ' + name + ' already exists!');

        // Move the focus on it
        windowManager.focusOn(name);
        return;
    }

    // The window unique name, if omitted a serialized name will be used instead; window_1 ~> window_2 ~> ...
    this.name = name || ( 'window_' + ( Object.keys(windowManager.windows).length + 1 ) );

    // The BrowserWindow module instance
    this.object = null;

    this.setup = {
        'show': false,
        'setupTemplate': setupTemplate
    };

    if(title) this.setup.title = title;
    if(url) this.setup.url = url;
    if(showDevTools) this.setup.showDevTools = showDevTools;

    // If the setup is just the window dimensions, like '500x350'
    if(isString(setup) && setup.indexOf('x') >= 0){
        const dimensions = setup.split('x');
        setup = {
            'width': parseInt(dimensions[0], 10),
            'height': parseInt(dimensions[1], 10)
        };
    }

    // Overwrite the default setup
    if(isObject(setup)){
        this.setup = Object.assign(this.setup, setup);
    }

    // Register the window on the window manager
    windowManager.windows[this.name] = this;
}
function ( name , title , url , setupTemplate , setup , showDevTools ) { // Check if the window already exists if ( windowManager . windows [ name ] ) { console . log ( 'Window ' + name + ' already exists!' ) ; // Move the focus on it windowManager . focusOn ( name ) ; return ; } // The window unique name, if omitted a serialized name will be used instead; window_1 ~> window_2 ~> ... this . name = name || ( 'window_' + ( Object . keys ( windowManager . windows ) . length + 1 ) ) ; // The BrowserWindow module instance this . object = null ; this . setup = { 'show' : false , 'setupTemplate' : setupTemplate } ; if ( title ) this . setup . title = title ; if ( url ) this . setup . url = url ; if ( showDevTools ) this . setup . showDevTools = showDevTools ; // If the setup is just the window dimensions, like '500x350' if ( isString ( setup ) && setup . indexOf ( 'x' ) >= 0 ) { const dimensions = setup . split ( 'x' ) ; setup = { 'width' : parseInt ( dimensions [ 0 ] , 10 ) , 'height' : parseInt ( dimensions [ 1 ] , 10 ) } ; } // Overwrite the default setup if ( isObject ( setup ) ) { this . setup = Object . assign ( this . setup , setup ) ; } // Register the window on the window manager windowManager . windows [ this . name ] = this ; }
Creates a new Window instance

@param name [optional] The code name for the window, each window must have a unique name
@param title [optional] The window title
@param url [optional] The targeted page/url of the window
@param setupTemplate [optional] The name of the setup template you want to use with this new window
@param setup [optional] The setup object that will be passed to the BrowserWindow module
@param showDevTools [optional] Whether to show the dev tools or not, false by default
Creates a new Window instance