mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
REFACTOR: Migrate markdown functionality in ES6
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
needs: ['modal'],
|
||||
|
||||
@ -22,7 +24,7 @@ export default Ember.Controller.extend({
|
||||
returned = "<pre class='badge-query-plan'>";
|
||||
|
||||
_.each(raw, function(linehash) {
|
||||
returned += Discourse.Utilities.escapeExpression(linehash["QUERY PLAN"]);
|
||||
returned += escapeExpression(linehash["QUERY PLAN"]);
|
||||
returned += "<br>";
|
||||
});
|
||||
|
||||
@ -32,7 +34,7 @@ export default Ember.Controller.extend({
|
||||
|
||||
processed_sample: Ember.computed.map('model.sample', function(grant) {
|
||||
var i18nKey = 'admin.badges.preview.grant.with',
|
||||
i18nParams = { username: Discourse.Utilities.escapeExpression(grant.username) };
|
||||
i18nParams = { username: escapeExpression(grant.username) };
|
||||
|
||||
if (grant.post_id) {
|
||||
i18nKey += "_post";
|
||||
@ -41,7 +43,7 @@ export default Ember.Controller.extend({
|
||||
|
||||
if (grant.granted_at) {
|
||||
i18nKey += "_time";
|
||||
i18nParams.time = Discourse.Utilities.escapeExpression(moment(grant.granted_at).format(I18n.t('dates.long_with_year')));
|
||||
i18nParams.time = escapeExpression(moment(grant.granted_at).format(I18n.t('dates.long_with_year')));
|
||||
}
|
||||
|
||||
return I18n.t(i18nKey, i18nParams);
|
||||
|
Reference in New Issue
Block a user