diff --git a/mod/editpost.php b/mod/editpost.php index 258585ef1c..9f4aee31d6 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -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'), diff --git a/mod/message.php b/mod/message.php index 223976ddbe..d0a583967b 100644 --- a/mod/message.php +++ b/mod/message.php @@ -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); } } diff --git a/src/Object/Post.php b/src/Object/Post.php index 038ca270d7..c52078e521 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -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 { diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index 9a15cab52a..80694b64da 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -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(); diff --git a/view/theme/frio/js/textedit.js b/view/theme/frio/js/textedit.js index 2079c20cdc..ad5f950234 100644 --- a/view/theme/frio/js/textedit.js +++ b/view/theme/frio/js/textedit.js @@ -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() diff --git a/view/theme/frio/templates/jot.tpl b/view/theme/frio/templates/jot.tpl index 423be5a5d9..14f383ac8d 100644 --- a/view/theme/frio/templates/jot.tpl +++ b/view/theme/frio/templates/jot.tpl @@ -93,6 +93,10 @@