// ==UserScript==
// @name IT之家-反恰客脚本
// @namespace http://tampermonkey.net/
// @version 0.84
// @description try to take over the world!
// @author You
// @match https://quan.ithome.com/*
// @grant none
// @downloadURL https://update.greasyfork.icu/scripts/389239/IT%E4%B9%8B%E5%AE%B6-%E5%8F%8D%E6%81%B0%E5%AE%A2%E8%84%9A%E6%9C%AC.user.js
// @updateURL https://update.greasyfork.icu/scripts/389239/IT%E4%B9%8B%E5%AE%B6-%E5%8F%8D%E6%81%B0%E5%AE%A2%E8%84%9A%E6%9C%AC.meta.js
// ==/UserScript==
(function () {
'use strict';
if ($(".postcontent").length > 0 && $(".postcontent").html().indexOf("class=\"appmore\"") > 0) {
$(".postcontent").html("
稍等一下,正在异步获取帖子数据。。。
");
var _id = location.href.substring(location.href.indexOf("/0/") + 3, location.href.indexOf("/0/") + 6) + location.href.substring(location.href.indexOf("/0/") + 7, location.href.indexOf("/0/") + 10);
$.ajax({
url: "https://fxxkcar.com/getithomepost.php?id=" + _id,
dataType: 'jsonp',
jsonp: "CallBack",
success: function (data) {
var _content = data.content;
_content = replaceimg(_content, data.imgs);
$(".postcontent").html(_content);
var _repost = "";
$("#content").after($(_repost));
var login = '';
login += ' ';
login += '
';
login += '
';
login += '
';
login += ' ';
login += ' ';
$("#ReplyList").append($(login));
window.editor = UE.getEditor('myEditor');
editor.placeholder("政治、色情、喷骂、引战、机型喷、水军、广告等违法违规行为将被封号。");
haodadaimages();
$(".comm_title").delegate(".order",
"click",
function (e) {
e.preventDefault();
if ($(".order").html() == "倒序显示") {
$("#ulcommentlist").hide();
$("#ulcommentlistorder").fadeIn("slow");
$(".order").html("正序显示");
if ($("#ulcommentlistorder").html() == "") {
var new_item = $("").load("/quan/GetAjaxData.aspx",
{ "postid": $("#postid").val(), "type": "replypage", "page": 1, "order": "order" },
function () {
}).hide();
$("#ulcommentlistorder").append(new_item);
new_item.fadeIn("slow");
}
} else {
$("#ulcommentlist").fadeIn("slow");
$("#ulcommentlistorder").hide();
$(".order").html("倒序显示");
if ($("#ulcommentlist").html() == "") {
var new_item = $("").load("/quan/GetAjaxData.aspx",
{ "postid": $("#postid").val(), "type": "replypage", "page": 1 },
function () {
}).hide();
$("#ulcommentlist").append(new_item);
new_item.fadeIn("slow");
}
}
})
$(".comm_list").delegate(".reply_btn",
"click",
function () {
oremarkbtn = $(this);
modelreplyComment();
addReply();
$(".bbsmodal textarea").keydown(function (e) {
if ((e.which === 13 || e.which === 10) && e.ctrlKey) {
$(".answer_inpt").click()
}
})
});
$("#btnReply").click(function () { reply() });
$("#btnModifyReply").click(function () { modifyReply() })
$(".comm_title .order").click();
}
})
}
$(function () {
haodadaimages();
});
function haodadaimages() {
//添加按钮
var _filebtn = '';
if($("#divanswer>.user_info").length>0)$("#divanswer>.user_info").after(_filebtn);
else if($(".pb_title").length>0)$(".pb_title").after(_filebtn);
else if($("#postbox .edit_form").length>0)$("#postbox .edit_form").before(_filebtn);
$(".sub_nav").append('IT之家自动签到系统')
var editor=typeof(editor)=="undefined"?UE.getEditor('myEditor'):editor;
$("#haodada_file").change(function () {
window.haodadafiles = $("#haodada_file")[0].files;
window.haodadaimagesindex= 0;
uploadimg();
});
}
function uploadimg(){
$("#haodada_lab").text("正在上传");
var formData = new FormData();
formData.append("smfile", haodadafiles[haodadaimagesindex]);
var _tempimg;
$.ajax({
url: 'https://www.fxxkcar.com/upload.php',
type: 'POST',
success: function (data) {
console.log(data);
editor.focus();
editor.execCommand("inserthtml","+"?ithome.com)
");
haodadaimagesindex++;
if(haodadaimagesindex/g);
if (_rexArray == null) { return content; }
for (var _i = 0; _i < _rexArray.length; _i++) {
content = content.replace(_rexArray[_i], "
");
}
return content;
}
})();