mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Webpack: remove libs and history apps, grunt:pack scripts
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
var GalaxyMasthead=require("../galaxy.masthead").GalaxyMasthead,GalaxyMenu=require("../galaxy.menu").GalaxyMenu,History=require("../mvc/history/history-model").History,HistoryPanelEdit=require("../mvc/history/history-panel-edit").HistoryPanelEdit;window.app=function(a,b){if(!Galaxy.masthead||!Galaxy.menu){var c=_.extend(_.clone(Galaxy.config),{user:{requests:Galaxy.currUser.get("requests"),email:Galaxy.currUser.get("email"),valid:Galaxy.currUser.isAnonymous(),json:Galaxy.currUser.toJSON()}});Galaxy.masthead=new GalaxyMasthead(c),Galaxy.menu=new GalaxyMenu({masthead:Galaxy.masthead,config:c}),console.debug(Galaxy.masthead),console.debug(Galaxy.menu)}return b=b||{},window.panel=new HistoryPanelEdit({show_deleted:b.show_deleted,show_hidden:b.show_deleted,purgeAllowed:Galaxy.config.allow_user_dataset_purge,model:new History(b.history,b.contents)}),$(function(){panel.render().$el.appendTo((a||{}).panelLoc||"body")}),panel};
|
||||
//# sourceMappingURL=../../maps/apps/history-app.js.map
|
||||
@@ -1,2 +0,0 @@
|
||||
var libExports=require("../libs/common-libs.js");exports=libExports;
|
||||
//# sourceMappingURL=../../maps/apps/libs.js.map
|
||||
@@ -1,104 +1,2 @@
|
||||
define([ "libs/underscore", "libs/backbone", "mvc/base-mvc", "mvc/user/user-model", "utils/metrics-logger", "utils/add-logging", "utils/localization" ], function(_, Backbone, BASE_MVC, userModel, metricsLogger, addLogging, localize) {
|
||||
function GalaxyApp(options, bootstrapped) {
|
||||
console.debug("GalaxyApp:", options, bootstrapped);
|
||||
var self = this;
|
||||
return self._init(options || {}, bootstrapped || {});
|
||||
}
|
||||
addLogging(GalaxyApp, "GalaxyApp");
|
||||
var DEBUGGING_KEY = "galaxy:debug", NAMESPACE_KEY = DEBUGGING_KEY + ":namespaces", localDebugging = !1;
|
||||
try {
|
||||
localDebugging = "true" == localStorage.getItem(DEBUGGING_KEY);
|
||||
} catch (storageErr) {
|
||||
console.log(localize("localStorage not available for debug flag retrieval"));
|
||||
}
|
||||
return GalaxyApp.prototype._init = function(options, bootstrapped) {
|
||||
var self = this;
|
||||
return _.extend(self, Backbone.Events), localDebugging && (self.logger = console),
|
||||
self._processOptions(options), self.debug("GalaxyApp.options: ", self.options),
|
||||
self.root = options.root || "/", self._initConfig(options.config || bootstrapped.config || {}),
|
||||
self.debug("GalaxyApp.config: ", self.config), self._patchGalaxy(window.Galaxy),
|
||||
self._initLogger(self.options.loggerOptions || {}), self.debug("GalaxyApp.logger: ", self.logger),
|
||||
self._initLocale(), self.debug("GalaxyApp.localize: ", self.localize), self.config = options.config || {},
|
||||
self.debug("GalaxyApp.config: ", self.config), self._initUser(options.user || {}),
|
||||
self.debug("GalaxyApp.user: ", self.user), self._setUpListeners(), self.trigger("ready", self),
|
||||
self;
|
||||
}, GalaxyApp.prototype.defaultOptions = {
|
||||
patchExisting: !0,
|
||||
root: "/"
|
||||
}, GalaxyApp.prototype._processOptions = function(options) {
|
||||
var self = this, defaults = self.defaultOptions;
|
||||
self.debug("_processOptions: ", options), self.options = {};
|
||||
for (var k in defaults) defaults.hasOwnProperty(k) && (self.options[k] = options.hasOwnProperty(k) ? options[k] : defaults[k]);
|
||||
return self;
|
||||
}, GalaxyApp.prototype._initConfig = function(config) {
|
||||
var self = this;
|
||||
return self.debug("_initConfig: ", config), self.config = config, self.config.debug = localDebugging || self.config.debug,
|
||||
self;
|
||||
}, GalaxyApp.prototype._patchGalaxy = function(patchWith) {
|
||||
var self = this;
|
||||
if (self.options.patchExisting && patchWith) {
|
||||
self.debug("found existing Galaxy object:", patchWith);
|
||||
for (var k in patchWith) patchWith.hasOwnProperty(k) && (self.debug(" patching in " + k + " to Galaxy"),
|
||||
self[k] = patchWith[k]);
|
||||
}
|
||||
}, GalaxyApp.prototype._initLogger = function(loggerOptions) {
|
||||
var self = this;
|
||||
if (self.config.debug) {
|
||||
loggerOptions.consoleLogger = loggerOptions.consoleLogger || console, loggerOptions.consoleLevel = loggerOptions.consoleLevel || metricsLogger.MetricsLogger.ALL;
|
||||
try {
|
||||
loggerOptions.consoleNamespaceWhitelist = localStorage.getItem(NAMESPACE_KEY).split(",");
|
||||
} catch (storageErr) {}
|
||||
}
|
||||
return self.debug("_initLogger:", loggerOptions), self.logger = new metricsLogger.MetricsLogger(loggerOptions),
|
||||
self.config.debug && (BASE_MVC.LoggableMixin.logger = self.logger), self;
|
||||
}, GalaxyApp.prototype._initLocale = function(options) {
|
||||
var self = this;
|
||||
return self.debug("_initLocale:", options), self.localize = localize, window._l = self.localize,
|
||||
self;
|
||||
}, GalaxyApp.prototype._initUser = function(userJSON) {
|
||||
var self = this;
|
||||
return self.debug("_initUser:", userJSON), self.user = new userModel.User(userJSON),
|
||||
self.user.logger = self.logger, self.currUser = self.user, self;
|
||||
}, GalaxyApp.prototype._setUpListeners = function() {
|
||||
var self = this;
|
||||
return self.lastAjax = {}, $(document).bind("ajaxSend", function(ev, xhr, options) {
|
||||
var data = options.data;
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
} catch (err) {}
|
||||
self.lastAjax = {
|
||||
url: location.href.slice(0, -1) + options.url,
|
||||
data: data
|
||||
};
|
||||
}), self;
|
||||
}, GalaxyApp.prototype.debugging = function(setting) {
|
||||
var self = this;
|
||||
try {
|
||||
if (void 0 === setting) return "true" === localStorage.getItem(DEBUGGING_KEY);
|
||||
if (setting) return localStorage.setItem(DEBUGGING_KEY, !0), !0;
|
||||
localStorage.removeItem(DEBUGGING_KEY), self.debuggingNamespaces(null);
|
||||
} catch (storageErr) {
|
||||
console.log(localize("localStorage not available for debug flag retrieval"));
|
||||
}
|
||||
return !1;
|
||||
}, GalaxyApp.prototype.debuggingNamespaces = function(namespaces) {
|
||||
var self = this;
|
||||
try {
|
||||
if (void 0 === namespaces) {
|
||||
var csv = localStorage.getItem(NAMESPACE_KEY);
|
||||
return "string" == typeof csv ? csv.split(",") : [];
|
||||
}
|
||||
null === namespaces ? localStorage.removeItem(NAMESPACE_KEY) : localStorage.setItem(NAMESPACE_KEY, namespaces);
|
||||
var newSettings = self.debuggingNamespaces();
|
||||
return self.logger && (self.logger.options.consoleNamespaceWhitelist = newSettings),
|
||||
newSettings;
|
||||
} catch (storageErr) {
|
||||
console.log(localize("localStorage not available for debug namespace retrieval"));
|
||||
}
|
||||
}, GalaxyApp.prototype.toString = function() {
|
||||
var userEmail = this.user ? this.user.get("email") || "(anonymous)" : "uninitialized";
|
||||
return "GalaxyApp(" + userEmail + ")";
|
||||
}, {
|
||||
GalaxyApp: GalaxyApp
|
||||
};
|
||||
});
|
||||
define(["libs/underscore","libs/backbone","mvc/base-mvc","mvc/user/user-model","utils/metrics-logger","utils/add-logging","utils/localization"],function(a,b,c,d,e,f,g){function h(a,b){console.debug("GalaxyApp:",a,b);var c=this;return c._init(a||{},b||{})}f(h,"GalaxyApp");var i="galaxy:debug",j=i+":namespaces",k=!1;try{k="true"==localStorage.getItem(i)}catch(l){console.log(g("localStorage not available for debug flag retrieval"))}return h.prototype._init=function(c,d){var e=this;return a.extend(e,b.Events),k&&(e.logger=console),e._processOptions(c),e.debug("GalaxyApp.options: ",e.options),e.root=c.root||"/",e._initConfig(c.config||d.config||{}),e.debug("GalaxyApp.config: ",e.config),e._patchGalaxy(window.Galaxy),e._initLogger(e.options.loggerOptions||{}),e.debug("GalaxyApp.logger: ",e.logger),e._initLocale(),e.debug("GalaxyApp.localize: ",e.localize),e.config=c.config||{},e.debug("GalaxyApp.config: ",e.config),e._initUser(c.user||{}),e.debug("GalaxyApp.user: ",e.user),e._setUpListeners(),e.trigger("ready",e),e},h.prototype.defaultOptions={patchExisting:!0,root:"/"},h.prototype._processOptions=function(a){var b=this,c=b.defaultOptions;b.debug("_processOptions: ",a),b.options={};for(var d in c)c.hasOwnProperty(d)&&(b.options[d]=a.hasOwnProperty(d)?a[d]:c[d]);return b},h.prototype._initConfig=function(a){var b=this;return b.debug("_initConfig: ",a),b.config=a,b.config.debug=k||b.config.debug,b},h.prototype._patchGalaxy=function(a){var b=this;if(b.options.patchExisting&&a){b.debug("found existing Galaxy object:",a);for(var c in a)a.hasOwnProperty(c)&&(b.debug(" patching in "+c+" to Galaxy"),b[c]=a[c])}},h.prototype._initLogger=function(a){var b=this;if(b.config.debug){a.consoleLogger=a.consoleLogger||console,a.consoleLevel=a.consoleLevel||e.MetricsLogger.ALL;try{a.consoleNamespaceWhitelist=localStorage.getItem(j).split(",")}catch(d){}}return b.debug("_initLogger:",a),b.logger=new e.MetricsLogger(a),b.config.debug&&(c.LoggableMixin.logger=b.logger),b},h.prototype._initLocale=function(a){var b=this;return b.debug("_initLocale:",a),b.localize=g,window._l=b.localize,b},h.prototype._initUser=function(a){var b=this;return b.debug("_initUser:",a),b.user=new d.User(a),b.user.logger=b.logger,b.currUser=b.user,b},h.prototype._setUpListeners=function(){var a=this;return a.lastAjax={},$(document).bind("ajaxSend",function(b,c,d){var e=d.data;try{e=JSON.parse(e)}catch(f){}a.lastAjax={url:location.href.slice(0,-1)+d.url,data:e}}),a},h.prototype.debugging=function(a){var b=this;try{if(void 0===a)return"true"===localStorage.getItem(i);if(a)return localStorage.setItem(i,!0),!0;localStorage.removeItem(i),b.debuggingNamespaces(null)}catch(c){console.log(g("localStorage not available for debug flag retrieval"))}return!1},h.prototype.debuggingNamespaces=function(a){var b=this;try{if(void 0===a){var c=localStorage.getItem(j);return"string"==typeof c?c.split(","):[]}null===a?localStorage.removeItem(j):localStorage.setItem(j,a);var d=b.debuggingNamespaces();return b.logger&&(b.logger.options.consoleNamespaceWhitelist=d),d}catch(e){console.log(g("localStorage not available for debug namespace retrieval"))}},h.prototype.toString=function(){var a=this.user?this.user.get("email")||"(anonymous)":"uninitialized";return"GalaxyApp("+a+")"},{GalaxyApp:h}});
|
||||
//# sourceMappingURL=../maps/galaxy-app-base.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user