mirror of
https://gh.wpcy.net/https://github.com/discourse/wp-discourse.git
synced 2026-05-24 04:53:57 +08:00
git-svn-id: http://plugins.svn.wordpress.org/wp-discourse/trunk@1449569 b8457f37-d9ea-0310-8a92-e5e31aec5664
18 lines
516 B
JavaScript
Vendored
18 lines
516 B
JavaScript
Vendored
/* globals discourse */
|
|
|
|
/**
|
|
* Fixes Discourse oneboxes and mention links for display on WordPress.
|
|
*
|
|
* @package WPDiscourse
|
|
*/
|
|
|
|
jQuery( document ).ready(function() {
|
|
jQuery( '.lazyYT' ).each(function() {
|
|
var id = jQuery( this ).data( 'youtube-id' ),
|
|
url = 'https://www.youtube.com/watch?v=' + id;
|
|
jQuery( this ).replaceWith( '<a href="' + url + '">' + url + '</a>' );
|
|
});
|
|
jQuery( 'a.mention' ).each(function() {
|
|
jQuery( this ).attr( 'href', discourse.url + jQuery( this ).attr( 'href' ) );
|
|
});
|
|
});
|