您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Easier to compare between corrections, especially for Japanese.
当前为
// ==UserScript== // @name Neil Fraser Diff Demo - Enhanced Output View // @namespace NFDiff_KK // @description Easier to compare between corrections, especially for Japanese. // @include https://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html // @version 1.1 // @grant none // ==/UserScript== document.getElementsByTagName('input')[5].addEventListener('click', function() { //Get output var outputdiv = document.getElementById('outputdiv'); var output = outputdiv.getElementsByTagName('*'); //Sort output var original = ''; var correction = ''; for (var i = 0; i < output.length; i++){ if (output[i].tagName == "SPAN"){ original += output[i].outerHTML; correction += output[i].outerHTML; } else if (output[i].tagName == "DEL"){ original += output[i].outerHTML; } else if (output[i].tagName == "INS"){ correction += output[i].outerHTML; } } //Replace highlight with text color (for better copying into word docs, etc) original = original.replace(/style="background:#ffe6e6;"/igm, 'style="color:red;"'); correction = correction.replace(/style="background:#e6ffe6;"/igm, 'style="color:green;"'); //Rewrite output outputdiv.innerHTML = '<table border="1" cellspacing="5" cellpadding="5" style="width:100%; border-collapse: collapse;"><tr><td width="50%">' + original + '</td><td width="50%">' + correction + '</td></tr></table>'; }, false);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址