diff options
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 57 | ||||
-rw-r--r-- | view/js/mod_events.js | 37 |
2 files changed, 86 insertions, 8 deletions
diff --git a/view/js/main.js b/view/js/main.js index eeee9e3ab..13f1fea8f 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -276,6 +276,23 @@ return false; } } + if(event.keyCode == '34') { + if((pageHasMoreContent) && (! loadingPage)) { + $('#more').hide(); + $('#no-more').hide(); + + next_page++; + scroll_next = true; + loadingPage = true; + + if(($('.directory-end').length == 0) && ($('.photos-end').length == 0)) + liveUpdate(); + else + pageUpdate(); + return true; + } + } + if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) { event.preventDefault(); if(stopped == false) { @@ -395,6 +412,8 @@ function updatePageItems(mode,data) { + + if(mode === 'append') { $(data).each(function() { $('#page-end').before($(this)); @@ -404,6 +423,12 @@ function updatePageItems(mode,data) { loadingPage = false; } } + + var e = document.getElementById('content-complete'); + if(e) { + pageHasMoreContent = false; + } + } @@ -664,7 +689,7 @@ function updateConvItems(mode,data) { bParam_page = 1; } - update_url = baseurl + '/directory/?f=&page=' + bParam_page; + update_url = baseurl + '/' + page_query + '/?f=&aj=1&page=' + bParam_page + extra_args ; $("#page-spinner").spin('small'); update_mode = 'append'; @@ -679,6 +704,23 @@ function updateConvItems(mode,data) { } + function justifyPhotos(bParam_page) { + justifiedGalleryActive = true; + $('#photo-album-contents-' + bParam_page).justifiedGallery({ + lastRow : 'nojustify', + captions: true, + margins: 3, + rowHeight : 150, + sizeRangeSuffixes : { + 'lt100': '', + 'lt240': '', + 'lt320': '', + 'lt500': '', + 'lt640': '', + 'lt1024': '' + } + }).on('jg.complete', function(e){ justifiedGalleryActive = false; }); + } function notify_popup_loader(notifyType) { @@ -1025,7 +1067,6 @@ function previewTheme(elm) { } $(document).ready(function() { - jQuery.timeago.settings.strings = { prefixAgo : aStr['t01'], prefixFromNow : aStr['t02'], @@ -1064,7 +1105,7 @@ $(document).ready(function() { -$(window).scroll(function () { +$(window).scroll(function () { if(typeof buildCmd == 'function') { // This is a content page with items and/or conversations $('#more').hide(); @@ -1074,8 +1115,8 @@ $(window).scroll(function () { $('#more').css("top","400"); $('#more').show(); } - - if($(window).scrollTop() + $(window).height() > $(document).height() - 100) { + + if($(window).scrollTop() + $(window).height() == $(document).height()) { if((pageHasMoreContent) && (! loadingPage)) { $('#more').hide(); $('#no-more').hide(); @@ -1094,9 +1135,9 @@ $(window).scroll(function () { $('#more').css("top","400"); $('#more').show(); } - - if($(window).scrollTop() + $(window).height() > $(document).height() - 100) { - if((pageHasMoreContent) && (! loadingPage)) { + + if($(window).scrollTop() + $(window).height() == $(document).height()) { + if((pageHasMoreContent) && (! loadingPage) && (! justifiedGalleryActive)) { $('#more').hide(); $('#no-more').hide(); diff --git a/view/js/mod_events.js b/view/js/mod_events.js new file mode 100644 index 000000000..0ce128fcc --- /dev/null +++ b/view/js/mod_events.js @@ -0,0 +1,37 @@ + +$(document).ready( function() { showHideFinishDate(); }); + +function showHideFinishDate() { + if( $('#event-nofinish-checkbox').is(':checked')) + $('#event-finish-wrapper').hide(); + else + $('#event-finish-wrapper').show(); +} + + + + function eventGetStart() { + //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); + $('#startModal').modal(); + $('#start-modal-OKButton').on('click', function() { + reply=$('#start-date').val(); + if(reply && reply.length) { + $('#start-text').val(reply); + $('#startModal').modal('hide'); + } + }) + + + } + function eventGetFinish() { + //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); + $('#finishModal').modal(); + $('#finish-modal-OKButton').on('click', function() { + reply=$('#finish-date').val(); + if(reply && reply.length) { + $('#finish-text').val(reply); + $('#finishModal').modal('hide'); + } + }) + + } |