您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
愉快的和朋友在论坛斗图吧!
当前为
// ==UserScript== // @name MCBBS Emoticon Add // @namespace http://fang.blog.miri.site // @version Beta 2.2 // @description 愉快的和朋友在论坛斗图吧! // @author Mr_Fang // @match https://*.mcbbs.net/* // @grant none // ==/UserScript== (function() { //如果快捷键冲突可以在最下面修改 var storage = window.localStorage; jq("head").append('<style id="ConfWindowStyle">.conf_contain {max-height:45vh;overflow-y:auto;padding-right:5px;} .alert_info ::-webkit-scrollbar {background: #f7f7f7;height: 7px;width:7px}.alert_info ::-webkit-scrollbar-thumb:hover{background:#0000005c;}.alert_info ::-webkit-scrollbar-thumb{background:#0000002c;}.conf_item{line-height: 1.2;margin-bottom:5px;} .conf_title{font-weight: 1000;} .conf_subtitle{font-size: 10px;color: #0000007a;padding-right:40px;display:block;} .conf_check{float: right;margin-top: -25px;} .conf_input{float: right;width:30px;margin-top:-27px;}.conf_longinput{ width: 100%;margin-top: 5px;}</style>'); //阿方太菜了,不知道为什么这个菜单与MCBBS Extender不兼容 var usermenu = document.getElementsByClassName("user_info_menu_btn")[0]; usermenu.innerHTML = usermenu.innerHTML + '<li><a id="mbea_setting">Emoticon Add 设置</a></li>'; document.getElementById('mbea_setting').addEventListener('click',function(){ showDialog('<style>.alert_right {background-image: none;padding-right: 0px;padding-left: 0px;}</style><div class=""><b>按规定格式添加即可</b> - 点击确定保存<hr><textarea id="input_setting" style="width: 340px;" rows="20">' + storage.getItem('mbea_setting') + '</textarea>保存后刷新即可生效</div>', 'right', '<div style="line-height:30px;"><img src="https://s2.ax1x.com/2020/02/25/3twNzq.png" width="20px"> 设置 - MCBBS Emoticon Add</div>', function() { storage["mbea_setting"] = document.getElementById("input_setting").value; } ); }) var list = ""; var setting = ""; setting = "[" + storage.getItem('mbea_setting') + "]"; //阿方很菜的,不会批量替换,预计下个版本直接批量替换 console.log(setting); console.log(setting.split('\n').length); for(var l=0;l<setting.split('\n').length;l++){ setting = setting.replace('; setting = setting.replace(')\n',"'],\n"); //console.log(setting); } setting = setting.replace(')',"']"); var arrayList = eval("(" + setting + ")"); console.log(arrayList); for(var i=0;i<arrayList.length;i++){ list = list + '<img src="' + arrayList[i][1] + '" height="42px"> <font color="gray" size="2">' + arrayList[i][0] + '</font> <button style="float: right;" class="pn pnc" onclick="setCopy(\'[img]' + arrayList[i][1] + '[/img]\');hideMenu(\'fwin_dialog\', \'dialog\')"><strong>复制</strong></button><br>'; }; document.onkeydown = function(e) { var keyCode = e.keyCode; var shiftKey = e.shiftKey; var ctrlKey = e.ctrlKey; if(ctrlKey && shiftKey && keyCode == 69) { showDialog('<style>.alert_right {background-image: none;padding-right: 5px;padding-left: 5px;}</style><b>点击复制按钮即可复制BBCode</b> - 点击确定退出<hr><div class="" style="max-height: 350px;overflow-y: auto;">' + list + '</div>', 'right', '<div style="line-height:30px;"><img src="https://s2.ax1x.com/2020/02/25/3twNzq.png" width="20px"> 插入表情 - MCBBS Emoticon Add</div>' ); } }; })();