diff options
author | Mario <mario@mariovavti.com> | 2021-03-08 19:12:37 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-08 19:12:37 +0000 |
commit | d57f4a9527896b472f5bf6dc429a1edeff0d0aef (patch) | |
tree | 08b6c95ceffa6b28b3a564708e192c9ed38cbe9e /view | |
parent | 6506cab55b1b2025bdd9888d1b22cfdda747b9fc (diff) | |
download | volse-hubzilla-d57f4a9527896b472f5bf6dc429a1edeff0d0aef.tar.gz volse-hubzilla-d57f4a9527896b472f5bf6dc429a1edeff0d0aef.tar.bz2 volse-hubzilla-d57f4a9527896b472f5bf6dc429a1edeff0d0aef.zip |
fix unexpected trigger of buttons when pressing enter in input field issue #1528
Diffstat (limited to 'view')
-rw-r--r-- | view/tpl/jot-header.tpl | 12 | ||||
-rw-r--r-- | view/tpl/jot.tpl | 44 |
2 files changed, 28 insertions, 28 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 2539c1fdf..dde623783 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) { @@ -351,7 +351,7 @@ var activeCommentText = ''; return false; }); }); - + } function itemFilerRm(id, term) { @@ -593,7 +593,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del localStorage.removeItem("post_body" + postid); localStorage.removeItem("post_category" + postid); } - } + } } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 1454f038b..53d4f094d 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,26 +224,26 @@ </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}} - <button id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" tabindex="3" name="button-submit">{{$share}}</button> + <button type="button" id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" tabindex="3" name="button-submit">{{$share}}</button> </div> <div class="clear"></div> {{if $jotplugins}} |