// ==UserScript==
// @name MV-Usertools
// @namespace MVusertools
// @version 1.10.1
// @description Añade controles avanzados a los posts en MV
// @grant GM_addStyle
// @include http://www.mediavida.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @require http://www.mvusertools.com/ext/libs/tinycon.min.js
// @require http://www.mvusertools.com/ext/libs/jquery.a-tools-1.5.2.js
// @require http://www.mvusertools.com/ext/libs/sisyphus.js
// @require http://www.mvusertools.com/ext/libs/mousetrap.js
// @require http://www.mvusertools.com/ext/libs/jquery.scrollto.js
// ==/UserScript==
////// VARIABLES REUTILIZABLES //////
/CAMBIAR VERSIÓN/var utversion = '1.10.1';
var bbcode = new Array();
var bbtags = new Array("", "", "", "", "", "", "", "", "", "", "", "[media]", "[/media]", "
", "
", "
NSFW
Para acceder a este contenido es necesario ser usuario de la web.
Regístrate (solo necesitas tu mail) o
identifícate si ya tienes cuenta.
", "
", "
", "
", "", "", "
", "
", "
", "[media]", "[/media]");
var theSelection = false;
var clientPC = navigator.userAgent.toLowerCase();
var clientVer = parseInt(navigator.appVersion);
var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_win = ((clientPC.indexOf("win") != -1) || (clientPC.indexOf("16bit") != -1));
var baseHeight;
var is_dark = jQuery("link[rel='stylesheet']").filter(function(){return this.href.match('\/style\/[0-9]+\/mv_oscuro.css')}).length > 0;
var postitlive = jQuery("div#pi_body div.embedded object").length > 0;
var liveactivado = jQuery('div.live_info').length > 0;
var utnoti = jQuery('#userinfo a[href="/foro/favoritos"] strong.bubble').html();
var utavisos = jQuery('#userinfo a[href="/notificaciones"] strong.bubble').html();
var utmsj = jQuery('#userinfo a[href="/mensajes"] strong.bubble').html();
var utusername = jQuery('.lu').html();
////// VARIABLES REUTILIZABLES //////
//Atajos de teclado
//Vars
var utbaseUrl = 'http://www.mediavida.com';
var previousPageLink = jQuery($(".tnext")).attr('href');
var nextPageLink = jQuery($(".tprev")).attr('href');
//Go previus page
if(typeof previousPageLink != 'undefined'){
Mousetrap.bind('ctrl+alt+z', function(){
document.location = utbaseUrl + '/' + previousPageLink;
});
}
//Go next page
if(typeof nextPageLink != 'undefined'){
Mousetrap.bind('ctrl+alt+x', function(){
document.location = utbaseUrl + '/' + nextPageLink;
});
}
//Open/close Spoilers
Mousetrap.bind('ctrl+alt+s', function(){
if (jQuery('div[id="cuerpo"] div[id="sp"]').is(':visible')){
jQuery('div[id="cuerpo"] a.spoiler.less').removeClass('less');
jQuery('div[id="cuerpo"] div[id="sp"]').hide();
}
else {
jQuery('div[id="cuerpo"] a.spoiler').toggleClass('less');
jQuery('div[id="cuerpo"] div[id="sp"]').toggle();
}
});
//Go favorites
Mousetrap.bind('ctrl+alt+e', function(){
document.location = utbaseUrl + '/foro/favoritos';
});
//Go to your profile
Mousetrap.bind('ctrl+alt+q', function(){
document.location = utbaseUrl + '/id/' + utusername;
});
//Go to warnings
Mousetrap.bind('ctrl+alt+w', function(){
document.location = utbaseUrl + '/notificaciones';
});
//Go to private messages
Mousetrap.bind('ctrl+alt+r', function(){
document.location = utbaseUrl + '/mensajes';
});
//Go to forums
Mousetrap.bind('ctrl+alt+a', function(){
document.location = utbaseUrl + '/foro';
});
//Go to spy
Mousetrap.bind('ctrl+alt+d', function(){
document.location = utbaseUrl + '/foro/spy';
});
//Fin de atajos de teclado//
function initInsertions() {
var b;
if (document.forms[form_name]) {
b = document;
} else {
b = opener.document;
}
var a = b.forms[form_name].elements[text_name];
if (is_ie && typeof (baseHeight) != "number") {
a.focus();
baseHeight = b.selection.createRange().duplicate().boundingHeight;
if (!document.forms[form_name]) {
document.body.focus();
}
}
}
function bbstyle2(a) {
if (a >= 0 && a <= 30) {
bbfontstyle(bbtags[a], bbtags[a + 1]);
}
else
console.log("fuera de rango");
}
function bbfontstyle(b, f) {
theSelection = false;
var d = document.forms[form_name].elements[text_name];
d.focus();
if ((clientVer >= 4) && is_ie && is_win) {
theSelection = document.selection.createRange().text;
if (theSelection) {
document.selection.createRange().text = b + theSelection + f;
document.forms[form_name].elements[text_name].focus();
theSelection = "";
return;
}
} else {
if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) {
mozWrap(document.forms[form_name].elements[text_name], b, f);
document.forms[form_name].elements[text_name].focus();
theSelection = "";
return;
}
}
var a = getCaretPosition(d).start;
var c = a + b.length;
insert_text(b + f);
if (!isNaN(d.selectionStart)) {
d.selectionStart = c;
d.selectionEnd = c;
} else {
if (document.selection) {
var e = d.createTextRange();
e.move("character", c);
e.select();
storeCaret(d);
}
}
d.focus();
return;
}
function insert_text(g, d, c) {
var b;
if (!c) {
b = document.forms[form_name].elements[text_name];
} else {
b = opener.document.forms[form_name].elements[text_name];
}
if (d) {
g = " " + g + " ";
}
if (!isNaN(b.selectionStart)) {
var f = b.selectionStart;
var e = b.selectionEnd;
mozWrap(b, g, "");
b.selectionStart = f + g.length;
b.selectionEnd = e + g.length;
} else {
if (b.createTextRange && b.caretPos) {
if (baseHeight != b.caretPos.boundingHeight) {
b.focus();
storeCaret(b);
}
var a = b.caretPos;
a.text = a.text.charAt(a.text.length - 1) == " " ? a.text + g + " " : a.text + g;
} else {
b.value = b.value + g;
}
}
if (!c) {
b.focus();
}
}
function mozWrap(g, d, j) {
var c = g.textLength;
var a = g.selectionStart;
var e = g.selectionEnd;
var b = g.scrollTop;
if (e == 1 || e == 2) {
e = c;
}
var i = (g.value).substring(0, a);
var h = (g.value).substring(a, e);
var f = (g.value).substring(e, c);
g.value = i + d + h + j + f;
g.selectionStart = e + d.length + j.length;
g.selectionEnd = g.selectionStart;
g.focus();
g.scrollTop = b;
return;
}
function storeCaret(a) {
if (a.createTextRange) {
a.caretPos = document.selection.createRange().duplicate();
}
}
function caretPosition() {
var b = null;
var a = null;
}
function getCaretPosition(e) {
var c = new caretPosition();
if (e.selectionStart || e.selectionStart == 0) {
c.start = e.selectionStart;
c.end = e.selectionEnd;
} else {
if (document.selection) {
var a = document.selection.createRange();
var b = document.body.createTextRange();
b.moveToElementText(e);
var d;
for (d = 0; b.compareEndPoints("StartToStart", a) < 0; d++) {
b.moveStart("character", 1);
}
e.sel_start = d;
c.start = e.sel_start;
c.end = e.sel_start;
}
}
return c;
}
// Fin de la magia
//Cosas de Vegon
var blacklistBarra = "<div class='nopost barra'> \
Usuario <span class='mensaje-ocultado'>Blacklisted</span> \
</div> ";
var balcklistToggle ="<div id='toggle' class='sprite'><div> ";
var blacklistInfo = "<span class='blacklisted-post'" + (is_dark ? " style='color: #626262 !important;'" : "") + ">Click en <img src='http://www.mvusertools.com/ext/img/blacklist-mini.png'> para desbloquear.</span>";
var blacklistAvatar = "";
//Inject CSS in header
{
var css =
".sprite {\
background: url(http://www.mvusertools.com/ext/img/sprites18-3.png) no-repeat;\
}\
.usertools TABLE TD\
{\
padding: 3px;\
}\
.usertools A\
{\
}\
.ut-firma\
{\
background-position: 0 -58px;\
text-indent: -9999px;\
width: 14px;\
height: 11px;\
display: block;\
outline: 0;\
margin-top: 1px;\
}\
.ut-firma:hover\
{\
background-position: 0 -69px;\
}\
.mensaje\
{\
background-position: -20px -58px;\
text-indent: -9999px;\
width: 14px;\
height: 10px;\
outline: 0;\
display: block;\
margin-top: 1px;\
}\
.mensaje:hover\
{\
background-position: -20px -68px;\
}\
.blacklist-off\
{\
background-position: -39px -57px;\
text-indent: -9999px;\
width: 12px;\
height: 12px;\
outline: 0;\
display: block;\
margin-top: 1px;\
}\
.blacklist-off:hover\
{\
background-position: -39px -69px;\
}\
.blacklist-on\
{\
background-position: -39px -69px;\
text-indent: -9999px;\
width: 12px;\
height: 12px;\
outline: 0;\
display: block;\
margin-top: 1px;\
}\
.blacklist-on:hover\
{\
background-position: -39px -57px;\
}\
.blacklist\
{\
}\
.ut-online\
{\
background-position: -56px -72px;\
text-indent: -99999px;\
width: 8px;\
height: 12px;\
display: block;\
outline: 0;\
}\
\
.ut-offline\
{\
background-position: -56px -58px;\
text-indent: -99999px;\
width: 8px;\
height: 12px;\
display: block;\
outline: 0;\
}\
.online-pos\
{\
float: left;\
width: 14px;\
z-index: 999;\
}\
.mensaje-pos\
{\
float: left;\
width: 19px;\
}\
.blacklist-pos\
{\
float: right;\
margin-top: -1px;\
width: 15px;\
}\
.firma-pos\
{\
float: left;\
width: 19px;\
}\
.mensaje-ocultado\
{\
font-weight: bold;\
}\
.toggle-on\
{\
background-position: -37px -21px;\
width: 34px;\
height: 34px;\
cursor: pointer;\
}\
.toggle-off\
{\
background-position: 0 -21px;\
width: 34px;\
height: 34px;\
cursor: pointer;\
}\
.tapavatares\
{\
width: 0px; \
height: 0px; \
position:relative;\
}\
.tapavatares span {\
position: abosolute; \
background: url(http://www.mvusertools.com/ext/img/blacklisted.png) no-repeat;\
background-position: 0 4px;\
width: 80px; \
height: 84px; \
top: 6px; \
left: 0px;\
display: block;\
}\
.blacklisted-post\
{\
border-radius: 7px;\
ms-border-radius: 7px;\
-moz-border-radius: 7px;\
-webkit-border-radius: 7px;\
-khtml-border-radius: 7px;\
padding: 3px 10px 2px 10px;\
background: #ccc;\
color: #626262 !important;\
}\
.usertools\
{\
position: relative;\
width: 67px;\
margin-top: 10px;\
}\
button::-moz-focus-inner {\
border: 0;\
padding: 0;\
margin:0;\
}\
.mbuttons button[type], button.alt[type] {\
padding:2px 4px !important;\
\
}\
.mbuttons a:hover,button.alt:hover {\
background-color:#aaaaaa;\
border:1px solid #c2e1ef;\
color:#ffffff;\
}\
button.alt {\
border-color: #aaa !important;\
min-width: 20px;\
border-radius: 5px !important;\
}\
button.bleft {\
border-radius: 5px 0px 0px 5px !important;\
margin-right: 0px !important;\
border-right-width: 0px !important;\
font-weight: normal !important;\
}\
button.bcenter {\
margin-right: 0px !important;\
border-left-width: 1px !important;\
border-left-color: #aaa !important;\
font-weight: normal !important;\
border-radius: 0px !important;\
}\
button.bcenter2 {\
margin-right: 0px !important;\
border-left-width: 0px !important;\
border-left-color: #aaa !important;\
font-weight: normal !important;\
border-radius: 0px !important;\
}\
button.bright {\
border-radius: 0px 5px 5px 0px !important;\
margin-left: 0px !important;\
border-left-width: 0px !important;\
font-weight: normal !important;\
}\
button.bright2 {\
border-radius: 0px 5px 5px 0px !important;\
font-weight: normal !important;\
}\
button.bsolo {\
border-radius: 5px !important;\
font-weight: normal !important;\
}\
button.bb {\
font-weight: bold !important;\
}\
button.bi {\
font-style: italic !important;\
}\
button.bu {\
text-decoration: underline !important;\
}\
button.bs {\
text-decoration: line-through !important;\
}\
.baudio {\
background-position: -0px 3px;\
width: 11px; \
height: 17px; \
display: block; \
}\
.bimg {\
background-position: -25px 3px;\
width: 12px; \
height: 17px; \
display: block; \
margin-left: 1px; \
}\
.bvideo {\
background-position: -12px 3px;\
width: 12px; \
height: 17px; \
display: block; \
}\
.bcentericon {\
background-position: -37px 3px;\
width: 14px; \
height: 17px; \
display: block; \
}\
.blist {\
background-position: -51px 3px;\
width: 14px; \
height: 17px; \
display: block; \
}\
.ut-live td {\
background-color: #FFEEEE;\
}\
.ut-live td.alt {\
background-color: #EFE0E0;\
}\
#modlist {\
margin: 20px 0 0;\
padding: 10px 10px;\
border-radius: 6px 6px 6px 6px;\
}\
.modlistblanco {\
border: 1px solid #D4D4D2;\
}\
.modlistnegro {\
border: 1px solid #273037;\
background-color: #39444B;\
}\
#modlist H3{\
margin-top: 0px !important;\
}\
#modlist A{\
padding: 3px 0 3px 3px;\
display: block;\
}\
.modlistblanco A:nth-child(odd){\
background: #E8EBE3;\
}\
.modlistblanco A:hover{\
background: #D6D8D2;\
}\
.modlistblanco span{\
color: #555555;\
}\
.modlistnegro A:nth-child(odd){\
background: #435058;\
}\
.modlistnegro A:hover{\
background: #273037;\
}\
.modlistnegro span{\
color: #C5D1EC;\
}\
.config {\
background-position: -78px -29px;\
width: 14px;\
height: 14px;\
display: inline-block;\
margin: 0 3px;\
position: relative;\
}\
.utmenubutton{\
padding-left: 15px;\
}\
#ut-mask {\
background: #ffffff; width: 100%; height: 100%; position: fixed; opacity: 0.9; z-index: 9998;\
}\
#ut-mask-menu {\
background: #000000; width: 100%; height: 100%; position: fixed; opacity: 0.9; z-index: 9998;\
}\
#ut-dialog {\
width: 500px; top: 10px; left: 50%; margin-left: -250px; position: absolute; z-index: 9999;\
}\
#ut-dialog-menu {\
width: 500px; top: 50px; left: 50%; margin-left: -250px; position: absolute; z-index: 9999;\
}\
.ut-boton-sino{\
cursor: pointer;\
color: #EF5000;\
}\
#ut-window {\
background: #ffffff; border-radius: 6px; padding: 10px 10px 30px 10px; border: 1px solid #cccccc;\
}\
#ut-menu-contenido {\
background: #fff;\
min-height: 270px;\
}\
#ut-menu-contenido TABLE{\
border-top: 1px solid #ccc;\
}\
.newquote a.toggled, .newquoteblack a.toggled{\
border-style: solid !important;\
border-width: 1px !important;\
margin: 0 !important;\
padding: 0 3px !important;\
}\
.newquote a.toggled {\
border-color: #CCCCCC #CCCCCC #CCCCCC !important;\
}\
.newquoteblack a.toggled{\
border-color: #CCCCCC #CCCCCC #CCCCCC !important;\
}\
.newquote div.quote, .newquoteblack div.quote{\
border: 1px solid #CCCCCC !important;\
margin: 0 0 8px !important;\
border-radius: 0 6px 6px 6px !important;\
}\
.tinycol.bigscreen{\
margin-top: 800px;\
}\
.postit.bigscreen{\
width: 958px;\
padding-left: 0px;\
}\
#pi_body.bigscreen{\
width: 938px;\
}\
.embedded.bigscreen{\
;\
}\
#bigscreen-mode{\
background-position: -99px -28px;\
width: 41px;\
height: 23px;\
float: right;\
margin: 5px 0 5px 10px;\
cursor: pointer;\
}\
#bigscreen-mode:hover{\
background-position: -142px -28px;\
}\
#bigscreen-mode-off{\
background-position: -99px 0;\
width: 41px;\
height: 23px;\
float: right;\
margin: 5px 0px 5px 10px;\
cursor: pointer;\
}\
#bigscreen-mode-off:hover{\
background-position: -141px 0;\
}\
.post .spoiler-content {\
background-color: #F0F2ED;\
padding: 5px;\
border-bottom: 1px solid #d7d9d4;\
}\
.post.odd .spoiler-content {\
background-color: #E7E9E4;\
}\
.post .spoiler-content-black {\
background-color: #435058;\
padding: 5px;\
border-bottom: 1px solid #252C31;\
}\
.post.odd .spoiler-content-black {\
background-color: #39444B;\
}\
#ut-menu-tabs div{\
margin: 0 10px 0 0;\
padding: 3px 4px;\
background: #eee;\
display: inline-block;\
cursor: pointer;\
border-top: 1px solid #CCCCCC;\
border-right: 1px solid #CCCCCC;\
border-left: 1px solid #CCCCCC;\
color: #999;\
font-size: 13px;\
}\
#ut-menu-tabs div.active{\
background: #444;\
color: #eee;\
border-top: 1px solid #CCCCCC;\
border-right: 1px solid #CCCCCC;\
border-left: 1px solid #CCCCCC;\
}\
#ut-menu-tabs div.active:hover{\
background: #444;\
color: #eee;\
border-top: 1px solid #CCCCCC;\
border-right: 1px solid #CCCCCC;\
border-left: 1px solid #CCCCCC;\
}\
#ut-menu-tabs div:hover{\
background: #ddd;\
color: #222;\
}\
#ut-menu-contenido .ut-opciones td:nth-child(2n+1){\
width: 420px;\
}\
.ut-arrow-up{\
background-position: -75px -53px;\
width: 12px;\
height: 17px;\
display: block; \
}\
.ut-arrow-down{\
background-position: -75px -70px;\
width: 12px;\
height: 17px;\
display: block; \
}\
#ut-boton-plus{\
background-color: #888888 !important;\
}\
#ut-boton-plus:hover {\
background-color: #777777 !important;\
}\
.ut-titleymacro{\
padding: 0 0 2px 3px;\
border-left: 2px solid #FF5500;\
margin: 10px 0;\
}\
.ut-titletxt{\
font-weight: bold;\
cursor: default;\
}\
.ut-macrotxt {\
color: #222222;\
text-overflow: ellipsis;\
-o-text-overflow: ellipsis;\
text-overflow: ellipsis;\
overflow:hidden;\
white-space:nowrap;\
width: 460px;\
}\
.ut-macrotxt:hover {\
white-space:pre-wrap;\
}\
.icon-down-list{\
background-position: -97px -59px;\
width: 12px;\
height: 9px;\
display: inline-block;\
vertical-align: middle;\
}\
.UT-trash{\
background-position: -97px -72px;\
width: 11px;\
height: 14px;\
display: inline-block;\
vertical-align: middle;\
}\
.UT-trash-orange{\
background-position: -114px -72px; \
width: 11px;\
height: 14px;\
display: inline-block;\
}\
#ut-button-macros-list{\
position: absolute;\
top: 132px;\
left: 154px;\
width: 125px;\
border-radius: 0px 0px 5px 5px;\
background-color: #565656;\
border: 1px solid #AAAAAA;\
color: #eee;\
}\
#ut-button-macros-list li{\
display: block;\
cursor: pointer;\
border-bottom: 1px solid #888888;\
padding: 1px 1px 1px 3px;\
}\
#ut-button-macros-list li:hover{\
background-color: #aaaaaa;\
}\
.ut-button-macros-list-barrendera{\
top: 68px !important;\
left: 290px !important;\
}\
#ut-button-macros-list-anadir {\
padding: 1px 1px 2px 3px;\
cursor: pointer;\
display: block;\
color: #ccc;\
background-color: #333;\
border-radius: 0 0 5px 5px;\
}\
#ut-button-macros-list-anadir:hover {\
color: #fff;\
background-color: #ff7700;\
}\
#ut-macro {\
overflow: auto;\
width: 98%;\
margin-top: 5px;\
}\
#ut-foros-fav LI{\
margin: 0 0 5px;\
transition: all 0.5s;\
-moz-transition: all 0.5s;\
-ms-transition: all 0.5s;\
-webkit-transition: all 0.5s;\
-o-transition: all 0.5s;\
}\
#ut-foros-fav LI:hover{\
}\
#ut-foros-fav LI A{\
background: #ccc;\
border-radius: 3px 3px 3px 3px;\
border: 1px solid #EEEEEE;\
vertical-align: middle;\
padding: 3px 4px;\
display: inline-block;\
transition: all 0.5s;\
-moz-transition: all 0.5s;\
-ms-transition: all 0.5s;\
-webkit-transition: all 0.5s;\
-o-transition: all 0.5s;\
}\
#ut-foros-fav LI A:hover{\
background: #999;\
}\
#foros-fav-float{\
position: absolute;\
top: 200px;\
margin-left: 1005px;\
opacity: 0.2;\
margin-top: 10px;\
transition: opacity 0.5s;\
-moz-transition: opacity 0.5s;\
-ms-transition: opacity 0.5s;\
-webkit-transition: opacity 0.5s;\
-o-transition: opacity 0.5s;\
}\
#foros-fav-float:hover {\
opacity: 1;\
}\
.foros-fav-float-sticky{\
top: 0px !important;\
position: fixed !important;\
}\
.ut-foros-fav-borrar{\
display: inline-block;\
margin: 0 0 0 10px;\
vertical-align: middle;\
opacity: 0.04;\
transition: all 0.5s;\
-moz-transition: all 0.5s;\
-ms-transition: all 0.5s;\
-webkit-transition: all 0.5s;\
-o-transition: all 0.5s;\
cursor: pointer;\
}\
.ut-foros-fav-borrar:hover{\
opacity: 1;\
}\
.ut-foros-fav-borrar:hover{\
opacity: 1;\
}\
.ut-foro-fav-add {\
background: url('http://www.mvusertools.com/ext/img/star.png') no-repeat scroll center -30px #FF9300;\
height: 38px;\
margin: 40px 0 0 -8px;\
width: 40px;\
transition: margin 0.5s;\
-moz-transition: margin 0.5s;\
-ms-transition: margin 0.5s;\
-webkit-transition: margin 0.5s;\
-o-transition: margin 0.5s;\
cursor: pointer;\
}\
.ut-foro-fav-added {\
background: url('http://www.mvusertools.com/ext/img/star.png') no-repeat scroll center 8px #FF9300;\
}\
.ut-foro-fav-add-moveup{\
margin: 3px 0 0 -8px;\
}\
.ut-filtrar {\
cursor: pointer;\
}\
.ut-opacity {\
opacity: 0.2;\
}\
#ut-filtros-fav{\
}\
#utFavQuitar{\
cursor: pointer;\
margin: 5px 0 20px 0;\
width: 80px;\
opacity: 0.7;\
}\
#utFavAviso{\
cursor: pointer;\
margin: 5px 0 20px 0;\
font-size: 9px;\
opacity: 0.5;\
}\
#utFavAviso:hover{\
opacity: 1;\
}\
#utFavAvisoTxt{\
border: 1px solid #ccc;\
border-radius: 6px;\
padding: 5px;\
margin: -15px 0 20px 0;\
display: none;\
font-size: 9px;\
}\
#ut-filtros-fav .foroicon{\
display: inline-block;\
padding: 0 4px 4px;\
}\
#ut-filtros-tags .cat2{\
display: inline-block;\
margin: 0 15px 5px 5px;\
}\
#ut-fav-filto-titulo{\
font-size: 14px;\
margin: 0 0 9px;\
font-family: Trebuchet MS,Arial,Verdana,sans-serif;\
font-weight: bold;\
}\
.ut-linksfooter{\
margin-top: 15px;\
}\
.ut-linksfooter-blanco{\
border: 1px solid #C7C9C3 !important;\
border-top:1px solid #C7C9C3 !important;\
border-bottom:1px solid #BABCB6 !important;\
background: linear-gradient(to top, #E8EBE3, #D6D8D2) !important;\
background: -webkit-gradient(linear, left top, left bottom, from(#D6D8D2), to(#E8EBE3)) !important;\
}\
.ut-linksfooter-blanco A{\
color: #777 !important;\
}\
.ut-linksfooter-blanco A:hover{\
color: #444 !important;\
}\
.ut-linksfooter-blanco a.lu, .ut-linksfooter-blanco a.ln, .ut-linksfooter-blanco a.lf, .ut-linksfooter-blanco a.lm, .ut-linksfooter-blanco li.logout{\
background-image: url('http://mvusertools.com/ext/img/ut_topbar_icons.gif') !important;\
}\
.ut-linksfooter-blanco strong.bubble {\
background-image: url('http://mvusertools.com/ext/img/bubble.png') !important;\
text-shadow: 0 0 3px #000000 !important;\
}\
.ut_tag{\
color: #ffffff;\
position: absolute;\
margin-top: 28px;\
padding: 2px 4px;\
border-radius: 4px;\
transition: 0.5s;\
-moz-transition: 0.5s;\
-ms-transition: 0.5s;\
-webkit-transition: 0.5s;\
-o-transition: 0.5s;\
cursor: pointer;\
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);\
white-space: nowrap;\
}\
.ut_tag:hover{\
box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);\
}\
.ut_tag_vacia:hover{\
opacity: 1.0 !important;\
width: 65px !important;\
height: 15px !important;\
}\
.ut_tag_info {\
position: absolute;\
background: #cccccc;\
border: 1px solid #999999;\
padding: 5px;\
margin: -129px 0 0 0;\
font-size: 10px;\
border-radius: 0 4px 4px 4px;\
}\
.ut_tag_info input,.ut_tag_info textarea{\
font-size: 9px;\
padding: 1px 1px 3px 1px;\
}\
.ut_tag_info input[type=submit]{\
padding: 0px;\
float: right;\
}\
.ut_tag_info input[type=submit]:hover{\
background: #3e8baf;\
color: #fff;\
}\
.ut_tag_tag, .ut_tag_link, .ut_tag_color {\
width: 110px;\
}\
.ut_tag_info_cerrar {\
cursor: pointer;\
position: absolute;\
margin: -8px 0 0 110px;\
color: #cb0000;\
}\
.ut_tag_colores div{\
width: 10px;\
height: 10px;\
display: inline-block;\
vertical-align: bottom;\
margin: 0 0 1px 1px;\
}\
.ut_tag_colores{\
display: inline;\
padding: 0 0 0 2px;\
}\
.ut_tag_colores_1 {\
background: #64ADCC;\
}\
.ut_tag_colores_2 {\
background: #51C25B;\
}\
.ut_tag_colores_3 {\
background: #C28051;\
}\
.ut_tag_colores_4 {\
background: #E3222F;\
}\
.ut_tag_colores_5 {\
background: #BC62BF;\
}\
.ut_tag_colores_6 {\
background: #4A4A4A;\
}\
";
}
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
heads[0].appendChild(node);
}
}
/////////// MENU ///////////////////////////////////////////////////////////////
var bottominfo = '<p style="margin-top: 20px; font-size: 9px; color: #888888;">Si ves algún fallo prueba siempre a hacer ctrl+f5. Si así no se ha solucionado comunícanoslo con un post en <a href="http://www.mediavida.com/foro/4/mv-usertools-extension-para-firefox-chrome-safari-413818">el hilo oficial</a> indicando navegador y su versión, sistema operativo y, si es posible, una screen del error.<br /><br />Instrucciones y más información en <a href="http://mvusertools.com" target="_blank">la web oficial de la extensión</a>.</p>';
var utlinksfooter = localStorage["utlinksfooter"];
var utlinksfooteroscuro = localStorage["utlinksfooteroscuro"];
var uttablamods = localStorage["uttablamods"];
var utmarcapaginas = localStorage["utmarcapaginas"];
var uticonosportada = localStorage["uticonosportada"];
var uticonosdestacados = localStorage["uticonosdestacados"];
var utlivesdestacados = localStorage["utlivesdestacados"];
var utnewquote = localStorage["utnewquote"];
var utuserinfo = localStorage["utuserinfo"];
var utestilospoilers = localStorage["utestilospoilers"];
var utbigscreen = localStorage["utbigscreen"];
var utordenarposts = localStorage["utordenarposts"];
var utfavicon = localStorage["utfavicon"];
var utmensajeupdate = localStorage["utmensajeupdate"];
var utsalvarposts = localStorage["utsalvarposts"];
var utforosfavs = localStorage["utforosfavs"];
var utfiltrarfavs = localStorage["utfiltrarfavs"];
var utantiguoslinksuserinfo = localStorage["utantiguoslinksuserinfo"];
var utCambiosNombre = localStorage["utCambiosNombre"];
var utTagsOpcion = localStorage["utTagsOpcion"];
var utcerrarspoilers = localStorage["utcerrarspoilers"];
// Forma del menu
jQuery('<div id="ut-config" class="last" style="margin-left: 10px;"><ul class="bar" style="margin: 0px 0px 0px 10px; padding: 0px 12px;"><li><a id="ut-menu" class="sprite config uextra" style="cursor: pointer; margin: 0px 0px 0px -5px;"><span class="utmenubutton">Ut</span></a></li></ul></div>').insertAfter('#userinfo');
jQuery('<div style="display: none;" id="ut-mask-menu"></div>').insertBefore('#background');
var utmenutabs = '<div id="ut-menu-tabs"><div id="ut-menu-tab1" class="active">Modulos</div><div id="ut-menu-tab2">Estilos</div><div id="ut-menu-tab4">Macros</div><div id="ut-menu-tab3">Sobre MV-UT</div></div>';
var utmenutabla1 = '<table id="ut-menu-tabla1" class="ut-opciones"><tbody><tr><td>Ventana con aviso y notas de actualización al actualizar.</td><td><span class="ut-boton-sino" id="ut-utmensajeupdate-si">Si</span> <span class="ut-boton-sino" id="ut-utmensajeupdate-no">No</span></td></tr><tr><td>Activar tags (etiquetas).</td><td><span class="ut-boton-sino" id="ut-utTagsOpcion-si">Si</span> <span class="ut-boton-sino" id="ut-utTagsOpcion-no">No</span></td></tr><tr><td>Tener siempre a la vista foros favoritos.</td><td><span class="ut-boton-sino" id="ut-utforosfavs-si">Si</span> <span class="ut-boton-sino" id="ut-utforosfavs-no">No</span></td></tr><tr><td>Activar filtro para hilos en favoritos.</td><td><span class="ut-boton-sino" id="ut-utfiltrarfavs-si">Si</span> <span class="ut-boton-sino" id="ut-utfiltrarfavs-no">No</span></td></tr><td>Links importantes al final de la página</td><td><span class="ut-boton-sino" id="ut-linksfooter-si">Si</span> <span class="ut-boton-sino" id="ut-linksfooter-no">No</span></td></tr><tr style="background: none;"><td><p id="ut-utlinksfooteroscuro" style="color: #999999;">Links importantes estilo oscuro usando theme predeterminado</p></td><td><span class="ut-boton-sino" id="ut-utlinksfooteroscuro-si">Si</span> <span class="ut-boton-sino" id="ut-utlinksfooteroscuro-no">No</span></td></tr><tr><td>Tabla de mods</td><td><span class="ut-boton-sino" id="ut-uttablamods-si">Si</span> <span class="ut-boton-sino" id="ut-uttablamods-no">No</span></td></tr><tr><td>Información del usuario al dejar el ratón sobre su nick</td><td><span class="ut-boton-sino" id="ut-utuserinfo-si">Si</span> <span class="ut-boton-sino" id="ut-utuserinfo-no">No</span></td></tr><tr><td>Opción para ordenar hilos por respuestas sin leer</td><td><span class="ut-boton-sino" id="ut-utordenarposts-si">Si</span> <span class="ut-boton-sino" id="ut-utordenarposts-no">No</span></td></tr><tr><td>Avisos en el favicon</td><td><span class="ut-boton-sino" id="ut-utfavicon-si">Si</span> <span class="ut-boton-sino" id="ut-utfavicon-no">No</span></td></tr><tr><td>Botón para ensanchar streams en hilos con Live! y postit (Experimental)</td><td><span class="ut-boton-sino" id="ut-utbigscreen-si">Si</span> <span class="ut-boton-sino" id="ut-utbigscreen-no">No</span></td></tr><tr><td>Recupera el texto escrito en el formulario extendido si se cierra la pestaña o navegador (Experimental)</td><td><span class="ut-boton-sino" id="ut-utsalvarposts-si">Si</span> <span class="ut-boton-sino" id="ut-utsalvarposts-no">No</span></td></tr></tbody></table>';
var utmenutabla2 = '<table id="ut-menu-tabla2" class="ut-opciones" style="display: none;"><tbody><tr><td>Marcapáginas</td><td><span class="ut-boton-sino" id="ut-utmarcapaginas-si">Si</span> <span class="ut-boton-sino" id="ut-utmarcapaginas-no">No</span></td></tr><tr><td>Hilos con Live! activado destacados (solo para theme predeterminado)</td><td><span class="ut-boton-sino" id="ut-utlivesdestacados-si">Si</span> <span class="ut-boton-sino" id="ut-utlivesdestacados-no">No</span></td></tr><tr><td>Nuevo estilo para los spoilers</td><td><span class="ut-boton-sino" id="ut-utestilospoilers-si">Si</span> <span class="ut-boton-sino" id="ut-utestilospoilers-no">No</span></td></tr><tr><td>Quitar ventanas flotantes en Avisos, Favs y Msj dejandolo como antes</td><td><span class="ut-boton-sino" id="ut-utantiguoslinksuserinfo-si">Si</span> <span class="ut-boton-sino" id="ut-utantiguoslinksuserinfo-no">No</span></td></tr><tr><td>Cambiar algunos nombres de usuarios y foros</td><td><span class="ut-boton-sino" id="ut-utCambiosNombre-si">Si</span> <span class="ut-boton-sino" id="ut-utCambiosNombre-no">No</span></td></tr><tr><td>Añadir botón para cerrar spoilers al final del mismo</td><td><span class="ut-boton-sino" id="ut-utcerrarspoilers-si">Si</span> <span class="ut-boton-sino" id="ut-utcerrarspoilers-no">No</span></td></tr></tbody></table>';
var utmenutabla3 = '<table id="ut-menu-tabla3" style="display: none;"><tbody><tr><td><a href="http://mvusertools.com" target="blank"><img src="http://www.mediavida.com/img/f/mediavida/2012/11/55268_mv_usertools_extension_para_firefox_chrome_opera_safari_0_full.png" width="48" height="48"><p>MV-Usertools</a> desarrollado por <a href="/id/Vegon">Vegon</a> y <a href="/id/cm07">cm07</a></p><br /><br /><p><a style="cursor: pointer;" id="ut-menu-notasdeparche">Notas del último parche.</a> Versión '+utversion+'.</p><br /><p>Atajos de teclado:<ul><li>- Ir a Favoritos: ctrl+alt+e</li><li>- Ir a Perfil: ctrl+alt+q</li><li>- Ir a Avisos: ctrl+alt+w</li><li>- Ir a Mensajes: ctrl+alt+r</li><li>- Ir a Foros: ctrl+alt+a</li><li>- Ir a Spy: ctrl+alt+d</li><li>- Abrir/Cerrar todos los spoilers: ctrl+alt+s</li><li>- Ir a la anterior página del hilo: ctrl+alt+z</li><li>- Ir a la siguiente página del hilo: ctrl+alt+x</li></ul></p><br /><br /><p>Para comunicar bugs usa el <a href="http://www.mediavida.com/foro/4/mv-usertools-extension-para-firefox-chrome-opera-safari-413818">hilo oficial</a>. Si tienes dudas de como funciona algun modulo u opción visita el <a href="http://mvusertools.com/caracteristicas">manual en la web oficial</a> que siempre está actualizado con las ultimas novedades.</p><br /><br /><p>Si las MV-Usertools te resultan utiles y quieres agradecernos las horas de trabajo detrás de ellas, tiranos algunas monedas.</p><br /><form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="s-xclick"><input type="hidden" name="hosted_button_id" value="2TD967SQAC6HC"><input type="image" src="https://www.paypalobjects.com/es_ES/ES/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal. La forma rápida y segura de pagar en Internet."><img alt="" border="0" src="https://www.paypalobjects.com/es_ES/i/scr/pixel.gif" width="1" height="1"></form></td></tr></tbody></table>';
var utmenutabla4 = '<table id="ut-menu-tabla4" style="display: none;"><tbody><tr><td><form id="ut-macros-form"><input id="ut-title" placeholder="Título" maxlength="17"><br /><textarea id="ut-macro" placeholder="Macro"></textarea><br /><input type="submit" value="Guardar" style="margin-top: 3px;" ></form><ul id="ut-macros"></ul></td></tr></tbody></table>';
jQuery('<div style="display: none;" id="ut-dialog-menu"><div id="ut-window"><div id="ut-menu-contenido">'+ utmenutabs +''+ utmenutabla1 +''+ utmenutabla2 +''+ utmenutabla4 +''+ utmenutabla3 +'</div>'+ bottominfo +'<a style="float: right; margin-top: 10px; cursor: pointer;" id="ut-menu-cerrar">Cerrar</a></div></div>').insertBefore('#content_head');
jQuery('#ut-menu-tabla1 tr:odd, #ut-menu-tabla2 tr:odd, #ut-menu-tabla3 tr:odd').addClass('odd');
jQuery('#ut-menu-tab1').click(function () {
jQuery('#ut-menu-tab1').addClass('active');
jQuery('#ut-menu-tab2').removeClass('active');
jQuery('#ut-menu-tab3').removeClass('active');
jQuery('#ut-menu-tab4').removeClass('active');
jQuery('#ut-menu-tabla1').show();
jQuery('#ut-menu-tabla2').hide();
jQuery('#ut-menu-tabla3').hide();
jQuery('#ut-menu-tabla4').hide();
});
jQuery('#ut-menu-tab2').click(function () {
jQuery('#ut-menu-tab1').removeClass('active');
jQuery('#ut-menu-tab2').addClass('active');
jQuery('#ut-menu-tab3').removeClass('active');
jQuery('#ut-menu-tab4').removeClass('active');
jQuery('#ut-menu-tabla1').hide();
jQuery('#ut-menu-tabla2').show();
jQuery('#ut-menu-tabla3').hide();
jQuery('#ut-menu-tabla4').hide();
});
jQuery('#ut-menu-tab3').click(function () {
jQuery('#ut-menu-tab1').removeClass('active');
jQuery('#ut-menu-tab2').removeClass('active');
jQuery('#ut-menu-tab3').addClass('active');
jQuery('#ut-menu-tab4').removeClass('active');
jQuery('#ut-menu-tabla1').hide();
jQuery('#ut-menu-tabla2').hide();
jQuery('#ut-menu-tabla3').show();
jQuery('#ut-menu-tabla4').hide();
});
jQuery('#ut-menu-tab4').click(function () {
jQuery('#ut-menu-tab1').removeClass('active');
jQuery('#ut-menu-tab2').removeClass('active');
jQuery('#ut-menu-tab3').removeClass('active');
jQuery('#ut-menu-tab4').addClass('active');
jQuery('#ut-menu-tabla1').hide();
jQuery('#ut-menu-tabla2').hide();
jQuery('#ut-menu-tabla3').hide();
jQuery('#ut-menu-tabla4').show();
});
jQuery('#ut-menu').click(function () {
jQuery('#ut-mask-menu').show();
jQuery('#ut-dialog-menu').show();
});
jQuery('#ut-menu-cerrar').click(function() {
jQuery('#ut-dialog-menu').hide();
jQuery('#ut-mask-menu').hide();
});
jQuery('#ut-mask-menu').click(function() {
jQuery('#ut-dialog-menu').hide();
jQuery('#ut-mask-menu').hide();
});
var nicklenght = jQuery('#userinfo a[href="/id/"]').text().length;
jQuery(function() {
if (nicklenght > 10) {
jQuery('#nav_bar #buscar').css('width','130px');
jQuery('#nav_bar #sbii').css('width','93px');
jQuery('#nav_bar .bbii').css('left','103px');
}
});
jQuery(function() {
if (nicklenght == 7) {
jQuery('#nav_bar #buscar').css('width','170px');
jQuery('#nav_bar #sbii').css('width','133px');
jQuery('#nav_bar .bbii').css('left','143px');
}
});
// CONSTRUCTORES DE OPCIONES
var utOpcionesSi = function(opcion) {
jQuery('#ut-'+opcion+'-si').click(function() {
localStorage[''+opcion+''] = 'si';
jQuery('#ut-'+opcion+'-no').css('color','#999999');
jQuery('#ut-'+opcion+'-si').css('color','#EF5000');
});
jQuery('#ut-'+opcion+'-no').click(function() {
localStorage[''+opcion+''] = 'no';
jQuery('#ut-'+opcion+'-si').css('color','#999999');
jQuery('#ut-'+opcion+'-no').css('color','#EF5000');
});
if (localStorage[opcion] == 'si' || localStorage[opcion] == undefined) {
jQuery('#ut-'+opcion+'-no').css('color','#999999');
}
if (localStorage[opcion] == 'no') {
jQuery('#ut-'+opcion+'-si').css('color','#999999');
}
};
var utOpcionesNo = function(opcion) {
jQuery('#ut-'+opcion+'-si').click(function() {
localStorage[opcion] = 'si';
jQuery('#ut-'+opcion+'-no').css('color','#999999');
jQuery('#ut-'+opcion+'-si').css('color','#EF5000');
});
jQuery('#ut-'+opcion+'-no').click(function() {
localStorage[opcion] = 'no';
jQuery('#ut-'+opcion+'-si').css('color','#999999');
jQuery('#ut-'+opcion+'-no').css('color','#EF5000');
});
if (localStorage[opcion] == 'si') {
jQuery('#ut-'+opcion+'-no').css('color','#999999');
}
if (localStorage[opcion] == 'no' || localStorage[opcion] == undefined) {
jQuery('#ut-'+opcion+'-si').css('color','#999999');
}
};
// Opciones
utOpcionesSi('utordenarposts');
utOpcionesSi('utbigscreen');
utOpcionesSi('utestilospoilers');
utOpcionesSi('utuserinfo');
utOpcionesSi('utnewquote');
utOpcionesSi('utlivesdestacados');
utOpcionesSi('uticonosdestacados');
utOpcionesSi('uticonosportada');
utOpcionesSi('utmarcapaginas');
utOpcionesSi('uttablamods');
utOpcionesSi('utfavicon');
utOpcionesSi('utforosfavs');
utOpcionesSi('utfiltrarfavs');
utOpcionesSi('utCambiosNombre');
utOpcionesSi('utTagsOpcion');
utOpcionesNo('utsalvarposts');
utOpcionesNo('utmensajeupdate');
utOpcionesNo('utlinksfooteroscuro');
utOpcionesNo('utantiguoslinksuserinfo');
utOpcionesNo('utcerrarspoilers');
// Boton de utlinksfooter. Tiene funciones extras, no es posible usar el constructor.
jQuery('#ut-linksfooter-si').click(function() {
localStorage["utlinksfooter"] = 'si';
jQuery('#ut-linksfooter-no').css('color','#999999');
jQuery('#ut-linksfooter-si').css('color','#EF5000');
jQuery('#ut-utlinksfooteroscuro').css('color','#222222');
});
jQuery('#ut-linksfooter-no').click(function() {
localStorage["utlinksfooter"] = 'no';
jQuery('#ut-linksfooter-si').css('color','#999999');
jQuery('#ut-linksfooter-no').css('color','#EF5000');
jQuery('#ut-utlinksfooteroscuro').css('color','#999999');
});
if (utlinksfooter == 'si' || utlinksfooter == undefined) {
jQuery('#ut-linksfooter-no').css('color','#999999');
jQuery('#ut-utlinksfooteroscuro').css('color','#222222');
}
if (utlinksfooter == 'no') {
jQuery('#ut-linksfooter-si').css('color','#999999');
jQuery('#ut-utlinksfooteroscuro').css('color','#999999');
}
// Mensaje al updatear
var utversionls = localStorage["utversionls"];
var utpatchnotes = '<p style="font-size: 16px; font-weight: bold;">Actualización '+ utversion +'</p><br /><br />\
- Corrección de errores.<br /><br />\
';
jQuery('<div style="display: none" id="ut-mask"></div>').insertBefore('#background');
jQuery('<div style="display: none" id="ut-dialog"><a href="http://mvusertools.com" target="_blank"><img style="margin: 0 150px;" src="http://www.mediavida.com/img/f/mediavida/2012/10/02632_mv_usertools_extension_para_firefox_chrome_safari_0_full.png"></a><div id="ut-window">'+ utpatchnotes +''+ bottominfo +'<a style="float: right; margin-top: 10px; cursor: pointer;" id="ut-box-cerrar">Cerrar</a></div></div>').insertBefore('#content_head');
jQuery(function(){
if (utmensajeupdate == 'si') {
if (utversionls != utversion) {
jQuery('div#ut-mask').show();
jQuery('div#ut-dialog').show();
localStorage["utversionls"] = utversion;
}
}
else {
localStorage["utversionls"] = utversion;
}
jQuery('#ut-menu-notasdeparche').click(function() {
jQuery('#ut-dialog-menu').hide();
jQuery('#ut-mask-menu').hide();
jQuery('div#ut-mask').show();
jQuery('div#ut-dialog').show();
});
jQuery('#ut-box-cerrar').click(function() {
jQuery('div#ut-mask').hide();
jQuery('div#ut-dialog').hide();
});
jQuery('#ut-mask').click(function() {
jQuery('div#ut-mask').hide();
jQuery('div#ut-dialog').hide();
});
});
// FUCKING TAGS
jQuery(function() {
if (utTagsOpcion == 'si' || utTagsOpcion == undefined) {
if (localStorage['ut-Tags'] == undefined) {
//var utTags = {"Vegon":{tag:"tag",link:"http://google.es",color:"#98C6F8"}, "-Power":{tag:"tag2",link:"http://mediavida.com",color:"rgb(116, 173, 121)"}};
var utTags = {};
localStorage['ut-Tags'] = JSON.stringify(utTags);
}
// Dibuja tags en el hilo
var utTags = JSON.parse(localStorage['ut-Tags']);
jQuery(':not(form)> div.post > div.autor > dl > dt > a').each(function() {
var nick = jQuery(this).text();
if (typeof utTags[nick] !== "undefined") { // dibuja con datos
jQuery(this).closest('.autor').append('<div class="ut_tag" style="background-color: '+utTags[nick].color+'">'+utTags[nick].tag+'</div><div class="ut_tag_info" style="display:none;"><div class="ut_tag_info_cerrar">x</div><form class="ut_tag_form">> Tag<br><input class="ut_tag_tag" value="'+utTags[nick].tag+'" maxlength="25"><br />> Color<div class="ut_tag_colores" style="display: inline;"><div class="ut_tag_colores_1"></div><div class="ut_tag_colores_2"></div><div class="ut_tag_colores_3"></div><div class="ut_tag_colores_4"></div><div class="ut_tag_colores_5"></div><div class="ut_tag_colores_6"></div></div><br><input class="ut_tag_color" value="'+utTags[nick].color+'" maxlength="26"><br />> <span class="ut_tag_link_span"><a href="'+utTags[nick].link+'" target="_blank">Link</a></span><br><input class="ut_tag_link" value="'+utTags[nick].link+'"><br />> Descripción<br><textarea class="ut_tag_desc" style="width: 110px;">'+utTags[nick].desc+'</textarea><br /><input type="submit" style="margin-top: 1px;" value="Guardar"></form></div>');
if (utTags[nick].link === "") { // quita el link si no tiene enlace
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_link_span').replaceWith('<span class="ut_tag_link_span">Link</span>');
}
}
else { // dibuja sin datos
jQuery(this).closest('.autor').append('<div class="ut_tag ut_tag_vacia" style="background-color: #aaaaaa; opacity: 0.25; width: 9px; height: 15px; overflow: hidden;">+ etiqueta</div><div class="ut_tag_info" style="display:none;"><div class="ut_tag_info_cerrar">x</div><form class="ut_tag_form">> Tag<br><input class="ut_tag_tag" placeholder="Tag" maxlength="25"><br />> Color<div class="ut_tag_colores" style="display: inline;"><div class="ut_tag_colores_1"></div><div class="ut_tag_colores_2"></div><div class="ut_tag_colores_3"></div><div class="ut_tag_colores_4"></div><div class="ut_tag_colores_5"></div><div class="ut_tag_colores_6"></div></div><br><input class="ut_tag_color" placeholder="#5eadb9" maxlength="26"><br />> <span class="ut_tag_link_span">Link</span><br><input class="ut_tag_link" placeholder="http://"><br />> Descripción<br><textarea placeholder="Descripción" class="ut_tag_desc" style="width: 110px;"></textarea><br /><input type="submit" style="margin-top: 1px;" value="Guardar"></form></div>');
}
jQuery(this).closest('.autor').children(".ut_tag_info").on('submit', 'form.ut_tag_form', function() { // guardamos datos del tag
var $tag = jQuery(this).children(".ut_tag_tag");
var $color = jQuery(this).children(".ut_tag_color");
var $link = jQuery(this).children(".ut_tag_link");
var $desc = jQuery(this).children(".ut_tag_desc");
var tag = $tag.val();
var color = $color.val();
if (color === "") { // si no se rellena el color, mete uno default
var color = '#1392ED';
}
var link = $link.val();
var desc = $desc.val();
utTags[''+nick+''] = {tag:''+tag+'', color:''+color+'', link:''+link+'', desc:''+desc+''};
if (utTags[''+nick+''].tag !== "") { // si el tag esta relleno mete y actualiza
jQuery(':not(form)> div.post > div.autor > dl > dt > a:contains("'+nick+'")').each(function() {
jQuery(this).closest('.autor').children('.ut_tag').replaceWith('<div class="ut_tag" style="background-color: '+utTags[nick].color+'">'+utTags[nick].tag+'</div>');
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_tag').attr('value',''+utTags[nick].tag+'');
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_color').attr('value',''+utTags[nick].color+'');
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_link').attr('value',''+utTags[nick].link+'');
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_link_span').replaceWith('<span class="ut_tag_link_span"><a href="'+utTags[nick].link+'" target="_blank">Link</a></span>');
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_desc').text(''+utTags[nick].desc+'');
if (utTags[nick].link === "") { // quita el link si no tiene enlace
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').children('.ut_tag_link_span').replaceWith('<span class="ut_tag_link_span">Link</span>');
}
jQuery(this).closest('div.autor').children('.ut_tag_info').hide();
});
}
else { // si el tag esta vacio borra key y deja default
jQuery(':not(form)> div.post > div.autor > dl > dt > a:contains("'+nick+'")').each(function() {
delete utTags[''+nick+''];
jQuery(this).closest('.autor').children('.ut_tag').replaceWith('<div class="ut_tag ut_tag_vacia" style="background-color: #aaaaaa; opacity: 0.25; width: 9px; height: 15px; overflow: hidden;">+ etiqueta</div>');
jQuery(this).closest('.autor').children('.ut_tag_info').children('.ut_tag_form').replaceWith('<form class="ut_tag_form">> Tag<br><input class="ut_tag_tag" placeholder="Tag" maxlength="25"><br />> Color<div class="ut_tag_colores" style="display: inline;"><div class="ut_tag_colores_1"></div><div class="ut_tag_colores_2"></div><div class="ut_tag_colores_3"></div><div class="ut_tag_colores_4"></div><div class="ut_tag_colores_5"></div><div class="ut_tag_colores_6"></div></div><br><input class="ut_tag_color" placeholder="#5eadb9" maxlength="26"><br />> <span class="ut_tag_link_span">Link</span><br><input class="ut_tag_link" placeholder="http://"><br />> Descripción<br><textarea placeholder="Descripción" class="ut_tag_desc" style="width: 110px;"></textarea><br /><input type="submit" style="margin-top: 1px;" value="Guardar"></form>');
jQuery(this).closest('div.autor').children('.ut_tag_info').hide();
});
}
localStorage['ut-Tags'] = JSON.stringify(utTags);
return false;
});
});
// Funciones de los botones
jQuery('.autor').each(function() {
jQuery(this).on('click', '.ut_tag, .ut_tag_info_cerrar', function(){
jQuery(this).closest('div.autor').children('.ut_tag_info').toggle();
});
});
jQuery('.autor').each(function() {
jQuery(this).on('click', '.ut_tag_colores_1, .ut_tag_colores_2, .ut_tag_colores_3, .ut_tag_colores_4 , .ut_tag_colores_5, .ut_tag_colores_6 ', function(){
var color = jQuery(this).css('background-color');
jQuery(this).closest('div.ut_tag_colores').siblings('.ut_tag_color').attr('value',''+color+'');
});
});
}
});
// Botón para cerrar spoiler al final del mismo
jQuery(function() {
if (utcerrarspoilers == 'si') {
jQuery('div[id="cuerpo"] div[id="sp"]').append('<br /><br /><a class="ut-cerrarspoiler-boton" style="cursor: pointer;">Cerrar Spoiler</a>');
jQuery('.ut-cerrarspoiler-boton').click(function() {
var utSpoilerPostId = jQuery(this).closest('div.post').attr('id');
var utSpoilerId = jQuery(this).closest('div[id="sp"]').attr('id');
jQuery(this).closest('div[id="sp"]').siblings('a[rel="'+ utSpoilerId +'"]').removeClass('less');
jQuery(this).closest('div[id="'+ utSpoilerId +'"]').hide();
jQuery('#'+utSpoilerPostId).ScrollTo({
duration: 0
});
});
}
});
// Antiguos links de favs/avisos/msj
jQuery(function() {
if (utantiguoslinksuserinfo == 'si') {
var utnotifylinkdesnudo = jQuery('#nav_bar a#notifylink').closest('li').clone();
var utfavslinkdesnudo = jQuery('#nav_bar a#favslink').closest('li').clone();
var utmplinkdesnudo = jQuery('#nav_bar a#mplink').closest('li').clone();
jQuery('#nav_bar a#notifylink').closest('li').remove();
jQuery('#nav_bar a#favslink').closest('li').remove();
jQuery('#nav_bar a#mplink').closest('li').remove();
var navbarAncla = jQuery('#nav_bar a[href="/id/"]').closest('li');
utnotifylinkdesnudo.add(utfavslinkdesnudo).add(utmplinkdesnudo).insertAfter(navbarAncla);
}
});
// Filtrar favoritos
jQuery(function() {
if (utfiltrarfavs == 'si' || utfiltrarfavs == undefined) {
jQuery('#favoritos .tinycol').prepend('<div id="ut-filtros-fav">');
jQuery('<h3 id="ut-fav-filto-titulo">').text('Filtros').insertBefore('#ut-filtros-fav');
/* Movemos y filtramos iconos de foros /
jQuery(document).on('mouseover','body', function(){
jQuery('#tfav a.foroicon').each(function() {
jQuery('#ut-filtros-fav').append(jQuery(this).clone());
});
var utforosUnicos = {};
jQuery('#ut-filtros-fav a.foroicon').each(function() {
jQuery(this).attr('href','#filtrados');
var interiorA = jQuery(this).html();
if (utforosUnicos[interiorA])
jQuery(this).remove();
else
utforosUnicos[interiorA] = true;
});
});
/ Filtramos foros y categorias /
jQuery(document).on('click', '#ut-filtros-fav a.foroicon', function() {
jQuery('#ut-filtros-fav a.foroicon').removeClass('ut-opacity');
jQuery('#tfav tr').removeClass('utfiltrado');
jQuery('#ut-filtros-tags').remove();
jQuery('#tfav a.foroicon').closest('tr').attr('style','display: table-row;');
var foroImgSrc = jQuery(this).children('i').attr("class").match(/fid(.)/)[1];
jQuery('#tfav a.foroicon i').not('.fid'+foroImgSrc+'').closest('tr').addClass('utfiltrado').hide();
jQuery('#ut-filtros-fav a.foroicon').not(this).addClass('ut-opacity');
jQuery('<div id="ut-filtros-tags">').insertAfter('#ut-filtros-fav');
jQuery('#tfav tr').not('tr.utfiltrado').children('td.dash').children('a.cat2').each(function() {
jQuery('#ut-filtros-tags').append(jQuery(this).clone().removeAttr('title'));
});
jQuery('#ut-filtros-tags a.cat2 img').removeAttr('alt', 'style');
var utCatsUnicos = {};
jQuery('#ut-filtros-tags a.cat2').each(function() {
jQuery(this).attr('href','#filtrados');
var interiorB = jQuery(this).html();
if (utCatsUnicos[interiorB])
jQuery(this).remove();
else
utCatsUnicos[interiorB] = true;
});
});
jQuery(document).on('click', '#ut-filtros-tags a.cat2', function() {
jQuery('#ut-filtros-tags a.cat2').removeClass('ut-opacity');
jQuery('#tfav a.foroicon').closest('tr').not('tr.utfiltrado').attr('style','display: table-row;');
var catImgSrc = jQuery(this).children('img').attr('src');
jQuery('#tfav a.cat2 img').not('img[src="'+catImgSrc+'"]').closest('tr').hide();
jQuery('#ut-filtros-tags a.cat2').not(this).addClass('ut-opacity');
});
/* Quitamos filtros */
jQuery('<p id="utFavQuitar">').text('Quitar filtro.').insertAfter('#ut-filtros-fav');
jQuery(document).on('click', '#utFavQuitar', function() {
jQuery('#ut-filtros-fav a.foroicon').removeClass('ut-opacity');
jQuery('#tfav tr').removeClass('utfiltrado');
jQuery('#ut-filtros-tags').remove();
jQuery('#tfav a.foroicon').closest('tr').attr('style','display: table-row;');
});
/* Aviso para los que tienen más de 30 favoritos */
var utVerMasFav = jQuery('#favoritos .tfooter #moar').text();
if (utVerMasFav === 'Ver más') {
jQuery('<p id="utFavAviso">').text('Tienes más de 30 favoritos +').insertAfter('#utFavQuitar');
jQuery('<div id="utFavAvisoTxt">').html('Para que el filtro funcione con todos tus hilos guardados en favoritos, debes darle al botón de "Ver más" al final de la lista de hilos. Si no se muestran el filtro no tendrá efecto en ellos.').insertAfter('#utFavAviso');
jQuery('#utFavAviso').click(function(){
jQuery('