updated components to be a require.js module, not a global (:rage2:)

v1.18.x
Julian Lam 10 years ago
parent f380f4214a
commit 16c6578bdb

@ -2,7 +2,7 @@
/* globals define, socket, app, templates, translator, ajaxify*/
define('forum/categories', function() {
define('forum/categories', ['components'], function(components) {
var categories = {};
$(window).on('action:ajaxify.start', function(ev, data) {

@ -8,8 +8,9 @@ define('forum/category', [
'share',
'navigator',
'forum/categoryTools',
'sort'
], function(composer, pagination, infinitescroll, share, navigator, categoryTools, sort) {
'sort',
'components'
], function(composer, pagination, infinitescroll, share, navigator, categoryTools, sort, components) {
var Category = {};
$(window).on('action:ajaxify.start', function(ev, data) {

@ -4,7 +4,7 @@
/* globals define, app, translator, socket, bootbox, ajaxify */
define('forum/categoryTools', ['forum/topic/move', 'topicSelect'], function(move, topicSelect) {
define('forum/categoryTools', ['forum/topic/move', 'topicSelect', 'components'], function(move, topicSelect, components) {
var CategoryTools = {};

@ -1,7 +1,7 @@
"use strict";
/*globals define, app, translator, socket*/
define('forum/footer', ['notifications', 'chat'], function(Notifications, Chat) {
define('forum/footer', ['notifications', 'chat', 'components'], function(Notifications, Chat, components) {
Notifications.prepareDOM();
Chat.prepareDOM();

@ -2,7 +2,7 @@
/* globals define, app, socket, utils */
define('forum/recent', ['forum/infinitescroll', 'composer'], function(infinitescroll, composer) {
define('forum/recent', ['forum/infinitescroll', 'composer', 'components'], function(infinitescroll, composer, components) {
var Recent = {};
var newTopicCount = 0,

@ -1,7 +1,7 @@
'use strict';
/* globals define, app, components, templates, translator, socket, bootbox, config, ajaxify, RELATIVE_PATH, utils */
/* globals define, app, templates, translator, socket, bootbox, config, ajaxify, RELATIVE_PATH, utils */
define('forum/topic', [
'forum/pagination',
@ -12,8 +12,9 @@ define('forum/topic', [
'forum/topic/browsing',
'forum/topic/posts',
'navigator',
'sort'
], function(pagination, infinitescroll, threadTools, postTools, events, browsing, posts, navigator, sort) {
'sort',
'components'
], function(pagination, infinitescroll, threadTools, postTools, events, browsing, posts, navigator, sort, components) {
var Topic = {},
currentUrl = '';

@ -1,14 +1,15 @@
'use strict';
/* globals app, ajaxify, components, define, socket, translator, templates */
/* globals app, ajaxify, define, socket, translator, templates */
define('forum/topic/events', [
'forum/topic/browsing',
'forum/topic/postTools',
'forum/topic/threadTools',
'forum/topic/posts'
], function(browsing, postTools, threadTools, posts) {
'forum/topic/posts',
'components'
], function(browsing, postTools, threadTools, posts, components) {
var Events = {};

@ -1,8 +1,8 @@
'use strict';
/* globals define, app, ajaxify, components, translator, socket */
/* globals define, app, ajaxify, translator, socket */
define('forum/topic/fork', function() {
define('forum/topic/fork', ['components'], function(components) {
var Fork = {},
forkModal,

@ -1,8 +1,8 @@
'use strict';
/* globals define, app, ajaxify, bootbox, components, socket, templates, translator, utils */
/* globals define, app, ajaxify, bootbox, socket, templates, translator, utils */
define('forum/topic/postTools', ['composer', 'share', 'navigator'], function(composer, share, navigator) {
define('forum/topic/postTools', ['composer', 'share', 'navigator', 'components'], function(composer, share, navigator, components) {
var PostTools = {},
topicName;

@ -1,13 +1,14 @@
'use strict';
/* globals config, app, ajaxify, components, define, socket, utils */
/* globals config, app, ajaxify, define, socket, utils */
define('forum/topic/posts', [
'forum/pagination',
'forum/infinitescroll',
'forum/topic/postTools',
'navigator'
], function(pagination, infinitescroll, postTools, navigator) {
'navigator',
'components'
], function(pagination, infinitescroll, postTools, navigator, components) {
var Posts = {};

@ -1,8 +1,8 @@
'use strict';
/* globals define, app, components, translator, ajaxify, socket, bootbox */
/* globals define, app, translator, ajaxify, socket, bootbox */
define('forum/topic/threadTools', ['forum/topic/fork', 'forum/topic/move'], function(fork, move) {
define('forum/topic/threadTools', ['forum/topic/fork', 'forum/topic/move', 'components'], function(fork, move, components) {
var ThreadTools = {};

@ -2,7 +2,7 @@
/* globals define, app, socket */
define('forum/unread', ['forum/recent', 'topicSelect', 'forum/infinitescroll'], function(recent, topicSelect, infinitescroll) {
define('forum/unread', ['forum/recent', 'topicSelect', 'forum/infinitescroll', 'components'], function(recent, topicSelect, infinitescroll, components) {
var Unread = {};
$(window).on('action:ajaxify.start', function(ev, data) {

@ -1,8 +1,7 @@
"use strict";
define('components', function() {
var components = {};
var components = components || {};
(function() {
components.core = {
'post': function(name, value) {
return $('[data-' + name + '="' + value + '"]');
@ -44,4 +43,6 @@ var components = components || {};
return $('[component="' + arguments[0] + '"]');
}
};
}());
return components;
});

@ -1,10 +1,10 @@
'use strict';
/* globals app, components, define, ajaxify, utils, translator, config */
/* globals app, define, ajaxify, utils, translator, config */
define('navigator', ['forum/pagination'], function(pagination) {
define('navigator', ['forum/pagination', 'components'], function(pagination, components) {
var navigator = {};
var index = 1;

@ -2,7 +2,7 @@
/* globals define*/
define('topicSelect', function() {
define('topicSelect', ['components'], function(components) {
var TopicSelect = {};
var lastSelected;

Loading…
Cancel
Save