/* This file is part of AToMPM - A Tool for Multi-Paradigm Modelling * Copyright 2011 by the AToMPM team and licensed under the LGPL * See COPYING.lesser and README.md in the root of this project for full details */ /////////////////////////////////////////////////////////////////////////////// // DEPRECATED FUNCTIONS /////////////////////////////////////////////////////////////////////////////// function _openDialog(type, args, callback){ AtomPMClient.alertDeprecatedFunctionCall("_openDialog"); WindowManagement.openDialog(type, args, callback); } function _spawnClient(fname,callbackURL){ AtomPMClient.alertDeprecatedFunctionCall("_spawnClient"); WindowManagement.spawnClient(fname, callbackURL); } function _spawnHeadlessClient(context,onready,onchlog){ AtomPMClient.alertDeprecatedFunctionCall("_spawnHeadlessClient"); WindowManagement.spawnHeadlessClient(context, onready, onchlog); } function __showDialog(){ alert(AtomPMClient); AtomPMClient.alertDeprecatedFunctionCall("__showDialog"); WindowManagement.showDialog(); } function __closeDialog(){ AtomPMClient.alertDeprecatedFunctionCall("__closeDialog"); WindowManagement.closeDialog(); } /////////////////////////////////////////////////////////////////////////////// //DEPRECATED FUNCTIONS /////////////////////////////////////////////////////////////////////////////// var __dialog_stack = []; WindowManagement = function(){ /** * Hides the login screen */ this.hideLoginScreen = function() { //$('#div_login').style.display = 'none'; $('#div_login').css('display', 'none'); __setCanvasScrolling(true); }; /** * Shows the login screen */ this.showLoginScreen = function() { //$('#div_login').style.display = 'inline'; $('#div_login').css('display', 'inline'); __setCanvasScrolling(false); }; this.showAboutDialog = function () { let create_about = function (status, text) { let version = null; let time_at = null; if (utils.isHttpSuccessCode(status)) { let resp = JSON.parse(text); version = resp['tag_name']; time_at = resp['published_at']; time_at = time_at.split("T")[0]; } let title = "About AToMPM"; let elements = []; let website = "Website and Tutorials"; elements.push(GUIUtils.getTextSpan(website)); let doc_website = "Documentation"; elements.push(GUIUtils.getTextSpan(doc_website)); let curr_version_str = "Current Version: " + __VERSION__; elements.push(GUIUtils.getTextSpan(curr_version_str)); elements.push(GUIUtils.getTextSpan("\n")); if (version != null) { let new_version_str = "Newest Version: " + version; elements.push(GUIUtils.getTextSpan(new_version_str)); let time_at_str = "Released on: " + time_at; elements.push(GUIUtils.getTextSpan(time_at_str)); } GUIUtils.setupAndShowDialog( elements, null, __ONE_BUTTON, title, null); }; HttpUtils.httpReq("GET", "https://api.github.com/repos/AToMPM/atompm/releases/latest", null, create_about); }; //Todo: Shred this function into smaller functions, as this should // really just amount to a switch statement //TBI: complete comments about each dialog (copy from user's manual) /** * Opens a general dialog window */ this.openDialog = function(type,args,callback) { args = args || {}; function error(err,fatal) { console.error("Error! " + err); GUIUtils.setupAndShowDialog( [GUIUtils.getTextSpan( err, 'error')], undefined, (fatal ? __NO_BUTTONS : __ONE_BUTTON), (fatal ? 'FATAL ERROR (restart required)' : 'ERROR')); //console.error(err,args); } // TODO: Fix this, convert to JQuery if( type == _CLOUD_DATA_MANAGER ) /* args: extensions,readonly,title */ { HttpUtils.httpReq( 'GET', HttpUtils.url('/filelist',__NO_WID), undefined, function(statusCode,resp){ var fnames = __localizeFilenames( __filterFilenamesByExtension( resp.split('\n'), args['extensions'] || ['.*'])).sort(), maxFnameLength = utils.max(fnames, function(_) { return _.length; }), fileb = FileBrowser.getFileBrowser(fnames,true), feedbackarea = $('