From 947a63c5a0f2fdcdbc5fa1bd4e494cefcd505e0e Mon Sep 17 00:00:00 2001 From: Lkytal Date: Mon, 12 Jan 2015 21:57:55 +0800 Subject: [PATCH] span --- meta/popsearch.meta.js | 2 +- meta/tieba_enhance.meta.js | 4 ++-- popsearch.user.js | 2 +- tieba_enhance.user.js | 44 +++++++++++++++++++++++++------------- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/meta/popsearch.meta.js b/meta/popsearch.meta.js index a06c272..847428b 100644 --- a/meta/popsearch.meta.js +++ b/meta/popsearch.meta.js @@ -6,7 +6,7 @@ // @description Popup Search Box and translate Button (etc) for selected Text // @include * // @exclude */test/index.html* -// @require http://code.jquery.com/jquery-2.1.1.min.js +// @require http://libs.baidu.com/jquery/2.1.1/jquery.min.js // @version 2.9.8 // @icon http://lkytal.qiniudn.com/ic.ico // @grant GM_xmlhttpRequest diff --git a/meta/tieba_enhance.meta.js b/meta/tieba_enhance.meta.js index 1d240b5..9db83b9 100644 --- a/meta/tieba_enhance.meta.js +++ b/meta/tieba_enhance.meta.js @@ -5,9 +5,9 @@ // @description 贴吧小尾巴, 坟贴提醒, 去除跳转等功能 // @include http://tieba.baidu.com/* // @include https://tieba.baidu.com/* -// @version 6.0.2 +// @version 6.0.4 // @author lkytal -// @require http://code.jquery.com/jquery-2.1.1.min.js +// @require http://libs.baidu.com/jquery/2.1.1/jquery.min.js // @icon http://lkytal.qiniudn.com/ic.ico // @grant unsafeWindow // @grant GM_addStyle diff --git a/popsearch.user.js b/popsearch.user.js index 4633d44..f02c398 100644 --- a/popsearch.user.js +++ b/popsearch.user.js @@ -6,7 +6,7 @@ // @description Popup Search Box and translate Button (etc) for selected Text // @include * // @exclude */test/index.html* -// @require http://code.jquery.com/jquery-2.1.1.min.js +// @require http://libs.baidu.com/jquery/2.1.1/jquery.min.js // @version 2.9.8 // @icon http://lkytal.qiniudn.com/ic.ico // @grant GM_xmlhttpRequest diff --git a/tieba_enhance.user.js b/tieba_enhance.user.js index 853f896..e064429 100644 --- a/tieba_enhance.user.js +++ b/tieba_enhance.user.js @@ -5,9 +5,9 @@ // @description 贴吧小尾巴, 坟贴提醒, 去除跳转等功能 // @include http://tieba.baidu.com/* // @include https://tieba.baidu.com/* -// @version 6.0.2 +// @version 6.0.4 // @author lkytal -// @require http://code.jquery.com/jquery-2.1.1.min.js +// @require http://libs.baidu.com/jquery/2.1.1/jquery.min.js // @icon http://lkytal.qiniudn.com/ic.ico // @grant unsafeWindow // @grant GM_addStyle @@ -38,7 +38,7 @@ log = function(msg) { }; open_setting_window = function() { - var e, x; + var e, x, _ref, _ref1; $('body').append("
\n
\n
重置
\n
保存
\n
设置
\n

\n
\n
坟贴检测
\n
\n

超过\n 天的帖子视为坟贴\n
坟贴禁回
\n
\n

\n
小尾巴
\n
\n
\n
\n
\n
\n
\n
html
\n
javascript
\n
\n
\n
保存当前尾巴
\n
新建尾巴
\n
删除尾巴
\n
\n
\n 预览\n
\n

\n
\n
\n
\n
"); $("#fentie_date")[0].value = tiebaData.fentie_date; if (!tiebaData.fentie_open) { @@ -52,7 +52,9 @@ open_setting_window = function() { $("#tail_open").attr("class", "setting_sp_btn close"); $("#tail_select,#tail_select + div").css("display", "none"); } - for (x in tiebaData.tail_data) { + _ref = tiebaData.tail_data; + for (x in _ref) { + if (!__hasProp.call(_ref, x)) continue; $("#tail_select_text")[0].innerHTML = x; $("#tail_select_text").attr("new", "0"); $("#tail_select_text").attr("oname", x); @@ -60,7 +62,9 @@ open_setting_window = function() { $("#tail_type_text")[0].innerHTML = tiebaData.tail_data[x].split("!分隔!")[1]; break; } - for (x in tiebaData.tail_data) { + _ref1 = tiebaData.tail_data; + for (x in _ref1) { + if (!__hasProp.call(_ref1, x)) continue; $("#tail_option_box").append("
" + x + "
"); } $(".tail_option").click(function() { @@ -225,16 +229,18 @@ open_setting_window = function() { $("#tail_select_text").attr("new", "1"); $("#tail_select_text").attr("oname", ""); $("#tail_select_text")[0].textContent = "新尾巴" + Math.random().toString().substr(3, 3); - $("#tail_data")[0].value = "
小尾巴脚本Tieba Enhance:
https://userscripts.org/scripts/show/180666"; + $("#tail_data")[0].value = "
小尾巴脚本Tieba Enhance:
https://git.oschina.net/coldfire/GM"; $("#tail_type_text")[0].textContent = "html"; }); $("#tail_delete").click(function() { - var oname; + var oname, _ref2, _ref3; oname = $("#tail_select_text")[0].getAttribute("oname"); if ($("#tail_select_text")[0].getAttribute("new") !== 1) { delete tiebaData.tail_data[oname]; } - for (x in tiebaData.tail_data) { + _ref2 = tiebaData.tail_data; + for (x in _ref2) { + if (!__hasProp.call(_ref2, x)) continue; $("#tail_select_text")[0].innerHTML = x; $("#tail_select_text").attr("new", "0"); $("#tail_select_text").attr("oname", x); @@ -244,7 +250,9 @@ open_setting_window = function() { } GM_setValue("tail_data", JSON.stringify(tiebaData.tail_data)); $("#tail_option_box").empty(); - for (x in tiebaData.tail_data) { + _ref3 = tiebaData.tail_data; + for (x in _ref3) { + if (!__hasProp.call(_ref3, x)) continue; tiebaData.tail_data[x] = tiebaData.tail_data[x].replace(/!逗号!/g, ",").replace(/!引号!/g, "\""); $("#tail_option_box").append("
" + x + "
"); } @@ -269,7 +277,7 @@ open_setting_window = function() { }); }); $("#tail_save").click(function() { - var name, oname; + var name, oname, _ref2, _ref3; name = $("#tail_select_text")[0].innerHTML; oname = $("#tail_select_text")[0].getAttribute("oname"); if ($("#tail_select_text")[0].getAttribute("new") === 1) { @@ -287,12 +295,16 @@ open_setting_window = function() { tiebaData.tail_data[name] = $("#tail_data")[0].value + "!分隔!" + $("#tail_type_text")[0].textContent; } } - for (x in tiebaData.tail_data) { + _ref2 = tiebaData.tail_data; + for (x in _ref2) { + if (!__hasProp.call(_ref2, x)) continue; tiebaData.tail_data[x] = tiebaData.tail_data[x].replace(/,/g, "!逗号!").replace(/"/g, "!引号!"); } GM_setValue("tail_data", JSON.stringify(tiebaData.tail_data)); $("#tail_option_box").empty(); - for (x in tiebaData.tail_data) { + _ref3 = tiebaData.tail_data; + for (x in _ref3) { + if (!__hasProp.call(_ref3, x)) continue; tiebaData.tail_data[x] = tiebaData.tail_data[x].replace(/!逗号!/g, ",").replace(/!引号!/g, "\""); $("#tail_option_box").append("
" + x + "
"); } @@ -364,7 +376,7 @@ TailInit = function() { if (!tiebaData.tail_open) { return; } - $("a.j_submit.poster_submit").before("\n \n
\n
\n
\n
"); + $("a.j_submit.poster_submit").before("\n \n \n \n
\n
\n
\n
"); $("#tail_use_text").click(function() { return $("#tail_use_box").slideToggle(400); }); @@ -460,7 +472,7 @@ clearLink = function(event) { }; Init = function() { - var x; + var x, _ref; tiebaData.fentie_open = GM_getValue("fentie_open", 1); tiebaData.fentie_date = GM_getValue("fentie_date", 30); tiebaData.fentie_forbidden = GM_getValue("fentie_forbidden", 1); @@ -479,7 +491,9 @@ Init = function() { GM_setValue("fentie_forbidden", tiebaData.fentie_forbidden); GM_setValue("tail_open", tiebaData.tail_open); GM_setValue("tail_data", JSON.stringify(tiebaData.tail_data)); - for (x in tiebaData.tail_data) { + _ref = tiebaData.tail_data; + for (x in _ref) { + if (!__hasProp.call(_ref, x)) continue; tiebaData.tail_data[x] = tiebaData.tail_data[x].replace(/!逗号!/g, ",").replace(/!引号!/g, "\""); } }