Browse Source

Merge pull request #5777 from JonnyTischbein/issue3870

[frio] Formatbar in new Post and Share Button for Preview Post
tags/2019.01
rabuzarus GitHub 1 year ago
parent
commit
fe0856e794
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions
  1. +2
    -0
      view/theme/frio/js/modal.js
  2. +16
    -0
      view/theme/frio/js/textedit.js
  3. +11
    -0
      view/theme/frio/templates/jot.tpl

+ 2
- 0
view/theme/frio/js/modal.js View File

@@ -332,6 +332,8 @@ function toggleJotNav (elm) {
// For some some tab panels we need to execute other js functions.
if (tabpanel === "jot-preview-content") {
preview_post();
// Make Share button visivle in preview
$('#jot-preview-share').removeClass("minimize").attr("aria-hidden" ,"false");
} else if (tabpanel === "jot-fbrowser-wrapper") {
$(function() {
Dialog.showJot();


+ 16
- 0
view/theme/frio/js/textedit.js View File

@@ -27,6 +27,22 @@ function insertFormatting(BBcode, id) {
return true;
}

function insertFormattingToPost(BBcode) {
textarea = document.getElementById("profile-jot-text");
if (document.selection) {
textarea.focus();
selected = document.selection.createRange();
selected.text = "[" + BBcode + "]" + selected.text + "[/" + BBcode + "]";
} else if (textarea.selectionStart || textarea.selectionStart == "0") {
var start = textarea.selectionStart;
var end = textarea.selectionEnd;
textarea.value = textarea.value.substring(0, start) + "[" + BBcode + "]" + textarea.value.substring(start, end) + "[/" + BBcode + "]" + textarea.value.substring(end, textarea.value.length);
}

$(textarea).trigger('change');

return true;
}

function showThread(id) {
$("#collapsed-comments-" + id).show()


+ 11
- 0
view/theme/frio/templates/jot.tpl View File

@@ -93,6 +93,10 @@
</div>

<ul id="profile-jot-submit-wrapper" class="jothidden nav nav-pills">
<li role="presentation"><button type="button" class="hidden-xs btn-link icon underline" style="cursor: pointer;" aria-label="{{$eduline}}" title="{{$eduline}}" onclick="insertFormattingToPost('u');"><i class="fa fa-underline"></i></button></li>
<li role="presentation"><button type="button" class="hidden-xs btn-link icon italic" style="cursor: pointer;" aria-label="{{$editalic}}" title="{{$editalic}}" onclick="insertFormattingToPost('i');"><i class="fa fa-italic"></i></button></li>
<li role="presentation"><button type="button" class="hidden-xs btn-link icon bold" style="cursor: pointer;" aria-label="{{$edbold}}" title="{{$edbold}}" onclick="insertFormattingToPost('b');"><i class="fa fa-bold"></i></button></li>
<li role="presentation"><button type="button" class="hidden-xs btn-link icon quote" style="cursor: pointer;" aria-label="{{$edquote}}" title="{{$edquote}}" onclick="insertFormattingToPost('quote');"><i class="fa fa-quote-left"></i></button></li>
<li role="presentation"><button type="button" class="btn-link" id="profile-link" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink();" title="{{$weblink}}"><i class="fa fa-link"></i></button></li>
<li role="presentation"><button type="button" class="btn-link" id="profile-video" onclick="jotVideoURL();" title="{{$video}}"><i class="fa fa-film" aria-hidden="true"></i></button></li>
<li role="presentation"><button type="button" class="btn-link" id="profile-audio" onclick="jotAudioURL();" title="{{$audio}}"><i class="fa fa-music" aria-hidden="true"></i></button></li>
@@ -118,6 +122,13 @@
</div>

<div id="jot-preview-content" class="minimize" aria-labelledby="jot-preview-lnk" role="tabpanel" aria-hidden="true"></div>

<div id="jot-preview-share" class="minimize" aria-labelledby="jot-preview-lnk" role="tabpanel" aria-hidden="true">
<ul id="profile-jot-preview-submit-wrapper" class="jothidden nav nav-pills">
<li role="presentation" class="pull-right"><button class="btn btn-primary" type="submit" id="profile-jot-peview-submit" name="submit" ><i class="fa fa-slideshare fa-fw" aria-hidden="true"></i> {{$share}}</button></li>
</ul>
</div>

</form>

<div id="jot-fbrowser-wrapper" class="minimize" aria-labelledby="jot-browser-link" role="tabpanel" aria-hidden="true"></div>


Loading…
Cancel
Save