Skip to content

Commit

Permalink
Major update to the housekeeping file to represent all boot-level fun…
Browse files Browse the repository at this point in the history
…ctions.
  • Loading branch information
bedney committed May 15, 2022
1 parent fec0748 commit 6008065
Show file tree
Hide file tree
Showing 2 changed files with 276 additions and 75 deletions.
86 changes: 43 additions & 43 deletions src/tibet/boot/tibet_loader_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1784,49 +1784,6 @@ TP.sys.getLaunchWindow = function() {

// ----------------------------------------------------------------------------

TP.sys.getHomeURL = function(checkSession) {

/**
* @method getHomeURL
* Returns the full URL string the application used as its home page.
* @param {Boolean} [checkSession=false] Whether the routine should check
* startup session parameters or not. When true the return value will
* prioritize session storage and/or session.home_page over normal
* values for project.home_page et. al. This is largely used during
* startup to get the page to load in the canvas, even though it's not
* the "standard" home page for the app.
* @returns {String} The home page URL.
*/

var homeURL;

if (checkSession && TP.topWindow.sessionStorage) {
homeURL = TP.topWindow.sessionStorage.getItem('TIBET.project.home_page');

// This is a "one time use" value. Clear after fetching.
TP.topWindow.sessionStorage.removeItem('TIBET.project.home_page');
}

// NOTE that the session.home_page value is set during startup to preserve
// any value found in session storage before clearing it to avoid incorrect
// home page computation on startup.
if (checkSession) {
homeURL = homeURL || TP.sys.cfg('session.home_page');
}

homeURL = homeURL || TP.sys.cfg('project.home_page');

if (TP.sys.cfg('lama.enabled')) {
homeURL = homeURL || TP.sys.cfg('path.lama_screen_0');
}

homeURL = homeURL || TP.sys.cfg('path.blank_page');

return homeURL;
};

// ----------------------------------------------------------------------------

TP.sys.getLaunchHost = function() {

/**
Expand Down Expand Up @@ -1881,6 +1838,49 @@ TP.sys.getLaunchScheme = function() {
return TP.sys.$scheme;
};

// ----------------------------------------------------------------------------

TP.sys.getHomeURL = function(checkSession) {

/**
* @method getHomeURL
* Returns the full URL string the application used as its home page.
* @param {Boolean} [checkSession=false] Whether the routine should check
* startup session parameters or not. When true the return value will
* prioritize session storage and/or session.home_page over normal
* values for project.home_page et. al. This is largely used during
* startup to get the page to load in the canvas, even though it's not
* the "standard" home page for the app.
* @returns {String} The home page URL.
*/

var homeURL;

if (checkSession && TP.topWindow.sessionStorage) {
homeURL = TP.topWindow.sessionStorage.getItem('TIBET.project.home_page');

// This is a "one time use" value. Clear after fetching.
TP.topWindow.sessionStorage.removeItem('TIBET.project.home_page');
}

// NOTE that the session.home_page value is set during startup to preserve
// any value found in session storage before clearing it to avoid incorrect
// home page computation on startup.
if (checkSession) {
homeURL = homeURL || TP.sys.cfg('session.home_page');
}

homeURL = homeURL || TP.sys.cfg('project.home_page');

if (TP.sys.cfg('lama.enabled')) {
homeURL = homeURL || TP.sys.cfg('path.lama_screen_0');
}

homeURL = homeURL || TP.sys.cfg('path.blank_page');

return homeURL;
};

// ============================================================================
// HTTP PRIMITIVES
// ============================================================================
Expand Down
Loading

0 comments on commit 6008065

Please sign in to comment.