Sha256: 80a5c3d7f31ef8531090f902e0e05b7eef17344ae0ff545395e65a9ace2a4ebc
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 KB
Contents
var Session = Backbone.Model.extend({ setApiKey: function(apiKey) { window.sessionStorage.setItem('apiKey', apiKey) }, setAuthenticated: function(value) { window.sessionStorage.setItem('authenticated', value) }, getApiKey: function() { return window.sessionStorage.getItem('apiKey') }, getAuthenticated: function() { return window.sessionStorage.getItem('authenticated') }, reset: function() { $(".reset-status")[0].firstChild.className = "label label-warning"; $(".reset-status")[0].firstChild.innerHTML = "loading..."; $(".reset-status").css("visibility","visible"); $.ajax({ type: 'POST', url: '/api/admin/reset', data: {api_token : this.getApiKey()}, success: function(){ $(".reset-status")[0].firstChild.className = "label label-success"; $(".reset-status")[0].firstChild.innerHTML = "success"; //router.navigate("#", true); }, error: function(resp){ $(".reset-status")[0].firstChild.className = "label label-danger"; $(".reset-status")[0].firstChild.innerHTML = "error"; $('#home-alert')[0].innerHTML = resp.responseText; $('#home-alert').css('display','block'); } }) } });
Version data entries
7 entries across 7 versions & 1 rubygems