1
0
Fork 0

Merge branch 'develop' of https://github.com/friendica/friendica into develop

This commit is contained in:
Ralf Thees 2018-09-23 14:06:17 +02:00
commit 306688057d
6 changed files with 38 additions and 3 deletions

View file

@ -21,12 +21,18 @@ function editpost_content(App $a)
}
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
$return_url = (($a->argc > 2) ? base64_decode($a->argv[2]) : '');
if (!$post_id) {
notice(L10n::t('Item not found') . EOL);
return;
}
// Fallback to SESSION return_path
if (empty($return_url)) {
$return_url = $_SESSION['return_url'];
}
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'type', 'body', 'title', 'file', 'wall', 'post-type'];
@ -95,7 +101,7 @@ function editpost_content(App $a)
$o .= replace_macros($tpl, [
'$is_edit' => true,
'$return_path' => $_SESSION['return_url'],
'$return_path' => $return_url,
'$action' => 'item',
'$share' => L10n::t('Save'),
'$upload' => L10n::t('Upload photo'),

View file

@ -92,7 +92,7 @@ function message_post(App $a)
$a->argc = 2;
$a->argv[1] = 'new';
} else {
goaway($_SESSION['return_url']);
goaway($a->cmd . '/' . $ret);
}
}

View file

@ -157,7 +157,7 @@ class Post extends BaseObject
if ($item["event-id"] != 0) {
$edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
} else {
$edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
$edpost = ["editpost/" . $item['id'] . "/" . base64_encode($a->cmd), L10n::t("Edit")];
}
$dropping = in_array($item['uid'], [0, local_user()]);
} else {

View file

@ -343,6 +343,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();

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()

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>