Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions config/vanilla/bootstrap.before.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,4 +875,34 @@ function writeInlineCommentOptions($comment) {
echo '</div>';

}
}

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);
}
}
3 changes: 2 additions & 1 deletion vanilla/plugins/Quotes/class.quotes.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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.
*
Expand Down
20 changes: 2 additions & 18 deletions vanilla/plugins/Quotes/js/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 + '<br />');

QuoteText = QuoteText + '\n';
Editor.val(Editor.val() + QuoteText);

// DEPRECATED: cleditor support
if ($('div.cleditorMain').length) {
Editor.val(Editor.val() + '<br/>');
Editor.get(0).editor.updateFrame();
}

Editor
.focus()
.trigger('autosize.resize');
$(document).trigger('ApplyQuoteText', [QuoteText]);
};

(function(window) {
Expand Down