NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Script JKStyle
// @namespace https://openuserjs.org/scripts/AngelKrak/Script_JKStyle
// @description Script para cambiar "Funciones" de JKanime
// @grant GM_xmlhttpRequest
// @grant GM_info
// @grant GM_getMetadata
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_registerMenuCommand
// @homeURL https://openuserjs.org/scripts/AngelKrak/Script_JKStyle
// @author Angel Komander(AK)
// @website http://angelkrak.hol.es
// @version 1.7
// @grant none
// @include http://*jkanime.net/*
// @include http://*www.jkanime.net/*
// @require http://clipboardjs.com/dist/clipboard.min.js
// @require http://cdn.jsdelivr.net/alertifyjs/1.6.0/alertify.min.js
// ==/UserScript==
// Version 0.3 JKStyle - NOVEDADES [26-Oct-15]
/* Version Primera que traia todo por Defecto */
// Version 0.4 JKStyle - NOVEDADES [14-Sep-15]
/* Cambios en las Etiquetas y Imagen de Preview en Enlaces + Semi-Transparencia en Titulos de JK */
// Version 0.5 JKStyle - NOVEDADES [02-Nov-15]
/* Nuevo ModalBox para las Miniaturas + Nuevo Color para los Titulos del Script */
// Version 0.6 JKStyle - NOVEDADES [03-Nov-15]
/* Nuevo Boton para Eliminar la Imagen que has puesto en X Seccion, Boton para copiar el Enlace de la Imagen, Imagen por Defecto(Si no has puesto ninguna imagen, aparecera otra imagen por Defecto) y Nuevo Scrollbar para los Enlaces */
// Version 0.7 JKStyle - NOVEDADES [04-Nov-15]
/* Cursor Personalizado, Ocultar el Sidebar al Expandir el Reproductor, Ancho Maximo en el Script + Scroll en el Enlace, Nuevo Boton para Añadir la Imagen Individualmente, Nuevo Tamaño para las Imagenes del Modal, Mostrar/Ocultar Sidebar, Scrollbar de JKAnime Custom */
// Version 0.8 JKStyle - NOVEDADES [05-Nov-15]
/* Nuevo Imagen para el Boton del Script, Script de Copy to Clipboard */
// Version 0.8.1 JKStyle - NOVEDADES [06-Nov-15]
/* Fix del Reproductor Desuka y Viento */
// Version 0.8.2 JKStyle - NOVEDADES [07-Nov-15]
/* Nuevo Margen para los Botones */
// Version 0.9 JKStyle - NOVEDADES [07-Nov-15]
/* Nuevo Script de Update Notification */
// Version 1.0 JKStyle - NOVEDADES [09-Nov-15]
/* Comentarios para las Funciones del Script y Mensaje de Error si no ahi Imagenes Establecidas */
// Version 1.1 JKStyle - NOVEDADES [11-Nov-15]
/* Load Automatico(Ahora ya no necesitas recargar para que se vean las imagenes agregadas) */
// Version 1.2 JKStyle - NOVEDADES [11-Nov-15]
/* Nuevo diseño para la Lista de Animes */
// Version 1.3 JKStyle - NOVEDADES [18-Nov-15]
/* Fix del Nuevo diseño de Animes en el Buscador + Copyright del Creador */
// Version 1.4 JKStyle - NOVEDADES [23-Nov-15]
/* Nueva Funcion de Recarga(Ahora solo se Recargara cada vez que se de Click en X Boton y no se estara Recargando a Cada Rato) */
// Version 1.5 JKStyle - NOVEDADES [28-Nov-15]
/* Nuevo Diseño del Script JKStyle */
// Version 1.6 JKStyle - NOVEDADES [30-Nov-15]
/* Notificaciones de Agregar, Copiar y Eliminar y Nuevo Boton para Ocultar el Contenido de JKAnime(Para que se vea nomas el Fondo) */
// Version 1.7 JKStyle - NOVEDADES [12-Feb-16]
/* Contador de Usuarios Online, Anime Recomendado y Anime Diario(Este se actualizara cada dia), Boton de Compartir en los Capitulos */
/* Link Extras de Estilos */
jQuery('head').append('<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"><link rel="stylesheet" href="//cdn.jsdelivr.net/alertifyjs/1.6.0/css/alertify.min.css"/>');
/* Estilos para la Transparencia */
jQuery('head').append('<style id="transparent" type="text/css">::-webkit-scrollbar{-webkit-appearance: none; width: 7px;}::-webkit-scrollbar-thumb{border-radius: 4px; background-color: rgba(0,0,0,.5); -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);}.slideback{padding: 10px;background: rgba(255,255,255, .5);}.lista_title,.sinopsis_title,.optional_title{color: #212123;background: rgba(255,255,255, .7);}.srcpage_title{margin: 0;background: rgba(255,255,255, .7);width: 586px;color: #212123;border-radius: 7px 7px 0px 0px;}.listpage{margin:5px 0px;}#content-episodes li{width:542px;}.listpage li{width: 490px;}#content{background:0 0;border:1px solid #D5D5D5;border-radius:3px}#global{background-attachment:fixed;background-position:50% 0;background-repeat:no-repeat;background-size:100%;height:100%}#latest_animes_menu{background:rgba(242,246,247,.4)}#select_lang{color:#000}#simplemodal-container code{background:rgba(0,0,0,.3);color:#fff}.listpage li a:hover,.rated_stars span,.spec:hover div a,.src_box{color:#000}#top_menu{background:0 0;border:1px solid #D5D5D5}#videobox_content div,.video_option_act{position:relative;z-index:9999}#videobox_content div a{position:relative;z-index:999999}.capitulos_right .seoblock{background-color:rgba(249,249,249,.6)}#letters_bg,#select_lang,.comment_like,.cont_top,.latest_end,.listbox,.listpage .search,.publibox,.publibox iframe,.ratedback,.ratedwhite,.select_lang_act,.srcpage_box,.video_actions,.videobox{background:0 0}.listpage .search,.listpage .search p{color:#000;opacity:.99}.listpage .search:hover,.listpage li:hover{background-color:rgba(249,249,249,.6)}.mode_extend{width:100%}.nivo-caption p{opacity:1}.player_conte{display:block;width:98%;margin:0 auto;}#a4gss77519563910,#moveboxr,.ads_home,.search_right .feed_box{display:none !important}.publibox iframe{height:218px}.ratedul li:hover,.spec:hover{background-color:rgba(249,249,249,.5)}.search_right .publibox:nth-child(1){border: 0;background-size:100% 100%;height:500px;border:0;}.select_lang_act{margin:1.5px 0 0 170px}.descripbox,.listnavi .listpag,.listpage li,.seoblock{background-color:rgba(242,246,247,.3)}.simplemodal-container{background-color:rgba(249,249,249,.6);z-index:999999}.sinopsis_title{border-radius:9px 6px 0 0;margin:0;width:552px}.src_box{background:0 0;font-family:georgia;font-size:18px;outline:0}.sticboxl_act,.video_actions_act{position:relative;z-index:9999}.comment_like,.video_left>.videobox{background:rgba(255,255,255,.5)}.video_right .publibox:nth-child(1){background-size:100% 100%;height:500px;position:relative;border:0;/*margin-top: -100%;transform: translate(-0%, -30%);*/}.nivo-caption p{opacity:1 !important;}#home_content_right{margin: 0;}</style>');
/* Estilos para el Script */
jQuery('head').append('<style id="script" type="text/css">*{margin:0;padding:0}.icono{position:fixed;font-size:24px;top:25px;right:20px;padding:15px;color:#FFF;z-index:10000;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;background:rgba(0,0,0,.3);-webkit-transition:all 1s ease;-moz-transition:all 1s ease;-ms-transition:all 1s ease;-o-transition:all 1s ease;transition:all 1s ease}.menu,.opac-men{height:100vh;position:fixed;top:0}.icono:hover{background:rgba(0,0,0, 1)}.opac-men{width:100vw;z-index:9999;background:rgba(0,0,0,.4);left:0;opacity:0;pointer-events:none}.menu{width:60%;background:rgba(0,0,0,.555);display:block;left:-100%;z-index:10000;max-width:500px;overflow:auto}#setfondo,#setsidebar,#setcursor{float:right;padding:14px;position:relative;margin:-46px -32px 0 0;z-index:10;color: #8A8686;border-left: 1px solid rgba(70, 64, 64, 0.5);border-bottom: 1px solid rgba(0,0,0, .6);line-height: 1.24;font-family: "roboto";font-size: 14px;}.imglink span {width: 50%;display: inline-block;overflow:auto;padding-bottom:10px;padding-top: 8px;}.imglink span::-webkit-scrollbar{width:7px;height:7px}.imglink span::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.3)}.imglink span:hover::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.8)}.btn-del,.btn-copy,.btn-add{padding:10px;color:#fff;background-color:#ff5252;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);border-radius:3px;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:14px;font-weight:500;max-width:70px;display:block;text-decoration:none}div.cont-btn{float:right;margin:-10px -10px}.btn-del{margin-top:6px;background:rgba(255,255,255, .2);}.btn-copy{background:rgba(255,255,255, .2);}.setimg{background: rgba(16, 13, 13, 0.6);border-radius: 0;box-shadow: none;}.setimg:after,.setimg:hover:after{content:"";position:absolute;left:0;bottom:0;transition:all 1s ease}.setimg:after{width:0;border-bottom: 1px solid #504C4C;}.setimg:hover:after{width:100%}.imglink img{width:100px;vertical-align:top;height:80px;margin:-15px 15px -15px -15px;}.button,.label{margin-top:-1px}.button,h2.insert{cursor:pointer}.button,.label input{outline:0;width:100%}.selectJK{width: 467px;transition:all .9s ease;}.label{position:relative;display:block}.label input{padding:15px;border:1px solid rgba(0,0,0, .6);font:inherit;background: rgba(0,0,0, .5);color: rgba(255,255,255, .6);width: 84%;}.button{padding:16px;border:0;background:rgba(18, 18, 19, 0.6);color:rgba(255, 255, 255, 0.6);font-weight:400;font-family:Helvetica;font-size:16px;box-sizing:content-box;box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);}h2.insert{background-color: rgba(0,0,0, .5);color: rgb(255,255,255);box-shadow: 0 3px 3px 0 rgba(0,0,0,.14),0 3px 2px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);text-align:center;width:100%;padding:16px;margin-bottom:-1px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.imglink{padding: 15px;width:100%;outline:0;border:1px solid rgba(35, 34, 34, 0.7);background:rgba(0,0,0, .6);color: rgba(255,255,255, .6);display:block;}#global, .selectJK{z-index:10000;}.video_right{margin-top: -100%;transform: translate(-0%, 51%);position: relative;}.toggle-side{background-size:cover !important;position:absolute;right:0;top:0;margin:30px 5px 30px 30px;z-index:10;width:46px;height:38px;cursor:pointer}.toggle-side.hide{background: url("http://www.presentation-process.com/wp-content/uploads/keep-hidden-icon.png");}.toggle-side.show{background: url("http://iconsineed.com/icons/faticons/view-01-128.png");}.video_right2{margin-top: -54%;transform: translate(0%, 0%);}#footer a.copyright{color:#fff;text-align:center;float:right;margin:0 5px;text-decoration: none;transition: all .5s ease;}#footer a.copyright:hover{padding-bottom:5px;border-bottom:1px solid #ddd;}.icono2,.logoJK{position:absolute}.logoJK{background:url(http://jkanime.net/assets/images/players/esquina5.png) no-repeat;background-size:100%;width:82px;height:64px;right:5px}.icono2{font-size:24px;top:0;right:20px;margin:17px;color:#FFF;z-index:10000;-webkit-transition:all 1s ease;-moz-transition:all 1s ease;-ms-transition:all 1s ease;-o-transition:all 1s ease;transition:all 1s ease}.logoJK.hidden{opacity: 0;transition: all 1s ease;}.logoJK.show{opacity: 1;transition: all 1s ease;}</style>');
/* Estilos para el Contenedor de los Animes */
jQuery('head').append('<style id="contenedor_animes">.home_portada_bg{margin:-3px -8px;width:231px;height:auto;background:0 0;position:relative}.home_portada_bg .big_portada_title{width: 88.5%;position:absolute;bottom:0;background:rgba(0,0,0,.4);margin:3px 9px}.home_portada_bg2{margin:4px -8px;width:210px;height:auto;background:0 0;position:relative}.home_portada_bg2 .big_portada_title{width: 87.4%;position:absolute;bottom:0;background:rgba(0,0,0,.4);margin:3px 9px}.portada_big img{width:100%}.search_left .optional_title{margin: 12px 0 0 4px;}</style>');
/* Estilos para el ModalBox */
jQuery('head').append('<style id="modalbox" type="text/css">#modalindex{display:inline-block;margin:5px}.modalimg{background:rgba(0,0,0, .5);padding:5px}#modalcontent{position:fixed;top:50%;width:60vw;height:60vh;margin:0 20vw;margin-top:calc(-60vh / 2);z-index:10001;-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0);-webkit-transition:all 1s ease-in-out;-moz-transition:all 1s ease-in-out;-ms-transition:all 1s ease-in-out;-o-transition:all 1s ease-in-out;transition:all 1s ease-in-out}#modalcontouter{position:relative;width:100%;height:100%}#modalcontent #modalclose{background:url(http://cs.angelkrak.hol.es/archivos/close.png) no-repeat;background-size:cover;position:absolute;width:30px;height:30px;top:0;right:0;z-index:10001;margin:-20px}#modalcontimg{outline:0;position:relative;border:10px solid #fff;max-width:420px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#modalcontimg .modalimg{width:100%;padding:0;margin:0;border:none;outline:0;vertical-align:top}</style>');
/* Agregamos el contenido del Arrow(Cambiador de Imagenes) */
$("#global").append('<i class="fa fa-bars icono"></i><div class="opac-men"></div><div class="menu"><div class="selectJK"><div class="uno"><h2 class="insert">Agregar Imagenes</h2><i class="fa fa-toggle-off icono2"></i> <label class="label"> <input type="text" placeholder="Fondo de Imagen" id="fondo"> <a href="#" id="setfondo" class="btn-add setimg"><div class="addM">Agregar</div></a></label> <label class="label"> <input type="text" placeholder="Sidebar" id="sidebar"> <a href="#" id="setsidebar" class="btn-add setimg"><div class="addM">Agregar</div></a></label> <label class="label"> <input type="text" placeholder="Cursor" id="cursor"> <a href="#" id="setcursor" class="btn-add setimg"><div class="addM">Agregar</div></a></label> <button class="button" id="boton-guardar">Agregar Todos</button> </div><div class="dos"> <h2 class="insert">Mostrar Enlaces</h2> <div class="imglink"> <a href="#" class="modalink" id="FondoW"><img src="http://www.emprend3.mx/images/site/imagen-no-disponible.png" alt="FondoM" id="FondoM" class="modalimg"/></a><span id="fondoM"></span> <div class="cont-btn"> <a href="#" id="copy-FondoM" class="btn-copy"> <div class="copyM btn" data-clipboard-target="#fondoM">Copiar</div></a> <a href="#" id="del-FondoM" class="btn-del"> <div class="delM">Eliminar</div></a> </div></div><div class="imglink"> <a href="#" class="modalink" id="SidebarW"><img src="http://www.emprend3.mx/images/site/imagen-no-disponible.png" alt="SidebarM" id="SidebarM" class="modalimg"/></a><span id="sidebarM"></span> <div class="cont-btn"> <a href="#" id="copy-SidebarM" class="btn-copy"> <div class="copyM btn" data-clipboard-target="#sidebarM">Copiar</div></a> <a href="#" id="del-SidebarM" class="btn-del"> <div class="delM">Eliminar</div></a> </div></div><div class="imglink"> <a href="#" class="modalink" id="CursorW"><img src="http://www.emprend3.mx/images/site/imagen-no-disponible.png" alt="CursorM" id="CursorM" class="modalimg"/></a><span id="cursorM"></span> <div class="cont-btn"> <a href="#" id="copy-CursorM" class="btn-copy"> <div class="copyM btn" data-clipboard-target="#cursorM">Copiar</div></a> <a href="#" id="del-CursorM" class="btn-del"> <div class="delM">Eliminar</div></a> </div></div></div></div></div><span class="logoJK hidden"></span>');
/* Agregamos la imagen para Ocultar y Mostrar Sidebar */
$(".video_right").append('<div class="toggle-side hide"></div>');
/* Anime Recomendado y Diarios*/
$("#home_content_right").prepend('<div class="iframe_animes"><iframe src="https://run.plnkr.co/plunks/w4UA9MUlLXKNE6emx0gG/" width="100%" height="100%" frameborder="0"></iframe></div>');
jQuery('head').append('<style id="animes_rec">.iframe_animes{display: block; height: 765px; width: 327px; margin: 18px 0 0 -42px;}</style>');
/* Compartir Capitulo en Facebook */
$("body").find("#top_block #sticboxl .dwldclass").append('<iframe src="https://www.facebook.com/v2.3/plugins/share_button.php?app_id=113869198637480&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D42%23cb%3Df250cda2c%26domain%3Ddevelopers.facebook.com%26origin%3Dhttps%253A%252F%252Fdevelopers.facebook.com%252Ff3b18c37%26relation%3Dparent.parent&container_width=613&href='+document.URL+'&layout=box_count&locale=es_LA&sdk=joey" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:auto; height:61px; margin-top: 5px; margin-bottom: -15px;\" allowTransparency=\"true\"><\/iframe>');
/* Usuarios Online PHP */
$(".menu").append('<iframe src="http://angelkrak.hol.es/contador_JKStyle/" frameborder="0" width="100%" height="50px"></iframe>');
/* Agregamos el Copyright */
$("#footer .ft-text1").append('<a href="http://facebook.com/angelkrak92" class="copyright">Script/Template Creado By AngelKrak</a>');
var clipboard = new Clipboard('.btn');
clipboard.on('success', function(e) {
event.preventDefault();
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
e.clearSelection();
alertify.success('El enlace ha sido Copiado');
});
clipboard.on('error', function(e) {
event.preventDefault();
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
alertify.error('El enlace no se ha podido Copiar');
});
/* Boton Open */
var menu = 0;
$(".icono").click(function() {
if (menu === 0) {
$(".menu").animate({
"left": "0"
}, "slow");
$(".icono").removeClass("fa-bars");
$(".icono").addClass("fa-times");
$(".opac-men").animate({
"opacity": "1"
}, "slow");
menu = 1;
} else {
$(".menu").animate({
"left": "-100%"
}, "slow");
$(".icono").removeClass("fa-times");
$(".icono").addClass("fa-bars");
$(".opac-men").animate({
"opacity": "0"
}, "slow");
menu = 0;
}
});
var opa = 0;
$(".icono2").click(function() {
if(opa === 0) {
opa = 1;
$("#wrapper").fadeTo("slow", 0);
$(".icono2").removeClass("fa-toggle-off");
$(".icono2").addClass("fa-toggle-on");
$(".logoJK").removeClass("hidden");
$(".logoJK").addClass("show");
}else{
opa = 0;
$("#wrapper").fadeTo("slow", 1);
$(".icono2").removeClass("fa-toggle-on");
$(".icono2").addClass("fa-toggle-off");
$(".logoJK").removeClass("show");
$(".logoJK").addClass("hidden");
}
});
/* Script del ModalBox */
$('body').append('<div id="modalcontent"></div>');
$("#modalcontent").append('<div id="modalcontouter"></div>');
$('#modalcontouter').append('<div id="modalcontimg"></div>');
$("#modalcontimg").append('<a href="#" id="modalclose"></a>');
$(".modalink").click(function(e) {
e.preventDefault;
$("#modalcontent").css({
"transform": "scale(1)"
});
$("img", this).clone().appendTo('#modalcontent #modalcontimg');
$("body").append('<div id="contover"><div id="#modalover" style="opacity: 0.7;cursor: pointer;height: 100vh;display: block;background-color: rgb(119, 119, 119);position: fixed;top: 0;left: 0;width: 100%;z-index: 10000;"></div></div>');
});
$("#modalclose").click(function(e) {
e.preventDefault;
$("#modalcontent").css({
"transform": "scale(0)"
});
setTimeout(function() {
$("#modalcontimg .modalimg").remove();
$('#contover:first').remove();
},1000);
});
/* Cambiar Tamaño de la imagen del Modal segun el Click */
$("#FondoW").click(function() {
$("#modalcontimg").css("max-width", "100%");
});
$(".imglink a:not(#FondoW)").click(function() {
$("#modalcontimg").css("max-width", "420px");
});
/* */
$(".toggle-side").click(function() {
$(".hide").toggleClass("show");
$(".video_right .publibox:nth-child(1)").toggle();
$(".video_right").toggleClass("video_right2");
});
/* Mostrar/Ocultar Sidebar al apretar el Boton de Expandir Reproductor*/
$(".expand_s").click(function() {
$(".video_right .publibox").toggle();
});
/* Mostramos y Ocultamos */
$(".uno").show();
$(".dos .imglink").hide();
$("h2.insert").click(function() {
$(".dos .imglink").slideToggle("slow");
});
$("h2.insert").click(function() {
$(".uno label, #boton-guardar").slideToggle("slow");
});
/*Funcion de Capturar, Almacenar datos y Limpiar campos*/
$(document).ready(function(){
//Establecer Imagen de Fondo
$('#setfondo').click(function(){
event.preventDefault();
if (confirm('Estas Seguro(a) ?')) {
/*Captura de datos escrito en los inputs*/
var fon = document.getElementById("fondo").value;
/*Guardando los datos en el LocalStorage*/
localStorage.setItem("Fondo", fon);
/*Limpiando los campos o inputs*/
document.getElementById("fondo").value = "";
/* Notificaciones con Alertify */
alertify.success('Agregado Correctamente');
}
});
//Establecer Imagen de Sidebar
$('#setsidebar').click(function(){
event.preventDefault();
if (confirm('Estas Seguro(a) ?')) {
/*Captura de datos escrito en los inputs*/
var sid = document.getElementById("sidebar").value;
/*Guardando los datos en el LocalStorage*/
localStorage.setItem("Sidebar", sid);
/*Limpiando los campos o inputs*/
document.getElementById("sidebar").value = "";
/* Notificaciones con Alertify */
alertify.success('Agregado Correctamente');
}
});
//Establecer Imagen del Cursor
$('#setcursor').click(function(){
event.preventDefault();
if (confirm('Estas Seguro(a) ?')) {
/*Captura de datos escrito en los inputs*/
var cur = document.getElementById("cursor").value;
/*Guardando los datos en el LocalStorage*/
localStorage.setItem("Cursor", cur);
/*Limpiando los campos o inputs*/
document.getElementById("cursor").value = "";
/* Notificaciones con Alertify */
alertify.success('Agregado Correctamente');
}
});
/* Guarda todas las Imagenes Escritas en los Input */
$('#boton-guardar').click(function(){
event.preventDefault();
if (confirm('Estas Seguro(a) ?')) {
setTimeout(function(){ //Hacemos que se Recargue lo Establecido Abajo
/*Captura de datos escrito en los inputs*/
var fon = document.getElementById("fondo").value;
var sid = document.getElementById("sidebar").value;
var cur = document.getElementById("cursor").value;
/*Guardando los datos en el LocalStorage*/
localStorage.setItem("Fondo", fon);
localStorage.setItem("Sidebar", sid);
localStorage.setItem("Cursor", cur);
/*Limpiando los campos o inputs*/
document.getElementById("fondo").value = "";
document.getElementById("sidebar").value = "";
document.getElementById("cursor").value = "";
/* Notificaciones con Alertify */
alertify.success('Agregados Correctamente');
//Cargamos el Fondo de la Pagina
var background = "background-image: url('"+fon+"')";
$("body #global").attr("style", background);
if(fon){ //Si existe el Fondo de la Pagina mostramos el Enlace
document.getElementById("fondoM").innerHTML = fon;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("fondoM").innerHTML = "No has establecido un Fondo de Imagen";
}
//Cargamos el Fondo del Sidebar
var sidebar2 = "background-image: url('"+sid+"')";
$(".video_right .publibox:nth-child(1)").attr("style", sidebar2);
if(sid){ //Si existe el Fondo del Sidebar mostramos el Enlace
document.getElementById("sidebarM").innerHTML = sid;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("sidebarM").innerHTML = "No has establecido un Fondo de Imagen al Sidebar";
}
//Cargamos la imagen del Cursor o Establecemos Cursor por Defecto
var cursor2 = "cursor: url("+cur+"), default";
$("body").attr("style", cursor2);
if(cur) { //Si existe la Imagen del Cursor mostramos el Enlace
document.getElementById("cursorM").innerHTML = cur;
}else{ //En caso contrario mostramos un Cursor ya Establecido por Defecto
$("body").attr("style", "cursor: url(http://cur.cursors-4u.net/anime/ani-11/ani1037.ani), url(http://cur.cursors-4u.net/anime/ani-11/ani1037.png), default;");
document.getElementById("cursorM").innerHTML = "http://cur.cursors-4u.net/anime/ani-11/ani1037.png";
}
/* Preview de Imagenes */
if (fon){
var backgroundimg = ""+fon+"";
$(".imglink #FondoM").attr("src", backgroundimg);
}else{
$(".imglink #FondoM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
if (sid){
var sidebarimg = ""+sid+"";
$(".imglink #SidebarM").attr("src", sidebarimg);
}else{
$(".imglink #SidebarM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
if (cur){
var cursorimg = ""+cur+"";
$(".imglink #CursorM").attr("src", cursorimg);
}else{
$(".imglink #CursorM").attr("src", "http://cur.cursors-4u.net/anime/ani-11/ani1037.png");
}
}); //Finalizamos el setTimeout
}
});
});
/* Funcion Cargar y Mostrar datos */
$(document).ready(function(){
/* Obtener datos almacenados */
var fondo = localStorage.getItem("Fondo");
var sidebar = localStorage.getItem("Sidebar");
var cursor = localStorage.getItem("Cursor");
/* Mostrar datos almacenados */
//Cargamos el Fondo de la Pagina
var background = "background-image: url('"+fondo+"')";
$("body #global").attr("style", background);
if(fondo){ //Si existe el Fondo de la Pagina mostramos el Enlace
document.getElementById("fondoM").innerHTML = fondo;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("fondoM").innerHTML = "No has establecido un Fondo de Imagen";
}
//Cargamos el Fondo del Sidebar
var sidebar2 = "background-image: url('"+sidebar+"')";
$(".video_right .publibox:nth-child(1)").attr("style", sidebar2);
if(sidebar){ //Si existe el Fondo del Sidebar mostramos el Enlace
document.getElementById("sidebarM").innerHTML = sidebar;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("sidebarM").innerHTML = "No has establecido un Fondo de Imagen al Sidebar";
}
//Cargamos la imagen del Cursor o Establecemos Cursor por Defecto
var cursor2 = "cursor: url("+cursor+"), default";
$("body").attr("style", cursor2);
if(cursor) { //Si existe la Imagen del Cursor mostramos el Enlace
document.getElementById("cursorM").innerHTML = cursor;
}else{ //En caso contrario mostramos un Cursor ya Establecido por Defecto
$("body").attr("style", "cursor: url(http://cur.cursors-4u.net/anime/ani-11/ani1037.ani), url(http://cur.cursors-4u.net/anime/ani-11/ani1037.png), default;");
document.getElementById("cursorM").innerHTML = "http://cur.cursors-4u.net/anime/ani-11/ani1037.png";
}
/* Preview de Imagenes */
if (fondo){
var backgroundimg = ""+fondo+"";
$(".imglink #FondoM").attr("src", backgroundimg);
}else{
$(".imglink #FondoM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
if (sidebar){
var sidebarimg = ""+sidebar+"";
$(".imglink #SidebarM").attr("src", sidebarimg);
}else{
$(".imglink #SidebarM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
if (cursor){
var cursorimg = ""+cursor+"";
$(".imglink #CursorM").attr("src", cursorimg);
}else{
$(".imglink #CursorM").attr("src", "http://cur.cursors-4u.net/anime/ani-11/ani1037.png");
}
// **** Aqui se Recargan las Imagenes al Dar Click y se Establecen ****
//Cargamos el Fondo de JKAnime al Darle Click al Boton de Agregar (Fondo de Imagen)
$("#setfondo").click(function() { //Hacemos la Funcion del Click
setTimeout(function(){ //Hacemos que se Recargue lo Establecido Abajo
var fondo = localStorage.getItem("Fondo"); //Cargamos el Fondo del LocalStorage
//Cargamos el Fondo de la Pagina y lo Establecemos al Body
var background = "background-image: url('"+fondo+"')"; //Creamos la Variable
$("body #global").attr("style", background); //Establecemos el Fondo al Body
if(fondo){ //Si existe el Fondo de la Pagina mostramos el Enlace
document.getElementById("fondoM").innerHTML = fondo;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("fondoM").innerHTML = "No has establecido un Fondo de Imagen";
}
//Mostramos la Imagen de Preview
if (fondo){
var backgroundimg = ""+fondo+"";
$(".imglink #FondoM").attr("src", backgroundimg);
}else{
$(".imglink #FondoM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
}); //Aqui termina el setTimeout
}); //Aqui termina la Funcion del Click
//Cargamos el Fondo del Sidebar al Darle Click al Boton de Agregar (Sidebar)
$("#setsidebar").click(function() {
setTimeout(function(){
var sidebar = localStorage.getItem("Sidebar");
//Cargamos el Fondo del Sidebar
var sidebar2 = "background-image: url('"+sidebar+"')";
$(".video_right .publibox:nth-child(1)").attr("style", sidebar2);
if(sidebar){ //Si existe el Fondo del Sidebar mostramos el Enlace
document.getElementById("sidebarM").innerHTML = sidebar;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("sidebarM").innerHTML = "No has establecido un Fondo de Imagen al Sidebar";
}
if (sidebar){
var sidebarimg = ""+sidebar+"";
$(".imglink #SidebarM").attr("src", sidebarimg);
}else{
$(".imglink #SidebarM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
}); //Aqui termina el setTimeout
}); //Aqui termina la Funcion del Click
//Cargamos el Cursor al Darle Click al Boton de Agregar (Cursor)
$("#setcursor").click(function() {
setTimeout(function() {
var cursor = localStorage.getItem("Cursor");
//Cargamos la imagen del Cursor o Establecemos Cursor por Defecto
var cursor2 = "cursor: url("+cursor+"), default";
$("body").attr("style", cursor2);
if(cursor) { //Si existe la Imagen del Cursor mostramos el Enlace
document.getElementById("cursorM").innerHTML = cursor;
}else{ //En caso contrario mostramos un Cursor ya Establecido por Defecto
$("body").attr("style", "cursor: url(http://cur.cursors-4u.net/anime/ani-11/ani1037.ani), url(http://cur.cursors-4u.net/anime/ani-11/ani1037.png), default;");
document.getElementById("cursorM").innerHTML = "http://cur.cursors-4u.net/anime/ani-11/ani1037.png";
}
if (cursor){
var cursorimg = ""+cursor+"";
$(".imglink #CursorM").attr("src", cursorimg);
}else{
$(".imglink #CursorM").attr("src", "http://cur.cursors-4u.net/anime/ani-11/ani1037.png");
}
}); //Aqui termina el setTimeout
}); //Aqui termina la Funcion del Click
});
/*Funcion Eliminar Imagenes y Limpiar campos*/
$(document).ready(function(){
//Eliminar Fondo de Imagen
$('#del-FondoM').click(function(){
event.preventDefault();
setTimeout(function(){
/*Eliminar imagen almacenada*/
localStorage.removeItem("Fondo");
/*Limpiar datos almacenados*/
document.getElementById('fondo').innerHTML = "";
/* Notificaciones con Alertify */
alertify.success('Se ha Eliminado Correctamente');
//Cargamos las Imagenes del LocalStorage y las Establecimos en JKAnime
var fondo = localStorage.getItem("Fondo"); //Cargamos el Fondo del LocalStorage
//Cargamos el Fondo de la Pagina y lo Establecemos al Body
var background = "background-image: url('"+fondo+"')"; //Creamos la Variable
$("body #global").attr("style", background); //Establecemos el Fondo al Body
if(fondo){ //Si existe el Fondo de la Pagina mostramos el Enlace
document.getElementById("fondoM").innerHTML = fondo;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("fondoM").innerHTML = "No has establecido un Fondo de Imagen";
}
//Mostramos la Imagen de Preview
if (fondo){
var backgroundimg = ""+fondo+"";
$(".imglink #FondoM").attr("src", backgroundimg);
}else{
$(".imglink #FondoM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
}); //Aqui termina el setTimeout
});
//Eliminar Imagen del Sidebar
$('#del-SidebarM').click(function(){
event.preventDefault();
setTimeout(function(){
/*Eliminar imagen almacenada*/
localStorage.removeItem("Sidebar");
/*Limpiar datos almacenados*/
document.getElementById('sidebar').innerHTML = "";
/* Notificaciones con Alertify */
alertify.success('Se ha Eliminado Correctamente');
//Cargamos las Imagenes del LocalStorage y las Establecimos en JKAnime
var sidebar = localStorage.getItem("Sidebar");
//Cargamos el Fondo del Sidebar
var sidebar2 = "background-image: url('"+sidebar+"')";
$(".video_right .publibox:nth-child(1)").attr("style", sidebar2);
if(sidebar){ //Si existe el Fondo del Sidebar mostramos el Enlace
document.getElementById("sidebarM").innerHTML = sidebar;
}else{ //En caso contrario mostramos un Texto de Error
document.getElementById("sidebarM").innerHTML = "No has establecido un Fondo de Imagen al Sidebar";
}
if (sidebar){
var sidebarimg = ""+sidebar+"";
$(".imglink #SidebarM").attr("src", sidebarimg);
}else{
$(".imglink #SidebarM").attr("src", "http://www.emprend3.mx/images/site/imagen-no-disponible.png");
}
}); //Aqui termina el setTimeout
});
//Eliminar Imagen del Cursor
$('#del-CursorM').click(function(){
event.preventDefault();
setTimeout(function(){
/*Eliminar imagen almacenada*/
localStorage.removeItem("Cursor");
/*Limpiar datos almacenados*/
document.getElementById('cursor').innerHTML = "";
/* Notificaciones con Alertify */
alertify.success('Se ha Eliminado Correctamente');
//Cargamos las Imagenes del LocalStorage y las Establecimos en JKAnime
var cursor = localStorage.getItem("Cursor");
//Cargamos la imagen del Cursor o Establecemos Cursor por Defecto
var cursor2 = "cursor: url("+cursor+"), default";
$("body").attr("style", cursor2);
if(cursor) { //Si existe la Imagen del Cursor mostramos el Enlace
document.getElementById("cursorM").innerHTML = cursor;
}else{ //En caso contrario mostramos un Cursor ya Establecido por Defecto
$("body").attr("style", "cursor: url(http://cur.cursors-4u.net/anime/ani-11/ani1037.ani), url(http://cur.cursors-4u.net/anime/ani-11/ani1037.png), default;");
document.getElementById("cursorM").innerHTML = "http://cur.cursors-4u.net/anime/ani-11/ani1037.png";
}
if (cursor){
var cursorimg = ""+cursor+"";
$(".imglink #CursorM").attr("src", cursorimg);
}else{
$(".imglink #CursorM").attr("src", "http://cur.cursors-4u.net/anime/ani-11/ani1037.png");
}
}); //Aqui termina el setTimeout
});
});
//if (window.self !== window.top) return;
var GM_update =
{
installed: { name: "", homeURL: "", version: "", description: "", metaURL: "", enabled: "" },
online: { name: "", version: "", description: "", changelog: "", date: "", userURL: "" },
checkTimestamp: function ()
{
var days = GM_update.getDaysSinceLastCheck();
var cp = GM_getValue("GMU-CoolingPeriod", 3);
if (cp > 0 && (days < 0 || days >= cp))
{
var url = (GM_update.installed.metaURL) ? GM_update.installed.metaURL : GM_update.installed.homeURL
GM_update.isThereANewVersion(url, checkCallback);
}
function checkCallback(success)
{
if (success && GM_update.installed.version != GM_update.online.version) GM_update.showUpdateDialog();
}
},
/* Returns the number of days since last check. If it is the first check,
it returns -1.
=====================================================================================*/
getDaysSinceLastCheck: function ()
{
var timestamp = GM_getValue("GMU-Timestamp", null);
if (!timestamp) return -1;
var now = new Date().getTime();
var diff = now - timestamp;
diff = diff / (1000 * 60 * 60 * 24); //Get number of days gone by;
return diff;
},
/* url is url to the scripts OUJS/GF/MG homepage or to the meta.js file.
checkCallback is function that takes in one parameter that returns true
if version check is done successfully.
checkCallback(success).
=====================================================================================*/
isThereANewVersion: function (url, checkCallback)
{
if (!url && GM_update.installed.metaURL) url = GM_update.installed.metaURL;
else if (!url) url = GM_update.installed.homeURL;
console.info("GM_update: " + url);
GM_xmlhttpRequest({
url: url,
method: "GET",
headers: {
"User-agent": navigator.userAgent,
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5"
},
onload: function (xhr)
{
//console.log("xhr.status: " + xhr.status, url);
if (xhr.status == 200)
{
var online;
if (url.search(/meta\.js$/) > 0) online = GM_update.parseMeta(xhr.responseText);
else
{
//var doc = new DOMParser().parseFromString(xhr.responseText, 'text/xml');
var doc = document.implementation.createHTMLDocument('MPIV');
doc.documentElement.innerHTML = xhr.responseText;
online = GM_update.parseDocument(url, doc);
}
if (checkCallback && online.version) checkCallback(true);
else if (checkCallback) checkCallback(false);
else if (!online.version || !online.name) console.error("GM_update xhr.status: " + xhr.status);
else if (online.version != GM_update.version) GM_update.showUpdateDialog();
}
else console.error("GM_update xhr.status: " + xhr.status);
},
ontimeout: function (response)
{
console.error("GM_Update: Unable to access script homepage due to timeout error. URL: " + url);
console.warn(response);
checkCallback(false);
},
onerror: function (response)
{
console.error("GM_Update: Error trying to access script homepage URL: " + url);
console.warn(response);
checkCallback(false);
}
});
},
/* Parses html document
=====================================================================================*/
parseDocument: function (url, doc)
{
var online = GM_update.online;
if (url.match(/greasyfork\.org\//i))
{
online.name = doc.querySelector("#script-info h2").textContent;
online.description = doc.querySelector("#script-info p").textContent;
online.version = doc.querySelector("dd.script-show-version span").textContent;
online.date = doc.querySelector("dd.script-show-updated-date time").getAttribute("datetime");
online.userURL = "https://greasyfork.org" + doc.querySelector(".install-link").href;
}
else if (url.match(/monkeyguts\.com\//i))
{
online.name = doc.querySelector(".codeName").textContent;
online.description = doc.querySelector(".codeTagline").textContent;
online.version = doc.querySelector(".codeVersion .codeFieldVar").textContent;
online.date = doc.querySelector(".codeTime .codeFieldVar").textContent;
online.userURL = doc.querySelector(".codeInstall").href;
}
else if (url.match(/openuserjs\.org\//i))
{
online.name = doc.querySelector(".script-name").textContent;
online.description = doc.querySelector(".script-meta p:nth-child(2)").textContent;
online.version = doc.querySelector("code").textContent.trim();
online.date = doc.querySelector("time").getAttribute("datetime");
online.userURL = "https://openuserjs.org/" + doc.querySelector("a.btn-info").href;
}
return online;
},
/* Parses meta.js file
=====================================================================================*/
parseMeta: function (raw)
{
var online = GM_update.online;
var lines = raw.split('\n');
var metadata = {};
for (var i = 0; i < lines.length; i++)
{
lines[i].replace(/\s*\/\/\s*@([^ ]+)\s+(.+)/, function (all, key, value)
{
key = key.toLowerCase();
metadata[key] = value.trim();
});
}
online.name = metadata["name"];
online.version = metadata["version"];
online.description = metadata["description"];
online.changelog = metadata["changelog"];
online.metaURL = metadata["metaurl"];
return metadata
},
/* Shows update window
=====================================================================================*/
showUpdateDialog: function (installed, online)
{
if (!installed) installed = GM_update.installed;
if (!online) online = GM_update.online;
if (document.getElementsByName(installed.name)[0]) document.body.removeChild(document.getElementsByName(installed.name)[0]);
var iframe = document.createElement("iframe");
iframe.id = "GM_UpdateWindow";
iframe.name = installed.name;
iframe.setAttribute("style", "border: none; background-color: transparent; position:fixed; right: 15px; bottom: 15px; z-index: 9999999999999999999999999;");
iframe.onload = function ()
{
var doc = iframe.contentDocument || iframe.contentWindow.document;
var css = doc.createElement("style");
css.type = "text/css";
css.textContent = "#smain{width: 600px;max-width: 600px;background-color: #E9E9F9;border: 2px ridge blue;font-size: 15px;}header{text-align: center;padding: 2px 0;font-size: 17px;color: black;border-bottom: 1px solid;}header, footer{border-color: navy;background-color: #CFCFF5;}footer{padding: 4px 5px 2px 5px;height: 25px;border-top: 1px solid;}#sdetail{margin: 5px;}#sname, #sversion{font-weight: bolder;}#sname{color: blue;}#sversion{color: blue;}article{background-color: white;padding: 5px;border-radius: 3px;}#info{padding: 2px 5px;border-radius: 3px;margin-bottom: 3px;border: 1px ridge gray;}.matched msg{background-color: #EFF1F1;color: black;}.matched #newversion, .matched #logsection{display: none;}.unmatched #info{background-color: white;}.unmatched #msg{font-size: 12px;display: inline-block;padding: 2px 5px;background-color: #F7E1E5;border: 1px solid #CA3952;color: #CA3952;border-radius: 5px;}.unmatched #newversion{display: inline-block;}#newversion{font-weight: bolder;margin-left: 5px;}#snameL{color: #33AC4A;}#sversionL{color: red;}#gohome, #cancel{font-family: 'Times New Roman';float: right;padding: 2px 6px;border: 1px solid;border-radius: 5px;text-decoration: none;font-size: 14px;margin-left: 3px;background-color: lightgray;}.unmatched #gohome{text-decoration: underline;text-decoration-color: red;-moz-text-decoration-color: red;color: green;background-color: #BDF1BD;}#cancel:hover, #gohome:hover{cursor: pointer;background-color: lightblue;}";
doc.head.appendChild(css);
doc.body.innerHTML = '<div id="smain"><header><span>Update Check: </span><span id="sname"></span><sup>v.<span id="sversion"></span></sup></header><section id="sdetail"><div id="info"><div id="msg"></div><div id="newversion"><span id="snameL"></span><sup>v.<span id="sversionL"></span> [<time id="stimeL"></time>]</sup></div></div><article><div style="font-weight: bolder;">Summary:</div><div id="description"></div><div id="logsection"><hr /><div style="font-weight: bolder;">Changelog:</div><div id="changelog"></div></div></article></section><footer><label>Update check: </label><select id="intervalLength"><option>never</option><option>everyday</option><option>every 2 days</option><option>every 3 days</option><option>every 4 days</option><option>every 5 days</option><option>every 6 days</option><option>every 7 days</option></select><div id="cancel">Cancel</div><a id="gohome" target="_blank">Download Page</a></footer></div>';
doc.getElementById("sname").textContent = installed.name;
doc.getElementById("sversion").textContent = installed.version;
doc.getElementById("description").textContent = installed.description;
doc.getElementById("gohome").href = installed.homeURL;
if (installed.version != online.version)
{
doc.getElementById("smain").className = "unmatched";
doc.getElementById("msg").textContent = "New version released";
doc.getElementById("snameL").textContent = (online.name) ? online.name : "getting online info...";
doc.getElementById("sversionL").textContent = online.version;
if (online.date) doc.getElementById("stimeL").textContent = online.date;
else
{
var sup = doc.getElementById("stimeL").parentElement;
sup.innerHTML = sup.innerHTML.replace(/\[(<time .+)\]$/i, "$1");
}
if (online.changelog)
{
var log = doc.getElementById("changelog");
log.innerHTML = online.changelog;
var nodes = doc.querySelectorAll('div[id="changelog"] *');
for (var i = 0; i < nodes.length; i++)
{
var node = nodes[i];
if (!node.tagName.match(/uo|ol|li|b|strong|i|div|br/i))
{
node.parentElement.removeChild(node);
}
else if (node.attributes)
{
try
{
for (var j = 0; j < node.attributes.length; j++)
{
var attrib = node.attributes[j];
if (attrib.name.toLowerCase() != "style")
{
node.removeAttribute(attrib.name);
j--;
}
}
}
catch (e) { console.log(e); }
}
}
}
else doc.getElementById("logsection").style.display = "none";
}
else
{
doc.getElementById("smain").className = "matched";
doc.getElementById("msg").textContent = "It appears you have the latest version"
}
var cp = GM_getValue("GMU-CoolingPeriod", 5);
doc.getElementById("intervalLength").selectedIndex = cp;
doc.getElementById("intervalLength").onchange = function ()
{
GM_setValue("GMU-CoolingPeriod", doc.getElementById("intervalLength").selectedIndex);
}
doc.getElementById("cancel").onclick = function ()
{
GM_setValue("GMU-Timestamp", new Date().getTime());
document.body.removeChild(iframe);
};
doc.getElementById("gohome").onclick = function ()
{
GM_setValue("GMU-Timestamp", new Date().getTime());
};
//Resize iframe
var intervalID = setInterval(function (iframe, doc)
{
iframe.style.width = (doc.body.firstElementChild.offsetWidth + 35) + "px";
iframe.style.height = (doc.body.scrollHeight) + "px";
Counter++;
if (Counter == 20)
{
clearInterval(intervalID);
}
}, 50, iframe, doc);
}
document.body.appendChild(iframe);
}
};
(function ()
{
var installed = GM_update.installed;
if (typeof GM_info !== "undefined")
{
installed.name = TrimValue(GM_info.script.name);
installed.version = TrimValue(GM_info.script.version);
installed.description = TrimValue(GM_info.script.description);
var str = GM_info.scriptMetaStr;
m = GM_info.scriptMetaStr.match(/\/\/ @homeurl\s+(.+)/i);
if (m) installed.homeURL = TrimValue(m[1]);
m = GM_info.scriptMetaStr.match(/\/\/ @metaurl\s+(.+)/i);
if (m) installed.metaURL = TrimValue(m[1]);
m = GM_info.scriptMetaStr.match(/\/\/ @gm_update\s+(.+)/i);
if (m) installed.enabled = TrimValue(m[1]) != "manual";
else installed.enabled = true;
}
else if (typeof GM_getMetadata !== "undefined")
{
installed.name = TrimValue(GM_getMetadata("name"));
installed.version = TrimValue(GM_getMetadata("version"));
installed.description = TrimValue(GM_getMetadata("description"));
installed.homeURL = TrimValue(GM_getMetadata("homeurl"));
installed.metaURL = TrimValue(GM_getMetadata("metaurl"));
installed.enabled = (TrimValue(GM_getMetadata("gm_update")) != "manual");
}
if (installed.enabled && installed.version && installed.homeURL && installed.name)
{
if (window.self !== window.top) return;
console.info("Register GM_update menu for: " + installed.name);
GM_registerMenuCommand("Update Check: " + installed.name, function ()
{
GM_update.showUpdateDialog();
GM_update.isThereANewVersion();
});
GM_update.checkTimestamp();
}
else if (installed.enabled)
{
console.error("GM_update: unable to get user script meta-data");
console.log(GM_update.installed);
}
function TrimValue(value)
{
if (value) return value.trim();
else "";
}
})();