Forked from saitamanodoruji/pixiv_staccfeed_illust_larger.user.js
Created
September 29, 2011 13:07
-
-
Save syoichi/1250699 to your computer and use it in GitHub Desktop.
Chrome 19.0.1084.56、Safari 5.1.7(NinjaKit 0.9.1)、Opera 11.64でも動作するようにし、また、適用するCSSを変更した。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @id pixiv staccfeed illust larger | |
// @name pixiv staccfeed illust larger | |
// @namespace http://retlet.net/ | |
// @author retlet | |
// @contributer saitamanodoruji | |
// @version 0.4.1 | |
// @update 2012-06-14T10:07:54.763Z(GMT+09:00) | |
// @description nya-n. | |
// @include http://www.pixiv.net/stacc/* | |
// @run-at document-end | |
// @priority 0 | |
// @compatibility Firefox 13.0(Scriptish 0.1.7), Chrome 19.0.1084.56, Safari 5.1.7(NinjaKit 0.9.1), Opera 11.64 on Windows 7 Home Premium SP1 64bit | |
// @charset UTF-8 | |
// ==/UserScript== | |
/*jslint browser: true, maxlen: 80*/ | |
// Edition 2012-05-09 | |
(function executeIllustLarger(doc) { | |
'use strict'; | |
var timeline, modifyIllusts, staccPage; | |
timeline = doc.getElementById('stacc_center_timeline'); | |
if (!timeline) { | |
return; | |
} | |
doc.head.appendChild(doc.createElement('style')).textContent = [ | |
'.stacc_ref_thumb {', | |
' position: relative !important;', | |
'}', | |
'.stacc_ref_thumb .stacc_layout_row_top > ' + | |
'div:first-child:not([class]) {', | |
' padding-top: 50px !important;', | |
'}', | |
'.stacc_ref_illust_side {', | |
' position: absolute !important;', | |
' left: 0 !important;', | |
'}', | |
'.stacc_ref_illust_img img {', | |
' max-width: 500px !important;', | |
'}' | |
].join('\n'); | |
modifyIllusts = function modifyIllusts(evt) { | |
var node, illusts, illustsLen, illust; | |
node = evt.target; | |
if (!(node.className && node.classList.contains('stacc_page'))) { | |
return; | |
} | |
illusts = node.querySelectorAll( | |
'.stacc_ref_illust_img img[src*="_s."]' | |
); | |
illustsLen = illusts.length; | |
while (illustsLen) { | |
illust = illusts[illustsLen -= 1]; | |
illust.src = illust.src.replace('_s.', '_m.'); | |
} | |
}; | |
staccPage = timeline.querySelector('.stacc_page'); | |
if (staccPage) { | |
modifyIllusts({target: staccPage}); | |
} | |
timeline.addEventListener('DOMNodeInserted', modifyIllusts); | |
}(document)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment