// ==UserScript== // @name 反恰客脚本 // @namespace http://tampermonkey.net/ // @version 0.3 // @description try to take over the world! // @author You // @match https://quan.ithome.com/0/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; if ($(".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://ithome.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 += ' '; login += ' 回复'; login += '
'; login += '
'; login += ' '; login += ' '; $("#ReplyList").append($(login)); var editor; editor = UE.getEditor('myEditor'); editor.placeholder("政治、色情、喷骂、引战、机型喷、水军、广告等违法违规行为将被封号。"); $(".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("倒序显示"); } }) $(".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() }) } }) } function replaceimg(content, imgsArr) { var _rexArray = content.match(/(/g); for (var _i = 0; _i < _rexArray.length; _i++) { content = content.replace(_rexArray[_i], "
"); } return content; } })();