ニコニコ漫画
by
asannou
2013-09-03 [2013/09/03 18:45:41]
Flash Player がない環境でニコニコ漫画を見る
@@ -1,6 +1,6 @@
/*
* @title ニコニコ漫画
- * @description ニコニコ漫画を見る
+ * @description Flash Player がない環境でニコニコ漫画を見る
* @include http://seiga.nicovideo.jp/watch/*
* @license MIT License
* @require
/*
* @title ニコニコ漫画
* @description Flash Player がない環境でニコニコ漫画を見る
* @include http://seiga.nicovideo.jp/watch/*
* @license MIT License
* @require
*/
jQuery(function($){
var id = location.href.match(/http:\/\/seiga\.nicovideo\.jp\/watch\/mg([0-9]+)/);
var url = [];
var i = 0;
var img = $("<img></img>");
$.ajax({
url: '/api/theme/data?theme_id=' + id[1],
type: 'get',
dataType: 'xml',
success: function(xml, status) {
if (status != 'success') return;
$(xml).find("source_url").each(function(){
url.push($(this).text());
});
$("#playerBody").empty().append(img);
img.attr("src", url[i]);
img.click(function(e) {
var w = $(this).width();
var x = e.pageX - $(this).offset().left;
if (x < w / 2) {
if (url[i - 1]) i--;
} else {
if (url[i + 1]) i++;
}
img.attr("src", url[i]);
});
}
});
});
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。