JavaScript cleanup: (a) create backbone lib in scripts/lib and use for backbone libraries; (b) clean up history.js; (c) pack scripts.

This commit is contained in:
Jeremy Goecks
2012-08-21 14:27:18 -04:00
parent 8faf5cc089
commit a3d8452df5
15 changed files with 17 additions and 16 deletions
+7 -7
View File
@@ -33,13 +33,13 @@ var HistoryItem = BaseModel.extend({
display : function(){},
edit_attr : function(){},
delete : function(){},
remove : function(){},
download : function(){},
details : function(){},
rerun : function(){},
tags : function(){},
annotations : function(){},
peek : function(){},
peek : function(){}
});
//..............................................................................
@@ -51,17 +51,17 @@ var HistoryItemView = BaseView.extend({
icons : {
display : 'path to icon',
edit_attr : 'path to icon',
delete : 'path to icon',
remove : 'path to icon',
download : 'path to icon',
details : 'path to icon',
rerun : 'path to icon',
tags : 'path to icon',
annotations : 'path to icon',
annotations : 'path to icon'
},
render : function(){
this.$el.append( 'div' )
},
this.$el.append( 'div' );
}
});
@@ -139,7 +139,7 @@ var HistoryCollectionView = BaseView.extend({
render : function(){
},
}
});
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
var HistoryItem=BaseModel.extend({display:function(){},edit_attr:function(){},remove:function(){},download:function(){},details:function(){},rerun:function(){},tags:function(){},annotations:function(){},peek:function(){}});var HistoryItemView=BaseView.extend({tagName:"div",className:"historyItemContainer",icons:{display:"path to icon",edit_attr:"path to icon",remove:"path to icon",download:"path to icon",details:"path to icon",rerun:"path to icon",tags:"path to icon",annotations:"path to icon"},render:function(){this.$el.append("div")}});var History=Backbone.Collection.extend({});var HistoryCollectionView=BaseView.extend({tagName:"body",className:"historyCollection",render:function(){}});
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.panel_section=b(function(e,n,d,l,k){d=d||e.helpers;var i="",c,h,o=this,f="function",m=d.helperMissing,g=void 0,j=this.escapeExpression;i+='<div class="toolSectionTitle" id="title_';h=d.id;c=h||n.id;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"id",{hash:{}})}}i+=j(c)+'">\n <a href="javascript:void(0)"><span>';h=d.name;c=h||n.name;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"name",{hash:{}})}}i+=j(c)+'</span></a>\n</div>\n<div id="';h=d.id;c=h||n.id;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"id",{hash:{}})}}i+=j(c)+'" class="toolSectionBody" style="display: none; ">\n <div class="toolSectionBg"></div>\n<div>';return i})})();
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.panel_section=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+='<div class="toolSectionTitle" id="title_';g=d.id;if(g){c=g.call(l,{hash:{}})}else{c=l.id;c=typeof c===f?c():c}h+=i(c)+'">\n <a href="javascript:void(0)"><span>';g=d.name;if(g){c=g.call(l,{hash:{}})}else{c=l.name;c=typeof c===f?c():c}h+=i(c)+'</span></a>\n</div>\n<div id="';g=d.id;if(g){c=g.call(l,{hash:{}})}else{c=l.id;c=typeof c===f?c():c}h+=i(c)+'" class="toolSectionBody" style="display: none; ">\n <div class="toolSectionBg"></div>\n<div>';return h})})();
@@ -1 +1 @@
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.tool_form=b(function(f,p,e,n,m){e=e||f.helpers;var k="",c,r,j,i,q=this,g="function",o=e.helperMissing,h=void 0,l=this.escapeExpression;function d(v,u){var s="",t;s+='\n <div class="form-row">\n <label for="';j=e.name;t=j||v.name;if(typeof t===g){t=t.call(v,{hash:{}})}else{if(t===h){t=o.call(v,"name",{hash:{}})}}s+=l(t)+'">';j=e.label;t=j||v.label;if(typeof t===g){t=t.call(v,{hash:{}})}else{if(t===h){t=o.call(v,"label",{hash:{}})}}s+=l(t)+':</label>\n <div class="form-row-input">\n ';j=e.html;t=j||v.html;if(typeof t===g){t=t.call(v,{hash:{}})}else{if(t===h){t=o.call(v,"html",{hash:{}})}}if(t||t===0){s+=t}s+='\n </div>\n <div class="toolParamHelp" style="clear: both;">\n ';j=e.help;t=j||v.help;if(typeof t===g){t=t.call(v,{hash:{}})}else{if(t===h){t=o.call(v,"help",{hash:{}})}}s+=l(t)+'\n </div>\n <div style="clear: both;"></div>\n </div>\n ';return s}k+='<div class="toolFormTitle">';j=e.name;c=j||p.name;if(typeof c===g){c=c.call(p,{hash:{}})}else{if(c===h){c=o.call(p,"name",{hash:{}})}}k+=l(c)+" (version ";j=e.version;c=j||p.version;if(typeof c===g){c=c.call(p,{hash:{}})}else{if(c===h){c=o.call(p,"version",{hash:{}})}}k+=l(c)+')</div>\n <div class="toolFormBody">\n ';j=e.inputs;c=j||p.inputs;r=e.each;i=q.program(1,d,m);i.hash={};i.fn=i;i.inverse=q.noop;c=r.call(p,c,i);if(c||c===0){k+=c}k+='\n </div>\n <div class="form-row form-actions">\n <input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute">\n</div>\n<div class="toolHelp">\n <div class="toolHelpBody">';j=e.help;c=j||p.help;if(typeof c===g){c=c.call(p,{hash:{}})}else{if(c===h){c=o.call(p,"help",{hash:{}})}}k+=l(c)+"</div>\n</div>";return k})})();
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.tool_form=b(function(f,m,e,l,k){e=e||f.helpers;var i="",c,h,g="function",j=this.escapeExpression,n=this;function d(s,r){var p="",q,o;p+='\n <div class="form-row">\n <label for="';o=e.name;if(o){q=o.call(s,{hash:{}})}else{q=s.name;q=typeof q===g?q():q}p+=j(q)+'">';o=e.label;if(o){q=o.call(s,{hash:{}})}else{q=s.label;q=typeof q===g?q():q}p+=j(q)+':</label>\n <div class="form-row-input">\n ';o=e.html;if(o){q=o.call(s,{hash:{}})}else{q=s.html;q=typeof q===g?q():q}if(q||q===0){p+=q}p+='\n </div>\n <div class="toolParamHelp" style="clear: both;">\n ';o=e.help;if(o){q=o.call(s,{hash:{}})}else{q=s.help;q=typeof q===g?q():q}p+=j(q)+'\n </div>\n <div style="clear: both;"></div>\n </div>\n ';return p}i+='<div class="toolFormTitle">';h=e.name;if(h){c=h.call(m,{hash:{}})}else{c=m.name;c=typeof c===g?c():c}i+=j(c)+" (version ";h=e.version;if(h){c=h.call(m,{hash:{}})}else{c=m.version;c=typeof c===g?c():c}i+=j(c)+')</div>\n <div class="toolFormBody">\n ';c=m.inputs;c=e.each.call(m,c,{hash:{},inverse:n.noop,fn:n.program(1,d,k)});if(c||c===0){i+=c}i+='\n </div>\n <div class="form-row form-actions">\n <input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute">\n</div>\n<div class="toolHelp">\n <div class="toolHelpBody">';h=e.help;if(h){c=h.call(m,{hash:{}})}else{c=m.help;c=typeof c===g?c():c}i+=j(c)+"</div>\n</div>";return i})})();
@@ -1 +1 @@
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.tool_link=b(function(e,n,d,l,k){d=d||e.helpers;var i="",c,h,o=this,f="function",m=d.helperMissing,g=void 0,j=this.escapeExpression;i+='<a class="';h=d.id;c=h||n.id;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"id",{hash:{}})}}i+=j(c)+' tool-link" href="';h=d.link;c=h||n.link;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"link",{hash:{}})}}i+=j(c)+'" target="';h=d.target;c=h||n.target;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"target",{hash:{}})}}i+=j(c)+'" minsizehint="';h=d.min_width;c=h||n.min_width;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"min_width",{hash:{}})}}i+=j(c)+'">';h=d.name;c=h||n.name;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"name",{hash:{}})}}i+=j(c)+"</a> ";h=d.description;c=h||n.description;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"description",{hash:{}})}}i+=j(c);return i})})();
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.tool_link=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+='<a class="';g=d.id;if(g){c=g.call(l,{hash:{}})}else{c=l.id;c=typeof c===f?c():c}h+=i(c)+' tool-link" href="';g=d.link;if(g){c=g.call(l,{hash:{}})}else{c=l.link;c=typeof c===f?c():c}h+=i(c)+'" target="';g=d.target;if(g){c=g.call(l,{hash:{}})}else{c=l.target;c=typeof c===f?c():c}h+=i(c)+'" minsizehint="';g=d.min_width;if(g){c=g.call(l,{hash:{}})}else{c=l.min_width;c=typeof c===f?c():c}h+=i(c)+'">';g=d.name;if(g){c=g.call(l,{hash:{}})}else{c=l.name;c=typeof c===f?c():c}h+=i(c)+"</a> ";g=d.description;if(g){c=g.call(l,{hash:{}})}else{c=l.description;c=typeof c===f?c():c}h+=i(c);return h})})();
@@ -1 +1 @@
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.tool_search=b(function(e,n,d,l,k){d=d||e.helpers;var i="",c,h,o=this,f="function",m=d.helperMissing,g=void 0,j=this.escapeExpression;i+='<input type="text" name="query" value="search tools" id="tool-search-query" autocomplete="off" class="search-query parent-width" />\n<img src="';h=d.spinner_url;c=h||n.spinner_url;if(typeof c===f){c=c.call(n,{hash:{}})}else{if(c===g){c=m.call(n,"spinner_url",{hash:{}})}}i+=j(c)+'" id="search-spinner" class="search-spinner"/>\n';return i})})();
(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.tool_search=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+='<input type="text" name="query" value="';g=d.search_hint_string;if(g){c=g.call(l,{hash:{}})}else{c=l.search_hint_string;c=typeof c===f?c():c}h+=i(c)+'" id="tool-search-query" autocomplete="off" class="search-query parent-width" />\n<a id="search-clear-btn" class="icon-button cross-circle tooltip" title="clear search (esc)"> </a>\n<img src="';g=d.spinner_url;if(g){c=g.call(l,{hash:{}})}else{c=l.spinner_url;c=typeof c===f?c():c}h+=i(c)+'" id="search-spinner" class="search-spinner"/>';return h})})();
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -26,7 +26,7 @@
## <!--[if lt IE 7]>
## <script type='text/javascript' src="/static/scripts/IE7.js"> </script>
## <![endif]-->
${h.js( "jquery", "bootstrap", "galaxy.base", "libs/underscore", "libs/backbone", "libs/backbone-relational", "libs/handlebars.runtime", "mvc/ui" )}
${h.js( "jquery", "bootstrap", "galaxy.base", "libs/underscore", "libs/backbone/backbone", "libs/backbone/backbone-relational", "libs/handlebars.runtime", "mvc/ui" )}
<script type="text/javascript">
// Set up needed paths.
var galaxy_paths = new GalaxyPaths({
+1 -1
View File
@@ -48,7 +48,7 @@
<!--[if lt IE 7]>
${h.js( 'IE7', 'ie7-recalc' )}
<![endif]-->
${h.js( 'jquery', 'bootstrap', 'libs/underscore', 'libs/backbone', 'libs/backbone-relational', 'libs/handlebars.runtime', 'mvc/ui' )}
${h.js( 'jquery', 'bootstrap', 'libs/underscore', 'libs/backbone/backbone', 'libs/backbone/backbone-relational', 'libs/handlebars.runtime', 'mvc/ui' )}
<script type="text/javascript">
// Set up needed paths.
var galaxy_paths = new GalaxyPaths({