-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from baminteractive/1.0.1
Release 1.0.1
- Loading branch information
Showing
92 changed files
with
2,893 additions
and
693 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
"predef": [ | ||
"document", | ||
"window", | ||
"-Promise" | ||
"-Promise", | ||
"ga" | ||
], | ||
"browser": true, | ||
"boss": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
isEnabled: true, | ||
isBuilding: false, | ||
isNotBuilding: Ember.computed.not('isBuilding'), | ||
archiveLink: '', | ||
initialMessage: 'Generate Package', | ||
buildingMessage: 'Building Package…', | ||
tagName: 'li', | ||
linkMessage: function() { | ||
var message = ''; | ||
if(this.isBuilding){ | ||
message = this.buildingMessage; | ||
} else { | ||
message = this.initialMessage; | ||
} | ||
return new Ember.Handlebars.SafeString(message); | ||
}.property('isBuilding'), | ||
triggerArchiveDownload: function() { | ||
this.sendAction('download', this.archiveLink); | ||
}.observes('archiveLink'), | ||
actions: { | ||
handleClick: function(){ | ||
if(this.isEnabled && !this.isBuilding){ | ||
this.sendAction('action'); | ||
} | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.TextField.extend({ | ||
type: 'file', | ||
attributeBindings: ['name'], | ||
change: function(evt) { | ||
var input = evt.target; | ||
if (input.files && input.files[0]) { | ||
this.sendAction('action', input.files[0]); | ||
} | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* global Prism:true */ | ||
|
||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
didInsertElement: (function(){ | ||
Prism.highlightElement(this.$("code")[0]); | ||
}), | ||
tagName:'pre', | ||
schedulePrism: (function(){ | ||
// scheduleOnce debounces prism highlighting to only run once per | ||
// runloop. highlighting is called on didInsertElement, and | ||
// whenever model.formattedManifest changes. | ||
Ember.run.scheduleOnce('afterRender', this, this.highlightTime); | ||
}).observes('data.formattedManifest'), | ||
highlightTime: (function(){ | ||
Prism.highlightElement(this.$("code")[0]); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Checkbox.extend(Ember.ViewTargetActionSupport, { | ||
click: function(){ | ||
this.triggerAction(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Select.extend({ | ||
change:function(){ | ||
this.get('controller').updateSelect(this.modelProperty, this.selection); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
step: null, | ||
nextStep: null, | ||
isShowingBody: false, | ||
showNextStep: true, | ||
allowToggle: false, | ||
tagName: 'li', | ||
classNames: ['step'], | ||
classNameBindings: ['stepId', 'isEnabled'], | ||
stepId: function () { | ||
return 'step' + this.get('step'); | ||
}.property('step'), | ||
isEnabled: function () { | ||
var cssClass; | ||
if(this.get('allowToggle')){ | ||
cssClass = 'step--enabled'; | ||
} else { | ||
cssClass = 'step--disabled'; | ||
} | ||
return cssClass; | ||
}.property('allowToggle'), | ||
actions: { | ||
toggleBody: function() { | ||
if(this.allowToggle) { | ||
this.toggleProperty('isShowingBody'); | ||
} | ||
}, | ||
updateStep: function(currentStep, nextStep){ | ||
this.toggleProperty('isShowingBody'); | ||
this.sendAction('action', currentStep, nextStep); | ||
return true; // keep bubbling | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Ember from 'ember'; | ||
import ajax from 'ic-ajax'; | ||
import config from '../config/environment'; | ||
|
||
export default Ember.Component.extend({ | ||
logoUrl: '', | ||
actions: { | ||
addLogo: function(){ | ||
var self = this; | ||
ajax({ | ||
url:config.APP.API_URL+'/images', | ||
type: 'POST', | ||
data: JSON.stringify({ image: { src: self.logoUrl }}), | ||
dataType: 'json', | ||
contentType: 'application/json; charset=utf-8' | ||
}).then(function(result) { | ||
self.logos.pushObject({ src: self.logoUrl, sizes: result.meta.width +'x'+result.meta.height }); | ||
self.set('logoUrl',''); | ||
self.sendAction('action',self.logos); | ||
}).catch(function(){ | ||
self.set('logoUrl',''); | ||
}); | ||
}, | ||
removeLogo: function(logo){ | ||
this.logos.removeObject(logo); | ||
this.sendAction('action',this.logos); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Ember from 'ember'; | ||
import ajax from 'ic-ajax'; | ||
import config from '../config/environment'; | ||
|
||
export default Ember.Component.extend({ | ||
generateFormData: function(file) { | ||
var formData = new FormData(); | ||
formData.append('file', file); | ||
return formData; | ||
}, | ||
actions:{ | ||
uploadManifest: function(file) { | ||
console.log(file); | ||
var self = this; | ||
var data = this.generateFormData(file); | ||
this.$(".upload-file").attr("value", file.name); | ||
ajax({ | ||
url: config.APP.API_URL + '/manifests', | ||
type: 'POST', | ||
data: data, | ||
contentType: false, | ||
processData: false, | ||
cache: false | ||
}).then(function(result) { | ||
self.sendAction('action', result); | ||
}); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* global _:true */ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
member_name: '', | ||
member_value: '', | ||
memberAlert: '', | ||
showAlert: false, | ||
members: Ember.A(), | ||
actions: { | ||
addMember: function () { | ||
var self = this; | ||
self.set('memberAlert',''); | ||
self.set('showAlert',false); | ||
|
||
var members = this.get('members'); | ||
if(_.any(members,'member_name',this.get('member_name'))){ | ||
self.set('memberAlert','A custom value with that key already exists'); | ||
self.set('showAlert',true); | ||
return; | ||
} | ||
var member = {}; | ||
var member_name = this.get('member_name'); | ||
if(member_name.indexOf('_') === -1){ | ||
member_name = 'mjs_'+member_name; | ||
} | ||
var member_value = this.get('member_value'); | ||
if(member_name && member_value) { | ||
member.member_name = member_name; | ||
try{ | ||
member.member_value = JSON.parse(member_value); | ||
} | ||
catch(e){ | ||
if(/Unexpected token.*/.test(e.message)){ | ||
self.set('memberAlert','There was a problem parsing the value. Make sure it is valid JSON (strings must be wrapped in quotes)'); | ||
self.set('showAlert',true); | ||
return; | ||
} | ||
} | ||
members.pushObject(member); | ||
this.sendAction('action', 'add', member); | ||
self.set('member_name', ''); | ||
self.set('member_value', ''); | ||
} | ||
}, | ||
removeMember: function(member){ | ||
var members = this.get('members'); | ||
members.removeObject(member); | ||
this.sendAction('action', 'remove', member); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
tagName: 'a', | ||
anchor: '', | ||
classNames: ['skip-link'], | ||
// Used so that upon clicking on the link | ||
// anchor behaviors are ignored | ||
click: function(){ | ||
this.scrollTo(); | ||
}, | ||
scrollTo: function(){ | ||
var self = this; | ||
var anchor = this.get('anchor'); | ||
var $el = Ember.$(anchor); | ||
if($el){ | ||
// Scrolls to the top of main content or whatever | ||
// is passed to the anchor attribute | ||
Ember.$('body').scrollTop($el.offset().top); | ||
|
||
// This sets focus on the content which was skipped to | ||
// upon losing focus, the tabindex should be removed | ||
// so that normal keyboard navigation picks up from focused | ||
// element | ||
Ember.$($el).attr('tabindex', -1).on('blur focusout', function(){ | ||
self.$(this).removeAttr('tabindex'); | ||
}).focus(); | ||
} | ||
}.on('click') | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.