From bb0cf8768472aa990ccf8e14a258395584de0496 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 3 Jun 2014 12:11:17 -0400 Subject: [PATCH] ES6: All components ported over --- .../components/{radio_button.js => radio-button.js.es6} | 6 ++---- ...ortable_heading_component.js => sortable-heading.js.es6} | 2 +- .../{toggle_summary_component.js => toggle-summary.js.es6} | 2 +- ...ic_participant_component.js => topic-participant.js.es6} | 2 +- .../{topic_status_component.js => topic-status.js.es6} | 2 +- .../{user_badge_component.js => user-badge.js.es6} | 2 +- .../templates/components/basic-topic-list.js.handlebars | 2 +- .../discourse/templates/discovery/categories.js.handlebars | 2 +- .../discourse/templates/featured_topics.js.handlebars | 2 +- .../javascripts/discourse/templates/header.js.handlebars | 2 +- .../discourse/templates/list/topic_list_item.js.handlebars | 2 +- .../mobile/components/basic-topic-list.js.handlebars | 2 +- .../templates/mobile/list/topic_list_item.js.handlebars | 2 +- .../javascripts/discourse/templates/topic.js.handlebars | 2 +- .../javascripts/discourse/views/topic-map-container.js.es6 | 3 ++- 15 files changed, 17 insertions(+), 18 deletions(-) rename app/assets/javascripts/discourse/components/{radio_button.js => radio-button.js.es6} (65%) rename app/assets/javascripts/discourse/components/{sortable_heading_component.js => sortable-heading.js.es6} (92%) rename app/assets/javascripts/discourse/components/{toggle_summary_component.js => toggle-summary.js.es6} (87%) rename app/assets/javascripts/discourse/components/{topic_participant_component.js => topic-participant.js.es6} (87%) rename app/assets/javascripts/discourse/components/{topic_status_component.js => topic-status.js.es6} (97%) rename app/assets/javascripts/discourse/components/{user_badge_component.js => user-badge.js.es6} (83%) diff --git a/app/assets/javascripts/discourse/components/radio_button.js b/app/assets/javascripts/discourse/components/radio-button.js.es6 similarity index 65% rename from app/assets/javascripts/discourse/components/radio_button.js rename to app/assets/javascripts/discourse/components/radio-button.js.es6 index 1817064c94d..1a17c6bbe22 100644 --- a/app/assets/javascripts/discourse/components/radio_button.js +++ b/app/assets/javascripts/discourse/components/radio-button.js.es6 @@ -1,4 +1,4 @@ -Discourse.RadioButton = Ember.Component.extend({ +export default Ember.Component.extend({ tagName : "input", type : "radio", attributeBindings : [ "name", "type", "value", "checked:checked" ], @@ -7,7 +7,5 @@ Discourse.RadioButton = Ember.Component.extend({ }, checked : function() { return this.get("value") === this.get("selection"); - }.property('selection') + }.property('selection'), }); - -Em.Handlebars.helper('radio-button', Discourse.RadioButton); diff --git a/app/assets/javascripts/discourse/components/sortable_heading_component.js b/app/assets/javascripts/discourse/components/sortable-heading.js.es6 similarity index 92% rename from app/assets/javascripts/discourse/components/sortable_heading_component.js rename to app/assets/javascripts/discourse/components/sortable-heading.js.es6 index 1839bdc4408..c1f469ecc9e 100644 --- a/app/assets/javascripts/discourse/components/sortable_heading_component.js +++ b/app/assets/javascripts/discourse/components/sortable-heading.js.es6 @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.SortableHeadingComponent = Ember.Component.extend({ +export default Ember.Component.extend({ tagName: 'th', classNameBindings: ['number:num', 'sortBy', 'iconSortClass:sorting', 'sortable:sortable'], attributeBindings: ['colspan'], diff --git a/app/assets/javascripts/discourse/components/toggle_summary_component.js b/app/assets/javascripts/discourse/components/toggle-summary.js.es6 similarity index 87% rename from app/assets/javascripts/discourse/components/toggle_summary_component.js rename to app/assets/javascripts/discourse/components/toggle-summary.js.es6 index 2f97dd75efe..440cf8f0288 100644 --- a/app/assets/javascripts/discourse/components/toggle_summary_component.js +++ b/app/assets/javascripts/discourse/components/toggle-summary.js.es6 @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.ToggleSummaryComponent = Ember.Component.extend({ +export default Ember.Component.extend({ layoutName: 'components/toggle-summary', tagName: 'section', classNames: ['information'], diff --git a/app/assets/javascripts/discourse/components/topic_participant_component.js b/app/assets/javascripts/discourse/components/topic-participant.js.es6 similarity index 87% rename from app/assets/javascripts/discourse/components/topic_participant_component.js rename to app/assets/javascripts/discourse/components/topic-participant.js.es6 index 377f859d0a9..a710913753b 100644 --- a/app/assets/javascripts/discourse/components/topic_participant_component.js +++ b/app/assets/javascripts/discourse/components/topic-participant.js.es6 @@ -1,4 +1,4 @@ -Discourse.TopicParticipantComponent = Ember.Component.extend({ +export default Ember.Component.extend({ postStream: Em.computed.alias('participant.topic.postStream'), diff --git a/app/assets/javascripts/discourse/components/topic_status_component.js b/app/assets/javascripts/discourse/components/topic-status.js.es6 similarity index 97% rename from app/assets/javascripts/discourse/components/topic_status_component.js rename to app/assets/javascripts/discourse/components/topic-status.js.es6 index d136673d419..af6779b4781 100644 --- a/app/assets/javascripts/discourse/components/topic_status_component.js +++ b/app/assets/javascripts/discourse/components/topic-status.js.es6 @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.TopicStatusComponent = Ember.Component.extend({ +export default Ember.Component.extend({ classNames: ['topic-statuses'], hasDisplayableStatus: Em.computed.or('topic.archived','topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault'), diff --git a/app/assets/javascripts/discourse/components/user_badge_component.js b/app/assets/javascripts/discourse/components/user-badge.js.es6 similarity index 83% rename from app/assets/javascripts/discourse/components/user_badge_component.js rename to app/assets/javascripts/discourse/components/user-badge.js.es6 index 725169b2366..b4e97ecb0d1 100644 --- a/app/assets/javascripts/discourse/components/user_badge_component.js +++ b/app/assets/javascripts/discourse/components/user-badge.js.es6 @@ -1,4 +1,4 @@ -Discourse.UserBadgeComponent = Ember.Component.extend({ +export default Ember.Component.extend({ tagName: 'span', badgeTypeClassName: function() { diff --git a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars index f628cd19d66..f5126ba1ab4 100644 --- a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars @@ -22,7 +22,7 @@ {{#groupedEach topic in topics}} - {{topicStatus topic=topic}} + {{topic-status topic=topic}} {{{unbound topic.fancy_title}}} {{#if unread}} {{unbound topic.unread}} diff --git a/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars index 1bea0e56b9c..38b0e193530 100644 --- a/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars +++ b/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars @@ -55,7 +55,7 @@ {{#each featuredTopics}}