diff options
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/acl.js | 20 | ||||
-rw-r--r-- | view/js/main.js | 30 |
2 files changed, 24 insertions, 26 deletions
diff --git a/view/js/acl.js b/view/js/acl.js index c129634a0..f9428e1c5 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -17,20 +17,24 @@ function ACL(backend_url, preset){ that.item_tpl = unescape($(".acl-list-item[rel=acl-template]").html()); that.showall = $("#acl-showall"); + // set the initial ACL lists in case the enclosing form gets submitted before the ajax loader completes. + that.on_submit(); + if (preset.length==0) that.showall.removeClass("btn-default").addClass("btn-warning"); /*events*/ $(document).ready(function() { - that.showall.click(that.on_showall); - $(document).on('click','.acl-button-show',that.on_button_show); - $(document).on('click','.acl-button-hide',that.on_button_hide); - $("#acl-search").keypress(that.on_search); -// $("#acl-wrapper").parents("form").submit(that.on_submit); +// setTimeout( function() { + that.showall.click(that.on_showall); + $(document).on('click','.acl-button-show',that.on_button_show); + $(document).on('click','.acl-button-hide',that.on_button_hide); + $("#acl-search").keypress(that.on_search); - /* startup! */ - that.get(0,100); - that.on_submit(); + /* startup! */ + that.get(0,100); + that.on_submit(); +// }, 5000 ); }); } diff --git a/view/js/main.js b/view/js/main.js index beedb7f01..04e43f72e 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -180,6 +180,13 @@ timer = setTimeout(NavUpdate,2000); } + function markItemRead(itemId) { + $.get('ping?f=&markItemRead='+itemId); + $('.unseen-wall-indicator-'+itemId).hide(); + } + + + var src = null; var prev = null; var livetime = null; @@ -200,6 +207,7 @@ var loadingPage = true; var pageHasMoreContent = true; var updateCountsOnly = false; + var divmore_height = 400; $(function() { $.ajaxSetup({cache: false}); @@ -335,7 +343,7 @@ if($('#live-network').length) { src = 'network'; liveUpdate(); } if($('#live-channel').length) { src = 'channel'; liveUpdate(); } - if($('#live-community').length) { src = 'community'; liveUpdate(); } + if($('#live-home').length) { src = 'home'; liveUpdate(); } if($('#live-display').length) { src = 'display'; liveUpdate(); } if($('#live-search').length) { src = 'search'; liveUpdate(); } @@ -458,25 +466,17 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // divgrow doesn't prevent itself from attaching a second (or 500th) - // "show more" div to a content region - it also has a few other - // issues related to how we're trying to use it. - // disable for now. - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } else { $('img',this).each(function() { $(this).attr('src',$(this).attr('dst')); }); - // more FIXME related to expanded comments if($('#collapsed-comments-'+itmId).is(':visible')) isVisible = true; $('#' + ident).replaceWith($(this)); if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); - } prev = ident; }); @@ -508,8 +508,6 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); - } else { $('img',this).each(function() { @@ -521,7 +519,6 @@ function updateConvItems(mode,data) { if(isVisible) showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } }); @@ -557,7 +554,6 @@ function updateConvItems(mode,data) { showHideComments(itmId); $(".autotime").timeago(); - // $("div.wall-item-body").divgrow({ initialHeight: 400 }); } prev = ident; }); @@ -597,17 +593,15 @@ function updateConvItems(mode,data) { function collapseHeight() { $(".wall-item-body").each(function() { - if($(this).height() > 410) { + if($(this).height() > divmore_height + 10) { if(! $(this).hasClass('divmore')) { - $(this).divgrow({ initialHeight: 400, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); + $(this).divgrow({ initialHeight: divmore_height, moreText: aStr['divgrowmore'], lessText: aStr['divgrowless'], showBrackets: false }); $(this).addClass('divmore'); } } }); } - - function liveUpdate() { if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').spin(false); return; } if(($('.comment-edit-text-full').length) || (in_progress)) { @@ -749,7 +743,7 @@ function updateConvItems(mode,data) { $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); $(data.notify).each(function() { - html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.class); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); $("#nav-" + notifyType + "-menu").append(html); }); $(".dropdown-menu img[data-src]").each(function(i, el){ |