diff options
-rw-r--r-- | Zotlabs/Module/Channel.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Profile.php | 26 | ||||
-rw-r--r-- | view/tpl/jot-header.tpl | 20 | ||||
-rw-r--r-- | view/tpl/jot.tpl | 42 |
4 files changed, 49 insertions, 40 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index a513523a7..5b8dbaac4 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -328,6 +328,7 @@ class Channel extends Controller { } else { + $sql_extra2 = ''; if (x($category)) { $sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY)); } diff --git a/Zotlabs/Module/Profile.php b/Zotlabs/Module/Profile.php index 118f11f64..bcc7ad930 100644 --- a/Zotlabs/Module/Profile.php +++ b/Zotlabs/Module/Profile.php @@ -29,26 +29,28 @@ class Profile extends Controller { return; } - $profile = ''; - $channel = App::get_channel(); - - if (!$channel) - http_status_exit(404, 'Not found'); - if (ActivityStreams::is_as_request()) { + $channel = channelx_by_nick($which); + if (!$channel) { + http_status_exit(404, 'Not found'); + } + $p = Activity::encode_person($channel, true); as_return_and_die(['type' => 'Profile', 'describes' => $p], $channel); } - nav_set_selected('Profile'); + $profile = ''; if ((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { + $channel = App::get_channel(); $which = $channel['channel_address']; $profile = argv(1); - $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", + + $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", intval($profile), intval(local_channel()) ); + if (!$r) $profile = ''; $profile = $r[0]['profile_guid']; @@ -80,7 +82,6 @@ class Profile extends Controller { profile_load($which, $profile); - } function get() { @@ -89,11 +90,10 @@ class Profile extends Controller { return login(); } - $groups = []; - + nav_set_selected('Profile'); - $tab = 'profile'; - $o = ''; + $groups = []; + $o = ''; if (!(perm_is_allowed(App::$profile['profile_uid'], get_observer_hash(), 'view_profile'))) { notice(t('Permission denied.') . EOL); diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 2539c1fdf..b24283664 100644 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -51,7 +51,7 @@ var activeCommentID = 0; var activeCommentText = ''; $(document).ready(function() { - + $("#profile-jot-text").focus(enableOnUser); $("#profile-jot-text").click(enableOnUser); @@ -125,8 +125,8 @@ var activeCommentText = ''; }); - function jotSetMime() { - var mtype = $('#id_mimetype').val(); + function jotSetMime() { + var mtype = $('#id_mimetype').val(); if(mtype == 'text/bbcode') $('#profile-jot-submit-left').show(); else @@ -155,7 +155,7 @@ var activeCommentText = ''; textarea = document.getElementById('profile-jot-text'); if (textarea.selectionStart || textarea.selectionStart == "0") { var start = textarea.selectionStart; - var end = textarea.selectionEnd; + var end = textarea.selectionEnd; if (end > start) { reply = prompt("{{$linkurl}}"); if(reply && reply.length) { @@ -313,6 +313,7 @@ var activeCommentText = ''; function itemCancel() { $("#jot-title").val(''); + $("#jot-summary").val(''); $("#profile-jot-text").val(''); $(".jot-poll-option input").val(''); $("#jot-category").tagsinput('removeAll'); @@ -351,7 +352,7 @@ var activeCommentText = ''; return false; }); }); - + } function itemFilerRm(id, term) { @@ -570,6 +571,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del if(action != 'clean') { localStorage.setItem("post_title" + postid, $("#jot-title").val()); + localStorage.setItem("post_summary" + postid, $("#jot-summary").val()); localStorage.setItem("post_body" + postid, $("#profile-jot-text").val()); if($("#jot-category").length) localStorage.setItem("post_category" + postid, $("#jot-category").val()); @@ -590,10 +592,11 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del clearTimeout(postSaveTimer); postSaveTimer = null; localStorage.removeItem("post_title" + postid); + localStorage.removeItem("post_summary" + postid); localStorage.removeItem("post_body" + postid); localStorage.removeItem("post_category" + postid); } - } + } } @@ -605,6 +608,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del var doctype = $('#jot-webpage').val(); var postid = '-' + doctype + '-' + $('#jot-postid').val(); var postTitle = localStorage.getItem("post_title" + postid); + var postSummary = localStorage.getItem("post_summary" + postid); var postBody = localStorage.getItem("post_body" + postid); var postCategory = (($("#jot-category").length) ? localStorage.getItem("post_category" + postid) : ''); var openEditor = false; @@ -613,6 +617,10 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del $('#jot-title').val(postTitle); openEditor = true; } + if(postSummary) { + $('#jot-summary').val(postSummary); + openEditor = true; + } if(postBody) { $('#profile-jot-text').val(postBody); openEditor = true; diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 1454f038b..23b18ffac 100644 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -52,15 +52,15 @@ <div id="jot-text-wrap"> <div id="profile-jot-tools" class="btn-group d-none"> {{if $is_owner}} - <a id="profile-jot-settings" class="btn btn-outline-secondary btn-sm border-0" href="/settings/editor/?f=&rpath=/{{$return_path}}"><i class="fa fa-cog"></i></a> + <a id="profile-jot-settings" class="btn btn-outline-secondary btn-sm border-0" href="/settings/editor/?f=&rpath=/{{$return_path}}" tabindex="4"><i class="fa fa-cog"></i></a> {{/if}} {{if $reset}} - <button id="profile-jot-reset" class="btn btn-outline-secondary btn-sm border-0" title="{{$reset}}" onclick="itemCancel(); return false;"> + <button type="button" id="profile-jot-reset" class="btn btn-outline-secondary btn-sm border-0" title="{{$reset}}" tabindex="-1" onclick="itemCancel(); return false;"> <i class="fa fa-close"></i> </button> {{/if}} </div> - <textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex="2" placeholder="{{$placeholdtext}}" >{{$content}}</textarea> + <textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex="2" placeholder="{{$placeholdtext}}" tabindex="3">{{$content}}</textarea> </div> {{if $attachment}} <div id="jot-attachment-wrap"> @@ -99,19 +99,19 @@ <div id="profile-jot-submit-left" class="btn-toolbar float-left"> {{if $bbcode}} <div class="btn-group mr-2"> - <button id="main-editor-bold" class="btn btn-outline-secondary btn-sm" title="{{$bold}}" onclick="inserteditortag('b', 'profile-jot-text'); return false;"> + <button type="button" id="main-editor-bold" class="btn btn-outline-secondary btn-sm" title="{{$bold}}" onclick="inserteditortag('b', 'profile-jot-text'); return false;"> <i class="fa fa-bold jot-icons"></i> </button> - <button id="main-editor-italic" class="btn btn-outline-secondary btn-sm" title="{{$italic}}" onclick="inserteditortag('i', 'profile-jot-text'); return false;"> + <button type="button" id="main-editor-italic" class="btn btn-outline-secondary btn-sm" title="{{$italic}}" onclick="inserteditortag('i', 'profile-jot-text'); return false;"> <i class="fa fa-italic jot-icons"></i> </button> - <button id="main-editor-underline" class="btn btn-outline-secondary btn-sm" title="{{$underline}}" onclick="inserteditortag('u', 'profile-jot-text'); return false;"> + <button type="button" id="main-editor-underline" class="btn btn-outline-secondary btn-sm" title="{{$underline}}" onclick="inserteditortag('u', 'profile-jot-text'); return false;"> <i class="fa fa-underline jot-icons"></i> </button> - <button id="main-editor-quote" class="btn btn-outline-secondary btn-sm" title="{{$quote}}" onclick="inserteditortag('quote', 'profile-jot-text'); return false;"> + <button type="button" id="main-editor-quote" class="btn btn-outline-secondary btn-sm" title="{{$quote}}" onclick="inserteditortag('quote', 'profile-jot-text'); return false;"> <i class="fa fa-quote-left jot-icons"></i> </button> - <button id="main-editor-code" class="btn btn-outline-secondary btn-sm" title="{{$code}}" onclick="inserteditortag('code', 'profile-jot-text'); return false;"> + <button type="button" id="main-editor-code" class="btn btn-outline-secondary btn-sm" title="{{$code}}" onclick="inserteditortag('code', 'profile-jot-text'); return false;"> <i class="fa fa-terminal jot-icons"></i> </button> </div> @@ -119,29 +119,29 @@ {{if $visitor}} <div class="btn-group mr-2 d-none d-lg-flex"> {{if $writefiles}} - <button id="wall-file-upload" class="btn btn-outline-secondary btn-sm" title="{{$attach}}" > + <button type="button" id="wall-file-upload" class="btn btn-outline-secondary btn-sm" title="{{$attach}}" > <i id="wall-file-upload-icon" class="fa fa-paperclip jot-icons"></i> </button> {{/if}} {{if $weblink}} - <button id="profile-link-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$weblink}}" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"> + <button type="button" id="profile-link-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$weblink}}" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"> <i id="profile-link" class="fa fa-link jot-icons"></i> </button> {{/if}} {{if $embedPhotos}} - <button id="embed-photo-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$embedPhotos}}" onclick="initializeEmbedPhotoDialog();return false;"> + <button type="button" id="embed-photo-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$embedPhotos}}" onclick="initializeEmbedPhotoDialog();return false;"> <i id="embed-photo" class="fa fa-file-image-o jot-icons"></i> </button> {{/if}} </div> <div class="btn-group mr-2 d-none d-lg-flex"> {{if $setloc}} - <button id="profile-location-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$setloc}}" onclick="jotGetLocation();return false;"> + <button type="button" id="profile-location-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$setloc}}" onclick="jotGetLocation();return false;"> <i id="profile-location" class="fa fa-globe jot-icons"></i> </button> {{/if}} {{if $clearloc}} - <button id="profile-nolocation-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$clearloc}}" onclick="jotClearLocation();return false;" disabled="disabled"> + <button type="button" id="profile-nolocation-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$clearloc}}" onclick="jotClearLocation();return false;" disabled="disabled"> <i id="profile-nolocation" class="fa fa-circle-o jot-icons"></i> </button> {{/if}} @@ -149,17 +149,17 @@ <div class="btn-group d-none d-lg-flex"> {{/if}} {{if $feature_expire}} - <button id="profile-expire-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$expires}}" onclick="jotGetExpiry();return false;"> + <button type="button" id="profile-expire-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$expires}}" onclick="jotGetExpiry();return false;"> <i id="profile-expires" class="fa fa-eraser jot-icons"></i> </button> {{/if}} {{if $feature_future}} - <button id="profile-future-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$future_txt}}" onclick="jotGetPubDate();return false;"> + <button type="button" id="profile-future-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$future_txt}}" onclick="jotGetPubDate();return false;"> <i id="profile-future" class="fa fa-clock-o jot-icons"></i> </button> {{/if}} {{if $feature_encrypt}} - <button id="profile-encrypt-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$encrypt}}" onclick="hz_encrypt('{{$cipher}}','#profile-jot-text');return false;"> + <button type="button" id="profile-encrypt-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$encrypt}}" onclick="hz_encrypt('{{$cipher}}','#profile-jot-text');return false;"> <i id="profile-encrypt" class="fa fa-key jot-icons"></i> </button> {{/if}} @@ -167,7 +167,7 @@ <i id="profile-poll" class="fa fa-bar-chart jot-icons"></i> </button> {{if $feature_nocomment}} - <button id="profile-nocomment-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$nocommenttitle}}" onclick="toggleNoComment();return false;"> + <button type="button" id="profile-nocomment-wrapper" class="btn btn-outline-secondary btn-sm" title="{{$nocommenttitle}}" onclick="toggleNoComment();return false;"> <i id="profile-nocomment" class="fa fa-comments jot-icons"></i> </button> {{/if}} @@ -224,22 +224,22 @@ </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}}"> + <button type="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}}"> + <button type="button" class="btn btn-outline-secondary btn-sm" onclick="preview_post();return false;" title="{{$preview}}"> <i class="fa fa-eye jot-icons" ></i> </button> {{/if}} {{if $jotnets}} - <button id="dbtn-jotnets" class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#jotnetsModal" type="button" title="{{$jotnets_label}}" style="{{if $lockstate == 'lock'}}display: none;{{/if}}"> + <button type="button" id="dbtn-jotnets" class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#jotnetsModal" type="button" title="{{$jotnets_label}}" style="{{if $lockstate == 'lock'}}display: none;{{/if}}"> <i class="fa fa-share-alt jot-icons"></i> </button> {{/if}} {{if $showacl}} - <button id="dbtn-acl" class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button" data-form_id="profile-jot-form"> + <button type="button" id="dbtn-acl" class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#aclModal" title="{{$permset}}" type="button" data-form_id="profile-jot-form"> <i id="jot-perms-icon" class="fa fa-{{$lockstate}} jot-icons{{if $bang}} jot-lock-warn{{/if}}"></i> </button> {{/if}} |