Skip to content

Commit

Permalink
FIX: fix user mention links
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitjalan committed Jun 8, 2015
1 parent a19a48b commit 8b6fe46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/discourse.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ function discourse_comments_js() {
url = 'https://www.youtube.com/watch?v=' + id;
jQuery(this).replaceWith('<a href="' + url + '">' + url + '</a>');
});
jQuery('a.mention').each(function() {
<?php
$discourse_options = self::get_plugin_options();
$discourse_url = $discourse_options['url'];
?>
var discourse_url = '<?php echo $discourse_url; ?>';
jQuery(this).attr("href", discourse_url + jQuery(this).attr("href"));
});
});
</script>
<?php
Expand Down

3 comments on commit 8b6fe46

@arpitjalan
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@retlehs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change double quotes to single quotes on L114 to be consistent with the rest of the code

does this need to be JS, or can it be done with PHP?

(sorry for the late reply, been on the road/camping for the last week and without service)

@arpitjalan
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changed double quotes to single quotes for consistent styling.

I tried to do it with PHP, but was unable to find a good solution.

Thanks for review!

Please sign in to comment.