mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add icons to buttons in regular view
This commit is contained in:
@@ -63,9 +63,9 @@ return Backbone.View.extend({
|
||||
this.setElement(this._template());
|
||||
|
||||
// create button section
|
||||
this.btnLocal = new Ui.Button({ title: 'Choose local file', onclick: function() { self.uploadbox.select(); } });
|
||||
this.btnFtp = new Ui.Button({ title: 'Choose FTP file', onclick: function() { self._eventFtp(); } });
|
||||
this.btnCreate = new Ui.Button({ title: 'Paste/Fetch data', onclick: function() { self._eventCreate(); } });
|
||||
this.btnLocal = new Ui.Button({ title: 'Choose local file', onclick: function() { self.uploadbox.select(); }, icon: 'fa fa-laptop' });
|
||||
this.btnFtp = new Ui.Button({ title: 'Choose FTP file', onclick: function() { self._eventFtp(); }, icon: 'fa fa-code-fork' });
|
||||
this.btnCreate = new Ui.Button({ title: 'Paste/Fetch data', onclick: function() { self._eventCreate(); }, icon: 'fa fa-pencil' });
|
||||
this.btnStart = new Ui.Button({ title: 'Start', onclick: function() { self._eventStart(); } });
|
||||
this.btnStop = new Ui.Button({ title: 'Pause', onclick: function() { self._eventStop(); } });
|
||||
this.btnReset = new Ui.Button({ title: 'Reset', onclick: function() { self._eventReset(); } });
|
||||
|
||||
@@ -59,6 +59,7 @@ return Backbone.View.extend({
|
||||
// add event handler to select/unselect all
|
||||
if (this.collection) {
|
||||
var self = this;
|
||||
this.$('._has_collection').show();
|
||||
this.$select_all = $('#upload-selectall');
|
||||
this.$select_all.addClass(this.options.class_add);
|
||||
this.$select_all.on('click', function() {
|
||||
@@ -72,14 +73,10 @@ return Backbone.View.extend({
|
||||
}
|
||||
});
|
||||
this._refresh();
|
||||
this.$('._has_collection').show();
|
||||
}
|
||||
} else {
|
||||
// add info
|
||||
this.$el.find('#upload-ftp-content').html($(this._templateInfo()));
|
||||
}
|
||||
|
||||
// hide spinner
|
||||
this.$el.find('#upload-ftp-wait').hide();
|
||||
},
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"upload-ftp.js","sources":["../../../src/mvc/upload/upload-ftp.js"],"names":["define","Utils","Backbone","View","extend","initialize","options","this","merge","class_add","class_remove","class_partial","collection","onchange","onadd","onremove","self","setElement","_template","rows","get","url","galaxy_config","root","success","ftp_files","_fill","error","events","mousedown","e","preventDefault","length","$el","find","html","$","_templateTable","size","index","push","_add","bytesToString","$select_all","addClass","on","add","hasClass","ftp_file","model_index","_find","trigger","_refresh","show","_templateInfo","hide","$it","_templateRow","$icon","el","append","icon_class","removeClass","filtered","where","file_mode","enabled","item","findWhere","file_path","path","ctime","ftp_upload_site"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GACjC,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GAEjBC,KAAKD,QAAUL,EAAMO,MAAMF,GACvBG,UAAkB,oCAClBC,aAAkB,0CAClBC,cAAkB,0CAClBC,WAAkB,KAClBC,SAAkB,aAClBC,MAAkB,aAClBC,SAAkB,cAItB,IAAIC,GAAOT,IAGXA,MAAKK,WAAaL,KAAKD,QAAQM,WAG/BL,KAAKU,WAAWV,KAAKW,aAGrBX,KAAKY,QAGLlB,EAAMmB,KACFC,IAAUC,cAAcC,KAAO,mBAC/BC,QAAU,SAASC,GAAaT,EAAKU,MAAMD,IAC3CE,MAAU,WAAaX,EAAKU,YAKpCE,QACIC,UAAa,SAASC,GAAKA,EAAEC,mBAIjCL,MAAO,SAASD,GACZ,GAAIA,GAAaA,EAAUO,OAAS,EAAG,CAEnCzB,KAAK0B,IAAIC,KAAK,uBAAuBC,KAAKC,EAAE7B,KAAK8B,kBAGjD,IAAIC,GAAO,CACX,KAAKC,QAASd,GACVlB,KAAKY,KAAKqB,KAAKjC,KAAKkC,KAAKhB,EAAUc,SACnCD,GAAQb,EAAUc,OAAOD,IAQ7B,IAJA/B,KAAK0B,IAAIC,KAAK,sBAAsBC,KAAKV,EAAUO,OAAS,UAC5DzB,KAAK0B,IAAIC,KAAK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AAKK,WAAWoD,OAAOC,UAAW,MAAOC,SAAS,GACjE3D,MAAKoC,YAAYmB,cAEbvD,KAAKoC,YAAYC,SADE,GAAnBmB,EAAS/B,OACiBzB,KAAKD,QAAQG,UAEnCsD,EAAS/B,QAAUzB,KAAKY,KAAKa,OACHzB,KAAKD,QAAQI,aAEbH,KAAKD,QAAQK,gBAMnDuC,MAAO,SAASF,GACZ,GAAImB,GAAO5D,KAAKK,WAAWwD,WACvBC,UAAcrB,EAASsB,KACvBL,UAAc,MACdC,SAAc,GAElB,OAAIC,GACOA,EAAK/C,IAAI,MAEb,MAIXqC,aAAc,SAASnD,GACnB,MAAQ,8HAE8BA,EAAQgE,KAAO,6BACfrE,EAAMyC,cAAcpC,EAAQgC,MAAQ,6BACpChC,EAAQiE,MAAQ,cAK1DlC,eAAgB,WACZ,MAAQ,0eAqBZiB,cAAe,WACX,MAAQ,uGAMZpC,UAAW,WACP,MAAQ,kPAEuJX,KAAKD,QAAQkE,gBAAkB"}
|
||||
{"version":3,"file":"upload-ftp.js","sources":["../../../src/mvc/upload/upload-ftp.js"],"names":["define","Utils","Backbone","View","extend","initialize","options","this","merge","class_add","class_remove","class_partial","collection","onchange","onadd","onremove","self","setElement","_template","rows","get","url","galaxy_config","root","success","ftp_files","_fill","error","events","mousedown","e","preventDefault","length","$el","find","html","$","_templateTable","size","index","push","_add","bytesToString","show","$select_all","addClass","on","add","hasClass","ftp_file","model_index","_find","trigger","_refresh","_templateInfo","hide","$it","_templateRow","$icon","el","append","icon_class","removeClass","filtered","where","file_mode","enabled","item","findWhere","file_path","path","ctime","ftp_upload_site"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GACjC,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GAEjBC,KAAKD,QAAUL,EAAMO,MAAMF,GACvBG,UAAkB,oCAClBC,aAAkB,0CAClBC,cAAkB,0CAClBC,WAAkB,KAClBC,SAAkB,aAClBC,MAAkB,aAClBC,SAAkB,cAItB,IAAIC,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long
@@ -1,2 +1,2 @@
|
||||
define(["utils/utils"],function(a){return Backbone.View.extend({initialize:function(b){this.options=a.merge(b,{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}});var c=this;this.collection=this.options.collection,this.setElement(this._template()),this.rows=[],a.get({url:galaxy_config.root+"api/remote_files",success:function(a){c._fill(a)},error:function(){c._fill()}})},events:{mousedown:function(a){a.preventDefault()}},_fill:function(b){if(b&&b.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var c=0;for(index in b)this.rows.push(this._add(b[index])),c+=b[index].size;if(this.$el.find("#upload-ftp-number").html(b.length+" files"),this.$el.find("#upload-ftp-disk").html(a.bytesToString(c,!0)),this.collection){var d=this;this.$select_all=$("#upload-selectall"),this.$select_all.addClass(this.options.class_add),this.$select_all.on("click",function(){var a=d.$select_all.hasClass(d.options.class_add);for(index in b){var c=b[index],e=d._find(c);(!e&&a||e&&!a)&&d.rows[index].trigger("click")}}),this._refresh(),this.$("._has_collection").show()}}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},_add:function(a){var b=this,c=$(this._templateRow(a)),d=c.find(".icon");if($(this.el).find("tbody").append(c),this.collection){var e="";e=this._find(a)?this.options.class_remove:this.options.class_add,d.addClass(e),c.on("click",function(){var c=b._find(a);d.removeClass(),c?(b.options.onremove(c),d.addClass(b.options.class_add)):(b.options.onadd(a),d.addClass(b.options.class_remove)),b._refresh()})}else c.on("click",function(){b.options.onchange(a)});return c},_refresh:function(){var a=this.collection.where({file_mode:"ftp",enabled:!0});this.$select_all.removeClass(),this.$select_all.addClass(0==a.length?this.options.class_add:a.length==this.rows.length?this.options.class_remove:this.options.class_partial)},_find:function(a){var b=this.collection.findWhere({file_path:a.path,file_mode:"ftp",enabled:!0});return b?b.get("id"):null},_templateRow:function(b){return'<tr class="upload-ftp-row"><td class="_has_collection" style="display: none;"><div class="icon"/></td><td class="ftp-name">'+b.path+'</td><td class="ftp-size">'+a.bytesToString(b.size)+'</td><td class="ftp-time">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th class="_has_collection" style="display: none;"><div id="upload-selectall"></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody/></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"/><div>'}})});
|
||||
define(["utils/utils"],function(a){return Backbone.View.extend({initialize:function(b){this.options=a.merge(b,{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}});var c=this;this.collection=this.options.collection,this.setElement(this._template()),this.rows=[],a.get({url:galaxy_config.root+"api/remote_files",success:function(a){c._fill(a)},error:function(){c._fill()}})},events:{mousedown:function(a){a.preventDefault()}},_fill:function(b){if(b&&b.length>0){this.$el.find("#upload-ftp-content").html($(this._templateTable()));var c=0;for(index in b)this.rows.push(this._add(b[index])),c+=b[index].size;if(this.$el.find("#upload-ftp-number").html(b.length+" files"),this.$el.find("#upload-ftp-disk").html(a.bytesToString(c,!0)),this.collection){var d=this;this.$("._has_collection").show(),this.$select_all=$("#upload-selectall"),this.$select_all.addClass(this.options.class_add),this.$select_all.on("click",function(){var a=d.$select_all.hasClass(d.options.class_add);for(index in b){var c=b[index],e=d._find(c);(!e&&a||e&&!a)&&d.rows[index].trigger("click")}}),this._refresh()}}else this.$el.find("#upload-ftp-content").html($(this._templateInfo()));this.$el.find("#upload-ftp-wait").hide()},_add:function(a){var b=this,c=$(this._templateRow(a)),d=c.find(".icon");if($(this.el).find("tbody").append(c),this.collection){var e="";e=this._find(a)?this.options.class_remove:this.options.class_add,d.addClass(e),c.on("click",function(){var c=b._find(a);d.removeClass(),c?(b.options.onremove(c),d.addClass(b.options.class_add)):(b.options.onadd(a),d.addClass(b.options.class_remove)),b._refresh()})}else c.on("click",function(){b.options.onchange(a)});return c},_refresh:function(){var a=this.collection.where({file_mode:"ftp",enabled:!0});this.$select_all.removeClass(),this.$select_all.addClass(0==a.length?this.options.class_add:a.length==this.rows.length?this.options.class_remove:this.options.class_partial)},_find:function(a){var b=this.collection.findWhere({file_path:a.path,file_mode:"ftp",enabled:!0});return b?b.get("id"):null},_templateRow:function(b){return'<tr class="upload-ftp-row"><td class="_has_collection" style="display: none;"><div class="icon"/></td><td class="ftp-name">'+b.path+'</td><td class="ftp-size">'+a.bytesToString(b.size)+'</td><td class="ftp-time">'+b.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span id="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span id="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th class="_has_collection" style="display: none;"><div id="upload-selectall"></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody/></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div id="upload-ftp-wait" class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div id="upload-ftp-content"/><div>'}})});
|
||||
//# sourceMappingURL=../../../maps/mvc/upload/upload-ftp.js.map
|
||||
Reference in New Issue
Block a user