1 /*jshint bitwise:true, indent:2, curly:true, eqeqeq:true, immed:true,
2 latedef:true, newcap:true, noarg:true, regexp:true, undef:true,
3 trailing:true, white:true*/
4 /*global XT:true, enyo:true, window:true, location: true */
6 XT = typeof XT !== 'undefined' ? XT : {};
10 XT.getBaseUrl = function () {
11 return location.protocol + "//" + location.hostname + (location.port && ":" + location.port);
14 XT.getOrganizationPath = function () {
15 return "/" + window.location.pathname.split("/")[1];
18 XT.logout = function () {
19 if (window.onbeforeunload) {
20 // if we've set up a "are you sure you want to leave?" warning, disable that
21 // here. Presumably we've already asked if they want to leave.
22 // delete window.onbeforeunload; // doesn't work
23 window.onbeforeunload = undefined;
25 window.location = XT.getOrganizationPath() + "/logout";
28 XT.setVersion = function (version, qualifier) {
29 XT.log("XT.setVersion is now deprecated. The app now reads extension versions from " +
30 "package.json or manifest.js (" + qualifier + ")");