mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add custom embed_by_username feature
Feature to allow each imported post to be created using a different discourse username. A possible use case of this is a multi-author blog where discourse is being used to track comments. This feature allows authors to receive updates when someone leaves a comment on one of their articles because each of the imported posts can be created using the discourse username of the author.
This commit is contained in:
@@ -1,10 +1,24 @@
|
||||
/* global discourseUrl */
|
||||
/* global discourseUserName */
|
||||
/* global discourseEmbedUrl */
|
||||
(function() {
|
||||
|
||||
var comments = document.getElementById('discourse-comments'),
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.src = discourseUrl + "embed/comments?embed_url=" + encodeURIComponent(discourseEmbedUrl);
|
||||
iframe = document.createElement('iframe');
|
||||
if (typeof discourseUserName === 'undefined') {
|
||||
iframe.src =
|
||||
[ discourseUrl,
|
||||
'embed/comments?embed_url=',
|
||||
encodeURIComponent(discourseEmbedUrl)
|
||||
].join('');
|
||||
} else {
|
||||
iframe.src =
|
||||
[ discourseUrl,
|
||||
'embed/comments?embed_url=',
|
||||
encodeURIComponent(discourseEmbedUrl),
|
||||
'&discourse_username=',
|
||||
discourseUserName
|
||||
].join('');
|
||||
}
|
||||
iframe.id = 'discourse-embed-frame';
|
||||
iframe.width = "100%";
|
||||
iframe.frameBorder = "0";
|
||||
|
||||
Reference in New Issue
Block a user