mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Ember.keys
is deprected in favor of Object.keys
This commit is contained in:
parent
187d7d6f96
commit
400c061046
15 changed files with 19 additions and 19 deletions
|
@ -107,7 +107,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
|
||||
$('noscript').remove();
|
||||
|
||||
Ember.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
Object.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
if (/\/pre\-initializers\//.test(key)) {
|
||||
var module = require(key, null, null, true);
|
||||
if (!module) { throw new Error(key + ' must export an initializer.'); }
|
||||
|
@ -115,7 +115,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
}
|
||||
});
|
||||
|
||||
Ember.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
Object.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
if (/\/initializers\//.test(key)) {
|
||||
var module = require(key, null, null, true);
|
||||
if (!module) { throw new Error(key + ' must export an initializer.'); }
|
||||
|
|
|
@ -218,7 +218,7 @@ export default Ember.Component.extend({
|
|||
const mouseTrap = Mousetrap(this.$('.d-editor-input')[0]);
|
||||
|
||||
const shortcuts = this.get('toolbar.shortcuts');
|
||||
Ember.keys(shortcuts).forEach(sc => {
|
||||
Object.keys(shortcuts).forEach(sc => {
|
||||
const button = shortcuts[sc];
|
||||
mouseTrap.bind(sc, () => {
|
||||
this.send(button.action, button);
|
||||
|
@ -244,7 +244,7 @@ export default Ember.Component.extend({
|
|||
this.appEvents.off('composer:insert-text');
|
||||
|
||||
const mouseTrap = this._mouseTrap;
|
||||
Ember.keys(this.get('toolbar.shortcuts')).forEach(sc => mouseTrap.unbind(sc));
|
||||
Object.keys(this.get('toolbar.shortcuts')).forEach(sc => mouseTrap.unbind(sc));
|
||||
this.$('.d-editor-preview').off('click.preview');
|
||||
},
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export var queryParams = {
|
|||
// Basic controller options
|
||||
var controllerOpts = {
|
||||
needs: ['discovery/topics'],
|
||||
queryParams: Ember.keys(queryParams),
|
||||
queryParams: Object.keys(queryParams),
|
||||
};
|
||||
|
||||
// Aliases for the values
|
||||
|
|
|
@ -142,7 +142,7 @@ const controllerOpts = {
|
|||
|
||||
};
|
||||
|
||||
Ember.keys(queryParams).forEach(function(p) {
|
||||
Object.keys(queryParams).forEach(function(p) {
|
||||
// If we don't have a default value, initialize it to null
|
||||
if (typeof controllerOpts[p] === 'undefined') {
|
||||
controllerOpts[p] = null;
|
||||
|
|
|
@ -70,7 +70,7 @@ export default Ember.DefaultResolver.extend({
|
|||
// If we end with the name we want, use it. This allows us to define components within plugins.
|
||||
const suffix = parsedName.type + 's/' + parsedName.fullNameWithoutType,
|
||||
dashed = Ember.String.dasherize(suffix),
|
||||
moduleName = Ember.keys(requirejs.entries).find(function(e) {
|
||||
moduleName = Object.keys(requirejs.entries).find(function(e) {
|
||||
return (e.indexOf(suffix, e.length - suffix.length) !== -1) ||
|
||||
(e.indexOf(dashed, e.length - dashed.length) !== -1);
|
||||
});
|
||||
|
|
|
@ -60,7 +60,7 @@ function findOutlets(collection, callback) {
|
|||
|
||||
const disabledPlugins = Discourse.Site.currentProp('disabled_plugins') || [];
|
||||
|
||||
Ember.keys(collection).forEach(function(res) {
|
||||
Object.keys(collection).forEach(function(res) {
|
||||
if (res.indexOf("/connectors/") !== -1) {
|
||||
// Skip any disabled plugins
|
||||
for (let i=0; i<disabledPlugins.length; i++) {
|
||||
|
|
|
@ -6,7 +6,7 @@ function resolveParams(ctx, options) {
|
|||
|
||||
if (hash) {
|
||||
if (options.hashTypes) {
|
||||
Ember.keys(hash).forEach(function(k) {
|
||||
Object.keys(hash).forEach(function(k) {
|
||||
const type = options.hashTypes[k];
|
||||
if (type === "STRING" || type === "StringLiteral") {
|
||||
params[k] = hash[k];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export function autoLoadModules() {
|
||||
Ember.keys(requirejs.entries).forEach(entry => {
|
||||
Object.keys(requirejs.entries).forEach(entry => {
|
||||
if ((/\/helpers\//).test(entry)) {
|
||||
require(entry, null, null, true);
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ const Post = RestModel.extend({
|
|||
// Put the metaData into the request
|
||||
if (metaData) {
|
||||
data.meta_data = {};
|
||||
Ember.keys(metaData).forEach(function(key) { data.meta_data[key] = metaData.get(key); });
|
||||
Object.keys(metaData).forEach(function(key) { data.meta_data[key] = metaData.get(key); });
|
||||
}
|
||||
|
||||
return data;
|
||||
|
|
|
@ -41,7 +41,7 @@ const Site = RestModel.extend({
|
|||
}
|
||||
});
|
||||
|
||||
Ember.keys(remaining).forEach(parentCategoryId => {
|
||||
Object.keys(remaining).forEach(parentCategoryId => {
|
||||
const category = result.findBy('id', parseInt(parentCategoryId, 10)),
|
||||
index = result.indexOf(category);
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ const User = RestModel.extend({
|
|||
},
|
||||
|
||||
copy() {
|
||||
return Discourse.User.create(this.getProperties(Ember.keys(this)));
|
||||
return Discourse.User.create(this.getProperties(Object.keys(this)));
|
||||
},
|
||||
|
||||
save() {
|
||||
|
|
|
@ -15,7 +15,7 @@ export function mapRoutes() {
|
|||
// will be built automatically. You can supply a `resource` property to
|
||||
// automatically put it in that resource, such as `admin`. That way plugins
|
||||
// can define admin routes.
|
||||
Ember.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
Object.keys(requirejs._eak_seen).forEach(function(key) {
|
||||
if (/route-map$/.test(key)) {
|
||||
var module = require(key, null, null, true);
|
||||
if (!module || !module.default) { throw new Error(key + ' must export a route map.'); }
|
||||
|
|
|
@ -4,7 +4,7 @@ import { queryParams } from 'discourse/controllers/discovery-sortable';
|
|||
function filterQueryParams(params, defaultParams) {
|
||||
const findOpts = defaultParams || {};
|
||||
if (params) {
|
||||
Ember.keys(queryParams).forEach(function(opt) {
|
||||
Object.keys(queryParams).forEach(function(opt) {
|
||||
if (params[opt]) { findOpts[opt] = params[opt]; }
|
||||
});
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ function findTopicList(store, tracking, filter, filterParams, extras) {
|
|||
|
||||
// Clean up any string parameters that might slip through
|
||||
filterParams = filterParams || {};
|
||||
Ember.keys(filterParams).forEach(function(k) {
|
||||
Object.keys(filterParams).forEach(function(k) {
|
||||
const val = filterParams[k];
|
||||
if (val === "undefined" || val === "null" || val === 'false') {
|
||||
filterParams[k] = undefined;
|
||||
|
|
|
@ -3,12 +3,12 @@ export default function(helpers) {
|
|||
const fixturesByUrl = {};
|
||||
|
||||
// Load any fixtures automatically
|
||||
Ember.keys(require._eak_seen).forEach(entry => {
|
||||
Object.keys(require._eak_seen).forEach(entry => {
|
||||
if (/^fixtures/.test(entry)) {
|
||||
const fixture = require(entry, null, null, true);
|
||||
if (fixture && fixture.default) {
|
||||
const obj = fixture.default;
|
||||
Ember.keys(obj).forEach(url => {
|
||||
Object.keys(obj).forEach(url => {
|
||||
fixturesByUrl[url] = obj[url];
|
||||
this.get(url, () => response(obj[url]));
|
||||
});
|
||||
|
|
|
@ -132,7 +132,7 @@ window.asyncTestDiscourse = helpers.asyncTestDiscourse;
|
|||
window.controllerFor = helpers.controllerFor;
|
||||
window.fixture = helpers.fixture;
|
||||
|
||||
Ember.keys(requirejs.entries).forEach(function(entry) {
|
||||
Object.keys(requirejs.entries).forEach(function(entry) {
|
||||
if ((/\-test/).test(entry)) {
|
||||
require(entry, null, null, true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue