mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 18:23:37 +08:00
Some javascript refactoring: Move markdown functions into their own classs, remove extraneous window.
calls.
This commit is contained in:
parent
e2ead81818
commit
1416bc7475
|
@ -137,7 +137,7 @@ Discourse.AdminUser = Discourse.Model.extend({
|
|||
|
||||
});
|
||||
|
||||
window.Discourse.AdminUser.reopenClass({
|
||||
Discourse.AdminUser.reopenClass({
|
||||
|
||||
bulkApprove: function(users) {
|
||||
users.each(function(user) {
|
||||
|
|
|
@ -34,7 +34,7 @@ _getTransitionEndEventName = function() {
|
|||
};
|
||||
transitionEnd = _getTransitionEndEventName();
|
||||
|
||||
window.Discourse.TransitionHelper = {
|
||||
Discourse.TransitionHelper = {
|
||||
after: function(element, callback) {
|
||||
return $(element).on(transitionEnd, callback);
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.CategoryList = Discourse.Model.extend({});
|
||||
Discourse.CategoryList = Discourse.Model.extend({});
|
||||
|
||||
window.Discourse.CategoryList.reopenClass({
|
||||
Discourse.CategoryList.reopenClass({
|
||||
|
||||
categoriesFrom: function(result) {
|
||||
var categories, users;
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.InputValidation = Discourse.Model.extend({});
|
||||
Discourse.InputValidation = Discourse.Model.extend({});
|
||||
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ Discourse.Post = Discourse.Model.extend({
|
|||
}).property('reply_count')
|
||||
});
|
||||
|
||||
window.Discourse.Post.reopenClass({
|
||||
Discourse.Post.reopenClass({
|
||||
|
||||
createActionSummary: function(result) {
|
||||
var lookup;
|
||||
|
|
|
@ -343,7 +343,7 @@ Discourse.Topic = Discourse.Model.extend({
|
|||
}
|
||||
});
|
||||
|
||||
window.Discourse.Topic.reopenClass({
|
||||
Discourse.Topic.reopenClass({
|
||||
NotificationLevel: {
|
||||
WATCHING: 3,
|
||||
TRACKING: 2,
|
||||
|
|
|
@ -138,7 +138,7 @@ Discourse.UserAction.reopenClass({
|
|||
GOT_PRIVATE_MESSAGE: 13
|
||||
});
|
||||
|
||||
window.Discourse.UserAction.reopenClass({
|
||||
Discourse.UserAction.reopenClass({
|
||||
statGroups: (function() {
|
||||
var g;
|
||||
g = {};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.ApplicationView = Discourse.View.extend({
|
||||
Discourse.ApplicationView = Discourse.View.extend({
|
||||
templateName: 'application'
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.FeaturedTopicsView = Discourse.View.extend({
|
||||
Discourse.FeaturedTopicsView = Discourse.View.extend({
|
||||
templateName: 'featured_topics',
|
||||
classNames: ['category-list-item']
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.ListCategoriesView = Discourse.View.extend({
|
||||
Discourse.ListCategoriesView = Discourse.View.extend({
|
||||
|
||||
templateName: 'list/categories',
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.ArchetypeOptionsModalView = window.Discourse.ModalBodyView.extend({
|
||||
Discourse.ArchetypeOptionsModalView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/archetype_options',
|
||||
title: Em.String.i18n('topic.options')
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.SearchView = Discourse.View.extend({
|
||||
Discourse.SearchView = Discourse.View.extend({
|
||||
tagName: 'div',
|
||||
classNames: ['d-dropdown'],
|
||||
elementId: 'search-dropdown',
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.TopicAdminMenuView = Discourse.View.extend({
|
||||
Discourse.TopicAdminMenuView = Discourse.View.extend({
|
||||
|
||||
willDestroyElement: function() {
|
||||
$('html').off('mouseup.discourse-topic-admin-menu');
|
||||
|
|
|
@ -489,7 +489,7 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
|
|||
}
|
||||
});
|
||||
|
||||
window.Discourse.TopicView.reopenClass({
|
||||
Discourse.TopicView.reopenClass({
|
||||
|
||||
// Scroll to a given post, if in the DOM. Returns whether it was in the DOM or not.
|
||||
scrollTo: function(topicId, postNumber, callback) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.PreferencesEmailView = Discourse.View.extend({
|
||||
Discourse.PreferencesEmailView = Discourse.View.extend({
|
||||
templateName: 'user/email',
|
||||
classNames: ['user-preferences'],
|
||||
didInsertElement: function() {
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
window.Discourse.View = Ember.View.extend(Discourse.Presence, {});
|
||||
Discourse.View = Ember.View.extend(Discourse.Presence, {});
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
/* These will help us migrate up to the new ember's default behavior
|
||||
*/
|
||||
|
||||
|
||||
// These will help us migrate up to the new ember's default behavior
|
||||
window.ENV = {
|
||||
CP_DEFAULT_CACHEABLE: true,
|
||||
VIEW_PRESERVES_CONTEXT: true,
|
||||
|
@ -10,7 +7,6 @@
|
|||
};
|
||||
|
||||
window.Discourse = {};
|
||||
|
||||
window.Discourse.SiteSettings = {};
|
||||
Discourse.SiteSettings = {};
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
Discourse.CDN = '<%= Rails.configuration.action_controller.asset_host %>';
|
||||
Discourse.BaseUrl = '<%= RailsMultisite::ConnectionManagement.current_hostname %>';
|
||||
Discourse.Environment = '<%= Rails.env %>';
|
||||
window.Discourse.Router.map(function() {
|
||||
Discourse.Router.map(function() {
|
||||
return Discourse.routeBuilder.call(this);
|
||||
});
|
||||
Discourse.start()
|
||||
|
|
Loading…
Reference in New Issue
Block a user