ES6: Many modal views
This commit is contained in:
parent
3265360ff7
commit
61fd64c99d
|
@ -1,12 +1,4 @@
|
|||
/**
|
||||
This view handles the avatar selection interface
|
||||
|
||||
@class AvatarSelectorView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AvatarSelectorView = Discourse.ModalBodyView.extend({
|
||||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/avatar_selector',
|
||||
classNames: ['avatar-selector'],
|
||||
title: I18n.t('user.change_avatar.title'),
|
||||
|
@ -22,6 +14,5 @@ Discourse.AvatarSelectorView = Discourse.ModalBodyView.extend({
|
|||
var value = self.get('controller.selected');
|
||||
$('input:radio[name="avatar"]').val([value]);
|
||||
});
|
||||
}.observes('controller.selected'),
|
||||
|
||||
}.observes('controller.selected')
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/change_owner',
|
||||
title: I18n.t('topic.change_owner.title')
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/auto_close',
|
||||
title: I18n.t('topic.auto_close_title')
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/invite_private',
|
||||
title: I18n.t('topic.invite_private.title')
|
||||
});
|
|
@ -1,14 +1,5 @@
|
|||
/**
|
||||
A modal view for inviting a user to Discourse
|
||||
|
||||
@class InviteView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.InviteView = Discourse.ModalBodyView.extend({
|
||||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/invite',
|
||||
|
||||
title: function() {
|
||||
if (this.get('controller.invitingToTopic')) {
|
||||
return I18n.t('topic.invite_reply.title');
|
||||
|
@ -17,5 +8,3 @@ Discourse.InviteView = Discourse.ModalBodyView.extend({
|
|||
}
|
||||
}.property('controller.invitingToTopic')
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/keyboard_shortcuts_help',
|
||||
title: I18n.t('keyboard_shortcuts_help.title')
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/merge_topic',
|
||||
title: I18n.t('topic.merge_topic.title')
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
A modal view for handling changing the owner of various posts
|
||||
|
||||
@class ChangeOwnerView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.ChangeOwnerView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/change_owner',
|
||||
title: I18n.t('topic.change_owner.title')
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
This view handles a modal to set, edit, and remove a topic's auto-close time.
|
||||
|
||||
@class EditTopicAutoCloseView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.EditTopicAutoCloseView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/auto_close',
|
||||
title: I18n.t('topic.auto_close_title')
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
A modal view for inviting a user to private message
|
||||
|
||||
@class InvitePrivateView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.InvitePrivateView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/invite_private',
|
||||
title: I18n.t('topic.invite_private.title')
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
A modal view for displaying Keyboard Shortcut Help
|
||||
|
||||
@class KeyboardShortcutsHelpView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.KeyboardShortcutsHelpView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/keyboard_shortcuts_help',
|
||||
title: I18n.t('keyboard_shortcuts_help.title')
|
||||
});
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
A modal view for handling moving of posts to an existing topic
|
||||
|
||||
@class MergeTopicView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.MergeTopicView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/merge_topic',
|
||||
title: I18n.t('topic.merge_topic.title')
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
/**
|
||||
A modal view for handling moving of posts to a new topic
|
||||
|
||||
@class SplitTopicView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.SplitTopicView = Discourse.ModalBodyView.extend(Discourse.SelectedPostsCount, {
|
||||
templateName: 'modal/split_topic',
|
||||
title: I18n.t('topic.split_topic.title')
|
||||
});
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
export default Discourse.ModalBodyView.extend(Discourse.SelectedPostsCount, {
|
||||
templateName: 'modal/split_topic',
|
||||
title: I18n.t('topic.split_topic.title')
|
||||
});
|
|
@ -1,19 +1,10 @@
|
|||
/**
|
||||
This view handles the upload interface
|
||||
|
||||
@class UploadSelectorView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
|
||||
function uploadTranslate(key, options) {
|
||||
var opts = options || {};
|
||||
if (Discourse.Utilities.allowsAttachments()) { key += "_with_attachments"; }
|
||||
return I18n.t("upload_selector." + key, opts);
|
||||
}
|
||||
|
||||
Discourse.UploadSelectorView = Discourse.ModalBodyView.extend({
|
||||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/upload_selector',
|
||||
classNames: ['upload-selector'],
|
||||
|
||||
|
@ -36,10 +27,9 @@ Discourse.UploadSelectorView = Discourse.ModalBodyView.extend({
|
|||
return I18n.t("upload_selector.hint" + (isSupported ? "_for_supported_browsers" : ""));
|
||||
}.property(),
|
||||
|
||||
didInsertElement: function() {
|
||||
this._super();
|
||||
_selectOnInsert: function() {
|
||||
this.selectedChanged();
|
||||
},
|
||||
}.on('didInsertElement'),
|
||||
|
||||
selectedChanged: function() {
|
||||
var self = this;
|
|
@ -1,13 +1,4 @@
|
|||
/**
|
||||
This view handles rendering of a user's posts
|
||||
|
||||
@class UserPostsView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@uses Discourse.LoadMore
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.UserPostsView = Discourse.View.extend(Discourse.LoadMore, {
|
||||
export default Ember.View.extend(Discourse.LoadMore, {
|
||||
loading: false,
|
||||
eyelineSelector: ".user-stream .item",
|
||||
classNames: ["user-stream"],
|
Loading…
Reference in New Issue