diff --git a/.editorconfig b/.editorconfig index 2fe4874a..47c54384 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,6 +18,7 @@ indent_style = space indent_size = 2 [*.hbs] +insert_final_newline = false indent_style = space indent_size = 2 diff --git a/.travis.yml b/.travis.yml index fa148e98..09cb62b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,20 @@ language: node_js node_js: "0.10.36" +env: + - EMBER_VERSION=default + - EMBER_VERSION=release + - EMBER_VERSION=beta + - EMBER_VERSION=canary + +matrix: + allow_failures: + - env: EMBER_VERSION=release + - env: EMBER_VERSION=beta + - env: EMBER_VERSION=canary + + fast_finish: true + addons: sauce_connect: true @@ -21,7 +35,7 @@ install: - bower install script: - - npm test + - ember try $EMBER_VERSION notifications: campfire: @@ -42,3 +56,6 @@ deploy: acl: public_read local_dir: dist region: us-east-1 + on: + branch: master + condition: "$EMBER_VERSION = default" diff --git a/Brocfile.js b/Brocfile.js index 16bcd676..89133ebc 100644 --- a/Brocfile.js +++ b/Brocfile.js @@ -21,7 +21,12 @@ if (process.env.DISABLE_FINGERPRINTS) { } var app = new EmberApp({ - fingerprint: fingerprint + fingerprint: fingerprint, + vendorFiles: { + // next line is needed to prevent ember-cli to load + // handlebars (it happens automatically in 0.1.x) + 'handlebars.js': null + } }); app.import('bower_components/pusher/dist/pusher.js'); diff --git a/app/app.coffee b/app/app.coffee index b789caf7..5618e4bf 100644 --- a/app/app.coffee +++ b/app/app.coffee @@ -7,15 +7,13 @@ `import label from 'travis/helpers/label'` `import travisField from 'travis/helpers/travis-field'` `import travisErrors from 'travis/helpers/travis-errors'` -`import tipsy from 'travis/helpers/tipsy'` #`import input from 'travis/helpers/input'` `import filterInput from 'travis/helpers/filter-input'` -Ember.Handlebars.registerHelper('label', label) -Ember.Handlebars.registerHelper('travis-field', travisField) -Ember.Handlebars.registerHelper('travis-errors', travisErrors) -Ember.Handlebars.registerHelper('tipsy', tipsy) +Ember.HTMLBars._registerHelper('label', label) +Ember.HTMLBars._registerHelper('travis-field', travisField) +Ember.HTMLBars._registerHelper('travis-errors', travisErrors) #Ember.Handlebars.registerHelper('input', input) -Ember.Handlebars.registerHelper('filter-input', filterInput) +Ember.HTMLBars._registerHelper('filter-input', filterInput) Ember.Handlebars.registerBoundHelper('mb', mb) Ember.MODEL_FACTORY_INJECTIONS = true diff --git a/app/controllers/ssh-key.coffee b/app/controllers/ssh-key.coffee index 152ba3d9..bfa2297f 100644 --- a/app/controllers/ssh-key.coffee +++ b/app/controllers/ssh-key.coffee @@ -20,8 +20,14 @@ Controller = Ember.ObjectController.extend Validations, add: -> id = @get('repo.id') model = @store.recordForId('sshKey', id) - if model.get('currentState.stateName') == 'root.empty' + # TODO: this can be removed in favor of simply unloading record + # once https://github.com/emberjs/data/pull/2867 + # and https://github.com/emberjs/data/pull/2870 are merged + if model @store.dematerializeRecord(model) + typeMap = @store.typeMapFor('sshKey') + idToRecord = typeMap.idToRecord + delete idToRecord[id] model = @store.createRecord('sshKey', id: id) @set('model', model) diff --git a/app/helpers/filter-input.coffee b/app/helpers/filter-input.coffee index 89c47bd7..cab15eef 100644 --- a/app/helpers/filter-input.coffee +++ b/app/helpers/filter-input.coffee @@ -7,12 +7,12 @@ TextField = Ember.TextField.extend _elementValueDidChange: -> @set('_value', @$().val()); -fn = (options) -> - Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2) +fn = (params, hash, options, env) -> + Ember.assert('You can only pass attributes to the `input` helper, not arguments', params.length) - onEvent = options.hash.on - delete options.hash.on - options.hash.onEvent = onEvent || 'enter' - return Ember.Handlebars.helpers.view.call(this, TextField, options) + onEvent = hash.on + delete hash.on + hash.onEvent = onEvent || 'enter' + env.helpers.view.helperFunction.call(this, [TextField], hash, options, env) `export default fn` diff --git a/app/helpers/format-message.coffee b/app/helpers/format-message.coffee index 720c6b56..ac38c784 100644 --- a/app/helpers/format-message.coffee +++ b/app/helpers/format-message.coffee @@ -1,7 +1,7 @@ `import { formatMessage as _formatMessage, safe } from 'travis/utils/helpers'` `import Ember from "ember"` -helper = Ember.Handlebars.makeBoundHelper (message, options) -> - safe _formatMessage(message, options.hash) +helper = Ember.HTMLBars.makeBoundHelper (params, hash) -> + safe _formatMessage(params[0], hash) `export default helper` diff --git a/app/helpers/label.coffee b/app/helpers/label.coffee index 5d733fd5..31c989dc 100644 --- a/app/helpers/label.coffee +++ b/app/helpers/label.coffee @@ -7,15 +7,16 @@ LabelView = Ember.View.extend( classNameBindings: ['class'] ) -label = (options) -> +label = (params, hash, options, env) -> view = LabelView - name = options.hash.for + controller = env.data.view.get('controller') + name = hash.for if name - labels = @get('_labels') + labels = controller.get('_labels') unless labels labels = Ember.Object.create() - @set('_labels', labels) + controller.set('_labels', labels) # for now I support only label + input in their own context id = labels.get(name) @@ -23,12 +24,10 @@ label = (options) -> id = "#{name}-#{Math.round(Math.random() * 1000000)}" labels.set(name, id) - options.hash.for = id - options.hashTypes.for = 'STRING' - options.hashContexts.for = this - if options.hash.content + hash.for = id + if hash.content view = view.extend(templateName: 'helpers/label') - Ember.Handlebars.helpers.view.call(this, view, options) + env.helpers.view.helperFunction.call(this, [view], hash, options, env) `export default label` diff --git a/app/helpers/tipsy.coffee b/app/helpers/tipsy.coffee deleted file mode 100644 index 08c58e38..00000000 --- a/app/helpers/tipsy.coffee +++ /dev/null @@ -1,7 +0,0 @@ -`import { safe } from 'travis/utils/helpers'` -`import Ember from "ember"` - -helper = Ember.Handlebars.makeBoundHelper (text, tip) -> - safe '' + text + '' - -`export default helper` diff --git a/app/helpers/travis-errors.coffee b/app/helpers/travis-errors.coffee index 030cb535..445a6cad 100644 --- a/app/helpers/travis-errors.coffee +++ b/app/helpers/travis-errors.coffee @@ -10,14 +10,15 @@ ErrorsView = Ember.View.extend ).property('@errors', 'errors.length') show: Ember.computed.notEmpty('errors.[]') -fn = (name, options) -> - errors = @get('errors').for(name) - window[name + 'Errors'] = errors +fn = (params, hash, options, env) -> + name = params[0] + controller = env.data.view.get('controller') + errors = controller.get('errors').for(name) view = ErrorsView.create( - controller: this + controller: controller errors: errors ) - Ember.Handlebars.helpers.view.call(this, view, options) + env.helpers.view.helperFunction.call(this, [view], hash, options, env) `export default fn` diff --git a/app/helpers/travis-field.coffee b/app/helpers/travis-field.coffee index c29bb3ea..60a85fa1 100644 --- a/app/helpers/travis-field.coffee +++ b/app/helpers/travis-field.coffee @@ -5,19 +5,21 @@ FormFieldRowView = Ember.View.extend classNameBindings: ['invalid'] classNames: 'field' -fn = (name, options) -> - errors = @get('errors').for(name) - template = options.fn - delete options.fn +fn = (params, hash, options, env) -> + name = params[0] + controller = env.data.view.get('controller') + errors = controller.get('errors').for(name) + template = options.template + delete options.template view = FormFieldRowView.create( - controller: this + controller: controller template: template errors: errors name: name classNameBindings: ['name'] ) - Ember.Handlebars.helpers.view.call(this, view, options) + env.helpers.view.helperFunction.call(this, [view], hash, options, env) `export default fn` diff --git a/app/styles/app.scss b/app/styles/app.scss index 4b0915ba..992effcd 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -36,7 +36,6 @@ // @import "app/right"; @import "app/settings"; @import "app/tabs"; -@import "app/tipsy"; @import "app/components/travis-switch"; @import "app/components/sync-button"; diff --git a/app/styles/app/forms.scss b/app/styles/app/forms.scss index 8d48d411..51dbcb31 100644 --- a/app/styles/app/forms.scss +++ b/app/styles/app/forms.scss @@ -197,8 +197,5 @@ .error, div.error > input { border-color: #c00; } - .tipsy { - margin-left: 20px; - } } } diff --git a/app/styles/app/modules/tabs.sass b/app/styles/app/modules/tabs.sass index c0a02746..2d90aa8d 100644 --- a/app/styles/app/modules/tabs.sass +++ b/app/styles/app/modules/tabs.sass @@ -34,7 +34,7 @@ @media #{$medium-up} ul - @extend %inline-block + display: block li float: left padding-right: 2em diff --git a/app/styles/app/tipsy.scss b/app/styles/app/tipsy.scss deleted file mode 100644 index 806bc5da..00000000 --- a/app/styles/app/tipsy.scss +++ /dev/null @@ -1,25 +0,0 @@ -.tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; } - .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; } - - /* Rounded corners */ - .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } - - /* Uncomment for shadow */ - /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/ - - .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; } - - /* Rules to colour arrows */ - .tipsy-arrow-n { border-bottom-color: #000; } - .tipsy-arrow-s { border-top-color: #000; } - .tipsy-arrow-e { border-left-color: #000; } - .tipsy-arrow-w { border-right-color: #000; } - - .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; } - .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;} - .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;} - .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } - .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } - .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } - .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } - .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } diff --git a/app/templates/build.hbs b/app/templates/build.hbs index d467cdb4..69d77943 100644 --- a/app/templates/build.hbs +++ b/app/templates/build.hbs @@ -14,14 +14,14 @@ {{build.pullRequestTitle}} {{else}} {{build.commit.branch}} - {{format-message build.commit.subject repoBinding=build.repo}} + {{format-message build.commit.subject repo=build.repo}} {{/if}}
{{format-message build.commit.subject repoBinding=build.repo}}
+{{format-message build.commit.subject repo=build.repo}}
{{/if}} -{{format-message build.commit.body repoBinding=build.repo pre=true}}+
{{format-message build.commit.body repo=build.repo pre=true}}