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 HeaderView = Backbone.View.extend({
events: {
'click #show-pet-store-icon' : 'showPetStore',
'click #show-wordnik-dev-icon' : 'showWordnikDev',
'click #explore' : 'showCustom',
'keyup #input_baseUrl' : 'showCustomOnKeyup',
'keyup #input_apiKey' : 'showCustomOnKeyup'
},
initialize: function(){},
showPetStore: function(){
this.trigger('update-swagger-ui', {
url:'http://petstore.swagger.wordnik.com/api/api-docs'
});
},
showWordnikDev: function(){
this.trigger('update-swagger-ui', {
url: 'http://api.wordnik.com/v4/resources.json'
});
},
showCustomOnKeyup: function(e){
if (e.keyCode === 13) {
this.showCustom();
}
},
showCustom: function(e){
if (e) {
e.preventDefault();
}
this.trigger('update-swagger-ui', {
url: $('#input_baseUrl').val(),
apiKey: $('#input_apiKey').val()
});
},
update: function(url, apiKey, trigger = false){
$('#input_baseUrl').val(url);
//$('#input_apiKey').val(apiKey);
if (trigger) {
this.trigger('update-swagger-ui', {url:url});
}
}
});