// ==UserScript==
// @name ウマ娘攻略まとめ速報用スクリプト
// @description URLの補正とリンク作成、及びリンク先(画像・WEBサイト)のプレビューを表示します
// @author Aga Khan XVIII
// @match *://xn--o9j0bk9l4k169rk1cxv4aci7a739c.com/*
// @icon data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxETEhUSEhIWFhUWFREVFhUWFRUQGBkVGBUXFxgWFRcdHSggGB0lHRcWITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGi0lHyUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAMMA6wMBEQACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAABQEDBAIGB//EAEkQAAIBAgQDBAUIBgcHBQAAAAECAwARBBIhMQVBURMiYYEGMnGRoRRCUlNikrHRFSOiweHwM2Nyc4KT8RZDVIOywtIkJTRklP/EABsBAAIDAQEBAAAAAAAAAAAAAAABAgMEBQYH/8QAOBEAAgIBAwIEAwcDAwQDAAAAAAECAxEEEiETMQUiQVEUYXEyQlKBkbHBFaHhI2LRM1Pw8ZKisv/aAAwDAQACEQMRAD8A+40AFABQAUAFABQAUAFABQAUARSACaeAMWJ4nDGbM4zfQF3b7i3PwpqIFP6Skb1MPIfFssI/aN/hUsCOu1xR2jiX2ys34JS4AA2L+jD9+Qf9lHAEfLMQPWw9x9iVGPuYLTwh4IHGoxpIGi/vEZB9/VfjS2hg3xSqwzAgg7EEMPIiotAW0gCmAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQBBNAC/F8UCt2aKZJPoLbS+xdjog9uvQGpJCM74SR9cRLlB/wB1ESg9jP67+WUeFP6DKMRj4cKtgscIPOQiO565Rd2PtpqORFWG9IlfVM0niq9mvle7GrFUIV8S9I51fs1QBjlsLO5AN7aH1ibbKPE1LYkIxNjMWXAaV0bcgKU0PPIw1F+YvapqCYGhMTxBD/SZh0YI35UukP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+hsP9Sn3RUdqLVqbfxHUXCoFIKxICNiFAPkaNqFK+1/eNwFMpAigDFNwuFjdo0JPMqCfM0tqLY32rhSOP0Nh/qU+4KNqJPU2/iD9DYf6pPuiltD4q5+ppw+GRBZFCjoAB56VJFU5zl3ZooIhQAUAFABQAUAFABQBFqMi5C1MMBSAKB9goAKEHYBQGQNAcAKBYwVzwq6lWAIIsQRcEdCKaeAaz2PH8d9EWyt8nJsw9RiSR/duTt9lj7CK0RvzwyWTvC4PESqsSJ2UaKql3TIbqACRHe7HfUkL/aqTmo9gyPeFcDihOYAs5FjI5zOR0vso+yoArPKbkIaVAWAo5DAUDJoAKAIoEFHIYCgAoAmgYUAFABQAUAFABQAUAFABQAUAFABQAUAFABQAUAFABQBAFAE0AFABQAUAFABQAUAFABQAUAFABQAUAFAH//Z
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
// @run-at document-Start
// @version 0.0.2.20200525.01
// @namespace https://greasyfork.org/users/325429
// ==/UserScript==
$(function () {
// 謝辞 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//このスクリプトはGinoaAI氏作"5ch&BBSViewser"をもとに改変を加えたものです。
//とげとげ氏作"2ch(5ch)サムネイル表示"、os0x氏作"Text URL Linker"の記述も包括的に引用しています。
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 謝辞
// 設定
var urlLinker = 1; //ttpsをhttpsに補正するか 1:する 0:しない
var imgThumbnail = 1; //リンク先が画像の場合サムネイルを表示するか 1:する 0:しない
var pageThumbnail = 1; //リンク先がwebページの場合サムネイルを表示するか 1:する 0:しない
var treeCollapse = 0; //コメントツリー折りたたみ機能を使うか 1:使う 0:使わない
// Text URL Linker os0x様 https://goo.gl/i29D46 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
(function () {
function TextURLLinker(config) {
if (TextURLLinker.isInit || urlLinker == 0) return;
TextURLLinker.isInit = true;
var newtab = config.open_in_newtab;
var noref = config.noreferrer;
var style = escapeTags(config.link_style);
var TEXT = 'descendant::text()[contains(self::text(),"ttp") and not(ancestor::' +
['a', 'textarea', 'script', 'style', 'head'].join(' or ancestor::') + ')]';
linker(document.body);
function linker(doc) {
return $X(TEXT, doc).filter(function (txt) {
return linkfy(txt, 'h?ttp(s?://.*)', '[ \\)\\]\'\"\n]|$', 'http');
});
}
function linkfy(node, start, end, prefix) {
var linked = false;
if (node.nodeValue.search(start) >= 0) {
var text = node.nodeValue, index;
var parent = node.parentNode;
while (text && (index = text.search(start)) >= 0) {
var _txt = node.splitText(index);
var _end = _txt.nodeValue.search(end);
var __txt = _txt.splitText(_end);
var a = document.createElement('a');
a.href = prefix + _txt.nodeValue.match(start)[1];
newtab && a.setAttribute('target', '_blank');
noref && a.setAttribute('rel', 'noreferrer');
style && a.setAttribute('style', style);
if (noref && typeof GM_openInTab !== 'undefined' && !window.getMatchedCSSRules) {
a.addEventListener('click', function (e) {
e.preventDefault();
GM_openInTab(a.href);
}, false);
}
a.appendChild(_txt);
parent.insertBefore(a, __txt);
text = __txt.nodeValue;
node = __txt;
linked = true;
}
}
return linked;
}
function escapeTags(str) {
return str.replace(/["&<>]/g, function ($) {
return '&' + { '"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt' }[$] + ';';
});
}
var wait = true;
document.addEventListener('DOMNodeInserted', function (e) {
if (wait) {
setTimeout(function () {
linker(document.body);
wait = true;
}, 1500);
wait = false;
}
}, true);
}
var TextURLLinkerID = 'aegfbpchoheaflicfmggkmlmcccpjpgd';
if (this.chrome && chrome.extension &&
/aegfbpchoheaflicfmggkmlmcccpjpgd/.test(chrome.extension.getURL('manifest.json'))) {
chrome.extension.sendRequest(TextURLLinkerID, 'init', TextURLLinker);
} else if (this.safari) {
safari.self.tab.dispatchMessage('config', '');
safari.self.addEventListener('message', function (evt) {
TextURLLinker(evt.message);
}, false);
} else {
TextURLLinker({
open_in_newtab: true,
noreferrer: true,
link_style: 'cursor:help;display:inline !important;'
});
}
function addDefaultPrefix(xpath, prefix) {
var tokenPattern = /([A-Za-z_\u00c0-\ufffd][\w\-.\u00b7-\ufffd]*|\*)\s*(::?|\()?|(".*?"|'.*?'|\d+(?:\.\d*)?|\.(?:\.|\d+)?|[\)\]])|(\/\/?|!=|[<>]=?|[\(\[|,=+-])|([@$])/g;
var TERM = 1, OPERATOR = 2, MODIFIER = 3;
var tokenType = OPERATOR;
prefix += ':';
function replacer(token, identifier, suffix, term, operator, modifier) {
if (suffix) {
tokenType =
(suffix == ':' || (suffix == '::' && (identifier == 'attribute' || identifier == 'namespace')))
? MODIFIER : OPERATOR;
} else if (identifier) {
if (tokenType == OPERATOR && identifier != '*')
token = prefix + token;
tokenType = (tokenType == TERM) ? OPERATOR : TERM;
} else {
tokenType = term ? TERM : operator ? OPERATOR : MODIFIER;
}
return token;
}
return xpath.replace(tokenPattern, replacer);
}
function $X(exp, context) {
context || (context = document);
var _document = context.ownerDocument || document,
documentElement = _document.documentElement;
var isXHTML = documentElement.tagName !== 'HTML' && _document.createElement('p').tagName === 'p';
var defaultPrefix = null;
if (isXHTML) {
defaultPrefix = '__default__';
exp = addDefaultPrefix(exp, defaultPrefix);
}
function resolver(prefix) {
return context.lookupNamespaceURI(prefix === defaultPrefix ? null : prefix) ||
documentElement.namespaceURI || '';
}
var result = _document.evaluate(exp, context, resolver, XPathResult.ANY_TYPE, null);
switch (result.resultType) {
case XPathResult.STRING_TYPE: return result.stringValue;
case XPathResult.NUMBER_TYPE: return result.numberValue;
case XPathResult.BOOLEAN_TYPE: return result.booleanValue;
case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
var ret = [], i = null;
while (i = result.iterateNext()) ret.push(i);
return ret;
}
return null;
}
})();
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ Text URL Linker os0x様 https://goo.gl/i29D46
// リンクの補正 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
$(function () {
function traverse(elem) {
var kids = elem.childNodes;
var kid;
for (var a = 0; a < kids.length; a++) {
kid = kids.item(a);
if (kid.nodeType == 3) {
kid.nodeValue = kid.nodeValue
.replace(/ttps:/g, "https:")
.replace(/hhttps:/g, "https:")
.replace(/ttp:/g, "http:")
.replace(/hhttp:/g, "http:")
;
} else {
if (kid.childNodes.length > 0) {
traverse(kid);
}
}
}
}
traverse(document.body);
});
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ リンクの補正
// 2chサムネイル表示 とげとげ様 https://goo.gl/vGtvCy 改変_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
$(function () {
$('.commets-list p>a[class!="comment_view"]').each(function () {
var addres = $(this).text();
var end = addres.substr(addres.length - 3);
if ((end == "jpg" || end == "peg" || end == "png" || end == "gif" || end == "bmp" || end == "rge" || end == "rig") && imgThumbnail == 1) {
//リンク先が画像の場合はコメ欄に合うサイズでプレビュー表示
$(this).after($('<a href=' + addres + ' target="_blank"><img src=' + addres + ' style="max-width:100%;display:block" /></a>'));
} else { //リンク先が画像でない場合はwordpress.comに作ってもらったサムネイルを表示
if (addres.length > 0 && pageThumbnail == 1) {
$(this).after($('<a href=' + addres + ' target="_blank"><img src=https://s.wordpress.com/mshots/v1/' + encodeURIComponent(addres) + '?w=500 style="display:block"></a>'));
}
}
});
});
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ 2chサムネイル表示 とげとげ様 https://goo.gl/vGtvCy 改変
// コメント折りたたみ_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
if(treeCollapse == 1){
$(function () {
//CookieObject取得
var ckObj;
//ひとまず全閉じ
$(".depth-1>.children").css("display","none");
//開閉ボタン設置
$(".depth-1>.children").after('<div class="su-button-center toggle-switch" style="display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;-webkit-align-items:stretch;align-items:stretch;"><span href="#" class="su-button su-button-style-3d su-button-wide" style="width:50%;cursor:pointer;color:#000;background-color:#b3de81;border-color:#265c00;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px" target="_self"><span style="color:#000;padding:7px 20px;font-size:16px;line-height:24px;border-color:#68a225;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;text-shadow:none;-moz-text-shadow:none;-webkit-text-shadow:none"><i class="fa fa-mail-forward" style="font-size:16px;color:#000"></i><span class="btn_text" style="display:inline !important;border:none;">開く</span></span></span></div>');
//開閉ボタン機能実装
$(".depth-1>.toggle-switch").on("click", function() {
$(this).prev().slideToggle("normal","swing",function(){
//.childrenのdisplay:blockなら1を書き込み noneならレコードごと消す(上のfor回数を減らすため)
if($(this).css("display")=="block"){//開いている
Cookies.set($(this).prev().prop("id"),1,{expires: 1});
$(this).next().find(".btn_text").text('閉じる');
}else{//閉じている
Cookies.remove($(this).prev().prop("id"));
$(this).next().find(".btn_text").text('開く');
}
});
});
//Cookieに合わせて開ける
ckObj = Cookies.get();
for (let [key, value] of Object.entries(ckObj)) {
if(value == 1){
$("#"+key).siblings(".children").css("display","block");
$("#"+key).siblings(".children").next().find(".btn_text").text('閉じる');
}
}
//最新コメント欄のリンクを変更してツリーへのリンクにする
$(".recent-comment-title>a").each(function () {
var comurl = $(this).prop("href").split('#');
if(comurl[0] == location.href.split('#')[0]){
var newhash = $("#"+comurl[1]).closest(".depth-1").prop("id");
//alert(comurl[1]+" => "+newhash);
$(this).prop("href",comurl[0]+"#"+newhash);
}
});
//全開閉ボタン設置
//スマホ用
$(".sidebtnlink").prepend('<a style="visibility:hidden"><i class="dashicons dashicons-arrow-up-alt"></i><p>空白</p></a>');
$(".sidebtnlink").prepend('<a style="cursor:pointer"><i class="dashicons dashicons-hidden"></i><p>全て閉じる</p></a>');
$(".sidebtnlink").prepend('<a style="cursor:pointer"><i class="dashicons dashicons-visibility"></i><p>全て開く</p></a>');
//PC用
$("#move-page-top").before($('<div id="tree-con" class="tree-controller" style="display:flex;flex-directionrow;"><a style="cursor:pointer;flex:auto;margin:0.5em;background-color:#000;flex:1;font-size:14px"><i class="dashicons dashicons-hidden"></i><p>全て<br>閉じる</p></a><a style="cursor:pointer;flex:auto;margin:0.5em;background-color:#000;flex:1;font-size:14px"><i class="dashicons dashicons-visibility"></i><p>全て<br>開く</p></a></div>'))
//全開閉ボタン実装
//スマホ用
$(".dashicons-hidden" ).closest("a").on("click", function() {
$(".depth-1>.children").css("display","none");
$(".depth-1>.children").next().find(".btn_text").text('開く');
ckObj = Cookies.get();
for (let [key, value] of Object.entries(ckObj)) {
//alert(key);
if(value == 1){
Cookies.remove(key);
}
}
});
$(".dashicons-visibility" ).closest("a").on("click", function() {
$(".depth-1>.children").css("display","block");
$(".depth-1>.children").next().find(".btn_text").text('閉じる');
});
//PC用
});
}
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ コメント折りたたみ_
});