diff --git a/config/vanilla/bootstrap.before.php b/config/vanilla/bootstrap.before.php index 86082a3..62dc298 100644 --- a/config/vanilla/bootstrap.before.php +++ b/config/vanilla/bootstrap.before.php @@ -875,4 +875,34 @@ function writeInlineCommentOptions($comment) { echo ''; } +} + +if (!function_exists('discussionUrl')) { + /** + * Return a URL for a discussion. This function is in here and not functions.general so that plugins can override. + * + * @param object|array $discussion + * @param int|string $page + * @param bool $withDomain + * @return string + */ + function discussionUrl($discussion, $page = '', $withDomain = true) { + $discussion = (object)$discussion; + $name = Gdn_Format::url($discussion->Name); + + // Disallow an empty name slug in discussion URLs. + if (empty($name)) { + $name = 'x'; + } + + $result = '/discussion/'.$discussion->DiscussionID.'/'.$name; + + if ($page) { + //if ($page > 1 || Gdn::session()->UserID) { + $result .= '/p'.$page; + // } + } + + return url($result, $withDomain); + } } \ No newline at end of file diff --git a/vanilla/plugins/Quotes/class.quotes.plugin.php b/vanilla/plugins/Quotes/class.quotes.plugin.php index df89e77..60eac2a 100644 --- a/vanilla/plugins/Quotes/class.quotes.plugin.php +++ b/vanilla/plugins/Quotes/class.quotes.plugin.php @@ -85,6 +85,7 @@ public function profileController_afterAddSideMenu_handler($sender) { * * @param profileController $sender */ + /* public function profileController_quotes_create($sender) { $sender->permission('Garden.SignIn.Allow'); $sender->title(t("Quote Settings")); @@ -140,7 +141,7 @@ public function profileController_quotes_create($sender) { $sender->render('quotes', '', 'plugins/Quotes'); } - + */ /** * Set user's quote folding preference in the page for Javascript access. * diff --git a/vanilla/plugins/Quotes/js/quotes.js b/vanilla/plugins/Quotes/js/quotes.js index c9d1753..1d41f44 100644 --- a/vanilla/plugins/Quotes/js/quotes.js +++ b/vanilla/plugins/Quotes/js/quotes.js @@ -105,7 +105,7 @@ Gdn_Quotes.prototype.GetEditor = function () { var editor = $(this.currentEditor); if (!document.body.contains(this.currentEditor) || !editor.length) { // FIX: https://github.com/topcoder-platform/forums/issues/83 - editor = $('.richEditor-textWrap').first(); + editor = $('.bodybox-wrap').first(); } return editor; @@ -165,23 +165,7 @@ Gdn_Quotes.prototype.QuoteResponse = function(Data, Status, XHR) { // Insert the quote text into the editor. Gdn_Quotes.prototype.ApplyQuoteText = function(QuoteText) { - var Editor = this.GetEditor(); - - // First try and throw an event. - Editor.trigger('appendHtml', QuoteText + '
'); - - QuoteText = QuoteText + '\n'; - Editor.val(Editor.val() + QuoteText); - - // DEPRECATED: cleditor support - if ($('div.cleditorMain').length) { - Editor.val(Editor.val() + '
'); - Editor.get(0).editor.updateFrame(); - } - - Editor - .focus() - .trigger('autosize.resize'); + $(document).trigger('ApplyQuoteText', [QuoteText]); }; (function(window) {