mirror of https://github.com/zulip/zulip.git
Get initial messages from get_updates_longpoll
(imported from commit 2bb9c51409735abe23bad758338b13121aea4c99)
This commit is contained in:
parent
ee75f7ae8d
commit
12e458df80
|
@ -33,7 +33,6 @@
|
|||
{% endif %}
|
||||
|
||||
<script type="text/javascript">
|
||||
var zephyr_array = {{ zephyr_array }};
|
||||
var initial_pointer = {{ user_profile.pointer }};
|
||||
var email = "{{ user_profile.user.email }}";
|
||||
var class_list = {{ classes }};
|
||||
|
|
|
@ -22,6 +22,7 @@ function register_huddle_onclick(zephyr_row, sender) {
|
|||
});
|
||||
}
|
||||
|
||||
var zephyr_array = [];
|
||||
var zephyr_dict = {};
|
||||
var status_classes = 'alert-error alert-success alert-info';
|
||||
|
||||
|
@ -759,12 +760,6 @@ function add_messages(zephyrs) {
|
|||
add_to_table(zephyrs, 'zhome', function () { return true; });
|
||||
}
|
||||
|
||||
$(function () {
|
||||
add_messages(zephyr_array);
|
||||
select_and_show_by_id(initial_pointer);
|
||||
get_updates_longpoll();
|
||||
});
|
||||
|
||||
function clear_compose_box() {
|
||||
$("#zephyr_compose").find('input[type=text], textarea').val('');
|
||||
}
|
||||
|
@ -787,6 +782,8 @@ function get_updates_longpoll() {
|
|||
add_messages(data.zephyrs);
|
||||
$.each(data.zephyrs, function () {
|
||||
zephyr_array.push(this);
|
||||
if (this.id === initial_pointer)
|
||||
select_and_show_by_id(initial_pointer);
|
||||
});
|
||||
}
|
||||
setTimeout(get_updates_longpoll, 0);
|
||||
|
@ -817,6 +814,7 @@ function get_updates_longpoll() {
|
|||
}
|
||||
|
||||
$(function () {
|
||||
get_updates_longpoll();
|
||||
update_autocomplete();
|
||||
$('.button-slide').click(function () {
|
||||
show_compose('class', $("#class"));
|
||||
|
|
|
@ -96,8 +96,6 @@ def home(request):
|
|||
user_profile.pointer = min([zephyr.id for zephyr in zephyrs])
|
||||
user_profile.save()
|
||||
|
||||
zephyr_json = simplejson.dumps([zephyr.to_dict() for zephyr in zephyrs])
|
||||
|
||||
# Populate personals autocomplete list based on everyone in your
|
||||
# realm. Later we might want a 2-layer autocomplete, where we
|
||||
# consider specially some sort of "buddy list" who e.g. you've
|
||||
|
@ -118,8 +116,7 @@ def home(request):
|
|||
instances = list(set(zephyr.instance for zephyr in class_zephyrs))
|
||||
|
||||
return render_to_response('zephyr/index.html',
|
||||
{'zephyr_array' : zephyr_json,
|
||||
'user_profile': user_profile,
|
||||
{'user_profile': user_profile,
|
||||
'email_hash' : hashlib.md5(settings.HASH_SALT + user_profile.user.email).hexdigest(),
|
||||
'people' : simplejson.dumps(people),
|
||||
'classes' : simplejson.dumps(classes),
|
||||
|
|
Loading…
Reference in New Issue