Skip to content

Commit

Permalink
埋め込みコード対応の修正
Browse files Browse the repository at this point in the history
- ニコ動の埋め込みはHTTPS非対応のため見送り
- URLのみ投稿した場合にレイアウトが崩れるので、Youtubeのiframeをdivで囲った
  • Loading branch information
kan committed Jul 16, 2015
1 parent f6930d0 commit e0f5651
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions assets/js/jquery.auto-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,8 @@ $(function(){
});
}
else if (u.match(/https?:\/\/www\.youtube\.com\/watch\?v=([0-9a-zA-Z_]+)/)) {
embed += '<iframe id="ytplayer" type="text/html" src="//www.youtube.com/embed/' +
RegExp.$1 + '" frameborder="0" />';
}
else if (u.match(/https?:\/\/www\.nicovideo\.jp\/watch\/([0-9a-z]+)/)) {
embed += '<iframe width="312" height="176" src="http://ext.nicovideo.jp/thumb/' + RegExp.$1 +
'" scrolling="no" style="border:solid 1px #CCC;" frameborder="0">';
embed += '<div><iframe id="ytplayer" type="text/html" src="//www.youtube.com/embed/' +
RegExp.$1 + '" frameborder="0" /></div>';
}

return '[<a href="'+u+'" target="_blank">'+url.attr('host')+'</a>]';
Expand Down

0 comments on commit e0f5651

Please sign in to comment.