﻿var settingsObject = JSON.parse(jsonBlob);

var resultObject = {};



var basePath = settingsObject.PLUGIN_PATH + "/res/";



var buildDialog = function(settings, result)

{

    dialogLayout =

    """dialog {

        settings: Panel { orientation:'column',

            alignment: ['fill', 'fill']

        },

        buttons: Group { orientation: 'row', alignment: 'middle',

            closeButton: Button { text: '""" + localize(_strings.BTN_CLOSE) + """', properties:{name:'close'} },

        }

    }""";



    var dialog = new Window(dialogLayout, localize(_strings.STR_TITLE));



    dialog.settings.add ("statictext", undefined, localize(_strings.STR_VERSION, settingsObject.MAJOR_VERSION, settingsObject.MINOR_VERSION, settingsObject.BUG_VERSION));  



    dialog.player = dialog.settings.add ("flashplayer", undefined, File(basePath + "swf/logo.swf"));    

    dialog.player.alignment = 'fill';

    dialog.player.maximumSize = [270, 152];   



    dialog.webBtn = dialog.settings.add ("button", undefined,  localize(_strings.STR_ONLINE));    

    dialog.webBtn.alignment = 'fill';

    dialog.webBtn.maximumSize = [270, 30];



    dialog.webBtn.onClick = function() 

    {

        File(basePath + "html/redirect.html").execute();

    };



    dialog.sct = dialog.settings.add ("edittext",  undefined, localize(_strings.STR_ABOUTTXT), {multiline:true, scrolling:true,readonly:true});



    dialog.sct.alignment = 'fill';

    dialog.sct.scrolling = true;

    dialog.sct.size = [270, 150];



    dialog.buttons.closeButton.onClick = function() 

    {

        dialog.close(0);

    };



    return dialog; 

};



var dialog = buildDialog(settingsObject, resultObject);



dialog.show();