Skip to content

Commit

Permalink
Merge pull request kashiwasan#34 from nishizoe/t3781
Browse files Browse the repository at this point in the history
(refs #3781) 商品IDを含まない amazon のリンクの修正
  • Loading branch information
nishizoe committed Feb 19, 2015
2 parents 2f6d04f + 1af700b commit c417070
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/js/timeline-loader.api.js
Expand Up @@ -432,8 +432,12 @@ function autoLinker(json)
if (match_id) {
id = RegExp.$1;
}
var url = 'http://amazon.openpne.jp/?id=' + id + '&tag=';
json.data[i].body_html = json.data[i].body.replace(/((http:|https:)\/\/www\.amazon\..*\/([a-zA-Z0-9_\-]+)\/.*)/, '<div><iframe MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no" BORDERCOLOR="#000000" src="' + url + '" name="sample" width="360" height="320">この部分はインラインフレームを使用しています。</iframe></div>');
if ('undefined' != (typeof id)){
var url = 'http://amazon.openpne.jp/?id=' + id + '&tag=';
json.data[i].body_html = json.data[i].body.replace(/((http:|https:)\/\/www\.amazon\..*\/([a-zA-Z0-9_\-]+)\/.*)/, '<div><iframe MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no" BORDERCOLOR="#000000" src="' + url + '" name="sample" width="360" height="320">この部分はインラインフレームを使用しています。</iframe></div>');
}else{
json.data[i].body_html = json.data[i].body.replace(/((http:|https:)\/\/[\x21-\x26\x28-\x7e]+)/gi, '<a href="$1"><div class="urlBlock"><img src="http://mozshot.nemui.org/shot?$1"><br />$1</div></a>');
}
}
else if (json.data[i].body.match(/((http:|https:)\/\/[\x21-\x26\x28-\x7e]+)/))
{
Expand Down

0 comments on commit c417070

Please sign in to comment.