Chrome外掛--》油猴的使用
阿新 • • 發佈:2018-12-25
以前介紹過幾款外掛, 不過都只能弄一下樣式, 遮蔽廣告而已, 沒有能自己寫指令碼的。 這不, 油猴就提供了這個功能。
下載地址:http://chromecj.com/Handler/Download/1468
同樣, 油猴外掛現在也是沒有辦法直接安裝到 Chrome 的了,
需要先安裝外掛伴侶:http://crxhelp.bj.bcebos.com/crxhelp.zip
有了外掛伴侶, 安裝很簡單就不贅述了。
先做一個效果:
- 遮蔽 csdn 回貼框 定焦/失焦 高度變化(這個比較煩人) 的特效 :
- 防止 csdn 管理子選單點選後收縮。
// ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://bbs.csdn.net/* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... // 1. 遮蔽 csdn 回貼框特效 $("#post_body").before('<textarea class="required quoteOnly markItUpEditor" cols="40" id="post_body_tmp" maxlength="10000" rows="20" style="height: 300px;"></textarea>'); var $txt = $("#post_body").hide(); var $tmp = $("#post_body_tmp"); $tmp.on("keyup",function(){ $txt.val($tmp.val()); }); setInterval(function(){ if($txt.val().length>$tmp.val().length+6){ $tmp.val($txt.val()); } },2000); // 2. 防止點選 管理子選單後,選單收縮。 注意替換 yenange 為自己的使用者名稱 var urlCurr = window.location.href; var urlArr =[ "https://bbs.csdn.net/user/open_topics", "https://bbs.csdn.net/users/yenange/topics", "https://bbs.csdn.net/user/pointed_topics", "https://bbs.csdn.net/user/replied_topics", "https://bbs.csdn.net/user/attention_topics", "https://bbs.csdn.net/user/attention_tags", "https://bbs.csdn.net/user/point_transfer"]; if($.inArray( urlCurr, urlArr )!=-1){ $("#menu_302_a").trigger("click"); } })();
是不是很簡單?
雖然沒有直接遮蔽那個 foucs/blur 事件,但在頁面上看來,已經沒有動態效果了, 而且最終也能正常回貼。
下面先貼出 csdn 的相關指令碼(https://csdnimg.cn/release/bbs/dist/js/apps/bbsMin-d7e7277d5f.js),
有空慢慢看吧:
如果哪位大俠知道 如何移除 document 上的 click 事件, 或 遮蔽 左側選單點選“我回復的貼子” 之後的收縮事件,
歡迎告之, 非常感謝!
回貼框相關:
var CSDN = {};
function throttle(o, a, n) {
var i, s = new Date;
return function() {
var t = arguments
, e = new Date;
clearTimeout(i),
n <= e - s ? (o.apply(this, t),
s = e) : i = setTimeout(o, a)
}
}
function keyupFn() {
if (window.localStorage) {
var t = $(".mod_topic_wrap:first").data("topicId");
window.localStorage.setItem(t, JSON.stringify($(".mod_topic_wrap #post_body").val()))
}
}
function SetStorage(t, e) {
window.localStorage && localStorage.setItem(t, e)
}
function editStorage(t) {
var e = $("#bbsModal input[name='reason_type']")
, o = $("#bbsModal #reason")
, a = $("#bbsModal #post_body")
, n = $("#topic_title")
, i = $("#bbsModal #topic_body")
, s = {}
, l = {};
if (e.change(function() {
s.reasonCategory = $(this).val(),
l[t] = s,
SetStorage(t, JSON.stringify(s))
}),
o.keyup(function() {
s.reason = $(this).val(),
l[t] = s,
SetStorage(t, JSON.stringify(s))
}),
a.keyup(function() {
s.editContent = $(this).val(),
l[t] = s,
SetStorage(t, JSON.stringify(s))
}),
n.keyup(function() {
s.topicTitle = $(this).val(),
l[t] = s,
SetStorage(t, JSON.stringify(s))
}),
i.keyup(function() {
s.editTopicContent = $(this).val(),
l[t] = s,
SetStorage(t, JSON.stringify(s))
}),
window.localStorage && localStorage.getItem(t)) {
var c = JSON.parse(localStorage.getItem(t));
c.reasonCategory && ($("#bbsModal input[value=" + c.reasonCategory + "]")[0].checked = !0,
s.reasonCategory = c.reasonCategory),
c.reason && (o.val(c.reason),
s.reason = c.reason),
c.editContent && (a.val(c.editContent),
s.editContent = c.editContent),
c.topicTitle && (n.val(c.topicTitle),
s.topicTitle = c.topicTitle),
c.editTopicContent && (i.val(c.editTopicContent),
s.editTopicContent = c.editTopicContent)
}
}
function showDialog(o, a) {
ajaxFn(o, a, function(t) {
if ($("#bbsModalLabel").html(a),
$("#bbsModal .modal-body").html(t),
"edit" == o) {
var e = $(".bbs_detail_wrap .mod_topic_wrap:first");
editStorage("bbs_edit_reply_" + e.data("topicId") + "_" + e.data("postId")),
checkRemainChars("#bbsModal #topic_title", "#bbsModal #title_count_notice"),
checkRemainChars("#bbsModal #topic_body", "#bbsModal #topic_body_count_notice")
}
$("#bbsModal").modal({
show: "true"
})
})
}
function ajaxFn(t, e, o) {
void 0 !== CFG.TOPIC_ID && $.ajax({
type: "get",
url: CFG.API_URL + "topics/" + CFG.TOPIC_ID + "/" + t,
dataType: "html",
success: function(t) {
"" == t && "undefined" == t || o(t)
},
error: function(t) {
console.log(t)
}
})
}
function comAjaxFn(t, e, o, a, n) {
if (t.preventDefault(),
t.stopPropagation(),
CSDN.getUserName()) {
var i = $(e).closest(".post");
if (i.hasClass("topic"))
if ("舉報" == a)
var s = i.data("postId")
, l = CFG.API_URL + "posts/" + s + o;
else
s = i.data("topicId"),
l = CFG.API_URL + "topics/" + s + o;
else
s = i.data("postId"),
l = CFG.API_URL + "posts/" + s + o;
$.ajax({
type: "get",
url: l,
dataType: "html",
success: function(t) {
"" == t && "undefined" == t || ($("#bbsModalLabel").html(a),
$("#bbsModal .modal-body").html(t),
"function" == typeof n && n(),
$("#bbsModal").modal({
show: "true"
}))
},
error: function(t) {
console.log(t)
}
})
} else
$("#bbsModal").modal({
show: "true"
}),
$("#bbsModalLabel").html("未登入"),
$("#bbsModal .modal-body").html('請<a href="https://passport.csdn.net/">登入</a>')
}
function allCheck(t, e) {
for (var o = document.getElementsByName(t), a = 0; a < o.length; a++)
"checkbox" == o[a].type && (o[a].checked = e)
}
function checkRemainChars(t, e) {
if ($(t).length) {
var o = $(t).attr("maxLength")
, a = $(t).val().length;
a < o ? $(e).html("你還可以輸入" + (o - a) + "個字元") : $(e).html("你還可以輸入0個字元")
}
}
function geniusAjax(t, n) {
$.ajax({
type: "get",
url: t,
dataType: "json",
success: function(t) {
if ("" != t || "undefined" != t) {
for (var e = t.list, o = "", a = 0; a < e.length; a++)
o += '<dl class="genius_list"><dt><a href="' + e[a].profile_url + '" target="_blank"><img src="' + e[a].avatar_url + '"></a></dt><dd><a href="' + e[a].profile_url + '" rel="nofollow" target="_blank" class="user_nick_name" title="' + e[a].show_name + '">' + e[a].show_name + '</a><p class="genius_p"><b> </b><span><img title="專家分:' + e[a].total_tech_point + '" src="' + e[a].point_level_url + '" ></span></p><a href="javascript:;" class="genius_att" data-username="' + e[a].username + '">關注</a></dd></dl>';
$(n).html(o),
CSDN.checkFollow(n)
}
},
error: function(t) {
console.log(t)
}
})
}
function doubleH(t, e, o) {
var a = $(t.target);
a.is(e) || a.is(".edit_btn_wrap span") || $(e).animate({
height: o
}, 300),
t.stopPropagation()
}
$.extend(CSDN, {
getUserName: function() {
var t = document.cookie.match(new RegExp("(^| )UserName=([^;]*)(;|$)"));
return t ? t[2] : ""
},
activeAttLink: function(t) {
this.checkFollow(t),
$(t).on("click", "a.genius_att", function(t) {
t.preventDefault();
var e = $(this);
if (!e.hasClass("followed")) {
var o = e.data("username");
$.ajax({
type: "POST",
url: "//my.csdn.net/index.php/follow/do_follow",
data: {
username: o
},
dataType: "json",
success: function(t) {
1 == t.succ ? (alert("關注成功!"),
e.addClass("followed").text("已關注")) : alert(t.msg)
}
})
}
})
},
checkFollow: function(t) {
var e = CSDN.getUserName().toLowerCase()
, o = $(t);
if ("" !== e) {
var a = o.find("a.genius_att").map(function(t, e) {
return encodeURIComponent($(e).data("username"))
}).get().join()
, n = "//my.csdn.net/index.php/follow/check_is_followed_m/" + encodeURIComponent(e) + "/" + a + "?jsonpcallback=?";
$.getJSON(n, {}, function(t) {
$.each(t, function(t, e) {
1 == e && o.find("a.genius_att[data-username=" + t + "]").addClass("followed").text("已關注")
})
}),
o.find("a.att[data-username=" + e + "]").addClass("followed").text("自己")
}
}
}),
$(function() {
$("select.jumpMenu").change(function() {
var t = $(this).val();
window.location.href = 1 != t ? window.location.pathname + "?page=" + t : window.location.pathname
}),
0 < $("table.table_list").length && $("table.table_list tr:even").addClass("zebra"),
"undefined" != typeof CNick && new CNick(".name2nick").showNickname()
}),
$(function() {
var t, e, o, a = {
tab: function() {
var e = $(".bbs_tab em")
, o = $(".honour_c ul");
e.hover(function() {
$(this).addClass("cur_tab").siblings().removeClass("cur_tab");
var t = e.index(this);
o.eq(t).addClass("cur_block").siblings().removeClass("cur_block")
})
},
leftMenu: function() {
if (0 < $(".csdn_bbs_main").length && 0 < $(".left_menu").length) {
var n = $(window).height() - $(".csdn_bbs_main").offset().top;
$(".left_menu_box").height(n),
window.addEventListener("scroll", (o = function() {
if (0 < $(".csdn_bbs_main").length && 0 < $(".left_menu").length)
var t = $(".csdn_bbs_main").offset().top
, e = $(".left_menu");
var o = t
, a = $(window).scrollTop();
o < a ? window.XMLHttpRequest ? ($(".left_menu_box").css({
height: "100%"
}),
e.css({
position: "fixed",
top: 0
})) : ($(".left_menu_box").css({
height: "100%"
}),
e.css({
top: a
})) : ($(".left_menu_box").css({
height: n
}),
e.css({
position: "absolute",
top: "0px"
}))
}
,
a = 200,
i = 100,
l = new Date,
function() {
var t = arguments
, e = new Date;
clearTimeout(s),
i <= e - l ? (o.apply(this, t),
l = e) : s = setTimeout(o, a)
}
))
}
var o, a, i, s, l;
$(".pub_fo").length && $(".left_menu").length && $(".pub_fo").addClass("pad_left"),
$(".left_menu .btn_toggle_hide").click(function() {
$(".left_menu").css({
left: -210
}),
$(".csdn_bbs_main").removeClass("pad_left"),
$("#csdn-toolbar").addClass("no_pad_left"),
$("div.news-nav").addClass("no_pad_left"),
$(".pub_fo").length && $(".left_menu").length && $(".pub_fo").removeClass("pad_left"),
$(this).toggle(),
$(".left_menu .btn_toggle_show").toggle()
}),
$(".left_menu .btn_toggle_show").click(function() {
$(".left_menu").css({
left: 0
}),
$("div.news-nav").removeClass("no_pad_left"),
$("#csdn-toolbar").removeClass("no_pad_left"),
$(".csdn_bbs_main").addClass("pad_left"),
$(".pub_fo").length && $(".left_menu").length && $(".pub_fo").addClass("pad_left"),
$(this).toggle(),
$(".left_menu .btn_toggle_hide").toggle()
})
},
fixFooter: function() {
var e = $(".fixed_dl");
if (0 < e.length) {
var o = e.offset().top;
e.offset().left;
$(window).scroll(function() {
var t = $(this).scrollTop();
o + 10 <= t ? e.css({
position: "fixed",
top: "0px",
"z-index": 1
}) : e.css({
position: "relative",
top: "0",
"z-index": 1
})
})
}
},
userHead: function() {
$(".topic_wrap .user_head").hover(function(t) {
var o = $(this);
o.data("allow_show", !0);
var e = o.find(".user_material");
if (e.length)
e.show();
else if (!o.data("fetched")) {
o.data("fetched", !0);
var a = CFG.API_URL + "users/" + o.data("username") + "/info";
$.ajax({
url: a
}).success(function(t) {
t = $(t);
var e = "user_meterial_" + Date.now();
t.attr("id", e),
follow_status(t),
o.data("allow_show") || t.hide(),
o.append(t)
})
}
}, function(t) {
var e = $(this);
e.data("allow_show", !1),
e.find(".user_material").hide()
})
},
userLevel: function() {
$(".topic_show_user_level").hover(function() {
$(this).next(".topic_show_posts").show()
}, function() {
$(this).next(".topic_show_posts").hide()
})
},
dropMenu: function() {
$(".drop_menu_wrap").hover(function() {
$(this).addClass("menu_cur").find(".drop_menu").show()
}, function() {
$(this).removeClass("menu_cur").find(".drop_menu").hide()
})
},
praise_stamp: function() {
var t = this;
$(".praise").hover(function() {
t.thumbFn(this, "#csdnc-thumbsup-ok")
}, function() {
t.thumbFn(this, "#csdnc-thumbsup")
}),
$(".stamp").hover(function() {
t.thumbFn(this, "#csdnc-thumbsdown-ok")
}, function() {
t.thumbFn(this, "#csdnc-thumbsdown")
})
},
thumbFn: function(t, e) {
$(t).find("use").attr("xlink:href", e)
},
popFn: function() {
$(".bbs_drop_menu li");
var t = $(".pop_close")
, e = this;
t.on("click", function(t) {
e.popHide(),
t.stopPropagation()
})
},
popShow: function() {
var t = $(".bbs_popup_wrap");
$("#mask").show(),
t.show();
var e = t.height();
t.css({
marginTop: -e / 2
})
},
popHide: function() {
$("#mask").hide(),
$(".bbs_popup_wrap").hide()
},
addPad: function() {
$(".topic_l").each(function() {
$(this).find(".close_topic").length && $(this).addClass("topic_owner")
})
}
};
a.tab(),
a.leftMenu(),
a.fixFooter(),
a.userHead(),
a.userLevel(),
a.dropMenu(),
a.praise_stamp(),
a.popFn(),
a.addPad(),
$(".bbs_drop_menu li").each(function() {
var t = $(this).attr("type")
, e = $(this).find("a").text();
null != t && "" != t && $(this).on("click", function() {
showDialog(t, e)
})
}),
$(".topic_wrap").delegate(".quote", "click", function(t) {
var n = $(this).closest(".post");
if (!n.data().isTopicLocked) {
t.preventDefault(),
t.stopPropagation();
var e = $(this).parents(".mod_topic_wrap").data("postId");
$.getJSON(CFG.API_URL + "posts/" + e + ".json", function(t) {
var e = t.content
, o = n.find(".post_info")
, a = $("#post_body");
e = o.hasClass("floorOwner") ? "[quote=引用 樓主 " + o.data("nickname") + " 的回覆:]\n" + e + "[/quote]" : "[quote=引用 " + o.data("floor") + " 樓 " + o.data("nickname") + " 的回覆:]\n" + e + "[/quote]",
"" !== a.val() && (e = "\n\n" + e),
a.focus().val(a.val() + e)
})
}
}),
$(".topic_wrap").delegate(".report_spam", "click", function(t) {
var e = $(this).closest(".post");
if (e.hasClass("topic"))
var o = e.data("topicId");
else
o = e.data("postId");
comAjaxFn(t, this, "/report?topic_id=" + o, "舉報")
}),
$(".topic_wrap").delegate(".mana_edit", "click", function(t) {
var e = $(this).closest(".post")
, o = "bbs_edit_reply_" + e.data("topicId") + "_" + e.data("postId");
comAjaxFn(t, this, "/edit", "編輯", function() {
editStorage(o),
e.hasClass("topic") ? (checkRemainChars("#bbsModal #topic_title", "#bbsModal #title_count_notice"),
checkRemainChars("#bbsModal #topic_body", "#bbsModal #topic_body_count_notice")) : checkRemainChars("#bbsModal #post_body", "#bbsModal #edit_body_count_notice")
})
}),
t = $(".mod_topic_wrap #post_body"),
e = $(".mod_topic_wrap:first").data("topicId"),
window.localStorage && localStorage.getItem(e) && t.val(JSON.parse(localStorage.getItem(e))),
$(".mod_topic_wrap #post_body").on("keyup", throttle(keyupFn, 200, 600)),
$(".topic_wrap").delegate(".mana_del", "click", function(t) {
comAjaxFn(t, this, "/destroy_edit", "刪除")
}),
$("#forums_search").on("click", function(t) {
$("#subSearch").is(":hidden") && $("#subSearch").show(),
t.stopPropagation()
}),
$("#subSearch").on("click", "li", function(t) {
var e = $(this).text();
$(this).addClass("sub_search_cur").siblings().removeClass("sub_search_cur").parents(".forums_search").find(".forums_txt").html(e),
$("#subSearch").hide(),
t.stopPropagation()
}),
a.checkAll = (o = !1,
void $("#checkbox_btn").on("click", function() {
o ? (allCheck("forums_del", !1),
o = !1) : (allCheck("forums_del", !0),
o = !0)
})),
$("#week .change_group").on("click", function() {
geniusAjax(CFG.API_URL + "change_rank_group?group=weeks", "#week .genius_c")
}),
$("#month .change_group").on("click", function() {
geniusAjax(CFG.API_URL + "change_rank_group?group=months", "#month .genius_c")
}),
$("#bbs_genius .change_group").on("click", function() {
geniusAjax(CFG.API_URL + "change_rank_group?group=total", "#bbs_genius .genius_c")
});
(function(t) {
for (var e = document.cookie.split("; "), o = 0; o < e.length; o++) {
var a = e[o].split("=");
if (a[0] == t && "UD" == t)
return decodeURIComponent(a[1]);
if (a[0] == t)
return decodeURI(a[1])
}
}
)("UserName") || function() {
var t = $("#bbs_detail_wrap");
if (0 < t.length) {
var e = $(window).height()
, o = 1.2 * e;
CSDN.getUserName() ? (t.removeAttr("style"),
$(".hide_topic_box").remove()) : (t.css({
height: o,
overflow: "hidden"
}),
t.append('<div class="hide_topic_box"> <div class="hide_topic_b"> <label class="show_topic js_show_topic"><span>檢視全部</span><svg class="icon" aria-hidden="true"><use xlink:href="#csdnc-chevrondown"></use></svg></label></div></div>')),
$(".js_show_topic").on("click", function() {
return t.removeAttr("style"),
$(this).parents(".hide_topic_box").remove(),
setTimeout(function() {
n = parseInt(c.offset().top)
}, 500),
!1
})
}
}();
var n, i, s, l, c = $(".post_feed_box");
c.length && setTimeout(function() {
n = parseInt(c.offset().top)
}, 1e3);
!function() {
var e = $("#bbs_title_bar");
if (e.length && c.length) {
var o = parseInt(e.offset().top);
$(window).scroll(function() {
var t = $(this).scrollTop();
o <= t && t < n - 300 ? (e.addClass("title_bar_fixed"),
$(".bbs_title_h").show()) : (e.removeClass("title_bar_fixed"),
$(".bbs_title_h").hide())
})
}
}(),
i = window.localStorage,
$(".icon_fullScreen").on("click", function() {
var t = $(this).parents("html");
if (t.hasClass("csdn_editor_fullscreen")) {
if (t.removeClass("csdn_editor_fullscreen"),
i.getItem("sTop")) {
var e = i.getItem("sTop");
$(document).scrollTop(e)
}
} else {
var o = document.documentElement.scrollTop || document.body.scrollTop;
i.setItem("sTop", o),
t.addClass("csdn_editor_fullscreen")
}
}),
s = $(".post_body"),
l = s.find("img"),
s.length && l.each(function(t, e) {
0 == e.src.split("//")[1].indexOf("img-bbs.csdn.net") && $(this).addClass("csdn-preview-img")
}),
function() {
var t = $("#topic_body")
, e = $("#post_body");
if (t.length) {
var o = t.height();
t.on("focus", function() {
$(this).animate({
height: 2 * o
}, 300)
}),
$(document).on("click", function(t) {
doubleH(t, "#topic_body", "200px")
})
}
if (e.length) {
setTimeout(function() {
var t = e.height();
e.on("focus", function() {
$(this).animate({
height: 2 * t
}, 300)
}),
$(document).on("click", function(t) {
doubleH(t, "#post_body", "100px")
})
}, 1e3)
}
}();
var r;
(r = $(".reply_topic")).length && (CSDN.getUserName() ? r.removeAttr("data-bind-login") : r.attr("data-bind-login", !0),
r.on("click", function(t) {
if (CSDN.getUserName()) {
var e = window.location.href;
e.indexOf("#new_post") < 0 && (e.indexOf("#post-") < 0 ? e += "#new_post" : (windowH = e.split("#"),
e = windowH[0] + "#new_post")),
$(this).attr("href", e)
} else
window.csdn.loginBox.show();
t.stopPropagation()
}))
});
var AutoTag = function(t) {
if (!jQuery)
return console.error("需要引用jquery"),
!1;
var i = this
, s = {
tagBox: $("div.tag-box"),
iptTags: $("#hidTags"),
addBtn: $("#addTag"),
splitStr: ",",
maxTagLen: 5,
funAfterEditor: null,
funAfterDel: null,
isEditorble: !0,
quickNext: [13, 188, 229]
};
t && $.extend(s, t),
s.isEditorble && s.tagBox.on("click", "span.name", function() {
$(this).prop("contenteditable", !0);
var t = $(this);
o(t)
}),
s.tagBox.on("keyup", "span.name", function(e) {
e.stopPropagation();
if (void 0 !== s.quickNext.find(function(t) {
return t == e.which
}) && (13 !== (e = e).which && (this.innerText = this.innerText.substring(0, this.innerText.length - 1)),
$(this).trigger("focusout"),
0 < s.quickNext.length && l())) {
var t = s.addTag("");
o(t.find("span.name")),
l()
}
}),
s.tagBox.on("keydown", "span.name", function(t) {
if (t.stopPropagation(),
13 === t.which)
return !1
});
var l = function() {
var t = !0;
return 0 < s.maxTagLen && (s.tagBox.find("div.tag").length === s.maxTagLen ? (s.addBtn.prop("disabled", !0),
t = !1) : (s.addBtn.prop("disabled", !1),
t = !0)),
t
}
, c = function() {
var o = s.tagBox.find("span.name")
, a = ""
, n = s.splitStr;
o.text(function(t, e) {
30 < e.length && (e = e.substring(0, 30)),
$(o[t]).text(e),
a += (0 < t ? n : "") + e
}),
i.allTagsVal = a,
s.iptTags.val(a)
}
, o = function(t) {
var a = s.funAfterEditor
, n = s.iptTags.val()
, e = t;
setTimeout(function() {
e.focus(),
e.one("focusout", function() {
var e = $(this).text().trim()
, t = new RegExp("," + e + "$|^" + e + ",|," + e + ",|^" + e + "$","i");
if (!e || t.test(n))
if (e) {
var o = n.split(",").findIndex(function(t) {
return t === e
});
$(this).parent().index("div.tag") !== o && $(this).parent().remove()
} else
$(this).parent().remove();
else
c(),
$(this).prop("contenteditable", !1),
null !== a && a($(this).parent("div.tag"), e);
l(),
s.setlocalstorage()
})
}, 100)
};
return s.setlocalstorage = function() {
window.localStorage && localStorage.setItem("invite_reply", s.iptTags.val())
}
,
s.addTag = function(t) {
var e = $('<div class="tag"><span class="name" ' + (t ? "" : 'contenteditable="true"') + '></span><svg class="icon icon-guanbi" aria-hidden="true"><use xlink:href="#csdnc-delete"></use></svg></div>');
return e.find("span.name").text(t),
s.addBtn.before(e),
e
}
,
s.addBtn.click(function() {
var t = s.addTag("");
return o(t.find("span.name")),
!1
}),
s.tagBox.on("click", ".icon-guanbi", function(t) {
var e, o;
e = $(this).parent(),
o = e.find("span.name").text(),
e.remove(),
c(),
l(),
null !== s.funAfterDel && s.funAfterDel(o),
s.setlocalstorage()
}),
i.allTagsVal = "",
i.loadTags = function(t) {
if (t)
for (var e = t.split(s.splitStr), o = s.funAfterEditor, a = 0; a < e.length; a++) {
var n = s.addTag(e[a]);
l(),
i.allTagsVal = t,
null !== o && o(n, e[a])
}
}
,
window.localStorage && localStorage.getItem("invite_reply") && i.loadTags(localStorage.getItem("invite_reply")),
i.addTag = function(t) {
if (l()) {
var e = s.addTag(t);
return c(),
s.funAfterEditor(e, t),
l(),
e
}
return !1
}
,
i
}
, topicTag = new AutoTag({
tagBox: $("#articleTagBox"),
iptTags: $("#hidTags"),
addBtn: $("#addTag"),
maxTagLen: 5,
isEditorble: !0
})
, addIntiver = new AutoTag({
tagBox: $("#MansBox"),
iptTags: $("#hidMans"),
addBtn: $("#addMan"),
maxTagLen: 5,
isEditorble: !0
});
!function(l) {
var t, s = '<svg><symbol id="csdnbbs-fileopen" viewBox="0 0 1024 1024"><path d="M0 841.152h896l-18.272 73.152c-10.976 40.384-38.208 73.152-85.344 73.152H85.344C38.208 987.456 0 954.72 0 914.304v-73.152z" fill="#DBDBDB" ></path><path d="M877.728 329.152H1024L891.552 858.88a73.12 73.12 0 0 1-70.944 55.392H73.152A73.152 73.152 0 0 1 0 841.12V109.696a73.152 73.152 0 0 1 73.152-73.152h239.84c31.488 0 59.424 20.16 69.376 50.016l32.096 96.288h390.08A73.152 73.152 0 0 1 877.696 256v73.152z" fill="#4788C7" ></path><path d="M804.576 329.152H146.304l-73.152 292.576v-512h239.84L361.76 256h442.816z" fill="#B6DCFE" ></path><path d="M930.336 402.272H203.424L93.696 841.12h726.912z" fill="#DFF0FE" ></path></symbol><symbol id="csdnbbs-subfile" viewBox="0 0 1024 1024"><path d="M73.12 877.737141h877.673145v73.147429a73.147428 73.147428 0 0 1-73.147428 73.147428H146.267428A73.147428 73.147428 0 0 1 73.12 950.88457v-73.147429z" fill="#DBDBDB" ></path><path d="M146.267428 0.063996h481.249922c19.646772 0 38.461596 7.903506 52.220736 21.91863l250.128367 253.584151c13.407162 13.663146 20.926692 32.061996 20.926692 51.1968v550.909568a73.147428 73.147428 0 0 1-73.147428 73.147429H146.267428A73.147428 73.147428 0 0 1 73.12 877.673145V73.147428A73.147428 73.147428 0 0 1 146.267428 0z" fill="#4788C7" ></path><path d="M146.267428 73.211424v804.525717h731.378289v-511.968002H585.088002V73.211424H146.267428z m511.968002 31.134054v188.276233h185.684395l-185.684395-188.276233z" fill="#FFFFFF" ></path></symbol><symbol id="csdnbbs-file" viewBox="0 0 1024 1024"><path d="M0 841.152h1024v73.152c0 40.384-38.208 73.152-85.344 73.152H85.312c-47.136 0-85.344-32.736-85.344-73.152v-73.152z" fill="#DBDBDB" ></path><path d="M414.464 182.848h536.384A73.152 73.152 0 0 1 1024 256v585.152a73.152 73.152 0 0 1-73.152 73.152H73.12a73.152 73.152 0 0 1-73.152-73.152V109.728a73.152 73.152 0 0 1 73.152-73.152H312.96c31.488 0 59.424 20.16 69.376 50.016l32.096 96.288z" fill="#4788C7" ></path><path d="M73.152 256v585.152h877.728V256z" fill="#DFF0FE" ></path><path d="M337.376 182.848l-24.384-73.152H73.152v73.152z" fill="#B6DCFE" ></path></symbol><symbol id="csdnbbs-fileuser" viewBox="0 0 1024 1024"><path d="M0 841.152h1024v73.152c0 40.384-38.208 73.152-85.344 73.152H85.312c-47.136 0-85.344-32.736-85.344-73.152v-73.152z" fill="#DBDBDB" ></path><path d="M414.464 182.848h536.384A73.152 73.152 0 0 1 1024 256v585.152a73.152 73.152 0 0 1-73.152 73.152H73.12a73.152 73.152 0 0 1-73.152-73.152V109.728a73.152 73.152 0 0 1 73.152-73.152H312.96c31.488 0 59.424 20.16 69.376 50.016l32.096 96.288z" fill="#4788C7" ></path><path d="M731.424 841.152c-8.672-122.592-103.776-219.424-219.424-219.424s-210.72 96.832-219.424 219.424H73.152V256h877.728v585.152h-219.424zM512 548.576a109.728 109.728 0 1 0 0-219.424 109.728 109.728 0 0 0 0 219.424z" fill="#DFF0FE" ></path><path d="M337.376 182.848l-24.384-73.152H73.152v73.152z" fill="#B6DCFE" ></path></symbol><symbol id="csdnbbs-filemark" viewBox="0 0 1024 1024"><path d="M0 841.152h1024v73.152c0 40.384-38.208 73.152-85.344 73.152H85.312c-47.136 0-85.344-32.736-85.344-73.152v-73.152z" fill="#DBDBDB" ></path><path d="M414.464 182.848h536.384A73.152 73.152 0 0 1 1024 256v585.152a73.152 73.152 0 0 1-73.152 73.152H73.12a73.152 73.152 0 0 1-73.152-73.152V109.728a73.152 73.152 0 0 1 73.152-73.152H312.96c31.488 0 59.424 20.16 69.376 50.016l32.096 96.288z" fill="#4788C7" ></path><path d="M73.152 256h877.728v585.152H73.152V256zM512 708.384l111.072 57.12a22.24 22.24 0 0 0 13.504 2.24c12.672-1.888 21.44-14.176 19.616-27.424l-17.632-128.128 86.272-92.832a24.512 24.512 0 0 0 6.208-12.736c2.176-13.184-6.272-25.696-18.88-28l-121.984-22.08-57.76-114.496a22.72 22.72 0 0 0-40.96 0l-57.76 114.496-121.984 22.08a22.88 22.88 0 0 0-12.192 6.496 24.992 24.992 0 0 0-0.48 34.24l86.272 92.832-17.632 128.128a25.28 25.28 0 0 0 2.144 14.144 22.72 22.72 0 0 0 31.008 11.04l111.072-57.12z" fill="#DFF0FE" ></path><path d="M337.376 182.848l-24.384-73.152H73.152v73.152z" fill="#B6DCFE" ></path></symbol><symbol id="csdnbbs-edit" viewBox="0 0 1024 1024"><path d="M365.728 877.728l-219.424-219.424L804.576 0.032 1024 219.456 365.728 877.728zM0 804.576l73.152-73.152 219.424 219.424L219.424 1024H0v-219.424z" ></path></symbol><symbol id="csdnc-delete" viewBox="0 0 1024 1024"><path d="M877.728 0L512 365.728 146.272 0 0 146.272 365.824 512 0 877.728 146.272 1024 512 658.272 877.728 1024 1024 877.728 658.208 512 1024 146.272z" ></path></symbol><symbol id="csdnc-light" viewBox="0 0 1024 1024"><path d="M219.851795 438.841463H117.74139a44.031312 44.031312 0 0 1-41.759347-58.175091L190.892247 49.31155A73.59885 73.59885 0 0 1 260.49116 0.00032h503.800128a73.59885 73.59885 0 0 1 69.598912 49.31123l114.910205 331.354822a43.839315 43.839315 0 0 1-27.359573 55.775129 44.15931 44.15931 0 0 1-14.399775 2.399962h-102.110404a292.571429 292.571429 0 0 1-585.142857 0z m73.150857 0a219.420572 219.420572 0 0 0 438.841143 0H293.002652z m330.106842 375.834128a51.1992 51.1992 0 0 1 65.630974 30.591522l40.031375 109.982281a51.2312 51.2312 0 0 1-96.222497 35.039453l-40.031374-109.982282a51.2312 51.2312 0 0 1 30.591522-65.630974z m-221.340542 0a51.1992 51.1992 0 0 1 30.591522 65.630974l-40.031374 109.982282a51.1992 51.1992 0 0 1-96.222497-35.039453l40.031375-109.982281a51.1992 51.1992 0 0 1 65.630974-30.591522z m379.354073-107.134326a51.1992 51.1992 0 0 1 72.414868 0l82.750707 82.750707a51.1992 51.1992 0 1 1-72.414868 72.414868l-82.750707-82.750707a51.1992 51.1992 0 0 1 0-72.414868z m-537.399603 0a51.1992 51.1992 0 0 1 0 72.414868L160.972715 862.70684a51.1992 51.1992 0 1 1-72.414869-72.414868l82.750707-82.750707a51.1992 51.1992 0 0 1 72.414869 0z" ></path></symbol><symbol id="csdnc-addpoints" viewBox="0 0 1024 1024"><path d="M146.272 950.848h731.424V1024H146.272A146.272 146.272 0 0 1 0 877.728V146.304h73.152v731.424a73.152 73.152 0 0 0 73.152 73.152zM219.424 0h731.424A73.152 73.152 0 0 1 1024 73.152v731.424a73.152 73.152 0 0 1-73.152 73.152H219.424a73.152 73.152 0 0 1-73.152-73.152V73.152A73.152 73.152 0 0 1 219.424 0zM512 365.728h-146.272a73.152 73.152 0 0 0 0 146.304H512v146.272a73.152 73.152 0 0 0 146.304 0v-146.272h146.272a73.152 73.152 0 0 0 0-146.304h-146.272V219.456a73.152 73.152 0 0 0-146.304 0v146.272z" ></path></symbol><symbol id="csdnbbs-lock" viewBox="0 0 1024 1024"><path d="M219.401144 365.758855V292.610284a292.562286 292.562286 0 0 1 585.124572 0v73.148571h73.148571a73.148571 73.148571 0 0 1 73.148571 73.148571v511.976001a73.148571 73.148571 0 0 1-73.148571 73.148572H146.284571A73.148571 73.148571 0 0 1 73.136 950.883427v-511.976001a73.148571 73.148571 0 0 1 73.148571-73.148571h73.148571z m438.859428 0V292.610284a146.265144 146.265144 0 1 0-292.530287 0v73.148571h292.562286zM365.698286 694.863428c0 80.444229 65.820915 146.265144 146.265144 146.265144s146.265144-65.820915 146.265144-146.265144-65.820915-146.265144-146.265144-146.265144-146.265144 65.820915-146.265144 146.265144z" ></path></symbol><symbol id="csdnbbs-recommend" viewBox="0 0 1024 1024"><path d="M146.272 0A146.272 146.272 0 0 0 0 146.272v731.424a146.272 146.272 0 0 0 146.272 146.272h731.424a146.272 146.272 0 0 0 146.272-146.272V146.272A146.272 146.272 0 0 0 877.696 0H146.272z m512 804.576v-73.152h-219.424v-73.152h292.576v-73.152h-292.576v-73.152h438.848v73.152h-73.152v73.152h73.152v73.152h-146.272v146.272h-292.576v-73.152h219.424zM292.576 365.728V292.576H146.304V219.424h146.272V146.272h73.152v73.152h292.576V146.272h73.152v73.152h146.272v73.152h-146.272v73.152h146.272v73.152h-512v438.848H292.576v-219.424H219.424v-73.152h73.152v-146.272H146.304v-73.152h146.272z m73.152 0h292.576V292.576h-292.576v73.152z m-219.456 292.544h73.152v73.152H146.272v-73.152z" ></path></symbol><symbol id="csdnbbs-arrows" viewBox="0 0 1024 1024"><path d="M219.424 585.152v146.272L0 512l219.424-219.424v146.272h219.424V219.424H292.576L512 0l219.424 219.424h-146.272v219.424h219.424V292.576L1024 512l-219.424 219.424v-146.272h-219.424v219.424h146.272L512 1024l-219.424-219.424h146.272v-219.424z" ></path></symbol><symbol id="csdnbbs-up" viewBox="0 0 1024 1024"><path d="M512 0l512 512h-292.576v365.728H292.576V512H0L512 0zM73.152 950.848h877.728V1024H73.152v-73.152z" ></path></symbol><symbol id="csdnbbs-rss" viewBox="0 0 1024 1024"><path d="M146.285714 0h731.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v731.428572a146.285714 146.285714 0 0 1-146.285714 146.285714H146.285714a146.285714 146.285714 0 0 1-146.285714-146.285714V146.285714a146.285714 146.285714 0 0 1 146.285714-146.285714z m73.142857 877.714286a73.142857 73.142857 0 1 0 0-146.285715 73.142857 73.142857 0 0 0 0 146.285715z m658.285715 0C877.714286 473.746286 550.253714 146.285714 146.285714 146.285714v146.285715a585.142857 585.142857 0 0 1 585.142857 585.142857h146.285715z m-292.571429 0a438.857143 438.857143 0 0 0-438.857143-438.857143v146.285714a292.571429 292.571429 0 0 1 292.571429 292.571429h146.285714z" ></path></symbol><symbol id="csdnbbs-starok" viewBox="0 0 1024 1024"><path d="M511.899224 884.958242l-259.143636 133.219024a52.980477 52.980477 0 0 1-72.304274-25.722405 58.80321 58.80321 0 0 1-4.990914-33.016819l41.079065-298.878994L15.36722 443.966157a58.355308 58.355308 0 0 1 1.087763-79.854631A53.236421 53.236421 0 0 1 44.800818 348.946824l284.546111-51.508797L464.10162 30.360117a52.852505 52.852505 0 0 1 95.595208 0l134.754691 267.07791 284.546111 51.508797c29.369612 5.310845 49.077326 34.552485 43.958439 65.265805a57.459503 57.459503 0 0 1-14.460854 29.753528l-201.236232 216.592891 41.079066 298.878994c4.223081 30.905278-16.252465 59.507057-45.75005 63.986083a51.956699 51.956699 0 0 1-31.545139-5.246859L511.899224 884.958242z" ></path></symbol><symbol id="csdnbbs-star" viewBox="0 0 1024 1024"><path d="M739.68968 639.187697L953.403197 409.349686l-301.694381-54.580128L511.899224 77.645832l-139.745605 277.05974-301.694382 54.580128L284.108769 639.187697l-43.062634 313.083904L511.899224 812.973898l270.85309 139.297703-43.062634-313.083904zM511.899224 884.894255L252.755588 1018.241253a52.980477 52.980477 0 0 1-72.304274-25.722406 58.80321 58.80321 0 0 1-4.990914-33.016819l41.079065-298.878994L15.36722 443.966157a58.355308 58.355308 0 0 1 1.087763-79.854631A53.236421 53.236421 0 0 1 44.800818 348.946824l284.546111-51.508797L464.10162 30.360117a52.852505 52.852505 0 0 1 95.595208 0l134.754691 267.07791 284.546111 51.508797c29.369612 5.310845 49.077326 34.552485 43.958439 65.265805a57.459503 57.459503 0 0 1-14.460854 29.753528l-201.236232 216.592891 41.079066 298.878994c4.223081 30.905278-16.252465 59.507057-45.75005 63.986083a51.956699 51.956699 0 0 1-31.545139-5.246859L511.899224 884.958242z" ></path></symbol><symbol id="csdnbbs-filedown" viewBox="0 0 1024 1024"><path d="M73.12 877.728h877.728v73.152a73.152 73.152 0 0 1-73.152 73.152H146.272A73.152 73.152 0 0 1 73.12 950.88v-73.152z" fill="#DBDBDB" ></path><path d="M146.272 0h554.432c19.648 0 38.464 7.904 52.224 21.92l176.992 180.48c13.408 13.664 20.928 32.064 20.928 51.2v624.096a73.152 73.152 0 0 1-73.152 73.152H146.272A73.152 73.152 0 0 1 73.12 877.696V73.12A73.152 73.152 0 0 1 146.272-0.032z" fill="#4788C7" ></path><path d="M146.272 73.152v804.576h731.424V253.632l-176.992-180.48z" fill="#FFFFFF" ></path><path d="M511.968 731.424L292.544 512h146.272V292.576h146.272V512h146.272z" fill="#4788C7" ></path></symbol><symbol id="csdnbbs-drop" viewBox="0 0 1024 1024"><path d="M307.2 0h409.632v511.968h183.584a51.2 51.2 0 0 1 36.192 87.424l-424.576 424.64-424.64-424.64A51.2 51.2 0 0 1 123.584 512H307.2V0.032z" fill="#FF630D" ></path><path d="M776.832 614.368h-162.368V102.4h-204.832v511.968H247.232l264.832 264.864z" fill="#FFA783" ></path></symbol><symbol id="csdnbbs-rise" viewBox="0 0 1024 1024"><path d="M307.2 1024h409.632V512.032h183.584a51.2 51.2 0 0 0 36.192-87.424L512.032-0.032l-424.64 424.64A51.2 51.2 0 0 0 123.584 512H307.2v511.968z" fill="#2E942E" ></path><path d="M776.832 409.632h-162.368V921.6h-204.832V409.632H247.232l264.832-264.864z" fill="#6FD46F" ></path></symbol><symbol id="csdnbbs-manage" viewBox="0 0 1195 1024"><path d="M85.333 0h1024c47.128 0 85.333 38.205 85.333 85.333v853.333c0 47.128-38.205 85.333-85.333 85.333h-1024C38.205 1023.999 0 985.794 0 938.666V85.333C0 38.205 38.205 0 85.333 0z" fill="#B6DCFE" ></path><path d="M349.593 682.667c18.302-49.084 65.01-83.979 119.74-83.979s101.438 34.895 119.74 83.979h434.926V768H591.388c-16.393 52.615-64.84 90.751-122.056 90.751S363.669 820.615 347.276 768H170.665v-85.333h178.926zM603.277 256c16.393-52.615 64.84-90.751 122.056-90.751S830.996 203.385 847.389 256H1024v85.333H845.074c-18.302 49.084-65.01 83.979-119.74 83.979s-101.438-34.895-119.74-83.979H170.668V256h432.611zM469.333 773.418c23.261 0 42.667-19.714 42.667-44.698s-19.406-44.698-42.667-44.698c-23.261 0-42.667 19.714-42.667 44.698s19.406 44.698 42.667 44.698z m256-433.439c23.261 0 42.667-19.714 42.667-44.698s-19.406-44.698-42.667-44.698c-23.261 0-42.667 19.714-42.667 44.698s19.406 44.698 42.667 44.698z" fill="#4788C7" ></path></symbol><symbol id="csdnbbs-up2" viewBox="0 0 1024 1024"><path d="M512 0L0 512h256v512h512V512h256z" fill="#59B300" ></path></symbol><symbol id="csdnbbs-add" viewBox="0 0 1024 1024"><path d="M365.714 365.714V73.143C365.714 32.747 398.461 0 438.857 0h146.286c40.396 0 73.143 32.747 73.143 73.143v292.571h292.571c40.396 0 73.143 32.747 73.143 73.143v146.286c0 40.396-32.747 73.143-73.143 73.143H658.286v292.571c0 40.396-32.747 73.143-73.143 73.143H438.857c-40.396 0-73.143-32.747-73.143-73.143V658.286H73.143C32.747 658.286 0 625.539 0 585.143V438.857c0-40.396 32.747-73.143 73.143-73.143h292.571z" fill="#2E942E" ></path><path d="M438.857 73.143v365.714H73.143v146.286h365.714v365.714h146.286V585.143h365.714V438.857H585.143V73.143z" fill="#6FD46F" ></path></symbol><symbol id="csdnbbs-0" viewBox="0 0 1024 1024"><path d="M170.656 256v597.344l128-170.656h554.656V256.032H170.656z m0-85.344h682.656A85.344 85.344 0 0 1 938.656 256v426.656A85.344 85.344 0 0 1 853.312 768h-512l-102.4 136.544a85.312 85.312 0 0 1-153.6-51.2V256a85.344 85.344 0 0 1 85.344-85.344z" fill="#CCCCCC" ></path></symbol><symbol id="csdnbbs-1" viewBox="0 0 1024 1024"><path d="M728.992 320L652.48 243.488a42.656 42.656 0 1 1 60.352-60.352l76.512 76.512 76.512-76.512a42.656 42.656 0 1 1 60.352 60.352L849.696 320l76.512 76.512a42.656 42.656 0 1 1-60.352 60.352l-76.512-76.512-76.512 76.512a42.656 42.656 0 1 1-60.352-60.352L728.992 320z" fill="#F21F2B" ></path><path d="M170.656 256v597.344l128-170.656h554.656v-128a42.656 42.656 0 0 1 85.312 0v128a85.344 85.344 0 0 1-85.344 85.344h-512l-102.4 136.544a85.312 85.312 0 0 1-153.6-51.2V256.032a85.344 85.344 0 0 1 85.344-85.344l384 0.224c21.408 0 38.4 20.32 38.4 42.464s-16.704 42.656-38.4 42.656h-384z" fill="#CCCCCC" ></path></symbol><symbol id="csdnbbs-2" viewBox="0 0 1024 1024"><path d="M170.656 256v597.344l128-170.656h554.656v-256a42.656 42.656 0 0 1 85.312 0v256a85.344 85.344 0 0 1-85.344 85.344h-512l-102.4 136.544a85.312 85.312 0 0 1-153.6-51.2V256.032a85.344 85.344 0 0 1 85.344-85.344l512 0.224c21.408 0 38.4 20.32 38.4 42.464s-16.704 42.656-38.4 42.656h-512z" fill="#CCCCCC" ></path><path d="M585.92 464.448l277.024-277.024a42.656 42.656 0 1 1 60.352 60.352l-307.2 307.2a42.656 42.656 0 0 1-60.352 0l-141.44-141.44a42.656 42.656 0 1 1 60.352-60.352l111.264 111.264z" fill="#86CA5E" ></path></symbol><symbol id="csdnbbs-3" viewBox="0 0 1024 1024"><path d="M810.656 421.28v48.064a42.656 42.656 0 0 1-85.312 0V384c0-23.552 19.104-42.656 42.656-42.656A85.344 85.344 0 1 0 682.656 256a42.656 42.656 0 0 1-85.312 0 170.656 170.656 0 1 1 213.312 165.28zM768 622.944a42.656 42.656 0 1 1 0-85.344 42.656 42.656 0 0 1 0 85.344z" fill="#3399EA" ></path><path d="M170.656 256v597.344l128-170.656h554.656v-170.656a42.656 42.656 0 0 1 85.312 0v170.656a85.344 85.344 0 0 1-85.344 85.344h-512l-102.4 136.544a85.312 85.312 0 0 1-153.6-51.2V256.032a85.344 85.344 0 0 1 85.344-85.344l341.344 0.224c21.408 0 38.4 20.32 38.4 42.464s-16.704 42.656-38.4 42.656H170.624z" fill="#CCCCCC" ></path></symbol></svg>', e = (t = document.getElementsByTagName("script"))[t.length - 1].getAttribute("data-injectcss");
if (e && !l.__iconfont__svg__cssinject__) {
l.__iconfont__svg__cssinject__ = !0;
try {
document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")
} catch (t) {
console && console.log(t)
}
}
!function(t) {
if (document.addEventListener)
if (~["complete", "loaded", "interactive"].indexOf(document.readyState))
setTimeout(t, 0);
else {
var e = function() {
document.removeEventListener("DOMContentLoaded", e, !1),
t()
};
document.addEventListener("DOMContentLoaded", e, !1)
}
else
document.attachEvent && (o = t,
a = l.document,
n = !1,
i = function() {
n || (n = !0,
o())
}
,
(s = function() {
try {
a.documentElement.doScroll("left")
} catch (t) {
return void setTimeout(s, 50)
}
i()
}
)(),
a.onreadystatechange = function() {
"complete" == a.readyState && (a.onreadystatechange = null,
i())
}
);
var o, a, n, i, s
}(function() {
var t, e, o, a, n, i;
(t = document.createElement("div")).innerHTML = s,
s = null,
(e = t.getElementsByTagName("svg")[0]) && (e.setAttribute("aria-hidden", "true"),
e.style.position = "absolute",
e.style.width = 0,
e.style.height = 0,
e.style.overflow = "hidden",
o = e,
(a = document.body).firstChild ? (n = o,
(i = a.firstChild).parentNode.insertBefore(n, i)) : a.appendChild(o))
})
}(window),
function(t, o) {
"use strict";
t.addEventListener("DOMContentLoaded", function() {
var e = o.location.href.replace(o.location.hash, "");
[].slice.call(t.querySelectorAll("use[*|href]")).filter(function(t) {
return 0 === t.getAttribute("xlink:href").indexOf("#")
}).forEach(function(t) {
t.setAttribute("xlink:href", e + t.getAttribute("xlink:href"))
})
}, !1)
}(document, window);
var topics_page_js = {};
function child_forum_html(t) {
$("#select_child_forum").html($("#selectForumTemplate").tmpl({
notice: "-選擇小版塊-",
forums: t
}))
}
topics_page_js.new_page = function(t) {
$("#select_parent_forum, #select_child_forum").change(function() {
$(this).find(":selected").data("tech-forum") ? ($("#topic_point").attr("min", 50),
t < 50 && alert("您沒有足夠的可用分在技術區發帖")) : $("#topic_point").attr("min", 0)
}),
$("#select_child_forum").change(function() {
var t = $(this).find(":selected").data("max-point");
$("#topic_point").attr("max", t)
});
$("#new_topic").validate({
rules: {
"topic[body]": {
maxlength: 1e4,
minlength: 10
}
},
submitHandler: function(t) {
var e = $(t);
e.data("load_submitted") || (e.data("load_submitted", !0),
e.find(".submit_load_icon").after('<img src="/assets/icon_loading.gif" class="icon_loading" />'),
t.submit(),
localStorage.removeItem("new_pub_topic"),
localStorage.removeItem("invite_reply"))
}
})
}
,
topics_page_js.show_page = function() {
function e() {
!0 === iframe_login_success_flag && location.reload()
}
$(".post_body img").each(function(t, e) {
$(this).attr("src") && $(this).attr("src").match(new RegExp("https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin")) || $(this).addClass("image_border")
}),
$('select[name="filter_posts"]').change(function() {
switch ($(this).val()) {
case "default":
$(".post_info:not(.deleted)").closest(".post").show(),
$(".post_info.deleted").closest(".post").hide();
break;
case "all":
$(".post").show();
break;
case "star":
$(".post_info:not(.deleted)").closest(".post").show(),
$(".post_info:not(.star, .topic)").closest(".post").hide();
break;
case "pointed":
$(".post_info:not(.deleted)").closest(".post").show(),
$(".post_info:not(.pointed, .topic)").closest(".post").hide();
break;
case "lz":
window.location.href = window.location.pathname + "?list=lz";
break;
case "unlz":
window.location.href = window.location.pathname
}
}),
$("#fav").click(function() {
var t = parseInt(screen.availWidth / 2 - 297.5, 0)
, e = parseInt(screen.availHeight / 2 - 166.5, 0);
return window.open(this.href, "_blank", "width=595,height=333,top=" + e + ",left=" + t + ",screenX=" + t + ",screenY=" + e + ",location=no,menubar=no,scrollbars=no,status=no,titlebar=no,toolbar=no,directories=no"),
!1
}),
window.open_embeded_betting_iframe_login = function(t) {
$.fancybox(CSDN.appConfig.csdn_passport_ssl_domain + "/account/loginbox?from=" + t, {
type: "iframe",
width: 350,
height: 240,
autoScale: !1,
onClosed: e,
hideOnOverlayClick: !1
})
}
,
window.iframe_login_success_flag = !1,
$(".post_body img").each(function(t, e) {
(750 <= e.width || 750 <= e.height) && (e.title = "點選檢視原始大小圖片",
$(e).addClass("magplus"),
$(e).click(function() {
window.open(e.src, "_blank")
}))
})
}
,
topics_page_js._form_page = function() {
var t = function() {
$("#title_count_notice").html($("#countTemplate").tmpl({
count: 80 - $("#topic_title").val().length
}))
};
t();
var e = function() {
$("#topic_body_count_notice").html($("#countTemplate").tmpl({
count: 1e4 - $("#topic_body").val().length
}))
};
e(),
$("#topic_title").keyup(t),
$("#topic_body").keyup(e),
$("#topic_body").markItUp(bbcodeSettings)
}
,
topics_page_js._select_forum_page = function() {
var t = $.map(forum_tree, function(t) {
return t
});
$("#select_parent_forum").html($("#selectForumTemplate").tmpl({
notice: "-選擇大版塊-",
forums: t
})),
$("#select_parent_forum").change(function() {
child_forum_html(forum_tree[$(this).val()] ? forum_tree[$(this).val()].child_forums : [])
})
}
,
topics_page_js.close_edit_page = function(t) {
var e = t
, o = e
, l = function() {
o = e,
$.each($("input.post_point"), function() {
$(this).val().match(/\d+/) && (o -= parseInt($(this).val(), 0))
}),
$("#point_notice").replaceWith($("#pointNoticeTemplate").tmpl({
total: e,
last: o
})),
0 === o && $(".checkTotalNotice").remove()
};
$("input.post_point").mouseover(function() {
$("#pointNoticeTemplate").tmpl({
total: e,
last: o
}).insertAfter($(this)),
$(this).select()
}).mouseout(function() {
$("#point_notice").remove()
}).keyup(function() {
$(this).valid() && l()
}),
$("#close_topic_form").validate({
submitHandler: function(t) {
0 === o ? ($(".close_submit").val("結帖給分...").prop("disabled", !0),
t.submit()) : alert("給分與總分不符,請重新分配!")
}
}),
$("a.average").click(function(t) {
t.preventDefault();
var a = $("input.post_point[value!=0]").map(function(t, e) {
return $(e).data("username")
})
, n = [];
$("input.post_point").each(function(t, e) {
var o = $(e).data("username");
-1 == $.inArray(o, a) && -1 == $.inArray(o, n) && n.push(o)
});
var e = n.length
, i = parseInt(o / e, 0)
, s = o % e;
$.each(n, function(t, e) {
var o = $("input.post_point[data-username=" + e + "]").first();
0 < s ? (o.val(i + 1),
s--) : o.val(i)
}),
l()
})
}
,
topics_page_js.top_edit_page = function() {
$("#search_parent_forum").click(function(t) {
t.preventDefault(),
"" !== $("#select_parent_forum").val() ? $("#select_parent_forum :selected").data("moderator") ? ($("input[name=forum_id]").val($("#select_parent_forum").val()),
$("#top_topic_form").submit()) : alert("沒有該版管理許可權") : alert("請選擇大版塊")
}),
$("#search_child_forum").click(function(t) {
t.preventDefault(),
"" !== $("#select_child_forum").val() ? $("#select_child_forum :selected").data("moderator") ? ($("input[name=forum_id]").val($("#select_child_forum").val()),
$("#top_topic_form").submit()) : alert("沒有該版管理許可權") : alert("請選擇小版塊")
})
}
;
var posts_page_js = {
_form_page: function() {
$("#post_body").markItUp(bbcodeSettings),
$("#post_body").keypress(function(t) {
var e = t.which ? t.which : t.keyCode;
if (10 === e || 13 == e && t.ctrlKey) {
var o = $(this).closest("form");
!0 !== o.find("#submit_new_post_form").prop("disabled") && o.submit()
}
});
var t = function() {
$("#body_count_notice").html($("#countTemplate").tmpl({
count: 1e4 - $("#post_body").val().length
}))
};
CSDN.getUserName() && t(),
$("#post_body").keyup(t),
jQuery.validator.addMethod("quoteOnly", function(t, e) {
return this.optional(e) || (null === (a = /^\s*\[quote.*\][\s\S]*\[\/quote\]\s*$/im.exec(o = t)) || o != a[0]);
var o, a
}, "只有引用的內容不允許回覆!");
$("#new_post").validate({
rules: {
"post[body]": {
maxlength: 1e4,
minlength: 6
}
},
submitHandler: function(t) {
var n = $("#submit_new_post_form")
, i = n[0];
i.disabled = !0,
n.after('<img src="/assets/icon_loading.gif" class="icon_loading" />');
var e = {
dataType: "json",
clearForm: !0,
error: function(t, e, o) {
i.disabled = !1,
n.next(".icon_loading").remove(),
403 == t.status && "需要登入" == t.responseText ? loginbox() : 400 <= t.status && t.status < 500 ? alert(t.responseText) : 503 == t.status ? alert(t.responseText + "!") : alert("添加回復失敗,請重試")
},
success: function(t, e, o) {
i.disabled = !1,
n.next(".icon_loading").remove(),
location.href = t.redirect_to;
var a = $(".bbs_detail_wrap .mod_topic_wrap:first").data("topicId");
localStorage.removeItem(a)
}
};
$(t).ajaxSubmit(e)
}
}),
window.iframe_login_success_flag = !1,
$(".bbs_topic_loginbox_link").on("click", function(t) {
t.preventDefault();
var e = this;
csdn.showLogin(function() {
$(e).parent().remove()
})
})
},
edit_page: function() {
$("#post_edit .body").markItUp(bbcodeSettings),
$("form.publish").validate();
var t = function() {
$("#edit_body_count_notice").html($("#countTemplate").tmpl({
count: 1e4 - $("#post_edit .body").val().length
}))
};
t(),
$("#post_edit .body").keyup(t)
}
}
, main_page_js = {};
function loginbox() {
var t = $("#pop_win");
t.html('<iframe src="//passport.csdn.net/account/loginbox?service=' + window.location.protocol + '//bbs.csdn.net/callback.html" frameborder="0" height="600" width="400" scrolling="no"></iframe>'),
$("#popup_mask").css({
opacity: .5,
width: $(document).width() + "px",
height: $(document).height() + "px"
}),
$("#popup_mask").css("display", "block"),
t.css({
top: ($(window).height() - t.height()) / 2 + $(window).scrollTop() + "px",
left: ($(window).width() - t.width()) / 2
}),
setTimeout(function() {
t.show(),
t.css({
opacity: 1
})
}, 200),
$("#popup_mask").unbind("click"),
$("#popup_mask").bind("click", function() {
$("#popup_mask").hide();
var t = $("#pop_win");
return $("#common_ask_div_sc").css("display", "none"),
t.css({
opacity: 0
}),
setTimeout(function() {
t.hide()
}, 350),
!1
})
}
main_page_js.home_page = function() {
CSDN.activeAttLink(".bbs_cow_c")
}
,
main_page_js.rank_page = function() {
CSDN.activeAttLink(".bor_bot"),
$(".bor_bot .attention_all").click(function(t) {
if (t.preventDefault(),
CSDN.getUserName()) {
var n = $(this).closest(".bor_bot")
, e = n.find(".genius_att:not(.followed)")
, i = e.length;
console.log(e);
var s = 0;
e.each(function(t, e) {
var o = "//my.csdn.net/index.php/follow/do_follow"
, a = $(e).data("username");
$.ajax({
type: "POST",
url: o,
data: {
username: a
},
dataType: "json",
success: function(t) {
1 == t.succ ? (n.find("a.genius_att[data-username=" + a + "]").addClass("followed").text("已關注"),
(s += 1) == i && alert("關注成功")) : alert(t.msg)
}
}),
$.getJSON(o, {
username: a
}, function(t) {
1 == t.succ ? (n.find("a.genius_att[data-username=" + a + "]").addClass("followed").text("已關注"),
(s += 1) == i && alert("關注成功")) : alert(t.msg)
})
})
} else
alert("請先登入")
}),
$(".expert_point_main").hover(function() {
$(this).find(".expert_point_details").show()
}, function() {
$(this).find(".expert_point_details").hide()
})
}
,
main_page_js.medal_page = function() {
$(".table_medals").on("click", "ul ~ a", function() {
var t = $(this).prev("ul");
$(t).is(":hidden") ? (t.slideDown(),
this.innerHTML = "<<收起") : (t.slideUp(),
this.innerHTML = "檢視更多>>")
})
}
,
document.domain = "csdn.net";
var forums_page_js = {
rank_page: function() {
var t = $.map(forum_tree, function(t) {
return t
});
$("#select_parent_forum").html($("#selectForumTemplate").tmpl({
notice: "-選擇大論壇-",
forums: t
})),
$("#select_parent_forum").change(function() {
var t = forum_tree[$(this).val()] ? forum_tree[$(this).val()].child_forums : [];
$("#select_child_forum").html($("#selectForumTemplate").tmpl({
notice: "-選擇小論壇-",
forums: t
}))
}),
$("#search_rank input[type=submit]").click(function(t) {
$("#type").val($(this).attr("id"))
}),
$("#parent_month, #parent_total").click(function(t) {
var e = $("#select_parent_forum").val();
e ? $("#forum_id").val(e) : (t.preventDefault(),
alert("請選擇大論壇"))
}),
$("#child_month").click(function(t) {
var e = $("#select_child_forum").val();
e ? $("#forum_id").val(e) : (t.preventDefault(),
alert("請選擇小論壇"))
})
},
show_page: function() {
!function() {
var e = $(".annbody-scroll");
if (0 < e.length) {
var o = !0;
e.mouseover(function() {
o = !1
}),
e.mouseout(function() {
o = !0
}),
setInterval(function() {
if (o) {
var t = e.find("li:lt(3)");
e.append(t.clone()),
e.find("li").each(function(t, e) {
(t + 1) % 3 == 1 ? $(e).removeClass().addClass("left") : (t + 1) % 3 == 2 ? $(e).removeClass().addClass("center") : (t + 1) % 3 == 0 && $(e).removeClass().addClass("right")
}),
t.slideUp(function() {
$(this).remove()
})
}
}, 5e3)
}
}()
}
}