aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js62
1 files changed, 26 insertions, 36 deletions
diff --git a/view/js/main.js b/view/js/main.js
index cb492b9de..191f24b59 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -352,18 +352,18 @@
if(data.events == 0) { data.events = ''; $('.events-update').removeClass('show') } else { $('.events-update').addClass('show') }
$('.events-update').html(data.events);
- if(data.events_today == 0) { data.events_today = ''; $('.events-today-update').removeClass('show') } else { $('.events-today-update').addClass('show') }
+ if(data.events_today == 0) { data.events_today = ''; $('.events-today-update').removeClass('show') } else { $('.events-today-update').addClass('show'); $('.events-update').html(data.events + '*'); }
$('.events-today-update').html(data.events_today);
- if(data.birthdays == 0) { data.birthdays = ''; $('.birthdays-update').removeClass('show') } else { $('.birthdays-update').addClass('show') }
+ if(data.birthdays == 0) { data.birthdays = ''; $('.birthdays-update').removeClass('show') } else { $('.birthdays-update').addClass('show'); }
$('.birthdays-update').html(data.birthdays);
- if(data.birthdays_today == 0) { data.birthdays_today = ''; $('.birthdays-today-update').removeClass('show') } else { $('.birthdays-today-update').addClass('show') }
+ if(data.birthdays_today == 0) { data.birthdays_today = ''; $('.birthdays-today-update').removeClass('show') } else { $('.birthdays-today-update').addClass('show'); $('.birthdays-update').html(data.birthdays + '*'); }
$('.birthdays-today-update').html(data.birthdays_today);
if(data.all_events == 0) { data.all_events = ''; $('.all_events-update').removeClass('show') } else { $('.all_events-update').addClass('show') }
$('.all_events-update').html(data.all_events);
- if(data.all_events_today == 0) { data.all_events_today = ''; $('.all_events-today-update').removeClass('show') } else { $('.all_events-today-update').addClass('show') }
+ if(data.all_events_today == 0) { data.all_events_today = ''; $('.all_events-today-update').removeClass('show') } else { $('.all_events-today-update').addClass('show'); $('.all_events-update').html(data.all_events + '*'); }
$('.all_events-today-update').html(data.all_events_today);
$.jGrowl.defaults.closerTemplate = '<div>[ ' + aStr['closeAll'] + ']</div>';
@@ -386,8 +386,6 @@
function updateConvItems(mode,data) {
-
-
if(mode === 'update') {
prev = 'threads-begin';
@@ -546,14 +544,6 @@ function updateConvItems(mode,data) {
collapseHeight();
}
-
- // $(".wall-item-body").each(function() {
- // if(! $(this).hasClass('divmore')) {
- // $(this).divgrow({ initialHeight: 400, showBrackets: false });
- // $(this).addClass('divmore');
- // }
- //});
-
}
@@ -589,44 +579,44 @@ function updateConvItems(mode,data) {
in_progress = true;
var update_url;
+ var update_mode;
-// if(typeof buildCmd == 'function') {
- if(scroll_next) {
- bParam_page = next_page;
- page_load = true;
- }
- else {
- bParam_page = 1;
- }
- update_url = buildCmd();
-// }
-// else {
-// page_load = false;
-// var udargs = ((page_load) ? '/load' : '');
-// update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
-// }
-
- if(page_load)
+ if(scroll_next) {
+ bParam_page = next_page;
+ page_load = true;
+ }
+ else {
+ bParam_page = 1;
+ }
+
+ update_url = buildCmd();
+
+ if(page_load) {
$("#page-spinner").spin('small');
+ if(bParam_page == 1)
+ update_mode = 'replace';
+ else
+ update_mode = 'append';
+ }
+ else
+ update_mode = 'update';
$.get(update_url,function(data) {
- var update_mode = ((page_load && bParam_page == 1) ? 'replace' : 'update');
- if(scroll_next)
- update_mode = 'append';
page_load = false;
scroll_next = false;
- in_progress = false;
updateConvItems(update_mode,data);
$("#page-spinner").spin(false);
$("#profile-jot-text-loading").spin(false);
+ in_progress = false;
+
// FIXME - the following lines were added so that almost
// immediately after we update the posts on the page, we
// re-check and update the notification counts.
// As it turns out this causes a bit of an inefficiency
// as we're pinging twice for every update, once before
// and once after. A btter way to do this is to rewrite
- // NavUpdate and perhpas LiveUpdate so that we check for
+ // NavUpdate and perhaps LiveUpdate so that we check for
// post updates first and only call the notification ping
// once.