This commit is contained in:
guerler
2016-10-17 21:01:22 -04:00
parent fdff89596e
commit e9a712c82d
3 changed files with 58 additions and 59 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
define(["mvc/user/change-user-information","mvc/user/change-password","mvc/user/change-permissions","mvc/user/change-api-key","mvc/user/change-toolbox-filter","mvc/user/change-communication"],function(a,b,c,d,e,f){var g=Backbone.View.extend({initialize:function(){this.setElement("<div/>"),this.render()},callManageInfo:function(){var b=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/get_information",function(c){var d=new a.ManageUserInformation(b,c);b.$(".user-preferences-all").append(d.$el)})},callChangePassword:function(){var a=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/change_password",function(c){var d=new b.ChangePassword(a,c);a.$(".user-preferences-all").append(d.$el)})},showPreferences:function(){this.$(".user-pref").show()},callChangePermissions:function(){var a=Galaxy.root+"api/user_preferences/change_permissions",b=this,d=$(".user-preferences-all");$(".user-pref").hide(),$.getJSON(a,function(a){changePermissions=new c.ChangePermissions(b,a,d)})},callApiKeys:function(){var a=Galaxy.root+"api/user_preferences/change_api_key",b={},c=this;$(".user-pref").hide(),b={message:"",status:""},$.getJSON(a,b,function(a){apiKey=new d.APIKeys(c,a),c.$(".user-preferences-all").append(apiKey.$el)})},callManageToolboxFilter:function(){var a=Galaxy.root+"api/user_preferences/change_toolbox_filters",b=this;$(".user-pref").hide(),$.getJSON(a,function(a){toolbox=new e.ToolboxFilter(b,a),b.$(".user-preferences-all").append(toolbox.$el)})},callChangeCommunication:function(){$(".user-pref").hide();var a=this,b=Galaxy.root+"api/user_preferences/change_communication";$.getJSON(b,function(b){changeCommunication=new f(a,b),a.$(".user-preferences-all").append(changeCommunication.$el)})},render:function(){var a=this;$.getJSON(Galaxy.root+"api/user_preferences",function(b){a.render(b)});var b="";null!==data.id?(b="<div class='user-preferences-all'>",b=b+'<div class="user-pref"> <h2> User preferences </h2><p>You are currently logged in as '+data.email+".</p>",b+="<ul>","galaxy"===data.webapp?(data.remote_user||(b+="<li><a target='galaxy_main' class='manage-userinfo'>Manage your information</a> (email, address, etc.) </li><li><a target='galaxy_main' class='change-password'>Change your password</a> </li>"),b+="<li><a target='galaxy_main' class='change-communication-setting'>Change your communication settings</a></li><li><a target='galaxy_main' class='change-permissions'>Change default permissions</a> for new histories </li><li><a target='galaxy_main' class='manage-api-keys'>Manage your API keys</a></li><li><a target='galaxy_main' class='manage-toolbox-filters'>Manage your ToolBox filters</a></li>",data.openid&&!data.remote_user&&(b+="<li><a target='galaxy_main' class='manage-openid'>Manage OpenIDs</a> linked to your account </li>")):b+="<li><a target='galaxy_main' class='manage-userinfo'> Manage your information </a> for new histories </li><li><a target='galaxy_main' class='change-password'> Change your password </a> </li><li><a target='galaxy_main' class='manage-api-keys'> Manage your API keys </a> </li><li><a target='galaxy_main' class='manage-email-alert'> Manage your email alerts </a> </li>",b+="</ul>","galaxy"===data.webapp&&(b=b+"<p>You are using <strong>"+data.disk_usage+"</strong> of disk space in this Galaxy instance.",data.enable_quotas&&(b=b+"Your disk quota is: <strong>"+data.quota+"</strong>."),b+='Is your usage more than expected? See the <a href="https://wiki.galaxyproject.org/Learn/ManagingDatasets" target="_blank">documentation</a> for tips on how to find all of the data in your account.',b+="</p>")):(data.message||(b+="<p>You are currently not logged in.</p>"),b+="<ul><li> <a target=\"galaxy_main\" class=\"user-login\"> Login </a></li><li> <a target='galaxy_main' class='user-register'> Register </a></li></ul>"),b+="</div></div>",this.$el.empty().append(b),$(".manage-userinfo").on("click",function(){a.callManageInfo()}),$(".change-password").on("click",function(){a.callChangePassword()}),$(".change-permissions").on("click",function(){a.callChangePermissions()}),$(".manage-api-keys").on("click",function(){a.callApiKeys()}),$(".manage-toolbox-filters").on("click",function(){a.callManageToolboxFilter()}),$(".change-communication-setting").on("click",function(){a.callChangeCommunication()})}});return{UserPreferences:g}});
define(["mvc/user/change-user-information","mvc/user/change-password","mvc/user/change-permissions","mvc/user/change-api-key","mvc/user/change-toolbox-filter","mvc/user/change-communication"],function(a,b,c,d,e,f){var g=Backbone.View.extend({initialize:function(){this.setElement("<div/>"),this.render()},callManageInfo:function(){var b=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/get_information",function(c){var d=new a.ManageUserInformation(b,c);b.$(".user-preferences-all").append(d.$el)})},callChangePassword:function(){var a=this;$(".user-pref").hide(),$.getJSON(Galaxy.root+"api/user_preferences/change_password",function(c){var d=new b.ChangePassword(a,c);a.$(".user-preferences-all").append(d.$el)})},showPreferences:function(){this.$(".user-pref").show()},callChangePermissions:function(){var a=Galaxy.root+"api/user_preferences/change_permissions",b=this,d=$(".user-preferences-all");$(".user-pref").hide(),$.getJSON(a,function(a){changePermissions=new c.ChangePermissions(b,a,d)})},callApiKeys:function(){var a=Galaxy.root+"api/user_preferences/change_api_key",b={},c=this;$(".user-pref").hide(),b={message:"",status:""},$.getJSON(a,b,function(a){apiKey=new d.APIKeys(c,a),c.$(".user-preferences-all").append(apiKey.$el)})},callManageToolboxFilter:function(){var a=Galaxy.root+"api/user_preferences/change_toolbox_filters",b=this;$(".user-pref").hide(),$.getJSON(a,function(a){toolbox=new e.ToolboxFilter(b,a),b.$(".user-preferences-all").append(toolbox.$el)})},callChangeCommunication:function(){$(".user-pref").hide();var a=this,b=Galaxy.root+"api/user_preferences/change_communication";$.getJSON(b,function(b){changeCommunication=new f(a,b),a.$(".user-preferences-all").append(changeCommunication.$el)})},render:function(){var a=this;$.getJSON(Galaxy.root+"api/user_preferences",function(b){var c="";null!==b.id?(c="<div class='user-preferences-all'>",c=c+'<div class="user-pref"> <h2> User preferences </h2><p>You are currently logged in as '+b.email+".</p>",c+="<ul>","galaxy"===b.webapp?(b.remote_user||(c+="<li><a target='galaxy_main' class='manage-userinfo'>Manage your information</a> (email, address, etc.) </li><li><a target='galaxy_main' class='change-password'>Change your password</a> </li>"),c+="<li><a target='galaxy_main' class='change-communication-setting'>Change your communication settings</a></li><li><a target='galaxy_main' class='change-permissions'>Change default permissions</a> for new histories </li><li><a target='galaxy_main' class='manage-api-keys'>Manage your API keys</a></li><li><a target='galaxy_main' class='manage-toolbox-filters'>Manage your ToolBox filters</a></li>",b.openid&&!b.remote_user&&(c+="<li><a target='galaxy_main' class='manage-openid'>Manage OpenIDs</a> linked to your account </li>")):c+="<li><a target='galaxy_main' class='manage-userinfo'> Manage your information </a> for new histories </li><li><a target='galaxy_main' class='change-password'> Change your password </a> </li><li><a target='galaxy_main' class='manage-api-keys'> Manage your API keys </a> </li><li><a target='galaxy_main' class='manage-email-alert'> Manage your email alerts </a> </li>",c+="</ul>","galaxy"===b.webapp&&(c=c+"<p>You are using <strong>"+b.disk_usage+"</strong> of disk space in this Galaxy instance.",b.enable_quotas&&(c=c+"Your disk quota is: <strong>"+b.quota+"</strong>."),c+='Is your usage more than expected? See the <a href="https://wiki.galaxyproject.org/Learn/ManagingDatasets" target="_blank">documentation</a> for tips on how to find all of the data in your account.',c+="</p>")):(b.message||(c+="<p>You are currently not logged in.</p>"),c+="<ul><li> <a target=\"galaxy_main\" class=\"user-login\"> Login </a></li><li> <a target='galaxy_main' class='user-register'> Register </a></li></ul>"),c+="</div></div>",a.$el.empty().append(c),$(".manage-userinfo").on("click",function(){a.callManageInfo()}),$(".change-password").on("click",function(){a.callChangePassword()}),$(".change-permissions").on("click",function(){a.callChangePermissions()}),$(".manage-api-keys").on("click",function(){a.callApiKeys()}),$(".manage-toolbox-filters").on("click",function(){a.callManageToolboxFilter()}),$(".change-communication-setting").on("click",function(){a.callChangeCommunication()})})}});return{UserPreferences:g}});
//# sourceMappingURL=../../../maps/mvc/user/user-preferences.js.map