Remove ObjectController, Discouse Controllers + Presence
This commit is contained in:
parent
e2e3e7c0e0
commit
02a968bd27
|
@ -20,8 +20,6 @@
|
||||||
"not",
|
"not",
|
||||||
"expect",
|
"expect",
|
||||||
"equal",
|
"equal",
|
||||||
"blank",
|
|
||||||
"present",
|
|
||||||
"visit",
|
"visit",
|
||||||
"andThen",
|
"andThen",
|
||||||
"click",
|
"click",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
noOperationIsRunning: Ember.computed.not("model.isOperationRunning"),
|
noOperationIsRunning: Ember.computed.not("model.isOperationRunning"),
|
||||||
rollbackEnabled: Ember.computed.and("model.canRollback", "model.restoreEnabled", "noOperationIsRunning"),
|
rollbackEnabled: Ember.computed.and("model.canRollback", "model.restoreEnabled", "noOperationIsRunning"),
|
||||||
rollbackDisabled: Ember.computed.not("rollbackEnabled")
|
rollbackDisabled: Ember.computed.not("rollbackEnabled")
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
import BufferedContent from 'discourse/mixins/buffered-content';
|
import BufferedContent from 'discourse/mixins/buffered-content';
|
||||||
import { propertyNotEqual } from 'discourse/lib/computed';
|
import { propertyNotEqual } from 'discourse/lib/computed';
|
||||||
|
|
||||||
export default Ember.ObjectController.extend(BufferedContent, {
|
export default Ember.Controller.extend(BufferedContent, {
|
||||||
needs: ['admin-badges'],
|
needs: ['admin-badges'],
|
||||||
saving: false,
|
saving: false,
|
||||||
savingStatus: '',
|
savingStatus: '',
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Is the "send test email" button disabled?
|
Is the "send test email" button disabled?
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
export default ObjectController.extend({
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
filterEmailLogs: debounce(function() {
|
filterEmailLogs: debounce(function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
export default Ember.Controller.extend({
|
||||||
filterEmailLogs: debounce(function() {
|
filterEmailLogs: debounce(function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
Discourse.EmailLog.findAll(this.get("filter")).then(function(logs) {
|
Discourse.EmailLog.findAll(this.get("filter")).then(function(logs) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
import { propertyEqual } from 'discourse/lib/computed';
|
import { propertyEqual } from 'discourse/lib/computed';
|
||||||
|
|
||||||
export default Em.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ['adminGroupsType'],
|
needs: ['adminGroupsType'],
|
||||||
disableSave: false,
|
disableSave: false,
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
editing: false,
|
editing: false,
|
||||||
savedIpAddress: null,
|
savedIpAddress: null,
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
viewMode: 'table',
|
viewMode: 'table',
|
||||||
viewingTable: Em.computed.equal('viewMode', 'table'),
|
viewingTable: Em.computed.equal('viewMode', 'table'),
|
||||||
viewingBarChart: Em.computed.equal('viewMode', 'barChart'),
|
viewingBarChart: Em.computed.equal('viewMode', 'barChart'),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
categoryNameKey: null,
|
categoryNameKey: null,
|
||||||
needs: ['adminSiteSettings'],
|
needs: ['adminSiteSettings'],
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
|
|
||||||
export default Ember.ArrayController.extend(Presence, {
|
export default Ember.ArrayController.extend({
|
||||||
filter: null,
|
filter: null,
|
||||||
onlyOverridden: false,
|
onlyOverridden: false,
|
||||||
filtered: Ember.computed.notEmpty('filter'),
|
filtered: Ember.computed.notEmpty('filter'),
|
||||||
|
|
||||||
filterContentNow: function(category) {
|
filterContentNow: function(category) {
|
||||||
// If we have no content, don't bother filtering anything
|
// If we have no content, don't bother filtering anything
|
||||||
if (!this.present('allSiteSettings')) return;
|
if (!!Ember.isEmpty(this.get('allSiteSettings'))) return;
|
||||||
|
|
||||||
let filter;
|
let filter;
|
||||||
if (this.get('filter')) {
|
if (this.get('filter')) {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
||||||
import { propertyNotEqual, setting } from 'discourse/lib/computed';
|
import { propertyNotEqual, setting } from 'discourse/lib/computed';
|
||||||
|
|
||||||
export default ObjectController.extend(CanCheckEmails, {
|
export default Ember.Controller.extend(CanCheckEmails, {
|
||||||
editingTitle: false,
|
editingTitle: false,
|
||||||
originalPrimaryGroupId: null,
|
originalPrimaryGroupId: null,
|
||||||
availableGroups: null,
|
availableGroups: null,
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
export default Ember.Controller.extend();
|
||||||
|
|
||||||
export default ObjectController.extend();
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
|
||||||
showBadges: function() {
|
showBadges: function() {
|
||||||
return this.get('currentUser.admin') && this.siteSettings.enable_badges;
|
return this.get('currentUser.admin') && this.siteSettings.enable_badges;
|
||||||
}.property()
|
}.property()
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ["admin-flags-list"],
|
needs: ["admin-flags-list"],
|
||||||
|
|
||||||
_agreeFlag: function (actionOnPost) {
|
_agreeFlag: function (actionOnPost) {
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
|
|
||||||
import ObjectController from 'discourse/controllers/object';
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
|
||||||
needs: ["admin-flags-list"],
|
needs: ["admin-flags-list"],
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
|
|
||||||
import ObjectController from 'discourse/controllers/object';
|
export default Ember.Controller.extend(ModalFunctionality);
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality);
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import Controller from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default Controller.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ["adminBackupsLogs"],
|
needs: ["adminBackupsLogs"],
|
||||||
|
|
||||||
_startBackup: function (withUploads) {
|
_startBackup: function (withUploads) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
|
|
||||||
submitDisabled: function() {
|
submitDisabled: function() {
|
||||||
return (!this.get('reason') || this.get('reason').length < 1);
|
return (!this.get('reason') || this.get('reason').length < 1);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
previousSelected: Ember.computed.equal('selectedTab', 'previous'),
|
previousSelected: Ember.computed.equal('selectedTab', 'previous'),
|
||||||
newSelected: Ember.computed.equal('selectedTab', 'new'),
|
newSelected: Ember.computed.equal('selectedTab', 'new'),
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
wasEdited: function () {
|
wasEdited: function () {
|
||||||
if (this.blank("last_revised_at")) { return false; }
|
if (Ember.isEmpty(this.get("last_revised_at"))) { return false; }
|
||||||
var lastRevisedAt = Date.parse(this.get("last_revised_at"));
|
var lastRevisedAt = Date.parse(this.get("last_revised_at"));
|
||||||
return _.some(this.get("post_actions"), function (postAction) {
|
return _.some(this.get("post_actions"), function (postAction) {
|
||||||
return Date.parse(postAction.created_at) < lastRevisedAt;
|
return Date.parse(postAction.created_at) < lastRevisedAt;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import { renderSpinner } from 'discourse/helpers/loading-spinner';
|
import { renderSpinner } from 'discourse/helpers/loading-spinner';
|
||||||
|
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
classNames: ["admin-backups-logs"],
|
classNames: ["admin-backups-logs"],
|
||||||
|
|
||||||
_initialize: function() { this._reset(); }.on("init"),
|
_initialize: function() { this._reset(); }.on("init"),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
classNames: ["admin-backups"],
|
classNames: ["admin-backups"],
|
||||||
|
|
||||||
_hijackDownloads: function() {
|
_hijackDownloads: function() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import LoadMore from "discourse/mixins/load-more";
|
import LoadMore from "discourse/mixins/load-more";
|
||||||
|
|
||||||
export default Discourse.View.extend(LoadMore, {
|
export default Ember.View.extend(LoadMore, {
|
||||||
loading: false,
|
loading: false,
|
||||||
eyelineSelector: '.admin-flags tbody tr',
|
eyelineSelector: '.admin-flags tbody tr',
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
_disableCustomStylesheets: function() {
|
_disableCustomStylesheets: function() {
|
||||||
if (this.session.get("disableCustomCSS")) {
|
if (this.session.get("disableCustomCSS")) {
|
||||||
$("link.custom-css").attr("rel", "");
|
$("link.custom-css").attr("rel", "");
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
/**
|
Discourse.AdminCustomizeColorsView = Ember.View.extend({
|
||||||
A view to handle color selections within a site customization
|
|
||||||
|
|
||||||
@class AdminCustomizeColorsView
|
|
||||||
@extends Discourse.View
|
|
||||||
@namespace Discourse
|
|
||||||
@module Discourse
|
|
||||||
**/
|
|
||||||
Discourse.AdminCustomizeColorsView = Discourse.View.extend({
|
|
||||||
templateName: 'admin/templates/customize_colors'
|
templateName: 'admin/templates/customize_colors'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1 @@
|
||||||
/**
|
Discourse.AdminUserView = Ember.View.extend(Discourse.ScrollTop);
|
||||||
The view class for an Admin User
|
|
||||||
|
|
||||||
@class AdminUserView
|
|
||||||
@extends Discourse.View
|
|
||||||
@namespace Discourse
|
|
||||||
@module Discourse
|
|
||||||
**/
|
|
||||||
Discourse.AdminUserView = Discourse.View.extend(Discourse.ScrollTop);
|
|
||||||
|
|
||||||
|
|
|
@ -155,3 +155,9 @@ function proxyDep(propName, moduleFunc, msg) {
|
||||||
proxyDep('computed', function() { return require('discourse/lib/computed') });
|
proxyDep('computed', function() { return require('discourse/lib/computed') });
|
||||||
proxyDep('Formatter', function() { return require('discourse/lib/formatter') });
|
proxyDep('Formatter', function() { return require('discourse/lib/formatter') });
|
||||||
proxyDep('PageTracker', function() { return require('discourse/lib/page-tracker').default });
|
proxyDep('PageTracker', function() { return require('discourse/lib/page-tracker').default });
|
||||||
|
proxyDep('URL', function() { return require('discourse/lib/url').default });
|
||||||
|
proxyDep('Quote', function() { return require('discourse/lib/quote').default });
|
||||||
|
proxyDep('debounce', function() { return require('discourse/lib/debounce').default });
|
||||||
|
proxyDep('View', function() { return Ember.View }, "Use `Ember.View` instead");
|
||||||
|
proxyDep('Controller', function() { return Ember.Controller }, "Use `Ember.Controller` instead");
|
||||||
|
proxyDep('ObjectController', function() { return Ember.ObjectController }, "Use `Ember.Controller` instead");
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
uploadedAvatarTemplate: null,
|
uploadedAvatarTemplate: null,
|
||||||
saveDisabled: Em.computed.alias("uploading"),
|
saveDisabled: Em.computed.alias("uploading"),
|
||||||
hasUploadedAvatar: Em.computed.or('uploadedAvatarTemplate', 'custom_avatar_upload_id'),
|
hasUploadedAvatar: Em.computed.or('uploadedAvatarTemplate', 'custom_avatar_upload_id'),
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
export default ObjectController.extend({
|
|
||||||
noMoreBadges: false,
|
noMoreBadges: false,
|
||||||
userBadges: null,
|
userBadges: null,
|
||||||
needs: ["application"],
|
needs: ["application"],
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
// Modal related to changing the ownership of posts
|
// Modal related to changing the ownership of posts
|
||||||
export default Ember.Controller.extend(Presence, SelectedPostsCount, ModalFunctionality, {
|
export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, {
|
||||||
needs: ['topic'],
|
needs: ['topic'],
|
||||||
|
|
||||||
topicController: Em.computed.alias('controllers.topic'),
|
topicController: Em.computed.alias('controllers.topic'),
|
||||||
|
@ -14,7 +13,7 @@ export default Ember.Controller.extend(Presence, SelectedPostsCount, ModalFuncti
|
||||||
|
|
||||||
buttonDisabled: function() {
|
buttonDisabled: function() {
|
||||||
if (this.get('saving')) return true;
|
if (this.get('saving')) return true;
|
||||||
return this.blank('new_user');
|
return Ember.isEmpty(this.get('new_user'));
|
||||||
}.property('saving', 'new_user'),
|
}.property('saving', 'new_user'),
|
||||||
|
|
||||||
buttonTitle: function() {
|
buttonTitle: function() {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
import Quote from 'discourse/lib/quote';
|
import Quote from 'discourse/lib/quote';
|
||||||
import Draft from 'discourse/models/draft';
|
import Draft from 'discourse/models/draft';
|
||||||
|
|
||||||
export default Ember.ObjectController.extend(Presence, {
|
export default Ember.Controller.extend({
|
||||||
needs: ['modal', 'topic', 'composer-messages', 'application'],
|
needs: ['modal', 'topic', 'composer-messages', 'application'],
|
||||||
|
|
||||||
replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY),
|
replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY),
|
||||||
|
@ -152,7 +151,7 @@ export default Ember.ObjectController.extend(Presence, {
|
||||||
this.closeAutocomplete();
|
this.closeAutocomplete();
|
||||||
switch (this.get('model.composeState')) {
|
switch (this.get('model.composeState')) {
|
||||||
case Discourse.Composer.OPEN:
|
case Discourse.Composer.OPEN:
|
||||||
if (this.blank('model.reply') && this.blank('model.title')) {
|
if (Ember.isEmpty(this.get('model.reply')) && Ember.isEmpty(this.get('model.title'))) {
|
||||||
this.close();
|
this.close();
|
||||||
} else {
|
} else {
|
||||||
this.shrink();
|
this.shrink();
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
|
|
||||||
export default Ember.Controller.extend(Presence);
|
|
|
@ -1,9 +1,8 @@
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ['login'],
|
needs: ['login'],
|
||||||
|
|
||||||
uniqueUsernameValidation: null,
|
uniqueUsernameValidation: null,
|
||||||
|
@ -66,7 +65,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
usernameRequired: Ember.computed.not('authOptions.omit_username'),
|
usernameRequired: Ember.computed.not('authOptions.omit_username'),
|
||||||
|
|
||||||
passwordRequired: function() {
|
passwordRequired: function() {
|
||||||
return this.blank('authOptions.auth_provider');
|
return Ember.isEmpty(this.get('authOptions.auth_provider'));
|
||||||
}.property('authOptions.auth_provider'),
|
}.property('authOptions.auth_provider'),
|
||||||
|
|
||||||
passwordInstructions: function() {
|
passwordInstructions: function() {
|
||||||
|
@ -83,7 +82,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
this.fetchConfirmationValue();
|
this.fetchConfirmationValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Discourse.SiteSettings.full_name_required && this.blank('accountName')) {
|
if (Discourse.SiteSettings.full_name_required && Ember.isEmpty(this.get('accountName'))) {
|
||||||
return Discourse.InputValidation.create({ failed: true });
|
return Discourse.InputValidation.create({ failed: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +93,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
emailValidation: function() {
|
emailValidation: function() {
|
||||||
// If blank, fail without a reason
|
// If blank, fail without a reason
|
||||||
let email;
|
let email;
|
||||||
if (this.blank('accountEmail')) {
|
if (Ember.isEmpty(this.get('accountEmail'))) {
|
||||||
return Discourse.InputValidation.create({
|
return Discourse.InputValidation.create({
|
||||||
failed: true
|
failed: true
|
||||||
});
|
});
|
||||||
|
@ -144,7 +143,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
}
|
}
|
||||||
this.set('prefilledUsername', null);
|
this.set('prefilledUsername', null);
|
||||||
}
|
}
|
||||||
if (this.get('emailValidation.ok') && (this.blank('accountUsername') || this.get('authOptions.email'))) {
|
if (this.get('emailValidation.ok') && (Ember.isEmpty(this.get('accountUsername')) || this.get('authOptions.email'))) {
|
||||||
// If email is valid and username has not been entered yet,
|
// If email is valid and username has not been entered yet,
|
||||||
// or email and username were filled automatically by 3rd parth auth,
|
// or email and username were filled automatically by 3rd parth auth,
|
||||||
// then look for a registered username that matches the email.
|
// then look for a registered username that matches the email.
|
||||||
|
@ -155,7 +154,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
fetchExistingUsername: debounce(function() {
|
fetchExistingUsername: debounce(function() {
|
||||||
const self = this;
|
const self = this;
|
||||||
Discourse.User.checkUsername(null, this.get('accountEmail')).then(function(result) {
|
Discourse.User.checkUsername(null, this.get('accountEmail')).then(function(result) {
|
||||||
if (result.suggestion && (self.blank('accountUsername') || self.get('accountUsername') === self.get('authOptions.username'))) {
|
if (result.suggestion && (Ember.isEmpty(self.get('accountUsername')) || self.get('accountUsername') === self.get('authOptions.username'))) {
|
||||||
self.set('accountUsername', result.suggestion);
|
self.set('accountUsername', result.suggestion);
|
||||||
self.set('prefilledUsername', result.suggestion);
|
self.set('prefilledUsername', result.suggestion);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +193,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If blank, fail without a reason
|
// If blank, fail without a reason
|
||||||
if (this.blank('accountUsername')) {
|
if (Ember.isEmpty(this.get('accountUsername'))) {
|
||||||
return Discourse.InputValidation.create({
|
return Discourse.InputValidation.create({
|
||||||
failed: true
|
failed: true
|
||||||
});
|
});
|
||||||
|
@ -225,7 +224,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
}.property('accountUsername'),
|
}.property('accountUsername'),
|
||||||
|
|
||||||
shouldCheckUsernameMatch: function() {
|
shouldCheckUsernameMatch: function() {
|
||||||
return !this.blank('accountUsername') && this.get('accountUsername').length >= this.get('minUsernameLength');
|
return !Ember.isEmpty(this.get('accountUsername')) && this.get('accountUsername').length >= this.get('minUsernameLength');
|
||||||
},
|
},
|
||||||
|
|
||||||
checkUsernameAvailability: debounce(function() {
|
checkUsernameAvailability: debounce(function() {
|
||||||
|
@ -296,7 +295,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
|
|
||||||
// If blank, fail without a reason
|
// If blank, fail without a reason
|
||||||
const password = this.get("accountPassword");
|
const password = this.get("accountPassword");
|
||||||
if (this.blank('accountPassword')) {
|
if (Ember.isEmpty(this.get('accountPassword'))) {
|
||||||
return Discourse.InputValidation.create({ failed: true });
|
return Discourse.InputValidation.create({ failed: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,14 +314,14 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.blank('accountUsername') && this.get('accountPassword') === this.get('accountUsername')) {
|
if (!Ember.isEmpty(this.get('accountUsername')) && this.get('accountPassword') === this.get('accountUsername')) {
|
||||||
return Discourse.InputValidation.create({
|
return Discourse.InputValidation.create({
|
||||||
failed: true,
|
failed: true,
|
||||||
reason: I18n.t('user.password.same_as_username')
|
reason: I18n.t('user.password.same_as_username')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.blank('accountEmail') && this.get('accountPassword') === this.get('accountEmail')) {
|
if (!Ember.isEmpty(this.get('accountEmail')) && this.get('accountPassword') === this.get('accountEmail')) {
|
||||||
return Discourse.InputValidation.create({
|
return Discourse.InputValidation.create({
|
||||||
failed: true,
|
failed: true,
|
||||||
reason: I18n.t('user.password.same_as_email')
|
reason: I18n.t('user.password.same_as_email')
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
// Just add query params here to have them automatically passed to topic list filters.
|
// Just add query params here to have them automatically passed to topic list filters.
|
||||||
export var queryParams = {
|
export var queryParams = {
|
||||||
order: { replace: true, refreshModel: true },
|
order: { replace: true, refreshModel: true },
|
||||||
|
@ -22,4 +20,4 @@ controllerOpts.queryParams.forEach(function(p) {
|
||||||
controllerOpts[p] = Em.computed.alias('controllers.discovery/topics.' + p);
|
controllerOpts[p] = Em.computed.alias('controllers.discovery/topics.' + p);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default DiscourseController.extend(controllerOpts);
|
export default Ember.Controller.extend(controllerOpts);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ['navigation/category', 'discovery/topics', 'application'],
|
needs: ['navigation/category', 'discovery/topics', 'application'],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
// Modal for editing / creating a category
|
// Modal for editing / creating a category
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
selectedTab: null,
|
selectedTab: null,
|
||||||
saving: false,
|
saving: false,
|
||||||
deleting: false,
|
deleting: false,
|
||||||
|
@ -19,7 +18,7 @@ export default ObjectController.extend(ModalFunctionality, {
|
||||||
},
|
},
|
||||||
|
|
||||||
changeSize: function() {
|
changeSize: function() {
|
||||||
if (this.present('model.description')) {
|
if (!Ember.isEmpty(this.get('model.description'))) {
|
||||||
this.set('controllers.modal.modalClass', 'edit-category-modal full');
|
this.set('controllers.modal.modalClass', 'edit-category-modal full');
|
||||||
} else {
|
} else {
|
||||||
this.set('controllers.modal.modalClass', 'edit-category-modal small');
|
this.set('controllers.modal.modalClass', 'edit-category-modal small');
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
// Modal related to auto closing of topics
|
// Modal related to auto closing of topics
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
auto_close_valid: true,
|
auto_close_valid: true,
|
||||||
auto_close_invalid: Em.computed.not('auto_close_valid'),
|
auto_close_invalid: Em.computed.not('auto_close_valid'),
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
var ButtonBackBright = {
|
var ButtonBackBright = {
|
||||||
classes: "btn-primary",
|
classes: "btn-primary",
|
||||||
action: "back",
|
action: "back",
|
||||||
|
@ -22,7 +20,7 @@ var ButtonBackBright = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// The controller for the nice error page
|
// The controller for the nice error page
|
||||||
export default ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
thrown: null,
|
thrown: null,
|
||||||
lastTransition: null,
|
lastTransition: null,
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import { categoryLinkHTML } from 'discourse/helpers/category-link';
|
import { categoryLinkHTML } from 'discourse/helpers/category-link';
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ["topic"],
|
needs: ["topic"],
|
||||||
|
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import { MAX_MESSAGE_LENGTH } from 'discourse/models/post-action-type';
|
import { MAX_MESSAGE_LENGTH } from 'discourse/models/post-action-type';
|
||||||
|
|
||||||
// Supports logic for flags in the modal
|
// Supports logic for flags in the modal
|
||||||
export default ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ['flag'],
|
needs: ['flag'],
|
||||||
|
|
||||||
message: Em.computed.alias('controllers.flag.message'),
|
message: Em.computed.alias('controllers.flag.message'),
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import { MAX_MESSAGE_LENGTH } from 'discourse/models/post-action-type';
|
import { MAX_MESSAGE_LENGTH } from 'discourse/models/post-action-type';
|
||||||
|
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
userDetails: null,
|
userDetails: null,
|
||||||
selected: null,
|
selected: null,
|
||||||
flagTopic: null,
|
flagTopic: null,
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
|
|
||||||
// You need a value in the field to submit it.
|
// You need a value in the field to submit it.
|
||||||
submitDisabled: function() {
|
submitDisabled: function() {
|
||||||
return this.blank('accountEmailOrUsername') || this.get('disabled');
|
return Ember.isEmpty(this.get('accountEmailOrUsername')) || this.get('disabled');
|
||||||
}.property('accountEmailOrUsername', 'disabled'),
|
}.property('accountEmailOrUsername', 'disabled'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import DiscourseController from "discourse/controllers/controller";
|
|
||||||
import { translateResults } from "discourse/lib/search-for-term";
|
import { translateResults } from "discourse/lib/search-for-term";
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ["application"],
|
needs: ["application"],
|
||||||
|
|
||||||
loading: Em.computed.not("model"),
|
loading: Em.computed.not("model"),
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
const HeaderController = Ember.Controller.extend({
|
||||||
|
|
||||||
const HeaderController = DiscourseController.extend({
|
|
||||||
topic: null,
|
topic: null,
|
||||||
showExtraInfo: null,
|
showExtraInfo: null,
|
||||||
notifications: null,
|
notifications: null,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import { categoryBadgeHTML } from 'discourse/helpers/category-link';
|
import { categoryBadgeHTML } from 'discourse/helpers/category-link';
|
||||||
|
|
||||||
// This controller handles displaying of history
|
// This controller handles displaying of history
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
loading: true,
|
loading: true,
|
||||||
viewMode: "side_by_side",
|
viewMode: "side_by_side",
|
||||||
revisionsTextKey: "post.revisions.controls.comparing_previous_to_current_out_of_total",
|
revisionsTextKey: "post.revisions.controls.comparing_previous_to_current_out_of_total",
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import Invite from 'discourse/models/invite';
|
import Invite from 'discourse/models/invite';
|
||||||
|
|
||||||
export default ObjectController.extend(Presence, ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ['user-invited-show'],
|
needs: ['user-invited-show'],
|
||||||
|
|
||||||
// If this isn't defined, it will proxy to the user model on the preferences
|
// If this isn't defined, it will proxy to the user model on the preferences
|
||||||
|
@ -16,14 +14,14 @@ export default ObjectController.extend(Presence, ModalFunctionality, {
|
||||||
|
|
||||||
disabled: function() {
|
disabled: function() {
|
||||||
if (this.get('model.saving')) return true;
|
if (this.get('model.saving')) return true;
|
||||||
if (this.blank('emailOrUsername')) return true;
|
if (Ember.isEmpty(this.get('emailOrUsername'))) return true;
|
||||||
const emailOrUsername = this.get('emailOrUsername').trim();
|
const emailOrUsername = this.get('emailOrUsername').trim();
|
||||||
// when inviting to forum, email must be valid
|
// when inviting to forum, email must be valid
|
||||||
if (!this.get('invitingToTopic') && !Discourse.Utilities.emailValid(emailOrUsername)) return true;
|
if (!this.get('invitingToTopic') && !Discourse.Utilities.emailValid(emailOrUsername)) return true;
|
||||||
// normal users (not admin) can't invite users to private topic via email
|
// normal users (not admin) can't invite users to private topic via email
|
||||||
if (!this.get('isAdmin') && this.get('isPrivateTopic') && Discourse.Utilities.emailValid(emailOrUsername)) return true;
|
if (!this.get('isAdmin') && this.get('isPrivateTopic') && Discourse.Utilities.emailValid(emailOrUsername)) return true;
|
||||||
// when invting to private topic via email, group name must be specified
|
// when invting to private topic via email, group name must be specified
|
||||||
if (this.get('isPrivateTopic') && this.blank('model.groupNames') && Discourse.Utilities.emailValid(emailOrUsername)) return true;
|
if (this.get('isPrivateTopic') && Ember.isEmpty(this.get('model.groupNames')) && Discourse.Utilities.emailValid(emailOrUsername)) return true;
|
||||||
if (this.get('model.details.can_invite_to')) return false;
|
if (this.get('model.details.can_invite_to')) return false;
|
||||||
return false;
|
return false;
|
||||||
}.property('isAdmin', 'emailOrUsername', 'invitingToTopic', 'isPrivateTopic', 'model.groupNames', 'model.saving'),
|
}.property('isAdmin', 'emailOrUsername', 'invitingToTopic', 'isPrivateTopic', 'model.groupNames', 'model.saving'),
|
||||||
|
@ -71,7 +69,7 @@ export default ObjectController.extend(Presence, ModalFunctionality, {
|
||||||
return I18n.t('topic.invite_reply.to_username');
|
return I18n.t('topic.invite_reply.to_username');
|
||||||
} else {
|
} else {
|
||||||
// when inviting to a topic, display instructions based on provided entity
|
// when inviting to a topic, display instructions based on provided entity
|
||||||
if (this.blank('emailOrUsername')) {
|
if (Ember.isEmpty(this.get('emailOrUsername'))) {
|
||||||
return I18n.t('topic.invite_reply.to_topic_blank');
|
return I18n.t('topic.invite_reply.to_topic_blank');
|
||||||
} else if (Discourse.Utilities.emailValid(this.get('emailOrUsername'))) {
|
} else if (Discourse.Utilities.emailValid(this.get('emailOrUsername'))) {
|
||||||
return I18n.t('topic.invite_reply.to_topic_email');
|
return I18n.t('topic.invite_reply.to_topic_email');
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ['modal'],
|
needs: ['modal'],
|
||||||
|
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
import showModal from 'discourse/lib/show-modal';
|
import showModal from 'discourse/lib/show-modal';
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
|
|
||||||
|
@ -8,7 +7,7 @@ const AuthErrors =
|
||||||
['requires_invite', 'awaiting_approval', 'awaiting_confirmation', 'admin_not_allowed_from_ip_address',
|
['requires_invite', 'awaiting_approval', 'awaiting_confirmation', 'admin_not_allowed_from_ip_address',
|
||||||
'not_allowed_from_ip_address'];
|
'not_allowed_from_ip_address'];
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ['modal', 'createAccount', 'forgotPassword', 'application'],
|
needs: ['modal', 'createAccount', 'forgotPassword', 'application'],
|
||||||
authenticate: null,
|
authenticate: null,
|
||||||
loggingIn: false,
|
loggingIn: false,
|
||||||
|
@ -39,7 +38,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
showSignupLink: function() {
|
showSignupLink: function() {
|
||||||
return this.get('controllers.application.canSignUp') &&
|
return this.get('controllers.application.canSignUp') &&
|
||||||
!this.get('loggingIn') &&
|
!this.get('loggingIn') &&
|
||||||
this.blank('authenticate');
|
Ember.isEmpty(this.get('authenticate'));
|
||||||
}.property('loggingIn', 'authenticate'),
|
}.property('loggingIn', 'authenticate'),
|
||||||
|
|
||||||
showSpinner: function() {
|
showSpinner: function() {
|
||||||
|
@ -50,7 +49,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
login: function() {
|
login: function() {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if(this.blank('loginName') || this.blank('loginPassword')){
|
if(Ember.isEmpty(this.get('loginName')) || Ember.isEmpty(this.get('loginPassword'))){
|
||||||
self.flash(I18n.t('login.blank_username_or_password'), 'error');
|
self.flash(I18n.t('login.blank_username_or_password'), 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +153,7 @@ export default DiscourseController.extend(ModalFunctionality, {
|
||||||
},
|
},
|
||||||
|
|
||||||
authMessage: (function() {
|
authMessage: (function() {
|
||||||
if (this.blank('authenticate')) return "";
|
if (Ember.isEmpty(this.get('authenticate'))) return "";
|
||||||
const method = Discourse.get('LoginMethod.all').findProperty("name", this.get("authenticate"));
|
const method = Discourse.get('LoginMethod.all').findProperty("name", this.get("authenticate"));
|
||||||
if(method){
|
if(method){
|
||||||
return method.get('message');
|
return method.get('message');
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import { movePosts, mergeTopic } from 'discourse/models/topic';
|
import { movePosts, mergeTopic } from 'discourse/models/topic';
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
// Modal related to merging of topics
|
// Modal related to merging of topics
|
||||||
export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, Presence, {
|
export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, {
|
||||||
needs: ['topic'],
|
needs: ['topic'],
|
||||||
|
|
||||||
saving: false,
|
saving: false,
|
||||||
|
@ -18,7 +17,7 @@ export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, P
|
||||||
|
|
||||||
buttonDisabled: function() {
|
buttonDisabled: function() {
|
||||||
if (this.get('saving')) return true;
|
if (this.get('saving')) return true;
|
||||||
return this.blank('selectedTopicId');
|
return Ember.isEmpty(this.get('selectedTopicId'));
|
||||||
}.property('selectedTopicId', 'saving'),
|
}.property('selectedTopicId', 'saving'),
|
||||||
|
|
||||||
buttonTitle: function() {
|
buttonTitle: function() {
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
export default Ember.Controller.extend();
|
||||||
|
|
||||||
export default DiscourseController.extend({});
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
|
||||||
needs: ['discovery', 'discovery/topics'],
|
needs: ['discovery', 'discovery/topics'],
|
||||||
|
|
||||||
categories: function() {
|
categories: function() {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
emailSent: false,
|
emailSent: false,
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
|
|
||||||
export default Ember.ObjectController.extend(Presence);
|
|
|
@ -1,9 +1,8 @@
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
||||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
|
|
||||||
export default ObjectController.extend(CanCheckEmails, {
|
export default Ember.Controller.extend(CanCheckEmails, {
|
||||||
|
|
||||||
allowAvatarUpload: setting('allow_uploaded_avatars'),
|
allowAvatarUpload: setting('allow_uploaded_avatars'),
|
||||||
allowUserLocale: setting('allow_user_locale'),
|
allowUserLocale: setting('allow_user_locale'),
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
export default Ember.Controller.extend({
|
||||||
|
|
||||||
export default ObjectController.extend({
|
|
||||||
saving: false,
|
saving: false,
|
||||||
newBio: null,
|
newBio: null,
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { propertyEqual } from 'discourse/lib/computed';
|
import { propertyEqual } from 'discourse/lib/computed';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
export default ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
taken: false,
|
taken: false,
|
||||||
saving: false,
|
saving: false,
|
||||||
error: false,
|
error: false,
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import { setting, propertyEqual } from 'discourse/lib/computed';
|
import { setting, propertyEqual } from 'discourse/lib/computed';
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
export default ObjectController.extend(Presence, {
|
export default Ember.Controller.extend({
|
||||||
taken: false,
|
taken: false,
|
||||||
saving: false,
|
saving: false,
|
||||||
error: false,
|
error: false,
|
||||||
|
@ -23,7 +21,7 @@ export default ObjectController.extend(Presence, {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.set('taken', false);
|
this.set('taken', false);
|
||||||
this.set('errorMessage', null);
|
this.set('errorMessage', null);
|
||||||
if (this.blank('newUsername')) return;
|
if (Ember.isEmpty(this.get('newUsername'))) return;
|
||||||
if (this.get('unchanged')) return;
|
if (this.get('unchanged')) return;
|
||||||
Discourse.User.checkUsername(this.get('newUsername'), undefined, this.get('content.id')).then(function(result) {
|
Discourse.User.checkUsername(this.get('newUsername'), undefined, this.get('content.id')).then(function(result) {
|
||||||
if (result.errors) {
|
if (result.errors) {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
import loadScript from 'discourse/lib/load-script';
|
import loadScript from 'discourse/lib/load-script';
|
||||||
import Quote from 'discourse/lib/quote';
|
import Quote from 'discourse/lib/quote';
|
||||||
|
|
||||||
export default DiscourseController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ['topic', 'composer'],
|
needs: ['topic', 'composer'],
|
||||||
|
|
||||||
_loadSanitizer: function() {
|
_loadSanitizer: function() {
|
||||||
|
@ -11,7 +10,7 @@ export default DiscourseController.extend({
|
||||||
|
|
||||||
// If the buffer is cleared, clear out other state (post)
|
// If the buffer is cleared, clear out other state (post)
|
||||||
bufferChanged: function() {
|
bufferChanged: function() {
|
||||||
if (this.blank('buffer')) this.set('post', null);
|
if (Ember.isEmpty(this.get('buffer'))) this.set('post', null);
|
||||||
}.observes('buffer'),
|
}.observes('buffer'),
|
||||||
|
|
||||||
// Save the currently selected text and displays the
|
// Save the currently selected text and displays the
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
// This controller handles displaying of raw email
|
// This controller handles displaying of raw email
|
||||||
export default ObjectController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
rawEmail: "",
|
rawEmail: "",
|
||||||
|
|
||||||
loadRawEmail: function(postId) {
|
loadRawEmail: function(postId) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
needs: ['modal'],
|
needs: ['modal'],
|
||||||
|
|
||||||
showGoogleSearch: function() {
|
showGoogleSearch: function() {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import searchForTerm from 'discourse/lib/search-for-term';
|
import searchForTerm from 'discourse/lib/search-for-term';
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
let _dontSearch = false;
|
let _dontSearch = false;
|
||||||
|
|
||||||
export default Em.Controller.extend(Presence, {
|
export default Em.Controller.extend({
|
||||||
typeFilter: null,
|
typeFilter: null,
|
||||||
|
|
||||||
contextType: function(key, value){
|
contextType: function(key, value){
|
||||||
|
@ -115,7 +114,7 @@ export default Em.Controller.extend(Presence, {
|
||||||
|
|
||||||
showCancelFilter: function() {
|
showCancelFilter: function() {
|
||||||
if (this.get('loading')) return false;
|
if (this.get('loading')) return false;
|
||||||
return this.present('typeFilter');
|
return !Ember.isEmpty(this.get('typeFilter'));
|
||||||
}.property('typeFilter', 'loading'),
|
}.property('typeFilter', 'loading'),
|
||||||
|
|
||||||
termChanged: function() {
|
termChanged: function() {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
|
||||||
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import { extractError } from 'discourse/lib/ajax-error';
|
import { extractError } from 'discourse/lib/ajax-error';
|
||||||
|
@ -6,7 +5,7 @@ import { movePosts } from 'discourse/models/topic';
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
// Modal related to auto closing of topics
|
// Modal related to auto closing of topics
|
||||||
export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, Presence, {
|
export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, {
|
||||||
needs: ['topic'],
|
needs: ['topic'],
|
||||||
topicName: null,
|
topicName: null,
|
||||||
saving: false,
|
saving: false,
|
||||||
|
@ -19,7 +18,7 @@ export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, P
|
||||||
|
|
||||||
buttonDisabled: function() {
|
buttonDisabled: function() {
|
||||||
if (this.get('saving')) return true;
|
if (this.get('saving')) return true;
|
||||||
return this.blank('topicName');
|
return Ember.isEmpty(this.get('topicName'));
|
||||||
}.property('saving', 'topicName'),
|
}.property('saving', 'topicName'),
|
||||||
|
|
||||||
buttonTitle: function() {
|
buttonTitle: function() {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
// This controller supports the admin menu on topics
|
// This controller supports the admin menu on topics
|
||||||
export default ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
menuVisible: false,
|
menuVisible: false,
|
||||||
showRecover: Em.computed.and('model.deleted', 'model.details.can_recover'),
|
showRecover: Em.computed.and('model.deleted', 'model.details.can_recover'),
|
||||||
isFeatured: Em.computed.or("model.pinned_at", "model.isBanner"),
|
isFeatured: Em.computed.or("model.pinned_at", "model.isBanner"),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ['topic'],
|
needs: ['topic'],
|
||||||
progressPosition: null,
|
progressPosition: null,
|
||||||
expanded: false,
|
expanded: false,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import BufferedContent from 'discourse/mixins/buffered-content';
|
import BufferedContent from 'discourse/mixins/buffered-content';
|
||||||
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
||||||
import { spinnerHTML } from 'discourse/helpers/loading-spinner';
|
import { spinnerHTML } from 'discourse/helpers/loading-spinner';
|
||||||
|
@ -6,7 +5,7 @@ import Topic from 'discourse/models/topic';
|
||||||
import Quote from 'discourse/lib/quote';
|
import Quote from 'discourse/lib/quote';
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
|
|
||||||
export default ObjectController.extend(SelectedPostsCount, BufferedContent, {
|
export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
needs: ['header', 'modal', 'composer', 'quote-button', 'search', 'topic-progress', 'application'],
|
needs: ['header', 'modal', 'composer', 'quote-button', 'search', 'topic-progress', 'application'],
|
||||||
allPostsSelected: false,
|
allPostsSelected: false,
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import DiscourseController from 'discourse/controllers/controller';
|
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
|
|
||||||
export default DiscourseController.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
remote: Em.computed.not("local"),
|
remote: Em.computed.not("local"),
|
||||||
local: false,
|
local: false,
|
||||||
showMore: false,
|
showMore: false,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
userActionType: null,
|
userActionType: null,
|
||||||
needs: ["application"],
|
needs: ["application"],
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import Invite from 'discourse/models/invite';
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
|
|
||||||
// This controller handles actions related to a user's invitations
|
// This controller handles actions related to a user's invitations
|
||||||
export default Ember.ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
user: null,
|
user: null,
|
||||||
model: null,
|
model: null,
|
||||||
filter: null,
|
filter: null,
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
|
|
||||||
// Lists of topics on a user's page.
|
// Lists of topics on a user's page.
|
||||||
export default ObjectController.extend({
|
export default Ember.Controller.extend({
|
||||||
needs: ["application", "user"],
|
needs: ["application", "user"],
|
||||||
hideCategory: false,
|
hideCategory: false,
|
||||||
showParticipants: false,
|
showParticipants: false,
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { exportUserArchive } from 'discourse/lib/export-csv';
|
import { exportUserArchive } from 'discourse/lib/export-csv';
|
||||||
import ObjectController from 'discourse/controllers/object';
|
|
||||||
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
||||||
|
|
||||||
export default ObjectController.extend(CanCheckEmails, {
|
export default Ember.Controller.extend(CanCheckEmails, {
|
||||||
indexStream: false,
|
indexStream: false,
|
||||||
pmView: false,
|
pmView: false,
|
||||||
userActionType: null,
|
userActionType: null,
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
import DiscourseURL from 'discourse/lib/url';
|
|
||||||
import Quote from 'discourse/lib/quote';
|
|
||||||
import debounce from 'discourse/lib/debounce';
|
|
||||||
|
|
||||||
function proxyDep(propName, module) {
|
|
||||||
if (Discourse.hasOwnProperty(propName)) { return; }
|
|
||||||
Object.defineProperty(Discourse, propName, {
|
|
||||||
get: function() {
|
|
||||||
Ember.warn(`DEPRECATION: \`Discourse.${propName}\` is deprecated, import the module.`);
|
|
||||||
return module;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'es6-deprecations',
|
|
||||||
before: 'inject-objects',
|
|
||||||
|
|
||||||
initialize: function() {
|
|
||||||
// TODO: Once things have migrated remove these
|
|
||||||
proxyDep('computed', require('discourse/lib/computed'));
|
|
||||||
proxyDep('Formatter', require('discourse/lib/formatter'));
|
|
||||||
proxyDep('URL', DiscourseURL);
|
|
||||||
proxyDep('Quote', Quote);
|
|
||||||
proxyDep('debounce', debounce);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,20 +0,0 @@
|
||||||
/**
|
|
||||||
This mixin provides `blank` and `present` to determine whether properties are
|
|
||||||
there, accounting for more cases than just null and undefined.
|
|
||||||
**/
|
|
||||||
export default Ember.Mixin.create({
|
|
||||||
|
|
||||||
/**
|
|
||||||
Returns whether a property is blank. It considers empty arrays, string, objects, undefined and null
|
|
||||||
to be blank, otherwise true.
|
|
||||||
*/
|
|
||||||
blank(name) {
|
|
||||||
return Ember.isEmpty(this[name] || this.get(name));
|
|
||||||
},
|
|
||||||
|
|
||||||
// Returns whether a property is present. A present property is the opposite of a `blank` one.
|
|
||||||
present(name) {
|
|
||||||
return !this.blank(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
const Model = Ember.Object.extend();
|
||||||
|
|
||||||
const Model = Ember.Object.extend(Presence);
|
|
||||||
|
|
||||||
Model.reopenClass({
|
Model.reopenClass({
|
||||||
extractByKey: function(collection, klass) {
|
extractByKey: function(collection, klass) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ const Post = RestModel.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
internalLinks: function() {
|
internalLinks: function() {
|
||||||
if (this.blank('link_counts')) return null;
|
if (Ember.isEmpty(this.get('link_counts'))) return null;
|
||||||
return this.get('link_counts').filterProperty('internal').filterProperty('title');
|
return this.get('link_counts').filterProperty('internal').filterProperty('title');
|
||||||
}.property('link_counts.@each.internal'),
|
}.property('link_counts.@each.internal'),
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ const Post = RestModel.extend({
|
||||||
}.property('actions_summary.@each.can_act'),
|
}.property('actions_summary.@each.can_act'),
|
||||||
|
|
||||||
actionsWithoutLikes: function() {
|
actionsWithoutLikes: function() {
|
||||||
if (!this.present('actions_summary')) return null;
|
if (!!Ember.isEmpty(this.get('actions_summary'))) return null;
|
||||||
|
|
||||||
return this.get('actions_summary').filter(function(i) {
|
return this.get('actions_summary').filter(function(i) {
|
||||||
if (i.get('count') === 0) return false;
|
if (i.get('count') === 0) return false;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
const RestModel = Ember.Object.extend({
|
||||||
|
|
||||||
const RestModel = Ember.Object.extend(Presence, {
|
|
||||||
isNew: Ember.computed.equal('__state', 'new'),
|
isNew: Ember.computed.equal('__state', 'new'),
|
||||||
isCreated: Ember.computed.equal('__state', 'created'),
|
isCreated: Ember.computed.equal('__state', 'created'),
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
|
|
|
@ -35,7 +35,7 @@ const TopicDetails = RestModel.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
fewParticipants: function() {
|
fewParticipants: function() {
|
||||||
if (!this.present('participants')) return null;
|
if (!!Ember.isEmpty(this.get('participants'))) return null;
|
||||||
return this.get('participants').slice(0, 3);
|
return this.get('participants').slice(0, 3);
|
||||||
}.property('participants'),
|
}.property('participants'),
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ const User = RestModel.extend({
|
||||||
@type {String}
|
@type {String}
|
||||||
**/
|
**/
|
||||||
displayName: function() {
|
displayName: function() {
|
||||||
if (Discourse.SiteSettings.enable_names && !this.blank('name')) {
|
if (Discourse.SiteSettings.enable_names && !Ember.isEmpty(this.get('name'))) {
|
||||||
return this.get('name');
|
return this.get('name');
|
||||||
}
|
}
|
||||||
return this.get('username');
|
return this.get('username');
|
||||||
|
@ -263,7 +263,7 @@ const User = RestModel.extend({
|
||||||
statsCountNonPM: function() {
|
statsCountNonPM: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
if (this.blank('statsExcludingPms')) return 0;
|
if (Ember.isEmpty(this.get('statsExcludingPms'))) return 0;
|
||||||
var count = 0;
|
var count = 0;
|
||||||
_.each(this.get('statsExcludingPms'), function(val) {
|
_.each(this.get('statsExcludingPms'), function(val) {
|
||||||
if (self.inAllStream(val)){
|
if (self.inAllStream(val)){
|
||||||
|
@ -275,7 +275,7 @@ const User = RestModel.extend({
|
||||||
|
|
||||||
// The user's stats, excluding PMs.
|
// The user's stats, excluding PMs.
|
||||||
statsExcludingPms: function() {
|
statsExcludingPms: function() {
|
||||||
if (this.blank('stats')) return [];
|
if (Ember.isEmpty(this.get('stats'))) return [];
|
||||||
return this.get('stats').rejectProperty('isPM');
|
return this.get('stats').rejectProperty('isPM');
|
||||||
}.property('stats.@each.isPM'),
|
}.property('stats.@each.isPM'),
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ export default Discourse.Route.extend({
|
||||||
});
|
});
|
||||||
DiscourseURL.jumpToPost(closest);
|
DiscourseURL.jumpToPost(closest);
|
||||||
|
|
||||||
if (topic.present('draft')) {
|
if (!Ember.isEmpty(topic.get('draft'))) {
|
||||||
composerController.open({
|
composerController.open({
|
||||||
draft: Draft.getLocal(topic.get('draft_key'), topic.get('draft')),
|
draft: Draft.getLocal(topic.get('draft_key'), topic.get('draft')),
|
||||||
draftKey: topic.get('draft_key'),
|
draftKey: topic.get('draft_key'),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import LoadMore from "discourse/mixins/load-more";
|
import LoadMore from "discourse/mixins/load-more";
|
||||||
|
|
||||||
export default Discourse.View.extend(LoadMore, {
|
export default Ember.View.extend(LoadMore, {
|
||||||
eyelineSelector: '.badge-user',
|
eyelineSelector: '.badge-user',
|
||||||
tickOrX: function(field){
|
tickOrX: function(field){
|
||||||
var icon = this.get('controller.model.' + field) ? "fa-check" : "fa-times";
|
var icon = this.get('controller.model.' + field) ? "fa-check" : "fa-times";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import StringBuffer from 'discourse/mixins/string-buffer';
|
import StringBuffer from 'discourse/mixins/string-buffer';
|
||||||
|
|
||||||
export default Discourse.View.extend(StringBuffer, {
|
export default Ember.View.extend(StringBuffer, {
|
||||||
tagName: 'button',
|
tagName: 'button',
|
||||||
classNameBindings: [':btn', ':standard', 'dropDownToggle'],
|
classNameBindings: [':btn', ':standard', 'dropDownToggle'],
|
||||||
attributeBindings: ['title', 'data-toggle', 'data-share-url'],
|
attributeBindings: ['title', 'data-toggle', 'data-share-url'],
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import searchForTerm from 'discourse/lib/search-for-term';
|
import searchForTerm from 'discourse/lib/search-for-term';
|
||||||
|
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
templateName: 'choose_topic',
|
templateName: 'choose_topic',
|
||||||
|
|
||||||
topicTitleChanged: function() {
|
topicTitleChanged: function() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ export default Ember.CollectionView.extend({
|
||||||
|
|
||||||
hidden: Em.computed.not('controller.controllers.composer.model.viewOpen'),
|
hidden: Em.computed.not('controller.controllers.composer.model.viewOpen'),
|
||||||
|
|
||||||
itemViewClass: Discourse.View.extend({
|
itemViewClass: Ember.View.extend({
|
||||||
classNames: ['composer-popup', 'hidden'],
|
classNames: ['composer-popup', 'hidden'],
|
||||||
templateName: Em.computed.alias('content.templateName'),
|
templateName: Em.computed.alias('content.templateName'),
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import positioningWorkaround from 'discourse/lib/safari-hacks';
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import { linkSeenMentions, fetchUnseenMentions } from 'discourse/lib/link-mentions';
|
import { linkSeenMentions, fetchUnseenMentions } from 'discourse/lib/link-mentions';
|
||||||
|
|
||||||
const ComposerView = Discourse.View.extend(Ember.Evented, {
|
const ComposerView = Ember.View.extend(Ember.Evented, {
|
||||||
_lastKeyTimeout: null,
|
_lastKeyTimeout: null,
|
||||||
templateName: 'composer',
|
templateName: 'composer',
|
||||||
elementId: 'reply-control',
|
elementId: 'reply-control',
|
||||||
|
@ -38,7 +38,7 @@ const ComposerView = Discourse.View.extend(Ember.Evented, {
|
||||||
}.observes('loading'),
|
}.observes('loading'),
|
||||||
|
|
||||||
postMade: function() {
|
postMade: function() {
|
||||||
return this.present('model.createdPost') ? 'created-post' : null;
|
return !Ember.isEmpty(this.get('model.createdPost')) ? 'created-post' : null;
|
||||||
}.property('model.createdPost'),
|
}.property('model.createdPost'),
|
||||||
|
|
||||||
refreshPreview: debounce(function() {
|
refreshPreview: debounce(function() {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
export default Ember.ContainerView.extend({
|
||||||
|
|
||||||
export default Ember.ContainerView.extend(Presence, {
|
|
||||||
|
|
||||||
attachViewWithArgs(viewArgs, viewClass) {
|
attachViewWithArgs(viewArgs, viewClass) {
|
||||||
if (!viewClass) { viewClass = Ember.View.extend(); }
|
if (!viewClass) { viewClass = Ember.View.extend(); }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
import UrlRefresh from 'discourse/mixins/url-refresh';
|
||||||
|
|
||||||
export default Discourse.View.extend(UrlRefresh, {
|
export default Ember.View.extend(UrlRefresh, {
|
||||||
_addBodyClass: function() {
|
_addBodyClass: function() {
|
||||||
$('body').addClass('categories-list');
|
$('body').addClass('categories-list');
|
||||||
}.on('didInsertElement'),
|
}.on('didInsertElement'),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
import UrlRefresh from 'discourse/mixins/url-refresh';
|
||||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
import ScrollTop from 'discourse/mixins/scroll-top';
|
||||||
|
|
||||||
export default Discourse.View.extend(ScrollTop, UrlRefresh);
|
export default Ember.View.extend(ScrollTop, UrlRefresh);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
import UrlRefresh from 'discourse/mixins/url-refresh';
|
||||||
import LoadMore from "discourse/mixins/load-more";
|
import LoadMore from "discourse/mixins/load-more";
|
||||||
|
|
||||||
export default Discourse.View.extend(LoadMore, UrlRefresh, {
|
export default Ember.View.extend(LoadMore, UrlRefresh, {
|
||||||
eyelineSelector: '.topic-list-item',
|
eyelineSelector: '.topic-list-item',
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
import ScrollTop from 'discourse/mixins/scroll-top';
|
||||||
import LoadMore from "discourse/mixins/load-more";
|
import LoadMore from "discourse/mixins/load-more";
|
||||||
|
|
||||||
export default Discourse.View.extend(ScrollTop, LoadMore, {
|
export default Ember.View.extend(ScrollTop, LoadMore, {
|
||||||
eyelineSelector: '.user-stream .item',
|
eyelineSelector: '.user-stream .item',
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
import ScrollTop from 'discourse/mixins/scroll-top';
|
||||||
import LoadMore from "discourse/mixins/load-more";
|
import LoadMore from "discourse/mixins/load-more";
|
||||||
|
|
||||||
export default Discourse.View.extend(ScrollTop, LoadMore, {
|
export default Ember.View.extend(ScrollTop, LoadMore, {
|
||||||
eyelineSelector: '.group-members tr',
|
eyelineSelector: '.group-members tr',
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import Presence from 'discourse/mixins/presence';
|
export default Ember.View.extend({
|
||||||
|
|
||||||
export default Ember.View.extend(Presence, {
|
|
||||||
_groupInit: function() {
|
_groupInit: function() {
|
||||||
this.set('context', this.get('content'));
|
this.set('context', this.get('content'));
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
let originalZIndex;
|
let originalZIndex;
|
||||||
|
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
tagName: 'header',
|
tagName: 'header',
|
||||||
classNames: ['d-header', 'clearfix'],
|
classNames: ['d-header', 'clearfix'],
|
||||||
classNameBindings: ['editingTopic'],
|
classNameBindings: ['editingTopic'],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
focusInput: true,
|
focusInput: true,
|
||||||
|
|
||||||
_setupModal: function() {
|
_setupModal: function() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
classNames: ['quote-button'],
|
classNames: ['quote-button'],
|
||||||
classNameBindings: ['visible'],
|
classNameBindings: ['visible'],
|
||||||
isMouseDown: false,
|
isMouseDown: false,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
classNames: ['d-dropdown'],
|
classNames: ['d-dropdown'],
|
||||||
elementId: 'search-dropdown',
|
elementId: 'search-dropdown',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
elementId: 'selected-posts',
|
elementId: 'selected-posts',
|
||||||
classNameBindings: ['customVisibility'],
|
classNameBindings: ['customVisibility'],
|
||||||
templateName: "selected-posts",
|
templateName: "selected-posts",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
templateName: 'share',
|
templateName: 'share',
|
||||||
elementId: 'share-link',
|
elementId: 'share-link',
|
||||||
classNameBindings: ['hasLink'],
|
classNameBindings: ['hasLink'],
|
||||||
|
@ -15,13 +15,13 @@ export default Discourse.View.extend({
|
||||||
}.property('controller.type', 'controller.postNumber'),
|
}.property('controller.type', 'controller.postNumber'),
|
||||||
|
|
||||||
hasLink: function() {
|
hasLink: function() {
|
||||||
if (this.present('controller.link')) return 'visible';
|
if (!Ember.isEmpty(this.get('controller.link'))) return 'visible';
|
||||||
return null;
|
return null;
|
||||||
}.property('controller.link'),
|
}.property('controller.link'),
|
||||||
|
|
||||||
linkChanged: function() {
|
linkChanged: function() {
|
||||||
const self = this;
|
const self = this;
|
||||||
if (this.present('controller.link')) {
|
if (!Ember.isEmpty(this.get('controller.link'))) {
|
||||||
Em.run.next(function() {
|
Em.run.next(function() {
|
||||||
if (!self.capabilities.touch) {
|
if (!self.capabilities.touch) {
|
||||||
var $linkInput = $('#share-link input');
|
var $linkInput = $('#share-link input');
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
This view is used for rendering the topic admin menu
|
This view is used for rendering the topic admin menu
|
||||||
|
|
||||||
@class TopicAdminMenuView
|
@class TopicAdminMenuView
|
||||||
@extends Discourse.View
|
@extends Ember.View
|
||||||
@namespace Discourse
|
@namespace Discourse
|
||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
export default Discourse.View.extend({
|
export default Ember.View.extend({
|
||||||
classNameBindings: ["controller.menuVisible::hidden", ":topic-admin-menu"],
|
classNameBindings: ["controller.menuVisible::hidden", ":topic-admin-menu"],
|
||||||
|
|
||||||
_setup: function() {
|
_setup: function() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import StringBuffer from 'discourse/mixins/string-buffer';
|
import StringBuffer from 'discourse/mixins/string-buffer';
|
||||||
|
|
||||||
export default Discourse.View.extend(StringBuffer, {
|
export default Ember.View.extend(StringBuffer, {
|
||||||
elementId: 'topic-closing-info',
|
elementId: 'topic-closing-info',
|
||||||
delayedRerender: null,
|
delayedRerender: null,
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ export default Discourse.View.extend(StringBuffer, {
|
||||||
'topic.details.auto_close_hours'],
|
'topic.details.auto_close_hours'],
|
||||||
|
|
||||||
renderString: function(buffer) {
|
renderString: function(buffer) {
|
||||||
if (!this.present('topic.details.auto_close_at')) return;
|
if (!!Ember.isEmpty(this.get('topic.details.auto_close_at'))) return;
|
||||||
if (this.get("topic.closed")) return;
|
if (this.get("topic.closed")) return;
|
||||||
|
|
||||||
var autoCloseAt = moment(this.get('topic.details.auto_close_at'));
|
var autoCloseAt = moment(this.get('topic.details.auto_close_at'));
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue