mirror of https://github.com/zulip/zulip.git
Add util module
(imported from commit 3844e136fb799c6f57f8823255addf00a07ef686)
This commit is contained in:
parent
d29c77b14c
commit
46f4a5eb38
|
@ -40,6 +40,7 @@
|
|||
<script type="text/javascript" src="/static/third/jquery-throttle-debounce/jquery.ba-throttle-debounce.min.js"></script>
|
||||
<script type="text/javascript" src="/static/third/jquery.idle/jquery.idle.js"></script>
|
||||
<script type="text/javascript" src="/static/third/jquery-autosize/jquery.autosize.js"></script>
|
||||
<script type="text/javascript" src="{{ static_hidden }}js/util.js"></script>
|
||||
<script type="text/javascript" src="{{ static_hidden }}js/setup.js"></script>
|
||||
<script type="text/javascript" src="{{ static_hidden }}js/rows.js"></script>
|
||||
<script type="text/javascript" src="{{ static_hidden }}js/narrow.js"></script>
|
||||
|
|
|
@ -48,6 +48,9 @@ var globals =
|
|||
// ui.js
|
||||
+ ' ui'
|
||||
|
||||
// util.js
|
||||
+ ' util'
|
||||
|
||||
// zephyr.js
|
||||
+ ' message_array message_dict get_updates_params'
|
||||
+ ' clear_table add_to_table add_messages'
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../../../static/js/util.js
|
|
@ -0,0 +1,11 @@
|
|||
var util = (function () {
|
||||
|
||||
var exports = {};
|
||||
|
||||
// From MDN: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random
|
||||
exports.random_int = function random_int(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
};
|
||||
|
||||
return exports;
|
||||
}());
|
Loading…
Reference in New Issue