@@ -83,6 +83,6 @@
}
}
$('.skin-entryBody>span,.skin-entryBody>a:not(:has(img))').addClass("in_ele");
-$('.skin-entryBody>a:has(img)').next().filter('.in_ele').addClass("kaigyo_pre");
-$('.in_ele+a:has(img),.in_ele+div:has(table),.in_ele+iframe').prev().addClass("kaigyo_app");
-$('.skin-entryBody>a:has(img)+a:has(img)').children('img').addClass("reb");
+$('.skin-entryBody>a:has(img),.skin-entryBody>iframe').next().filter('.in_ele').addClass("kaigyo_pre");
+$('.in_ele+a:has(img),.in_ele+iframe').prev().addClass("kaigyo_app");
+$('.skin-entryBody>a:has(img)+a:has(img),.skin-entryBody>iframe+a:has(img)').children('img').addClass("reb");
// ==UserScript==
// @title nishino_ameblo_only
// @name nishino_ameblo_only
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://ameblo.jp/nishino-akihiro*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==
var listArray = document.querySelectorAll('.skin-entryBody *[style]');
for (var i = 0; i < listArray.length; i++) {
listArray[i].removeAttribute("style");
}
var listArray2 = document.querySelectorAll('.skin-entryBody font[color],.skin-entryBody font[face]');
for (var j = 0; j < listArray2.length; j++) {
listArray2[j].removeAttribute("color");
listArray2[j].removeAttribute("face");
}
var listArray3 = document.querySelectorAll('.skin-entryBody b,.skin-entryBody i,.skin-entryBody font,.skin-entryBody u');
for (var k = 0; k < listArray3.length; k++) {
listArray3[k].classList.add("fbi");
}
var result5 = document.evaluate('id("entryBody")//text()', document, null, 7, null);
for (var b = 0; b < result5.snapshotLength; b++) {
if (/^\s+$/g.test(result5.snapshotItem(b).nodeValue)) {
if (/ /g.test(result5.snapshotItem(b).nodeValue)) {
result5.snapshotItem(b).nodeValue = " ";
} else {
result5.snapshotItem(b).nodeValue = result5.snapshotItem(b).nodeValue.replace(/^\s+/g, "");
}
}
}
$('.skin-entryBody a:not([href])').contents().unwrap();
$('.skin-entryBody section,.skin-entryBody h1,.skin-entryBody h2,.skin-entryBody h3,.skin-entryBody h4,.skin-entryBody h5,.skin-entryBody h6').wrap("<div></div>");
$('.skin-entryBody section,.skin-entryBody h1,.skin-entryBody h2,.skin-entryBody h3,.skin-entryBody h4,.skin-entryBody h5,.skin-entryBody h6').contents().unwrap();
var result9 = document.evaluate('id("entryBody")//span[not(./text())]', document, null, 7, null);
for (var z = 0; z < result9.snapshotLength; z++) {
result9.snapshotItem(z).classList.add("fbi");
}
$('.fbi>.fbi').parent().contents().unwrap();
$('.fbi:empty').remove();
$('.skin-entryBody>.fbi').wrap("<span class='n_fbi'></span>");
$('.fbi').contents().unwrap();
$('.skin-entryBody span>span').parent().contents().unwrap();
$('.skin-entryBody span>br').parent().contents().unwrap();
$('.skin-entryBody span>a').parent().contents().unwrap();
var result6 = document.evaluate('id("entryBody")//*[self::div or self::p][./text()=" "][not(./*)]|id("entryBody")//*[self::div or self::p][./span[./text()=" "][not(./*)]]', document, null, 7, null);
for (var c = 0; c < result6.snapshotLength; c++) {
result6.snapshotItem(c).classList.add("div_br");
}
var result = document.evaluate('id("entryBody")//*[self::div or self::p]/br[not(./preceding-sibling::*) and string-length(./preceding-sibling::text())<1]', document, null, 7, null);
for (var x = 0; x < result.snapshotLength; x++) {
result.snapshotItem(x).classList.add("br_first");
}
$(".br_first").wrap("<div class='div_br'></div>");
$('.skin-entryBody div>div,.skin-entryBody p>div,.skin-entryBody div>p').parent().contents().unwrap();
$('.skin-entryBody div>span:empty,.skin-entryBody p>span:empty').remove();
$('.skin-entryBody div:empty,.skin-entryBody p:empty').remove();
$(".skin-entryBody").contents().filter(function () {
return this.nodeType === 3;
}).wrap("<span class='n_text'></span>");
$('.skin-entryBody span:empty').remove();
$(".skin-entryBody div+br").wrap("<div class='div_br'></div>");
var result3 = document.evaluate('id("entryBody")/*[not(@class="div_br")][last()]', document, null, 7, null);
result3.snapshotItem(0).classList.add("node_last");
var result4 = document.evaluate('id("entryBody")/*[not(@class="div_br")][1]', document, null, 7, null);
result4.snapshotItem(0).classList.add("node_first");
$('.node_first').prevAll().addClass("cork");
var result8 = document.evaluate('//*[contains(@class,"node_last")][count(./a)=1]', document, null, 7, null);
if (result8.snapshotItem(0)) {
if ($(".node_last").text().length - $(".node_last>a").text().length < 2) {
$('.node_last').addClass("solo_a");
} else {
$('.node_last').addClass("uni_a");
}
} else {
if ($(".node_last").text().length == 1) {
var result7 = document.evaluate('//*[contains(@class,"node_last")]/preceding-sibling::*[not(contains(@class,"div_br"))][1]', document, null, 7, null);
$('.node_last').remove();
result7.snapshotItem(0).classList.add("node_last");
}
}
$('.skin-entryBody>span,.skin-entryBody>a:not(:has(img))').addClass("in_ele");
$('.skin-entryBody>a:has(img),.skin-entryBody>iframe').next().filter('.in_ele').addClass("kaigyo_pre");
$('.in_ele+a:has(img),.in_ele+iframe').prev().addClass("kaigyo_app");
$('.skin-entryBody>a:has(img)+a:has(img),.skin-entryBody>iframe+a:has(img)').children('img').addClass("reb");