Skip to content

Instantly share code, notes, and snippets.

@bluelovers
Last active March 17, 2019 11:06
Show Gist options
  • Save bluelovers/5186199 to your computer and use it in GitHub Desktop.
Save bluelovers/5186199 to your computer and use it in GitHub Desktop.
ImageTweak_SC.user.js
// ==UserScript==
// @name ImageTweak SC
// @namespace bluelovers
// @author bluelovers
//
// @downloadURL https://gist.github.com/bluelovers/5186199/raw/ImageTweak_SC.user.js
// @updateURL https://gist.github.com/bluelovers/5186199/raw/ImageTweak_SC.user.js
//
// @include *://exhentai.org/*
// @include *://g.e-hentai.org/*
// @include http*://www.gamer.com.tw/
// @include http*://www.gamer.com.tw/index*.php*
// @include http*://acg.gamer.com.tw/acgDetail.php?s=*
// @include http*://gnn.gamer.com.tw/*.html
// @include http*://gnn.gamer.com.tw/*k=*
// @include http*://forum.gamer.com.tw/*bsn=*
// @include http*://home.gamer.com.tw/*
// @include http*://acg.gamer.com.tw/*
// @include http*://m.gamer.com.tw/*
// @include *getchu.com/*
// @include http://blog.livedoor.jp/*/*
// @include http://gelbooru.com/*
// @include http://danbooru.donmai.us/*
// @include http://konachan.com/*
// @include http://www.anime-sharing.com/forum/*
// @include http*://*.google.*/blank.html
// @include http*://*.google.*/search*
// @include http*://*.google.*/imgres*
// @include http*://encrypted.google.com/*
// @include http://www.hongfire.com/forum/forumdisplay.php*
// @include http*://www.520cc.cc/*.html
// @include http://www.mobile01.com/topiclist.php?f=*
// @include http://www.mobile01.com/topicdetail.php?f=*
// @include http*://www.mobile01.com/*
// @include http://www.hgamecn.com/*
// @include http://*.blogspot.tw/*
// @include http://*.blogger.com/*
// @include http*://comic.ck101.com/*
// @include http://www.gamebase.com.tw/forum/*
// @include http://*.wretch.cc/*
// @include http*://*.aisex.com/*
// @include http*://new.comicvip.com/show/*
// @include http*://www.8comic.com/comic/*
// @include http*://www.xindm.cn/*
// @include http*://99manga.com/*
// @include http*://*.pixiv.net/*
// @include http*://share.dmhy.org/*
// @include http*://adf.ly/*
// @include http*://hikarinoakariost.info/*
// @include http*://www.4kong.com/*
// @include http*://play.google.com/*
// @include http*://www.sammobile.com/firmwares/*
// @include http*://*.pixnet.net/blog/*
// @include http*://*.kasi-time.com/*
// @include http*://*.coolapk.com/*
// @include http*://*.mobilism.org/*
// @include http*://shopping.pchome.com.tw/*
// @include http*://24h.pchome.com.tw/*
// @include http*://buy.yahoo.com.tw/*
// @include http*://tw.buy.yahoo.com/*
// @include http*://*.search.buy.yahoo.com*/*
// @include http*://search.buy.yahoo.com.tw/*
// @include http*://ecshweb.pchome.com.tw/search/*
// @include http*://tw.mall.yahoo.com/*
// @include http*://tw.*.mall.yahoo.com/*
// @include http*://*.xda-developers.com/*
// @include http*://soundcloud.com/*
// @include http*://www.wandoujia.com/*
// @include http*://www.facebook.com/*
// @include http*://www.life.com.tw/*
// @include http*://blog.xuite.net/*
// @include http*://tieba.baidu.com/*
// @include http*://*99comic.com/*
// @include http*://www.jandown.com/*
// @include http*://*.mimima.com/*
// @include http*://*.pcstore.com.tw/*
// @include http*://*.cartoonmad.com/*
// @include http*://*.cartoonad.com/*
// @include http*://*.dlsite.com/*
// @include http*://*.u17.com/*
// @include http*://*.techbang.com/*
// @include http*://*.blogger.com/*
// @include http*://*.kkkmh.com/*
// @include http*://get.adobe.com/*
// @include http*://*.inside.com.tw/*
// @include http*://*.embedupload.com/*
// @include http*://*.xahka.com/*
// @include http*://*.appledaily.com*/*
// @include http*://unwire.hk/*
// @include http*://*.cococomic.com/*
// @include http*://*.dm5.com/*
// @include http*://*.logsoku.com/*
// @include http*://*.alphapolis.co.jp/*
// @include http*://sukebei.nyaa.se/*
// @include http*://*.playpcesor.com/*
// @include http*://*.w3cplus.com/*
// @include http*://*.77mh.com/*
// @include http*://*.nobuy01.com/*
// @include http*://*.gamebase.com.tw/*
// @include http*://*.ptt.cc/*
// @include http*://*.dmzj.com/*
// @include http*://*.coolaler.com/*
// @include http*://jsbeautifier.org/*
// @include http*://*.youku.com/*
// @include http*://briian.com/*
// @include http*://*.teepr.com/*
// @include http*://*.sfacg.com/*
// @include http*://*.lightnovel.cn/*
// @include http*://*.chuixue.com/*
// @include http*://kickass.so/*
// @include http*://disp.cc/*
// @include http*://*.seemh.com/*
// @include http*://*.fc2.com/*
// @include http*://addons.mozilla.org/*
// @include http*://developers.google.com/*
// @include http*://*.verycd.com/*
// @include http*://greasyfork.org/*
// @include http*://*.ruanyifeng.com/*
// @include http*://dm1080p.com/*
// @include http*://disqus.com/*
// @include http*://dulfy.net/*
// @include http*://adblockplus.org/*
// @include http*://*.mm-cg.com/*
// @include http*://*.twitch.tv/*
// @include http*://*.tv543.org/*.html
// @include http*://*.u2mtv.com/html/movie/*
// @include http://netrunner.kapai.com/card*
// @include http*://bbs.3dmgame.com/*
// @include http*://www.3dmgame.com/*
// @include http*://*.nexusmods.com/*
// @include http*://*.loverslab.com/*
// @include http*://*.gamersky.com/*
// @include http*://weibo.com/*
// @include http*://*.weibo.com/*
// @include http*://*.wnacg.com/*
// @include http*://*.wnacg.org/*
// @include http*://*.manben.com/*
// @include http*://forum*.guildwars2.com/*
// @include http*://*.nicesoftware.co/*
// @include http*://*.deviantart.com/*
// @include http*://*.k73.com/*
// @include http*://*.dayanzai.me/*
// @include http*://*.hk01.com/*
// @include http*://*.ikanman.com/*
// @include http*://*.4399.com/*
//
// @include http*://pan.baidu.com/disk/home*
//
// @include http*://www.reddit.com/*
//
// @exclude *.js*
// @exclude *.css*
// exclude http*://pan.baidu.com/*
// @exclude http*://yun.baidu.com/*
// @exclude http*://www.blogger.com/navbar*
//
// @exclude http*://*.facebook.com/ai.php*
// @exclude http*://*.facebook.com/xti.php*
// @exclude http*://*.*.facebook.com/*
// @exclude http*://*.facebook.com/ajax/*
//
// @version 1
// @grant none
// grant unsafeWindow
// grant GM_registerMenuCommand
// @run-at document-start
//
// @require http://code.jquery.com/jquery-latest.js?KU201
// @require http://code.jquery.com/jquery-migrate-1.2.1.js?KU201
//
// require https://raw.githubusercontent.com/jquery/jquery-color/master/jquery.color.js?KU201
// require https://github.com/brandonaaron/jquery-cssHooks/raw/master/color.js?KU201
// @require https://raw.githubusercontent.com/bluelovers/jquery-color/develop/jquery.color.js?KU201
//
// @require https://gist.github.com/bluelovers/5046969/raw/UserScript%20Framework.js?KU201
//
// @require https://gist.github.com/bluelovers/0791e858a2014f5daa4f/raw/jquery.selector.data.js?KU201
//
// require https://gist.github.com/desandro/797120/raw/jquery.imagesloaded.js?KU201
// require https://raw.githubusercontent.com/desandro/imagesloaded/master/imagesloaded.pkgd.js?KU201
// require https://raw.githubusercontent.com/desandro/imagesloaded/master/imagesloaded.js?KU201
// @require https://gist.github.com/bluelovers/ad699ce5de7571043293/raw/jquery.imagesloaded.js?KU201
//
// require https://raw.githubusercontent.com/f0r4y312/jquery-stylesheet/master/jquery.stylesheet.js?KU201
// @require https://raw.githubusercontent.com/bluelovers/jquery-stylesheet/develop/jquery.stylesheet.js?KU201
//
// require https://github.com/evanw/glfx.js/raw/gh-pages/glfx.js?KU201
//
// @require https://gist.github.com/bluelovers/5c41f61657bdfc84c3f1/raw/jquery.translate.conv.js?KU201
//
// require https://raw.githubusercontent.com/cowboy/jquery-postmessage/master/jquery.ba-postmessage.js?KU201
// @require https://raw.githubusercontent.com/bluelovers/jquery-postmessage/develop/jquery.ba-postmessage.js?KU201
//
// ==/UserScript==
(function($, undefined){
$.migrateTrace = false;
$(function(){
var unsafeWindow = unsafeWindow || window;
var _url = window.location.href;
var _url_obj = _url_obj_ = parse_url(_url);
var _url_host = _url_obj.host;
var _no_clearly_button;
var $_options = {
style: {},
};
// var _browser = _uf_browser();
// _uf_log('init', _browser);
// alert(_url_host);
//$('head:first').append('<link href="https://raw.github.com/lokesh/lightbox2/master/css/lightbox.css" rel="stylesheet" />');
_001_init();
(function(_h, _w){
if (!('innerWidth' in window))
{
return;
}
$.fn.height = function()
{
if (this.length && $.isWindow(this[0]) && this[0].innerHeight)
{
return this[0].innerHeight;
}
else
{
var args = Array.prototype.slice.call(arguments, 0) || [];
return _h.apply(this, args);
}
};
$.fn.width = function()
{
if (this.length && $.isWindow(this[0]) && this[0].innerWidth)
{
return this[0].innerWidth;
}
else
{
var args = Array.prototype.slice.call(arguments, 0) || [];
return _w.apply(this, args);
}
};
})($.fn.height, $.fn.width);
if (0)
{
//
}
else if (_url_host.match(/e-hentai\.org/) || _url_host.match(/exhentai\.org/))
{
$('.itg a, #gdt a, #i5 > .sb > a, .ppi a, #nb > a:first').attr('target', '_blank');
$('.ppo, .ppi').css('width', 'auto');
$('.itg .c').remove();
$('.itg').append('<div class="c"></div>');
$('.itg .itd1').height(_uf_map_maxheight('.itg .itd1'));
if (_url_obj.path.match(/^\/g\//))
{
if ($('#gn').size())
{
$('#gdt')
.css({
width: 'auto',
'min-width': 'auto',
})
;
var _d = $('<div/>').addClass('gt').css({
'font-size': '8pt',
// 'color': '#5C0D11',
'margin': '0px 2px',
});
// _uf_log(_d);
var _a = $('<a target="_blank"/>').text('g.e-hentai.org').attr('href', 'http://g.e-hentai.org' + _url_obj.path).css({
'font-size': '8pt',
// 'color': '#5C0D11',
'text-decoration': 'none',
});
if (_url_host.match(/e-hentai\.org/))
{
_a.text('exhentai.org').attr('href', 'http://exhentai.org' + _url_obj.path);
}
// _a.css('color', $('.gt:first a:first').css('color'));
// _uf_log(_a);
//
$('<div/>')
.css({
'display': 'inline-block',
'vertical-align': 'middle',
'margin': '0px 10px',
})
.append(_d.append(_a))
// .append($('<span/>').text(' | ').css('margin', '10px'))
// .append(_d.clone().append(_a.clone().text('exhentai.org').attr('href', 'http://exhentai.org' + _url_obj.path)))
.appendTo($('#gn'))
;
}
else if ($('#nb + div').size())
{
$('#nb + div').find('a[href*="nw=always"]:first')[0].click();
}
// _uf_log(1);
}
else if (_url_obj.path.match(/^\/s\//))
{
var _h1 = $('#i1 h1');
var _elem = $('#i5 > .sb > a').clone();
_h1.wrap(_elem.empty());
var _func = function(){
$('#i7').children().appendTo($('#i2 div:last').addClass('if').css('margin', '2px auto').wrapInner('<span/>')).removeClass('if');
$('#i2 div:last').find('img').css('margin', 'auto 5px');
$('#i2 *').css('vertical-align', 'middle');
$('#i4 div:first').before($('#i2 div:last').clone()).remove();
// $('#img').on('load', function(){
//// $(this).height($(window).height()).width('auto');
// this.mozRequestFullScreen();
// });
};
var _load_image_dispatch = unsafeWindow.load_image_dispatch;
unsafeWindow.load_image_dispatch = function(){
var _ret = _load_image_dispatch();
_func();
return _ret;
};
_func();
}
var _m;
if ((_m = _url_obj.query.match(/page\=(\d+)/)) && _m[1] > 0 && $('#toppane + div').size())
{
// _uf_log(_m);
$(window).scrollTop($('#toppane + div').offset().top);
}
var _page;
if ($('#toppane, body > .ido .ptt td > a[onclick]').size() > 2)
{
var _dom = $(document);
_dom
.delay(2)
.on('keydown.eh', function(event){
var _idx = -1;
var _a = $('body > .ido .ptt td > a[onclick]');
switch (event.which)
{
case 34:
case 39:
_uf_done(event);
location.href = _a.eq(-1).attr('href');
break;
case 33:
case 37:
_uf_done(event);
location.href = _a.eq(0).attr('href');
break;
default:
// alert(event.which);
break;
}
})
;
}
else if ($.isFunction(unsafeWindow.sp) && (_page = parseInt($('.ptds a:first').text())))
{
var _dom = $(document);
_dom
.delay(2)
.on('keydown.eh', function(event){
var _idx = -1;
switch (event.which)
{
case 34:
case 39:
_idx = _page;
break;
case 33:
case 37:
_idx = _page - 2;
break;
default:
// alert(event.which);
break;
}
if (_idx > -1)
{
_uf_done(event);
_dom.off('keydown.eh');
unsafeWindow.sp(_idx);
}
})
;
}
else if ($('#img').size())
{
var _body = $('body');
var _div_page = $('<div/>')
// .addClass('sni')
.css({
position: 'fixed',
background: _body.css('background-color'),
color: _body.css('color'),
padding: '10px',
border: $('#i1').css('border'),
'border-left-width': 0,
'min-width': 'none',
'min-width': 'auto',
'min-width': 'initial',
'z-index': 100,
})
.offset({
top: $('#img').offset().top,
left: $('#i1').offset().left,
})
.appendTo(_body)
;
var _loaded = false;
$(window)
.add($('#img'))
.on('history.ready imagesLoaded.done', function(event){
var _fn = function()
{
var _img = $('#img');
_div_page
.text($('.sn div').eq(0).text())
.offset({
// left: $('#i1').offset().left,
left: (!_loaded || _img.attr('old') == 1 || _area.width() > _img.width()) ? $('#i1').offset().left : Math.max(0, Math.min($('#i1').offset().left, _img.offset().left - _div_page.outerWidth())),
})
;
$.scrollTo(_area);
};
_fn();
setTimeout(_fn, 100);
})
/*
.on('statechange load ', function(event){
})
*/
;
var _dom = $(document);
UF_addStyle([
'body { overflow-x: hidden; }',
'#img { $filter_contrast_1; }',
]);
var _area = $('#i3');
var _fn = function() {
var _this = _uf_fixsize2(this, window, 1, {
width: 'auto',
});
_this.css({
'max-width': 'none',
'max-height': 'none',
/*
'max-width': _this.width(),
'max-height': _this.height(),
*/
});
_area = _this.parents('div:first');
_area.height(_this.height());
_this
.css({
position: 'relative',
'z-index': 100,
left: _area.width() > _this.width() ? 0 : (_area.width() - _this.width()) / 2,
})
;
_loaded = true;
// _uf_log(_this, _this.width(), _this.height(), $(window).width(), $(window).height());
// $.scrollTo(_this);
};
_dom
.delay(2)
.on('keydown.eh', function(event){
switch (event.which)
{
case 34:
case 39:
_uf_done(event);
//_dom.off('keydown.eh');
$('#next').trigger('click');
//$('#img').delay(2).imagesLoaded(_fn);
break;
case 33:
case 37:
_uf_done(event);
//_dom.off('keydown.eh');
$('#prev').trigger('click');
//$('#img').delay(2).imagesLoaded(_fn);
break;
default:
break;
}
})
//.on('load', '#img', _fn)
;
$('#img')
/*
.css({
'max-width': 'none',
'max-height': $(window).height(),
})
*/
.imagesLoaded(_fn)
;
$(unsafeWindow)
.on('resize load', function(){
$('#img').triggerHandler('imagesLoaded.done');
})
;
(function(_old)
{
unsafeWindow.load_image = function()
{
_loaded = false;
$('#img').attr('old', 1);
var _ret = _old.apply(this, arguments);
var _fn2 = function()
{
if ($('#img').attr('old') == 1)
{
setTimeout(_fn2, 100);
}
else
{
$('#img').imagesLoaded(_fn);
}
};
setTimeout(_fn2, 100);
return _ret;
};
})(unsafeWindow.load_image);
}
}
else if (_url_host.match(/gamer\.com\.tw/))
{
//_uf_log(_url_obj, 11);
// $_options.varmap.body += ', body, .FM-P2, .FM-cbox7, .FM-cbox7 *, div.wikiContent th, div.wikiContent td';
$_options.varmap.body += ', body, .FM-P2, .FM-cbox7, font[size="3"], div.wikiContent th, div.wikiContent td';
$_options.varmap.body_head = $('body')[0];
if (_url_host == 'www.gamer.com.tw' && _url_obj.path == '/index2.php')
{
//
}
$('font[face="標楷體"]').removeAttr('face');
$('.BA-cbox, .BH-rbox, #gnn_head, .GN-lbox8, .HOME-mainbox1, .FM-blist .FM-blist3, #BH-master .ACG-mainbox2, .ACG-mster_box3 .ACG-newstitle')
.on('click', 'a', function(event){
if (_uf_dom_filter_link($(this)).size())
{
_uf_done(event);
_uf_open($(this).attr('href'));
}
})
// .find('a:not([href^="javascript"])')
// .attr('target', '_blank')
;
//_uf_log(_url_obj, 12);
$('img[name="gnnPIC"], .GN-thumbnail img')
.each(function(){
// try
// {
$(this)
.attr('src', function (i, old)
{
if (typeof old == 'undefined')
{
return $(this).attr('data-src');
}
})
.imagesLoaded(function(){
var _this = $(this);
//_uf_log(this, _this, 16, this.src, _this.attr('data-src') || _this.data('data-src'));
var _src = (_this.attr('src') || _this.attr('data-src')).replace('/M/', '/B/').replace('/S/', '/B/');
_uf_fixsize2(_this, true);
_this
// .width(_this.width()).height(_this.height())
.attr('lowsrc', _this.attr('src'))
.attr('src', _src)
.attr('data-src', _src)
;
});
// }
// catch(e)
// {
// _uf_log(e, 15);
// }
})
.on('click', function(){
//_uf_log(this, 14);
var _this = $(this);
if (_this.not('img[name="gnnPIC"]'))
{
_uf_openimage(_src);
}
})
;
//_uf_log(_url_obj);
var _title;
var _c = ' - ';
var _show_all;
if (_url_obj.path.match(/G\d\.php/))
{
_title = $('#mmenunow').text() + _c;
if (_url_obj.path.match(/G1\.php/))
{
$('#BH-master .FM-stb1 a[href*="sn="]').attr('target', '_blank');
}
else
{
_title = $('#BH-master .FM-cbox1 .FM-cbox3 p').text() + _c + _title;
_show_all = 1;
}
}
else if (_url_obj.path.match(/B\.php/))
{
$('.FM-blist tr:not(.FM-blist1) > td[id] a').attr('target', '_blank');
}
else if (_url_host.match(/gnn\.gamer\.com\.tw/))
{
$('.BH-lbox.GN-lbox2 a').attr('target', '_blank');
$('#BH-slave iframe.BH-rbox, #BH-ad_banner > *').remove();
}
else if (_url_obj.path.match(/Co?\.php/))
{
_show_all = 1;
}
else if (_url_obj.path.match(/A\.php/))
{
if (document.referrer && document.referrer.match(/acgDetail\.php/))
{
var _m;
if (_m = _url_obj.query.match(/bsn=(\d+)(?:\b|$|&)/))
{
location.replace('http://forum.gamer.com.tw/listtype.php?bsn=' + _m[1] + '&stype=10');
}
}
$('.FM-abox2A a').attr('target', '_blank');
}
else if (_url_host.match(/m\.gamer\.com\.tw/))
{
_show_all = 1;
}
if (_title)
{
$('title').text(_title + $('title').text());
}
var _attachImgName = $('<a/>');
var _attachImg_data_attr = 'data-srcsource';
if (_show_all && $.isFunction(unsafeWindow.forumShowAllMedia))
{
$('a[name="attachImgName"]')
.attr(_attachImg_data_attr, function(){
//$(this).wrap($('<div/>').attr('data-src', $(this).attr('href')))
_attachImgName.add(this);
return $(this).attr('href');
})
;
try
{
// code to try
unsafeWindow.forumShowAllMedia.call();
$('#BH-slave #fly').nextAll().remove();
$('#BH-master').find('.FM-cbox2 .FM-cbox4 a[href="#"], .BH-search').remove();
$('form[name="fsearch"], #BH-ad_banner, #BH-fbshare').remove();
$('iframe').each(function(){
var _this = $(this);
if (_this.is('[id^="embed"]'))
{
}
else
{
_this.remove();
}
});
}
catch (e)
{
// handle errors here
}
var _class = '_uf_hidden_text';
var _class_found = false;
var _hidden_text = $();
var _hidden_text_parent = $();
var _btn = $('<div class="_uf_hidden_btn">內含反白文</div>');
$(window)
.on('scroll.hidden_text load', (function(event){
// _uf_log(_uf_event_name(event), event);
try
{
var _a = $('.FM-cbox7 .FM-P2:not([data-done]):lt(2)').each(function(){
var _post_body = $(this);
var _class_found_post_body = false;
_post_body.attr('data-done', true);
var _font = $('font[color="#FFFFFF"]', _post_body)
.each(function(){
var _this = $(this);
var _parent;
var _parent_bgcolor;
var _this_bgcolor = _this.css('background-color');
var _bgcolor1 = $.Color(_this_bgcolor);
var _bgcolor2;
if (!_this_bgcolor || _bgcolor1.is('transparent') || _bgcolor1.is('#FFFFFF'))
{
var _count = 0;
_parent = _this;
do
{
_parent = _parent.parent(':first');
_parent_bgcolor = _parent.css('background-color');
_bgcolor2 = $.Color(_parent_bgcolor);
// _uf_log(0, _count, _parent, _parent_bgcolor, _bgcolor2);
}
while (_count++ < 5 && !_parent.is(_post_body) && (!_parent_bgcolor || _bgcolor2.is('transparent')));
if (_bgcolor2.is('transparent') || _bgcolor2.is('#FFFFFF') || _bgcolor1.is('#FFFFFF'))
{
_this
.addClass(_class)
;
_class_found_post_body = _class_found = true;
if (!_parent.is(_post_body))
{
_parent
.addClass('_uf_hidden_parent')
;
}
else
{
_this
.addClass('_uf_hidden_parent')
;
}
}
// _uf_log(1, _this, _this_bgcolor, _parent, _parent_bgcolor, _bgcolor1, _bgcolor2);
}
else
{
//_uf_log(2, _this, _this_bgcolor, _parent, _parent_bgcolor, _bgcolor1, _bgcolor2);
}
})
;
// _uf_log(3, _post_body, _font, _class_found_post_body);
if (_class_found_post_body)
{
_post_body.prepend(_btn);
_hidden_text = $('.' + _class);
_hidden_text_parent = $('._uf_hidden_parent');
}
});
}
catch (e)
{
_uf_log(e);
}
// _uf_log(4, _a, _a.size());
if (!_a.size())
{
$(window).off('scroll.hidden_text');
}
}).debounce(300))
.triggerHandler('scroll.hidden_text')
;
if (1 || _class_found)
{
UF_addStyle([
//'._uf_hidden_text { color: #FFFFFF; }',
'._uf_hidden_text_show { color: ' + $('.FM-cbox7 .FM-P2').css('color') + '; }',
'._uf_hidden_parent_show { padding-bottom: 0.2rem; padding-top: 0.2rem; border-bottom: 1px dotted #21C9C3; }',
'._uf_hidden_btn { text-align: center; background: none repeat scroll 0% 0% rgba(194, 43, 224, 0.32) !important; color: #FF00CF; padding: 1px 10px !important; margin: auto 1em !important; border: thin solid #FF00CF !important; }',
]);
$('.FM-cbox7 .FM-P2')
.on('click.uf_hidden_btn', '._uf_hidden_btn', function(event){
_hidden_text.toggleClass('_uf_hidden_text_show');
_hidden_text_parent.toggleClass('_uf_hidden_parent_show');
})
;
}
}
$('.FM-abox1 > a, .BH-rbox.FM-blist8 a, #BH-master .FM-abox2A a, a[name="guild_flag"], #info_html .FM-abox6B a, .BH-rbox.FM-rbox8 a, .HOME-mainbox1a.BC5 a, .MSG-list8C')
.find('> img')
.add('img.gallery-image, .themeboxA img')
.attr(_attachImg_data_attr, function(){
var _this = $(this);
var _p = _this.parents('a:eq(0)');
var _src = _this.attr('data-src') || _this.attr('src');
if (_p.is('a'))
{
_p.attr(_attachImg_data_attr, _src);
}
// _attachImgName.add($(this).parents('a:eq(0)').attr('data-src', $(this).attr('src')));
//$(this).wrap($('<div/>').attr('data-src', $(this).attr('href')))
return _src;
})
;
_uf_log(777, _attachImgName, _attachImgName.size());
if (1 || _attachImgName.size())
{
// alert(_attachImgName.size());
$(window).on('load', function(){
setTimeout(function(){
$('[' + _attachImg_data_attr + ']')
.each(function(){
var _this = $(this);
// _this.attr('data-1', 1);
var _img = $('img:eq(0)', _this);
var _src = '';
if (_img.filter('[' + _attachImg_data_attr + ']').size())
{
_src = _img.attr(_attachImg_data_attr);
}
else
{
_src = _this.attr(_attachImg_data_attr);
}
if (_src)
{
if (_this.is('a') && _this.attr('href') == '')
{
_this
.attr('href', _src)
.attr('onclick', '')
.attr('target', '_blank')
;
}
else if (_this.is('img') && _this.attr('src') == '')
{
_img = _this;
}
if (_img.size() && !_img.attr('src'))
{
//$('img', _this)
_img
.attr('src', _src)
.attr(_attachImg_data_attr, _src)
;
}
}
// _this.attr('data-2', 2);
})
}, 0);
});
$('img.lazyload').each(function(){
var _img = $(this);
//var _this = $(this.parentNode);
var _src = _img.attr(_attachImg_data_attr) || _img.attr('data-src') || (this.attributes['data-src']).value;
if (_src)
{
_img
.attr('src', _src)
;
}
//_uf_log(777, _img, _this, _img.attr('src'), _src, _img.attr('src'), this.src);
});
}
$('#BH-wrapper, .BH-list1, .FM-cbox1 .FM-P1').find('a[href^="http://ref.gamer.com.tw/redir.php"]')
.attr('target', '_blank')
.each(function(){
var _this = $(this);
_this.attr('href', decodeURIComponent(_this.attr('href').replace('http://ref.gamer.com.tw/redir.php?url=', '')));
})
;
$('iframe[src*="facebook"]').remove();
$('.wikiContent').css('font-size', $_options.style.fontSize);
// _uf_clearly_button(_url_obj, 1).appendTo('#BH-pathbox');
}
else if (_url_host.match(/getchu\.com/))
{
var _gc, _goto = true;
try
{
_gc = $('img[src$="auth_com3.jpg"]')
.parent('div')
.find('table a[href*="gc=gc"]')
;
}
catch (e)
{}
// _uf_log('_gc', _gc);
// _uf_log(_url_obj);
if (_gc && _gc.size())
{
window.location = _gc.attr('href');
}
else
{
_gc = $('#detail_block .content_block > table a.blueb');
if (_gc.size() == 1)
{
window.location = _gc.attr('href') + '&gc=gc';
}
else if (_url_obj.query && _url_obj.query.match(/(?:&(?:amp;?)?)?(gc=gc)/))
{
unsafeWindow.history.replaceState('data', '', _url.replace(/(?:&(?:amp;?)?)?gc=gc/, ''));
}
else if (_url_host.match(/dl\.getchu\.com/))
{
if ($('map[name="map_n"]').size() && (_gc = $('map[name="map_n"] area[href*="index.php?action=aa"]')) && _gc.size())
{
window.location = _gc.attr('href');
}
else
{
_goto = false;
}
}
else
{
_goto = false;
}
}
// _uf_log('_goto', _goto);
if (!_goto)
{
$('a').filter('[href*="id="], [href*="gcd="], [href*="/brandnew/"], [href*="soft_sampleimage.phtml"]').attr('target', '_blank');
(function(_area){
if (!_area.size())
{
return;
}
_area
.on('mousedown', '.reitem_item a', function(event){
if (event.which == 1)
{
_uf_done(event);
_uf_open($(this).attr('href'));
}
})
;
})($('#sbi_mix1_adult'));
$(window).one('load', function(){
var _list = $('.content_block');
$('a').filter('[href*="id="], [href*="gcd="], [href*="/brandnew/"], [href*="soft_sampleimage.phtml"]').attr('target', '_blank');
var _url;
_list.size() && _list
.find('.package img')
.each(function(){
var _this = $(this);
var _a = _this.parent('a');
var _id = _a.attr('href').replace(/^.*id\=(\d+)([\&\#].*)*$/, '$1');
if (_id && _this.not('[src*=package_ss.jpg]'))
{
var _b = _a.clone();
_b
.find('img')
.removeClass('lazy')
.on('error', function(){
var _this = $(this);
// _this.attr('src', 'http://www.getchu.com/common/images/r18.jpg');
_this
.attr('data-original', 'http://www.getchu.com/news/now.jpg')
.attr('src', 'http://www.getchu.com/news/now.jpg');
})
.attr('data-original', 'http://www.getchu.com/brandnew/' + _id + '/c' + _id + 'package_ss.jpg')
.attr('src', 'http://www.getchu.com/brandnew/' + _id + '/c' + _id + 'package_ss.jpg')
;
_url = _a.attr('href');
_a.after(_b)
.remove()
// .hide()
;
}
})
;
if (_list.find('.package img').size() == 1)
{
window.location.href = _url + '&gc=gc';
}
});
// GM_addStyle('._ufmy_img_loading { border: 1px solid red; }');
$(window)
.on('load.highslide', function(event){
$('.highslide img, .tablebody img')
.not('[data-done]')
.filter('.soft_link, .soft, [src*="_s."], [src*="package"]')
.imagesLoaded(function(event) {
var _this = $(this);
_uf_fixsize2(_this, true);
var _src = _this.attr('src')
.replace(/\_s\.(png|jpg|gif|bmp)/, '.$1')
.replace(/(\/brandnew\/\d+\/)r(.+package\.(?:png|jpg|gif|bmp))/, '$1$2')
;
_this
.attr('src', _src)
.attr('data-done', true)
;
})
;
})
.triggerHandler('load.highslide')
;
$('div > .banner').height('auto');
$('#bannera2').nextUntil('div[align="center"]').not('.top_return').remove();
if (_url_obj.path.match(/search/))
{
var _page_now = $('.search_container > div > table[valign="middle"] td[align="center"] > b:first').eq(0);
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
//unsafeWindow.prevpage();
// unsafeWindow.pageChange('prv');
var _a = _page_now.prev('a');
if (_a.size())
{
location.href = _a.attr('href');
}
return false;
break;
case 34:
case 39:
_uf_done(event);
//unsafeWindow.nextpage();
// unsafeWindow.pageChange('next');
var _a = _page_now.next('a');
if (_a.size())
{
location.href = _a.attr('href');
}
return false;
break;
}
});
}
// _uf_log(2);
var _title = document.title;
var _m = _title.match(/^Getchu.com\s*(?:[:\-\:])\s*(.+)\s*$/);
// _uf_log(0);
if (_m)
{
document.title = _m[1] + ' - ' + 'Getchu.com';
}
// _uf_log(1);
// _uf_log(_t);
}
}
else if (_url_host.match(/blog\.livedoor\.jp/))
{
GM_addStyle('._ufmy_img { max-width: 90% }');
$('.article-category, .article-title, .entry-title, .article-continue, .category-parent, .popularArticlesWithImage').find('a').attr('target', '_blank');
$('.article-body-inner')
.find('img[src*="-s."]')
.each(function(){
var _this = $(this);
_this
.attr('src', _this.attr('src').replace(/\-s\.(png|jpg|gif|bmp)/, '.$1'))
.addClass('_ufmy_img')
;
})
;
}
else if (_url_host.match(/(gelbooru|konachan)\.com/) || _url_host.match(/danbooru\.donmai\.us/))
{
$('#post-list .content .thumb, .tag-type-generalm, #posts .post-preview, #post-list-posts .inner').find('a').attr('target', '_blank');
}
else if (_url_host.match(/anime\-sharing\.com/))
{
$(window)
.on('load', (function(){
_uf_dom_filter_link('a.title, .prefix a', '.searchbits .searchtitle, .threads .threadtitle').attr('target', '_blank');
}).debounce(500))
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.threadpagenav .prev_next a[rel="prev"]');
if (_a.size())
{
_uf_done(event);
location.href = _a.attr('href');
}
break;
case 34:
case 39:
var _a = $('.threadpagenav .prev_next a[rel="next"]');
if (_a.size())
{
_uf_done(event);
location.href = _a.attr('href');
}
break;
}
})
.triggerHandler('load')
;
}
else if (_url_host.match(/hongfire\.com/))
{
$('.threadlist .threadtitle').find('a').attr('target', '_blank');
}
else if (_url_host.match(/mobile01\.com/))
{
GM_addStyle('.single-post-content { font-size: 12px; } a.topic_gen:visited { color: rgba(0, 0, 0, 0.5); }');
$('.forumlist a.topic_gen').attr('target', '_blank');
// $(window).one('load', function(event){
// _uf_log(event);
//
// unsafeWindow.LoadAttachImage();
// });
try
{
unsafeWindow.LoadAttachImage();
}
catch (e)
{
}
$('.single-post-content a[name="attachimg"]')
.removeAttr('onclick')
;
var _nav = $('#section .navbar .nav');
if (_nav.size())
{
var _title = '';
var _last = '';
_nav.eq(0).find('a').each(function(){
var _this = $(this);
// _title = _this.text() + ' - ' + _title;
_last = _this.text();
});
var _regex = new RegExp('^(' + _last.replace(/([\(\)\/\\])/g, '\\$1') + ')\\s+\\-\\s(.+)((?:\\s\\-\\s.+)+)');
document.title = document.title.replace(_regex, '$2 - $1$3');
}
}
else if (_url_host.match(/520cc\.cc/))
{
GM_addStyle('ignore_js_op img { max-width: 90%; }');
$('ignore_js_op img[id^="aimg_"]').each(function(){
var _this = $(this);
var _js_op = _this.parents('ignore_js_op:first');
var _src = _uf_my_discuzimage(_this);
var _a = $('<a/>')
.attr({
href: _src,
alt: _this.attr('alt'),
title: _this.attr('title'),
})
;
var _img = $('<img/>')
.attr({
src: _src,
alt: _this.attr('alt'),
title: _this.attr('title'),
})
.appendTo(_a)
;
_js_op.empty().append(_a);
});
}
else if (_url_host.match(/hgamecn\.com/))
{
UF_addStyle([
'#hgc_header { height: auto; } .gtitle a:visited, #hgc_right .indexcon a:visited { color: #333; }',
'#hgc_right #hgc_square { height: auto; width: auto; max-height: 250px; max-width: 300px; }',
'#artcon img { margin: auto 5px auto auto; }',
]);
$_options.varmap.body += ', #artcon p, body';
$_options.style.fontSize = '9pt';
$('#hgc_relink a, #hgc_reart a, #rank_main .package a, #rank_main .title a').attr('target', '_blank');
$('#hgc_header').height('auto');
$('#skyscraper').remove();
if ($('#hgc_nav_search_text').val() == '游戏名称,厂商,原画,声优,剧作')
{
$('#hgc_nav_search_text')
.attr('placeholder', $('#hgc_nav_search_text').val())
.val('')
;
}
$(window).scrollTop($('#hgc_main').offset().top);
var _page_now = $('.hgc_pages .hgc_pages_con > a.on');
if (_page_now.size())
{
_page_now = _page_now.eq(0);
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
location.href = _page_now.prev('a').attr('href');
return false;
break;
case 34:
case 39:
_uf_done(event);
location.href = _page_now.next('a').attr('href');
return false;
break;
}
});
}
$('#hgc_right #hgc_square')
.each(function(){
var _this = $(this);
if (!(_this.height() && _this.width()))
{
_this.hide();
}
})
;
var _area = $('#artcon');
$('a[href^="/img/"]', _area)
.each(function(){
var _this = $(this);
var _img = $('img', _this);
var _m = _this.attr('href').replace(/^\/img\//, 'http://img.hgamecn.com/');
if (_img.attr('src') == _m)
{
_this.attr('href', _m);
}
})
;
$('img[src*="img.hgamecn.com"]', _area)
.imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, _area);
})
;
$('p:has(> img) + p', _area)
.addClass('_uf_clearfix')
;
}
else if (_url_host.match(/comic\.ck101\.com/))
{
GM_addStyle('.img img { width: auto; } .lightOpenBg, .lightCloseBg { background-color: #000; } .Text_Right { width: 70%; } .prev_Left { left: -20%; } .broadband, #comicimg { width: auto; }');
/*
jQuery.fn.extend({
scrollToMe: function () {
var x = jQuery(this).offset().top;
jQuery('html,body').animate({scrollTop: x}, 500);
}
});
*/
$('.adText, .sideAd, .related, .ad_728, .ad650, .lastAd, .ad300').remove();
var _img = $('#defualtPagePic, #comicPic');
if (_img.size())
{
_img
.imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, null, true, {
height: $('.progressBg').height(),
});
$('.broadband, #comicimg, .wrap').width(_this.width());
$.scrollTo(_this);
})
;
$(window)
.on('resize', function(){
/*
var _h = $(window).height();
if ($('.progressBg').size())
{
_h -= $('.progressBg').height();
}
_img.eq(0).height(_h).scrollToMe();
*/
_img.triggerHandler('imagesLoaded.done');
})
.triggerHandler('resize')
;
}
else if ($('.nextPageButton.closeAd').size())
{
setTimeout(function(){
try
{
$('.nextPageButton.closeAd').trigger('click');
}
catch(e)
{
$('.nextPageButton.closeAd')[0].click();
}
var _href = $('.nextPageButton.closeAd').attr('href');
if (_href && (_href != location.href) && (location.href != _url_obj.scheme + '://' + _url_host + _href))
{
location.href = _href;
}
/*
setTimeout(function(){
if (_url_obj.fragment)
{
window.open(location.href, '_self');
}
else
{
window.open(location.href + '?123#comicPic', '_self');
}
}, 1000);
*/
}, 100);
}
$('.relativeRec a, #detailsBox a, .hotList a, .comicBox a, .rankList a').attr('target', '_blank');
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.previousPageButtonJs');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('.nextPageButtonJs');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
});
}
else if (_url_host.match(/\.wretch\.cc/))
{
$('body').removeAttr('ondragstart').removeAttr('oncontextmenu').removeAttr('onselectstart');
}
else if (_url_host.match(/\.aisex\.com/))
{
GM_addStyle('body, table, td, .tpc_content { font-size: 12px; } h3 a { color: blue; } h3 a:visited { color: #333 !important; }');
var _main = $('#main .t table:first');
_main.find('tr td span').remove();
$('#ajaxtable .tr3 td > a').removeAttr('href');
// $('#content .tr3 th a, #ajaxtable .tr3 td > h3 a').attr('target', '_blank');
_uf_dom_filter_link($('#content .tr3 th a, #ajaxtable .tr3 td > h3 a, .tpc_content a')).attr('target', '_blank');
$('font[size="3"]').removeAttr('size');
// $('#ajaxtable .tr3 td > h3 a:visited');
$_options.env._no_clearly_button = true;
}
else if (_url_host.match(/new\.comicvip\.com/) || _url_host.match(/8comic\.com/))
{
// unsafeWindow.document.oncontextmenu = null;
_uf_disable_nocontextmenu(1);
if (_url_host.match(/new\.comicvip\.com/))
{
GM_addStyle('html, body { background: #000; }');
$('body > form > table:last').hide();
//unsafeWindow.$ = $;
$('#TheImg')
.click(function(){
unsafeWindow.jn();
})
/*
.on('load', function(event){
_uf_log(1, event, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
})
.on('error', function(event){
_uf_log(1, event, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
})
.on('ready', function(event){
_uf_log(1, event, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
})
.on('readystatechange', function(event){
_uf_log(5, event, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
})
.ready(function(event){
_uf_log(2, event, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
})
.each(function(event){
_uf_log(3, event, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
})
*/
.imagesLoaded(function() {
var _this = $(this);
/*
if (_this.width() > $(window).width())
{
_this.width($(window).width());
}
else if (1 || _this.height() > $(window).height())
{
_this.height($(window).height());
}
*/
// _uf_log(4, null, this, this.complete, this.readyState, this.naturalWidth, this.naturalHeight);
_uf_fixsize2(_this, window, 1);
$(window).scrollTop(_this.offset().top);
})
;
$(window).on('resize', function(event){
$('#TheImg').triggerHandler('imagesLoaded.done');
});
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _fn = unsafeWindow.jp;
if (p <= 1)
{
_fn = unsafeWindow.pv;
}
_fn();
return false;
break;
case 34:
case 39:
_uf_done(event);
var _fn = unsafeWindow.jn;
if (p >= ps)
{
_fn = unsafeWindow.nv;
}
_fn();
return false;
break;
}
});
}
else
{
$('#itemlist_dl a, tr[onmouseover] a, #itemonline_dl a, #photo2_dl a, #hotcomicpic_dl a, #hotanimelist_dl a, #hotanimepic_dl a').attr('target', '_blank');
$(window).keydown(function(event){
var _pagenow = $('#itemlist_pager table:first tr:first td[bgcolor="#D7F0FF"]').eq(0);
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _a = _pagenow.prev('td:has(a)');
if (_a.size())
{
location.href = _a.find('a:first').attr('href');
}
return false;
break;
case 34:
case 39:
_uf_done(event);
var _a = _pagenow.next('td:has(a)');
if (_a.size())
{
location.href = _a.find('a:first').attr('href');
}
return false;
break;
}
});
}
}
else if (_url_host.match(/xindm\.cn/))
{
$('.fengmian_comic_main_gg, .gg_botom_gg').remove();
(function()
{
// _uf_log(1);
var _this = $('#PicNow, #imgArea #viewimg, .fengmian_comic_head, .top_header_bg + div');
var _area = $('#imgArea');
if (_area.size())
{
$('#loading').css({
margin: '0px auto',
position: 'fixed',
top: '0px',
});
var _top = $('#viewimages');
}
else if (_this.size())
{
var _top = _this;
}
// _uf_log(2, _top, _area, _this, _top.eq(0).offset());
if (_top && _top.size())
{
var _func = function()
{
// _uf_log(4, _top, _area, _this, _top.eq(0).offset());
_top.each(function()
{
var _this = $(this);
// _uf_log(5, _this, _this.offset());
if (_this.offset().top)
{
$(window).scrollTop(_this.offset().top);
return false;
}
});
};
_func();
$(window).on('ready, load', _func);
var _btn = $('#goTopButton, .go_top_f > a[href^="#"], .go_top_f');
if (_btn.size())
{
_btn.on('click', function(event){
_uf_done(event);
_func();
});
};
}
})();
if (_url_obj.path != '/mh/' && _url_obj.path.match(/mh/) && $('.divleft .page-list, .page-list1').size() == 0)
{
GM_addStyle('html, body, #articleContent { background: none #000 !important; } body, a, a:link, .black_02 { color: rgba(0, 165, 242, 1) !important; } #mouseOverleft, #mouseOverright { z-index: 10; } #PicNow, #imgArea #viewimg { position: relative; z-index: 100; cursor: url("/skin/v2/images/bg12.cur"), pointer; }');
UF_addStyle([
'#PicNow, #imgArea #viewimg { $filter_contrast_1; }',
]);
$('body > table:last, .view_bt ~ table, .nav, body > table[height=0], body > table[height=6], body > table[height=3], .chapterAd').remove();
$('a[target]').removeAttr('target');
$('.view_bt').after($('body > table[height=50]:first')).after($('body > table[background="/image/bg/2.gif"]:first'));
(function(_func)
{
unsafeWindow.load_pic = function (obj)
{
};
})(unsafeWindow.load_pic);
// var _fn = function(event) {
// var _this = $(this);
//
// _uf_log(_uf_event_name(event), event, this, _this.width(), _this.height(), this.naturalWidth, this.naturalHeight);
// };
// $('#PicNow, #imgArea img:not(#viewimg)')
// .on('*', _fn)
// ;
// $('#PicNow, #imgArea img')
// .on('ready load', _fn)
//// .on('load', _fn)
// .ready()
// ;
$('#PicNow, #imgArea #viewimg').imagesLoaded(function() {
var _this = $(this);
/*
var _w = _h = 'auto';
if (_this.width() > $(window).width())
{
_w = $(window).width();
_this.height(_h).width(_w);
}
else if (1 || _this.height() > $(window).height())
{
_h = $(window).height();
_this.height(_h).width(_w);
}
*/
_uf_fixsize2(_this, window, 1);
var _w = _this.width();
var _h = _this.height();
var _area = $('#imgArea');
if (_area.size())
{
$('#loading').css({
margin: '0px auto',
position: 'fixed',
top: '0px',
});
_area.height(_h).width(_w);
var _top = $('#viewimages').offset().top;
}
else
{
var _top = _this.offset().top;
}
if (_top > 0)
{
var _func = function()
{
$(window).scrollTop(_top);
};
_func();
var _btn = $('#goTopButton, .go_top_f > a[href="#"]');
if (_area.size() && _btn.size())
{
_btn.off('click').on('click', function(event){
_uf_done(event);
_func();
});
};
}
});
$(unsafeWindow).on('resize', function(){
$('#PicNow, #imgArea #viewimg').triggerHandler('imagesLoaded.done');
}).on('load', function(){
$('#PicNow, #imgArea #viewimg').triggerHandler('imagesLoaded.done');
});
if ($('#articleContent .footer').size())
{
$('#articleContent .footer').css({
background: 'none',
'border-top': 'none',
}).hover(function(){
$(this).find('.footMain').show();
}, function(){
$(this).find('.footMain').hide();
}).find('.footMain').hide().css('background', 'none repeat scroll 0% 0% rgba(0, 0, 0, 0.50);');
}
$(unsafeWindow).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _func = unsafeWindow.Gprev;
if (unsafeWindow.goprev)
{
_func = unsafeWindow.goprev;
}
_func();
return false;
break;
case 34:
case 39:
_uf_done(event);
if ($('#mend:visible tr:has(img[src*="e_or.gif"])').size())
{
//_uf_log($('#PicNow').size(), $('#mend:visible tr:has(img[src*="e_or.gif"]) + tr').find('a:eq(1)'));
var _a = $('#mend:visible tr:has(img[src*="e_or.gif"]) + tr').find('a:eq(1)');
if (_a.size())
{
window.open(_a.attr('href'), '_self');
}
}
else
{
var _func;
if (unsafeWindow.gonext)
{
_func = unsafeWindow.gonext;
}
else
{
_func = function ()
{
$('#PicNow, #imgArea #viewimg').trigger('click');
};
}
_func();
}
return false;
break;
}
});
}
else if ($('.divleft .page-list, .page-list1').find('> b').size())
{
$(window).scrollTop($('#navTop').offset().top);
//unsafeWindow.$ = $;
var _page_now = $('.divleft .page-list, .page-list1').find('> b').eq(0);
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
location.href = _page_now.prev('a').attr('href');
return false;
break;
case 34:
case 39:
_uf_done(event);
location.href = _page_now.next('a').attr('href');
return false;
break;
}
});
}
$('.fengmian_comic_main_h .fengmian_comic_main_h_r a').attr('target', '_blank');
}
else if (_url_host.match(/99manga\.com/))
{
if (_url_obj.path.match(/page/))
{
GM_addStyle('html, body { background-color: #000; } html, body, * { font-size: 9pt !important; }');
_uf_disable_nocontextmenu(1);
$('.a, .c, .d, .f, .h').remove();
$('#ComicPic').imagesLoaded(function() {
var _this = $(this);
if (_this.width() > $(window).width())
{
_this.width($(window).width());
}
else if (1 || _this.height() > $(window).height())
{
_this.height($(window).height());
}
_this.off('mousedown');
$(window).scrollTop(_this.offset().top);
}).click(function(){
unsafeWindow.nextpage();
}).off('mousedown');
$(window).keydown(function(event){
unsafeWindow.page = $('select[name=select2]').val();
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
//unsafeWindow.prevpage();
unsafeWindow.get_sel(--unsafeWindow.page);
return false;
break;
case 34:
case 39:
_uf_done(event);
//unsafeWindow.nextpage();
unsafeWindow.get_sel(++unsafeWindow.page);
return false;
break;
}
});
}
}
else if (_url_host.match(/pixiv\.net/))
{
$('.works_display a.work, .tagCloud a, .user-list a, .image-item a, .worksListOthersImg a, .rank-detail a, .tags .tag a, #favorite-preference form, .spotlight-wrapper .spotlight-article-body .works-column a.work, .spotlight-wrapper .sidebar a, .members a').attr('target', '_blank');
var _pixiv_user_id = unsafeWindow.pixiv.user.id;
//_uf_log(_pixiv_user_id);
if (_pixiv_user_id)
{
$('.header .navigation-list ul:eq(0)')
.each(function(){
var _this = $(this);
$('.bookmarks:eq(0)', _this)
.after(function(){
var _a = $('<a/>')
.attr({
'href': 'http://www.pixiv.net/bookmark.php?type=user',
})
.html('<i class="_icon sprites-bookmarks"></i>關注')
;
return $('<li class="bookmarks"/>').append(_a);
})
;
})
;
}
var _pixiv_source = function (_src)
{
var _ret;
var _regex = /(pixiv\.net)\/(?:c\/.+\/img-master)\/(img\/[\/a-z0-9]+\/.+)_master1200(\..+)/i;
if (_src.match(_regex))
{
_ret = _src.replace(_regex, '$1/img-original/$2$3');
}
else if ((_regex = /(\/img\/.+)\/mobile\/(.+)_(?:\d+)mw(\.(?:jpg|png|gif|bmp))$/) && _src.match(_regex))
{
_ret = _src.replace(_regex, '$1/$2$3');
}
else if ((_regex = /_m(\.(?:jpg|png|gif|bmp))$/) && _src.match(_regex))
{
_ret = _src.replace(_regex, '$1');
}
return _ret;
};
if (_url_obj.path.match(/member_illust\.php/) && _url_obj.query.match(/mode=medium/))
{
//_uf_log($('body').css('background-color'));
if ($('body').css('background-color') == '#E4E7EE' || $('body').css('background-color') == 'rgb(228, 231, 238)')
{
$('body').css('background-color', 'rgba(0, 3, 11, 0.9)');
}
$('.profile-unit .user-relation #favorite-preference form').on('submit', function(){
var _form = $(this);
_uf_open_background('http://www.pixiv.net/member_illust.php?id=' + $(':input[name="user_id"]', _form).val());
})
var _area = $('.works_display:not(:has(.multiple))');
if (_area.size())
{
_area
.find('a img, img.medium, ._layout-thumbnail img')
.not('img.big')
.css('border', '1px solid red')
.imagesLoaded(function() {
var _this = $(this);
// _uf_fixsize2(_this, _this);
// _this.width(_this.width()).height(_this.height());
_uf_fixsize2(_this, true).css('border', '');
var _src;
var _big = _area.find('img.big');
var _old = _this.attr('src');
if (_big.size())
{
_src = _big.attr('src') || _big.attr('data-src');
}
else if (_src = _pixiv_source(_old))
{
}
if (_src)
{
// _this.attr('src', _src);
_this
.one('error', function(){
$(this)
.one('error', function(){
$(this).attr('src', _old);
})
.attr('src', _src.replace(/(\.(?:jpg|png|gif|bmp))$/, '.png'))
;
})
.attr('src', _src)
;
}
$(window).scrollTop($('#wrapper').offset().top);
_uf_log(_this, _big, _src, _this.attr('src'));
})
;
}
$(window)
.keydown(function(event){
var _div = $('#ank-pixiv-large-viewer-panel:visible');
if (!_div.size())
{
return;
}
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _a = _div.find('#ank-pixiv-large-viewer-previous-button');
if (_a.size())
{
_a.click();
return false;
}
break;
case 34:
case 39:
_uf_done(event);
var _a = _div.find('#ank-pixiv-large-viewer-next-button');
if (_a.size())
{
_a.click();
return false;
}
break;
}
})
/*
.on('resize', function(){
$('.works_display img.big').triggerHandler('imagesLoaded.done');
})
*/
;
}
else if (_url_obj.path.match(/member_illust\.php/))
{
$('#wrapper ._image-items .image-item ._thumbnail[data-src]')
.each(function() {
var _this = $(this);
_this.attr('src', function(i, old)
{
if (old != _this.attr('data-src'))
{
return _this.attr('data-src');
}
});
})
}
else if (_url_obj.path.match(/search\.php/))
{
if ($('.column-header .tabs li:eq(0) a.current').size() && $('.column-search-result ._no-item:visible').size())
{
location.href = $('.column-header .tabs a[href*="search_user"]').attr('href');
}
$(window).scrollTop($('#wrapper').offset().top);
$('.popular-introduction:has(.require-premium), .ad-printservice').remove();
$('.column-search-result .image-item[style]').height('inherit');
$(document).on('click mousedown', function (event)
{
var _this = $(event.target);
//_uf_log(event, this);
if (_this.is('._profile-popup .follow-button'))
{
//_uf_log(777, event, _this);
var _a = _this.parents('.user-info:first').find('a.user-name:first');
var _href = 'http://www.pixiv.net/' + _a.attr('href').replace('member.php', 'member_illust.php');
//_uf_log(event, _this, _a, _href);
setTimeout(function(){
_uf_open_background(_href);
}, 200);
}
});
//_uf_log(999);
}
else if (_url_obj.path.match(/search_user\.php/))
{
if ($('.user-search-result-container .user-recommendation-item').size() == 1)
{
location.href = $('.user-search-result-container .user-recommendation-item a.title').attr('href').replace('member.php', 'member_illust.php');
}
}
else if (_url_obj.path.match(/stacc/))
{
var _hover_item = $('.hover-item:first');
var _color = _hover_item.css('background-color');
if (_color == '#FFA500' || _color == 'rgb(255, 165, 0)')
{
_hover_item.css('background-color', '#01001E');
}
if (_url_obj.query.match(/mode=unify/))
{
var _fn_timeline = function(event){
$('#stacc_timeline > .stacc_status_summary:not([data-done])')
.each(function(index){
var _this = $(this);
var _stacc_ref_illust_user_name = $('.stacc_ref_illust_user_name > a:first', _this);
var _stacc_post_user_name = $('.stacc_post_user_name', _this);
var _badge_poster = $('.stacc_follow_unify_comment_profile_list img[src*="badge_add_content.png"]:first', _this);
if (!_badge_poster.size() && _stacc_ref_illust_user_name.text() != _stacc_post_user_name.text())
{
_this
// .css('border', '1px solid rgba(15, 0, 255, 0.5)')
// .css('background-color', 'rgba(27, 169, 180, 0.2)')
.css('box-shadow', '0px 0px 0px 2px rgba(0, 149, 222, 0.3) inset')
;
/*
$('.stacc_ref_thumb_right', _this).width(function(index, value){
return value - 2;
});
*/
// _uf_log(index, _this, _stacc_ref_illust_user_name.text(), _stacc_post_user_name.text(), _badge_poster);
}
$('.stacc_ref_user_illust_caption_img a', _this).attr('href', function(i, v){
v = v.replace('member.php', 'member_illust.php');
return v;
});
_this
.attr('data-done', true)
;
})
;
};
$(window)
.on('scroll.timeline', _fn_timeline.debounce(1000))
.triggerHandler('scroll.timeline')
;
}
}
else if (_url_obj.path.match(/spotlight/))
{
$_options.varmap.body += ', .spotlight-article-body';
var _area = $('.spotlight-wrapper .spotlight-article-body');
_area
.find('.works-column a.work img.ugoku-illust-dummy-thumbnail')
.css('border', '1px solid red')
.imagesLoaded(function() {
var _this = $(this);
_uf_fixsize2(_this, true).css('border', '');
var _src;
var _old = _this.attr('src');
if (_src = _pixiv_source(_old))
{
}
if (_src)
{
_this
.one('error', function(){
$(this)
.one('error', function(){
$(this).attr('src', _old);
})
.attr('src', _src.replace(/(\.(?:jpg|png|gif|bmp))$/, '.png'))
;
})
.attr('src', _src)
;
}
_uf_log(_this, _old, _src, _this.attr('src'));
})
;
$(window).scrollTop(_area.offset().top);
}
else if (_url_obj.path.match(/bookmark_add\.php/))
{
$(window)
.on('load', (function(){
if (!$('.user-recommendation-items .user-recommendation-item').size() && $('#wrapper .user-recommendation-unit ._no-item:visible').size())
{
window.close();
}
}).debounce(3000))
;
}
else if (_url_obj.path.match(/bookmark\.php/))
{
$(window).scrollTo('#search-result');
}
else if (_url_obj.path.match(/jump\.php/))
{
window.location.href = $('b > a:first').attr('href');
}
$(window).keydown(function(event){
var _a = $();
var _page_now = $('.pager-container .page-list .current').eq(0);
switch(event.which)
{
case 33:
case 37:
_a = _page_now.prev('li').find('a')
if (!_a.size())
{
_a = $('.pages a.button[rel="prev"]')
}
if (_a.size())
{
_uf_done(event);
location.href = _a.attr('href');
return false;
}
break;
case 34:
case 39:
_a = _page_now.next('li').find('a');
if (!_a.size())
{
_a = $('.pages a.button[rel="next"]')
}
if (_a.size())
{
_uf_done(event);
location.href = _a.attr('href');
return false;
}
break;
}
});
// _uf_log(1, $('#wrapper .user-recommendation-items li'));
var _dummy = function()
{
// _uf_log($('#wrapper .user-recommendation-items'));
if ($('#wrapper .user-recommendation-items').size())
{
// $('#wrapper .user-recommendation-items').on('click.follow', 'li.user-recommendation-item .follow-button', function(){
// var _this = $(this);
//
// _uf_log(_this);
//
// var _li = _this.parent('li.user-recommendation-item');
//
// _uf_log(_this, _li);
//
// if (_li.size())
// {
// _li.eq(0).find('h1 a').eq(0).trigger('click');
// }
// });
$('#wrapper .user-recommendation-items li.user-recommendation-item:not([data-uf])').each(function(){
var _this = $(this);
_this.attr('data-uf', true);
// _uf_log(_this);
_this.find('.follow-button').on('click.follow', function(event){
// _uf_log(event, this, _this, _this.attr('data-id'));
setTimeout(function(){
_uf_open_background('http://www.pixiv.net/member_illust.php?id=' + _this.attr('data-id'));
}, 200);
});
_this.find('div.follow')
.attr('data-id', _this.attr('data-id'))
.find('.sprites-checked')
.attr('data-uf', true)
;
$('a.title', _this).attr('href', function(i, v){
v = v.replace('member.php', 'member_illust.php');
return v;
})
});
$('body').on('click', '.follow-setting-modal .action-follow :submit', (function (event)
{
//_uf_log(event);
$('#wrapper .user-recommendation-items li.user-recommendation-item div.follow ._icon:not([data-uf])')
.each(function(){
var _this = $(this);
if (_this.is('.sprites-checked'))
{
_this.attr('data-uf', true);
_uf_open_background('http://www.pixiv.net/member_illust.php?id=' + _this.parent('div.follow').attr('data-id'));
}
})
;
}).debounce(500));
}
};
if (_url_obj.path.match(/member/))
{
$('.profile-unit .user-relation a#favorite-button').attr('href', 'javascript:void(0);');
}
var _scrollheight;
_dummy();
$(window)
.on('scroll load', function(){
var _body = $('body')[0];
if (!_scrollheight || _scrollheight != _body.scrollheight)
{
_scrollheight = _body.scrollheight;
setTimeout(_dummy, 1000);
}
})
.on('load', function(){
_dummy();
})
;
$(document).on('mouseover._profile-popup', function (event)
{
var _this = $(event.target);
if (_this.is('._profile-popup'))
{
$('a.user-name, .user-profile > a', _this).attr('href', function(i, v){
v = v.replace('member.php', 'member_illust.php');
return v;
})
}
});
setTimeout(_dummy, 3000);
$('a[href*="jump.php"]', '.profile-web, .caption, .body')
.each(function(){
var _this = $(this);
var _url = _this.attr('href');
if (_url.match(/jump\.php\?(.+)$/))
{
_url = decodeURIComponent(RegExp.$1);
_this.attr('href', _url);
}
})
.attr('target', '_blank')
;
}
else if (_url_host.match(/share\.dmhy\.org/))
{
//_uf_log(_url_obj);
UF_addStyle([
'#topic_list .title > a:visited { color: rgba(51, 51, 51, 0.7); }',
'.bgm-anime { background-color: rgba(120, 120, 120, 0.5); }',
]);
var _fn_weekly_list = function(_content)
{
_uf_dom_filter_link('.weekly_list_part a, .bgm-content a, .weekly_list_b a', _content)
.attr('target', '_blank')
.on('click', function(event){
var _this = $(this);
_uf_done(event);
_uf_open(_this.attr('href'));
})
;
$('div.weekly_list_b[onclick]', _content)
.each(function(){
var _this = $(this);
var _value = _this.attr('onclick').replace(/^location\.href=\'(.+)\';*$/, '$1');
if (_value)
{
_this.attr('onclick', 'window.open(\'' + _value + '\', \'_blank\');');
}
// _uf_log(_value);
})
;
var _unsafeJquery;
if (unsafeWindow.$ && unsafeWindow.$.fn && unsafeWindow.$.fn.jquery)
{
_unsafeJquery = unsafeWindow.$;
}
// _uf_log($.fn.jquery);
var _list = $('div.bgm-anime', _content);
var _list_fn_click = function(event){
var _this = $(this);
var _kw = _this.data('kw') || _this.attr('data-kw');
_uf_log(event, _this, event.target, event.currentTarget, _kw, _this.jquery);
if (_kw)
{
if ($(event.target).is('a') && !$(event.currentTarget).is('a'))
{
_uf_done(event, 1);
_uf_log(9.1);
}
else
{
_uf_done(event);
_uf_open('http://share.dmhy.org/topics/list?keyword=' + _kw);
_uf_log(9.2);
}
}
};
if (_list.size())
{
if (_unsafeJquery)
{
(function($, who){
$.each(['off', 'unbind', 'die'], function(i, value){
if ($.fn[value] && $.isFunction($.fn[value]))
{
$.fn[value].call(who, 'click');
$.fn[value].call(who, 'mousedown');
$.fn[value].call(who, 'mouseup');
}
});
})(_unsafeJquery, _unsafeJquery('div.bgm-anime, .bgm-content, #bgm-wrapper'));
}
$.each(['off', 'unbind', 'die'], function(i, value){
if ($.fn[value] && $.isFunction($.fn[value]))
{
$.fn[value].call(_list, 'click');
$.fn[value].call(_list, 'mousedown');
$.fn[value].call(_list, 'mouseup');
}
});
_list
.off('click')
.on('click', _list_fn_click)
.each(function(){
var _sub = $(this);
if (!$('.bgm-anime-sub-wrap', _sub).size())
{
var _div = $('<div class="bgm-anime-sub-wrap"/>');
$('.bgm-anime-sub', _sub).wrap(_div);
_div = $('.bgm-anime-sub-wrap', _sub);
_div
.data('kw', _sub.data('kw') || _sub.attr('data-kw'))
.height(_sub.height() - $('.bgm-anime-title', _sub).outerHeight())
.on('click', _list_fn_click)
;
}
})
;
$('.bgm-rowhead', _content)
.each(function(){
var _rowhead = $(this);
var _color = $.Color(_rowhead.css('background-color')).alpha(0.35);
_rowhead
.siblings('.bgm-rowfollow')
.find('div.bgm-anime')
.each(function(){
var _this = $(this);
_this.css('background-color', _color);
})
;
})
;
}
};
if ($('.weekly_list, #bgm-wrapper').size())
{
if ($('#bgm-wrapper').size())
{
$('#bgm-wrapper')
.on('DOMNodeInserted' || $_options.event.dom, (function(event){
var _content = $(this);
_fn_weekly_list(_content);
}).debounce(500))
;
(function(){
$('#bgm-controls a.active, #bgm-controls a[data-index]')
.on('click mouseup mousedown', (function(event){
$.scrollTo('#bgm-wrapper');
}).debounce(1500))
;
}).debounce(500);
}
else
{
_fn_weekly_list($('.weekly_list, #bgm-wrapper'));
}
$_options.env._no_clearly_button = true;
}
if (!$('#user_cm').text())
{
$('a.download-arrow').attr('target', '_blank');
}
if ($('.topics_bk .topic-main .topic-nfo').size())
{
// UF_addStyle('.topics_bk .topic-main .topic-nfo { color: rgb(68, 68, 68); font-family: Tahoma,"Microsoft Yahei",Simsun; font-size: 14px; line-height: 21px; }');
$('.topic-title .info.relative-goods').html($('<div/>').html($('#resource-tabs #tabs-1 > p:eq(0)').nextUntil('hr').andSelf().each(function(i){
$('strong', this).css({
'min-width': '7.5em',
display: 'inline-block',
});
if (i == 0)
{
$('a:eq(0)', this)
.addClass('a_torrent')
.attr('download', $('a:eq(0)', this).text() + '.torrent')
;
}
}).clone()).css({
padding: '1em 1.4em',
margin: 'auto',
'font-family': 'Verdana,Arial,sans-serif',
}));
var _style_css = '';
$(window).on('load', function(){
$('[style], font[size]', '.topics_bk .topic-main .topic-nfo').each(function(index){
var _this = $(this);
var _m;
var _style = _this.attr('style');
if (_this.is('font[size]'))
{
var _size = _this.attr('size');
var _found;
var _parents = _this.parents('.topic-nfo font[size]')
.each(function(){
var _parent = $(this);
var _parent_size = _parent.attr('size');
if (_parent_size == _size)
{
_parent.removeAttr('size');
}
else
{
return _found = false;
}
})
;
if (_found !== false && 3 == _size)
{
_this.removeAttr('size');
}
_uf_log(index, 'font[size]', _size, _found, _parents);
}
if (_m = _style.match(/(\s*color\s*:[^;]+;\s*font-family\s*:\s*[^;]+\s*;\s*font-size\s*:\s*14px\s*;\s*line-height\s*:\s*\d+px\s*;\s*)/i))
{
if (!_style_css)
{
_style_css = _m[1];
}
// _style.replace('color: rgb(68, 68, 68); font-family: Tahoma,"Microsoft Yahei",Simsun; font-size: 14px; line-height: 21px;', '');
_style = _style.replace(/(\s*(color\s*:[^;]+;\s*)?font-family\s*:\s*[^;]+\s*;\s*font-size\s*:\s*14px\s*;\s*line-height\s*:\s*\d+px\s*;\s*)/i, '$2');
_style = _style.replace(/(color\s*:\s*rgb\(\s*68\s*,\s*68\s*,\s*68\s*\)\s*)/i, '');
_this.attr('style', _style);
}
else if (_m = _style.match(/\bfont-size\s*:\s*14px\s*;?/))
{
_this.css('font-size', function(i, _size){
var _found;
var _font = _this = $(this);
var _parents = _this.parents('.topic-nfo [style*="font-size"]')
.each(function(){
var _parent = $(this);
var _parent_size = _parent.css('font-size');
if (_parent_size == _size || _parent_size == '')
{
_font.css('font-size', '');
_font = _parent;
_found = true;
}
else
{
return _found = false;
}
})
;
if (_found !== false)
{
if (_size == '14px')
{
_font.css('font-size', '');
return '';
}
}
});
}
// _uf_log(index, _this, _m, _style);
});
});
$_options.style.fontSize = '9pt';
UF_addStyle([
'.lang-ja, :lang(ja) { font-family: initial; font-family: $fontFamily_ja2; }',
'.topics_bk .topic-main .topic-nfo { color: rgb(68, 68, 68); font-family: Tahoma,"Microsoft Yahei",Simsun; line-height: 21px; ' + _style_css + '; font-size: $fontSize; }',
'.topic-title div.resource-info { margin-top: 0px; }',
'a.a_torrent { color: blue; }',
'a#a_magnet { color: #18891D; }',
]);
$('img[src="rss.gif"]').after('<span>RSS</span>').remove();
}
else if ($('#topic_list').size())
{
$_options.env._no_clearly_button = true;
var _colors = $_options.color.tag;
var _tag_cache = {
array: [],
list: {},
colors: {},
style: [],
};
var _list_kw = {
array: [],
/*
today: [],
name: [],
*/
day: {
today: {},
},
nottoday :[],
colors: {
length: 0,
},
color_data: {},
};
if ($('#keyword').val())
{
//
}
else if ($('#mini_jmd').size())
{
var _today = $('#mini_jmd .today');
try
{
// _uf_log(1);
_today
.push(_today.prev('tr'))
.each(function(index){
var _day = $(this);
var _is_today = _day.is('.today');
var _list_kw_day = _list_kw.day[_is_today ? 'today' : 'x' + index] = {};
if (!_is_today)
{
_list_kw.nottoday.push('x' + index);
_day.addClass('nottoday dayx' + index);
}
$('a[href*="list?keyword="]', _day)
.each(function(){
var _a = $(this);
var _kw = $.trim(decodeURIComponent((_a.attr('href').match(/list\?keyword=(.+)(?:&|$)/))[1]));
var _kw_regex = '(' + _kw.replace('/', '//').replace(/\+/gmi, ').*(') + ')';
if (_kw)
{
_a
.attr('data-kw', _kw)
;
var _kw_regex2 = $.jConv.cht2chs(_kw_regex);
if (_kw_regex2 != _kw_regex)
{
// _uf_log(_kw_regex, _kw_regex2);
_kw_regex = '(?:' + _kw_regex + ')|(?:' + _kw_regex2 + ')';
}
//_kw_regex = '(?:' + _kw_regex + ')' + '(?!' + _kw_regex.replace('(', '(?:') + ')';
_kw_regex = new RegExp(_kw_regex, 'i');
var _idx = _list_kw.array.length;
/*
_list_kw.today.push(_kw_regex);
_list_kw.array.push(_kw);
_list_kw.name.push(_a.text());
*/
_list_kw.array.push(_kw);
_list_kw_day[_idx] = {
index: _idx,
regex: _kw_regex,
name: _a.text(),
};
}
})
;
// _uf_log(_list_kw_day);
})
;
// _uf_log(_list_kw);
}
catch(e)
{
_uf_log(e);
}
}
// _uf_log(2);
try
{
$('#topic_list .title')
.each(function(){
var _td_title = $(this);
var _tag = $('.tag', _td_title);
var _team_id;
if (_tag.size() && (_team_id = $('a:first', _tag).attr('href').match(/team_id\/(\d+)(?:\b|$)/)))
{
_team_id = _team_id[1];
}
var _tr = _td_title.parents('tr:first');
if (_team_id)
{
_tr
.add(_tag)
.attr('data-team-id', _team_id)
;
if (_tag_cache.list[_team_id] === undefined)
{
var _color = $.Color(_colors[_tag_cache.array.length % _colors.length]);
while (_tag_cache.colors[_color] !== undefined)
{
// _uf_log(_color);
_color = $.Color(_color).rand();
};
// _uf_log(_color);
_tag_cache.colors[_color] = _team_id;
_tag_cache.list[_team_id] = {
index: _tag_cache.array.length,
id: _team_id,
color: _color,
contrastColor: _color.contrastColor(),
borderColor: _color.lightness(function(value){
return value * 0.6;
}),
};
_tag_cache.array.push(_team_id);
}
}
var _a = $('> a', _td_title);
if (_a.size() && (_list_kw.array))
{
var _text = _a.text();
var _found;
$.each(_list_kw.day, function(index, day){
var _class = index == 'today' ? 'keyword ' + index : 'keyword_day day' + index;
// _uf_log(index, day);
var _kw;
$.each(day, function(i, data){
var _ret;
var v = data.regex;
if (_ret = v.test(_text))
{
_kw = _list_kw.array[i];
var _html = _text.replace(v, function(s){
return '<span class="' + _class + '" data-kw="' + _kw + '">' + s + '</span>';
});
_a.html(_html);
_tr
.add(_a)
.add(_td_title)
.attr('data-kw', _kw)
;
return _found = false;
}
//_uf_log(i, v, _text, _ret);
});
if (_found === false)
{
if (_list_kw.color_data[_kw] === undefined)
{
var _color = $.Color(_colors[_list_kw.colors.length % _colors.length]);
while (_list_kw.colors[_color] !== undefined || _color.is('#EAEA00'))
{
_color = _color.is('#EAEA00') ? $.Color.rand() : $.Color(_color).rand();
};
_list_kw.colors[_color] = _kw;
_list_kw.color_data[_kw] = {
index: _list_kw.colors.length++,
kw: _kw,
color: _color,
contrastColor: _color.contrastColor(),
borderColor: _color.lightness(function(value){
return value * 0.6;
}),
};
}
return _found;
}
});
}
})
;
}
catch(e)
{
_uf_log(e);
}
// _uf_log(_tag_cache);
UF_addStyle([
'table.tablesorter tbody tr { opacity: 1; }',
'table.tablesorter tbody tr:hover, ._uf_hover { opacity: 0.75; }',
'table.jmd a[data-kw]:hover { opacity: 1; }',
'table.jmd a[data-kw] { opacity: 0.5; }',
'table.jmd a { line-height: 1.5em; display: inline-block; padding: 0px 3px; text-wrap: none; white-space: nowrap; }',
'.keyword_day { background: rgba(153, 0, 102, 0.3); }',
'.keyword.today { background: rgba(255, 255, 0, 0.5); }',
], $('body')[0]);
$.each(_tag_cache.list, function(_team_id, data){
var _css = 'table#topic_list tr td span.tag[data-team-id="' + _team_id + '"], #AdvSearchTeam[name="team_id"] option[value="' + _team_id + '"] { color: ' + data.contrastColor + '; background: ' + data.color + '; border-color: ' + data.borderColor + '; } .tag[data-team-id="' + _team_id + '"] a { color: ' + data.contrastColor + '; }';
_tag_cache.style.push(_css);
});
$.each(_list_kw.color_data, function(_kw, data){
var _css = 'table.jmd a[data-kw="' + _kw + '"] { color: ' + data.contrastColor + '; background: ' + data.color + '; border-color: ' + data.borderColor + '; } table.jmd a[data-kw="' + _kw + '"]:hover { color: ' + data.contrastColor + '; }';
_css += 'table.jmd a[data-kw="' + _kw + '"] { opacity: 0.75; }';
_tag_cache.style.push(_css);
});
UF_addStyle(_tag_cache.style, $('body')[0]);
}
$('html').attr('lang', 'ja').attr('lang', 'zh');
}
else if (_url_host.match(/adf\.ly/))
{
if ($('#overly #continue div a').size())
{
location.href = $('#overly #continue div a').eq(0).attr('href');
}
if ($('#Interstitual #top > span:last a:has(#skip_ad_button), #skip_button:has(#skip_ad_button)').size())
{
_uf_wait_while(function(){
return $('#Interstitual #top > span:last a[href]:has(#skip_ad_button), #skip_button:visible').size();
}, function(){
location.href = $('#Interstitual #top > span:last a[href]:has(#skip_ad_button), #skip_button:visible').eq(0).attr('href');
}, 900);
}
}
else if (_url_host.match(/hikarinoakariost\.info/))
{
$('.post-content .cover a').attr('target', '_blank');
}
else if (_url_host.match(/4kong\.com/))
{
$('.IndexPost .IndexPost-Title-Bg a').attr('target', '_blank');
if ($('.IndexPost.pagebar').size())
{
var _page_now = $('.IndexPost.pagebar > strong').eq(0);
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
location.href = _page_now.prev('a').attr('href');
return false;
break;
case 34:
case 39:
_uf_done(event);
location.href = _page_now.next('a').attr('href');
return false;
break;
}
});
}
try
{
(function(_fn)
{
unsafeWindow.zbj_ad_pop.open = function(){};
})(unsafeWindow.zbj_ad_pop.open);
var setCookie = function (key, value) {
var expires = new Date();
expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000));
document.cookie = key + '=' + value +';path=/'+ ';expires=' + expires.toUTCString();
}
setCookie(unsafeWindow.zbj_ad_pop_cookie_name);
unsafeWindow.upcookie(unsafeWindow.zbj_ad_pop_cookie_name,unsafeWindow.zbj_ad_pop_cookie_time);
}
catch (e)
{
_uf_log(e);
}
}
else if (_url_host.match(/play\.google\.com/))
{
//_uf_log(_url_obj);
var _running = false;
var _dummy = function()
{
//_uf_log('dummy');
if (_running)
{
_uf_log('running', _running);
return false;
}
_running = true;
var _lists = $('.card-list .card-content, .expand-page .card').filter(':not([title])');
if (_lists.size())
{
_lists
.each(function(){
var _this = $(this);
var _title = _this.find('a.title:first').attr('title');
var _subtitle = _this.find('a.subtitle:first').attr('title');
_this.attr('title', _title + "\n\n" + _subtitle);
})
;
if (_lists.size() > 1)
{
_lists
.find('a.card-click-target, .details a.title, .stars-container a, a.subtitle')
.attr('target', '_blank');
}
}
var _appbody = $('#body-content:has(.details-wrapper[data-docid])').not(':has(.details-wrapper[data-uf])');
if (_appbody.size())
{
_appbody.each(function(){
var _this = $(this);
//_uf_log(999, _this.find('.details-wrapper').attr('data-uf'), _this);
_this.find('.details-wrapper').attr('data-uf', 1);
var _id, _button;
var _actions = _this.find('.details-wrapper .details-info .details-actions').eq(0);
var _version = _this.find('.meta-info .content[itemprop="softwareVersion"]').eq(0).text();
_this.find('.details-info .document-title:first').eq(0).append($('<span/>').text('(' + _version + ')').addClass('document-subtitle').css({
'padding-left': '0.5em',
'margin-left': '0.5em',
'font-size': '13px',
})).find('*').css('display', 'inline-block');
_actions.each(function(){
var _this = $(this);
var _button_buy = _this.find('.play-button.buy-button-container:first');
_id = _button_buy.attr('data-docid');
_button = _button_buy.clone().removeClass('buy-button-container').addClass('play-button-uf');
_button.find('button').removeAttr('class').html($('<span class="button-text"/>'));
GM_addStyle('.apps.play-button { margin-right: 5px;} .apps.play-button-uf { margin-right: 5px; background-color: rgb(139, 51, 200); background-color: rgba(139, 51, 200, 0.75); -o-transition: color .20s linear; -webkit-transition: color .20s linear; -moz-transition: color .20s linear; transition: color .20s linear; } .apps.play-button-uf:hover { background-color: rgba(200, 51, 167, 0.92); }');
});
_this.find('.info-container, a.document-subtitle').attr('target', '_blank');
var _button_new = function(_text, _link){
var _elem = _button.clone().appendTo(_actions);
_elem.find('button span.button-text').text(_text);
if (_link)
{
_elem.click(function(event){
_uf_open(_link);
});
}
return _elem;
};
_button_new('APK Downloader', 'http://apps.evozi.com/apk-downloader/?id=' + _id);
_button_new('Coolapk', 'http://www.coolapk.com/search?q=' + _id);
});
// _uf_log('keydown.screenshots');
$(window).off('keydown.screenshots').on('keydown.screenshots', function(event)
{
var _stop;
var _area;
try
{
_area = $('.details-section.screenshots:first').find('.details-section-body:first');
if (!_area.find('.expand-close:visible').size())
{
_stop = true;
}
}
catch (e)
{
_stop = true;
}
// _uf_log('keydown.screenshots', _stop, _area);
if (_stop)
{
return;
}
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _a = _area.find('.expand-prev:first');
if (_a.size() && _a.is(':visible'))
{
_a.trigger('click');
}
return false;
break;
case 34:
case 39:
_uf_done(event);
var _a = _area.find('.expand-next:first');
if (_a.size() && _a.is(':visible'))
{
_a.trigger('click');
}
return false;
break;
}
});
}
$('body').on('click.play', 'a, #show-more-button', function(event){
//_uf_log(3, event);
setTimeout(_dummy, 1500);
});
$('#body-content').one('DOMNodeRemoved', function(event){
//_uf_log('#body-content', event);
setTimeout(_dummy, 1000);
});
$('#gbqfw form').one('submit', function(event){
//_uf_log('#body-content', event);
setTimeout(_dummy, 1500);
});
_running = false;
return true;
};
/*
(function(_old){
window.onpopstate = function(event){
_old(event);
_uf_log(1, event);
setTimeout(_dummy, 2500);
};
})(window.onpopstate);
*/
$(unsafeWindow).on('popstate, replaceState, hashchange, pushState, readystatechange, statechange, statuschange, ready, load, DOMContentLoaded', function(event){
//_uf_log(2, event);
setTimeout(_dummy, 2500);
});
var _h = $('#body-content').height();
$(unsafeWindow).on('scroll, resize', function(event){
//_uf_log(2, event);
var _t = $('#body-content').height();
if (_h != _t)
{
_h = _t;
setTimeout(_dummy, 1500);
}
});
_dummy();
}
else if (_url_host.match(/sammobile\.com/))
{
$('.firmware-header, .firmware-captcha').eq(0).find('.section-header:has(#input_search)').eq(0).css('background', '#18923F');
}
else if (_url_host.match(/pixnet\.net/))
{
$_options.varmap.body += ', .article-content, body';
$('span', '.article-content .article-content-inner')
.each(function(){
var _this = $(this);
var _size = _this.css('font-size');
var _size_p = _this.parent().css('font-size');
_uf_log(_this, _size, _size_p);
if (_size == '13px' || _size == '12pt' || _size == '16px')
{
_this.css('font-size', '');
}
})
;
$.scrollTo('.article-head');
_uf_disable_nocontextmenu(1);
}
else if (_url_host.match(/kasi-time\.com/))
{
_uf_disable_nocontextmenu(1, '#center, .mainkashi');
}
else if (_url_host.match(/coolapk\.com/))
{
GM_addStyle('#feedList .ex-card-feed .ex-card-content { overflow: auto; max-height: 300px; margin-right: 15px; } .ex-card, .ex-card-content, .ex-card-quick-comment .ex-card-comment-list li, body, textarea, .form-control { font-size: 12px; } .container .col-md-5 .well { color: #FFF; background-color: #5CB85C; border-color: #4CAE4C; background-color: rgba(92, 184, 92, 0.9); }');
_uf_dom_filter_link($('.ex-card-app-list a, .col-md-5 .ex-card-content a, #feedList .media-body a, .col-md-4 .ex-card-feed .ex-card-extend .ex-card-imageView a')).attr('target', '_blank');
//developer:Chainfire
var _div = $('.media-body .pull-right');
if (_div.size())
{
_div
.find('.btn-group a')
.each(function(){
var _this = $(this);
var _href = _this.attr('href');
if (_href.match(/play\.google\.com.+details\?id=/))
{
_href = (_href + '&hl=zh_TW').replace('&hl=zh&', '&');
_this.attr('href', _href);
_div.find('.btn-group:first').before(_this.clone().addClass('btn btn-default').css('margin-right', '5px'));
}
})
.add('.pull-right a')
.each(function(){
var _this = $(this);
var _href = _this.attr('href');
if (_href.match(/play\.google\.com.+details\?id=/))
{
_href = (_href + '&hl=zh_TW').replace('&hl=zh&', '&');
_this.attr('href', _href);
}
})
;
var _main = $('.container .col-md-5 .well:first ~ div.panel').filter(':has(.ex-card-content)');
$('.container .col-md-5 .well:first').after(_main);
var _keywords = $('meta[name="keywords"]').attr('content');
var _m = _keywords.split(',');
var _id = _m.slice(-2)[0];
// _uf_log(_m, _m.slice(-2, 1));
$('.container .ex-page-topbar .media-body small').eq(0).append($('<span/>').text('( ' + _id + ' )').css({
'font-size': '12px',
'margin-left': '5px',
}));
$('.ex-screenshot-thumb-carousel img').imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, true);
_this.attr('src', function(i, val){
$(this).attr('lowsrc', val);
return val.replace(/\.t\.jpg$/, '');
});
});
// _uf_log(unsafeWindow.apkDownloadUrl);
if (unsafeWindow.apkDownloadUrl)
{
var _apk = $('.media-body .ex-apk-view-btns .dropdown-menu a[onclick*="onDownloadApk"]');
var _a = $('<a/>').attr('target', '_blank');
var _data = {};
var extra = 0;
_data[extra] = {
href: unsafeWindow.apkDownloadUrl + '&extra=' + extra,
text: 'Download',
};
if (_apk.size())
{
_apk.each(function(){
var _this = $(this);
var extra = _this.attr('onclick').replace(/.*onDownloadApk\s*\(\s*(.+)\s*\).*$/, '$1');
// _uf_log(_this, extra);
if (extra !== '')
{
_data[extra] = {
href: unsafeWindow.apkDownloadUrl + '&extra=' + extra,
text: _this.text(),
};
}
});
}
GM_addStyle('._uf_apk_download { } ._uf_apk_download a { margin: 10px; }');
// _uf_log(_data, _div, _main, _apk);
var _div = $('<div class="_uf_apk_download ex-card-wrapper"/>');
var _i;
for (_i in _data)
{
_a.clone().attr('href', _data[_i].href + '&' + _i + '.apk').text(_data[_i].text).appendTo(_div);
}
_div.appendTo(_main);
}
}
var _div = $('#feedList .ex-card-feed:lt(5)');
if (_div.size())
{
_div.find('.ex-card-content a[onclick*="exRequest"]').each(function(){
$(this).triggerHandler('click');
});
}
}
else if (_url_host.match(/mobilism\.org/))
{
$('#pagecontent .tablebg a').attr('target', '_blank');
//_uf_log($('.gensmall > form[name="search"] + b').size());
if ($('.gensmall > form[name="search"] + b').size())
{
var _page_now = $('.gensmall > form[name="search"] + b').eq(0).find('> a');
//_uf_log(_page_now);
var _findtext = function(_arr, _text)
{
var _ret;
$(_arr).each(function(){
var _this = $(this);
if (_this.text() == _text)
{
_ret = _this;
return false;
}
});
//_uf_log(_ret);
return _ret;
};
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _a = _findtext(_page_now, 'Previous');
if (_a.size())
{
location.href = _a.attr('href');
}
return false;
break;
case 34:
case 39:
_uf_done(event);
var _a = _findtext(_page_now, 'Next');
if (_a.size())
{
location.href = _a.attr('href');
}
return false;
break;
}
});
}
}
else if (_url_host.match(/(shopping|24h)\.pchome\.com\.tw/))
{
_url_obj.query = _url_obj.query || '';
//alert(_url_obj.query);
// http://shopping.pchome.com.tw/?mod=item&func=exhibit&IT_NO=DRAA3I-A66929774&SR_NO=DRAA3I&ROWNO=3
if (_url_obj.query.match(/mod=item&(?:amp;)?func=exhibit/) || $('#order[action="/?mod=item&func=order"]').size())
{
var _div = $('<div/>');
_div.append($('#loading').html());
var _order = $('#order');
var _order_id = _order.find('> table:eq(0)');
var _order_head = _order.find('> table:eq(1)');
var _price_table = $('#p_it_price').parents('table:eq(0)');
// _price_table.after(_div.css('text-align', 'left'));
// var _td = _price_table.parents('td:first').attr({rowspan:1, colspan:3, align:'center'});
//
// _td.prevAll().remove();
_price_table.width('auto').parent('td').attr('align', 'left').css('padding-left', 10);
_price_table.parents('table:first').find('table[onmouseout="hideLoadingLay()"]')
.after(_div.css('text-align', 'left')).remove();
_div.find('table:first').attr('align', 'center');
_div.find('table:first').css('min-width', '190').find('table:first').width('100%');
var _p_it_price = $('#p_it_price').text();
_div
.find('table table tr')
.each(function(){
var _this = $(this);
var _i1 = _this.find('td:eq(0) font > font:first').text();
var _i2 = _this.find('td:eq(1)').text().replace(/^\$/, '');
var _i3 = _i1 * _i2;
var _td1 = _this.find('td:eq(1)').clone();
var _more = (_i3 > _p_it_price) ? true : false;
_td1.find('font').text(_more ? '$' + _i3 : '').css('color', 'blue');
var _td2 = _this.find('td:eq(1)').clone();
if (_more)
{
_td2.find('font').text('$' + (_i3 - _p_it_price)).css('color', '#fff');
_td2.css({'background-color':'#E21679'});
}
else
{
_td2.empty();
}
_this.append(_td1);
_this.append(_td2);
})
;
var _title = $('title').text();
/**
* %E3%80%8A = 《
* %E3%80%8B = 》
**/
_title = decodeURIComponent(encodeURIComponent(_title).replace(/^(.+)(%E3%80%8A.+%E3%80%8B)$/, '$2$1'));
$('title').text(_title);
}
// http://shopping.pchome.com.tw/?mod=store&func=style_show&SR_NO=DRAA3I&show=1
else if (_url_obj.query.match(/mod=store&(?:amp;)?func=style_show/) || _url_obj.path.match(/\/store\/./) || $('img[src$="24h_bar.gif"], input[name="showbutton"]').size())
{
// var _list = $('input[name="showbutton"]').parents('table:eq(1)').parent('td').find('> table:eq(6), > table:eq(8)');
var _title = $('title').text();
_title = _title.replace(/^([^\-]+)\-\s+(.+)$/, '$2 - $1');
$('title').text(_title);
var _list = $();
if ($('input[name="showbutton"]').size())
{
var _list = $('input[name="showbutton"]').parents('table:eq(1)').nextAll('table').filter(':not(:has(.pgNumber))');
}
else
{
var _list = $('img[src$="24h_bar.gif"]').parents('table:eq(0)').nextAll('table').filter(':not(:has(.pgNumber))');
}
_uf_log(99, _list);
_list = _list.add('#StoreTopContainer, #StoreProdContainer');
// _list.css('border', '1px solid red');
//_list.find('a').attr('target', '_blank');
_uf_dom_filter_link(_list.find('a'))
.on('click', function(event){
var _ret = _uf_my_openfix(this);
if (_ret)
{
_uf_done(event);
}
})
.attr('target', '_blank')
;
var _items = _list
.find('td[width=148]:has(> table[width=148], > table[width=140]), td[width=145]:has(> table[width=140]), table[width=780] tr:has(> td.small8)')
;
var _itemlist = [];
_items
.each(function(indexInArray, valueOfElement){
var _tmp = $(this);
var _this;
var _desc;
if (_tmp.is('tr'))
{
_this = _tmp.children();
_this.filter('td.small8').find('font[color="#888888"] div:first')
// .css('border', '1px solid red')
.css('height', 'auto')
.css('overflow', '')
.wrapInner('<font size="2" />')
;
}
else
{
_this = _tmp.find('> table');
_desc = _this.find('font.text12[color="#666666"] div:first').text();
_this
.attr('title', _desc)
.find('.text13Link img')
.attr('title', _desc)
;
}
var _price = parseInt(_this
.find('.textprice03, .textprice02_search')
.first()
.text()
);
var _title = _this
.find('.text13Link > font, font[color="#0000FF"] div a font b.text16')
.first()
.text()
;
_data = {
idx: indexInArray,
obj: _this,
val: _price,
title: _title
};
_itemlist[indexInArray] = _data;
_this
.data(_data)
;
})
;
// _uf_log(_itemlist);
var _func = function(mode){
var _arr = $(_itemlist);
if (mode == 1)
{
_arr
.sort(function(a, b){
return a.val > b.val ? 1 : -1;
})
;
}
else if (mode == 2)
{
_arr
.sort(function(a, b){
return a.val < b.val ? 1 : -1;
})
;
}
else
{
mode = 0;
_arr
.sort(function(a, b){
return a.idx > b.idx ? 1 : -1;
})
;
}
_arr
.each(function(i, v){
this.obj.appendTo(_items.eq(i));
})
;
_div.find('a').css('color', '#0000ff').eq(mode).css('color', '#000000');
};
var _div = $('<div class="sort-type text12">排序:</div>')
.append($('<a/>').click(function(){
_func(0);
}).text('優先推薦'))
.append($('<a/>').click(function(){
_func(1);
}).text('價格低至高'))
.append($('<a/>').click(function(){
_func(2);
}).text('價格高至低'))
.css({
'background-color': '#EAEAEA',
'border-top': '1px solid #EEEEEE',
'font-size': '13px',
'height': '30px',
'line-height': '30px',
'margin-bottom': '10px',
'margin-top': '10px',
'padding': '0 1em',
})
;
_div
.find('a')
.css({
'color': '#000000',
'text-decoration': 'none'
})
.attr('href', 'javascript:void(0);')
.filter(':not(:first)')
.css({
'color': '#0000ff',
})
.before($('<span> | </span>'))
;
_items.eq(0).parents('table:first').before(_div);
}
else
{
_uf_log(_url_obj);
}
$(window)
.on('load', (function(event){
_uf_log(event);
var _area = $('#StagesContainer:not([data-done])')
.each(function(){
var _area = $(this);
_area.attr('data-done', true);
var _price = $('#PriceTotal').text();
var _t1 = $('> table:eq(0)', _area);
var _t2 = $('dl.overlay_pay', _area);
_t2
.find('dd table tr')
.each(function(){
var _tr = $(this);
var _td1 = $('> td:eq(0):not(:has(b))', _tr);
var _td2 = $('> td:eq(1)', _tr);
var _td3 = $('<td/>').appendTo(_tr);
if (_td1.size())
{
var _m = _td1.text().match(/(\d+)期/);
if (_m[1])
{
_td3.html('<b>$' + (_td2.text().replace('$', '') * _m[1] - _price) + '</b>')
}
}
})
})
;
}).debounce(1500))
.triggerHandler('load')
;
$('.text13List a[href*="mod=store&func=style_show"], .text13List a[href*="m=index&f=view"]').attr('target', '_blank');
}
else if (_url_host.match(/ecshweb\.pchome\.com\.tw/))
{
// $('a[href*="q="]').attr('target', '_blank');
$('a[href*="shopping.pchome.com.tw"]').attr('target', '_blank');
_uf_log(_url_host);
}
else if (_url_host.match(/buy\.yahoo\.com/))
{
UF_addStyle([
'body { font-family: $fontFamily8; }',
]);
//$('.pd-image, .pd-desc .title, #srp-pdclass, #cl-catproduct, .pdbound, .pdbox, .sitelist .list, .sitelist .stitle, #cl-pdintro .content .tab-content .Notes').find('a').attr('target', '_blank');
//_uf_dom_filter_link('a', '.pd-image, .pd-desc .title, #srp-pdclass, #cl-catproduct, .pdbound, .pdbox, .sitelist .list, .sitelist .stitle, #cl-pdintro .content .tab-content .Notes, #srp_result_list').attr('target', '_blank')();
if ($('#rightcx').size())
{
$(window).one('load', function(){
$('#rightcx')
.find('#cl-vvrecmd a')
.each(function(){
var _this = $(this);
var _clone = _this.clone();
_this.after(_clone).remove();
_clone.attr('target', '_blank');
})
;
});
}
// _uf_log(_url_obj);
if (_url_obj.query.match(/gdid=/))
{
try
{
$('.RightItro .promoGift')
.hover(function(){
$(this).find('.bd').show();
}, function(){
$(this).find('.bd').hide();
})
.find('.bd')
;
}
catch (e)
{}
try
{
$('td[background*="st-4280247-8.gif"]')
.parents('table:first')
.siblings(':has(td[background*="st-4280247-8.gif"])')
.andSelf()
.attr('data-title', true)
.click(function(){
var _this = $(this);
_this.nextUntil('[data-title]').filter(':not([data-title])').toggle();
});
;
}
catch (e)
{}
try
{
$('<div>')
.append(
$('.content .tab-content:eq(1)')
.children()
.children()
.clone()
)
.prependTo('.content .tab-content:first')
;
}
catch (e)
{}
}
if ($('#cl-mainitem').size())
{
var _item_img = $('#cl-mainitem .item-img');
_item_img.find('.zoom-box img.main-image').imagesLoaded(function(){
var _this = $(this);
_this.width(_this.width()).height(_this.height());
var _view = _item_img.find('.zoom-view img.main-image');
if (_view.size())
{
_this.attr('lowsrc', _this.attr('src')).attr('src', _view.attr('src'));
}
});
$('#item_scrollable .itemlist .item').each(function(){
var _item = $(this);
_item.find('img:first').imagesLoaded(function(){
var _this = $(this);
_this.width(_this.width()).height(_this.height());
if (_item.attr('data-lsrc'))
{
_this.attr('lowsrc', _this.attr('src')).attr('src', _item.attr('data-lsrc'));
}
});
});
var _rate = $('#cl-mainitem .item-spec .rate .rate-table');
if (_rate.size())
{
$('#cl-mainitem .item-spec .rate .ratelayer').width(400);
var _p0 = $('#cl-mainitem .item-spec .priceinfo .price').text().replace(/[,\$]/, '');
_rate.find('tbody > tr').each(function(){
var _this = $(this);
var _n1 = _this.find('.nums .period').text();
var _n2 = -1;
if (_this.find('.nums .rate-num').size())
{
_n2 = _this.find('.nums .rate-num').text();
}
var _p1 = _this.find('.amount span').text();
var _p2 = parseInt(_n1) * parseInt(_p1);
var _p4 = _p2 - _p0;
if (_n1 && _n2 == -1)
{
var _p3 = parseInt(_p2) - parseInt(_p0);
_uf_log(_p0, _p1, _p2, _p3);
$('<td/>')
.attr('nowrap', true)
.css({
padding: '0 5px',
})
.addClass('amount')
.append($('<span/>').text(_p2))
.append($('<span/>').css({
'padding-left': '5px',
}).text('( ' + _p3 + ' )'))
.appendTo(_this)
;
}
else if (_p4)
{
$('<td/>')
.attr('nowrap', true)
.css({
padding: '0 5px',
})
.addClass('amount')
.append($('<span/>').css({
'padding-left': '5px',
}).text('( ' + _p4 + ' )'))
.appendTo(_this)
;
}
})
.parent('table')
.find('td')
.attr('nowrap', true)
;
}
}
$('article[class="Notes"]')
.each(function(){
var _note = $(this);
$('[style]', _note)
.each(function(){
var _this = $(this);
if (this.style['font-size'] == '12pt')
{
this.style['font-size'] = '';
}
})
;
})
;
$(window)
.on('load.ready', function(){
let a = _uf_dom_filter_link('a', ['.pd-image, .pd-desc .title, #srp-pdclass, #cl-catproduct, .pdbound, .pdbox, .sitelist .list, .sitelist .stitle, #cl-pdintro .content .tab-content .Notes, #srp_result_list',
'.orderbox .info, .tracktable .info',
].join(',')).attr('target', '_blank');
})
.on('load', function(){
})
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#srp_sl_result .srp_pagination ul li.selected').prev().find('a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('#srp_sl_result .srp_pagination ul li.selected').next().find('a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.on('statechange', function()
{
let fn = function(){
if ($('body > .yui3-overlay.yui3-overlay-hidden').size())
{
setTimeout(function () {
$(window).triggerHandler('load.ready')
}, 100)
}
else
{
setTimeout(fn, 100)
}
};
fn();
})
.triggerHandler('load')
;
}
else if (_url_host.match(/tw\.(\w+\.)?mall\.yahoo\.com/))
{
//$('#bd .bd .pic, #bd .bd .title, #bd .bd .info').find('a').attr('target', '_blank');
var _btn = $('#ypsadult .action a.no');
if (_btn.size())
{
_btn[0].click();
location.href = _btn[0].href;
}
$(window)
.on('load.ready', function(){
let a = _uf_dom_filter_link('a', $('#bd .bd .pic, #bd .bd .title, #bd .bd .info, #srp_result_list, #Mid_item, #Preadpic')).attr('target', '_blank');
})
.on('load', function(){
})
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#srp_sl_result .srp_pagination ul li.selected').prev().find('a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('#srp_sl_result .srp_pagination ul li.selected').next().find('a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.on('statechange', function()
{
let fn = function(){
if ($('body > .yui3-overlay.yui3-overlay-hidden').size())
{
setTimeout(function () {
$(window).triggerHandler('load.ready')
}, 100)
}
else
{
setTimeout(fn, 100)
}
};
fn();
})
.triggerHandler('load')
;
$('#ypsitb a[href*="hpp=QA"]:not([data-done])').attr('href', function (i, v) {
$(this).attr('data-done', true);
return v + '&order=down';
});
let _m = $('#ypsiqna').eq(0);
if (_m.size())
{
let b = $('<div id="ypsiqna" class="ypsmodule" />').insertBefore(_m);
_m.find('> .ft').clone().appendTo(b)
$('#ypsiqna .ft .btn-qna')
.on('click', function(event){
let t = $('#yui-main .yui-g > .ypsmodule[id="ypsiqnans"]');
let d = t.eq(0).css('display');
if (d == 'block')
{
t.hide();
}
else
{
t.show();
}
_uf_done(event);
})
;
$('#ypsiqnans').clone().insertBefore(_m);
}
$_options.varmap.body += ', .card-title, .title-txt, #wrapper, .clear-link, #ypsiif .infolist td, #ypsiqna .qna-list tbody td, .Fz-15';
}
else if (_url_host.match(/xda\-developers\.com/))
{
// $('.thread-listing, #rssbox, #sidepanel #topThanksAll').find('a').filter(':not([href^="javascript:"]), :not([href^="#"])').attr('target', '_blank');
_uf_dom_filter_link($('.thread-listing, #rssbox, #sidepanel #topThanksAll').find('a')).attr('target', '_blank');
}
else if (_url_host.match(/soundcloud\.com/))
{
$(window).on('load', function()
{
var _actions = $('.listenEngagement__actions .soundActions.sc-button-toolbar .sc-button-group');
_uf_log(_actions.size());
if (_actions.size())
{
GM_addStyle('.listenInfoTeaser__description { max-height: none; overflow: auto; } .listenInfoTeaser__descriptionFade { display: none; }');
var _button = $('<button class="sc-button sc-button-medium sc-button-responsive" tabindex="0" />');
_uf_log(_button);
_actions.append(_button.clone().addClass('sc-button-share').text('Downloade').click(function(event){
_uf_open('http://streampocket.com/?stream=' + encodeURIComponent(_url));
return _uf_done(event);
}));
_uf_log(_button);
}
});
}
else if (_url_host.match(/wandoujia\.com/))
{
GM_addStyle('.card .comment, .desc-info { color: #4D4D4D; } .PC .card { border: 1px solid rgba(60, 60, 60, 1); width: 30%; } .PC .card:hover { box-shadow: 0 1px 3px #BA126B; border: 1px solid rgb(216, 8, 221); } body { background-color: #1F202F; } #j-head-menu { background-color: rgb(244, 244, 244); }');
// $('.app-box .card').find('a').filter(':not([href^="javascript:"]), :not([href^="#"])').attr('target', '_blank');
_uf_dom_filter_link($('.app-box .card').find('a')).attr('target', '_blank');
}
else if (0 && _url_host.match(/facebook\.com/))
{
// _uf_log(_browser);
$_options.varmap.body_head = $('body')[0];
$_options.varmap.body += ', .userContent, ._wk, #fbPhotoSnowliftCaption, #fbPhotoSnowliftTagList, #fbPhotoSnowliftCaption .text_exposed_link, ._5k3v, ._5p3y ._5pbw, ._5p3y ._5pbx, ._5p3y ._5pbx span.text_exposed_link, ._4_j6, ._5k3v, ._6dh ._2yg .input, ._6dh ._2yg .uiMentionsInput .highlighterContent, .fbPhotoAlbumHeader .fbPhotoCaption, ._5p3y, ._5p3y button, ._5p3y input, ._5p3y label, ._5p3y select, ._5p3y td, ._5p3y textarea, ._5p3y .uiMentionsInput .highlighter, ._5p3y .uiButtonText, ._5p3y .uiButton input, ._5p3y .uiLinkButton input, ._5p3y button.as_link, ._5t_y ._2yg .input, ._5t_y ._2yg .uiMentionsInput .highlighterContent, ._5t_y ._2yg .input, ._5t_y ._2yg .uiMentionsInput .highlighterContent, html ._1llv ._2yg .input, html ._1llv ._2yg .uiMentionsInput .highlighterContent, ._36, .webMessengerMessageGroup ._38';
if (0 || _uf_browser().chrome)
{
var _top;
var _ok = false;
var _chk;
$('body').on('click.fbfix', '.userContentWrapper .mtm a[rel="theater"][ajaxify], #fbTimelinePhotosContent a.uiMediaThumb[rel="theater"][ajaxify], #contentArea a[rel="theater"][ajaxify], .share_action_link', function(event){
var _this = $(this);
_ok = true;
_top = $(window).scrollTop();
// var _p = _this.parents('div.null.uiLayer[role="dialog"]');
var _p = _this.is('.share_action_link');
if (_this.is('.share_action_link'))
{
_chk = function()
{
return $('body > div.null.uiLayer[role="dialog"]').size() ? false : true;
};
}
else
{
_chk = null;
}
// _uf_log(_ok, _top, $(window).scrollTop(), event, _p, _chk, _this);
// $(window).scrollTop(_this.offset().top);
});
var _chk_chk = function()
{
if ((!_chk && $('#photos_snowlift').hasClass('hidden_elem')) || (_chk && _chk()))
{
return true;
}
return false;
};
$('body').on('click.fbfix', '.fbPhotoSnowlift.fbxPhoto.uiLayer, #photos_snowlift, .fbPhotoSnowliftControls .closeTheater, div.null.uiLayer[role="dialog"] form[rel="async"] button, div.null.uiLayer[role="dialog"] form[rel="async"] a[role="button"]', function(event){
// _uf_log(_ok, _top, $(window).scrollTop(), event, _chk_chk(), _chk);
if (_ok && _top)
{
var _this = $(this);
var _s = 0;
if (_chk && _this.is('div.null.uiLayer[role="dialog"] form[rel="async"] button:submit'))
{
_s = 500;
}
setTimeout(function(){
if (_ok && _top && _chk_chk())
{
_ok = false;
_chk = null;
var _do = function()
{
$(window).scrollTop(_top);
$(unsafeWindow).scrollTop(_top);
unsafeWindow.scrollTo(0, _top);
};
_do();
setTimeout(_do, 250);
setTimeout(_do, 500);
setTimeout(_do, 750);
// _uf_log('setTimeout', _ok, _top, $(window).scrollTop(), $('#photos_snowlift').hasClass('hidden_elem'));
}
}, 250 + _s);
}
});
/*
$(window).on('scroll.fbfix', function(event){
_uf_log(_ok, _top, $(window).scrollTop(), event);
if (!_ok)
{
_top = $(window).scrollTop();
}
});
*/
}
var _fn_is_timeline = function(){
return $('#contentArea #timeline_tab_content').size();
};
var _area_main_last;
var _fn_area_main = (function(event){
try
{
var _area_delay = 2500;
// _uf_log(_uf_event_name(event), event, _area_main_last, 999);
var _area_main = $('#stream_pagelet');
if (_area_main.size())
{
_area_main_last = _area_main.selector;
var _area_stream = $('div[id^="topnews_main_stream_"] > div[id^="feed_stream_"], > ._5pcb', _area_main);
var _more_pager_pagelet_last = $();
$(window)
.off('scroll.area_main')
.on('scroll.area_main', (function(event){
_more_pager_pagelet = $('div[id^="more_pager_pagelet_"]', _area_stream);
var _substream = $();
var _substream_true = $();
if (_more_pager_pagelet_last.size())
{
_more_pager_pagelet_new = _more_pager_pagelet.eq(-1);
_substream = _more_pager_pagelet_last.nextUntil(_more_pager_pagelet_new);
_more_pager_pagelet_last = _more_pager_pagelet_new;
}
else
{
_more_pager_pagelet_last = _more_pager_pagelet.eq(-1);
_substream = $('#newsFeedHeading', _area_stream).nextUntil(_more_pager_pagelet_last);
}
if (_substream.size())
{
_more_pager_pagelet_last.attr('data-done', true);
if (!_substream.parent('#stream_pagelet > ._5pcb').size())
{
_substream_true = _substream.filter('div[id^="substream_"]');
}
else
{
_substream_true = _substream;
}
_substream_true
.each(function(){
var _this = $(this);
$('.userContentWrapper .mtm a[href^="/notes/"]', _this).attr('target', '_blank');
})
;
}
// _uf_log(_area_main_last, _area_main, _area_stream, _substream, _substream_true, _more_pager_pagelet_last);
}).debounce(_area_delay))
;
}
else if ((_area_main = $('#contentArea #timeline_tab_content')) && _area_main.size())
{
_area_main_last = _area_main.selector;
var _area_stream = $('#pagelet_timeline_recent .fbTimelineCapsule > ._4_7u > ol._3rbf', _area_main);
var _more_pager_pagelet_last = $();
$(window)
.off('scroll.area_main')
.on('scroll.area_main', (function(event){
_more_pager_pagelet = $('div._5pcb', _area_stream);
var _substream = $();
var _substream_true = $();
if (_more_pager_pagelet_last.size())
{
_more_pager_pagelet_new = _more_pager_pagelet.eq(-1);
_substream = _more_pager_pagelet_last.nextAll(_more_pager_pagelet.selector);
_more_pager_pagelet_last = _more_pager_pagelet_new;
}
else
{
_more_pager_pagelet_last = _more_pager_pagelet.eq(-1);
_substream = $('.lastCapsule', _area_stream).nextAll(_more_pager_pagelet.selector);
}
if (_substream.size())
{
_more_pager_pagelet_last.attr('data-done', true);
_substream_true = _substream.find('> div[id^="tl_unit_"]');
_substream_true
.each(function(){
var _this = $(this);
$('.userContentWrapper .mtm a[href^="/notes/"]', _this).attr('target', '_blank');
})
;
}
// _uf_log(_area_main_last, _area_main, _area_stream, _substream, _substream_true, _more_pager_pagelet_last);
}).debounce(_area_delay))
;
}
else if ((_area_main = $('#contentArea #timeline-medley')) && _area_main.size())
{
_area_main_last = _area_main.selector;
var _area_stream = $('#pagelet_timeline_medley_notes > div[id^="collection_wrapper_"] > div[id^="pagelet_timeline_app_collection_"]', _area_main);
var _more_pager_pagelet_last = $();
$(window)
.off('scroll.area_main')
.on('scroll.area_main', (function(event){
_more_pager_pagelet = $('> div._z3h', _area_stream);
var _substream = $();
var _substream_true = $();
if (_more_pager_pagelet_last.size())
{
_more_pager_pagelet_new = _more_pager_pagelet.eq(-1);
_substream = _more_pager_pagelet_last.nextAll(_more_pager_pagelet.selector);
_more_pager_pagelet_last = _more_pager_pagelet_new;
}
else
{
_more_pager_pagelet_last = _more_pager_pagelet.eq(-1);
_substream = _more_pager_pagelet;
}
if (_substream.size())
{
_more_pager_pagelet_last.attr('data-done', true);
_substream_true = $('> .userContentWrapper', _substream).size() ? _substream : _substream.find('div._5pcb');
_substream_true
.each(function(){
var _this = $(this);
$('.userContentWrapper .mtm a[href^="/notes/"]', _this).attr('target', '_blank');
})
;
}
// _uf_log(_area_main_last, _area_main, _area_stream, _substream, _substream_true, _more_pager_pagelet_last);
}).debounce(_area_delay))
;
}
else if ((_area_main = $('#contentArea > div[id^="pagelet_"][id*="_dashboard"]')) && _area_main.size())
{
_area_main_last = _area_main.selector;
var _area_stream = _area_main;
var _more_pager_pagelet_last = $();
$(window)
.off('scroll.area_main')
.on('scroll.area_main', (function(event){
_more_pager_pagelet = $('div._5pcb', _area_stream);
var _substream = $();
var _substream_true = $();
_substream = _more_pager_pagelet;
if (_more_pager_pagelet_last.size())
{
_more_pager_pagelet_last = _area_stream;
}
else
{
_more_pager_pagelet_last = $('div.ptm:eq(-2)', _area_stream);
}
if (_substream.size())
{
_area_stream = $('div.ptm:eq(-1)', _area_stream);
_more_pager_pagelet_last.attr('data-done', true);
_substream_true = _substream.find('div.mbm');
_substream_true
.each(function(){
var _this = $(this);
$('.userContentWrapper .mtm a[href^="/notes/"]', _this).attr('target', '_blank');
})
;
}
// _uf_log(_area_main_last, _area_main, _area_stream, _substream, _substream_true, _more_pager_pagelet_last);
}).debounce(_area_delay))
;
}
else if (_area_main_last)
{
_area_main_last = null;
_uf_log(666);
$(window)
.off('scroll.area_main')
;
}
_uf_dom_filter_link('#all_search_results ._gli a._ohe, #all_search_results ._glj ._gll a').attr('target', '_blank');
// $(window)
// .add(history)
// .off('statechange.area_main')
// .on('statechange.area_main', function(){
// $(window)
// .trigger('load.area_main')
// ;
// })
// ;
$(window)
.triggerHandler('scroll')
;
// setTimeout(function(){
// $(window)
// .triggerHandler('scroll')
// ;
// }, 1000);
// _uf_log(_uf_event_name(event), event, _area_main, _area_main_last, _area_main.selector);
}
catch(e)
{
_uf_log(e);
}
}).debounce(2000);
// $(window)
// .off('statechange.area_main')
// .on('statechange popstate', _fn_area_main)
// ;
$(window)
.on('load.area_main', _fn_area_main)
// .on('statechange', (function(event){
// _uf_url_obj_update();
// }).debounce(500))
.on('statechange.area_main', _fn_area_main)
.on('popstate', (function(event){
// _uf_log(_uf_event_name(event), event, 777);
// setTimeout(function(){
$(window).triggerHandler('load.area_main');
// }, 1000);
}).debounce(1500))
.trigger('load.area_main')
;
}
else if (_url_host.match(/life\.com\.tw/))
{
GM_addStyle('.fancybox-overlay { display: none; } #mainContent img { max-width: ' + $('#mainContent').width() + 'px; }');
// _uf_log(2, $('#mainContent').html());
_uf_disable_nocontextmenu(2, '#mainContent, #mainContent iframe');
// _uf_disable_nocontextmenu(2, $('#mainContent > iframe:first').contents());
// _uf_log(0, $('#mainContent > iframe:first')[0].contentWindow.document);
// _uf_disable_nocontextmenu(2, iframe[0].contentWindow.document);
// _uf_log(3);
$('#mainContent > iframe:first').on('ready, load', function(){
// _uf_log(4);
var _html = $('#mainContent > iframe:first').contents().find('body').html();
if (_html)
{
$('#mainContent').html(_html);
}
});
$(unsafeWindow).ready(function(){
// _uf_log(5);
$('#mainContent > iframe:first').trigger('load');
});
// $('#mainContent > iframe:first').contents().find('body').html()
}
else if (_url_host.match(/blog\.xuite\.net/))
{
_uf_disable_nocontextmenu(1);
}
else if (_url_host.match(/tieba\.baidu\.com/))
{
// GM_addStyle('.l_post_bright .d_post_content_main .p_content { min-height: none; min-height: auto; min-height: inherit !important; }');
//
// UF_addStyle('.d_post_content, .lzl_content_main, .edui-editor-body .edui-body-container { font-size: $fontSize; }', null, $_options.style);
UF_addStyle([
'.l_post_bright .d_post_content_main .p_content { min-height: none; min-height: auto; min-height: inherit !important; }',
'.d_post_content, .lzl_content_main, .edui-editor-body .edui-body-container, .search_bright .search_ipt, .search_nav, .tb_rich_poster .poster_body .editor_textfield, .root_dir_box li, #dir_content_main a, #dir_content_main a:link, #dir_content_main a:hover, #dir_content_main a:visited, .pagination, .search .s_ipt, .search .s_btn, .lzl_cnt .lzl_content_main, .deepread-wrap { font-size: $fontSize; }',
'._uf_anchor { border: 1px solid rgba(0, 183, 255, 0.5); }',
'#com_userbar { position: fixed; background-color: #FFF; }',
]);
$_options.varmap.body += ', .new_list .title, .n_name, .n_txt';
if (_url_obj.path.match(/^\/photo\//))
{
$(window).keydown(function(event){
// _uf_log(event, event.which);
switch(event.which)
{
case 33:
case 37:
var _a = $('#image_original_container .image_original_prev:first');
if (_a.size())
{
_uf_done(event);
_a[0].click();
// return false;
}
break;
case 34:
case 39:
var _a = $('#image_original_container .image_original_next:first');
if (_a.size())
{
_uf_done(event);
_a[0].click();
// return false;
}
break;
}
});
}
else
{
var _goto_count = 2;
var _goto = function (anchor)
{
var _who = $();
if (anchor)
{
_who = _who.add('.l_post_anchor[name="' + anchor + '"]');
_who = _who.add('.l_post:has(.l_post_anchor[name="' + anchor + '"]) .core_reply');
}
var _m;
if (_m = _url_obj.query.match(/(?:\?|\&|^)cid=(\d+)\b/))
{
//_uf_log('cid', _m[1]);
_who = _who.push('.l_post_anchor[name="' + _m[1] + '"]');
}
if (_m = _url_obj.query.match(/(?:\?|\&|^)pid=(\d+)\b/))
{
//_uf_log('pid', _m[1]);
_who = _who.push('.l_post_anchor[name="' + _m[1] + '"]');
}
if (_url_obj.path.match(/p\//))
{
_who = _who.push('#pb_content');
}
var _top;
if (_who.size())
{
_top = _who.eq(0);
if (_top.is('#pb_content'))
{
_top = _top.offset().top - $('#j_core_title_wrap').height();
}
else if (_goto_count >= 0)
{
_uf_log('_goto', _goto_count, _who, _who.offset(), _top);
_goto_count--;
setTimeout(function(){
_goto(anchor);
}, 250);
}
// _uf_log(9, _who, _who.offset(), _top);
if (_who.parents('.l_post.l_post_bright:first').size())
{
$('._uf_anchor').removeClass('_uf_anchor');
_who.parents('.l_post.l_post_bright:first').addClass('_uf_anchor');
}
if (!anchor && _top.is('.l_post_anchor'))
{
_top = _top.offset().top - $('#j_core_title_wrap').height() + 44;
}
$.scrollTo(_top);
}
//_uf_log(_goto, anchor, _who, _top);
};
var _fn_show_reply_interval;
var PageData = $.extend({}, {
thread: {},
}, unsafeWindow.PageData);
/*
$('.l_post:not([data-loaded])')
.each(function(){
var _post = $(this);
_post.attr('data-loaded', true);
$('.d_post_content_main', _post).prepend($('<a/>')
.text('#' + _post.data('field').content.post_no)
.attr('href', 'http://tieba.baidu.com/p/' + PageData.thread.thread_id + '?pid=' + _post.data('field').content.post_id + '#' + _post.data('field').content.post_id)
.attr('style', 'float: right; z-index: 500; position: absolute; right: 0px; top: 0px; padding: 1px 5px;')
.on('click', _uf_done)
);
})
;
*/
var _fn_show_reply = function()
{
var _not_done = 0;
var _posts = $('.l_post')
.each(function(){
var _post = $(this);
if (_post.is(':not([data-loaded])'))
{
_post.attr('data-loaded', true);
$('.d_post_content_main', _post).prepend($('<a/>')
.text('#' + _post.data('field').content.post_no)
.attr('href', 'http://tieba.baidu.com/p/' + PageData.thread.thread_id + '?pid=' + _post.data('field').content.post_id + '#' + _post.data('field').content.post_id)
.attr('style', 'float: right; z-index: 500; position: absolute; right: 0px; top: 0px; padding: 1px 5px;')
.on('click', _uf_done)
);
}
var _area = $('.d_post_content_main .core_reply:not([data-loaded])', _post);
if (_area.size())
{
if (!$('.loading_reply', _area).size())
{
_area.attr('data-loaded', true);
var _button3 = _area.find('.core_reply_content .lzl_more a.j_lzl_m');
if (_button3.size())
{
_button3[0].click();
}
}
else
{
if (_area.isOnScreen())
{
_uf_log('isOnScreen', _not_done);
_fn_show_reply_debounced();
}
_not_done++;
}
}
$('.BDE_Image', _post).attr('src', function(i, v){
return v.replace(/forum\/.+\/sign=[^\/]+\//, 'forum/pic/item/')
})
})
;
$('#j_p_postlist, .p_postlist').attr('data-loaded', true);
/*
$('.l_post .d_post_content_main .core_reply:not([data-loaded])')
.each(function(){
var _area = $(this);
// _area.isOnScreen() &&
if (!$('.loading_reply', _area).size())
{
_area.attr('data-loaded', true);
var _button3 = _area.find('.core_reply_content .lzl_more a.j_lzl_m');
if (_button3.size())
{
_button3[0].click();
}
}
else
{
if (_area.isOnScreen())
{
_uf_log('isOnScreen', _not_done);
_fn_show_reply_debounced();
}
_not_done++;
}
})
;
*/
// _uf_log('', _not_done);
if (!_not_done)
{
clearInterval(_fn_show_reply_interval);
$(window).off('scroll.reply');
}
_fn_title_update();
};
var _fn_show_reply_debounced = _fn_show_reply.debounce(250);
var _fn_title_update = function()
{
var _title = $('.core_title_txt').text();
var _p = $('.l_thread_info .l_pager .tP').eq(0).text();
if (_p > 1)
{
_title += ' (' + _p + ' 頁)';
}
_title += ' ' + $('.card_title_fname').text();
document.title = _title;
$('title').text(_title);
return _title;
};
$(window)
/*
.on('load.scrollTo', function(event){
// _uf_log(_uf_event_name(event), event);
_goto(_url_obj.fragment);
})
.one('load', function(event){
// $(window).triggerHandler('load.scrollTo');
setTimeout(function(){
$(window).triggerHandler('load.scrollTo');
}, 1000);
})
*/
.on('scroll.reply', _fn_show_reply_debounced)
/*
.on('load.ready', function(){
if (_url_obj.path.match(/p\//))
{
$('.l_post .d_post_content_main .core_reply')
.each(function(){
var _area = $(this);
var _button2 = _area.find('.core_reply_tail .lzl_link_fold');
if (_button2.size() && _button2.is(':hidden'))
{
var _button1 = _area.find('.core_reply_tail .lzl_link_unfold');
_button1[0].click();
}
var _button3 = _area.find('.core_reply_content .lzl_more a.j_lzl_m');
if (_button3.size())
{
_button3[0].click();
}
})
;
}
})
*/
.on('history.ready', function(event){
//_uf_log(9, event, _url_obj, _url_obj.fragment);
if (_url_obj.fragment != 'noExistHash')
{
var anchor;
if (_url_obj.fragment)
{
anchor = _url_obj.fragment;
}
setTimeout(function(){
_goto(anchor);
}, 2000);
}
_fn_title_update();
$(window).off('scroll.reply').on('scroll.reply', _fn_show_reply_debounced);
setTimeout(function(){
$(window).triggerHandler('scroll.reply');
}, 1500);
$('#j_p_postlist, .p_postlist')
var _ajax_interval = setInterval(_fn_show_reply_debounced, 10000);
var _fn = function(){
var _posts = $('#j_p_postlist, .p_postlist');
var i = _posts.size();
if (i)
{
if (i == 1)
{
setTimeout(_fn, 500);
}
else if (_posts.filter(':not([data-loaded])').size())
{
$(window).triggerHandler('scroll.reply');
}
}
};
setTimeout(_fn, 1500);
})
.on('load', function ()
{
$(window).triggerHandler('scroll.reply');
})
.ready(function ()
{
_fn_title_update();
$(window).triggerHandler('scroll.reply');
})
;
setTimeout(function(){
_goto(_url_obj.fragment);
_fn_show_reply_interval = setInterval(_fn_show_reply_debounced, 10000);
}, 500);
$('.replace_div .replace_tip')
.each(function(){
this.click();
})
;
/*
$('.d_post_content .BDE_Image').imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, true);
var _src = _this.attr('src');
// http://imgsrc.baidu.com/forum/w%3D580/sign=b47b35f9830a19d8cb03840d03fb82c9/2b6aba504fc2d562fdf1bca5e41190ef77c66c4b.jpg
// http://imgsrc.baidu.com/forum/pic/item/2b6aba504fc2d562fdf1bca5e41190ef77c66c4b.jpg
if (_src.match(/imgsrc\.baidu\.com/))
{
_this.attr('lowsrc', _src);
_src = _src.replace(/(forum\/).+\/([a-z0-9]+\.[a-z]+)$/, '$1pic/item/$2');
_this.attr('src', _src);
}
});
*/
}
}
else if (_url_host.match(/99comic\.com/))
{
if (_url_obj.path.match(/comics/))
{
UF_addStyle([
'html, body { background-color: #000; background: #000; } html, body, * { font-size: 9pt !important; } div.cBody img { border: 0px none #000 !important; }',
'#imgCurr { $filter_contrast_1; }',
]);
// _uf_log(0);
$('#iBody #imgCurr').imagesLoaded(function() {
// _uf_log(1);
var _this = $(this);
if (_this.width() > $(window).width())
{
_this.width($(window).width());
}
else if (1 || _this.height() > $(window).height())
{
_this.height($(window).height());
}
// _uf_log(2);
$(window).scrollTop(_this.offset().top);
}).click(function(){
unsafeWindow.pageChange('next');
});
$(window).on('resize', function(){
$('#iBody #imgCurr').triggerHandler('imagesLoaded.done');
});
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
//unsafeWindow.prevpage();
unsafeWindow.pageChange('prv');
return false;
break;
case 34:
case 39:
_uf_done(event);
//unsafeWindow.nextpage();
unsafeWindow.pageChange('next');
return false;
break;
}
});
}
}
else if (_url_host.match(/(?:jandown|mimima)\.com/))
{
if (_url_obj.path.match(/link/))
{
var _form = $('form[action="fetch.php"]:first');
_form.attr('onsubmit', '').removeAttr('onsubmit').trigger('submit').find(':submit:first').after('<span style="color: rgba(255, 0, 255, 1); padding: 5px; margin: 0px 10px;">OK</span>');
document.title = _form.find(':input[name="code"]').val() + ' - ' + _url_host;
}
}
else if (_url_host.match(/cartoonad\.com/) || _url_host.match(/cartoonmad\.com/))
{
if (_url_host.match(/cartoonad\.com/) && _url_obj.path.match(/comic/))
{
GM_addStyle('body { background: #000; }');
var _img = $('a > img[onload][oncontextmenu]').imagesLoaded(function(){
var _this = _uf_fixsize2(this, window, 1);
$(window).scrollTop(_this.offset().top);
});
$(window).scrollTop(_img.offset().top);
_uf_disable_nocontextmenu(1, _img);
$(window).on('resize', function(){
_img.triggerHandler('imagesLoaded.done');
});
$(window).keydown(function(event){
var _pagenow = $('a.onpage').eq(0);
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
var _a = _pagenow.prev('a.pages');
if (_a.size())
{
location.href = _a.attr('href');
}
return false;
break;
case 34:
case 39:
_uf_done(event);
var _a = _pagenow.next('a.pages');
if (_a.size())
{
location.href = _a.attr('href');
}
return false;
break;
}
});
}
else if (_url_host.match(/cartoonmad\.com/))
{
$('a[href^="comic"]').attr('target', '_blank');
}
}
else if (_url_host.match(/dlsite\.com/))
{
var _yes = $('form#adult_check #check-top #btn_yes');
if (_yes.size())
{
$('form#adult_check').submit();
}
}
else if (_url_host.match(/u17\.com/))
{
$_options.varmap.body += ', body, .chapterlist_box li a, .ncc_content_right_text, .comic_info .left .info .top, .f14';
$_options.style.fontSize = '12px';
_uf_disable_nocontextmenu();
var _div_image = $('#current_read_image');
if (_div_image.size())
{
GM_addStyle('#current_read_image, #current_read_image img { text-align: center; } .fixedNav_ds { right: 20%; position: fixed; }');
var _is_jquery = _uf_is_jquery(unsafeWindow.$);
var _unsafeWindow_body;
if (_is_jquery)
{
_unsafeWindow_body = _is_jquery(unsafeWindow).add('html, body');
}
else
{
_unsafeWindow_body = $(unsafeWindow).add('html, body');
}
$('#image_trigger').css('z-index', 0);
var _fn = function(event) {
_unsafeWindow_body.stop();
$(window).scrollTop($('#image_trigger').offset().top);
};
var _timeout;
$('#current_read_image, #current_read_image img, #readtop .pagebar .prev, #readtop .pagebar .next').on('click', function(event){
_uf_done(event, 1);
// _uf_log(_uf_event_name(event), event, this, event.which);
// _fn();
// _fn3();
// _fn3();
// setTimeout(_fn, 200);
_fn3();
setTimeout(_fn, 100);
setTimeout(_fn2, 500);
// setTimeout(_fn3, 100);
//
// setTimeout(_fn3, 300);
//
// setTimeout(_fn3, 700);
// setTimeout(_fn2, 500);
if (_timeout)
{
clearTimeout(_timeout);
_timeout = null;
}
_timeout = setTimeout(function(){
$(window).triggerHandler('load').triggerHandler('resize');
}, 1000);
});
var _fn2 = function() {
var _this = $('#current_read_image .cur_img, #current_read_image .cur_img + img.image_cache');
if (_is_jquery)
{
// _uf_log(99, _is_jquery(_this).add(_unsafeWindow_body).stop());
// _uf_log(99, _is_jquery(_this).stop());
_is_jquery(_this).stop();
}
else
{
_this.stop();
}
_uf_fixsize2(_this, null, 1);
_this
.css({
position: 'relative',
opacity: 1,
})
.not('.cur_img')
.css({
opacity: 0,
})
.hide()
;
$('#image_trigger').width(_this.width()).height(_this.height());
// _div_image.width('100%').height($(window).height())[0].attr('style', function(i, val){
// return val + '; width: 100% !important; height: ' + $(window).height() + 'px !important;';
// });
// _uf_log(_this, _div_image, _this.width(), _div_image.width());
};
var _fn3 = function(){
$(window).triggerHandler('resize.img');
};
var _style = GM_addStyle('');
_uf_log(_style);
$(window)
.on('load.img', function(event){
// _uf_log(_uf_event_name(event), event);
var _img = $('#current_read_image img:not(#image_trigger)').imagesLoaded(function(event){
var _this = _uf_fixsize2(this, window, 1);
_fn();
_fn2();
// _uf_log(77, _uf_event_name(event), event);
});
$(window).triggerHandler('resize.div');
})
.on('resize.div', function(event){
var _css = '#current_read_image { width: 100% !important; height: ' + $(window).height() + 'px !important; }';
_style.remove();
_style = GM_addStyle(_css);
// _uf_log(_uf_event_name(event), event, _style, _css);
})
.on('load', function(event){
_fn();
$('#current_read_image img:not(#image_trigger)').ready();
})
.on('resize.img', function(event){
_fn();
_fn2();
// _fn();
// _uf_log(_uf_event_name(event), event);
})
;
// setTimeout(_fn3, 100);
// unsafeWindow._fn2 = _fn2;
_fn();
setTimeout(function(){
_fn();
$(window).triggerHandler('load.img');
}, 100);
var _div = $('<div/>').css('display', 'none');
$('#cr_top').wrapInner(_div);
_div = $('#cr_top > div:first');
$('#cr_top')
.css('border-bottom-style', 'none')
// .add('#cr_top .cr_tb, #cr_top .bg')
// .add(_div)
.hover(function(event){
// _uf_log(_uf_event_name(event), event, _div, this);
_div.show().css('display', 'block');
}, function(){
// _uf_log(_uf_event_name(event), event, _div, this);
_div.hide();
})
;
_div.hide();
$('#current_read_image').on('mouseenter', function(event){
// _uf_log(_uf_event_name(event), event, _div, this);
_div.hide();
});
// var _stop = false;
$(window).add(document).keydown(function(event){
// _uf_log(_uf_event_name(event), event, this, event.which);
switch(event.which)
{
case 33:
// case 37:
// _uf_done(event);
var _a = $('#readtop .pagebar .prev');
if (_a.size())
{
_uf_done(event);
// _a.trigger('click');
_a[0].click();
}
break;
case 34:
// case 39:
// _uf_done(event);
var _a = $('#readtop .pagebar .next');
if (_a.size())
{
_uf_done(event);
// _a.trigger('click');
_a[0].click();
}
break;
case 37:
case 39:
_fn3();
setTimeout(function(){
$(window).triggerHandler('load');
// _fn3();
}, 100);
setTimeout(_fn, 500);
break;
}
});
}
$(window).one('load', function(event){
var _tab2 = $('.main .recomend [rel="rec-2"]');
if (_tab2.size())
{
// _tab2.trigger('click');
_tab2.click();
_tab2[0].click();
}
_uf_log(_tab2);
});
}
else if (_url_host.match(/techbang\.com/))
{
// _uf_log(_url_host);
UF_addStyle('body { font-size: $fontSize; }', null, $_options.style);
$(window).add(document).keydown(function(event){
_uf_log(_uf_event_name(event), event, event.which);
switch(event.which)
{
case 33:
case 37:
var _a = $('.pagination a.previous_page');
if (_a.size())
{
_uf_done(event);
_a.trigger('click');
_a[0].click();
// _a.click();
}
break;
case 34:
case 39:
var _a = $('.pagination a.next_page');
if (_a.size())
{
_uf_done(event);
// _a.trigger('click');
_a[0].click();
// _a.click();
}
break;
}
});
$('.article .post-title a, .article .more-links a, .article a.excerpt-image-link').attr('target', '_blank');
$('#main .article .content .excerpt > span').removeAttr('style');
}
else if (_url_host.match(/wikipedia\./))
{
// GM_addStyle('.mw-body-content, #bodyContent { font-size: 10pt; }');
$_options.varmap.body += ', .mw-body-content, #bodyContent';
$('#mw-content-text, #bodyContent, #content').find('a.external').attr('target', '_blank');
}
else if (_url_host.match(/github\.com/))
{
$_options.varmap.body += ', .markdown-body, #readme .plain pre';
// GM_addStyle('.markdown-body { font-size: 10pt; }');
_uf_dom_filter_link($('.markdown-body a, .codesearch-results .repo-list-name a, .codesearch-results .code-list .title a, .news .alert .simple .title a, a.mini-repo-list-item')).attr('target', '_blank');
if (_url_host.match(/gist\.github\.com/))
{
// _uf_log(_url_host);
var _tpl_a1 = $('<a class="minibutton" data-skip-pjax="" aria-label=""/>');
$(window)
/*
.on('load', function(event){
_uf_log(_uf_event_name(event), event);
})
*/
.on('load.ready', function(event){
// _uf_log(_uf_event_name(event), event);
$('.files .file:not([data-old])')
.each(function(){
var _files = $(this);
// _uf_log(1);
var _actions_group = _files.find('.meta .actions .button-group');
// _uf_log(2);
// /bluelovers/5186199/raw/672fa55355385c52ba9d6f3c3e67d6e20651647d/ImageTweak_SC.user.js
var _a = _actions_group.find('.raw-url');
// _uf_log(3);
var _m, _url = '', _data;
if (_a.size())
{
_url = _a.attr('href');
}
// _uf_log(4);
if (_m = _url.match(/^\/?([^\/]+)\/([^\/]+)\/raw\/[^\/]+\/(.+)$/))
{
_data = {
user: _m[1],
gid: _m[2],
filename: _m[3],
};
// _uf_log(_data);
}
// _uf_log(5);
// _uf_log(_files, _actions_group, _a, _url, _data);
if (_data)
{
// _uf_log(6);
_tpl_a1.clone()
.attr('aria-label', 'Permalink Raw')
.attr('href', 'https://gist.github.com/' + _data.user + '/' + _data.gid + '/raw/' + _data.filename + '')
.text('Raw')
.appendTo(_actions_group)
;
}
// _uf_log(7);
})
.attr('data-old', true)
;
})
.triggerHandler('load.ready')
;
}
}
else if (_url_host.match(/kkkmh\.com/))
{
_uf_disable_nocontextmenu(1);
var _imgshow = $('#pic-show-area');
UF_addStyle('p, .chapterlist ul li, .bookinfo .onlinedm { font-size: inherit; }');
if (_imgshow.size())
{
UF_addStyle('body, #img_area, .imagearea .image .tip { background: #000 !important; border-width: 0px !important; } #img_area { position: absolute; left: 0px; text-align: center; width: 90%; }')
$('.header, .tip .fav, .footer').remove();
_imgshow
.imagesLoaded(function() {
var _this = $(this);
_uf_fixsize2(_this);
$.scrollTo(_this);
})
.on('click', function(event){
_uf_trigger_key(window, 39, 'keydown');
})
.on('load', function(event){
_imgshow.triggerHandler('imagesLoaded.done');
})
;
$(window)
.keydown(function(event){
var _pagenow = $('#select_menu:first');
var _a = $();
switch(event.which)
{
case 33:
case 37:
if (_pagenow.val() == 1 && (_a = $('a + #previous')).size())
{
_uf_done(event);
_a.prev()[0].click();
}
else
{
_uf_done(event);
unsafeWindow.multipage('previous');
}
break;
case 34:
case 39:
if (_pagenow.val() == _pagenow.find('option:last').val() && (_a = $('#next + a')).size())
{
_uf_done(event);
_a[0].click();
}
else
{
_uf_done(event);
unsafeWindow.multipage('next');
}
break;
}
})
.on('resize', function(event){
$.scrollTo(_imgshow);
$('#img_area').width($(window).width() - 30);
_imgshow.triggerHandler('imagesLoaded.done');
})
/*
.on('load', function(event){
$(window).triggerHandler('resize');
})
*/
.triggerHandler('resize')
;
}
else
{
if ($('.pages').size())
{
$.scrollTo('.body .sortarea .sortlist');
}
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.pages a + .current');
if (_a.size())
{
_uf_done(event);
_a.prev()[0].click();
}
break;
case 34:
case 39:
var _a = $('.pages .current + a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
});
}
}
else if (_url_host.match(/get\.adobe\.com/))
{
if (0 && _url_obj.path.match(/flashplayer/))
{
var _i = 0;
var _fn = function()
{
var _McAfee = $('#offerCheckbox');
if (_McAfee.size() && $('#buttonDownload').size())
{
_McAfee.is(':not([data-done])') && _McAfee.attr('data-done', true)[0].click();
}
else if (_i++ < 5)
{
setTimeout(_fn, 1000);
}
};
setTimeout(_fn, 1000);
}
}
else if (_url_host.match(/inside\.com\.tw/))
{
$('.content, #articles a[rel="bookmark"]').attr('target', '_blank');
}
else if (_url_host.match(/embedupload\.com/))
{
var _m;
if (_m = _url_obj.query.match(/^([a-z0-9]{2,})\=([a-z0-9]+)/i))
{
_uf_open_background($('.categories a').eq(0).attr('href'));
}
}
else if (_url_host.match(/xahka\.com/))
{
if (_url_obj.path.match(/link/))
{
$('#outborder').remove();
var _form = $('form[action="fetch.php"]:first');
var _input = $(':input[name="code"]:first');
_input.parents('table:first').eq(0).nextAll().remove();
_form.attr('onsubmit', '').removeAttr('onsubmit').trigger('submit').find(':submit:first').after('<span style="color: rgba(255, 0, 255, 1); padding: 5px; margin: 0px 10px;">OK</span>');
document.title = _input.val() + ' - xahka.com';
}
}
else if (_url_host.match(/appledaily\.com/))
{
$('#Cover, .splash, .aml_like, div[id^="rectangleAD"], .ads, #door-left_ad_container').hide().remove();
$_options.varmap.body += ', .nm-article-body, #summary, .articulum, body, .lbimg p, .lbimg #caption, .lbimg .cpt, .rel_img_des';
$('#sitesidecontent section a').attr('target', '_blank');
var _main = $('#maincontent');
if (_main.size())
{
UF_addStyle('.articulum p { line-height: 190%; }');
$('#summary, .articulum > *, .lbimg p, .lbimg #caption, .lbimg .cpt').css('font-size', 'inherit');
var _jac = $('section.jac');
if (_jac.size())
{
_jac.appendTo(_jac.parent());
}
$.scrollTo(_main);
}
}
else if (_url_obj.host.match(/unwire\.hk/))
{
$_options.varmap.body += ', .entry p, .fullentry p, .entry, .fullentry, p';
$_options.varmap.body_clearly_important = '!important';
}
else if (_url_obj.host.match(/cococomic\.com/))
{
var _img = $('#ComicPic');
if (_img.size())
{
GM_addStyle('body { background-color: #000; }');
_img
.imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, null, true);
$.scrollTo(_this);
})
;
$(window)
.on('resize', function(){
_img.triggerHandler('imagesLoaded.done');
})
;
$.scrollTo(_img);
$(window).keydown(function(event){
unsafeWindow.page = $('select[name=select2]').val();
switch(event.which)
{
case 33:
case 37:
_uf_done(event);
//unsafeWindow.prevpage();
unsafeWindow.get_sel(--unsafeWindow.page);
return false;
break;
case 34:
case 39:
_uf_done(event);
//unsafeWindow.nextpage();
unsafeWindow.get_sel(++unsafeWindow.page);
return false;
break;
}
});
}
}
else if (_url_obj.host.match(/dm5\.com/))
{
$_options.varmap.body += ', .vPage .topToolBar .center, .vPage .viewBar .viewTool .right a';
var _img = $('#cp_image2:visible, #cp_image:visible');
$(window).on('load', (function(){
var _a = $('#erroraudit_show #checkAdult');
if (_a.size())
{
_a[0].click();
}
}).debounce(500)).triggerHandler('load');
if (_img.size() || $('#cp_img').size())
{
UF_addStyle([
'body, .bdcolor, .bdblackcolor { background-color: #000; overflow-x: hidden; color: #444; } #cp_funtb, .cp_fun_c3, #showimage #cp_funtb, .bdcolor #showimage, .bdcolor #cp_funtb .cp_tbmore, .lan_bt { background-color: transparent; } #cp_funtb .cp_tbimg, #cp_funtb .cp_tbfu, #cp_funtb .cp_fun_c2 { border: 0px none #000; }',
/*
'.lan_kk2 a:link { color: rgba(6, 92, 116, 0.5); } .lan_kk2 a:visited { color: rgba(6, 92, 116, 0.3) !important; } .lan_kk2 .innr8 { color: rgba(6, 92, 116, 0.3); }',
'a:hover, .lan_kk2 a:hover { color: #f40 !important; }',
'.redzia, .redzia:link, .redzia:visited { color: #C8000A !important; }',
*/
'a:link { color: rgba(7, 81, 154, 0.7); } a:visited { color: rgba(7, 81, 154, 0.3); } a:hover { color: #f40 !important; }',
'#cp_image { filter: contrast(115%); -webkit-filter: contrast(115%); color: #fff; /*background-color: rgba(255, 0, 0, 0.45);*/ }',
'#cp_funtb .cp_tbimg_cw #cp_img, #cp_funtb #cp_img { padding: 0px; }',
//'#cp_funtb .cp_tbimg_cw #cp_img, #cp_funtb #cp_img { width: initial !important; height: initial !important; }',
'#cp_funtb .cp_tbimg { min-height: initial; height: auto; }',
'#cp_funtb { height: 100%; table-layout: fixed; width: 100%; }',
'#cp_img, #cp_funtb .cp_tbimg { height: 100%; }',
'#imgloading { margin-top: auto !important; }',
'#cp_image { border-size: 0px !important; padding: 0px !important; background: transparent !important; border: 0px none #000 !important; }',
'.rightToolBar { opacity: 0.5; }',
]);
var _style_img = $.stylesheet('#cp_image, #cp_image2, #cp_img, .cp_tbimg > div > img');
// var _style_img1 = $.stylesheet('#cp_funtb .cp_tbimg_cw #cp_img');
var _style_img2 = $.stylesheet('#cp_funtb #cp_img, #cp_funtb .cp_tbimg_cw #cp_img');
var _style_img3 = $.stylesheet('#showimage_area, #cp_funtb, #cp_funtb .cp_tbimg');
var _loaded = false;
var _fn_loaded = (function(){
if (0 && !_loaded)
{
setTimeout(function(){
//$(window).trigger('resize');
_area_show
.height($(window).height())
.css('vertical-align', 'middle')
;
}, 0);
}
_loaded = true;
}).debounce(100);
var _timer_setInterval;
var _i_setInterval = 0;
var _fn_setInterval = function(){
var _w;
var _h;
_i_setInterval++;
if (_img_last)
{
// _img
// .attr('width', _img_last[0])
// .width(_img_last[0])
// .attr('height', _img_last[1])
// .height(_img_last[1])
// ;
_w = _img[0].naturalWidth;
_h = _img[0].naturalHeight;
}
// _img[0].crossOrigin = 'anonymous';
if (((1 || _loaded) && _w > 50 && _h > 50) || !_img_last || _i_setInterval > 10)
{
clearInterval(_timer_setInterval);
_img.triggerHandler('imagesLoaded.done');
}
else
{
_page_text
.text($('#c_page').text() + ' / ' + $('#c_page').next('span').text())
;
}
// if (_img_last)
// {
// $(window).triggerHandler('resize.style');
// }
// _uf_log(_i_setInterval, _loaded, _timer_setInterval, _w, _h, _img_last);
};
var _page_text = $('<div/>')
.css({
position: 'absolute',
'background-color': 'rgba(0, 0, 0, 0.5)',
padding: '10px',
color: '#fff',
'z-index': 100,
'min-width': '80px',
'text-align': 'center',
})
.appendTo('body')
;
var _img_last;
var _scrollToWho = $('#cp_funtb, #showimage');
var _i_count = 0;
var _fn = function(){
_img = $(_img.selector);
if (_img.size())
{
if (_img_last)
{
_i_count = 0;
_i_setInterval = 0;
clearInterval(_timer_setInterval);
_fn_setInterval();
_timer_setInterval = setInterval(_fn_setInterval, 100);
}
_img
.each(function(){
var _this = $(this);
//this.crossOrigin = 'anonymous';
_this.attr('data-i-count', ++_i_count);
})
.imagesLoaded((function(event){
var _this = $(this);
// _uf_log(_uf_event_name(event), event, this, arguments);
_uf_fixsize2(_this, null, true, {
width: 'auto',
});
// _this.attr('height', _this.height());
// _uf_log('scrollTo', _scrollToWho);
// $.scrollTo(_this);
$.scrollTo(_scrollToWho);
var _w = this.naturalWidth;
var _h = this.naturalHeight;
//_uf_log(_img, _this, $('#cp_image2'), _img.eq(-1), _this.is(':eq(-1)'), _img.eq(-1).is(_this), _i_count, _this.attr('data-i-count'), _this.attr('id'));
if (_w > 50 && _h > 50 && ($('#cp_image2').size() == 0 || _this.attr('data-i-count') == _i_count || _this.is('#cp_image2') || _img.eq(-1).is(_this)))
{
_img_last = [_this.attr('data-width'), _this.attr('data-height')];
//_uf_log(_img, _this, $('#cp_image2'), _img.eq(-1), _this.is(':eq(-1)'), _img.eq(-1).is(_this), _i_count, _this.attr('data-i-count'), _this.attr('id'), _img_last);
_this
.width(_img_last[0])
.height(_img_last[1])
//.attr('alt', '').attr('title', '')
//.css('background-color', 'transparent')
;
_fn_loaded();
setTimeout(function(){
_page_text
.css({
top: _this.offset().top,
left: Math.max(_this.offset().left - 100, 0),
})
;
}, 200);
$(window).triggerHandler('resize.style');
}
var _alt = $('#c_page, .viewTool .right .arrow_down').eq(0).text().replace(/第\s*(\d+)\s*页/, '$1') + ' / ' + $('#c_page + span, .viewTool .pageBar > a:last').eq(0).text().replace(/第\s*(\d+)\s*页/, '$1');
_page_text
.text(_alt)
;
_this
.attr('alt', _alt)
;
$(window).triggerHandler('load.nocontextmenu');
}).debounce(100))
.on('click', function(){
_uf_trigger_key(window, 39, 'keydown')
})
.on('load.imagesLoaded', function(event){
$(this).triggerHandler('imagesLoaded.done');
})
/*
.on('error', function(event){
$(this)
.attr('alt', 'error').attr('title', 'error')
.css('background-color', 'rgba(255, 0, 0, 0.45)')
;
})
*/
.on('error.imagesLoaded', _fn_loaded)
;
}
else
{
setTimeout(_fn, 50);
}
};
var _fn_dm5 = function(){
if ($('#erroraudit_show #checkAdult').size())
{
var _a = $('#erroraudit_show #checkAdult');
if (_a.size())
{
_a[0].click();
}
}
else if (_url_obj.path.match(/-end\//))
{
var _a = $('.end_mian .end_top .new_h4 a');
if (_a.size())
{
_a[0].click();
}
}
else
{
try{
_loaded = false;
_fn();
// $.scrollTo(_img.push('#cp_img'));
$.scrollTo(_scrollToWho);
var _select = $('#pagelist');
var _option = $('option[value="' + _select.val() + '"]', _select);
if (_option.size())
{
$('option', _select).attr("selected", false).removeAttr("selected");
_option.attr("selected", true);
var _prev = _option.prev('option');
var _next = _option.next('option');
if (!_next.size())
{
_next = _option;
}
if (_next.size())
{
$('#s_next a').attr('href', _next.val());
}
if (_prev.size())
{
$('#s_pre a').attr('href', _prev.val());
}
}
_img
.triggerHandler('imagesLoaded.done')
;
setTimeout(function(){
// _uf_disable_nocontextmenu(2, _img);
_img
// .on('load', _fn_load)
.triggerHandler('imagesLoaded.done')
;
$(window).triggerHandler('load.nocontextmenu');
}, 200);
setTimeout(function(){
// $.scrollTo(_img.push('#cp_img'));
$.scrollTo(_scrollToWho);
$(window).triggerHandler('load.nocontextmenu');
}, 1000);
}catch(e){_uf_log(e)}
}
};
if ($('#itop, a[name="itop"]').size())
{
$('#itop, a[name="itop"]').attr('id', 'itop').add('#ipg, #cuadpg').prependTo($('#showimage'));
}
$('#cp_funtb').attr('align', 'center');
var _area_show = $('<div id="showimage_area"/>');
$('#showimage').wrap(_area_show);
// var _area_show = $('#showimage_area, #cp_funtb, #cp_funtb .cp_tbimg, #cp_img');
var _area_show = $('#showimage_area, #cp_funtb, #cp_funtb .cp_tbimg');
var _area_style = $('<style id="_area_style"/>');
var _style_head = $('body')[0];
$(window)
.on('load.nocontextmenu', (function(event){
_uf_disable_nocontextmenu(2, _img.selector + ', #cp_img, #showimage, #cp_funtb, .cp_tbimg, .view_bt');
if ($('.cp_tbfu:visible').size())
{
$('#cp_fun_sq')[0].click();
}
$('.cp_tbmore').hide();
}).debounce(200))
.on('resize load', function(event){
_img.triggerHandler('imagesLoaded.done');
// _area_show
// .height($(window).height())
// .css('vertical-align', 'middle')
// ;
// $('#cp_img')[0].style.cssText += '; height: ' + $(window).height() + 'px !important;';
/*
_area_show.each(function(){
this.style.cssText += '; height: ' + $(window).height() + 'px !important;';
});
if (!_img_last)
{
_img_last = [_img.width(), $(window).height()];
}
_area_style.remove();
_area_style = $(UF_addStyle([
'#cp_image, #cp_funtb #cp_img, .cp_tbimg, #cp_funtb { height: ' + _img_last[1] + 'px; width: ' + _img_last[0] + 'px; }',
'#cp_funtb #cp_img, .cp_tbimg, #cp_funtb, #cp_funtb .cp_tbimg_cw #cp_img { height: ' + _img_last[1] + 'px !important; width: ' + _img_last[0] + 'px !important; }',
], _style_head)).attr('id', '_area_style');
*/
})
.keydown(function(event){
// _uf_log(_uf_event_name(event), event, event.which, this);
var _jq = unsafeWindow.$ || $;
// _uf_log(event.which, _jq);
var _select = _jq('#pagelist');
var _option = _jq('option[value="' + _select.val() + '"]', _select);
// _uf_log(event.which, _select, _select.val(), _option, _option.val());
// var _who = $(window).add(document).add('body, #showimage, #view_bt');
switch(event.which)
{
case 33:
case 37:
/*
_uf_done(event);
_uf_trigger_key(_who, 90, 'keydown');
_uf_trigger_key(_who, 90, 'keypress');
_uf_trigger_key(_who, 90, 'keyup');
break;
*/
var _a = _option.prev('option');
if (_a.size())
{
if (!_loaded)
{
_uf_done(event);
return;
}
clearInterval(_timer_setInterval);
_loaded = false;
// _uf_log(_select, _select.val(), _option, _option.val(), _a, _a.val());
_uf_done(event);
_jq('option', _select).attr("selected", false);
_a.attr("selected", true);
_select.trigger('change');
break;
}
var _a = $('#s_pre a, a.s_pre');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
/*
_uf_done(event);
_uf_trigger_key(_who, 88, 'keydown');
_uf_trigger_key(_who, 88, 'keypress');
_uf_trigger_key(_who, 88, 'keyup');
break;
*/
var _a = _option.next('option');
if (_a.size())
{
if (!_loaded)
{
_uf_done(event);
return;
}
clearInterval(_timer_setInterval);
_loaded = false;
// _uf_log(_select, _select.val(), _option, _option.val(), _a, _a.val());
_uf_done(event);
_jq('option', _select).attr("selected", false);
_a.attr("selected", true);
_select.trigger('change');
break;
}
var _a = $('#s_next a, a.s_next');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
/*
.on('resize load statechange keyup', (function(event){
_area_show
.height($(window).height())
.css('vertical-align', 'middle')
;
}).debounce(100))
*/
.on('load statechange keyup', function(event){
$(window).triggerHandler('resize.style');
})
.on('resize.style', (function(event){
var _h = $(window).height();
if (_img_last)
{
_style_img
.css({
'width': _img_last[0] + 'px',
'height': _img_last[1] + 'px',
'max-width': _img_last[0] + 'px',
'max-height': _img_last[1] + 'px',
})
;
_style_img2
.css({
'width': _img_last[0] + 'px !important',
'height': _img_last[1] + 'px !important',
'max-width': _img_last[0] + 'px !important',
'max-height': _img_last[1] + 'px !important',
})
;
}
_style_img3
.css({
'height': _h + 'px !important',
'vertical-align': 'middle !important',
})
;
$('#showimage')
.css({
'min-height': 'auto',
'margin-top': '0px',
'padding': '0px',
'border-size': '0px',
})
;
_img
.css({
'padding': '0px',
'border': '0px none #000',
'background': 'transparent',
})
;
}).debounce(100))
.one('load.one', (function(event){
var _t = $();
_t = _t.push(_scrollToWho);
_t = _t.push(_img);
//_uf_log(_t);
$.scrollTo(_t);
}).debounce(150))
;
$(window).triggerHandler('load.nocontextmenu');
$(window)
.on('statechange', _fn_dm5.debounce(300))
;
_fn_dm5();
}
else if ($('#erroraudit_show #checkAdult').size())
{
var _a = $('#erroraudit_show #checkAdult');
if (_a.size())
{
_a[0].click();
}
}
else if (_url_obj.path.match(/-end\//))
{
var _a = $('.end_mian .end_top .new_h4 a, .finalPage .topBar .right a:has(img[src$="finalPage_4.png"]), .finalForm_1 > div:nth-child(1) > span:nth-child(1) > a:nth-child(3)');
if (_a.size())
{
_a[0].click();
}
}
else if (_url_obj.path.match(/search/))
{
$.scrollTo('#search_nr');
}
else
{
var _top = $();
if ($('#search_fy .current').size())
{
if ($('#search_fy .current').text() > 1)
{
_top = _top.push('#index_left .inkk.mato10');
}
}
_top = _top.push('#index_left');
$.scrollTo(_top.eq(0));
if ($('#mhinfo #bt_shownext').size() || $('#mhinfo .fold_open').size())
{
$('#mhinfo .fold_open')
.each(function(){
var _this = $(this);
_this.parent(':first').find(':hidden').show().find('.fold_close').add(_this).remove();
})
;
UF_addStyle([
'.sy_tb { height: auto; min-height: 80px; }',
]);
$('#index_left .inkk.ma5 div.sy_tb .sy_tba2 > a[title]')
.each(function(){
var _this = $(this);
_this.html(_this.attr('title'));
})
;
$('#todaycomic').insertAfter('#tempc');
}
else
{
/*
UF_addStyle([
'.red_lj a:visited { opacity: 0.75; }',
'#index_mian .inkk .innr3 .red_lj a:link { opacity: 1; }',
'#index_mian .inkk .innr3 .red_lj a:visited { opacity: 0.5; }',
'#index_mian .inkk .innr3 .red_lj:hover a:visited, #index_mian .inkk .innr3 .red_lj a:hover { opacity: 1; }',
]);
*/
$.stylesheet('#index_mian .inkk .innr3 .red_lj a:visited', 'opacity', 0.5);
$.stylesheet('#index_mian .inkk .innr3 .red_lj:hover a', 'opacity', 1);
}
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#search_fy a + .current');
if (_a.size())
{
_uf_done(event);
_a.prev('a')[0].click();
}
break;
case 34:
case 39:
var _a = $('#search_fy .current + a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
;
}
_uf_dom_filter_link($('.red_lj a, #cbc_1 a, #cbc_2 a, #cbc_3 a, #abc_1 a, #abc_2 a, #index_mian .diline a, .innr22 a, .innr72 a, #tempc a.tg, .end_kk a, #search_nr .ssnr_bt a, #search_nr .matoa a, #index_left .inkk.ma5 div.sy_tb a, #todaycomic a, #index_right .inkk .innr8 li a, #search_nrl .ssnr_yt dl a, #index_mian .innr3 a')).not('.li_end a').attr('target', '_blank');
}
else if (_url_obj.host.match(/logsoku\.com/) || _url_obj.host.match(/2ch\.net/))
{
_uf_app_2ch(_url_obj);
}
else if (_url_host.match(/alphapolis\.co\.jp/))
{
_uf_disable_nocontextmenu(1);
if (_url_obj.path.match(/viewManga/))
{
UF_addStyle([
'body { margin-top: 0px; padding-top: 0px; }',
// '.pages .manga_image { text-align: center; }',
// '.pages .manga_image { left: 5%; }',
]);
var _area = $('#book');
var _img = $('.pages .manga_image', _area);
_img
.imagesLoaded(function(event){
var _this = $(this);
// _uf_log(_uf_event_name(event), event, this, arguments);
//
// _uf_log(_this, _this.width(), _this.height(), $(window).width(), $(window).height(), _this.attr('src'));
_uf_fixsize2(_this, window);
// _uf_log(_this, _this.width(), _this.height());
})
;
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.turn_pages .next_page_button');
if (_a.size())
{
_uf_done(event);
_a[0].click();
$.scrollTo(_area);
}
break;
case 34:
case 39:
var _a = $('.turn_pages .prev_page_button');
if (_a.size())
{
_uf_done(event);
_a[0].click();
$.scrollTo(_area);
}
break;
}
})
.on('load', function(){
$(window).triggerHandler('resize.area');
})
.on('resize.imagesLoaded', (function(event){
// _uf_log(_uf_event_name(event), event, this, arguments, _img);
_img
.trigger('imagesLoaded.done')
;
}).debounce(200))
.on('resize.area', (function(event){
// _uf_log(_uf_event_name(event), event, this, arguments, _img);
$.scrollTo(_area);
_area.height($(window).height());
var _w = 0;
var _visible = _img.filter(':visible');
if (_visible.size())
{
var _len = _visible.size() > 2 ? 2 : _visible.size();
var _i;
for (_i = 0; _i < _len; _i++)
{
_w += _visible.eq(_i).width();
}
if (_i == 1)
{
_w *= 2;
}
// _w *= 1.15;
_uf_log(_uf_event_name(event), event, _len, _i, _w, $(window).width());
if (_w > $(window).width())
{
_w = $(window).width();
}
_area.width(_w);
}
else
{
}
}).debounce(200))
.triggerHandler('resize.area')
;
}
}
else if (_url_obj.host.match(/sukebei\.nyaa\.se/))
{
UF_addStyle([
'.tlist .tlistname a:link { color: rgba(102, 0, 0, 1); }',
'.tlist .tlistname a:hover { color: rgba(102, 0, 0, 0.6); }',
'.tlist .tlistname a:visited { color: rgba(102, 0, 0, 0.4); }',
]);
$('.tlist .tlistname a')
.each(function(){
var _this = $(this);
var _href = _this.attr('href');
if (!_href.match(/&showfiles=1/))
{
_href += '&showfiles=1';
_this.attr('href', _href);
}
})
;
$('.tlist .tlistname a').attr('target', '_blank');
}
else if (_url_obj.host.match(/comic-walker\.com/))
{
var _img = $('#bookList .list_img img');
if ($.browser && $.browser.mozilla && _img.size())
{
_img
/*
.imagesLoaded(function(event){
var _this = $(this);
_uf_fixsize2(_this, true);
_this.show();
_uf_log(_this, _this.attr('src'));
})
*/
.on('load', function(event){
var _this = $(this);
if (!_this.attr('src').match(/img_loading/))
{
_this.show();
//_this.trigger('imagesLoaded.done');
}
})
;
setTimeout(function(){
_img
.each(function(){
var _this = $(this);
if (_this.attr('src').match(/img_loading/))
{
_this.attr('src', _this.attr('data-original'));
}
_this.show();
})
;
}, 2000);
}
else if ($('#root #renderer').size())
{
var _viewer = $('#renderer');
$(window)
.add('#renderer')
.keydown(function(event){
// _uf_log(_uf_event_name(event), event, event.which, this);
switch(event.which)
{
case 33:
//case 37:
_uf_done(event);
_uf_trigger_key(_viewer, 39, event.type, true);
break;
case 34:
//case 39:
_uf_done(event);
_uf_trigger_key(_viewer, 37, event.type, true);
break;
}
})
;
}
_uf_dom_filter_link($('#bookList .list_hoverBox a')).attr('target', '_blank');
}
else if (_url_obj.host.match(/playpcesor\.com/))
{
$_options.varmap.body += ', .post-body, body';
}
else if (_url_obj.host.match(/w3cplus\.com/))
{
$_options.varmap.body += ', .node p';
_uf_dom_filter_link($('h1[property="dc:title"] a, a.node_read_more, .body-content a')).attr('target', '_blank');
}
else if (_url_obj.host.match(/77mh\.com/))
{
$_options.varmap.body += ', body, #main, .ar_list_coc li, .msg';
if ($('#dracg, #comicImg').size())
{
UF_addStyle([
'body { background: #000; }',
'#comicImg img, #dracg, #nav_menu_wap, #hot_commend, #hot_commend h3, ul.hot_rand_iframe { border: 0px solid #000 !important; background-color: transparent; }',
'#bdbottop, #bdad, #bdtopbot, #bdcotopnew { height: auto; }',
'#comicImg img, #dracg { $filter_contrast_1; }',
'#comicImg, #comicImg img, #dracg { vertical-align: middle; }',
]);
$('.page_num:first, .top.page_tip:first').hide();
var _area = $('#comicImg');
var _img = $('#dracg')
.imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this);
$.scrollTo(_area);
})
.on('load', function(){
var _this = $(this);
_this.trigger('imagesLoaded.done');
})
;
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.page_num .prePage');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('.page_num .nextPage');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.on('resize load', function(event){
_img.trigger('imagesLoaded.done');
_area.height($(window).height());
})
;
}
}
else if (_url_obj.host.match(/nobuy01\.com/))
{
$_options.varmap.body += ', body, p, .entry-content, .entry-content span';
$_options.varmap.body_clearly_important = '!important';
$(window)
.on('load ready', function(event){
$('.spu-bg, .spu-box, .fb-social-plugin').hide().remove();
})
.trigger('ready')
;
_uf_dom_filter_link($('h1[property="dc:title"] a, a.node_read_more, .body-content a')).attr('target', '_blank');
}
else if (_url_obj.host.match(/disqus\.com/))
{
$_options.varmap.body += ', body, .discovery-main';
}
else if (_url_obj.host.match(/gamebase\.com\.tw/))
{
$_options.varmap.body += ', body, #forum_topic_list .content';
var _area = $('#forum_topic_list .content');
var _img = $('.content img')
.imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, _area);
})
;
$(window)
.on('load', function(){
if ($('#adult_limit_box').size())
{
unsafeWindow.adult_remove();
$('#adult_limit_box').remove();
$('#light_box_bg').hide();
}
})
.triggerHandler('load')
;
}
else if (_url_obj.host.match(/ptt\.cc/))
{
$_options.varmap.body += ', body, .bbs-content';
var _form = $('.bbs-content form[action="/ask/over18"]');
if (_form.size())
{
$('.btn-big[name="yes"]', _form).click();
}
}
else if (_url.match(/dmzj\.com/))
{
$_options.varmap.body += ', .content_r .text';
$_options.varmap.body_clearly_important = ' !important';
//_uf_log(999);
if (_url.match(/donghua\.dmzj\.com/))
{
$('#list_content_div')
.on('DOMSubtreeModified, DOMNodeInserted', (function(event){
_uf_dom_filter_link('#list_content_div ul a').attr('target', '_blank');
}).debounce(300))
;
try
{
unsafeWindow.switchDescOpen('on');
}
catch (e)
{}
$(window)
.on('load', function(event){
$('#list_content_div').triggerHandler('DOMNodeInserted');
})
;
_uf_dom_filter_link('.anim_online .anim_online_play_content a').attr('target', '_blank');
}
else if (_url.match(/manhua\.dmzj\.com/))
{
_uf_dom_filter_link('.cartoon_online_border li a').attr('target', '_blank');
var _page_text = $('<div/>')
.css({
position: 'absolute',
'background-color': 'rgba(0, 0, 0, 0.5)',
padding: '10px',
color: '#fff',
'z-index': 100,
'min-width': '80px',
'text-align': 'center',
})
;
var _img = $('#center_box > img:eq(0)');
var _img_func = function()
{
_img = $('#center_box > img:eq(0)');
if (_img.size())
{
$.scrollTo(_img);
_img.imagesLoaded(function() {
var _this = $(this);
$.scrollTo(_img);
_uf_fixsize2(_this, null, true, {
width: 'auto',
});
setTimeout(function(){
_page_text
.css({
top: _this.offset().top,
left: Math.max(_this.offset().left - 100, 0),
})
;
}, 200);
});
}
};
$((function(){
_uf_disable_nocontextmenu(2);
_img = $('#center_box > img:eq(0)');
if (_img.size())
{
UF_addStyle([
'body { background: #34353b; }'
, '.img_land_next, .img_land_prev { width: 25%; }'
, '#center_box img { padding: 0px; border: 0px none #ccc; }'
]);
_page_text
//.text($('.newpagelabel').text())
.appendTo('body')
;
}
_img_func();
(function(_old){
unsafeWindow.imgload_size = function()
{
_old();
_img_func();
};
})(unsafeWindow.imgload_size);
(function(_old){
unsafeWindow.nextChapterMsgBox = function()
{
_old();
if ($('#next_btn').size())
{
$('#next_btn')[0].click();
}
};
})(unsafeWindow.nextChapterMsgBox);
}).debounce(500));
UF_addStyle([
]);
$(window)
.keydown(function(event){
//_uf_log(event);
switch(event.which)
{
case 33:
case 37:
var _a = $('#center_box .img_land_prev, .wrap .pages > a:eq(1)');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('#center_box .img_land_next, .wrap .pages > a:eq(-2)');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.on('resize load', function(event){
//_img = $('#center_box > img:eq(0)');
//_img.triggerHandler('imagesLoaded.done');
_img_func();
});
;
}
}
else if (_url_obj.host.match(/coolaler\.com/))
{
$_options.varmap.body += ', .blogcontent, body';
}
else if (_url_obj.host.match(/jsbeautifier\.org/))
{
$_options.env._no_clearly_button = true;
$(window)
.on('load', function(){
var _area = $('#options')
.each(function(){
var _area = $(this);
var _setting = {
"#tabsize":
{
"name": "tabsize",
"value": "1",
"id": "tabsize"
},
"#max-preserve-newlines":
{
"name": "max-preserve-newlines",
"value": "5",
"id": "max-preserve-newlines"
},
"#wrap-line-length":
{
"name": "wrap-line-length",
"value": "0",
"id": "wrap-line-length"
},
"#brace-style":
{
"name": "brace-style",
"value": "expand",
"id": "brace-style"
},
"#indent-scripts":
{
"name": "indent-scripts",
"value": "normal",
"id": "indent-scripts"
},
"#end-with-newline":
{
"name": "end-with-newline",
"value": "on",
"id": "end-with-newline"
},
"#detect-packers":
{
"name": "detect-packers",
"value": "on",
"id": "detect-packers"
},
"#keep-array-indentation":
{
"name": "keep-array-indentation",
"value": "on",
"id": "keep-array-indentation"
},
"#space-before-conditional":
{
"name": "space-before-conditional",
"value": "on",
"id": "space-before-conditional"
}
};
/*
$(':checkbox, :radio', _area).prop("checked", false);
$(':input', _area)
.each(function(index, elem){
var _input = $(this);
if (_input.is('select'))
{
}
})
;
*/
$(':input', _area)
.each(function(index, elem){
var _input = $(this);
if (_input.attr('name') === undefined)
{
_input.attr('name', _input.attr('id'));
}
})
;
$.each(_setting, function(_id, _val){
var _input = $(_id, _area);
var _type;
if (_input.is('select'))
{
$('option:selected', _input)
.prop('selected', false)
;
$('option[value="' + _val.value + '"]', _input).prop('selected', true);
_input
.val(_val.value)
;
_type = 'select';
}
else if (_input.is(':checkbox, :radio'))
{
_input
.filter(':checked')
.prop('checked', false)
.attr('checked', true)
;
_input
.filter('[value="' + _val.value + '"]')
.prop('checked', true)
;
_type = _input.attr('type');
}
else
{
_input
.val(_val.value)
;
_type = _input.attr('type');
}
// _uf_log(_id, _type, _val, _input);
});
/*
var fields = $(':input', _area).serializeArray();
var _ret2 = {};
$.each(fields, function(idx, value){
var _input = $(':input[name="' + value.name + '"]', _area);
var _id = _input.attr('id');
_ret2['#' + _id] = {
name: _input.attr('name'),
value: value.value,
id: _id,
};
});
_uf_log(fields, _ret2, JSON.stringify(_ret2), _ret2 == _setting, JSON.stringify(_ret2) == JSON.stringify(_setting));
*/
/*
var _ret = {};
$(':input', _area)
.each(function(index, elem){
var _input = $(this);
var _id = _input.attr('id');
if (_input.attr('name') === undefined)
{
_input.attr('name', _id);
}
_ret['#' + _id] = {
name: _input.attr('name'),
value: _input.val(),
id: _id,
index: index,
};
})
;
_uf_log($(':input', _area), _ret, JSON.stringify(_ret));
var fields = $(':input', _area).serializeArray();
_uf_log(fields, JSON.stringify(fields));
var _ret2 = {};
$.each(fields, function(idx, value){
var _input = $(':input[name="' + value.name + '"]', _area);
var _id = _input.attr('id');
_ret2['#' + _id] = {
name: _input.attr('name'),
value: value.value,
id: _id,
};
});
_uf_log(_ret2, JSON.stringify(_ret2));
*/
})
;
})
.triggerHandler('load')
;
}
else if (_url_obj.host.match(/youku\.com/))
{
UF_addStyle([
'#playshow_mask { opacity: 0.97; }',
]);
}
else if (_url_obj.host.match(/briian\.com/))
{
$_options.varmap.body += ', body, #content, #content input, #content textarea, #comments .comment-body, blockquote';
}
else if (_url_obj.host.match(/teepr\.com/))
{
$_options.varmap.body += ', body, .post-single-content p, .widget ul li, .post-single-content';
$_options.varmap.body_clearly_important = '!important';
$_options.varmap.body_head = $('style, link[rel="stylesheet"], link[type="text/css"]').eq(-1).parents('body:first, head:first').eq(-1)[0];
$_options.clearly.dom += ', .topad, #topAdBlock';
$_options.clearly.dom = _uf_trim2($_options.clearly.dom);
UF_addStyle([
$_options.clearly.dom + ' { display: none; }',
], $_options.varmap.body_head);
var _dom = $('#ONEAD-mobile, #ONEAD-mobile-container, #ONEAD-mobile-origin-content, .main-container-wrap, .post-single-content, .single_post, .post-single-content img');
var _fn = (function(event){
_uf_disable_nocontextmenu(2, _dom);
}).debounce(500);
$(window)
.on('load', function(event){
_dom = $(_dom.selector);
})
.on('load scroll', _fn)
;
$('.post-single-content img')
.on('hover', _fn)
;
_fn();
}
else if (_url_obj.host.match(/pan\.baidu\.com/))
{
UF_addStyle([
'.cssTextModulestart{}.module-header{height:49px;background:#252525;border-bottom:0;position:relative;padding:0;box-shadow:0 0 5px #333}.module-header .clearfix:after{content:".";display:block;clear:both;visibility:hidden;font-size:0;height:0;line-height:0}.module-header .clearfix{zoom:1}.module-header a{color:#06c;text-decoration:none}.module-header a:hover,.module-header a:active,.module-header a:focus{color:#06c;text-decoration:underline}.module-header .f-icon{background-image:url("http://yun.baidu.com/ppres/static/thirdparty/header/images/frame-icon.png?t=201501150137");background-repeat:no-repeat}.module-header .no-height{height:0;line-height:0;font-size:0}.module-header .has-pulldown{cursor:pointer;position:relative;*z-index:10000}.module-header .pulldown{position:absolute;z-index:1000;cursor:default;display:none;top:30px;left:0}.module-header .pulldown .arrow{*margin-bottom:-1px;_margin-bottom:0;height:0;width:0;font-size:0;line-height:0;border-width:7px;border-style:solid;border-color:transparent transparent #f6f6f9 transparent;_filter:chroma(color=tomato);_border-color:tomato tomato #f6f6f9 tomato;position:relative;display:block;left:20px;z-index:2}.module-header .pulldown .content{background:#f6f6f9;color:#333;text-align:left;border-radius:3px;border:#afafaf 1px solid;border-width:0 1px 1px 1px;box-shadow:0 2px 4px rgba(0,0,0,.2);position:relative;z-index:1;*top:-2px}.module-header .pulldown-canvas{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;filter:alpha(opacity=0)}.module-header .logo{display:block;height:36px;width:113px;float:left;margin-left:10px;background-position:0 0;margin-top:5px;display:inline;outline:0}.module-header .logo-hao123{height:36px;width:100px;float:left;margin-left:10px;background-position:0 -162px;display:none;margin-right:-10px}.module-header .logo-unicom{height:36px;width:145px;float:left;margin-left:10px;background-position:0 -202px;margin-top:5px;display:none;margin-right:-10px}.module-header .navs-title{font:18px "Microsoft YaHei","Microsoft JhengHei","黑体";color:#d8d8d8;float:left;padding:10px 0 0 17px}.module-header .navs{padding:0 0 3px 25px;height:45px;float:left;width:400px;padding-bottom:0!important}.module-header .info{position:absolute;top:3px;right:0}.capacity-tips{display: none;background: url("http://yun.baidu.com/ppres/static/thirdparty/header/images/icon-capa-tips.png") no-repeat;position:relative;top:15px;*top:17px;right:17px;width:200px;height: 31px;overflow:hidden;zoom:1;}.capa-tips{float: left;margin-left: 17px;margin-top: 5px;height: 24px;line-height: 24px;color:#666666;}.icon-tips{cursor:pointer;float: left;width:15px;height: 10px;margin-left: 28px; margin-top: 13px;background: url("http://yun.baidu.com/ppres/static/thirdparty/header/images/icon-tips-wrong.png") no-repeat;background-position: -6px 0px;}.module-header .info a,.module-header .info a:visited,.module-header .info a:active{color:#d8d8d8}.module-header .navs a:hover,.module-header .navs a:active{text-decoration:none;background-color:#0f0f0f;color:#d8d8d8}.module-header .navs .def-nav,.module-header .navs .pulldown-nav,.module-header .navs .separate{display:block;float:left;height:48px;font:18px "Microsoft YaHei","Microsoft JhengHei","黑体";color:#d8d8d8;text-align:center;width:90px;line-height:48px}.module-header .navs .def-nav-share{position:relative}.module-header .navs .def-nav em.share-icon{position:absolute;height:12px;width:12px;display:block;top:9px;right:15px;background:url("http://yun.baidu.com/ppres/static/thirdparty/header/images/notice.png?t=201501150137") no-repeat}.module-header .navs .def-nav.current em.share-icon{display:none}.module-header .navs .nav-main{width:auto}.module-header .navs .nav-main .pulldown-nav{width:auto;padding:0 27px}.module-header .nav-hover .pulldown-nav{background-color:#f6f6f9!important;color:#333!important}.module-header .nav-hover .pulldown-nav em{background-position:-89px -55px!important}.module-header .nav-hover .pulldown{display:block}.module-header .navs .def-nav .app-url{left:150px;top:48px;width:644px}.module-header .navs .def-nav .pulldown-canvas-url{width:575px;height:109px}.module-header .navs .def-nav .app-url .arrow{left:140px}.module-header .navs .app-url .content{padding:17px 0 0 22px;height:91px}.module-header .navs .app-url .content a,.module-header .navs .app-url .content a:hover{color:#333}.module-header .navs .app-url .li{cursor:pointer;padding-top:8px;width:66px;height:66px;border-radius:3px;display:block;float:left;text-align:center}.module-header .navs .app-url .li:hover{background-color:#e0e1e5}.module-header .navs .app-url .li .icon{margin:0 auto;width:35px;height:38px;display:block;background:url("http://yun.baidu.com/ppres/static/thirdparty/header/images/dropdown_menu.png?t=201501150137") no-repeat}.module-header .navs .app-url .li:hover .icon{background-image:url("http://yun.baidu.com/ppres/static/thirdparty/header/images/dropdown_menu_hover.png?t=201501150137")}.module-header .navs .app-url .tongxunlu .icon{background-position:-35px 0}.module-header .navs .app-url .xiangce .icon{background-position:-70px 0}.module-header .navs .app-url .shoucang .icon{background-position:-105px 0}.module-header .navs .app-url .note .icon{background-position:-140px 0}.module-header .navs .app-url .duanxin .icon{background-position:-175px 0}.module-header .navs .app-url .zhaohui .icon{background-position:-210px 0}.module-header .navs .app-url .xiaodu .icon{background-position:-245px 0}.module-header .navs .app-url .jiankang .icon{background-position:-280px 0}.module-header .navs .app-url .wenzhang .icon{background-position:-315px 0}.module-header .navs .app-url .tonghuajilu .icon{background-position:-350px 0}.module-header .navs .app-url .li .text{height:30px;display:block;font:14px "Microsoft YaHei","Microsoft JhengHei","黑体"}.module-header .navs .separate{margin:0;height:48px;width:2px;background:#2a2b2d}.module-header .navs .pulldown-nav{position:relative}.module-header .navs .pulldown-nav em{position:absolute;display:block;right:9px;top:18px;height:12px;width:12px;font-size:0;background-position:-89px -45px}.module-header .navs .pulldown-nav:hover .f-icon,.module-header .navs .pulldown-nav:active .f-icon{position:absolute;display:block;right:9px;top:18px;height:12px;width:12px;font-size:0;background-position:-89px -55px}.module-header .navs .current,.module-header .navs .current .pulldown-nav{font-weight:bold;color:#FFF;display:inline-block;height:49px;background-color:#0f0f0f;text-align:center;line-height:48px}.module-header .navs .current:hover{color:#ececec}.module-header .info{margin-top:3px;float:right}.module-header .info ul{text-align:right;float:left;height:36px;margin:0;padding:0}.module-header .info a{position:relative}.module-header .info a:hover{color:#d8d8d8;text-decoration:underline}.module-header .info a:hover{color:#FFF}.module-header .info .info-i{padding:0 10px;margin:10px 0;display:inline-block;*display:inline;*zoom:1;height:16px;border-right:#393939 1px solid;color:#d8d8d8;font:12px "SimSun";vertical-align:middle}.module-header .info .has-pulldown{padding-right:28px}.module-header .info .has-pulldown .pull-arrow{position:absolute;display:block;right:10px;top:1px;height:12px;width:12px;font-size:0;background-position:-89px -45px}.module-header .info .no-separate{border:0}.module-header .info .gg-content{display:none}.module-header .gg-content,.module-header .gg-content a,.module-header .gg-content a:hover{color:#e15f00!important}.module-header .info .gg-content a{display:inline-block;height:16px;line-height:16px;background:0 -6px no-repeat;_margin-top:0;background-image:none!important}.module-header .info .search-box{display:none}.module-header .search-form{float:left;height:22px;border:#1a1a1a 1px solid;overflow:hidden;background-color:#FFF;margin-top:-4px;_margin-top:-2px;position:relative}.module-header .search-form .search-query{width:100px;height:20px;margin-right:22px;line-height:20px;float:left;padding-left:4px;border:0;background:0;background:transparent;color:#666;position:relative;z-index:2;outline:0;background-image:url("http://yun.baidu.com/ppres/static/thirdparty/header/images/robin-search-btn.png?t=201501150137");background-position:1000px 1000px;background-repeat:no-repeat}.module-header .search-form input.search-query::-ms-clear,.module-header .search-form input.search-query::-ms-reveal{display:none}.module-header .search-form .search-button{width:61px;height:22px;border:0;cursor:pointer;float:left;background:#ccc url("http://yun.baidu.com/ppres/static/thirdparty/header/images/robin-search-btn.png?t=201501150137")}.module-header .search-form .input-placeholder{position:absolute;top:3px;_top:5px;left:4px;color:#999;text-align:left;cursor:text}.module-header .search-form .input-clear{display:none;position:absolute;height:22px;width:22px;line-height:22px;top:0;right:61px;cursor:pointer;background:#fff url("http://yun.baidu.com/ppres/static/thirdparty/header/images/robin-search-clear.png?t=201501150137") no-repeat 0 0}.module-header .search-form .input-clear:hover{background-position:0 -22px}.module-header .info .disk-capacity{width:170px;position:relative;text-align:left}.module-header .info .progress{position:absolute;top:0;right:10px;width:138px;height:16px;border-bottom:#2f2f2f 1px solid}.module-header .info .pro-con{position:relative;width:136px;height:14px;border:#1b1b1b 1px solid;background:#323232}.module-header .info .progress .bar{position:absolute;display:block;top:0;left:0;width:20%;height:14px;background-color:#d4d5d7}.module-header .info .progress .text{position:absolute;top:0;left:0;text-align:right;display:block;width:130px;height:14px;line-height:14px;color:#646464}.module-header .info .user-name{position:relative;padding-left:24px}.module-header .info .user-name .name{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.module-header .info .user-name .identity{position:absolute;top:0;left:3px;height:16px;width:16px;background-position:-89px -88px}.module-header .info .no-vip{padding-left:10px}.module-header .info .no-vip .identity{display:none}.module-header .info .user-name .is-vip{background-position:-89px -68px}.module-header .info .user-info,.module-header .info .more-info{top:9px;left:auto;right:-24px;width:116px}.module-header .info .notice-nu{display:inline-block;padding-left:4px;background-position:-86px -109px;background-position:-86px -112px\0;height:14px;height:16px\0;-webkit-text-size-adjust:none;font-size:10px;font-style:normal}@-moz-document url-prefix(){.module-header .info .notice-nu{background-position:-86px -111px}}.module-header .info .notice-nu .f-icon{display:inline-block;padding-right:4px;background-position:right -109px;background-position:right -112px\0;color:#FFF}@-moz-document url-prefix(){.module-header .info .notice-nu .f-icon{background-position:-104px -111px}}.module-header .info .pulldown-canvas-user{width:116px;height:243px}.module-header .info .user-info .arrow{left:70px;*left:-32px}.module-header .info .user-info .content,.module-header .info .more-info .content{padding:10px 0;height:146px}.module-header .info .more{padding:0;display:inline;line-height:inherit;background:0}.module-header .info .more-info .content{height:250px}.module-header .info .pulldown-canvas-more{width:116px;height:285px}.module-header .info .user-info .content a,.module-header .info .more-info .content a{display:block;padding-left:33px;height:30px;line-height:30px;color:#888}.module-header .info .user-info .content a:hover,.module-header .info .more-info .content a:hover{color:#333;text-decoration:none;background:#e0e1e5}.module-header .info .user-info .li,.module-header .info .more-info .li{display:block;padding:2px 0;height:30px}.module-header .info .user-info .separate-li,.module-header .info .more-info .separate-li{display:block;margin:3px 11px;border-top:#ebebec 1px solid;border-bottom:#FFF 1px solid}.module-header .info .more-info{right:0}.module-header .info .more-info .arrow{left:94px;*left:-8px}.module-header .noticelist{background:#fff1c3;color:#000;text-align:left;border-radius:3px;border:#dbaf3e 1px solid;border-width:0 1px 1px 1px;box-shadow:0 2px 4px rgba(0,0,0,.2);position:relative;z-index:1;top:34px;right:132px;width:170px;padding-top:12px;padding-bottom:10px}.module-header .noticelist a{display:block;height:26px;font-size:13px;line-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-top:1px dashed #eadba9;margin-left:15px;margin-right:15px}.module-header .noticelist a:first-child{border-top:0}.module-header .noticelist .firstchildclass{border-top:0}.module-header .noticelist .close{margin-left:148px;*margin-left:140px;font-weight:bold;color:#ab831b;font-style:normal;font-size:15px;position:absolute;top:5px}.module-header .noticelist .close:hover{color:#dbaf3e;cursor:pointer}.module-header .noticelist span{color:#0063cf;font-weight:bold}.module-header .info .noticelist a,.module-header .info .noticelist a:hover,.module-header .info .noticelist a:active{color:#000;text-decoration:none;cursor:pointer}.module-header .info .more-info .noticeinfo{right:77px}.module-header .info .show-item{display:inline-block;*display:inline}.cssTextModuleend{}',
]);
if (_url_obj.path.match(/\/disk\/home/))
{
UF_addStyle([
'.list-view-home .item[data-category="1"] .name-text { color: rgba(0, 21, 255, 0.8); }',
'.list-view-home .item[data-category="1"]:hover .name-text { color: rgba(0, 21, 255, 1); }',
'.list-view-home .item[data-category="7"] .name-text { color: rgba(23, 135, 44, 0.8) }',
'.list-view-home .item[data-category="7"]:hover .name-text { color: rgba(23, 135, 44, 1) }',
'.list-view-home .item[data-category="2"] .name-text { color: rgba(135, 69, 182, 0.8); }',
'.list-view-home .item[data-category="2"]:hover .name-text { color: rgba(135, 69, 182, 1); }',
//'._uf_btn { display: inline-block; height: 28px; vertical-align: middle; position: relative; padding: 0px 0px 0px 36px; margin: 0px 0px 0px 5px; cursor: pointer; }',
//'._uf_btn .text { display: inline-block; height: 28px; line-height: 26px; font-weight: 100; color: #666; padding: 0px 25px 0px 0px; vertical-align: top; }',
]);
var _fn_refresh = (function(){
var _a = $('body > .dialog-panel.alert-dialog .footer .alert-dialog-commands .a.okay');
if (_a.size() && !_a.is('[data-done]'))
{
_a.attr('data-done', true);
_a.one('click.offline', _fn_refresh);
}
if (_a.size() || $('#toast, #downloadVerify').is(':visible'))
{
_fn_refresh();
}
else
{
history.refresh();
}
}).debounce(2500);
$('body').on('click.offline', '> .b-dialog.offlinebtlist-dialog .dlg-ft .alert-dialog-commands a.okay', function(event){
/*
var _this = $(this);
// _uf_log(_uf_event_name(event), event, _this);
setTimeout(function(){
var _a = $('body > .dialog-panel.alert-dialog .footer .alert-dialog-commands .a.okay');
// _uf_log(_uf_event_name(event), event, _this, _a);
if (_a.size())
{
_a.one('click.offline', _fn_refresh);
}
else
{
_fn_refresh();
}
}, 2500);
*/
_fn_refresh();
});
$('#yao-main .module-toolbar .bar').eq(0).append(function(){
var _html = $('<span class="icon-btn-device _uf_btn" href="javascript:void(0);" onclick="javascript:history.refresh();"/>');
_html
.append('<span class="ico"></span><span class="text">Refresh</span>')
;
return _html;
});
}
}
else if (_url_obj.host.match(/sfacg\.com/))
{
if (_url_obj.host.match(/book\.sfacg\.com/))
{
$_options.varmap.body += ', body, #ChapterBody, .List_Crumbs';
$_options.style.fontSize = '9pt';
UF_addStyle([
'.uf_wrap_body { background-color: #2A2A2A; }',
'#ChapterBody { font-family: inherit; display: block; }',
'.uf_p p { text-indent: 2em; line-height: 1.6em; }',
'.uf_img { position: absolute; }',
'._uf_chapter_body { max-width: 25em; margin: 0 auto; }',
'.clearfix:after, #ChapterBody .uf_p:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }',
'.clearfix { display: inline-block; }',
'html[xmlns] .clearfix { display: block; }',
'* html .clearfix { height: 1%; }',
]);
$('body > .wrap').wrap('<div class="uf_wrap_body"/>');
$('.uf_wrap_body').append('<div class="clearfix"/>');
$('#ChapterBody')
.css({
'font-size': _uf_var('style.fontSize'),
'font-family': 'inherit',
'line-height': '1.6em',
})
.wrapInner('<div class="_uf_chapter_body"/>')
;
$('._uf_chapter_body')
.html(function(index, old){
return '<p>' + old + '</p>';
})
.each(function(){
var _chapter_body = $(this);
var _area = [$('#ChapterBody').width(), $(window).height()];
var _left = $('#ChapterBody').position().left;
$('img', _chapter_body)
.imagesLoaded(function(event){
var _img = $(this);
_uf_fixsize2(_img, _area);
_img.parent()
.height(_img.height())
;
_img
.addClass('uf_img')
.css({
left: _left,
})
;
})
;
$('> p', _chapter_body)
.wrap('<div class="uf_p"/>')
;
$('> br', _chapter_body)
.wrap('<div class="uf_p"/>')
.remove()
;
$('> .uf_p', _chapter_body)
.html(function(index, old){
return old.replace(/\<br\>(?:\<\/br\>)?/gmi, '</p><p>') + '</p>';
})
;
});
$.scrollTo('#ReadBg');
}
else if (_url_obj.host.match(/comic\.sfacg\.com/))
{
$_options.varmap.body += ', .Reduction_left, .page_turning select, .page_turning, a.redfont_input, .sf_input, .grayfont, a.page_fleet';
var _img = $('#curPic');
if (_img.size())
{
UF_addStyle([
'body { background: #000; }',
'.Reduction_top { position: relative; z-index: 100; }',
'body > .wrap { padding-top: 0 !important; }',
'.AD_D7 { position: absolute; }',
'.AD_D7 > * { display: none; }',
'.AD_D7 .IDC_button { position: absolute; display: none; background: rgba(255, 255, 255, 0.5); }',
'.AD_D7 .IDC_button:hover, .AD_D7:hover .IDC_button { display: block; }',
'body > .wrap + table, body > .wrap + table td, ._uf_area_table, ._uf_area_table td { margin: 0px auto !important; padding: 0 !important; border: 0px none #000; background: transparent; }',
'#curPic { margin: auto; padding: 0; border: 0px none #000; background: transparent; }',
'._uf_area_wrap { width: 100%; z-index: 5000; background: #000; }',
]);
var _area = _img.parents('table:first');
_area
.addClass('_uf_area_table')
.wrap('<div class="_uf_area_wrap"/>')
;
var _area_wrap = $('._uf_area_wrap');
var _page_text = $('<div/>')
.css({
position: 'absolute',
'background-color': 'rgba(0, 0, 0, 0.5)',
padding: '10px',
color: '#fff',
'z-index': 5100,
'min-width': '80px',
'text-align': 'center',
})
.appendTo('body')
;
var _page, _page_max;
var _window = $(window);
_img
.imagesLoaded(function(event){
var _this = $(this);
_uf_fixsize2(_this, null, true, {
width: 'auto',
});
_window.triggerHandler('load.ready');
})
;
var _jq = unsafeWindow.$ || $;
var _top = _area.offset().top;
var _scroll = function()
{
_jq('html, body').stop(true, false);
$('html, body').stop(true, false);
$.scrollTo(_top || _area);
};
$.each(['PrePage', 'NextPage', 'GoSelPage', 'reload'], function(i, v){
var _fn = unsafeWindow[v];
unsafeWindow[v] = function()
{
if (v == 'NextPage' && _page_max == _page)
{
return unsafeWindow.NextVolume();
}
else if (v == 'PrePage' && 1 == _page)
{
return unsafeWindow.PreVolume();
}
else if (v == 'reload')
{
_area_wrap
.css({
'position': 'fixed',
'left': 0,
'top': 0,
'padding-top': _area.offset().top,
})
;
}
var _ret = _fn.apply(this, arguments);
_scroll();
if (v == 'reload')
{
setTimeout(function(){
_area_wrap.css({
'position': '',
'padding-top': 0,
});
_scroll();
}, 0);
setTimeout(function(){
_window.triggerHandler('load.ready');
}, 200);
}
return _ret;
};
});
//_page_max = $('#TotalPage').text();
_page_max = $('#pageSel option:eq(-1)').val();
// _uf_log(object);
_window
.on('resize', function(event){
_img.trigger('imagesLoaded.done');
})
.on('load.ready', function(event){
//curIndex
_jq = unsafeWindow.$ || $;
document.onkeydown = function(){};
unsafeWindow.document.onkeydown = function(){};
_area.height(_window.height());
_page = $('#CurrentPage').text();
_page_text
.css({
top: _area.offset().top,
left: Math.max(_img.offset().left - 100, 0),
})
.text(_page + ' / ' + _page_max)
;
_scroll();
})
.one('load.ready', function(event){
$('#AD_j3')
.each(function(){
var _this = $(this);
_this
.css({
position: 'absolute',
top: _this.position().top,
left: _this.position().left,
})
;
})
;
})
.keydown(function(event){
/*
var _jq = unsafeWindow.$ || $;
var _select = _jq('#pagelist');
var _option = _jq('option[value="' + _select.val() + '"]', _select);
*/
switch(event.which)
{
case 81: // Q
case 33:
case 37:
_uf_done(event);
unsafeWindow.PrePage();
break;
var _a = $('#s_pre a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 65: // A
case 34:
case 39:
_uf_done(event);
unsafeWindow.NextPage();
break;
var _a = $('#s_next a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.triggerHandler('load.ready')
;
}
else if ($('.comic_cover[width="420"]').size())
{
var _space10px = $('body > .space10px');
var _table = _space10px.eq(3);
_space10px.eq(2).insertAfter(_table);
$('td:has(> script[src^="/AD/B/B"])').hide();
$.scrollTo($('.comic_cover:eq(0)').parents('body > table'));
}
_uf_dom_filter_link('a.Blue_link1, .Comic_Pic_List a').attr('target', '_blank');
}
}
else if (_url_obj.host.match(/lightnovel\.cn/))
{
if (_url_obj.host.match(/lknovel\.lightnovel\.cn/))
{
$_options.varmap.body += ', .lk-view-line, body, .lk-g-footer';
$_options.style.fontSize = '9pt';
// $_options.style.fontFamily = _uf_var('style.fontFamily_cn2');
$_options.varmap.body_head = $('style, link[rel="stylesheet"], link[type="text/css"]').eq(-1).parents('body:first, head:first').eq(-1)[0];
UF_addStyle([
'.lk-view-line, .lk-book-detail, .row-fluid > .span10 > p, .span12 > .fn-left > .ft-12 { font-family: tahoma,arial,宋体 !important; }',
]);
$(window)
.on('load.adblock', function(event){
$('body > div:has(> div > h1:contains(AdBlock))').remove();
})
.on('load', function(event){
if (!$(window).scrollTop())
{
$.scrollTo('#J_nav, .container > .row-fluid > .span12');
}
})
.triggerHandler('load')
;
}
}
else if (_url_obj.host.match(/chuixue\.com/))
{
_uf_dom_filter_link('.updateList a.video, .dmList a, .cmd_list a').attr('target', '_blank');
}
else if (_url_obj.host.match(/kickass\.so/))
{
UF_addStyle([
'a.cellMainLink:link { color: rgba(117, 117, 117, 1); }',
'a.cellMainLink:visited { color: rgba(117, 117, 117, 0.5); }',
]);
$(window)
.on('load', function(event){
_uf_dom_filter_link('#mainSearchTable .data .torrentname .markeredBlock a').attr('target', '_blank');
})
.triggerHandler('load')
;
}
else if (_url_obj.host.match(/disp\.cc/))
{
$_options.varmap.body += ', body';
}
else if (_url_obj.host.match(/seemh\.com/))
{
$_options.varmap.body += ', .update-cont li p, .search .keyword, .shortcuts, .cover-list li p, .idx-mc-cont p, .shadow, .shadow p, .book-list li p, .book-intro, .crumb, .chapter-list li a';
$_options.style.fontSize = '12px';
UF_addStyle([
'div[class^="gg_"], .top_banner { display: none; }',
'.bar-tab, .bar-title h2, .bar-title h3, .bar-title h4, .bar-title h5, .bar-title h6, .bar-tab li { font-size: 10pt; }',
]);
var _window = $(window);
$('div[class^="gg_"], .top_banner, div[class^="mt"]:has(> script)').height('auto');
if ($('#mangaBox').size())
{
UF_addStyle([
'.header { margin-bottom: 0; }',
'body > .pr, body > .w980 { background: #000; margin: 0px auto; padding: 0px; }',
'.tbCenter, #tbBox, .tbCenter td, #mangaBox, #mangaFile { border: 0px none #000; background: transparent; margin: auto; padding: 0px; vertical-align: middle; }',
'#mangaBox #mangaFile { $filter_contrast_1; }',
]);
var _img = $('#mangaBox #mangaFile');
//var _area = $('#mangaBox');
var _area = $('#tbBox');
var _page_text = $('<div/>')
.css({
position: 'absolute',
'background-color': 'rgba(0, 0, 0, 0.5)',
padding: '10px',
color: '#fff',
'z-index': 5100,
'min-width': '80px',
'text-align': 'center',
})
.appendTo('body')
;
$('div[class^="gg_"], .top_banner').hide();
_img
.imagesLoaded(function(event){
var _this = $(this);
_uf_fixsize2(_this, null, true, {
width: 'auto',
});
$.scrollTo(_area);
_page_text
.css({
top: $('#mangaBox').offset().top,
left: Math.max(_img.offset().left - 100, 0, $('#mangaBox').offset().left - 100),
})
.text($('#page').text() + ' / ' + $('#pageSelect option:eq(-1)').val())
;
})
.on('load.init error', function(event){
var _dom = '#tbBox, #mangaBox, .tbCenter';
try
{
_uf_disable_nocontextmenu(2, _dom);
unsafeWindow.$(_dom).off('click');
}
catch(e)
{
_uf_log(e);
}
$.scrollTo(_area);
})
.click(function(event){
_uf_trigger_key(_window, 39, 'keydown');
})
;
_window
.one('load', function(event){
_img = $(_img.selector);
$('body > .w980:eq(0)').appendTo('body > .pr:eq(0)');
_img.triggerHandler('load.init');
})
.on('load resize', function(event){
_area.height(_window.height());
_img.triggerHandler('imagesLoaded.done');
})
.keydown(function(event){
switch(event.which)
{
case 81: // Q
case 33:
case 37:
var _a = $('#prev');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 65: // A
case 34:
case 39:
var _a = $('#next');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.triggerHandler('load')
;
}
else
{
var _area = $('body > .pr');
_window
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.pager-cont .pager .current').prevAll('a.prev:eq(0)');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('.pager-cont .pager .current ~ a.prev:eq(0)');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
;
if ($('#chapters', _area).size())
{
$('.book-similar', _area).appendTo($('#chapters + .chapter', _area));
$('#intro-cut, #intro-act').remove();
$('#intro-all').removeClass('none').show();
$('#intro-all [style]').css('font-size', '');
}
$.scrollTo('body > .pr .book-sort, body > .pr .book-cont.cf:has(.book-cover)');
}
_uf_dom_filter_link('a.bcover, #updateWrap a, .cover-list li a, .reminder-cont a, a[href^="/comic/"], a[href^="/author/"]').attr('target', '_blank');
}
else if (_url_obj.host.match(/pcstore\.com\.tw/))
{
_uf_dom_filter_link('#mainContent1 #keyad-pro-right3 .pic1 a, #mainContent1 #keyad-pro-right3 .pic2t a').attr('target', '_blank');
}
else if (_url_obj.host.match(/rarlab\.com/))
{
$_options.varmap.body += ', body';
$_options.varmap.body_head = $('body')[0];
}
else if (_url_obj.host.match(/fc2\.com/))
{
if (_url_obj.host.match(/\.blog(\d+)?\.fc2\.com/))
{
$_options.varmap.body_rem += ', #container, div.entry_body dl, .entry-body, .entry_body, .ently_body';
UF_addStyle([
'._uf_img { opacity: 1; }',
'._uf_img:hover { opacity: 0.8; }',
]);
var _entry_body = $('.entry-body, .entry_body, .ently_body, #main > .content:eq(0), #main > .contents:eq(0), .contents_body')
.each(function(){
var _area = $(this);
$('img', _area)
.imagesLoaded(function(){
var _this = $(this);
_uf_fixsize2(_this, [200]);
})
.each(function(){
var _this = $(this);
var _a = _this.parent();
if (!_a.is('a'))
{
_this.wrap(function(){
var _a = $('<a/>');
_a.attr('href', _this.attr('src'));
return _a;
});
}
else
{
_this.attr('src', function(i, v){
var _href = _a.attr('href');
if (_href.match(/\.(png|jpe?g|bmp|gif)$/) && _href != v)
{
_this.attr('lowsrc', v);
return _href;
}
});
}
_this.addClass('_uf_img');
})
;
//_uf_dom_filter_link('a', _area).attr('target', '_blank');
})
;
$.scrollTo('.container .wrapper');
if (_entry_body.size())
{
$.scrollTo(_entry_body);
}
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#navi .previous:eq(-1) a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('#navi .next:eq(0) a');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
;
_uf_dom_filter_link('a', '.plugin-tag, .side-tag, #blog-box, #main, .main_body, #center-left, .ently_body, .ently_title, .ently_text').add('a[href*="blog-entry"]').attr('target', '_blank');
}
}
else if (_url_obj.host.match(/mozilla\.org/))
{
if (_url_obj.host.match(/addons\.mozilla\.org/))
{
$(window)
.on('load statechange', (function(event){
_uf_dom_filter_link('.listing .items .item .info h3 a').attr('target', '_blank');
}).debounce(500))
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#pjax-results .paginator .rel a.button.prev');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('#pjax-results .paginator .rel a.button.next');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.triggerHandler('load')
;
}
}
else if (_url_obj.host.match(/developers\.google\.com/))
{
$_options.varmap.body += ', body.docs, .docs .memitem table';
}
else if (_url_obj.host.match(/verycd\.com/))
{
$_options.varmap.body += ', #contents_more, #contents_more .p';
$_options.varmap.body_clearly_important = '!important';
$(window)
.on('load', function(event){
$.scrollTo('.mainDiv .leftDiv');
_uf_dom_filter_link('.entry_cover_list a').attr('target', '_blank');
$('#iptcomED2K div:eq(0)')
.html(function(){
var _a = $('<a/>');
_a
.css({
width: '100%',
height: '100%',
display: 'block',
})
.text('Download')
.attr('target', '_blank')
.attr('href', 'http://verycd.gdajie.com/' + _url_obj.path)
;
return _a;
})
.css({
border: '1px solid #BD2DE1',
background: 'none repeat scroll 0% 0% rgba(189, 45, 225, 0.7)',
color: '#fff',
})
;
})
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('ul.page a.next[rel="prev"]');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('ul.page a.next[rel="next"]');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.triggerHandler('load')
;
}
else if (_url_obj.host.match(/verycd\.gdajie\.com/))
{
_uf_dom_filter_link('#emuleFile a').attr('target', '_blank');
}
else if (_url_obj.host.match(/greasyfork\.org/))
{
$_options.varmap.body_rem += ', .script-list h2, .list-option-groups';
UF_addStyle([
'.script-list article dl { opacity: 0.5; }',
'.script-list article a:link { color: blue; }',
'.script-list article a:visited { opacity: 0.5; }',
]);
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.pagination a.previous_page');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('.pagination a.next_page');
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
;
_uf_dom_filter_link('article a').attr('target', '_blank');
}
else if (_url_obj.host.match(/ruanyifeng\.com/))
{
$_options.varmap.body += ', html, body';
$_options.varmap.body_rem += ', blockquote, li, p, code, pre, dd, div, dl, dt, form, h1, h2, h3, h4, h5, h6, li, ol, p, pre, td, th, ul';
}
else if (_url_obj.host.match(/dm1080p\.com/))
{
$_options.varmap.body += ', #neirong_box, body, html, .post-content';
UF_addStyle([
'.article-list.idx-list .article-box { width: 49%; height: 150px; overflow: hidden; float: left; }',
'.article-list.idx-list .article-box .article-summary { height: 4.5em; overflow: hidden; } ',
'body { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; }',
]);
$(window)
.on('load', function(){
try
{
$('.fileinfo')
.each(function(){
$('.downSite .linkHidden a', this).attr('download', $('.fileinfo_l > p:eq(0)', this).text() + $('.downSite .linkHidden a', this).attr('href').replace(/^.+(\.[a-z]+)$/, '$1'));
$('.downSite .linkHidden', this).show();
})
;
$('base').attr('target', '');
}
catch(e)
{}
})
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.pages .pgs b').prev('a');
if (_a.size())
{
_uf_done(event);
// _a[0].click();
location.href = _a[0].href;
}
break;
case 34:
case 39:
var _a = $('.pages .pgs b').next('a');
if (_a.size())
{
_uf_done(event);
// _a[0].click();
location.href = _a[0].href;
}
break;
}
})
.triggerHandler('load')
;
$.scrollTo('.neirong, .article-list.idx-list');
}
else if (_url_obj.host.match(/adblockplus\.org/))
{
$_options.varmap.body += ', *';
_uf_dom_filter_link('#content h3 a').attr('target', '_blank');
}
else if (_url_obj.host.match(/mm-cg\.com/))
{
$_options.varmap.body += ', body, font, .cs_mvwidth, .label';
UF_addStyle([
'#menu1Content, #container { background-color: #cccccc; }',
]);
$('h1 a.aRF').attr('href', 'javascript:void(0);');
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.PageBar .page_previous:eq(1) a, #main .aButton_np_S:eq(1)');
if (_a.size())
{
_uf_done(event);
if (_a.is(':input'))
{
_a[0].click();
}
else
{
location.href = _a[0].href;
}
}
break;
case 34:
case 39:
var _a = $('.PageBar .pageback a, #main .aButton_np_S:eq(0)');
if (_a.size())
{
_uf_done(event);
if (_a.is(':input'))
{
_a[0].click();
}
else
{
location.href = _a[0].href;
}
}
break;
}
_uf_log(event.which);
})
;
_uf_dom_filter_link('a.aRF').attr('target', '_blank');
}
else if (_url_obj.host.match(/metabattle\.com/))
{
$_options.varmap.body += ', #bodyContent';
$('#mw-content-text #toc').nextAll('div.clear:eq(0)').appendTo('#mw-content-text #toc');
//_uf_dom_filter_link('#content h3 a').attr('target', '_blank');
}
else if (_url_obj.host.match(/twitch\.tv/))
{
if (_url_obj.path.match(/\/popout/))
{
UF_addStyle([
'body, html, #standard_holder { overflow: hidden; padding: 0px; }',
], $('body')[0]);
}
UF_addStyle([
'a._img_link { margin: auto 0.3em; padding: 0px 0.2em; }',
'._img_link, ._img_link img { vertical-align: baseline; display: inline-block; line-height: 1em; }',
'.action-menu-list a.button:visited, .video.item a.cap, .meta .title a:visited, .action-menu-list:hover a.button:visited, .video.item:hover a.cap, .meta .title:hover a:visited, .items-grid .meta p:hover a:visited, .items-grid:hover .meta p a:visited, .items-grid .meta:hover p a:visited, .items-grid .meta p a:visited, .items-grid a:visited, .manager .videos-grid .video .meta .actions .action-menu-list li a:visited { color: #8C8C8C !important; }',
], $('body')[0]);
$(window)
.on('load', function(){
var area = $('.videos.items, .ember-view, .js-videos')
.on($_options.event.dom, (function(){
var a = _uf_dom_filter_link('.video.item a.cap, .meta .title a')
.not('[data-done]')
.attr('target', '_blank')
.attr('data-done', true)
.on('click', function(e){
var _this = $(this);
_uf_done(e);
_uf_open(_this.attr('href'))
})
.each(function(){
var _this = $(this);
if (_this.parents('.title:first').size())
{
var _img = $('<img src="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%2210%22%3E%3Cg%20transform%3D%22translate%28-826.429%20-698.791%29%22%3E%3Crect%20width%3D%225.982%22%20height%3D%225.982%22%20x%3D%22826.929%22%20y%3D%22702.309%22%20fill%3D%22%23fff%22%20stroke%3D%22%2306c%22%2F%3E%3Cg%3E%3Cpath%20d%3D%22M831.194%20698.791h5.234v5.391l-1.571%201.545-1.31-1.31-2.725%202.725-2.689-2.689%202.808-2.808-1.311-1.311z%22%20fill%3D%22%2306f%22%2F%3E%3Cpath%20d%3D%22M835.424%20699.795l.022%204.885-1.817-1.817-2.881%202.881-1.228-1.228%202.881-2.881-1.851-1.851z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"/>');
_this.after(_img);
var _href = _this.attr('href');
_href = _href.replace(/\/b\/(\d+)/, '/popout?videoId=a$1')
_img
.addClass('_img_link')
.wrap('<a href="' + _href + '" target="_blank" data-done="true" class="_img_link"></a>')
;
}
})
;
_uf_dom_filter_link('.action-menu-list a.button')
.not('[data-done]')
.attr('data-done', true)
.attr('target', '_blank')
.on('click', function(e){
var _this = $(this);
_uf_done(e);
_uf_open(_this.attr('href'))
})
;
}).debounce(500))
;
_uf_dom_filter_link('.action-menu-list a.button').attr('target', '_blank');
_uf_log(_url_obj, a);
})
.triggerHandler('load')
;
}
else if (_url_obj.host.match(/tv543\.org/))
{
$_options.varmap.body += ', body, p, ul, ol, dl, blockquote, table, article, article footer, nav';
UF_addStyle([
'body, #sidebar .widget, .cse .gsc-control-cse, .gsc-control-cse { background-color: #000; }',
'.page-single > p { text-align: initial; }',
'.page-single > p > iframe { text-align: center; }',
], $('body')[0]);
_uf_disable_nocontextmenu(2);
//_uf_dom_filter_link('#content h3 a').attr('target', '_blank');
}
else if (_url_obj.host.match(/u2mtv\.com/))
{
$_options.varmap.body += ', body, p, ul, ol, dl, blockquote, table, article, article footer, nav';
// UF_addStyle([
// 'body, #sidebar .widget, .cse .gsc-control-cse, .gsc-control-cse { background-color: #000; }',
// '.page-single > p { text-align: initial; }',
// '.page-single > p > iframe { text-align: center; }',
// ], $('body')[0]);
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#HyperLink2');
if (_a.size())
{
_uf_done(event);
_a[0].click();
// location.href = _a[0].href;
}
break;
case 34:
case 39:
var _a = $('#HyperLink3');
if (_a.size())
{
_uf_done(event);
_a[0].click();
// location.href = _a[0].href;
}
break;
}
})
;
_uf_dom_filter_link('a[href^="show.aspx"]').attr('target', '_blank');
}
else if (_url_obj.host.match(/kapai\.com/))
{
if (_url_obj.path.match(/card/))
{
$('.kapai_hot .hot_tb a > img, .kp_detail .kp_detail_l img, .kp_search2 .kp_searchbox .style_cur a[onmouseover]', '.kapai ')
.each(function(){
var _this = $(this);
if (_this.is('a'))
{
this.onmouseover = this.onmouseover.replace(/_\d+_\d+\.png$/, '.png');
}
else
{
_this
.attr('src', function(e, old){
if (old.match(/_\d+_\d+\.png$/))
{
if (_this.height() < 200)
{
_uf_fixsize2(_this);
}
return old.replace(/_\d+_\d+\.png$/, '.png');
}
})
;
}
})
;
}
}
else if (_url_obj.host.match(/bbs\.3dmgame\.com/))
{
$_options.varmap.body += ', #thread_subject, .t_f, font, .xst, .wp font';
var w = $('.t_f:eq(0)').width();
$('.t_f .button + .alt2').find('img').unwrap().css('max-width', w - 50).prev('.button').remove();
var _t_f_bg_color = _true_bg_color($('.t_f:eq(0)'))[0];
var _elem = $('.t_f font[color]');
_elem
.each(function()
{
var _this = $(this);
var _color = $.Color(_this.css('color'));
//var _bg_color = $.Color(_this.css('background-color'));
var _ret = _true_bg_color(_this, '.t_f');
if (_ret[1].is('.t_f'))
{
_ret[0] = _t_f_bg_color;
}
if (_color.is('transparent') || _color.is(_ret[0]))
{
_uf_log(_ret);
_this
.css('color', _ret[0].contrastColor())
//.wrap('<span title="反白內容"/>')
;
}
})
;
function _true_bg_color(_this, _area)
{
var _this = $(_this);
//var _color = $.Color(_this.css('color'));
var _bg_color = $.Color(_this.css('background-color'));
if (_area && _this.is(_area) || _this.is('html'))
{
}
else
{
if (_this.parent().size() && _bg_color.is('transparent'))
{
return _true_bg_color(_this.parent(), _area);
}
}
return [_bg_color, _this];
}
_uf_dom_filter_link('#threadlist .common a.s.xst, #threadlist .new a.s.xst').attr('target', '_blank').removeAttr('onclick');
}
else if (_url_obj.host.match(/3dmgame\.com/))
{
$_options.varmap.body += ', .con div, .con p, .daohang a, #SOHUCS #SOHU_MAIN .module-cmt-list .wrap-issue-gw .issue-wrap-gw, #SOHUCS #SOHU_MAIN a, #SOHUCS #SOHU_MAIN abbr, #SOHUCS #SOHU_MAIN acronym, #SOHUCS #SOHU_MAIN address, #SOHUCS #SOHU_MAIN applet, #SOHUCS #SOHU_MAIN article, #SOHUCS #SOHU_MAIN aside, #SOHUCS #SOHU_MAIN audio, #SOHUCS #SOHU_MAIN b, #SOHUCS #SOHU_MAIN big, #SOHUCS #SOHU_MAIN blockquote, #SOHUCS #SOHU_MAIN canvas, #SOHUCS #SOHU_MAIN caption, #SOHUCS #SOHU_MAIN center, #SOHUCS #SOHU_MAIN cite, #SOHUCS #SOHU_MAIN code, #SOHUCS #SOHU_MAIN dd, #SOHUCS #SOHU_MAIN del, #SOHUCS #SOHU_MAIN details, #SOHUCS #SOHU_MAIN dfn, #SOHUCS #SOHU_MAIN dialog, #SOHUCS #SOHU_MAIN div, #SOHUCS #SOHU_MAIN dl, #SOHUCS #SOHU_MAIN dt, #SOHUCS #SOHU_MAIN em, #SOHUCS #SOHU_MAIN embed, #SOHUCS #SOHU_MAIN fieldset, #SOHUCS #SOHU_MAIN figcaption, #SOHUCS #SOHU_MAIN figure, #SOHUCS #SOHU_MAIN font, #SOHUCS #SOHU_MAIN footer, #SOHUCS #SOHU_MAIN form, #SOHUCS #SOHU_MAIN h1, #SOHUCS #SOHU_MAIN h2, #SOHUCS #SOHU_MAIN h3, #SOHUCS #SOHU_MAIN h4, #SOHUCS #SOHU_MAIN h5, #SOHUCS #SOHU_MAIN h6, #SOHUCS #SOHU_MAIN header, #SOHUCS #SOHU_MAIN hgroup, #SOHUCS #SOHU_MAIN hr, #SOHUCS #SOHU_MAIN i, #SOHUCS #SOHU_MAIN iframe, #SOHUCS #SOHU_MAIN img, #SOHUCS #SOHU_MAIN ins, #SOHUCS #SOHU_MAIN kbd, #SOHUCS #SOHU_MAIN label, #SOHUCS #SOHU_MAIN legend, #SOHUCS #SOHU_MAIN li, #SOHUCS #SOHU_MAIN mark, #SOHUCS #SOHU_MAIN menu, #SOHUCS #SOHU_MAIN meter, #SOHUCS #SOHU_MAIN nav, #SOHUCS #SOHU_MAIN object, #SOHUCS #SOHU_MAIN ol, #SOHUCS #SOHU_MAIN output, #SOHUCS #SOHU_MAIN p, #SOHUCS #SOHU_MAIN pre, #SOHUCS #SOHU_MAIN progress, #SOHUCS #SOHU_MAIN q, #SOHUCS #SOHU_MAIN rp, #SOHUCS #SOHU_MAIN rt, #SOHUCS #SOHU_MAIN ruby, #SOHUCS #SOHU_MAIN s, #SOHUCS #SOHU_MAIN samp, #SOHUCS #SOHU_MAIN section, #SOHUCS #SOHU_MAIN small, #SOHUCS #SOHU_MAIN span, #SOHUCS #SOHU_MAIN strike, #SOHUCS #SOHU_MAIN strong, #SOHUCS #SOHU_MAIN sub, #SOHUCS #SOHU_MAIN summary, #SOHUCS #SOHU_MAIN sup, #SOHUCS #SOHU_MAIN table, #SOHUCS #SOHU_MAIN tbody, #SOHUCS #SOHU_MAIN td, #SOHUCS #SOHU_MAIN tfoot, #SOHUCS #SOHU_MAIN th, #SOHUCS #SOHU_MAIN thead, #SOHUCS #SOHU_MAIN time, #SOHUCS #SOHU_MAIN tr, #SOHUCS #SOHU_MAIN tt, #SOHUCS #SOHU_MAIN u, #SOHUCS #SOHU_MAIN ul, #SOHUCS #SOHU_MAIN var, #SOHUCS #SOHU_MAIN video, #SOHUCS #SOHU_MAIN xmp';
}
else if (_url_obj.host.match(/nexusmods\.com/))
{
$_options.varmap.body += ', #UnderContent, .bb-content';
//var _event = 'DOMSubtreeModified DOMNodeInserted';
var _event = 'DOMNodeInserted';
var _fn2 = (function()
{
var _this = $(this);
var _done = _this.attr('data-done');
if (!_done && !$('.content-loading, img[src*="loading.gif"]', _this).size())
{
_this.attr('data-done', true);
_uf_dom_filter_link('.block-list .popbox a, #main .files-list a, #fcontentarea .bb-content a').attr('target', '_blank');
}
if (!_done)
{
_uf_log($(this), _done, $('.content-loading, img[src*="loading.gif"]', _this).size());
}
}).debounce(500);
var _fn = (function()
{
$('#sb_search .std_txt:input')
.prop('placeholder', function(){
return this.placeholder || this.title;
})
.attr('value', function(){
return (this.value == this.placeholder || this.value == this.title) ? '' : this.value;
})
.removeAttr('title onblur onmousedown onkeydown')
;
_uf_dom_filter_link('.block-list .popbox a, #main .files-list a, .uploader a').attr('target', '_blank');
//$('#srcContainer_files').one(_event, _fn)
}).debounce(1000);
(function(_old)
{
unsafeWindow.$.fn.loadPage = function ()
{
var args = Array.prototype.slice.call(arguments, 0) || [];
var _this = $(this);
_this
.attr('data-done', false)
;
_old.apply(this, args);
_this
.one(_event, _fn2)
;
_fn2();
}
})(unsafeWindow.$.fn.loadPage);
$(window)
.on('statechange', _fn)
.on('load', (function()
{
if ($('#main .file-info-bg:has(.uploader)').size())
{
$('#main .file-info-bg .uploader a:last')
.attr('href', function(idx, attr)
{
return attr + '?tb=mods&pUp=1';
})
;
$('#main .file-info-bg .uploader')
.contents()
.filter(function(){
return this.nodeType == 3;
})
.eq(0)[0].nodeValue = ' by '
;
$('<a/>')
.text($('.file-name .header-name, .file-name-default .header-name').text())
.attr('href', 'http://www.nexusmods.com/skyrim/mods/' + unsafeWindow.ajax_id)
.attr('target', '_blank')
.on('click', function(event)
{
_uf_done(event);
location.href = this.href;
})
.prependTo('#main .file-info-bg .uploader')
;
}
}).debounce(1000))
;
//$('#content').one('load', _fn);
_fn();
}
else if (_url_obj.host.match(/loverslab\.com/))
{
setTimeout(function(){
$('.entry-content > .bbc_spoiler:has(.bbc_img) > .bbc_spoiler_show, .ipsLayout_content > .bbc_spoiler_show').each(function(){
this.click();
});
}, 1000);
_uf_dom_filter_link('.content .ipsType_pagetitle .download_button, .description_content a').attr('target', '_blank');
}
else if (_url_obj.host.match(/skycitizen\.net/))
{
$_options.varmap.body += ', .blog-item-body, .font-13';
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.forum-section .pagination:eq(0) > .btn-round:eq(0)');
if (location.href.match(/view=SECTION/) && _a.size())
{
_uf_done(event);
_a[0].click();
// location.href = _a[0].href;
}
break;
case 34:
case 39:
var _a = $('.forum-section .pagination:eq(0) > .btn-round:last');
if (location.href.match(/view=SECTION/) && _a.size())
{
_uf_done(event);
_a[0].click();
// location.href = _a[0].href;
}
break;
}
})
.on('statechange', (function(){
var _t = $('.forum-section > .page-section:eq(0)').eq(0).offset().top;
if ($('#left-sections').scrollTop() < _t)
{
$('#left-sections').scrollTo(_t);
}
}).debounce(500))
;
}
else if (_url_obj.host.match(/gamersky\.com/))
{
$_options.varmap.body += ', .Mid2L_con';
}
else if (_url_obj.host.match(/weibo\.com/))
{
$_options.varmap.body += ', .W_f14';
var _this = $(this);
var _chk_hover = false;
$(document)
.on('click', '.WB_detail .WB_media_wrap .bigcursor, .WB_expand_media_box .artwork_box, .WB_expand_media_box .artwork_box img, .WB_detail .WB_expand_media_box .artwork_box span', function()
{
var _media_box = $(this).parents('.WB_detail:eq(0)').find('.media_box:eq(0)').eq(0);
if (_media_box.size() && !_media_box.attr('data-chk-hover'))
{
_media_box.attr('data-chk-hover', true);
_media_box
.find('.WB_pic img')
.each(function(){
var _this = $(this);
$(this)
.imagesLoaded(function(){
var _this = $(this);
var _src = _this.attr('src').replace(/\/(thumb\d+|mw\d+)\//, '/large/');
var _p = _this.parent();
_uf_fixsize2(_this, true);
_this
.attr('lowsrc', _this.attr('src'))
.on('load', function(){
var _this = $(this);
_uf_fixsize2(_this, _p, true);
})
.attr('src', _src)
.attr('data-src', _src)
;
})
.wrap($('<a/>')
.attr({
href: _this.attr('src').replace(/\/(thumb\d+|mw\d+)\//, '/large/'),
target: '_blank'
})
.on('click', function(event){
event.preventDefault()
})
)
;
})
}
})
;
}
else if (_url_obj.host.match(/wnacg\.(com|org)/))
{
$_options.varmap.body += ', .uwconn, .uwuinfo div, .grid .info .title';
UF_addStyle([
'.gallary_wrap li.li { height: 258px; }',
'#photo_body { margin: 0px; padding: 0px; }',
'#photo_body .photo { padding: 0px; border: 0px none #ccc; }',
]);
//setTimeout(function(){
/*
_uf_log('wnacg\.com');
$('#bodywrap').on('click', '.pic_box a', function (event)
{
_uf_done(event);
_uf_open_background(this.href);
})
*/
_uf_dom_filter_link('.pic_box a, a.tagshow, .pic_box a').attr('target', '_blank');
//}, 1000);
var _img = $();
if ($('#photo_body').size())
{
UF_addStyle([
'body { background: #34353b; }',
'body, a { color: #DDDDDD; }',
]);
var _page_text = $('<div/>')
.css({
position: 'absolute',
'background-color': 'rgba(0, 0, 0, 0.5)',
padding: '10px',
color: '#fff',
'z-index': 100,
'min-width': '80px',
'text-align': 'center',
})
.text($('.newpagelabel').text())
.appendTo('body')
;
var _alt = $('.png.bread > a:eq(-1)').text() + ' ' + $('#photo_infos h1').text();
_img = $('#photo_body .photo');
$.scrollTo(_img);
_img.imagesLoaded(function() {
var _this = $(this);
$.scrollTo(_img);
_uf_fixsize2(_this, null, true, {
width: 'auto',
});
setTimeout(function(){
_page_text
.css({
top: _this.offset().top,
left: Math.max(_this.offset().left - 100, 0),
})
;
}, 200);
});
_img.attr('alt', _alt);
}
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.bot_toolbar .prev a');
if (_img.size())
{
_a = $('.newpagewrap .newpage > label').prev('a');
}
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
case 39:
var _a = $('.bot_toolbar .next a');
if (_img.size())
{
_a = $('.newpagewrap .newpage > label').next('a');
}
if (_a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
.on('resize load', function(event){
_img.triggerHandler('imagesLoaded.done');
});
;
}
else if (_url_obj.host.match(/manben\.com/))
{
if ($('body.view, div.myview').size() == 2)
{
UF_addStyle([
'body.view { padding: 0px; }',
'body.view .main .indexImg { right: unset !important; left: unset !important; }',
]);
$(window)
.ready((function(event){
$('.v_tip[src*=view_right_tip]', _main).size() && $('.myview > ul > li').each(function(){
var _main = $('.main', this);
if (1)
{
var elem = $('.flipForm .pageItem:eq(0)', _main);
elem.insertAfter(elem.next());
}
});
//unsafeWindow.hideReadTip();
}).debounce(2000))
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
unsafeWindow.pagePrev();
break;
case 34:
case 39:
if ($('#nowPage').text() == $('#sumPage').text())
{
$('.imgFloat_2').parent('a')[0].click();
}
else
{
unsafeWindow.pageNext();
}
break;
}
})
;
}
}
else if (_url_obj.host.match(/forum-\w+\.guildwars2\.com/))
{
_uf_dom_filter_link('.message-content a, .signature-content a, .post-topic-header a, .topic a').attr('target', '_blank');
}
else if (_url_obj.host.match(/nicesoftware\.co/))
{
if (_url_obj.path.match(/search/))
{
UF_addStyle([
'.wrapfullpost { max-height: 600px; overflow: hidden; }',
]);
}
}
else if (_url_obj.host.match(/deviantart\.com/))
{
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
//case 37:
var _a = $('#overhead .minibrowse_prev');
if (location.href.match(/\/art\//) && _a.size())
{
_uf_done(event);
_a[0].click();
}
break;
case 34:
//case 39:
var _a = $('#overhead .minibrowse_next');
if (location.href.match(/\/art\//) && _a.size())
{
_uf_done(event);
_a[0].click();
}
break;
}
})
}
else if (_url_obj.host.match(/k73\.com/))
{
$_options.varmap.body += ', .content div.main_text, #commetcontent .decmt-box2 .pltext, .submenu a';
}
else if (_url_obj.host.match(/avtube\.tv/))
{
if (_url_obj.path.match(/18yesno\.php/))
{
window.location.href = _url.replace('18yesno.php', 'video.php');
}
}
else if (_url_obj.host.match(/dayanzai\.me/))
{
$_options.varmap.body += ', .soft-content, .spos .gaishu, .spos .c-item .other, .position, body, #SOHUCS #SOHU_MAIN .module-cmt-list .wrap-issue-gw .issue-wrap-gw';
}
else if (_url_obj.host.match(/hk01\.com/))
{
$_options.varmap.body += ', p, h2, :-moz-any(article, aside, nav, section) h1, .article, .article_wrapper, .article_tag, .channel_tit, .article .article_wrapper .article__body .article__body__header .article_tag .tag_txt, .tag_txt, .article_info, .article .article_wrapper .article__body .article__body__content .module_fullimg';
$_options.varmap.body += ', html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, img, ins, kbd, q, s, samp, small, strike, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, caption, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video';
}
else if (_url_obj.host.match(/andygod\.com/))
{
_uf_dom_filter_link('.main-content .item a').attr('target', '_blank');
}
else if (_url_obj.host.match(/ikanman\.com/))
{
$_options.varmap.body += ', .sub-btn, .pager a, .pager span, a.btn-red, a.btn-blue';
UF_addStyle([
'body { background-color: #000; overflow-x: hidden; color: #444; }',
'.tbCenter { background-color: transparent; }',
'body, #mangaFile, .mangaFile, #mangaBox, #tbBox, .tbCenter, #imgLoading, .img-loading, .sub-btn, table { border-spacing: 0px; border: 0px none transparent; padding: 0; border-collapse: collapse; }',
]);
var _this = _uf_fixsize2(this, window, 1, {
width: 'auto',
});
let _img = $('#mangaFile, .mangaFile')
.imagesLoaded(function()
{
_uf_fixsize2(this);
$.scrollTo(this);
})
.on('load.imagesLoaded', function(event){
$(this).triggerHandler('imagesLoaded.done');
})
;
$('#mangaBox, #tbBox').on('mousedown', function (event)
{
_uf_done(event);
});
$(window)
.on('load.nocontextmenu', (function(event)
{
_uf_disable_nocontextmenu(2, '#mangaBox, #tbBox, #mangaFile');
}).debounce(200))
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#prev');
if (_a.size())
{
_uf_done(event);
_a[0].click();
$(window).triggerHandler('load.imagesLoaded');
setTimeout(function ()
{
$(window).triggerHandler('load.imagesLoaded');
}, 1000);
}
break;
case 34:
case 39:
var _a = $('#next');
if (_a.size())
{
_uf_done(event);
_a[0].click();
$(window).triggerHandler('load.imagesLoaded');
setTimeout(function ()
{
$(window).triggerHandler('resize');
$(window).triggerHandler('load.imagesLoaded');
}, 100);
setTimeout(function ()
{
$(window).triggerHandler('resize');
$(window).triggerHandler('load.imagesLoaded');
}, 500);
setTimeout(function ()
{
$(window).triggerHandler('resize');
$(window).triggerHandler('load.imagesLoaded');
}, 1000);
}
break;
}
})
.on('resize', function(event)
{
_img = $(_img.selector);
_img.triggerHandler('imagesLoaded.done');
_uf_fixsize2(_img);
$.scrollTo(_img);
})
.on('statechange', (function(event)
{
_img = $(_img.selector);
$(window).triggerHandler('resize');
setTimeout(function ()
{
$(window).triggerHandler('resize');
}, 100);
setTimeout(function ()
{
$(window).triggerHandler('resize');
}, 1000);
}).debounce(100))
.on('load.imagesLoaded', (function ()
{
_img = $(_img.selector);
$(window).triggerHandler('resize');
}).debounce(100))
;
}
else if (_url_obj.host.match(/kknews\.cc/))
{
$_options.varmap.body += ', body, .meta, .meta a, .entry .flex-vid, .entry .mh-video-container, .entry blockquote, .entry h1, .entry h2, .entry h3, .entry h4, .entry h5, .entry h6, .entry p, .entry row';
}
else if (_url_obj.host.match(/pcucgame\.com/))
{
$_options.varmap.body += ', #toc_container ul li, .td-post-content li, .td-post-content p, .td-post-content, .td-page-content p, .td-post-content p, .wpb_text_column p, .td_block_text_with_title p, .woocommerce #tab-description p, .mce-content-body p, .td-page-content li, .td-post-content li, .wpb_text_column li, .td_block_text_with_title li, .woocommerce #tab-description li, .mce-content-body li';
$_options.varmap.body_clearly_important = '!important';
}
else if (_url_obj.host.match(/entertainment14\.net/))
{
$_options.varmap.body += ', .entry-content strong, .entry-content, .entry-summary, body, table, .t_f, .t_f td, .single-post, .single-post-content, div#globalWrapper, .mw-body-content, #mw-panel, .metadata small, .ambox small, div#mw-panel div.portal div.body ul li, div#mw-panel div.portal h3, .wikitable small, .infobox small, #toc, .toc, .mw-warning, #bodyContent';
UF_addStyle([
'article, aside, details, figcaption, figure, footer, header, main, menu, nav, section, summary { font-family: $fontFamily; }',
]);
}
else if (_url_obj.host.match(/4399\.com/))
{
$_options.varmap.body += ', .content, .coninfo span';
UF_addStyle([
'body, :root { font-family: $fontFamily; }',
]);
}
/*
else if (_url_obj.host.match(/manben\.com/))
{
$_options.varmap.body += ', .uwconn, .uwuinfo div, .grid .info .title';
}
*/
else
{
function _0_label_dummy(){
/*
UF_addStyle([
//'._uf_hidden_text { color: #FFFFFF; }',
'._uf_hidden_text_show { color: ' + $('.FM-cbox7 .FM-P2').css('color') + '; }',
'._uf_hidden_parent_show { padding-bottom: 0.2rem; padding-top: 0.2rem; border-bottom: 1px dotted #21C9C3; }',
'._uf_hidden_btn { text-align: center; background: none repeat scroll 0% 0% rgba(194, 43, 224, 0.32) !important; color: #FF00CF; padding: 1px 10px !important; margin: auto 1em !important; border: thin solid #FF00CF !important; }',
]);
$_options.varmap.body += '';
_uf_dom_filter_link('.content .ipsType_pagetitle .download_button, .description_content a').attr('target', '_blank');
$.stylesheet('.post-body.entry-content .separator img')
.css({
'max-width': (_content_area.width() * 0.9) + 'px',
})
;
$('#PicNow, #imgArea #viewimg').imagesLoaded(function() {});
$(window)
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('.forum-section .pagination:eq(0) > .btn-round:eq(0)');
if (location.href.match(/view=SECTION/) && _a.size())
{
_uf_done(event);
_a[0].click();
// location.href = _a[0].href;
}
break;
case 34:
case 39:
var _a = $('.forum-section .pagination:eq(0) > .btn-round:last');
if (location.href.match(/view=SECTION/) && _a.size())
{
_uf_done(event);
_a[0].click();
// location.href = _a[0].href;
}
break;
}
})
*/
};
if (0)
{
//
}
else if (_uf_my_is_google_search(_url_obj))
{
$_options.env._no_clearly_button = true;
// _uf_log('_uf_my_is_google_search');
if (_url_obj.path.match(/\/imgres/) || $('#irc_bg').size())
{
// _uf_log('google image');
$('#irc_but_r, #irc_it, .irc_but_r, .irc_it')
.find('a, a > span')
.attr('target', '_blank')
.click(function(event){
// _uf_log(event);
_uf_my_openfix(this);
_uf_done(event);
})
;
if ($('#irc_ifr, .irc_ifr').size())
{
$('#irc_ifr, .irc_ifr').load(function(){
$(this)
.contents()
.on('DOMSubtreeModified, DOMNodeInserted', function(event){
// _uf_log(event);
var _target = $(event.target);
if (_target.is('img#irc_mi'))
{
// _uf_log(event);
_target
.parent('a')
.andSelf()
// .attr('target', '_blank')
.click(function(event){
// _uf_log(event);
_uf_my_openfix(this);
_uf_done(event);
})
;
}
});
});
}
else
{
$('#irc_mimg')
.find('a, a > img')
// .attr('target', '_blank')
.click(function(event){
// _uf_log(event);
_uf_my_openfix(this);
_uf_done(event);
})
;
}
}
else if (_url_host.match(/encrypted\.google\.com/))
{
var _item = $('#hdtb_msb .hdtb_mitem:eq(1)');
var _clone = _item.clone();
_clone.find('a:first').attr('href', _url_obj.scheme + '://translate.google.com.tw/?q=' + $('#lst-ib').val() + '&oe=utf-8').text('翻譯');
_item.after(_clone);
var _clone = _item.clone();
_clone.find('a:first').attr('href', _url_obj.scheme + '://maps.google.com.tw/maps?q=' + $('#lst-ib').val() + '&oe=utf-8').text('地圖');
_item.after(_clone);
// https://translate.google.com.tw/?q=test&oe=utf-8
// _uf_log(_url_obj);
}
else if ($('body#gsr').size())
{
// $('#cnt #res').find('a').not('[href^=javascript], [href^="#"]').attr('target', '_blank');
_uf_dom_filter_link($('#cnt #res').find('a')).attr('target', '_blank');
var _area = $('#topstuff .std.card-section').push('#taw > div:eq(0)').push('#ucs').eq(0);
var _div = $('<div/>');
_div
.appendTo(_area)
.css({
'margin-top': '0.5em',
})
.append(function(){
var _a = $('<a/>');
_a
.attr({
'href': _url_obj.path + '?' + _url_obj.query.replace(/\&(?:tbs|lr)=[^&]*($|\&|\#)/ig, '$1') + '&tbs=lr:lang_1zh-CN%7Clang_1zh-TW&lr=lang_zh-CN%7Clang_zh-TW',
})
.html('只顯示<em>中文</em>搜尋結果。')
;
return _a;
})
;
(_url_obj.host != 'www.google.co.jp') && _div
.append(function(){
var _a = $('<a/>');
_a
.attr({
'href': 'https://www.google.co.jp' + _url_obj.path + '?' + _url_obj.query.replace(/\&(?:tbs|lr|hl)=[^&]*($|\&|\#)/ig, '$1') + '&hl=ja',
})
.html('以<em>日本</em>作為搜尋。')
;
return _a;
})
;
$('#ires .srg .g')
.each(function(){
var _this = $(this);
if ($('.f.slp .fl', _this).size())
{
$('h3.r a:first', _this)
.attr('href', function(i, v){
return _uf_parse_url_params(parse_url(v).query).url[0];
})
;
}
})
;
//https://www.google.com.tw/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwj5wYvTrqnSAhXEmJQKHdLfDMUQFggaMAA&url=%2Finterstitial%3Furl%3Dhttp%3A%2F%2Fbbs.3dmgame.com%2Fthread-5259227-1-1.html&usg=AFQjCNGUVslQGnPWxOeE71HxujkZtRMzaA&sig2=yL_WFB1n7gHFf5Pa8kLBUA
}
}
else if (_uf_my_is_wordpress(_url_obj))
{
$('#content .post .entry-header .entry-title a, #content .post .entry-content .more-link').attr('target', '_blank');
if ($('#nav-below .nav-previous, #nav-below .nav-next').size())
{
$(window).keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#nav-below .nav-next a');
if (_a.size())
{
_uf_done(event);
location.href = _a.attr('href') + '#primary';
return false;
}
break;
case 34:
case 39:
var _a = $('#nav-below .nav-previous a');
if (_a.size())
{
_uf_done(event);
location.href = _a.attr('href') + '#primary';
return false;
}
break;
}
});
}
}
else if ($('body#nv_forum').size() && $('#append_parent').size())
{
_uf_log('is discuz', _url_obj);
if ($('.wp form[action="' + _url + '"] :input[name="agree"]').size())
{
$('.wp form[action="' + _url + '"] :submit[name="submit"]:first').click();
}
$(window)
.on('load', (function(){
try
{
// code to try
unsafeWindow.setatarget(1);
}
catch (e)
{
// handle errors here
}
}).debounce(500))
.keydown(function(event){
switch(event.which)
{
case 33:
case 37:
var _a = $('#fd_page_bottom .pg a.prev');
if (_a.size())
{
_uf_done(event);
location.href = _a[0].href;
}
break;
case 34:
case 39:
var _a = $('#fd_page_bottom .pg a.nxt');
if (_a.size())
{
_uf_done(event);
location.href = _a[0].href;
}
break;
}
})
.triggerHandler('load')
;
_uf_dom_filter_link('#threadlisttableid th a.s.xst').attr('target', '_blank');
$_options.varmap.body += ', .t_f, .t_f td';
}
else if (document.title.match(/^DD-WRT/i) && $('body.gui').size())
{
$_options.varmap.body += ', body, html';
$_options.style.fontSize = '9pt';
}
else if (_url_obj.host.match(/\.(blogspot\..+|blogger\.com)/) || $('#navbar #navbar-iframe-container iframe[src*="blogger.com"]').size() || $('meta[content="blogger"][name="generator"]').size())
{
_uf_log('is blogger', _url_obj);
var _btn = $('#contents .contents-depth1 .kd-button-bar .kd-button-red, #maia-main .maia-button-primary');
if (_btn.size() == 1)
{
window.open(_btn.attr('href'), '_parent');
_btn[0].click();
}
if (_url_obj.path.match(/blogger\.g/))
{
$('.editPosts .bloggPostTable a[href^="#editor"]:not([target])').attr('target', '_blank');
}
var _content_area = $('.content-outer');
if (_content_area.size())
{
$.stylesheet('.post-body.entry-content .separator img')
.css({
'max-width': (_content_area.width() * 0.9) + 'px',
})
;
}
}
else if ($('body.mediawiki').size() || $('meta[name="generator"][content*="MediaWiki"]').size())
{
_uf_log('is mediawiki', _url_obj);
$_options.varmap.body += ', body, .mw-body-content';
$_options.varmap.body_small += ', div#mw-panel div.portal div.body ul li';
}
else
{
_uf_log('null', _url_obj);
}
}
// _uf_log('d', _url_obj);
_000_init();
function _000_init()
{
_uf_log('_000_init', 1);
var _body = $('body');
if (_body.size())
{
var _children = _body.children();
if (_children.size() == 1 && _children.is('pre, img'))
{
if (_children.is('pre'))
{
UF_addStyle('body > pre { font-size: $fontSize; font-family: $fontFamily2; }');
$('body > pre').css({
'font-size': _uf_var('style.fontSize'),
'fontFamily': _uf_var('style.fontFamily2'),
});
}
else if (_children.is('img'))
{
var _style = UF_addStyle([
'body { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9QTFRFIiIiISEhIyMjHx8fICAgSEHIqwAAC3FJREFUeNrEWwmS4zgM46H/v3lFALKdtA9ZqdrZ2eruOLYOigTBw2bNI8zMPSyj/+gfmmf/4Ob9evRPFvUz+ufsV3FTfVV/pXm/1CJwc//Uf7V6pH7171tmv1i39a8yMVMN5uE1Pp7jF+59lOxP1MD9oYZF1dVW9wTurgvh2Vq/ln2KrK/rEQ2Me2p5juVn7UibqhtqkX1Ex68aAHtyzI4d9IVm7dxwvdaZfbC61P/Dx5qrj9Oidmu1in5nTeh9MRinFuv4xrDzaBQXpUmhjY2XxEq0/ck+ZotaRq2iL7rVOI0rq8my1YZbiRXDY5Kxijqd/kU6lu0YsGRUR4pJa/utpg5+dNyF1eDEuBivxTbtwrD5Einur7XWRHWxRsUTXXQ4r1IhCHZoAf7Qpg0D1x01UHA7UVfquZqjBaXKhfUffbONmolN9mkSCseF1+JKlRqVFDqBLZY61OJrV9gM5tOMdeyRLl0ZKoARjbpGlcWaalgM3+XeSqz4QY0MN4kREtGia9pmQ6JUuuRMVMw6lJCosWytpizEptW9SbA1IY6qnky7VffQXmvU3M2tydyitMKgcFmbd9hTUkFkkbiQPBx97kJodXDQX2mTUdW7DDMJK0Zb6daB8a32khST0X5SgqoVZP0ri6s11sKjbKJugUJCIJAu9Le23uoyBInvqNMewKnSgEbF0k8YpBGfiD51KoVwFFYJiDYfsHA+BN0pOQSUiVrNfVIJeBXajbOrcQsyaOWtbJGy9PqrCfwa4LKG7EKAygk76mMQZaIEkHi6JOhcZ0qFMbfzWAoxpu0Fplb3AtJKF1LncWrgCVk6BqSKDHG3zZoi4tTAC7biGmBcAKMjTYEz7Y8DQlus0BEYiVtLU7k2T6Injo9X5M/6uSYtEHae2iDRSUdNdYLZlIUBO2pi7pBgj2NygHN9gh3VzriJ2h1NBCdj0GfKnstqtDkidHnCOqc6VKgAdI2QTPMpmUPRqUZd9yCvhEXKkulPAqBS5+H8sgZKumPYEUEJqNPtsQZNInUOJUqTvuIeaiFNBMCBk2lE1+HGahfcUw0tadKTBCSZmx7D7HFctSg5f4nS4cxyc42FqWMGcAo4RsBuf6alnN4zytTTKXQBrkH83LI8s8GWB8JBQrVoK3SCspb+l7G4VI2jAWhr81yg88BLTIBqI6GwRyWhQ2o4ZqMsiONh44RfK95xzAXFkwU0I5isuMADC5p2gSEX6JnaOFE51smQbzt+SYbokxpvt3vKZzJWOk1qQyN/hBKcUT7fKR8M8ZJykhOSDjl8xvCOL7bVSMbqofKlMPLi6hCZwatA5WgUIXdA/5Yh39CVphWI4hTcpRF0qU98JykPkXHAPOAJHLl0ETSDdE80eVALKOdmrHc0+k6mvygwlphECXoxuOPSrBoXgjFAM+iLK1xJMekMEZtB6hRqkHEkhsEJiJg0Wm9NnIiCAEGUOmMb6DyW+Mq9FMErxQzqZStgLFVrSWdefGxz46UxJI7SpDqA3TAXuPGsrhyBwQQMACI/kosRTAChFYnW6gJPJglVEMJk1lPRyxe5GVzSBD+FMqkztWFHODXLLfZJ+eVWaJVGqic8u2BrPqh1Uj2CTjxpOLBJOM/3tDoOtPrC4fnB4fmNw2XcNEM+r7ZzRz5d5BOzH8iv7+TXOd4pXLQdLvwarhihQ8VJMMWcUsSSxPwcrhoW9kGWXGTJ5CCeyZo12jx2MnyI4oonsubiRjDl1UxNY8blVaZGCZUQr35i8feG9hEmTaYJ5OgLeZv4zQIAQK7NXwGAuH8IFsW6llIrg034nduNEVbCC/x1+zbI57sc12fQ37bTg/qD0kCfEiBjigxIZ6BIJhNJ41cF9jR3xtYMXhtDpood7jV9hVKHjRzdWPZ8GPAHFSfCgD+oGELFICMZ7A4ZAaRGsIwGo0Mupt8YDFv/et7phOKBXTaxy7K3c8V6QZNX+GTsig2HPuLEJsK0OdqRoUlkPhBI0emHvCSkMZXLajbCkgJ2HJkwN45+0nc/WUYy46eXsiq7YwNFu4qgbCp1QM/XfJHb0Vt8pz2SaUyJ2CjYGKYw9sS1n6c9btMutqddQCiecEPpBcRBf3LzoNLURMJ0yQqL46qc1gONhv2G/L7cOaznK5H5qm5ws7ZHTJW6vix3xF7uALSNVA3oS5JkUlfluuFPcHIZYi2xOfEG5Xo653sZv0+vpfRMudSLsHcSGFcrLTsBgD/zCpaSCZE2IN1HdjbodZzRBSkAoK38SxpTV4J4rnaEktJmMEbaWMMtUPkgOf3fDwDBDAw9XCrxjkp+5v2+clZwjbMOfk83vxA5U4iDD0bMiDwlcmpWY4GgwduDTE3x/6sQdIb/f6crlOp0AvV39vslP50urx34ae78dLCfp/qsjWwhnTNJtsONTwLWMeowRR3yWd+JN6UPGKsVMoJVbQWmZJIkVAhZYTQmRtOo0NJ+2Cc535uA7zZ2DxF3RVooICRWioQ5uJUvINgxceg/JLnaoOe/VO5WyLTtKQZBF/UwRJIY9Eajx4T5cKlJ5QlW8lS5JVwRFRtS9wY5ZI48ECsCm2i2FDllmGd3hO5g9Hq7wq2AmFtKCiIhaXSW0i5WCL7DlLuKivIBoCTtkK+4qYmsMOl+fiPcTAaQRp4bPODBIyB9uCj+7VuMZWKmIwBdL/vYPH5e5G8wTUt/Y86K5IpO5JoMUzKE7CajEVM0gv8ZDcH4c8n6d/60kuLOnT9hS/cFnofw5JD6nQ5PQuEJnaC4+sscwxYrrNAoU6wQAqHpvN6ZXn7BvHB/Wi8JNK/D26NC3bRqXEU4sUc4qTreevn2Gar+lm9t8BBLFjjOG2x8qsHnO2tXYMvWi+sGH1eDjyvJ/G+zZH5Odp2w81yYPpDd6fgmRbYbe0p+coa24gxN7lpK/IsR0hBWjZBSPjBcHrkahtJEdEP82Qf+i0iHVOdtB6SGNHJW1Tb+9gfN9sdd9Adl3PQnmfqT4M9zoUryESW9rJKwYLMdZGMT0ElvyDxJ2XtDQr0hTyTFBG7ixctlY/rHhbKxq/uTe1WD5yozXMmxtp3V+HNh8ClqeCgMnkUNOTp5MNj7aOxDsSajsQ+EiCNC2E2X10yXmfRODXxAYkHndZeZH7rMlGE/Ted5TNTk3nZ+4RiVThzdjFMteFdJiBUM870F0JnBuQeu28bKkRB+01hpAk6gx11FbqZwclGRuy2cuOp1Q76vz/2YlZk996s0MpX+h/hwBnq/eaXt0O/DOT40jl6nzlZKzq7UGZpMXrQB0+N8tSF/9zmrRBlUo2DfjMswtD3xXQe2+utK4WePzm99aNzfY8fcXeJutsZ9ZlGIOeO3gkksFEy2rgcI0yezm1fcbwm/tTusP992MH6dx0rPgek8mnT9b5/Ni3LoyksZivBteF+Y3fayAASIw5vqknubWw7RR7VOsIzw1AF534rB8nNjYlTpkpbi7YFivSPmCOrf3oFJRHupwX90bLbh6OArmnzFaHD9iZaulP5zT1gyS/aTGLeUpTX1WqKGlGFbI/GoMquPmYV33wLopfzkHjktlBtMBJfSnn5D7DxGWXk9yfYYxfSu1HLFJlaoVBPQ2Whnm8hJXx7wi1cRNs7jO+dpQ7DLOfuV7hdTZDYq5L90Fdv7ruLqpOCJjszty+TsZ7PEZI37o5HDlVqzrQ61UnvThfO+2ft+ICXqYrwxNv9q3Um+9vHVupN8bagjhWfwz3vJXhfdvrOIM+/kfWYRc88ixu07oVPx6tQ7eZ/xqo6X7MhftGSfqtZ9D/Mpt8qdW9H+n7kLI8oz7rRCJ00oHwSn/52PROyxK0O3y/chZ9IGtcoWzHwyX6hA7DptYEobqCx2ipa+o+X9OyAPJ3TKbkNozXfOliMCOuqXXcgfjppt5f+4m+4/AQYA7rFTSAXDOQYAAAAASUVORK5CYII=") repeat scroll 0% 0% #212121; }',
]);
$('head, body').eq(0).prepend(_style);
}
}
else
{
_uf_clearly_adblock(_url_obj);
$_options.varmap = _uf_trim2($_options.varmap);
// UF_addStyle('body, table, td, input, textarea { font-size: inherit; }');
if (!$_options.env._no_clearly_button && _uf_browser().mozilla && $('._uf_clearly').size() == 0)
{
var _dom = _uf_clearly_button(_url_obj, 0).appendTo('body').wrap('<div class="_uf_clearly_div"/>');
}
var _style_css = [];
if ($_options.varmap.body)
{
_style_css.push('$body { font-size: $fontSize $body_clearly_important; }');
}
if ($_options.varmap.body_rem)
{
_style_css.push('$body_rem { font-size: $fontSize_rem $body_clearly_important; }');
}
if ($_options.varmap.body_small)
{
_style_css.push('$body_small { font-size: $fontSize_small; }');
}
UF_addStyle(_style_css, $_options.varmap.body_head);
}
}
// _uf_log('_000_init', $('body'), $('body').children());
// unsafeWindow.$toggleFullScreen = _toggleFullScreen;
unsafeWindow.$jQuery = $;
unsafeWindow.GM_addStyle = GM_addStyle;
unsafeWindow.UF_addStyle = UF_addStyle;
unsafeWindow.$userJsWindow = window;
if (0 && !unsafeWindow.$)
{
unsafeWindow.$ = $;
}
// unsafeWindow.$fx = fx;
unsafeWindow._uf_log = _uf_log;
unsafeWindow._uf_trigger_key = _uf_trigger_key;
unsafeWindow._uf_disable_nocontextmenu = _uf_disable_nocontextmenu;
//_uf_clearly_adblock(_url_obj);
_uf_log('_000_init', 9, $_options, unsafeWindow.$jQuery, $);
}
function _001_init()
{
// GM_addStyle('._ufmy_wait { border: 1px solid red !important; }');
_001_init_function();
$.migrateTrace = false;
// $_options.style.fontSize = '10pt';
$_options.style = $.extend($_options.style, {
fontSize: '10pt',
fontSize_small: '8pt',
fontSize_rem: '1rem',
// fontFamily: 'arial, helvetica, sans-serif',
fontFamily: 'Consolas,"Liberation Mono",Menlo,Courier,monospace',
fontFamily2: 'Consolas,"Liberation Mono",Menlo,Courier,monospace',
fontFamily3: 'Helvetica,Arial,sans-serif',
fontFamily4: '"微軟正黑體","Microsoft JhengHei", Helvetica,Arial,sans-serif',
fontFamily5: '"微軟正黑體", "Microsoft JhengHei", Helvetica,Roboto,"Lucida Grande",arial,sans-serif',
fontFamily6: '"Times New Roman"',
fontFamily7: 'Tahoma,Arial,sans-serif',
fontFamily8: 'FreeSans,Arimo,Arial,Helvetica,sans-serif,"Microsoft JhengHei"',
fontFamily_ja: '"Lucida Grande","Hiragino Kaku Gothic ProN","ヒラギノ角ゴ ProN W3",Meiryo,メイリオ,sans-serif',
// firefox
fontFamily_ja2: '"MS PGothic", "PMingLiU", "Meiryo", sans-serif',
// pixiv
fontFamily_ja3: '"Helvetica Neue","arial","Hiragino Kaku Gothic ProN",Meiryo,sans-serif',
// http://comic-walker.com
fontFamily_ja4: '"Hiragino Kaku Gothic Pro","ヒラギノ角ゴ Pro W3","メイリオ",Meiryo,"MS Pゴシック","Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif',
fontFamily_cn: '"宋体"',
fontFamily_cn2: 'tahoma,arial,宋体',
filter_contrast_1: 'filter: contrast(115%); -webkit-filter: contrast(115%);',
fontFamily_bbs_1: '"細明體","AR PL UMing TW","Inconsolata","LiSongPro",monospace',
fontFamily_bbs_2: '"AR PL UMING TW","細明體",mingliu,Courier,monospace',
});
$_options.varmap = $.extend($_options.varmap, {
body: '',
body_rem: '',
body_small: '',
body_clearly: '',
body_clearly_important: '',
clearfix: '',
});
$_options.adblock = $.extend($_options.adblock, {
class: '',
});
$_options.event = $.extend($_options.event, {
dom: 'DOMSubtreeModified DOMNodeInserted',
});
$_options.env = $.extend($_options.env, {
'_no_clearly_button': false,
});
$_options.color = $.extend($_options.color, {
tag: [
'#906',
'#66F',
'#800',
'#C60',
'#EAEA00',
'#006',
'#360',
],
});
$_options = $.extend($_options, {
clearly: {
dom: '',
all: '',
not: '',
},
});
_uf_log('init', _url_obj, $_options, $);
var _css = [
'body, html { font-family: $fontFamily; border: 0px none; }',
//'article, aside, details, figcaption, figure, footer, header, main, menu, nav, section, summary { font-family: $fontFamily; }',
'html { font-size: $fontSize; margin: 0px; padding: 0px; }',
'body { font-size: inherit; margin: 0px; padding: 8px; }',
'.lang-ja, :lang(ja) { font-family: $fontFamily_ja; }',
'table, td, input, textarea { font-size: inherit; }',
'._ufmy_wait { border: 1px solid red !important; }',
'._uf_clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }',
'._uf_clearfix { display: inline-block; }',
'html[xmlns] ._uf_clearfix { display: block; }',
'* html ._uf_clearfix { height: 1%; }',
];
$_options.varmap = _uf_trim2($_options.varmap);
// _css = _uf_var_replace(_css, $_options.varmap);
var _style = UF_addStyle(_css);
$('head, body').eq(0).prepend(_style);
}
function _001_init_function()
{
_001_init_cssHook();
(function(_old){
UF_addStyle = function (css, head, varmap)
{
css = _uf_var_replace(css, $_options.varmap);
if (!varmap)
{
varmap = $_options.style;
}
if (head && head.length !== 'undefined' && head[0] && (head.find || head.selector || head.prevObject || head.context))
{
head = head[0];
}
return _old(css, head, varmap);
};
})(UF_addStyle);
// http://stackoverflow.com/questions/13281897/how-to-preserve-order-of-items-added-to-jquery-matched-set
$.fn.push = function (selector, context)
{
Array.prototype.push.apply(this, $.makeArray($(selector, context).not(this)));
// _uf_log('push', this, $.makeArray($(selector, context)));
return this;
};
(function(_old){
var _fn_top = function (who)
{
var _top;
var _o;
if ($.isNumeric(who))
{
_top = who;
}
else if ((_o = $(who)) && _o.size())
{
_top = _o.offset().top;
}
return _top;
};
// if (!$.isfunction(_old))
if (typeof _old === 'undefined')
{
$.fn.scrollTo = function (who, offset)
{
var _top = _fn_top(who);
if (offset)
{
_top = (_top ? _top : 0) + _fn_top(offset);
}
if (_top !== undefined)
{
this.scrollTop(_top);
}
return this;
};
}
// if (!$.isfunction($.scrollTo))
if (typeof $.scrollTo === 'undefined')
{
$.scrollTo = function (who, offset)
{
return $(window).scrollTo(who, offset);
};
}
})($.fn.scrollTo);
try
{
_uf_history_event();
}
catch (e)
{
_uf_log('error', e);
}
$(window)
.on('statechange', function(event){
var args = _uf_hash2array(arguments, 1);
var history = $.isWindow(this) ? this.history : this;
var _old = _url_obj;
_url = this.location.href;
_url_obj = _url_obj_ = parse_url(_url);
_url_host = _url_obj.host;
_uf_log('window.' + _uf_event_name(event), _uf_event_name(args[0]), event, this, args, history, history.state, _old, _url_obj);
$(this).add(history).trigger('history.ready', args);
})
;
History.prototype.refresh = function(mode)
{
/*
$(window).trigger('popstate');
*/
var _this = this;
if (mode)
{
return _this.go(0);
}
else if (_this.length > 1)
{
var _fn, _timeout, _delay = 1000;
_timeout = setTimeout(function(){
$(_this).off('popstate.refresh', _fn);
}, _delay);
_fn = function(){
clearTimeout(_timeout);
setTimeout(function(){_this.go(1);}, _delay);
};
$(_this).one('popstate.refresh', _fn);
_this.go(-1);
//_fn();
}
/*
var event = new Event('popstate');
window.dispatchEvent(event);
*/
};
/*
$(history)
.add(window)
// .add(unsafeWindow)
.on('replacestate pushstate popstate statechange', function(event){
var args = _uf_hash2array(arguments, 1);
var history = $.isWindow(this) ? this.history : this;
_uf_log('history.' + _uf_event_name(event) + ' 3', event, this, arguments, args, history, history.state, window.location.href);
})
;
*/
// http://upshots.org/javascript/jquery-test-if-element-is-in-viewport-visible-on-screen
Function.prototype.debounce = function (threshold)
{
var callback = this;
var timeout;
return function()
{
var context = this, params = arguments;
clearTimeout(timeout);
timeout = setTimeout(function()
{
callback.apply(context, params);
}, threshold);
};
};
$.fn.isOnScreen = function (x, y)
{
if (x == null || typeof x == 'undefined') x = 1;
if (y == null || typeof y == 'undefined') y = 1;
var win = $(window);
var viewport = {
top: win.scrollTop(),
left: win.scrollLeft()
};
viewport.right = viewport.left + win.width();
viewport.bottom = viewport.top + win.height();
var height = this.outerHeight();
var width = this.outerWidth();
if (!width || !height)
{
return false;
}
var bounds = this.offset();
bounds.right = bounds.left + width;
bounds.bottom = bounds.top + height;
var visible = (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
if (!visible)
{
return false;
}
var deltas = {
top: Math.min(1, (bounds.bottom - viewport.top) / height),
bottom: Math.min(1, (viewport.bottom - bounds.top) / height),
left: Math.min(1, (bounds.right - viewport.left) / width),
right: Math.min(1, (viewport.right - bounds.left) / width)
};
// console.log(deltas);
return (deltas.left * deltas.right) >= x && (deltas.top * deltas.bottom) >= y;
};
if (window.self !== window.top)
{
$(window)
.on('load', function(event)
{
$.receiveMessage(function(event)
{
var data;
try
{
// data = $.parseJSON(event.data);
}
catch(e)
{}
if (data === undefined) data = event.data;
// _uf_log(1, _uf_event_name(event), event, this, event.source, event.data, data);
// $.postMessage('ok', window.parent.location.href, event.source);
if (data == '_uf_clearly')
{
_uf_log(_uf_event_name(event), event, this, event.source, event.data, data);
_uf_clearly(_url_obj);
}
}, '*');
})
;
}
}
function _001_init_cssHook()
{
if (($.browser && $.browser.mozilla) || (unsafeWindow.navigator && unsafeWindow.navigator.appCodeName == 'Mozilla'))
{
var propStr = 'border';
var props = ['Top', 'Right', 'Bottom', 'Left'];
$.each(props, function(i, suffix)
{
/*
var i;
var suffix = 'Top';
*/
var hook = propStr + suffix;
$.cssHooks[hook] = $.extend($.cssHooks[hook], {
get: function(elem, computed, extra)
{
// _uf_log(hook, elem, computed, extra);
return (function(elem, pos, prop) {
var width = $.css(elem, hook + 'Width');
var style = $.css(elem, hook + 'Style');
var color = $.css(elem, hook + 'Color');
// var color = $.color.normalize(color);
var color = $.Color(color).toString();
// _uf_log(hook, elem, computed, extra, prop, width, style, color);
var ret = [width, style, color].join(' ');
return ret;
})(elem, i, suffix);
},
});
});
(function()
{
/*
var i;
var suffix = 'Top';
*/
var hook = propStr;
$.cssHooks[hook] = $.extend($.cssHooks[hook], {
get: function(elem, computed, extra)
{
// _uf_log(hook, elem, computed, extra);
return (function(elem) {
var _test = {};
$.each(props, function(i, suffix)
{
var _key = $.css(elem, hook + suffix);
if (!_key)
{
_key = 0;
}
// _uf_log(i, suffix, _key);
if (!_test[_key])
{
_test[_key] = 0;
}
_test[_key]++;
});
var _max = 0;
var ret;
$.each(_test, function(suffix, i)
{
// _uf_log(i, suffix);
if (i > _max)
{
ret = suffix;
_max = i;
}
});
// _uf_log(hook, elem, computed, extra, _test, _max, ret);
return ret ? ret : '';
})(elem);
},
});
})();
}
}
function _uf_app_2ch(_url_obj_)
{
UF_addStyle([
'._uf_2ch_image { max-height: 150px; }',
'#thread-contents #comments .comment:hover { background-color: #fff; }',
'._uf_2ch_image:hover { opacity: 0.5; }',
]);
$_options.varmap.body += ', #thread-contents #comments';
var _img = $('<img class="_uf_2ch_image"/>');
var _link = $('<a rel="nofollow" target="_blank" class="_uf_2ch_image_link" />');
_img
.imagesLoaded(function(){
var _this = $(this);
})
.one('error', function(event){
var _this = $(this);
var _parent = _this.parent(':first');
var _src = _this.attr('src');
if (_parent.is('a'))
{
_parent.text(_src);
}
else
{
_this
.after(_link.clone(true).attr('href', _src))
.remove()
;
}
})
;
$('#thread-contents #comments .comment a[rel="nofollow"]')
.each(function(){
var _this = $(this);
var _url = _this.attr('href');
var _src;
_url = _uf_app_2ch_url_fix(_url);
if (_src = _uf_is_image_url(_url))
{
_this.html(_img.clone(true).attr('src', _src).attr('title', _src));
}
// _uf_log('_uf_app_2ch', _this, _url, _src);
if (_url)
{
_this.attr('href', _url);
}
})
;
var _t = $('.ad_area')
.parent('div')
.css({
'margin': 'inherit',
'min-height': 'none',
})
.remove()
;
}
function _uf_is_image_url(url)
{
var _ret, _m;
if (0 || !url)
{
//
}
else if (_m = url.match(/\.(png|jpg|gif|jpeg|bmp)$/))
{
_ret = url;
}
return _ret;
}
function _uf_app_2ch_url_fix(url)
{
var _ret, _m;
if (0 || !url)
{
//
}
else if (_m = url.match(/^https?:\/\/l\.moapi\.net\/(https?:\/\/.+)$/))
{
_ret = _m[1];
}
return _ret;
}
function _uf_hash2array(data, jquery)
{
var idx = jquery ? 1 : 0;
return Array.prototype.slice.call(data, idx) || [];
}
function _uf_history_event()
{
(function(history, _window){
var e;
// var pushState = history.pushState;
// var replaceState = history.replaceState;
var _argsfix = function(args, type, data)
{
var _data = $.extend({}, {
arguments: args,
// location: ,
}, data);
return {
/*
originalArguments: args,
originalLocation: location,
*/
original: _data,
state: args[0],
title: args[1],
url: args[2],
type: type,
};
};
if (!('onpushstate' in history))
{
try
{
// history.onpushstate = new Function;
history.onpushstate = function(){};
}
catch (e)
{
_uf_log('error', e);
}
var pushState = history.pushState;
history.pushState = function(state) {
var args = Array.prototype.slice.call(arguments, 0) || [];
// _uf_log('history.pushstate', this, args);
var _location = {
location: $.extend({}, _window.location),
};
var _ret = pushState.apply(this, args);
if (typeof this.onpushstate == 'function') {
// this.onpushstate.apply(this, args);
var _data = _argsfix(args, 'pushstate', _location);
$(_window).add(this).trigger('pushstate', _data).trigger('statechange', _data);
}
return _ret;
// $(window).trigger('pushstate', arguments);
// ... whatever else you want to do
// maybe call onhashchange e.handler
// return pushState.apply(this, args);
};
}
if (!('onreplacestate' in history))
{
try
{
// history.onreplacestate = new Function;
history.onreplacestate = function(){};
}
catch (e)
{
_uf_log('error', e);
}
var replaceState = history.replaceState;
history.replaceState = function(state) {
var args = Array.prototype.slice.call(arguments, 0) || [];
// _uf_log('history.replacestate', this, args);
var _location = {
location: $.extend({}, _window.location),
};
var _ret = replaceState.apply(this, args);
if (typeof this.onreplacestate == 'function') {
// this.replacestate.apply(this, args);
var _data = _argsfix(args, 'replacestate', _location);
$(_window).add(this).trigger('replacestate', _data).trigger('statechange', _data);
}
return _ret;
// $(window).trigger('pushstate', arguments);
// ... whatever else you want to do
// maybe call onhashchange e.handler
// return replaceState.apply(this, args);
};
}
if (!('onstatechange' in history))
{
try
{
// history.onstatechange = new Function;
// history.onpopstate = new Function;
history.onstatechange = function(){};
history.onpopstate = function(){};
}
catch (e)
{
_uf_log('error', e);
}
$(_window).on('popstate', function(event){
var args = _uf_hash2array(arguments, 1);
var history = this.history;
// _uf_log('history.' + _uf_event_name(event) + ' 1', event, this, arguments, args, history, history.state);
var _data = _argsfix(args, _uf_event_name(event));
$(history).trigger(_uf_event_name(event), _data);
$(this).add(history).trigger('statechange', _data);
});
}
try
{
if (e)
{
_uf_log('error check', history, e);
}
else
{
// _uf_log('error check ok', history, e);
}
}
catch (e2)
{
_uf_log('error', e2);
}
// _uf_log('history', history, unsafeWindow.history);
})(window.history, window);
unsafeWindow.history = window.history;
return;
(function(history){
var pushState = history.pushState;
history.pushState = function(state) {
var args = Array.prototype.slice.call(arguments, 0) || [];
_uf_log('history.onpushstate 2', this, args, {state: state});
if (typeof history.onpushstate == 'function') {
// history.onpushstate({state: state});
// history.onpushstate(args);
history.onpushstate.apply(history, args);
}
// $(window).trigger('pushstate', arguments);
// ... whatever else you want to do
// maybe call onhashchange e.handler
return pushState.apply(history, args);
};
var replaceState = history.replaceState;
history.replaceState = function(state) {
var args = Array.prototype.slice.call(arguments, 0) || [];
_uf_log('history.onreplacestate 2', this, args, {state: state});
if (typeof history.onreplacestate == 'function') {
// history.onpushstate({state: state});
// history.onreplacestate(args);
history.onreplacestate.apply(history, args);
}
// $(window).trigger('replacestate', arguments);
// ... whatever else you want to do
// maybe call onhashchange e.handler
return replaceState.apply(history, args);
};
})(unsafeWindow.history);
}
function _uf_parse_url_params (str) {
var queryString = str || '';
var keyValPairs = [];
var params = {};
queryString = queryString.replace(/.*?\?/,"");
if (queryString.length)
{
keyValPairs = queryString.split('&');
for (pairNum in keyValPairs)
{
var key = keyValPairs[pairNum].split('=')[0];
if (!key.length) continue;
if (typeof params[key] === 'undefined')
params[key] = [];
params[key].push(keyValPairs[pairNum].split('=')[1]);
}
}
return params;
}
function _uf_parse_url(url)
{
var o = parse_url(v);
o.query_params = _uf_parse_url_params(o.query);
return o;
}
function _uf_var(name)
{
var _m = (name + '').split('.');
var _i;
var _o = $_options;
// _uf_log('_uf_var', name, _o);
for (_i in _m)
{
// _uf_log('_uf_var', name, _o, _i, _m[_i]);
var _o = _o[_m[_i]];
}
// _uf_log('_uf_var', name, _o);
return (_o === $_options) ? undefined : _o;
}
function _uf_is_jquery(who)
{
var _is_jquery = false;
try
{
if (who.fn.jquery)
{
_is_jquery = true;
return who;
}
}
catch (e)
{}
return _is_jquery;
}
function _uf_my_is_wordpress(_url_obj)
{
if ($('meta[name="generator"][content*="WordPress"]').size())
{
_uf_log('is WordPress', _url_obj, true);
return true;
}
}
function _uf_event_name(event)
{
return event.type + ((typeof event.namespace !== 'undefined' && event.namespace !== '') ? '.' + event.namespace : '');
}
function _uf_regexp_match_array(source, regexp_array)
{
var _m;
for (var _regexp in regexp_array)
{
if (_m = source.match(regexp_array[_regexp]))
{
return _m;
}
}
return _m;
}
function _uf_clearly_adblock(_url_obj_, mode)
{
if (!$.browser || !$.browser.mozilla || window.self !== window.top)
{
$_options.env._no_clearly_button = true;
}
if (0)
{
//
}
else if (_uf_regexp_match_array(_url_obj_.host, [
/(yun|pan)\.baidu\.com/,
/comic-walker\.com/,
]))
{
//
$_options.env._no_clearly_button = true;
}
else if (_uf_regexp_match_array(_url_obj_.host, [
/facebook\.com/,
]))
{
//
}
else if ($.browser && $.browser.mozilla)
{
$(window).on('load', function(){
_adblock_filter();
});
}
_uf_log('_uf_clearly_adblock', _url_obj_, mode, window.self !== window.top);
}
/**
* 自定義清理頁面規則
**/
function _uf_clearly(_url_obj_, mode)
{
// _uf_log('_uf_clearly', 'start', _url_obj_, mode);
var _stop_adblock_filter;
var _url_obj_ = _url_obj_ || _url_obj;
var _style_css = new Array();
// var _style_head = document.getElementsByTagName('body')[0];
var _style_head = $('style, link[rel="stylesheet"], link[type="text/css"]').eq(-1);
_style_head.push('body');
_style_head.push('html');
// _uf_log('_uf_clearly 0', _style_head, _style_head.eq(0).is('style'), _style_head.parent(':first'));
if (_style_head.eq(0).is('style') || _style_head.eq(0).is('link'))
{
_style_head = _style_head.parent(':first')[0];
}
else
{
_style_head = _style_head[0];
}
var _style_head2 = $(_style_head);
_style_head2.push('body');
_style_head2.push('head');
_style_head2.push('html');
// _uf_log('_uf_clearly 1', _style_head, _style_head2);
if (_style_head2.eq(0).is('head') || _style_head2.eq(0).is('html') || _style_head2.parent('body').size())
{
_style_head2 = _style_head2[1];
}
else
{
_style_head2 = _style_head2[0];
}
// _uf_log('_uf_clearly 2', _style_head, _style_head2, $(_style_head2).is('html, head'));
// GM_addStyle('body, table, td, .t_f, .t_f td, .single-post, .single-post-content, div#globalWrapper, .mw-body-content, #mw-panel, .metadata small, .ambox small, div#mw-panel div.portal div.body ul li, div#mw-panel div.portal h3, .wikitable small, .infobox small, #toc, .toc, .mw-warning, #bodyContent { font-size: 12px; font-size: 10pt; } .FM-cbox3, .FM-cbox3 a, #BH-main_menu a, .infobox { font-size: 13px; } .t_fsz { min-height: 4em; min-height: none; min-height: auto; } .main-content { padding-top: 20px; } .clearfix { width: 1px; height: 1px; }', document.getElementsByTagName('body')[0]);
_style_css[_style_css.length] = 'body, table, .t_f, .t_f td, .single-post, .single-post-content, div#globalWrapper, .mw-body-content, #mw-panel, .metadata small, .ambox small, div#mw-panel div.portal div.body ul li, div#mw-panel div.portal h3, .wikitable small, .infobox small, #toc, .toc, .mw-warning, #bodyContent { font-size: 12px; font-size: $fontSize; } .FM-cbox3, .FM-cbox3 a, #BH-main_menu a, .infobox { font-size: 13px; } .t_fsz { min-height: 4em; min-height: none; min-height: auto; } .main-content { padding-top: 20px; } .clearfix { width: 1px; height: 1px; }';
$_options.varmap.clearfix += ', .clearfix';
$_options.clearly.all += ', ._uf_clearly, ._uf_clearly_div';
var _dom = $();
var _dom_skip = $();
if (0)
{
//
}
else if (_url_obj_.host.match(/gamer\.com\.tw/))
{
_dom = _dom
.add([
'.BH-search2, #BH-slave, .FM-reply, #BH-footer, #BH-master .FM-cbox1 .FM-cbox9, #BH-master .FM-cbox5 img, #BH-master .FM-cbox6 img, .TOP-bh, script, #BH-menu-path, #BH-master > .GN-lbox5 .GN-lbox5A, #comment > .GN-lbox6B, #BH-menubar-fly, .BH-lbox .MSG-list9 .MSG-list9B, .BH-lbox .MSG-list9 .MSG-list9D, .MSG-list8E, .BH-search, #acg + .GN-lbox5A, img[src*="/avataruserpic/"], div[id*="ad_banner"], #BH-master h4 > img, #comment .IMG-E25, #BH-path img, img[src*="spacer.gif"], img[src*="toolbar_icon"]',
'.FM-exp',
'#headnews',
].join(','));
if (_url_obj_.host.match(/gnn\.gamer\.com\.tw/))
{
UF_addStyle([
'.GN-lbox3D { display: block; float: right; margin: 1em; }',
'.GN-lbox3C { display: block; margin-bottom: 1em; }',
'#BH-master { margin: auto; }',
'.GN-lbox4B > div { display: inline-block; }',
'.GN-lbox3B ul.GN-thumbnails { list-style: outside none none; padding: 0px; display: table; margin: 0px auto; }',
'.GN-lbox3B ul.GN-thumbnails li.line { float: left; }',
]);
$('#BH-master').css('max-width', $('#BH-master').width());
$('link[type="text/css"], link[rel="stylesheet"]').remove();
}
else if (_url_obj_.host.match(/forum\.gamer\.com\.tw/))
{
_dom = _dom
.add('#BH-master > .BH-rbox.FM-blist8, #BH-pagebtn + .FM-lbox1')
;
UF_addStyle([
'.FM-cbox3 { background-color: #5E71B6; }',
'*, .FM-feature { background-image: none !important; }',
'.FM-feature { background: none; }',
], _style_head2);
$.stylesheet('*').css('background-image', 'none');
$('body *, body').css('background-image', 'none');
}
$_options.varmap.body_clearly += ', body, .FM-cbox7, .FM-cbox7 *';
}
else if (_url_obj_.host.match(/techbang\.com/))
{
_dom = _dom.add('#stickies .notice_stickie, .latest-comments, .hot-posts, #header, #footer, #sidebar section, #float-navigation');
_dom = _dom.add('#related-posts, .join-us-on-fb, #new-comment, .comment-push, .post-favorite, .share-wrapper, .bottom-share, .social-box, .float-share, .google-dfp, .phone-ads');
}
else if (_url_obj_.host.match(/xda\-developers\.com/))
{
_dom = _dom.add('#header, #navigation, #sidepanel, #footer, .showthread-social, .leaderboard, .postbutton-row, .postbit-social');
$('.post-text .bbcode-hide').each(function()
{
var _this = $(this);
_this.find('> :input[onclick]:first').remove();
_this.find('> div:first').show();
});
$('.moreInfoButton:visible').trigger('click');
}
else if (_url_obj_.host.match(/mobile01\.com/))
{
_dom = _dom.add('#header, .sidebar, .navbar .nav, #footer, #section .navbar .nav:last, .contentfoot .numbers a[onclick^="share"], .topic-share');
$('.subject-menu').css('position', 'inherit');
}
else if (_url_obj_.host.match(/tieba\.baidu\.com/))
{
// $(GM_addStyle('.clearfix { width: auto; height: auto; }')).appendTo('body');
_style_css[_style_css.length] = '.clearfix { width: auto; height: auto; }';
_dom = _dom.add('#head, #guide_fc, #tb_rich_poster_container, .tbui_aside_float_bar, .right_section.right_bright, .share_btn_wrapper, .thread_recommend, .d_icons, .l_badge .d_badge_lv, #com_userbar, #footer, .pb_bright_share, #tb_nav, #sign_mod, #pb_adbanner, .firework_sender_wrap, #j_ten_years, .BAIDU_CLB_AD, .BAIDU_CLB_AD_pb, .core_title_btns, #j_head_focus_btn, .card_top .card_num, #tb_nav, .fav-wrapper, .pb_footer, iframe, #bdshare_tb_s, .loading-tip, .save_face_bg_0, #voteFlashPanel, #my_friends_vote_detail, .user-hide-post-down, #nav_forum_menu, .complaint, .super_jubao, .lzl_editor_container, .j_user_sign');
_dom = _dom.add($('body > .wrap1').prevAll()).add($('.lzl_li_pager:has(.j_lzl_p)'));
_dom = _dom.add('.p_author .icon, .lzl_single_post .j_user_card');
$('#j_core_title_wrap').css('position', 'inherit');
}
else if (_url_obj_.host.match(/getchu\.com/))
{
_dom = _dom.add($('#wrapper > .header_search').prevAll('div').andSelf());
_dom = _dom.add($('#bannera').prevAll('div').andSelf());
_dom = _dom.add('#bannera, #soft_table tr:eq(1) > :eq(1), .xsnazzy_novelty, #sbi_mix1_adult ~ table, iframe[src*="checkpagelist"], .top_return + div, #topcontrol, button.header_wish, #soft_table div:has(img[src*="samplepackage_s.jpg"]), #soft_table div:has(img[src*="samplepackage_s.jpg"]) + fieldset, .banner-link, #bannera2, .top_return, #sbi_mix1_adult');
_dom = _dom.add($('#soft_table fieldset:last').nextAll('div'));
_dom = _dom.add('#soft_table > tbody > tr:eq(1) > td:eq(-1), #xsnazzy_vote, img[width="1"], img[height="1"]');
_dom = _dom.add('#banner_a1, #banner_a_mini1');
$('#wrapper > div[style]:has(.banner-link)').css('background-image', 'none');
$('img[src*="/demo_"]').after('<span>Download</span>').remove();
_dom = _dom.add($('#sample').next('.tabletitle').next('div').nextAll());
$_options.clearly.text_only = true;
}
else if (_url_obj_.host.match(/douban\.com/))
{
_dom = _dom.add('#db-global-nav, #db-nav-sns, #footer, .sns-bar, #db-nav-group, .mod-app-entrance, .btn-fav, form[action="no_where_to_go"], #footer, #landing-bar');
}
else if (_url_obj_.host.match(/code\.google\.com/))
{
_dom = _dom.add('#footer, #projects-dropdown. .headbg #gaia');
}
else if (_url_obj_.host.match(/4kong\.com/))
{
_dom = _dom.add('.header, #divSidebar, .ad02, form[name="feedback"], #divBottomHov, #divCopyRight');
}
else if (_url_obj_.host.match(/xindm\.cn/))
{
_dom = _dom.add('.top_login_form, .top_header_bg, .guess_u_like, .fengmian_comic_main_gg, .go_top_f, .footer_t, .gg_botom_gg, .fengmian_comic_head_tuijian, .fengmian_comic_main_h');
$('.fengmian_comic_nav, .fengmian_comic_nav_l, .fengmian_comic_nav_r').css('background', 'none');
}
else if (_url_obj_.host.match(/share\.dmhy\.org/))
{
_dom = _dom.add('.user-sidebar .topics_cult, #UNY_ad, #comment_add, .share, .relative-goods, #shareman_ad + div.clear, #shareman_ad, .quick_search, div[id$="_ad"], #mz_ad, .header, #comment_add');
_dom = _dom.add($('.footer').nextAll('div').andSelf());
_dom = _dom.add('#comment_add');
}
else if (_url_obj_.host.match(/pixiv\.net/))
{
_dom = _dom.add('.footer, a[href*="premium.php"], .ad-footer, .header, ._toolmenu, #toolbar-items, .user-relation, iframe');
if (_url_obj_.path.match(/spotlight/))
{
_dom = _dom.add('.article-header, .sidebar, .footer');
}
}
else if (_url_obj_.host.match(/stackoverflow\.com/))
{
$('#question-header').css({
'margin-top': '10px',
'padding-top': '10px',
});
_dom = _dom.add('.topbar, #header, #herobox-mini, #newsletter-ad, #hot-network-questions, #feed-link, #post-form, .new-post-login, .form-submit, .bottom-notice, #footer, .vote-up-off, .vote-down-off, a.comments-link, a.short-link, a.suggest-edit-post');
}
else if (_url_obj_.host.match(/e-hentai\.org/) || _url_obj_.host.match(/exhentai\.org/))
{
_dom = _dom.add('body > .tod, body > .dp, iframe[src*="adshow"], #searchbox form > .itc, .ido #pp, .ido #pt');
}
else if (_url_obj_.host.match(/coolpc\.com\.tw/))
{
// GM_addStyle('.postbody { font-size: 12px; }');
$_options.varmap.body_clearly += ', .postbody';
_dom = _dom.add('#wrapfooter, #portal_container > table:has(table.tablebg):eq(0), #pagecontent > table:first, #pagecontent > table.tablebg:first, span.postbody:has(> fieldset)');
_dom = _dom.add($('#wrapheader').prevAll().andSelf());
var _main = $('#portal_container > table:has(table.tablebg):eq(0)').next('table').find('tr:first td:first').eq(0);
_dom = _dom.add(_main.nextAll('td'));
// unsafeWindow._main = _main;
// _uf_log(_main);
_dom = _dom.add(_main.find('> table.tablebg:first'));
_dom = _dom.add($('#pagecontent > table:eq(-4)').nextAll('table').andSelf());
_dom = _dom.add($('#pagecontent').nextAll());
// _uf_log(_dom);
//
// return;
}
else if (_url_obj_.host.match(/buy\.yahoo\.com/))
{
_dom = _dom.add('#bd > div:first, body#page > .header, body#page > .navbar, body#page > .footer, .back-to-top, #ads_body > table:last, #cl-vvrecmd, .imgnav .data-pool');
var _a = $('#cl-mainitem .item-spec .rate .rate-table');
if (_a.size())
{
// $('<div/>').width(400).append(_a.width(400)).appendTo($('#cl-mainitem'));
$('#cl-mainitem .item-spec .rate > div')
.removeClass('yui3-overlay-hidden')
.css({
position: 'relative',
left: 0,
top: 0,
visibility: 'visible',
})
.show()
.filter('.ratemax')
.css({
'padding-bottom': '5px',
})
;
$('#cl-mainitem .item-spec .rate').css({
'padding': '10px 0',
});
}
}
else if (_url_obj_.host.match(/pcstore\.com\.tw/))
{
_dom = _dom.add('#side, #Msgdiv, #head, img[width="0"][height="0"]');
}
else if (_url_obj_.host.match(/sozi\.cn/))
{
_dom = _dom.add('.main > .clearfix > .left, .footer, .header, .detail .content .conr');
}
else if (_url_obj_.host.match(/blog\.joaoko\.net/))
{
_dom = _dom.add('#secondary');
}
else if (_url_obj_.host.match(/u17\.com/))
{
// GM_addStyle('.clear { width: 1px; height: 1px; }');
_style_css[_style_css.length] = '.clear { width: 1px; height: 1px; }';
_dom = _dom.add('#topbar, .side, #v4footer, #goTop, .bot a, #tuijian, .vote, .panel_input_comment, #rollTop, #app_down');
_dom = _dom.add($('#banner').prevAll().andSelf());
var _div = $('.info .label .label_con');
if (_div.size())
{
_div.find('> div').show();
}
}
else if (_url_obj_.host.match(/coolapk.com/))
{
// GM_addStyle('.col-md-5 { width: 41.6667%; float: left; } .col-md-7 { width: 58.3333%; float: left; } .container { width: 970px; }');
_style_css[_style_css.length] = '.col-md-5 { width: 41.6667%; float: left; } .col-md-7 { width: 58.3333%; float: left; } .container { width: 970px; }';
_dom = _dom.add('.navbar[role="navigation"], .ex-dockbar, .ex-card:has(#commentForm), .ex-card:has(#commentForm2)');
}
else if (_url_obj_.host.match(/github\.com/))
{
_stop_adblock_filter = true;
// GM_addStyle('.markdown-body { font-size: 10pt; }');
$_options.varmap.body_clearly += ', .markdown-body';
_dom = _dom
.add([
'.wrapper .header, .pagehead .pagehead-actions, .container .sunken-menu, .container .site-footer, .octicon-link, #header, .signed-out-comment, object#global-zeroclipboard-flash-bridge, #global-zeroclipboard-html-bridge, footer',
'.timeline-new-comment, .url-box-clippy',
].join(','))
;
}
else if (_url_obj_.host.match(/blog\.sina\.com\.cn/))
{
$_options.varmap.body_clearly += ', #articlebody, .articalContent';
_dom = _dom.add($('.nsinatopbar').prevAll().andSelf());
_dom = _dom.add('.godreply, #column_1, .articalTitle .img2, .turnBoxzz, #sharePhoto, #share, .articalInfo, .writeComm, #diggerFla, #sinablogfooter, .SG_connHead, #sinablogHead, #swfbox, [id*="sinaads"], #ramdomVisitDiv, iframe, .sinaads, #selectionShare, div:hidden, table:hidden, #map, embed');
}
else if (_url_obj_.host.match(/hgamecn\.com/))
{
_dom = _dom.add('#skyscraper, #hgc_header, #hgc_reart .right, #hgc_comment_add, #hgc_footer, #ckepop, #hgc_banner, #hgc_right #hgc_square');
}
else if (_url_obj_.host.match(/kkkmh\.com/))
{
UF_addStyle('.chapterlist ul li { background: none; }');
_dom = _dom.add('.bookarea > .left, .bookinfo > .outer > .onlinedm, .comment_post, .footer, .header, .navbar, .navletter, #digg_num');
}
else if (_url_obj_.host.match(/inside\.com\.tw/))
{
_dom = _dom.add($('header[role="main"]').prevAll().andSelf());
_dom = _dom.add('#sidebar, #form, footer[role="contentinfo"], #discovery, #footer, #nav-below, .nav-secondary');
}
else if (_url_obj_.host.match(/free\.com\.tw/))
{
_dom = _dom.add($('.nav-primary').prevAll().andSelf());
_dom = _dom.add($('.footer-widgets').nextAll().andSelf());
_dom = _dom.add('.site-inner .sidebar-primary, #respond, iframe');
}
else if (_url_obj_.host.match(/4byte\.cn/))
{
// _style_css[_style_css.length] = 'body { font: $fontSize; font-size: $fontSize !important; }';
$_options.varmap.body_clearly += ', .post-text p, p, pre, body';
$_options.varmap.body_clearly_important = '!important';
_dom = _dom.add('.navbar, footer, .container-fluid > .row:eq(-2), .container-fluid > .row:has(.adv-center)');
}
else if (_url_obj_.host.match(/appledaily\.com/))
{
_dom = _dom.add('#Cover, .splash, .line-join-btn, .nm-social, .nm-recommended-articles, .nm-prevnext-articles, .nm-footer, iframe, .nm-header, #Cover, .splash, .aml_like, div[id^="rectangleAD"], .ads');
}
else if (_url_obj_.host.match(/facebook\.com/))
{
_dom = _dom.add('#pagelet_bluebar, #pageFooter');
}
else if (_url_obj_.host.match(/unwire\.hk/))
{
_dom = _dom.add('.srp-widget-container, .widget, .morebutton, #sidebar, .scrollTo_top, #footer, .theblogwidgets, #header, .advanced-browser-check');
}
else if (_url_obj_.host.match(/ttrar\.com/))
{
$_options.varmap.body_clearly += ', .content, .downsm li, .et-box-content, .catname';
_dom = _dom.add('#foot, #content_top .pf, #content_top .diggood, .num_tips, .ds-comment-actions > :not(.ds-time), .ds-avatar, .ds-login-buttons, .ds-replybox, .ds-powered-by, .tab_nav');
_dom = _dom.add($('#left_content').prevAll());
_dom = _dom.add($('#left_content').nextAll());
}
else if (_url_obj_.host.match(/dm5\.com/))
{
_dom = _dom.add('#top, #hd, #adjs_id, form.madi5, #index_right, .rss2, #todaycomic, .zmk2 .fll, #sos, #Dialog_Comic_FrameWork, img[src*="mrtx2.gif"], .sy_tba3, .btnreport, #bt_collect');
_dom = _dom.add($('#index_mian').prevAll());
_dom = _dom.add($('#index_mian').nextAll());
_dom = _dom.add($('.beitou > .c_re').prevAll());
_dom = _dom.add($('.beitou > .c_re').nextAll());
}
else if (_url_obj_.host.match(/alphapolis\.co\.jp/))
{
_dom = _dom.add('.sidenav, #footer, .ad');
_dom = _dom.add($('#topicpath').prevAll());
}
else if (_url_obj_.host.match(/tonarinoyj\.jp/))
{
_dom = _dom.add('#single-related, .footer-social, #footer, iframe, #header');
UF_addStyle('#contents { min-height: initial !important; }');
}
else if (_url_obj_.host.match(/comic-walker\.com/))
{
_dom = _dom.add('#sideContent, #appLinks, #detailInfoBox .mail_situation, #comicsArchive, #twitterWidget, .bunnerBox');
_dom = _dom.add($('#wrap').prevAll());
_dom = _dom.add($('#wrap').nextAll());
$_options.varmap.body_clearly += ', #infomationList dt';
UF_addStyle('#wrap { overflow: visible; }');
$('#mainContent')
.each(function(){
var _this = $(this);
_this.width(_this.width());
})
;
}
else if (_url_obj_.host.match(/playpcesor\.com/))
{
_dom = _dom.add('.sidebar .widget.Image, #HTML5, #PlusBadge1, .widget.AdSense, #HTML6, .tabs-outer, #HTML8, .widget.Stats');
$_options.varmap.body_clearly += ', body';
}
else if (_url_obj_.host.match(/wizards\.com/))
{
_dom = _dom.add('header, footer');
$_options.varmap.body_clearly += ', body, p, ul, ol, dt, dd, html';
}
else if (_url_obj_.host.match(/w3cplus\.com/))
{
_dom = _dom.add('#header, #branding, #sidebar-second, #totop, #footer, #footer-col, #node_bottom, .ds-login-buttons, .ds-replybox, .ds-powered-by');
$_options.varmap.body_clearly += ', .node p, body';
}
else if (_url_obj_.host.match(/mozilla\.org/))
{
_dom = _dom.add('header, footer, .article-meta .page-buttons');
}
else if (_url_obj_.host.match(/dmzj\.com/))
{
_dom = _dom.add('#throwFrame, #dmNav, #fixbdshare, .footer, .flink-box, .commentBody .PostComm');
_dom = _dom.add($('body > .navbox').prevAll());
_dom = _dom.add($('.commentBody .PostComm', $('#tweets_area').contents()));
}
else if (_url_obj_.host.match(/coolaler\.com/))
{
_dom = _dom.add('.above_body, #footer, .below_body');
}
else if (_url_obj_.host.match(/briian\.com/))
{
_dom = _dom.add('.google_search, #branding, #header, #footer, #primary, #wumiiDisplayDiv, div:has(> form[action*="feedburner"]), .entry-content + div:has(#fb-root)');
_dom = _dom.add($('.entry-content > div:has(> span[itemprop="image"])').prevAll());
}
else if (_url_obj_.host.match(/tech\.mozilla\.com\.tw/))
{
_dom = _dom.add('#moztech_authors-2, .widget-area .widget_search, #text-4, .widget-area .widget_facebook_widget, #text-2, #text-3, #archives-2, #nav-post, #footer, #commentform, .related-posts-scope, #after-share-subscribe');
_dom = _dom.add($('#masthead .breadcrumbs').prevAll());
$_options.varmap.body_clearly += ', body';
$_options.clearly.not += ', .entry-header, .entry-footer, #masthead';
}
else if (_url_obj_.host.match(/zhangxinxu\.com/))
{
_dom = _dom.add('.alipay_support, #respond, #footbar, #footer, #header');
}
else if (_url_obj_.host.match(/seemh\.com/))
{
_dom = _dom.add('.backToTop, div[class^="mt"]:has(> script), #uyan_cmt_box, .footer, .score:has(#scoreRes), .book-btn, #bdShare, .book-similar');
_dom = _dom.add($('body > .pr:eq(0)').prevAll());
}
else if (_url_obj_.host.match(/mozest\.com/))
{
_dom = _dom.add('#common-header, #sub-header, #common-sub-footer, #common-footer, .footer-html5');
$_options.clearly.text_only = true;
}
else if (_url_obj_.host.match(/gamebase\.com\.tw/))
{
var _area = $('#container');
_dom = _dom
.add(_area.siblings())
.add(_area.parent().siblings())
.not(_area.parents().andSelf())
.add(([
'#forum_topic_list .topic .poster img, .poster_header_medals, .topic_push_box, .page_up_down, .tools, .share, #right, #header',
'footer, .more_txt, .sign_box, #forum_reply_more, #fast_post_table, #forum_event_box',
]).join(','))
;
$_options.clearly.text_only = true;
}
else if (_url_obj_.host.match(/disqus\.com/))
{
_dom = _dom
.add(([
'#form, script, .avatar, footer, .nav, header, #discovery-top',
]).join(','))
;
}
else if (_url_obj_.host.match(/dulfy\.net/))
{
var _img = $('.post-content img, #content img')
.each(function(){
var _this = $(_this);
_uf_fixsize2(_this, true);
_this
.attr('src', function(i, old){
return old.replace(/_thumb(\.[a-z]+)$/, '$1');
})
;
})
;
}
else if (_url_obj_.host.match(/sokmil\.com/))
{
var _uf_clearly_others = function(source, target)
{
var _this = $(source);
target = $(target)
.add(_this.prevAll())
.add(_this.nextAll())
;
var _parents = _this
.parents('body *')
.each(function(){
target = _uf_clearly_others(this, target);
})
;
if (mode)
{
_this
.add('html, body')
.add(_parents)
.css({
'background-image': '',
})
;
}
return target;
};
_dom = _uf_clearly_others('#main-content', _dom, true);
_dom = _dom
.add(([
'.icon-desc-area, .tag-recommend, .page-rss, .valueArea, .rating-area, .product-title .sokmil_lightbox',
]).join(','))
;
$('.product')
.each(function(){
var _area = $(this);
$('.badge-area-wrapper img', _area)
.attr('src', function(){
_uf_fixsize2(this, true);
return $('.product-title .sokmil_lightbox', _area).attr('href');
})
;
})
;
$_options.varmap.body_clearly += ', html, body';
$_options.varmap.fontSize = '12px';
}
else if (_url_obj_.host.match(/reddit\.com/))
{
_dom = _dom
.add(([
'#header, .side, .footer-parent, .debuginfo',
]).join(','))
;
}
else if (_url_obj_.host.match(/3dmgame\.com/))
{
_dom = _dom
.add(([
'.hd_table',
'#SOHU_MAIN .module-cmt-header, .module-cmt-footer, .module-hot-topic, #bottom, .wrap-action-gw, .QZmainR, #mainbody > .tb, #AD',
]).join(','))
;
}
else if (_url_obj.host.match(/skycitizen\.net/))
{
_dom = _dom
.add(([
'.hangout-control-container, #post-nav-bottom',
'.popup-menu.post-nav, #post-comments-container',
'.cover-img, #top-nav',
]).join(','))
//.add($('._post_popup #post-tab').appendTo('body').siblings())
.add($('.post-content-inner')
.css({
padding: 0
})
.removeClass('pd-20')
.appendTo('body').siblings())
.not($('#post-comments .message-container:visible, #post-comments-container .message-container:visible').eq(0)
.width(function(){
$('.post-content-inner')
.css({
width: 'calc(100% - ' + ($(this).width() + 50) + 'px)',
float: 'left'
});
return $(this).width();
})
.css({
float: 'right',
height: '90%',
padding: 0
})
.appendTo('body'))
.add('.message .content > .least')
;
window.document.title = $('.blog-item-title').text();
}
else if (_url_obj_.host.match(/nexusmods\.com/))
{
_dom = _dom
.add(([
'#horizontalpub',
]).join(','))
.add($('#main').siblings())
.add($('#UnderContent').nextAll())
;
}
else if (_url_obj.host.match(/gamersky\.com/))
{
_dom = _dom
.add('.Mid2L_crumb, .post_ding mid, .tag, .PLshade, .PLlogin')
.add($('.Mid2L_con').nextAll())
;
$('.Mid2L_ctt.block').parents().each(function(){
_dom = _dom.add($(this).siblings())
});
$('body').css('background', 'none');
}
else if (_url.match(/dmzj\.com/))
{
_dom = _dom
.add($('.wrapper').siblings().not('.wrapper'))
.add('.probable_like, .wrapper > .right')
.add('.probable_like + a')
;
}
else if (_url_obj.host.match(/nicesoftware\.co/))
{
$('#main .post.hentry')
var _map_func = function(elem, _dom)
{
var _this = $(elem);
//_uf_log(_dom.size(), _this, _this.size());
if (_this.size() == 1)
{
_dom = _dom
.add(_this.siblings())
;
//_uf_log(_dom.size());
if (_this.parents('body').size())
{
var _parent = _this.parent();
if (_parent.is('body'))
{
//_uf_log(_dom.size(), _parent);
}
else
{
return _map_func(_parent, _dom)
}
}
}
return _dom;
};
_dom = _map_func('#main .post.hentry', _dom);
var _elem = $('#main .post.hentry').css({
'background': '#fff',
'padding': 0,
margin: 'auto'
}).width(function(i, v){
return v;
}).appendTo('body');
_dom = _dom
.add(_elem.siblings())
;
$('body').css({
'background': 'none',
'padding': 10,
margin: 'auto'
})
_elem.wrap('<div style="width: 95%; margin: auto;"/>')
}
else if (_url.match(/k73\.com/))
{
_dom = _dom
.add(([
'.title .plt2, #viewtopad, .zw_20160419_xiugai',
'#azbt, #colbt',
'#if-game, .m-hotnew, .m_weiwin, #pmform',
'.wtag img',
'#if-gamenew, .main_right-15',
'.down_dizhi .pop-title, .down_dizhi .m-qdb',
'.game_info .xx_img, .info .downbutton',
]).join(','))
.add($('body > #menu').prevAll().andSelf())
.add($('body > .zw_20160419_xiugai').nextAll().andSelf())
.add($('.main > .main_l').siblings())
;
$('.game_about').css('height', 'auto');
}
else if (_url.match(/dayanzai\.me/))
{
_dom = _dom
.add(([
'.main .content > .c-w300',
'#SOHU_MAIN .cont-head-gw, #SOHU_MAIN .user-level-gw, #SOHU_MAIN .wrap-action-gw',
'#cyReward, .bdsharebuttonbox, #notice',
]).join(','))
.add($('.main .content .soft-content').nextAll().not('#comment_box'))
.add($('#SOHU_MAIN .module-cmt-list').siblings().not('#SOHU_MAIN .module-cmt-list'))
.add($('.main .content').siblings().not('.main .contten'))
.add($('.main').siblings().not('.main'))
;
}
else if (_url.match(/fireemblem\.net/))
{
_dom = _dom
.add($('form[name="delatc"] .tpc_content').prevAll())
.add($('form[name="delatc"]').siblings())
;
$('form[name="delatc"] > table:odd').each(function(i, _this){
$('tbody > tr:first > td:eq(0)', _this).html($('tbody > tr:first > td:eq(0) > font:eq(0)', _this))
})
}
else if (_url_obj.host.match(/hk01\.com/))
{
_dom = _dom
.add(([
'.nocontent, .channel_tit',
]).join(','))
.not('.article_info')
.add($('.comments_list').siblings().not('.comments_list'))
//.add($().prevAll())
//.add($('form[name="delatc"]').siblings())
;
$('.article__body__content .article_content__module object[data]').each(function () {
var _this = $(this);
$('<img/>').attr('src', _this.attr('data')).appendTo(_this.parent());
_this.remove();
});
}
else if (_url_obj.host.match(/kknews\.cc/))
{
_dom_skip = _dom_skip
.add([
'#content header',
].join(','))
;
_dom = _dom
.add([
'aside, .copyright-wrap, .axslot.lrct_inject',
].join(','))
.add($('#main-content > #content').nextAll())
;
}
else if (_url_obj.host.match(/pcucgame\.com/))
{
_dom_skip = _dom_skip
.add([
'.td-ss-main-content article footer',
].join(','))
;
_dom = _dom
.add([
'',
].join(','))
.add($('.td-main-content').siblings().not('.td-main-content'))
.add($('article').siblings().not('article'))
.add($('#td-outer-wrap').siblings().not('#td-outer-wrap'))
.add($('.td-main-content-wrap').siblings().not('.td-main-content-wrap'))
.add($('.toc-post-ad').prev().andSelf())
//.add($('article .td-post-content h2:has(#i-2)').nextAll().andSelf())
;
}
else if (_url_obj.host.match(/entertainment14\.net/))
{
_dom_skip = _dom_skip
.add([
'',
].join(','))
;
_dom = _dom
.add([
'#secondary',
].join(','))
;
}
else if (_url_obj.host.match(/4399\.com/))
{
_dom = _dom
.add([
'.coninfo > :not(span)',
'.w250',
'a[href*="shang.qq.com"]',
].join(','))
.add($('.content').nextAll())
.add($('.content > :eq(-4)').nextAll().andSelf())
;
$('html, body').css('background', 'unset');
_dom = _uf_dom_unwarp_all('.wp.cf', _dom);
}
else
{
function _9_label_dummy()
{
}
//
}
if (1)
{
//_uf_log(0);
//
if ($('body#nv_forum').size() || $('#append_parent').size())
{
_uf_log('is discuz', _url_obj_);
// discuz
_dom = _dom
.add('#pidRight, #postlist .plc .po, #postlist .userPlubInfo, .viewShare, #toptb, #hd, .greenSubmenu, #f_pst, .footer, #p_btn, body #ft, .favatar .pil img, #postlist .plc .y , #postlist .plc .ts .xg1, #postlist .plc .authi .authicn, #scrolltop, #postlist .pls .o, #postlist .pls .bui, #postlist .pls img.vm[src*="usergroup_icon"], #newspecial, #pt .z .nvhm, #append_parent, #ajaxwaitid, #qmenu_menu, #newspecialtmp, .replybtn, #bshare')
.add(([
'.postauthor img[alt*="rank"], .popupmenu_popup.userinfopanel, .authicon, .postactions, #back-to-top, #common-header',
'img[src*="noavatar"]',
'.p_pop, .pgs, .vwthd .xg1, .tip, .aimg_tip',
'.pct .a_pt:has(embed), .sign',
'.pcb .jammer',
]).join(','))
;
$('.t_f font[size=3]').removeAttr('size');
_dom = _dom
.add($('.favatar > div:has(.avatar)').nextAll())
;
$('.pcb .t_f').find('div, span, font')
.each(function (i, elem) {
var _this = $(this);
if (_this.children().size() == 0)
{
var _color = _this.css('color');
if (_this.is(':hidden') || (
_color
&& _color == _this.parent().css('background-color')
&& _color == _this.parents('.t_f, .pcb').eq(0).css('background-color')
))
{
//console.log(_color, _this.parent().css('background-color'));
_this.remove();
}
}
})
;
}
else if (_url_obj_.host.match(/pixnet\.net/) || $('body#article-main').size() && $('#topbar').size() && $('#topbar h2 a[title*="PIXNET"]').size())
{
_uf_log('is PIXNET', _url_obj_);
_dom = _dom
.add([
'.bookmark',
'#topbar, .json-form, .post-comment, #d_clip_button, #footer, #pixblogad',
].join(','))
.add($('#links div#category').siblings().not('#category, [id*="article"]'))
;
$('.article-content').find('*[style]').css('font-size', 'unset');
}
else if (_url_obj_.host.match(/blogspot\..+/) || $('#navbar #navbar-iframe-container iframe[src*="blogger.com"]').size() || $('meta[content="blogger"][name="generator"]').size())
{
_uf_log('is blogger', _url_obj_);
$_options.varmap.body_clearly += ', .post-body';
_dom = _dom.add('#navbar, .widget.Translate, .widget.CustomSearch, .item-control.blog-admin, .comment-form, footer, header, .sidebar .widget:has(.gsc-search-box), .comment-form, #backlinks-container, .post-feeds, #commentForm');
}
else if ($('body.mediawiki').size() || $('meta[name="generator"][content*="MediaWiki"]').size())
{
_uf_log('is mediawiki', _url_obj_);
UF_addStyle([
'div#mw-panel div.portal div.body ul li { font-size: 0.8em; }',
'.infobox { font-size: 88%; } .infobox td { font-size: inherit; }',
], _style_head2);
if ($('#globalWrapper #column-content').size())
{
_dom = _dom.add('#column-one');
}
_dom = _dom.add('#footer, #siteNotice, .uls-settings-trigger, .mw-editsection, #mw-head, .mw-wiki-logo, #p-logo');
$_options.clearly.text_only = true;
}
else if (_uf_my_is_wordpress(_url_obj_))
{
$_options.varmap.body_clearly += ', #content .entry';
_dom = _dom.add($('#respond, .comment-respond, footer, .widget:has(#cse-search-form), #feedarea, #sidebar .sidebox:has(#cse-search-box), #dynamic-to-top, form.reply, #github, header').not('article header'));
_uf_log('is WordPress 2', _dom);
}
else
{
//
}
// _dom = _dom.add('#disqus_thread');
$_options.clearly.text_only = true;
}
/*
$_options.varmap.body = $_options.varmap.body.replace(/^[,\s]+|[,\s]+$/g, '');
$_options.varmap.body_clearly = $_options.varmap.body_clearly.replace(/^[,\s]+|[,\s]+$/g, '');
*/
try
{
$_options.varmap = _uf_trim2($_options.varmap);
}
catch (e)
{
_uf_log(e);
}
// _uf_log($_options.varmap);
_style_css[_style_css.length] = '$body_clearly { font-size: $fontSize $body_clearly_important; }';
_style_css[_style_css.length] = '$clearfix { width: auto; height: auto; }';
$(UF_addStyle(_style_css, _style_head))
.attr('rel', '_uf_clearly')
.siblings('style[rel="_uf_clearly"]')
;
// _uf_log(1);
_dom = _dom.add(_uf_clearly_viedo(_url_obj_, mode));
try
{
$_options.clearly.all += ',' + ([
'noscript',
'#fb-root, iframe[src*="facebook"], iframe[src*="accounts.google.com"], .fb_iframe_widget, .facebook_api, .gplus_api, .twitter_api, .plurk_share',
'embed[src*="zeroclipboard"], embed[id*="ZeroClipboard"], script[src*="ZeroClipboard"]',
'div[id^="div-gpt-ad-"]',
'script[src*="google-analytics.com"], script[src*="baidu"]',
'embed[src*="clipboard"]',
'#__readable_extension_definitions, div[id^="__readable_"]',
]).join(',');
$_options.clearly = _uf_trim2($_options.clearly);
_dom = _dom.add($_options.clearly.dom);
_dom = _dom.add($_options.clearly.all);
_dom = _dom.add($($_options.clearly.all, $('iframe').contents()));
}
catch (e)
{
_uf_log(e);
}
$('iframe')
.each(function(){
try
{
this.contentWindow.postMessage('_uf_clearly', '*');
}
catch (e)
{
_uf_log(e);
}
})
;
/*
_dom = _dom.add('noscript');
_dom = _dom.add('#fb-root, iframe[src*="facebook"], iframe[src*="accounts.google.com"], .fb_iframe_widget, .facebook_api, .gplus_api, .twitter_api, .plurk_share');
_dom = _dom.add('embed[src*="zeroclipboard"], embed[id*="ZeroClipboard"], script[src*="ZeroClipboard"]');
_dom = _dom.add('div[id^="div-gpt-ad-"]');
*/
if (mode)
{
// _uf_log('_uf_clearly', 'hidden', _url_obj, mode);
// _dom = _dom.add($('body').find(':not(:visible), :hidden, :input[type="hidden"]').filter(':not(html, body, script, head, head *, style)'));
_dom = _dom.add(_uf_dom_filter_allow_remove($('body').find(':not(:visible), :hidden, :input[type="hidden"]')));
// $('body').find(':not(:visible), :hidden, :input[type="hidden"]').filter(':not(html, body, script, head, head *, style)').remove();
}
_dom = _uf_dom_filter_allow_remove(_dom, 0, _dom_skip);
if ($_options.clearly.text_only)
{
_dom = _dom.add(([
// 'iframe',
'script',
'object, embed',
'head script',
]).join(','));
}
_dom = _dom.add(([
'link[rel="alternate"], link[rel="EditURI"], link[rel="EditURI"], link[rel="search"], link[rel="apple-touch-ico"], link[rel="dns-prefetch"]',
'script[src*="google-analytics.com"]',
]).join(','));
if ($_options.clearly.not)
{
_dom = _dom.not($_options.clearly.not);
}
_uf_log('_uf_clearly', _url_obj, mode, _dom);
// _dom.filter(':not(html, body, script, head, head *, style)').remove();
_dom.remove();
if (!_stop_adblock_filter)
{
_adblock_filter(1);
}
}
function _uf_trim2(str)
{
// _uf_log('trim2', str, typeof str);
if (typeof str === 'string')
{
return str.replace(/^[,\s]+|[,\s]+$/g, '');
}
else if (!str || $.isEmptyObject(str))
{
// _uf_log('trim2', str, 'empty');
}
else if ($.isArray(str) || $.isPlainObject(str))
{
// _uf_log('trim2 object', str);
$.each(str, function(_i, _v){
var _ret = _uf_trim2(_v);
// _uf_log('trim2 each', str, _i, _v, _ret);
if (_ret !== null && typeof _ret !== 'undefined')
{
str[_i] = _ret;
}
else
{
//
}
});
}
else
{
}
return str;
}
function _uf_clearly_button(_url_obj, mode, fn)
{
// _uf_log('_uf_clearly_button', 1);
if ($('._uf_clearly').size() == 0)
{
GM_addStyle('._uf_clearly { background: rgba(194, 43, 224, 0.32) !important; color: rgb(0, 0, 0); padding: 1px 10px !important; margin: auto 1em !important; border: thin solid rgb(255, 0, 207) !important; } ._uf_clearly a { text-decoration: none; } ._uf_clearly_div { top: 50%; position: fixed; width: 5%; left: 0; z-index: 9999; padding: 10px; } ._uf_clearly_div ._uf_clearly { display: none; } ._uf_clearly_div:hover ._uf_clearly { display: inline-block; }');
}
var _fn_clearly = function(event){
_uf_log('_uf_clearly_button', 'click', _url_obj, mode, fn);
_uf_clearly(_url_obj, mode, fn);
if (fn)
{
fn();
}
_uf_disable_nocontextmenu(2);
};
var _dom = $('<span class="_uf_clearly"/>').append($('<a/>').text('CLEARLY').on('click', _fn_clearly));
try {
// code to try
GM_registerMenuCommand('CLEARLY', _fn_clearly);
} catch (e) {
// handle errors here
_uf_log(e);
}
return _dom;
}
function _uf_clearly_viedo(_url_obj_, mode)
{
var _dom_return = $('<div/>');
$('embed[type="application/x-shockwave-flash"], iframe[src*="youtube"], iframe[data-src*="youtube"], article a[name="attachMovieName"][href*="youtube"]').each(function(){
var _this = $(this);
var _url = _this.attr('src') || _this.attr('data-src') || _this.attr('href');
var _matches = _url.match('^(?:https?:)?\/\/(?:www\.)?youtube\.(?:googleapis\.)?com\/(?:v|embed)\/([A-Za-z0-9_\-]{11})');
var _data;
if (_matches)
{
_data = {
type: 'youtube',
src: _url,
width: _this.width(),
height: _this.height(),
videoid: _matches[1],
matches: _matches,
thumb: [
'http://img.youtube.com/vi/' + _matches[1] + '/0.jpg',
'http://img.youtube.com/vi/' + _matches[1] + '/2.jpg'
],
};
}
if (_data)
{
var _dom;
if (_this.parent().is('object'))
{
_dom = _this.parent();
}
else
{
_dom = _this;
}
var _elem = $('<a/>')
.attr({
href: _data.src,
target: '_blank',
title: 'Youtube: ' + _data.videoid,
})
.css({
display: 'inline-block',
color: '#FFF',
'text-decoration': 'none',
})
.append($('<img/>').attr({
src: _data.thumb[1] || _data.thumb[0],
// lowsrc: _data.thumb[1],
alt: 'Youtube: ' + _data.videoid,
}))
.append($('<div/>').text('Youtube: ' + _data.videoid).css('padding-top', '5px'))
.appendTo($('<div/>').css({
display: 'inline-block',
background: '#000',
color: '#FFF',
'text-decoration': 'none',
'text-align': 'center',
padding: '5px',
}))
.parent()
;
_dom_return = _dom_return.add(_dom);
_dom.after(_elem);
// _dom.after(_elem).remove();
}
});
return _dom_return;
}
function _adblock_detect()
{
var _img1 = $('<img width="1" height="1">').appendTo('body');
var _img2 = _img1.clone().addClass('ad-a').appendTo('body');
var _ret = _img2.is(':visible');
//_uf_log('adblock_detect', _ret, _img1.is(':visible'));
_img1.remove();
_img2.remove();
return !_ret;
}
function _uf_browser()
{
var _ret = {};
if ($.browser)
{
_ret = $.browser;
}
if ($.browser && $.browser.mozilla)
{
}
else if (unsafeWindow.navigator && unsafeWindow.navigator.appCodeName == 'Mozilla')
{
_ret.mozilla = true;
}
// _uf_log(_ret, $.browser, $.support);
return _ret;
}
/**
* for Scrapbook
**/
function _adblock_filter(mode)
{
var _ok = _adblock_detect();
// _uf_log('_adblock_filter', _ok);
//_uf_log('_adblock_filter');
if (_ok)
{
//_uf_log('_adblock_filter', 1, $.browser, unsafeWindow.$jQuery.browser, unsafeWindow);
var _dom = $('<div/>');
var _dom_test;
var _hash_class;
if (($.browser && $.browser.mozilla) || (unsafeWindow.navigator && unsafeWindow.navigator.appCodeName == 'Mozilla'))
{
//_uf_log('Mozilla', $('.wzqtsmhrtpetkcizkgwk'));
if (!$_options.adblock.class || !$_options.adblock.class.length)
{
_dom = _dom.add('.wzqtsmhrtpetkcizkgwk');
var _hash_class_has = false;
var _adblock_filter_class = function ()
{
var _this = $(this);
var _m;
var _class = _this.attr('class');
if (_class)
{
if (_m = _class.match(/\b([a-z]{20})\b/i))
{
if (!_hash_class[_m[1]])
{
_hash_class[_m[1]] = 0;
}
_hash_class[_m[1]]++;
_hash_class_has = true;
}
}
//_uf_log(_this.attr('class'), _this.prop('class'), _this.data('class'), _m, _this);
};
_hash_class = new Object;
// _hash_class['wzqtsmhrtpetkcizkgwk'] = 'wzqtsmhrtpetkcizkgwk';
//_uf_log(_hash_class);
_dom_test = $();
$.each(['iframe', 'embed', 'img', 'div', 'table'], function(key, value)
{
if (_hash_class_has)
{
return false;
}
var _dom = $(value).filter(':not(:visible)');
var _temp = $();
_temp = _temp.add(_dom.filter(':lt(10)')).add(_dom.filter(':lt(-10)'));
_dom = $(value + '[class]').filter(':not(:visible)');
_temp = _temp.add(_dom.filter(':lt(10)')).add(_dom.filter(':lt(-10)'));
if (_temp.size())
{
_temp.each(_adblock_filter_class);
}
// _uf_log(5, key, value, _temp);
//_dom_test = _dom_test.add(_temp);
});
if (!_hash_class_has)
{
var _dom3 = $('img, div, table, embed, iframe');
_dom_test = _dom_test.add(_dom3.filter(':not(:visible):lt(50)'));
_dom_test = _dom_test.add(_dom3.filter(':not(:visible):lt(-50)'));
_dom_test.each(_adblock_filter_class);
}
}
else
{
_hash_class = $_options.adblock.class;
}
var _class = '';
var _c = '';
for (var _i in _hash_class)
{
$_options.adblock.class[_i] = _hash_class[_i];
_class += _c + '.' + _i;
_c = ', ';
}
if (_class)
{
_dom = _dom.add(_class);
}
if (mode)
{
var _dom2 = $('<div/>');
var _hidden_ad = $('body').find(':visible > :hidden, > :hidden').not('noscript, .clearfix:empty, .clear:empty');
// _uf_log(5);
_hidden_ad = _uf_dom_filter_allow_remove(_hidden_ad, 1);
// _uf_log(7, _hidden_ad);
_hidden_ad.each(function(){
var _this = $(this);
// _uf_log(8, _this);
try
{
if (_this.parent() && _this.parent().is(':visible') && _this.show().is(':hidden'))
{
// _uf_log(9, _this, _this.parent());
// var _this2 = _this.not(_dom2);
//
// if (_this2.size())
// {
// _dom2 = _dom2.add(_this2);
// }
_dom2 = _dom2.add(_this);
}
}
catch (e)
{
_uf_log('_adblock_filter error', e);
}
});
// _uf_log(10);
_hidden_ad.hide();
// _uf_log(6);
_dom2 = _uf_dom_filter_allow_remove(_dom2, 1);
_uf_log('_adblock_filter_auto', _dom2);
// _uf_log('_adblock_filter', _hash_class, _dom);
_dom2.addClass('_adblock_filter_auto');
_dom = _dom.add(_dom2);
}
}
_uf_log('_adblock_filter 3', mode, _dom, _hash_class, _dom_test);
// _dom.filter(':not(html, body, script, head, head *, style)').remove();
// _dom.not('html, body, script, head, head *, style').remove();
_dom = _uf_dom_filter_allow_remove(_dom);
_dom.remove();
}
}
function _uf_dom_filter_allow_remove(_dom, mode, skip)
{
// _uf_log('_uf_dom_filter_allow_remove', _dom);
_dom = _dom.not('html, body, script, head, head *, style, meta, title, link');
if (mode)
{
_dom = _dom.not('._uf_clearly, ._uf_clearly_div, :input, br, hr');
}
if (skip)
{
_dom = _dom.not(skip);
}
// _uf_log('_uf_dom_filter_allow_remove', 'return', _dom);
return _dom;
}
function _uf_dom_filter_link(_dom, _content, mode)
{
if (_content)
{
_dom = $(_dom, _content);
}
else
{
_dom = $(_dom);
}
_dom = _dom.filter('a[href]').not('[href^="javascript:"], [href^="#"], [href=""]');
return _dom;
}
function _uf_url_obj_update(href)
{
_url = href || window.location.href;
_url_obj = _url_obj_ = _uf_parse_url(_url);
_url_host = _url_obj.host;
return _url_obj;
}
function _uf_wait_while(_bool, _func, _time)
{
var _time = _time || 200;
var _val = _bool();
//_uf_log(_val);
if (_val)
{
return _func();
}
else
{
setTimeout(function(){
_uf_wait_while(_bool, _func, _time);
}, _time);
}
}
function _uf_trigger_key(who, keycode, eventname, _unsafe)
{
var _jquery_array = [$];
var _unsafeJquery;
var _jquery;
if (_unsafe)
{
if (_unsafe.fn && _unsafe.fn.jquery)
{
_unsafeJquery = _unsafe;
}
else if (unsafeWindow.$ && unsafeWindow.$.fn && unsafeWindow.$.fn.jquery)
{
_unsafeJquery = unsafeWindow.$;
}
if (_unsafeJquery)
{
_jquery_array[_jquery_array.length] = _unsafeJquery;
}
}
return $.each(_jquery_array, function(key, _jquery){
var e = _jquery.Event(eventname ? eventname : 'keydown', {
which: keycode,
keyCode: keycode,
});
if ($.isArray(who))
{
var _who = _jquery();
$.each(who, function(key, _i){
_who = _who.add(_i);
});
_uf_log('_uf_trigger_key', _who, keycode, eventname, _unsafe);
_who.trigger(e);
}
else
{
_uf_log('_uf_trigger_key', who, keycode, eventname, _unsafe);
_jquery(who).trigger(e);
}
});
}
function _uf_disable_nocontextmenu(mode, elem)
{
var _jquery_array = [$];
var _unsafeJquery;
var _jquery;
if (mode > 1)
{
var _style = $('style#_uf_disable_nocontextmenu');
if (!_style.size())
{
_style = GM_addStyle('* { -moz-user-select: auto !important; -webkit-user-select: auto !important; -ms-user-select: auto !important; }');
$(_style).attr('id', '_uf_disable_nocontextmenu');
}
if (unsafeWindow.$ && unsafeWindow.$.fn && unsafeWindow.$.fn.jquery)
{
_unsafeJquery = unsafeWindow.$;
_jquery_array[_jquery_array.length] = _unsafeJquery;
}
}
var _fn_jq_call = function(_jquery, arr, fn, event){
if (_jquery.fn[fn])
{
$.each(event, function(i, v){
arr[fn](v);
//_uf_log(arr, fn, v);
});
}
};
// _jquery = _jquery_array[0];
var _fn_event = ['dragstart', 'contextmenu', 'selectstart', 'mousedown', 'mouseup', 'source'];
$.each(_jquery_array, function(key, _jquery){
var arr = _jquery(unsafeWindow.document).add('body, html');
if (elem)
{
arr = arr.add(elem);
}
// _uf_log('_uf_disable_nocontextmenu', mode, elem, _jquery_array, _jquery, _jquery.fn.jquery, arr);
arr
.removeAttr('ondragstart')
.removeAttr('oncontextmenu')
.removeAttr('onselectstart')
.removeAttr('onmousedown')
.removeAttr('onmouseup')
.removeAttr('onsource')
.css({
'-moz-user-select': 'auto',
'-webkit-user-select': 'auto',
'-ms-user-select': 'auto',
'user-select': 'auto',
})
;
if (mode)
{
arr
.each(function(){
this.oncontextmenu = this.ondragstart = this.onselectstart = this.onmousedown = this.onmouseup = this.onsource = null;
})
;
_fn_jq_call(_jquery, arr, 'unbind', _fn_event);
_fn_jq_call(_jquery, arr, 'die', _fn_event);
if (_jquery.fn.off)
{
/*
arr
.off('dragstart')
.off('contextmenu')
.off('selectstart')
.off('mousedown')
.off('mouseup')
.off('source')
;
*/
_fn_jq_call(_jquery, arr, 'off', _fn_event);
}
}
});
}
function _uf_my_discuzimage(_this)
{
return $(_this).attr('zoomfile').replace('.thumb.jpg', '');
}
function _uf_my_openfix(_this)
{
var _a = $(_this);
if (_a.is('span, img'))
{
_a = _a.parent('a');
}
if (_a.is('a'))
{
_uf_open(_a.attr('href'));
return true;
}
else
{
return false;
}
}
function _uf_map_maxheight(who)
{
var maxHeight = Math.max.apply(null, $(who).map(function ()
{
return $(this).height();
}).get());
return maxHeight;
}
function _uf_done(event, mode)
{
event.stopPropagation();
if (!mode) event.preventDefault();
}
function _uf_open(url)
{
if (typeof GM_openInTab !== 'undefined')
{
return GM_openInTab(url);
}
return window.open(url, '_blank');
}
function _uf_open_background(url)
{
var _window = _uf_open(url);
var _fn = function(){
_window.blur();
_uf_focus(window);
};
_fn();
setTimeout(_fn, 2000);
return _window;
}
function _uf_focus(who)
{
var _dom = $(who);
if ($.isWindow(who))
{
if (who === window || who === unsafeWindow || $(who) === $(window) || $(who) === $(unsafeWindow))
{
_dom = _dom.add(window);
_dom = _dom.add(unsafeWindow);
_dom = _dom.add('html, body');
}
}
_dom.each(function(){
var _this = $(this);
this.focus();
try
{
_this.focus();
}
catch (e)
{
_this.trigger('focus');
}
try
{
if ($.isWindow(this))
{
var a = document.createElement("a");
a.href = this.location.pathname;
var evt = document.createEvent("MouseEvents");
//the tenth parameter of initMouseEvent sets ctrl key
evt.initMouseEvent("click", true, true, this, 0, 0, 0, 0, 0, true, false, false, false, 0, null);
a.dispatchEvent(evt);
}
}
catch (e)
{}
});
return $(who);
}
function _uf_openimage(url)
{
window.open(url, '_blank');
}
function _myuf_wait(who, done)
{
if (done)
{
who.prop('-data-trueimage-done', true);
who.removeClass('_ufmy_wait');
}
else
{
who.addClass('_ufmy_wait');
}
return who;
}
function _uf_fixsize(who, src)
{
var _old = who.attr('src');
if (src == _old || who.prop('-data-trueimage-done') === true) return _myuf_wait(who, true);
who.prop('-data-trueimage', src);
var w = who.width();
var h = who.height();
_myuf_wait(who);
if (w > 0 && h > 0)
{
who
.width(w)
.height(h)
.attr('lowsrc', _old)
.off('load')
.on('load', function(){
_myuf_wait($(this), true).off('load');
})
.attr('src', who.prop('-data-trueimage'))
;
}
else
{
who
.on('load', function(){
_uf_fixsize($(this), $(this).prop('-data-trueimage')).off('load');
})
;
}
return who;
}
function _uf_fixsize2(who, area, force, scrollsize)
{
var _elem = $(who);
var _ok;
if ($.isPlainObject(area) && $.isNumeric(area.width))
{
area = $('<div/>')
.width(area.width)
.height(area.height !== undefined ? area.height : area.width)
;
}
else if ($.isArray(area) && $.isNumeric(area[0]))
{
area = $('<div/>')
.width(area[0])
.height(area[1] !== undefined ? area[1] : area[0])
;
}
if (area === true || area == who || area == _elem)
{
scrollsize = null;
_ok = true;
}
else if (area)
{
_ok = area;
}
else
{
_ok = window;
}
if (!scrollsize || _ok === true || (scrollsize.width === undefined && scrollsize.height === undefined) || (!scrollsize.width && !scrollsize.height))
{
scrollsize = null;
}
else
{
if (scrollsize == 'auto')
{
scrollsize.width = 'auto';
scrollsize.height = 'auto';
}
scrollsize.width = scrollsize.width || 0;
scrollsize.height = scrollsize.height || 0;
/*
if (scrollsize.width == 'auto')
{
// scrollsize.width = document.documentElement.scrollWidth - document.documentElement.clientWidth;
scrollsize.width = (_ok === true ? 0 : $(_ok).width() - $(_ok).innerWidth());
}
if (scrollsize.height == 'auto')
{
// scrollsize.height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
scrollsize.height = (_ok === true ? 0 : $(_ok).height() - $(_ok).innerHeight());
}
*/
}
_elem.each(function(){
var _this = $(this);
var _area = $(_ok === true ? this : _ok);
var _w = _this[0].naturalWidth;
var _h = _this[0].naturalHeight;
if (!_w || !_h)
{
_w = _this.width();
_h = _this.height();
}
var _w2 = _area.width();
var _h2 = _area.height();
if (scrollsize)
{
/*
_w2 -= scrollsize.width;
_h2 -= scrollsize.height;
*/
_w2 = scrollsize.width == 'auto' ? _area.innerWidth() : _w2 - scrollsize.width;
_h2 = scrollsize.height == 'auto' ? _area.innerHeight() : _h2 - scrollsize.height;
}
var _w3 = _w;
var _h3 = _h;
if (_w > _w2)
{
_w3 = _w2;
_h3 = _h * (_w2 / _w);
// _uf_log(1, [_w, _h, _w/_h], [_w2, _h2, _w2/_h2], [_w3, _h3, _w3/_h3]);
if (_h3 > _h2)
{
_w3 = _w3 * (_h2 / _h3);
_h3 = _h2;
// _uf_log(1, [_w, _h, _w/_h], [_w2, _h2, _w2/_h2], [_w3, _h3, _w3/_h3]);
}
// _this.height(_h * (_w2 / _w)).width(_w2);
}
else if (force || (_h > _h2))
{
_w3 = _w * (_h2 / _h);
_h3 = _h2;
// _uf_log(2, [_w, _h, _w/_h], [_w2, _h2, _w2/_h2], [_w3, _h3, _w3/_h3]);
if (_w3 > _w2)
{
_w3 = _w2;
_h3 = _h * (_w2 / _w);
// _uf_log(2, [_w, _h, _w/_h], [_w2, _h2, _w2/_h2], [_w3, _h3, _w3/_h3]);
}
// _this.width(_w * (_h2 / _h)).height(_h2);
}
else
{
// _uf_log(3, [_w, _h, _w/_h], [_w2, _h2, _w2/_h2], [_w3, _h3, _w3/_h3]);
// _this.height(_h).width(_w);
}
_this.height(_h3).width(_w3);
// _uf_log([_w, _h], [_w2, _h2], [_w3, _h3]);
_this.attr({
'data-naturalHeight': _h,
'data-naturalWidth': _w,
'data-height': _h3,
'data-width': _w3,
});
});
return _elem;
}
function _uf_my_is_google_search(_url_obj)
{
var _bool = _uf_my_is_google_search_core(_url_obj);
if (_bool)
{
_uf_log('is google search', _url_obj);
}
return _bool;
}
function _uf_my_is_google_search_core(_url_obj)
{
// _uf_log(_url_obj);
if (_url_obj.host.match(/\.google\./))
{
if (_url_obj.host.match(/play\.google\.com/))
{
return false;
}
else if (_url_obj.path.match(/\/blank\.html/))
{
return true;
}
else if (_url_obj.path.match(/\/(search|imgres)/))
{
return true;
}
}
else
{
// alert(_url_obj.host);
}
return false;
}
/*
function _uf_log(object)
{
var args = Array.prototype.slice.call(arguments, 0) || [];
// throw new Error(args.toString());
if (typeof console != "undefined")
{
// return console.log.apply(console, args);
return console.log(args);
}
}
*/
function _toggleFullScreen()
{
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement )
{
// current working methods
if (document.documentElement.requestFullscreen)
{
document.documentElement.requestFullscreen();
}
else if (document.documentElement.msRequestFullscreen)
{
document.documentElement.msRequestFullscreen();
}
else if (document.documentElement.mozRequestFullScreen)
{
document.documentElement.mozRequestFullScreen();
}
else if (document.documentElement.webkitRequestFullscreen)
{
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
}
else
{
if (document.exitFullscreen)
{
document.exitFullscreen();
}
else if (document.msExitFullscreen)
{
document.msExitFullscreen();
}
else if (document.mozCancelFullScreen)
{
document.mozCancelFullScreen();
}
else if (document.webkitExitFullscreen)
{
document.webkitExitFullscreen();
}
}
}
function _uf_dom_unwarp_all(elem, _dom)
{
var _this = $(elem);
_dom = _dom || $('<p/>');
_dom = _dom.add(_this.siblings());
var _p = _this.parents().eq(0);
if (_p.not('body, html').size())
{
_dom = _uf_dom_unwarp_all(_p, _dom);
}
return _dom.not(_this);
}
})})(jQuery.noConflict());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment