您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Native Bitrix24 CODE tag is broken and doesnt have hightlighting at all, so it is very hard to share sources in tasks. This script is fixing this issue.
// ==UserScript== // @name Bitrix24 Better <code> // @namespace https://crm.globaldrive.ru/ // @version 2024-02-22-2 // @description Native Bitrix24 CODE tag is broken and doesnt have hightlighting at all, so it is very hard to share sources in tasks. This script is fixing this issue. // @author Dzorogh // @match https://crm.globaldrive.ru/* // @grant GM_addStyle // ==/UserScript== (function() { const addScript = (src) => { const e = document.createElement('script'); e.src = src; document.head.appendChild(e); return e; } const addStyle = (src) => { const e = document.createElement('link'); e.rel = "stylesheet"; e.href = src; document.head.appendChild(e); return e; } const css = ` .forum-code { border-radius: 0; } .forum-code td { padding: 0; } `; const languages = [ 'html', '1c', 'apache', 'bash', 'css', 'diff', 'ini', 'java', 'javascript', 'json', 'less', 'markdown', 'nginx', 'php', 'scss', 'sql', 'typescript', 'xml', 'yaml', ]; (function Init() { const selectors = document.querySelectorAll('.forum-code pre'); for (let selector of selectors) { // wrap code in real <code> tag to make work highlightAll selector.innerHTML = `<code>${selector.innerHTML}</code>`; } const mainStyle = addStyle('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css'); const mainScript = addScript('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js'); mainScript.onload = () => { languages.forEach((language) => { addScript(`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/${language}.min.js`); }) hljs.highlightAll(); GM_addStyle(css); } })() })();