diff options
Diffstat (limited to 'view')
-rw-r--r-- | view/js/autocomplete.js | 2 | ||||
-rw-r--r-- | view/js/main.js | 41 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 3 | ||||
-rwxr-xr-x | view/tpl/conv_item.tpl | 9 | ||||
-rwxr-xr-x | view/tpl/conv_list.tpl | 9 | ||||
-rwxr-xr-x | view/tpl/group_edit.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/jot-header.tpl | 12 | ||||
-rwxr-xr-x | view/tpl/jot.tpl | 12 | ||||
-rw-r--r-- | view/tpl/notifications_widget.tpl | 2 | ||||
-rw-r--r-- | view/tpl/privacy_groups.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/remote_friends_common.tpl | 3 |
11 files changed, 68 insertions, 27 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 6b77f0631..278a0a176 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -216,8 +216,6 @@ function string2bb(element) { }); textcomplete.register([contacts,forums,smilies,tags]); }); - - }; })( jQuery ); diff --git a/view/js/main.js b/view/js/main.js index a69bcfa64..4718fb98f 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -44,6 +44,17 @@ $(document).ready(function() { $(document).on('click', '.conversation-settings-link', getConversationSettings); $(document).on('click', '#settings_module_ajax_submit', postConversationSettings); + $(document).on('click focus', '.comment-edit-form textarea', function(e) { + if(! this.autocomplete_handled) { + /* autocomplete @nicknames */ + $(this).editor_autocomplete(baseurl+"/acl?f=&n=1"); + /* autocomplete bbcode */ + $(this).bbco_autocomplete('bbcode'); + + this.autocomplete_handled = true; + } + }); + var tf = new Function('n', 's', 'var k = s.split("/")['+aStr['plural_func']+']; return (k ? k : s);'); jQuery.timeago.settings.strings = { @@ -239,7 +250,11 @@ function handle_comment_form(e) { },10000); }); - function commentSaveChanges(convId,isFinal = false) { + function commentSaveChanges(convId, isFinal) { + + if(typeof isFinal === 'undefined') + isFinal = false; + if(auto_save_draft) { tmp = $('#' + emptyCommentElm).val(); if(tmp) { @@ -453,6 +468,9 @@ function notificationsUpdate(cached_data) { $.get(pingCmd,function(data) { // Put the object into storage + if(! data) + return; + sessionStorage.setItem('notifications_cache', JSON.stringify(data)); var fnotifs = []; @@ -716,6 +734,7 @@ function updateConvItems(mode,data) { title.replace(/\s+$/, ''); if (title) { savedTitle = title + " " + savedTitle; + document.title = title; } } } @@ -751,12 +770,7 @@ function updateConvItems(mode,data) { mediaPlaying = false; }); - /* autocomplete @nicknames */ - $(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); - /* autocomplete bbcode */ - $(".comment-edit-form textarea").bbco_autocomplete('bbcode'); - - var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; })); + var bimgs = ((preloadImages) ? false : $(".wall-item-body img, .wall-photo-item img").not(function() { return this.complete; })); var bimgcount = bimgs.length; if (bimgcount) { @@ -832,10 +846,10 @@ function collapseHeight() { }); var collapsedContentHeight = Math.ceil($("#region_2").height()); - contentHeightDiff = origContentHeight - collapsedContentHeight; + contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight; console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px'); - if(i){ + if(i && !liking){ var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i); console.log('collapsed above viewport count: ' + i); $(window).scrollTop(sval); @@ -888,7 +902,12 @@ function liveUpdate(notify_id) { if((src === null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; } - if(($('.comment-edit-text.expanded').length) || (in_progress) || (mediaPlaying)) { + // if auto updates are enabled and a comment box is open, + // prevent live updates until the comment is submitted + + var lockUpdates = (($('.comment-edit-text.expanded').length && (! bParam_static)) ? true : false); + + if(lockUpdates || in_progress || mediaPlaying) { if(livetime) { clearTimeout(livetime); } @@ -981,7 +1000,7 @@ function liveUpdate(notify_id) { $("#profile-jot-text-loading").hide(); // adjust scroll position if new content was added above viewport - if(update_mode === 'update') { + if(update_mode === 'update' && !justifiedGalleryActive) { $(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index b406e710c..18c3db665 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1806,6 +1806,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { - background-color: yellow; - padding: 2px 4px; + background-color: yellow; } diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 7dddf9c01..428529de2 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -9,12 +9,12 @@ <div class="wall-item-outside-wrapper{{if $item.is_comment}} comment{{/if}}{{if $item.previewing}} preview{{/if}}" id="wall-item-outside-wrapper-{{$item.id}}" > <div class="clearfix wall-item-content-wrapper{{if $item.is_comment}} comment{{/if}}" id="wall-item-content-wrapper-{{$item.id}}"> {{if $item.photo}} - <div class="wall-photo-item" id="wall-photo-item-{{$item.id}}"> + <div class="wall-photo-item{{if $item.is_new && !$item.title}} wall-item-head-new rounded-top{{/if}}" id="wall-photo-item-{{$item.id}}"> {{$item.photo}} </div> {{/if}} {{if $item.event}} - <div class="wall-event-item" id="wall-event-item-{{$item.id}}"> + <div class="wall-event-item{{if $item.is_new && !$item.title}} wall-item-head-new rounded-top{{/if}}" id="wall-event-item-{{$item.id}}"> {{$item.event}} </div> {{/if}} @@ -26,7 +26,7 @@ <hr class="m-0"> {{/if}} {{/if}} - <div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}"> + <div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment && !$item.photo}} wall-item-head-new rounded-top{{/if}}"> <div class="wall-item-info " id="wall-item-info-{{$item.id}}" > <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}"> <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" /> @@ -146,6 +146,9 @@ {{if $item.share}} <a class="dropdown-item" href="#" onclick="jotShare({{$item.id}},{{$item.item_type}}); return false"><i class="generic-icons-nav fa fa-fw fa-retweet" title="{{$item.share.0}}"></i>{{$item.share.0}}</a> {{/if}} + {{if $item.embed}} + <a class="dropdown-item" href="#" onclick="jotEmbed({{$item.id}},{{$item.item_type}}); return false"><i class="generic-icons-nav fa fa-fw fa-share" title="{{$item.embed.0}}"></i>{{$item.embed.0}}</a> + {{/if}} {{if $item.plink}} <a class="dropdown-item" href="{{$item.plink.href}}" title="{{$item.plink.title}}" class="u-url"><i class="generic-icons-nav fa fa-fw fa-external-link"></i>{{$item.plink.title}}</a> {{/if}} diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index c6da3d8a4..63e74b159 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -9,12 +9,12 @@ <div class="wall-item-outside-wrapper{{if $item.is_comment}} comment{{/if}}{{if $item.previewing}} preview{{/if}}" id="wall-item-outside-wrapper-{{$item.id}}" > <div class="clearfix wall-item-content-wrapper{{if $item.is_comment}} comment{{/if}}" id="wall-item-content-wrapper-{{$item.id}}"> {{if $item.photo}} - <div class="wall-photo-item" id="wall-photo-item-{{$item.id}}"> + <div class="wall-photo-item{{if $item.is_new && !$item.title}} wall-item-head-new rounded-top{{/if}}" id="wall-photo-item-{{$item.id}}"> {{$item.photo}} </div> {{/if}} {{if $item.event}} - <div class="wall-event-item" id="wall-event-item-{{$item.id}}"> + <div class="wall-event-item{{if $item.is_new && !$item.title}} wall-item-head-new rounded-top{{/if}}" id="wall-event-item-{{$item.id}}"> {{$item.event}} </div> {{/if}} @@ -26,7 +26,7 @@ <hr class="m-0"> {{/if}} {{/if}} - <div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}"> + <div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment && !$item.photo}} wall-item-head-new rounded-top{{/if}}"> <div class="wall-item-info" id="wall-item-info-{{$item.id}}" > <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}"> <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" /></a> @@ -139,6 +139,9 @@ {{if $item.share}} <a class="dropdown-item" href="#" onclick="jotShare({{$item.id}},{{$item.item_type}}); return false"><i class="generic-icons-nav fa fa-fw fa-retweet" title="{{$item.share.0}}"></i>{{$item.share.0}}</a> {{/if}} + {{if $item.embed}} + <a class="dropdown-item" href="#" onclick="jotEmbed({{$item.id}},{{$item.item_type}}); return false"><i class="generic-icons-nav fa fa-fw fa-share" title="{{$item.embed.0}}"></i>{{$item.embed.0}}</a> + {{/if}} {{if $item.plink}} <a class="dropdown-item" href="{{$item.plink.href}}" title="{{$item.plink.title}}" class="u-url"><i class="generic-icons-nav fa fa-fw fa-external-link"></i>{{$item.plink.title}}</a> {{/if}} diff --git a/view/tpl/group_edit.tpl b/view/tpl/group_edit.tpl index 88f037abe..60038701e 100755 --- a/view/tpl/group_edit.tpl +++ b/view/tpl/group_edit.tpl @@ -13,6 +13,7 @@ <input type='hidden' name='form_security_token' value='{{$form_security_token_edit}}'> {{include file="field_input.tpl" field=$gname}} {{include file="field_checkbox.tpl" field=$public}} + {{$pgrp_extras}} <a href="group/drop/{{$gid}}?t={{$form_security_token_drop}}" onclick="return confirmDelete();" class="btn btn-sm btn-danger"> {{$delete}} </a> diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index b286b6071..9a44f1a54 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -198,16 +198,24 @@ var activeCommentText = ''; }) } - function jotShare(id,post_type) { + $('#like-rotator-' + id).show(); + $.get('{{$baseurl}}/share/' + id, function(data) { + $('#like-rotator-' + id).hide(); + updateInit(); + }); + } + + function jotEmbed(id,post_type) { if(post_type == 6) { window.location.href = 'rpost?f=&post_id='+id; } else { + if ($('#jot-popup').length != 0) $('#jot-popup').show(); $('#like-rotator-' + id).show(); - $.get('{{$baseurl}}/share/' + id, function(data) { + $.get('{{$baseurl}}/embed/' + id, function(data) { if (!editor) $("#profile-jot-text").val(""); initEditor(function(){ addeditortext(data); diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 4eae33d13..12509fc59 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -137,8 +137,11 @@ <i id="profile-nocomment" class="fa fa-comments jot-icons"></i> </button> {{/if}} + {{if $custommoretoolsbuttons}} + {{$custommoretoolsbuttons}} + {{/if}} </div> - {{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting}} + {{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting || $custommoretoolsdropdown}} <div class="btn-group d-lg-none"> <button type="button" id="more-tools" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i id="more-tools-icon" class="fa fa-cog jot-icons"></i> @@ -176,6 +179,8 @@ {{if $feature_nocomment}} <a class="dropdown-item" href="#" onclick="toggleNoComment(); return false;"><i id="profile-nocomment-sub" class="fa fa-comments"></i> {{$nocommenttitlesub}}</a> {{/if}} + <hr /> + {{$custommoretoolsdropdown}} </div> </div> {{/if}} @@ -186,6 +191,11 @@ </div> </div> <div id="profile-jot-submit-right" class="btn-group float-right"> + {{foreach $customsubmitright as $csr}} + <button class="btn btn-outline-secondary btn-sm" {{$csr.buttonparams}} title="{{$csr.preview}}"> + {{$csr.buttoncontent}} + </button> + {{/foreach}} {{if $preview}} <button class="btn btn-outline-secondary btn-sm" onclick="preview_post();return false;" title="{{$preview}}"> <i class="fa fa-eye jot-icons" ></i> diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 98047f1d9..bc7f80906 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -24,7 +24,7 @@ }); window.onpopstate = function(e) { - if(e.state !== null) + if(e.state !== null && e.state.b64mid !== bParam_mid) getData(e.state.b64mid, ''); }; }); diff --git a/view/tpl/privacy_groups.tpl b/view/tpl/privacy_groups.tpl index b4e27ef2c..327a15aee 100644 --- a/view/tpl/privacy_groups.tpl +++ b/view/tpl/privacy_groups.tpl @@ -8,6 +8,7 @@ <input type='hidden' name='form_security_token' value='{{$form_security_token}}'> {{include file="field_input.tpl" field=$gname}} {{include file="field_checkbox.tpl" field=$public}} + {{$pgrp_extras}} <button type="submit" name="submit" class="btn btn-sm btn-primary float-right">{{$submit}}</button> </form> </div> diff --git a/view/tpl/remote_friends_common.tpl b/view/tpl/remote_friends_common.tpl index efc0ab49a..6ef3a7dde 100755 --- a/view/tpl/remote_friends_common.tpl +++ b/view/tpl/remote_friends_common.tpl @@ -7,10 +7,9 @@ <div class="contact-block-content"> {{foreach $items as $item}} <div class="contact-block-div"> - <a class="contact-block-link mpfriend" href="{{$base}}/chanview?f=&url={{$item.xchan_url}}"><img class="contact-block-img mpfriend" src="{{$item.xchan_photo_s}}"alt="{{$item.xchan_name}}" title="{{$item.xchan_name}} [{{$item.xchan_addr}}]" /></a> + <a class="contact-block-link mpfriend" href="{{$base}}/chanview?f=&url={{$item.xchan_url}}"><img class="contact-block-img mpfriend" src="{{$item.xchan_photo_s}}" alt="{{$item.xchan_name}}" title="{{$item.xchan_name}} [{{$item.xchan_addr}}]" /></a> </div> {{/foreach}} </div> {{/if}} </div> - |