Skip to content

Commit

Permalink
Merge pull request #125 from baminteractive/1.0.1
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
ryanbillingsley committed Apr 29, 2015
2 parents 059627e + 8c4ece7 commit d2a70c9
Show file tree
Hide file tree
Showing 92 changed files with 2,893 additions and 693 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"predef": [
"document",
"window",
"-Promise"
"-Promise",
"ga"
],
"browser": true,
"boss": true,
Expand Down
18 changes: 15 additions & 3 deletions Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var app = new EmberApp();
var app = new EmberApp({
emberCliFontAwesome: { includeFontAwesomeAssets: false }
});

// Use `app.import` to add additional libraries to the generated
// output files.
Expand All @@ -17,7 +19,17 @@ var app = new EmberApp();
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

app.import('vendor/prism.css');
app.import('vendor/prism.js');
app.import('bower_components/prism/themes/prism-okaidia.css');
app.import('bower_components/prism/prism.js');
app.import('bower_components/pluralize/pluralize.js');
app.import('bower_components/lodash/lodash.min.js');

app.import("bower_components/font-awesome/css/font-awesome.css");
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.eot", { destDir: "fonts" });
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.svg", { destDir: "fonts" });
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.ttf", { destDir: "fonts" });
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.woff", { destDir: "fonts" });
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.woff2", { destDir: "fonts" });
app.import("bower_components/font-awesome/fonts/FontAwesome.otf", { destDir: "fonts" });

module.exports = app.toTree();
15 changes: 15 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ var App = Ember.Application.extend({
Resolver: Resolver
});

//Allow data-eventname to be set on link-to's
Ember.LinkView.reopen({
attributeBindings: ['data-eventname']
});

Ember.Router.reopen({
notifyGoogleAnalytics: function() {
if (!ga) { return; }
return ga('send', 'pageview', {
'page': this.get('url'),
'title': this.get('url')
});
}.on('didTransition')
});

loadInitializers(App, config.modulePrefix);

export default App;
30 changes: 30 additions & 0 deletions app/components/download-archive.js
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');
}
}
}
});
12 changes: 12 additions & 0 deletions app/components/file-input.js
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]);
}
}
});
18 changes: 0 additions & 18 deletions app/components/file-upload.js

This file was deleted.

19 changes: 19 additions & 0 deletions app/components/formatted-manifest.js
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]);
})
});
7 changes: 7 additions & 0 deletions app/components/generator-checkbox.js
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();
}
});
7 changes: 7 additions & 0 deletions app/components/generator-select.js
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);
}
});
36 changes: 36 additions & 0 deletions app/components/generator-step.js
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
}
}
});
29 changes: 29 additions & 0 deletions app/components/logo-upload.js
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);
}
}
});
29 changes: 29 additions & 0 deletions app/components/manifest-upload.js
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);
});
}
}
});
52 changes: 52 additions & 0 deletions app/components/member-list.js
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);
}
}
});
30 changes: 30 additions & 0 deletions app/components/skip-link.js
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')
});
39 changes: 0 additions & 39 deletions app/controllers/build.js

This file was deleted.

Loading

0 comments on commit d2a70c9

Please sign in to comment.