mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Enable JSHINT's unused
option. It caught a bunch of suspicious stuff which is fixed in this commit.
This commit is contained in:
parent
8685e4079f
commit
a502266c42
59 changed files with 69 additions and 102 deletions
|
@ -50,7 +50,7 @@ Discourse.ScreenedIpAddressFormComponent = Ember.Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement: function(e) {
|
didInsertElement: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._super();
|
this._super();
|
||||||
Em.run.schedule('afterRender', function() {
|
Em.run.schedule('afterRender', function() {
|
||||||
|
|
|
@ -13,9 +13,8 @@ Discourse.AdminApiController = Ember.ArrayController.extend({
|
||||||
Generates a master api key
|
Generates a master api key
|
||||||
|
|
||||||
@method generateMasterKey
|
@method generateMasterKey
|
||||||
@param {Discourse.ApiKey} the key to regenerate
|
|
||||||
**/
|
**/
|
||||||
generateMasterKey: function(key) {
|
generateMasterKey: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
Discourse.ApiKey.generateMasterKey().then(function (key) {
|
Discourse.ApiKey.generateMasterKey().then(function (key) {
|
||||||
self.get('model').pushObject(key);
|
self.get('model').pushObject(key);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Handlebars.registerHelper('valueAtTrustLevel', function(property, trustLevel) {
|
Handlebars.registerHelper('valueAtTrustLevel', function(property, trustLevel) {
|
||||||
var data = Ember.Handlebars.get(this, property);
|
var data = Ember.Handlebars.get(this, property);
|
||||||
if( data ) {
|
if( data ) {
|
||||||
var item = data.find( function(d, i, arr) { return parseInt(d.x,10) === parseInt(trustLevel,10); } );
|
var item = data.find( function(d) { return parseInt(d.x,10) === parseInt(trustLevel,10); } );
|
||||||
if( item ) {
|
if( item ) {
|
||||||
return item.y;
|
return item.y;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -31,7 +31,7 @@ Discourse.AdminUser = Discourse.User.extend({
|
||||||
**/
|
**/
|
||||||
revokeApiKey: function() {
|
revokeApiKey: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return Discourse.ajax("/admin/users/" + this.get('id') + "/revoke_api_key", {type: 'DELETE'}).then(function (result) {
|
return Discourse.ajax("/admin/users/" + this.get('id') + "/revoke_api_key", {type: 'DELETE'}).then(function () {
|
||||||
self.set('api_key', null);
|
self.set('api_key', null);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -51,7 +51,7 @@ Discourse.AdminUser = Discourse.User.extend({
|
||||||
"label": '<i class="fa fa-exclamation-triangle"></i> ' + I18n.t("admin.user.delete_all_posts"),
|
"label": '<i class="fa fa-exclamation-triangle"></i> ' + I18n.t("admin.user.delete_all_posts"),
|
||||||
"class": "btn btn-danger",
|
"class": "btn btn-danger",
|
||||||
"callback": function() {
|
"callback": function() {
|
||||||
Discourse.ajax("/admin/users/" + (user.get('id')) + "/delete_all_posts", {type: 'PUT'}).then(function(result){
|
Discourse.ajax("/admin/users/" + (user.get('id')) + "/delete_all_posts", {type: 'PUT'}).then(function(){
|
||||||
user.set('post_count', 0);
|
user.set('post_count', 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ Discourse.AdminUser = Discourse.User.extend({
|
||||||
user.mergeAttributes(data.user);
|
user.mergeAttributes(data.user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, function(jqXHR, status, error) {
|
}, function() {
|
||||||
Discourse.AdminUser.find( user.get('username') ).then(function(u){ user.mergeAttributes(u); });
|
Discourse.AdminUser.find( user.get('username') ).then(function(u){ user.mergeAttributes(u); });
|
||||||
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
||||||
});
|
});
|
||||||
|
@ -325,7 +325,7 @@ Discourse.AdminUser = Discourse.User.extend({
|
||||||
} else {
|
} else {
|
||||||
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
||||||
}
|
}
|
||||||
}, function(jqXHR, status, error) {
|
}, function() {
|
||||||
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ Discourse.ApiKey = Discourse.Model.extend({
|
||||||
@returns {Promise} a promise that resolves when the key has been revoked
|
@returns {Promise} a promise that resolves when the key has been revoked
|
||||||
**/
|
**/
|
||||||
revoke: function() {
|
revoke: function() {
|
||||||
var self = this;
|
|
||||||
return Discourse.ajax('/admin/api/key', {type: 'DELETE', data: {id: this.get('id')}});
|
return Discourse.ajax('/admin/api/key', {type: 'DELETE', data: {id: this.get('id')}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ Discourse.Group = Discourse.Model.extend({
|
||||||
return Discourse.ajax("/admin/groups/" + group.get('id'), {type: "DELETE"})
|
return Discourse.ajax("/admin/groups/" + group.get('id'), {type: "DELETE"})
|
||||||
.then(function(){
|
.then(function(){
|
||||||
return true;
|
return true;
|
||||||
}, function(error) {
|
}, function() {
|
||||||
group.set('disableSave', false);
|
group.set('disableSave', false);
|
||||||
bootbox.alert(I18n.t("admin.groups.delete_failed"));
|
bootbox.alert(I18n.t("admin.groups.delete_failed"));
|
||||||
return false;
|
return false;
|
||||||
|
@ -108,15 +108,5 @@ Discourse.Group.reopenClass({
|
||||||
});
|
});
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
},
|
|
||||||
|
|
||||||
find: function(id) {
|
|
||||||
var promise = new Em.Deferred();
|
|
||||||
|
|
||||||
setTimeout(function(){
|
|
||||||
promise.resolve(Discourse.Group.create({id: 1, name: "all mods", members: ["A","b","c"]}));
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
return promise;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@ Discourse.Report = Discourse.Model.extend({
|
||||||
valueAt: function(numDaysAgo) {
|
valueAt: function(numDaysAgo) {
|
||||||
if (this.data) {
|
if (this.data) {
|
||||||
var wantedDate = moment().subtract('days', numDaysAgo).format('YYYY-MM-DD');
|
var wantedDate = moment().subtract('days', numDaysAgo).format('YYYY-MM-DD');
|
||||||
var item = this.data.find( function(d, i, arr) { return d.x === wantedDate; } );
|
var item = this.data.find( function(d) { return d.x === wantedDate; } );
|
||||||
if (item) {
|
if (item) {
|
||||||
return item.y;
|
return item.y;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ Discourse.ScreenedEmail = Discourse.Model.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
Discourse.ScreenedEmail.reopenClass({
|
Discourse.ScreenedEmail.reopenClass({
|
||||||
findAll: function(filter) {
|
findAll: function() {
|
||||||
return Discourse.ajax("/admin/logs/screened_emails.json").then(function(screened_emails) {
|
return Discourse.ajax("/admin/logs/screened_emails.json").then(function(screened_emails) {
|
||||||
return screened_emails.map(function(b) {
|
return screened_emails.map(function(b) {
|
||||||
return Discourse.ScreenedEmail.create(b);
|
return Discourse.ScreenedEmail.create(b);
|
||||||
|
|
|
@ -45,7 +45,7 @@ Discourse.ScreenedIpAddress = Discourse.Model.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
Discourse.ScreenedIpAddress.reopenClass({
|
Discourse.ScreenedIpAddress.reopenClass({
|
||||||
findAll: function(filter) {
|
findAll: function() {
|
||||||
return Discourse.ajax("/admin/logs/screened_ip_addresses.json").then(function(screened_ips) {
|
return Discourse.ajax("/admin/logs/screened_ip_addresses.json").then(function(screened_ips) {
|
||||||
return screened_ips.map(function(b) {
|
return screened_ips.map(function(b) {
|
||||||
return Discourse.ScreenedIpAddress.create(b);
|
return Discourse.ScreenedIpAddress.create(b);
|
||||||
|
|
|
@ -13,7 +13,7 @@ Discourse.ScreenedUrl = Discourse.Model.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
Discourse.ScreenedUrl.reopenClass({
|
Discourse.ScreenedUrl.reopenClass({
|
||||||
findAll: function(filter) {
|
findAll: function() {
|
||||||
return Discourse.ajax("/admin/logs/screened_urls.json").then(function(screened_urls) {
|
return Discourse.ajax("/admin/logs/screened_urls.json").then(function(screened_urls) {
|
||||||
return screened_urls.map(function(b) {
|
return screened_urls.map(function(b) {
|
||||||
return Discourse.ScreenedUrl.create(b);
|
return Discourse.ScreenedUrl.create(b);
|
||||||
|
|
|
@ -12,7 +12,7 @@ Discourse.AdminSiteContentsRoute = Discourse.Route.extend({
|
||||||
return Discourse.SiteContentType.findAll();
|
return Discourse.SiteContentType.findAll();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTemplate: function(controller, model) {
|
renderTemplate: function() {
|
||||||
this.render('admin/templates/site_contents', {into: 'admin/templates/admin'});
|
this.render('admin/templates/site_contents', {into: 'admin/templates/admin'});
|
||||||
this.render('admin/templates/site_contents_empty', {into: 'admin/templates/site_contents'});
|
this.render('admin/templates/site_contents_empty', {into: 'admin/templates/site_contents'});
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,7 +42,7 @@ Discourse.AceEditorView = Discourse.View.extend({
|
||||||
aceEditorView.editor.setTheme("ace/theme/chrome");
|
aceEditorView.editor.setTheme("ace/theme/chrome");
|
||||||
aceEditorView.editor.setShowPrintMargin(false);
|
aceEditorView.editor.setShowPrintMargin(false);
|
||||||
aceEditorView.editor.getSession().setMode("ace/mode/" + (aceEditorView.get('mode')));
|
aceEditorView.editor.getSession().setMode("ace/mode/" + (aceEditorView.get('mode')));
|
||||||
aceEditorView.editor.on("change", function(e) {
|
aceEditorView.editor.on("change", function() {
|
||||||
aceEditorView.skipContentChangeEvent = true;
|
aceEditorView.skipContentChangeEvent = true;
|
||||||
aceEditorView.set('content', aceEditorView.editor.getSession().getValue());
|
aceEditorView.set('content', aceEditorView.editor.getSession().getValue());
|
||||||
aceEditorView.skipContentChangeEvent = false;
|
aceEditorView.skipContentChangeEvent = false;
|
||||||
|
|
|
@ -48,7 +48,7 @@ Discourse.EditTopicAutoCloseController = Discourse.ObjectController.extend(Disco
|
||||||
} else {
|
} else {
|
||||||
bootbox.alert(I18n.t('composer.auto_close_error'), function() { self.send('showModal'); } );
|
bootbox.alert(I18n.t('composer.auto_close_error'), function() { self.send('showModal'); } );
|
||||||
}
|
}
|
||||||
}, function (error) {
|
}, function () {
|
||||||
bootbox.alert(I18n.t('composer.auto_close_error'), function() { self.send('showModal'); } );
|
bootbox.alert(I18n.t('composer.auto_close_error'), function() { self.send('showModal'); } );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
// Show newly inserted topics
|
// Show newly inserted topics
|
||||||
showInserted: function(e) {
|
showInserted: function() {
|
||||||
var tracker = Discourse.TopicTrackingState.current();
|
var tracker = Discourse.TopicTrackingState.current();
|
||||||
|
|
||||||
// Move inserted into topics
|
// Move inserted into topics
|
||||||
|
|
|
@ -61,7 +61,7 @@ Discourse.LoginController = Discourse.Controller.extend(Discourse.ModalFunctiona
|
||||||
$hidden_login_form.submit();
|
$hidden_login_form.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, function(result) {
|
}, function() {
|
||||||
// Failed to login
|
// Failed to login
|
||||||
loginController.flash(I18n.t('login.error'), 'error');
|
loginController.flash(I18n.t('login.error'), 'error');
|
||||||
loginController.set('loggingIn', false);
|
loginController.set('loggingIn', false);
|
||||||
|
|
|
@ -183,7 +183,7 @@ Discourse.Dialect = {
|
||||||
@param {Function} emitter A function that emits the JsonML for the replacement.
|
@param {Function} emitter A function that emits the JsonML for the replacement.
|
||||||
**/
|
**/
|
||||||
inlineReplace: function(token, emitter) {
|
inlineReplace: function(token, emitter) {
|
||||||
this.registerInline(token, function(text, match, prev) {
|
this.registerInline(token, function() {
|
||||||
return [token.length, emitter.call(this, token)];
|
return [token.length, emitter.call(this, token)];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
@for Handlebars
|
@for Handlebars
|
||||||
**/
|
**/
|
||||||
Handlebars.registerHelper('breakUp', function(property, hint, options) {
|
Handlebars.registerHelper('breakUp', function(property, hint, options) {
|
||||||
var prop, result, tokens;
|
var prop = Ember.Handlebars.get(this, property, options);
|
||||||
prop = Ember.Handlebars.get(this, property, options);
|
|
||||||
if (!prop) return "";
|
if (!prop) return "";
|
||||||
hint = Ember.Handlebars.get(this, hint, options);
|
hint = Ember.Handlebars.get(this, hint, options);
|
||||||
|
|
||||||
|
@ -328,7 +327,7 @@ Handlebars.registerHelper('date', function(property, options) {
|
||||||
@method customHTML
|
@method customHTML
|
||||||
@for Handlebars
|
@for Handlebars
|
||||||
**/
|
**/
|
||||||
Handlebars.registerHelper('customHTML', function(property, options) {
|
Handlebars.registerHelper('customHTML', function(property) {
|
||||||
var html = PreloadStore.get("customHTML");
|
var html = PreloadStore.get("customHTML");
|
||||||
|
|
||||||
if (html && html[property] && html[property].length) {
|
if (html && html[property] && html[property].length) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ Discourse.addInitializer(function() {
|
||||||
// Observe file changes
|
// Observe file changes
|
||||||
return Discourse.MessageBus.subscribe("/file-change", function(data) {
|
return Discourse.MessageBus.subscribe("/file-change", function(data) {
|
||||||
Ember.TEMPLATES.empty = Handlebars.compile("<div></div>");
|
Ember.TEMPLATES.empty = Handlebars.compile("<div></div>");
|
||||||
_.each(data,function(me,idx) {
|
_.each(data,function(me) {
|
||||||
|
|
||||||
if (me === "refresh") {
|
if (me === "refresh") {
|
||||||
// Refresh if necessary
|
// Refresh if necessary
|
||||||
|
|
|
@ -141,7 +141,6 @@ $.fn.autocomplete = function(options) {
|
||||||
|
|
||||||
if (isInput) {
|
if (isInput) {
|
||||||
var width = this.width();
|
var width = this.width();
|
||||||
var height = this.height();
|
|
||||||
wrap = this.wrap("<div class='ac-wrap clearfix" + (disabled ? " disabled": "") + "'/>").parent();
|
wrap = this.wrap("<div class='ac-wrap clearfix" + (disabled ? " disabled": "") + "'/>").parent();
|
||||||
wrap.width(width);
|
wrap.width(width);
|
||||||
if(options.single) {
|
if(options.single) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ $.fn.caretPosition = function(options) {
|
||||||
span = $("#pos span");
|
span = $("#pos span");
|
||||||
textarea = $(this);
|
textarea = $(this);
|
||||||
|
|
||||||
getStyles = function(el, prop) {
|
getStyles = function(el) {
|
||||||
if (el.currentStyle) {
|
if (el.currentStyle) {
|
||||||
return el.currentStyle;
|
return el.currentStyle;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -19,7 +19,6 @@ Discourse.Eyeline.prototype.update = function() {
|
||||||
var docViewTop = $(window).scrollTop(),
|
var docViewTop = $(window).scrollTop(),
|
||||||
windowHeight = $(window).height(),
|
windowHeight = $(window).height(),
|
||||||
docViewBottom = docViewTop + windowHeight,
|
docViewBottom = docViewTop + windowHeight,
|
||||||
documentHeight = $(document).height(),
|
|
||||||
$elements = $(this.selector),
|
$elements = $(this.selector),
|
||||||
atBottom = false,
|
atBottom = false,
|
||||||
foundElement = false,
|
foundElement = false,
|
||||||
|
|
|
@ -151,7 +151,7 @@ Discourse.Formatter = (function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
relativeAgeTiny = function(date, options){
|
relativeAgeTiny = function(date){
|
||||||
var format = "tiny";
|
var format = "tiny";
|
||||||
var distance = Math.round((new Date() - date) / 1000);
|
var distance = Math.round((new Date() - date) / 1000);
|
||||||
var distanceInMinutes = Math.round(distance / 60.0);
|
var distanceInMinutes = Math.round(distance / 60.0);
|
||||||
|
@ -226,7 +226,7 @@ Discourse.Formatter = (function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
relativeAgeMedium = function(date, options){
|
relativeAgeMedium = function(date, options){
|
||||||
var displayDate, fiveDaysAgo, oneMinuteAgo, fullReadable, leaveAgo, val;
|
var displayDate, fiveDaysAgo, oneMinuteAgo, fullReadable, leaveAgo;
|
||||||
var wrapInSpan = options.wrapInSpan === false ? false : true;
|
var wrapInSpan = options.wrapInSpan === false ? false : true;
|
||||||
|
|
||||||
leaveAgo = options.leaveAgo;
|
leaveAgo = options.leaveAgo;
|
||||||
|
|
|
@ -9,7 +9,7 @@ Discourse.KeyValueStore = {
|
||||||
initialized: false,
|
initialized: false,
|
||||||
context: "",
|
context: "",
|
||||||
|
|
||||||
init: function(ctx, messageBus) {
|
init: function(ctx) {
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
this.context = ctx;
|
this.context = ctx;
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,8 +15,7 @@ Discourse.Lightbox = {
|
||||||
|
|
||||||
callbacks: {
|
callbacks: {
|
||||||
open: function() {
|
open: function() {
|
||||||
var self = this,
|
var wrap = this.wrap,
|
||||||
wrap = this.wrap,
|
|
||||||
img = this.currItem.img,
|
img = this.currItem.img,
|
||||||
maxHeight = img.css("max-height");
|
maxHeight = img.css("max-height");
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ Discourse.ScreenTrack = Ember.Object.extend({
|
||||||
var newTimings = {},
|
var newTimings = {},
|
||||||
totalTimings = this.get('totalTimings');
|
totalTimings = this.get('totalTimings');
|
||||||
|
|
||||||
_.each(this.get('timings'), function(timing,key) {
|
_.each(this.get('timings'), function(timing) {
|
||||||
if (!totalTimings[timing.postNumber])
|
if (!totalTimings[timing.postNumber])
|
||||||
totalTimings[timing.postNumber] = 0;
|
totalTimings[timing.postNumber] = 0;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
**/
|
**/
|
||||||
Discourse.LoadMore = Em.Mixin.create(Ember.ViewTargetActionSupport, Discourse.Scrolling, {
|
Discourse.LoadMore = Em.Mixin.create(Ember.ViewTargetActionSupport, Discourse.Scrolling, {
|
||||||
|
|
||||||
scrolled: function(e) {
|
scrolled: function() {
|
||||||
var eyeline = this.get('eyeline');
|
var eyeline = this.get('eyeline');
|
||||||
if (eyeline) { eyeline.update(); }
|
if (eyeline) { eyeline.update(); }
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,7 +20,7 @@ Discourse.Scrolling = Em.Mixin.create({
|
||||||
opts = opts || {debounce: 100};
|
opts = opts || {debounce: 100};
|
||||||
|
|
||||||
var self = this,
|
var self = this,
|
||||||
onScrollMethod = function(e) {
|
onScrollMethod = function() {
|
||||||
return Em.run.scheduleOnce('afterRender', self, 'scrolled');
|
return Em.run.scheduleOnce('afterRender', self, 'scrolled');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ Discourse.Category = Discourse.Model.extend({
|
||||||
return this.get('topic_count') > Discourse.SiteSettings.category_featured_topics;
|
return this.get('topic_count') > Discourse.SiteSettings.category_featured_topics;
|
||||||
}.property('topic_count'),
|
}.property('topic_count'),
|
||||||
|
|
||||||
save: function(args) {
|
save: function() {
|
||||||
var url = "/categories";
|
var url = "/categories";
|
||||||
if (this.get('id')) {
|
if (this.get('id')) {
|
||||||
url = "/categories/" + (this.get('id'));
|
url = "/categories/" + (this.get('id'));
|
||||||
|
@ -81,7 +81,7 @@ Discourse.Category = Discourse.Model.extend({
|
||||||
return rval;
|
return rval;
|
||||||
}.property("permissions"),
|
}.property("permissions"),
|
||||||
|
|
||||||
destroy: function(callback) {
|
destroy: function() {
|
||||||
return Discourse.ajax("/categories/" + (this.get('slug') || this.get('id')), { type: 'DELETE' });
|
return Discourse.ajax("/categories/" + (this.get('slug') || this.get('id')), { type: 'DELETE' });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -420,7 +420,7 @@ Discourse.Composer = Discourse.Model.extend({
|
||||||
this.set('composeState', CLOSED);
|
this.set('composeState', CLOSED);
|
||||||
|
|
||||||
return Ember.Deferred.promise(function(promise) {
|
return Ember.Deferred.promise(function(promise) {
|
||||||
post.save(function(savedPost) {
|
post.save(function() {
|
||||||
composer.clearState();
|
composer.clearState();
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
var response = $.parseJSON(error.responseText);
|
var response = $.parseJSON(error.responseText);
|
||||||
|
@ -486,8 +486,7 @@ Discourse.Composer = Discourse.Model.extend({
|
||||||
|
|
||||||
composer.set('composeState', SAVING);
|
composer.set('composeState', SAVING);
|
||||||
createdPost.save(function(result) {
|
createdPost.save(function(result) {
|
||||||
var addedPost = false,
|
var saving = true;
|
||||||
saving = true;
|
|
||||||
|
|
||||||
createdPost.updateFromJson(result);
|
createdPost.updateFromJson(result);
|
||||||
|
|
||||||
|
|
|
@ -91,8 +91,7 @@ Discourse.Post = Discourse.Model.extend({
|
||||||
}.property('read', 'topic.last_read_post_number', 'bookmarked'),
|
}.property('read', 'topic.last_read_post_number', 'bookmarked'),
|
||||||
|
|
||||||
bookmarkedChanged: function() {
|
bookmarkedChanged: function() {
|
||||||
var post = this;
|
Discourse.ajax("/posts/" + this.get('id') + "/bookmark", {
|
||||||
Discourse.ajax("/posts/" + (this.get('id')) + "/bookmark", {
|
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
data: {
|
data: {
|
||||||
bookmarked: this.get('bookmarked') ? true : false
|
bookmarked: this.get('bookmarked') ? true : false
|
||||||
|
|
|
@ -306,9 +306,7 @@ Discourse.PostStream = Em.Object.extend({
|
||||||
fillGapAfter: function(post, gap) {
|
fillGapAfter: function(post, gap) {
|
||||||
var postId = post.get('id'),
|
var postId = post.get('id'),
|
||||||
stream = this.get('stream'),
|
stream = this.get('stream'),
|
||||||
idx = stream.indexOf(postId),
|
idx = stream.indexOf(postId);
|
||||||
currentPosts = this.get('posts'),
|
|
||||||
self = this;
|
|
||||||
|
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
stream.pushObjects(gap);
|
stream.pushObjects(gap);
|
||||||
|
@ -674,8 +672,7 @@ Discourse.PostStream = Em.Object.extend({
|
||||||
|
|
||||||
var url = "/t/" + this.get('topic.id') + "/posts.json",
|
var url = "/t/" + this.get('topic.id') + "/posts.json",
|
||||||
data = { post_ids: postIds },
|
data = { post_ids: postIds },
|
||||||
postStream = this,
|
postStream = this;
|
||||||
result = Em.A();
|
|
||||||
|
|
||||||
return Discourse.ajax(url, {data: data}).then(function(result) {
|
return Discourse.ajax(url, {data: data}).then(function(result) {
|
||||||
var posts = Em.get(result, "post_stream.posts");
|
var posts = Em.get(result, "post_stream.posts");
|
||||||
|
|
|
@ -24,7 +24,7 @@ Discourse.Topic = Discourse.Model.extend({
|
||||||
return a !== 'regular' && a !== 'private_message';
|
return a !== 'regular' && a !== 'private_message';
|
||||||
}.property('archetype'),
|
}.property('archetype'),
|
||||||
|
|
||||||
convertArchetype: function(archetype) {
|
convertArchetype: function() {
|
||||||
var a = this.get('archetype');
|
var a = this.get('archetype');
|
||||||
if (a !== 'regular' && a !== 'private_message') {
|
if (a !== 'regular' && a !== 'private_message') {
|
||||||
this.set('archetype', 'regular');
|
this.set('archetype', 'regular');
|
||||||
|
@ -233,7 +233,7 @@ Discourse.Topic = Discourse.Model.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
// Recover this topic if deleted
|
// Recover this topic if deleted
|
||||||
recover: function(deleted_by) {
|
recover: function() {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
deleted_at: null,
|
deleted_at: null,
|
||||||
deleted_by: null,
|
deleted_by: null,
|
||||||
|
@ -326,14 +326,13 @@ Discourse.Topic.reopenClass({
|
||||||
|
|
||||||
// Load a topic, but accepts a set of filters
|
// Load a topic, but accepts a set of filters
|
||||||
find: function(topicId, opts) {
|
find: function(topicId, opts) {
|
||||||
var data, promise, url;
|
var url = Discourse.getURL("/t/") + topicId;
|
||||||
url = Discourse.getURL("/t/") + topicId;
|
|
||||||
|
|
||||||
if (opts.nearPost) {
|
if (opts.nearPost) {
|
||||||
url += "/" + opts.nearPost;
|
url += "/" + opts.nearPost;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = {};
|
var data = {};
|
||||||
if (opts.postsAfter) {
|
if (opts.postsAfter) {
|
||||||
data.posts_after = opts.postsAfter;
|
data.posts_after = opts.postsAfter;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ Discourse.TopicDetails = Discourse.Model.extend({
|
||||||
Discourse.ajax("/t/" + this.get('topic.id') + "/remove-allowed-user", {
|
Discourse.ajax("/t/" + this.get('topic.id') + "/remove-allowed-user", {
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
data: { username: username }
|
data: { username: username }
|
||||||
}).then(function(res) {
|
}).then(function() {
|
||||||
users.removeObject(users.findProperty('username', username));
|
users.removeObject(users.findProperty('username', username));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,8 +169,7 @@ Discourse.TopicList.reopenClass({
|
||||||
topicsFrom: function(result) {
|
topicsFrom: function(result) {
|
||||||
// Stitch together our side loaded data
|
// Stitch together our side loaded data
|
||||||
var categories = Discourse.Category.list(),
|
var categories = Discourse.Category.list(),
|
||||||
users = this.extractByKey(result.users, Discourse.User),
|
users = this.extractByKey(result.users, Discourse.User);
|
||||||
topics = Em.A();
|
|
||||||
|
|
||||||
return result.topic_list.topics.map(function (t) {
|
return result.topic_list.topics.map(function (t) {
|
||||||
t.category = categories.findBy('id', t.category_id);
|
t.category = categories.findBy('id', t.category_id);
|
||||||
|
|
|
@ -216,7 +216,7 @@ Ember.DiscourseLocation = Ember.Object.extend({
|
||||||
var guid = Ember.guidFor(this),
|
var guid = Ember.guidFor(this),
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
Ember.$(window).on('popstate.ember-location-'+guid, function(e) {
|
Ember.$(window).on('popstate.ember-location-'+guid, function() {
|
||||||
// Ignore initial page load popstate event in Chrome
|
// Ignore initial page load popstate event in Chrome
|
||||||
if (!popstateFired) {
|
if (!popstateFired) {
|
||||||
popstateFired = true;
|
popstateFired = true;
|
||||||
|
|
|
@ -16,7 +16,7 @@ Discourse.Route = Em.Route.extend({
|
||||||
|
|
||||||
@method activate
|
@method activate
|
||||||
**/
|
**/
|
||||||
activate: function(router, context) {
|
activate: function() {
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
// Close mini profiler
|
// Close mini profiler
|
||||||
|
|
|
@ -10,7 +10,7 @@ Discourse.UserTopicListRoute = Discourse.Route.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function createPMRoute(viewName, path, type) {
|
function createPMRoute(viewName, path) {
|
||||||
return Discourse.UserTopicListRoute.extend({
|
return Discourse.UserTopicListRoute.extend({
|
||||||
userActionType: Discourse.UserAction.TYPES.messages_received,
|
userActionType: Discourse.UserAction.TYPES.messages_received,
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ function createPMRoute(viewName, path, type) {
|
||||||
return Discourse.TopicList.find('topics/' + path + '/' + this.modelFor('user').get('username_lower'));
|
return Discourse.TopicList.find('topics/' + path + '/' + this.modelFor('user').get('username_lower'));
|
||||||
},
|
},
|
||||||
|
|
||||||
setupController: function(controller, model) {
|
setupController: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
this.controllerFor('user').setProperties({
|
this.controllerFor('user').setProperties({
|
||||||
pmView: viewName,
|
pmView: viewName,
|
||||||
|
|
|
@ -18,7 +18,7 @@ Discourse.ClearPinButton = Discourse.ButtonView.extend({
|
||||||
return this.get('controller.pinned') ? null : 'hidden';
|
return this.get('controller.pinned') ? null : 'hidden';
|
||||||
}.property('controller.pinned'),
|
}.property('controller.pinned'),
|
||||||
|
|
||||||
click: function(buffer) {
|
click: function() {
|
||||||
this.get('controller').send('clearPin');
|
this.get('controller').send('clearPin');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Discourse.DropdownButtonView = Discourse.View.extend({
|
||||||
classNameBindings: [':btn-group', 'hidden'],
|
classNameBindings: [':btn-group', 'hidden'],
|
||||||
shouldRerender: Discourse.View.renderIfChanged('text', 'longDescription'),
|
shouldRerender: Discourse.View.renderIfChanged('text', 'longDescription'),
|
||||||
|
|
||||||
didInsertElement: function(e) {
|
didInsertElement: function() {
|
||||||
// If there's a click handler, call it
|
// If there's a click handler, call it
|
||||||
if (this.clicked) {
|
if (this.clicked) {
|
||||||
var dropDownButtonView = this;
|
var dropDownButtonView = this;
|
||||||
|
@ -22,7 +22,7 @@ Discourse.DropdownButtonView = Discourse.View.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement: function(e) {
|
willDestroyElement: function() {
|
||||||
this.$('ul li').off('click.dropdown-button');
|
this.$('ul li').off('click.dropdown-button');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
|
||||||
});
|
});
|
||||||
}.observes('model.composeState'),
|
}.observes('model.composeState'),
|
||||||
|
|
||||||
keyUp: function(e) {
|
keyUp: function() {
|
||||||
var controller = this.get('controller');
|
var controller = this.get('controller');
|
||||||
controller.checkReplyLength();
|
controller.checkReplyLength();
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
childDidInsertElement: function(e) {
|
childDidInsertElement: function() {
|
||||||
return this.initEditor();
|
return this.initEditor();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ Discourse.ListTopicsView = Discourse.View.extend(Discourse.LoadMore, {
|
||||||
},
|
},
|
||||||
|
|
||||||
// When the topic list is scrolled
|
// When the topic list is scrolled
|
||||||
scrolled: function(e) {
|
scrolled: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.saveScrollPosition();
|
this.saveScrollPosition();
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ Discourse.AvatarSelectorView = Discourse.ModalBodyView.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
// when a file has been selected
|
// when a file has been selected
|
||||||
$upload.on("fileuploadadd", function (e, data) {
|
$upload.on("fileuploadadd", function () {
|
||||||
self.setProperties({
|
self.setProperties({
|
||||||
uploading: true,
|
uploading: true,
|
||||||
imageIsNotASquare: false
|
imageIsNotASquare: false
|
||||||
|
@ -81,7 +81,7 @@ Discourse.AvatarSelectorView = Discourse.ModalBodyView.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
// when the upload is done
|
// when the upload is done
|
||||||
$upload.on("fileuploadalways", function (e, data) {
|
$upload.on("fileuploadalways", function () {
|
||||||
self.setProperties({ uploading: false, uploadProgress: 0 });
|
self.setProperties({ uploading: false, uploadProgress: 0 });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,7 +11,7 @@ Discourse.CreateAccountView = Discourse.ModalBodyView.extend({
|
||||||
title: I18n.t('create_account.title'),
|
title: I18n.t('create_account.title'),
|
||||||
classNames: ['create-account'],
|
classNames: ['create-account'],
|
||||||
|
|
||||||
didInsertElement: function(e) {
|
didInsertElement: function() {
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
Discourse.HideModalView = Discourse.ModalBodyView.extend({
|
Discourse.HideModalView = Discourse.ModalBodyView.extend({
|
||||||
|
|
||||||
// No rendering!
|
// No rendering!
|
||||||
render: function(buffer) { },
|
render: function() { },
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
$('#discourse-modal').modal('hide');
|
$('#discourse-modal').modal('hide');
|
||||||
|
|
|
@ -41,7 +41,7 @@ Discourse.LoginView = Discourse.ModalBodyView.extend({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement: function(e) {
|
didInsertElement: function() {
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ Discourse.PopupInputTipView = Discourse.View.extend({
|
||||||
bouncePixels: 6,
|
bouncePixels: 6,
|
||||||
bounceDelay: 100,
|
bounceDelay: 100,
|
||||||
|
|
||||||
click: function(e) {
|
click: function() {
|
||||||
this.set('shownAt', false);
|
this.set('shownAt', false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -56,10 +56,10 @@ Discourse.QuoteButtonView = Discourse.View.extend({
|
||||||
view.selectText(e.target, controller);
|
view.selectText(e.target, controller);
|
||||||
view.set('isMouseDown', false);
|
view.set('isMouseDown', false);
|
||||||
})
|
})
|
||||||
.on('touchstart.quote-button', function(e){
|
.on('touchstart.quote-button', function(){
|
||||||
view.set('isTouchInProgress', true);
|
view.set('isTouchInProgress', true);
|
||||||
})
|
})
|
||||||
.on('touchend.quote-button', function(e){
|
.on('touchend.quote-button', function(){
|
||||||
view.set('isTouchInProgress', false);
|
view.set('isTouchInProgress', false);
|
||||||
})
|
})
|
||||||
.on('selectionchange', function() {
|
.on('selectionchange', function() {
|
||||||
|
|
|
@ -71,7 +71,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
||||||
}
|
}
|
||||||
}.observes('controller.enteredAt'),
|
}.observes('controller.enteredAt'),
|
||||||
|
|
||||||
didInsertElement: function(e) {
|
didInsertElement: function() {
|
||||||
this.bindScrolling({name: 'topic-view'});
|
this.bindScrolling({name: 'topic-view'});
|
||||||
|
|
||||||
var topicView = this;
|
var topicView = this;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/*global Markdown:true*/
|
|
||||||
|
|
||||||
window.PagedownCustom = {
|
window.PagedownCustom = {
|
||||||
insertButtons: [
|
insertButtons: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,7 @@ regexp: false # true if . and [^...] should not be allowed in RegExp liter
|
||||||
safe: false # true if the safe subset rules are enforced (used by ADsafe)
|
safe: false # true if the safe subset rules are enforced (used by ADsafe)
|
||||||
strict: false # true if the ES5 "use strict"; pragma is required
|
strict: false # true if the ES5 "use strict"; pragma is required
|
||||||
undef: true # true if variables must be declared before used
|
undef: true # true if variables must be declared before used
|
||||||
|
unused: true
|
||||||
white: false # true if strict whitespace rules apply (see also 'indent' option)
|
white: false # true if strict whitespace rules apply (see also 'indent' option)
|
||||||
eqnull: false
|
eqnull: false
|
||||||
onecase: true # allow for one case switches, can be more elegant sometimes
|
onecase: true # allow for one case switches, can be more elegant sometimes
|
||||||
|
|
|
@ -92,8 +92,7 @@ test("Select Replies when present", function() {
|
||||||
tc = testController(Discourse.TopicController, topic),
|
tc = testController(Discourse.TopicController, topic),
|
||||||
p1 = Discourse.Post.create({id: 1, post_number: 1, reply_count: 1}),
|
p1 = Discourse.Post.create({id: 1, post_number: 1, reply_count: 1}),
|
||||||
p2 = Discourse.Post.create({id: 2, post_number: 2}),
|
p2 = Discourse.Post.create({id: 2, post_number: 2}),
|
||||||
p3 = Discourse.Post.create({id: 2, post_number: 3, reply_to_post_number: 1}),
|
p3 = Discourse.Post.create({id: 2, post_number: 3, reply_to_post_number: 1});
|
||||||
postStream = tc.get('postStream');
|
|
||||||
|
|
||||||
ok(!tc.postSelected(p3), "replies are not selected by default");
|
ok(!tc.postSelected(p3), "replies are not selected by default");
|
||||||
tc.send('toggledSelectedPostReplies', p1);
|
tc.send('toggledSelectedPostReplies', p1);
|
||||||
|
|
|
@ -150,6 +150,7 @@ var jsHintOpts = {
|
||||||
"plusplus": false,
|
"plusplus": false,
|
||||||
"regexp": false,
|
"regexp": false,
|
||||||
"undef": true,
|
"undef": true,
|
||||||
|
"unused": true,
|
||||||
"sub": true,
|
"sub": true,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
"white": false,
|
"white": false,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/*global md5:true */
|
|
||||||
module("Discourse.BBCode");
|
module("Discourse.BBCode");
|
||||||
|
|
||||||
var format = function(input, expected, text) {
|
var format = function(input, expected, text) {
|
||||||
|
|
|
@ -28,10 +28,6 @@ var formatDays = function(days) {
|
||||||
return formatHours(days * 24);
|
return formatHours(days * 24);
|
||||||
};
|
};
|
||||||
|
|
||||||
var formatMonths = function(months) {
|
|
||||||
return formatDays(months * 30);
|
|
||||||
};
|
|
||||||
|
|
||||||
var shortDate = function(days){
|
var shortDate = function(days){
|
||||||
return moment().subtract('days', days).format('D MMM');
|
return moment().subtract('days', days).format('D MMM');
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
module("Discourse.HTML");
|
module("Discourse.HTML");
|
||||||
|
|
||||||
var html = Discourse.HTML;
|
|
||||||
|
|
||||||
test("categoryLink without a category", function() {
|
test("categoryLink without a category", function() {
|
||||||
blank(Discourse.HTML.categoryLink(), "it returns no HTML");
|
blank(Discourse.HTML.categoryLink(), "it returns no HTML");
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/*global sanitizeHtml:true */
|
|
||||||
|
|
||||||
module("Discourse.Markdown", {
|
module("Discourse.Markdown", {
|
||||||
setup: function() {
|
setup: function() {
|
||||||
Discourse.SiteSettings.traditional_markdown_linebreaks = false;
|
Discourse.SiteSettings.traditional_markdown_linebreaks = false;
|
||||||
|
@ -173,7 +171,7 @@ test("Quotes", function() {
|
||||||
"handles quotes properly");
|
"handles quotes properly");
|
||||||
|
|
||||||
cookedOptions("1[quote=\"bob, post:1\"]my quote[/quote]2",
|
cookedOptions("1[quote=\"bob, post:1\"]my quote[/quote]2",
|
||||||
{ topicId: 2, lookupAvatar: function(name) { } },
|
{ topicId: 2, lookupAvatar: function() { } },
|
||||||
"<p>1</p>\n\n<p><aside class=\"quote\" data-post=\"1\"><div class=\"title\"><div class=\"quote-controls\"></div>bob said:" +
|
"<p>1</p>\n\n<p><aside class=\"quote\" data-post=\"1\"><div class=\"title\"><div class=\"quote-controls\"></div>bob said:" +
|
||||||
"</div><blockquote><p>my quote</p></blockquote></aside></p>\n\n<p>2</p>",
|
"</div><blockquote><p>my quote</p></blockquote></aside></p>\n\n<p>2</p>",
|
||||||
"includes no avatar if none is found");
|
"includes no avatar if none is found");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module("Discourse.SelectedPostsCount");
|
module("Discourse.SelectedPostsCount");
|
||||||
|
|
||||||
var buildTestObj = function(params, topicParams) {
|
var buildTestObj = function(params) {
|
||||||
return Ember.Object.createWithMixins(Discourse.SelectedPostsCount, params || {});
|
return Ember.Object.createWithMixins(Discourse.SelectedPostsCount, params || {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module("Discourse.Composer");
|
module("Discourse.Composer");
|
||||||
|
|
||||||
test('replyLength', function() {
|
test('replyLength', function() {
|
||||||
var replyLength = function(val, expectedLength, text) {
|
var replyLength = function(val, expectedLength) {
|
||||||
var composer = Discourse.Composer.create({ reply: val });
|
var composer = Discourse.Composer.create({ reply: val });
|
||||||
equal(composer.get('replyLength'), expectedLength);
|
equal(composer.get('replyLength'), expectedLength);
|
||||||
};
|
};
|
||||||
|
|
|
@ -227,7 +227,7 @@ test("storePost", function() {
|
||||||
test("identity map", function() {
|
test("identity map", function() {
|
||||||
var postStream = buildStream(1234);
|
var postStream = buildStream(1234);
|
||||||
var p1 = postStream.appendPost(Discourse.Post.create({id: 1, post_number: 1}));
|
var p1 = postStream.appendPost(Discourse.Post.create({id: 1, post_number: 1}));
|
||||||
var p3 = postStream.appendPost(Discourse.Post.create({id: 3, post_number: 4}));
|
postStream.appendPost(Discourse.Post.create({id: 3, post_number: 4}));
|
||||||
|
|
||||||
equal(postStream.findLoadedPost(1), p1, "it can return cached posts by id");
|
equal(postStream.findLoadedPost(1), p1, "it can return cached posts by id");
|
||||||
blank(postStream.findLoadedPost(4), "it can't find uncached posts");
|
blank(postStream.findLoadedPost(4), "it can't find uncached posts");
|
||||||
|
@ -403,7 +403,7 @@ test("comitting and triggerNewPostInStream race condition", function() {
|
||||||
var user = Discourse.User.create({username: 'eviltrout', name: 'eviltrout', id: 321});
|
var user = Discourse.User.create({username: 'eviltrout', name: 'eviltrout', id: 321});
|
||||||
var stagedPost = Discourse.Post.create({ raw: 'hello world this is my new post' });
|
var stagedPost = Discourse.Post.create({ raw: 'hello world this is my new post' });
|
||||||
|
|
||||||
var result = postStream.stagePost(stagedPost, user);
|
postStream.stagePost(stagedPost, user);
|
||||||
equal(postStream.get('filteredPostsCount'), 0, "it has no filteredPostsCount yet");
|
equal(postStream.get('filteredPostsCount'), 0, "it has no filteredPostsCount yet");
|
||||||
stagedPost.set('id', 123);
|
stagedPost.set('id', 123);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue