// ==UserScript== // @name 绯月表情增强插件 // @namespace https://greasyfork.org/users/5415 // @version 5.2.1 // @author eddie32 // @description KF论坛专用的回复表情, 插图扩展插件, 在发帖时快速输入自定义表情和论坛BBCODE // @icon http://wx1.sinaimg.cn/small/62800f43ly8fttwqsdhc2j20e80e8t9b.jpg // @homepage https://github.com/liu599/KF-Emotion-UserScript // @include https://*miaola.info/* // @include https://*ikfol.com/* // @include https://*2dkf.com/* // @include https://*9moe.com/* // @include https://*kfgal.com/* // @include https://*kforz.com/* // @match *://*/* // @include * // @copyright 2014-2023, eddie32 // @grant none // @license MIT // @run-at document-end // @downloadURL https://update.greasyfork.icu/scripts/5124/%E7%BB%AF%E6%9C%88%E8%A1%A8%E6%83%85%E5%A2%9E%E5%BC%BA%E6%8F%92%E4%BB%B6.user.js // @updateURL https://update.greasyfork.icu/scripts/5124/%E7%BB%AF%E6%9C%88%E8%A1%A8%E6%83%85%E5%A2%9E%E5%BC%BA%E6%8F%92%E4%BB%B6.meta.js // ==/UserScript== !function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { i: moduleId, l: !1, exports: {} }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.l = !0, module.exports; } __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.d = function(exports, name, getter) { __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, { enumerable: !0, get: getter }); }, __webpack_require__.r = function(exports) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(exports, "__esModule", { value: !0 }); }, __webpack_require__.t = function(value, mode) { if (1 & mode && (value = __webpack_require__(value)), 8 & mode) return value; if (4 & mode && "object" == typeof value && value && value.__esModule) return value; var ns = Object.create(null); if (__webpack_require__.r(ns), Object.defineProperty(ns, "default", { enumerable: !0, value: value }), 2 & mode && "string" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); return ns; }, __webpack_require__.n = function(module) { var getter = module && module.__esModule ? function() { return module.default; } : function() { return module; }; return __webpack_require__.d(getter, "a", getter), getter; }, __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 1); }([ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.readEmotions = exports.addEmotions = exports.loadEmotions = exports.join = void 0, exports.join = function(obj) { var output = ""; return Object.keys(obj).forEach(function(keyname) { output += obj[keyname] + " "; }), output; }; function typeAssert(ext) { return -1 !== [ "png", "jpg", "jpeg", "bmp", "gif", "webp", "psd", "svg", "tiff" ].indexOf(ext.toLowerCase()); } exports.loadEmotions = function(options) { for (var rest = [], _i = 1; _i < arguments.length; _i++) rest[_i - 1] = arguments[_i]; for (var ret = [], i = options.startPos; i < options.arrLength; i += 1) { var picNumber = "" + i; options.leadingZero && (picNumber = 9 < i ? picNumber : "0" + picNumber), ret.push("" + options.strPrefix + picNumber + options.strSuffix); } return rest.forEach(function(r) { for (var restRet = [], i = r.startPos; i < r.arrLength; i += 1) { var picNumber = "" + i; r.leadingZero && (picNumber = 9 < i ? picNumber : "0" + picNumber), restRet.push("" + options.strPrefix + picNumber + options.strSuffix); } ret.concat(restRet); }), ret; }, exports.addEmotions = function(imageUrls) { imageUrls.forEach(function(url, index) { var ts = new Date().getTime(), ind = url.lastIndexOf("."); typeAssert(url.substr(ind + 1)) && window.localStorage.setItem("eddie32_" + ts + "_" + index, url); }); }, exports.readEmotions = function(prefix) { for (var ret = [], i = 0; i < window.localStorage.length; i += 1) { var con, key = window.localStorage.key(i); key.includes(prefix) && ((con = document.createElement("img")).src = window.localStorage[key], con.dataset.link = "", con.className = "Ems", ret.push(con)); } return ret; }; }, function(module, targetTextarea, reserveData) { "use strict"; Object.defineProperty(targetTextarea, "__esModule", { value: !0 }); var Emotion = reserveData(2), app = reserveData(0), targetTextarea = document.getElementsByTagName("textarea").item(0), reserveData = [ { groupEmotions: [ { itemAddress: app.loadEmotions({ startPos: 1, arrLength: 49, strPrefix: (void 0 !== window.imgpath ? window.imgpath : "") + "/post/smile/em/em", strSuffix: ".gif", leadingZero: !0 }), itemDescription: app.loadEmotions({ startPos: 10, arrLength: 58, strPrefix: "[s:", strSuffix: "]", leadingZero: !1 }) } ], groupTitle: "KF", groupType: Emotion.GroupType.ImageLink }, { groupEmotions: [ { itemAddress: [ "[sell=100][/sell]", "[quote][/quote]", "[hide=100][/hide]", "[code][/code]", "[strike][/strike]", "[fly][/fly]", "[color=#00FF00][/color]", "[b][/b]", "[u][/u]", "[i][/i]", "[hr]", "[backcolor=][/backcolor]", "[img][/img]" ], itemDescription: [ "出售贴sell=售价", "引用", "隐藏hide=神秘等级", "插入代码", "删除线", "跑马灯", "文字颜色", "粗体", "下划线", "斜体", "水平线", "背景色", "插入图片" ] }, { itemAddress: [ "(●・ 8 ・●)", "╰(๑◕ ▽ ◕๑)╯", "(ゝω・)", "〜♪♪", "(゚Д゚≡゚Д゚)", "(^o^)ノ", "(|||゚Д゚)", "(`ε´ )", "(╬゚д゚)", "(|||゚д゚)", "( ̄∇ ̄)", "( ̄3 ̄)", "( ̄ー ̄)", "( ̄ .  ̄)", "( ̄︿ ̄)", "( ̄︶ ̄)", "(*´ω`*)", "(・ω・)", "(⌒▽⌒)", "( ̄▽ ̄)", "(=・ω・=)", "(`・ω・´)", "(〜 ̄△ ̄)〜", "(・∀・)", "(°∀°)ノ", "( ̄3 ̄)", "╮( ̄▽ ̄)╭", "( ´_ゝ`)", "のヮの", "(ノ< ๑)诶嘿☆~", "(<_<)", "(>_>)", "(;¬_¬)", "(▔□▔)/", "(゚Д゚≡゚д゚)!?", "Σ(゚д゚;)", "Σ(  ̄□ ̄||)", "(´;ω;`)", "(/TДT)/", "(^・ω・^ )", "(。・ω・。)", "(● ̄(エ) ̄●)", "ε=ε=(ノ≧∇≦)ノ", "(´・_・`)", "(-_-#)", "( ̄へ ̄)", "( ̄ε(# ̄) Σ", "ヽ(`Д´)ノ", "(╯°口°)╯(┴—┴", "(#-_-)┯━┯", "_(:3」∠)_", "(笑)", "(汗)", "(泣)", "(苦笑)", "(´・ω・`)", "(╯°□°)╯︵ ┻━┻", "(╯‵□′)╯︵┻━┻", "( ´ρ`)", "( ゚ω゚)", "(o゚ω゚o)", "( ^ω^)", "(。◕∀◕。)", "/( ◕‿‿◕ )\\", "ε٩( º∀º )۶з", "( ̄ε(# ̄)☆╰╮( ̄▽ ̄///)", "(●´3`)~♪", "_(:з」∠)_", "хорошо!", "\(^o^)/", "(•̅灬•̅ )", "(゚Д゚)", "まったく、小学生は最高だぜ!!", "ε=ε=ε=┏(゜ロ゜;)┛", "(;°ほ°)", "⎝≧⏝⏝≦⎠", "ヽ(✿゚▽゚)ノ", "焔に舞い上がるスパークよ、邪悪な異性交際に、天罰を与え!", "|•ω•`)" ], itemDescription: [] } ], groupTitle: "颜文字", groupType: Emotion.GroupType.Plain }, { groupEmotions: [ { itemAddress: app.loadEmotions({ startPos: 1, arrLength: 47, strPrefix: "https://ecs32.top/emotions/selected/1-20190811/sticker (", strSuffix: ").png", leadingZero: !1 }), itemDescription: [] } ], groupTitle: "流行", groupType: Emotion.GroupType.ImageLink }, { groupEmotions: [ { itemAddress: app.loadEmotions({ startPos: 1, arrLength: 82, strPrefix: "https://ecs32.top/emotions/selected/2-20190811/sticker (", strSuffix: ").png", leadingZero: !1 }), itemDescription: [] } ], groupTitle: "伪中国语", groupType: Emotion.GroupType.ImageLink }, { groupEmotions: [], groupTitle: "自定义", groupType: Emotion.GroupType.User } ], app = { mainView: '#eddie320000 {font: 12px/28px "Hiragino Sans GB","Microsoft YaHei","Arial","sans-serif"; margin-bottom: 5px; }', stageView: "#eddie32stage {height: 100px; padding: 3px 3px; overflow-x: auto; margin-top:4px;margin-bottom:4px; border:1px solid #ff4351; position:relative; z-index:200; display: none; } #eddie32stage span { cursor: pointer }", menuView: '#eddie32menu {display:inline-block;cursor:pointer; text-align:center; padding: 0; font: 12px/30px "Hiragino Sans GB","Microsoft YaHei","Arial","sans-serif";background-color: #ff4351;border-color: #ff4351;color: #fff; } #eddie32menu ul { list-style-type: none; margin: 0; padding: 0; } #eddie32menu ul li { display: inline-block; text-align: middle } #eddie32menu ul li a { display: block; color: #f2f2f2; min-width: 55px; } #eddie32menu ul li a:hover, #eddie32menu ul li a.active {background-color: #ff7680;border-color: #ff7680; color: #f2f2f2;}', txtBtn: "a.txtBtnEmotion { display: inline-block; text-decoration: none; cursor: pointer; padding: 0 8px; font: 12px/24px 'Hiragino Sans GB','Microsoft YaHei','Arial','sans-serif';} a.txtBtnEmotion:hover { background: #ff7680; color: #fff; }", imageLink: ".Ems { cursor: pointer; width: 50px; height: 50px; display: inline-block; z-index: 400; }", popUp: "#eddie32ppp {position: fixed; bottom: 10px; right: 10px; z-index: 999; width: 400px; display: block; height: 300px; background: #f3f3f3; border: 1px solid #000; display: none}" }, app = new Emotion.EmotionPlugin("eddie32", reserveData, app, targetTextarea); targetTextarea.parentNode.insertBefore(app.appInstance, targetTextarea); }, function(module, exports, EmotionPlugin) { "use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.EmotionPlugin = exports.CssStyles = exports.EmotionMenu = exports.EmotionMenuItem = exports.GroupType = void 0; var GroupType, utils = EmotionPlugin(0); !function(GroupType) { GroupType[GroupType.ImageLink = 0] = "ImageLink", GroupType[GroupType.Plain = 1] = "Plain", GroupType[GroupType.Image = 2] = "Image", GroupType[GroupType.User = 3] = "User"; }(GroupType = exports.GroupType || (exports.GroupType = {})); EmotionPlugin = function() {}; exports.EmotionMenuItem = EmotionPlugin; EmotionPlugin = function() {}; exports.EmotionMenu = EmotionPlugin; EmotionPlugin = function() {}; exports.CssStyles = EmotionPlugin; EmotionPlugin = function() { function EmotionPlugin(name, data, css, targetTextarea) { this.targetInstance = targetTextarea, this.divPrefix = name, this.appInstance = document.createElement("div"), this.Popup = document.createElement("div"), this.Popup.id = this.divPrefix + "ppp", this.Popup.innerHTML = '