mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
Add people.initialize().
This makes us not have to stub jquery in many of our node tests!
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
});
|
||||
|
||||
@@ -12,7 +12,6 @@ set_global('pygments_data', {langs:
|
||||
{python: 0, javscript: 1, html: 2, css: 3},
|
||||
});
|
||||
|
||||
global.stub_out_jquery();
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
stream_data: 'js/stream_data.js',
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
hash_util: 'js/hash_util.js',
|
||||
people: 'js/people.js',
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
global.stub_out_jquery();
|
||||
|
||||
set_global('window', {
|
||||
location: {
|
||||
origin: 'http://zulip.zulipdev.com',
|
||||
|
||||
@@ -2,7 +2,6 @@ var _ = require('node_modules/underscore/underscore.js');
|
||||
var MessageListView = require('js/message_list_view.js');
|
||||
|
||||
add_dependencies({
|
||||
$: 'jquery',
|
||||
XDate: 'node_modules/xdate/src/xdate.js',
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
util: 'js/util.js',
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
hash_util: 'js/hash_util.js',
|
||||
hashchange: 'js/hashchange.js',
|
||||
|
||||
@@ -2,8 +2,6 @@ add_dependencies({
|
||||
util: 'js/util.js',
|
||||
});
|
||||
|
||||
global.stub_out_jquery();
|
||||
|
||||
var people = require("js/people.js");
|
||||
set_global('blueslip', {});
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
Handlebars: 'handlebars',
|
||||
templates: 'js/templates',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
set_global('document', {});
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
// clean up after themselves, and they should explicitly stub all
|
||||
// dependencies.
|
||||
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
util: 'js/util.js',
|
||||
Handlebars: 'handlebars',
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
set_global('page_params', {
|
||||
is_admin: false,
|
||||
realm_users: [],
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
var th = require('js/typeahead_helper.js');
|
||||
|
||||
global.stub_out_jquery();
|
||||
|
||||
set_global('page_params', {realm_is_zephyr_mirror_realm: false});
|
||||
|
||||
add_dependencies({
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
// clean up after themselves, and they should explicitly stub all
|
||||
// dependencies (except _).
|
||||
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
muting: 'js/muting.js',
|
||||
people: 'js/people.js',
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
global.stub_out_jquery();
|
||||
|
||||
add_dependencies({
|
||||
people: 'js/people.js',
|
||||
});
|
||||
|
||||
@@ -679,7 +679,7 @@ exports.is_my_user_id = function (user_id) {
|
||||
return user_id.toString() === my_user_id.toString();
|
||||
};
|
||||
|
||||
$(function () {
|
||||
exports.initialize = function () {
|
||||
_.each(page_params.realm_users, function (person) {
|
||||
exports.add_in_realm(person);
|
||||
});
|
||||
@@ -695,7 +695,7 @@ $(function () {
|
||||
|
||||
delete page_params.realm_users; // We are the only consumer of this.
|
||||
delete page_params.cross_realm_bots;
|
||||
});
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
||||
|
||||
@@ -241,6 +241,7 @@ $(function () {
|
||||
|
||||
// initialize other stuff
|
||||
reload.initialize();
|
||||
people.initialize();
|
||||
markdown.initialize();
|
||||
composebox_typeahead.initialize();
|
||||
search.initialize();
|
||||
|
||||
Reference in New Issue
Block a user