mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 09:58:06 +00:00
util: Remove execute_early.
This function was removed in favor of loading everything in ui_init.js. The asynchronous nature of jQuery 3 document-ready events may cause an undesirable order in which these are executed.
This commit is contained in:
@@ -103,26 +103,6 @@ var _ = global._;
|
||||
assert(!util.same_recipient(undefined, undefined));
|
||||
}());
|
||||
|
||||
(function test_execute_early() {
|
||||
var doc = $(document);
|
||||
doc.one = function (event_name, f) {
|
||||
assert.equal(event_name, 'phantom_page_loaded');
|
||||
f();
|
||||
};
|
||||
|
||||
var called = false;
|
||||
var func = function () { called = true; };
|
||||
|
||||
global.page_params.test_suite = true;
|
||||
util.execute_early(func);
|
||||
assert(called);
|
||||
|
||||
called = false;
|
||||
global.page_params.test_suite = false;
|
||||
util.execute_early(func);
|
||||
assert(called);
|
||||
}());
|
||||
|
||||
(function test_robust_uri_decode() {
|
||||
assert.equal(util.robust_uri_decode('xxx%3Ayyy'), 'xxx:yyy');
|
||||
assert.equal(util.robust_uri_decode('xxx%3'), 'xxx');
|
||||
|
||||
@@ -197,14 +197,6 @@ exports.CachedValue.prototype = {
|
||||
},
|
||||
};
|
||||
|
||||
exports.execute_early = function (func) {
|
||||
if (page_params.test_suite) {
|
||||
$(document).one('phantom_page_loaded', func);
|
||||
} else {
|
||||
$(func);
|
||||
}
|
||||
};
|
||||
|
||||
exports.is_all_or_everyone_mentioned = function (message_content) {
|
||||
var all_everyone_re = /(^|\s)(@\*{2}(all|everyone)\*{2})|(@(all|everyone))($|\s)/;
|
||||
return all_everyone_re.test(message_content);
|
||||
|
||||
Reference in New Issue
Block a user