Move all files to javascript folder and remove coffeescript folder

This commit is contained in:
Mohsen Azimi
2015-03-12 15:51:01 -07:00
parent f21ade9ba7
commit 215a8fa63e
14 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
'use strict';
var ApiKeyButton = Backbone.View.extend({ // TODO: append this to global SwaggerUi
events:{
'click #apikey_button' : 'toggleApiKeyContainer',
'click #apply_api_key' : 'applyApiKey'
},
initialize: function(){},
render: function(){
var template = this.template();
$(this.el).html(template(this.model));
return this;
},
applyApiKey: function(){
var keyAuth = new ApiKeyAuthorization(
this.model.name,
$('#input_apiKey_entry').val(),
this.model.in
);
window.authorizations.add(this.model.name, keyAuth);
window.swaggerUi.load();
$('#apikey_container').show();
},
toggleApiKeyContainer: function(){
if ($('#apikey_container').length > 0) {
var elem = $('#apikey_container').first();
if (elem.is(':visible')){
elem.hide();
} else {
// hide others
$('.auth_container').hide();
elem.show();
}
}
},
template: function(){
return Handlebars.templates.apikey_button_view;
}
});