Coder Social home page Coder Social logo

beijixiaohu / ojbetter Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 8.0 56.51 MB

适用于在线评测系统(Online Judge)的Tampermonkey脚本,增强功能与界面。

Home Page: https://greasyfork.org/zh-CN/users/747162

License: GNU General Public License v3.0

JavaScript 92.26% HTML 6.32% Python 1.42%
codeforces tampermonkey-userscript

ojbetter's Issues

1.15.5 版本删除重装 1.15.2 后无法加载

如题。
本人在使用 ATBetter 1.15.5 测试版时出现了下拉框不显示、代码框无法输入代码问题,决定重新安装,到油叉重新装了一遍,回来就不能加载了。
望修复。

翻译的时候老是弹出,请问可以关掉么

弹窗内容如下

"是否继续翻译?
即将翻译的内容似乎为代码片段,翻译它可能是无意义的,你确定继续吗?"

请问可以默认自动翻译别一直弹出来么,翻译一段弹一段

[BUG] 翻译错误/更像是关键词配对异常问题

对于Atcoder Better:
image

此位置的Guest在比赛的时候会变为Contestant,应该是触发了 Atcoder Better 中 contest 的匹配条目,实际展示效果会是比赛ant

修改建议:加入 contestant 翻译项并翻译 / 如果这里是意外情况,请限制一下匹配条目的翻译匹配范围。

类似的行为还会出现在 codeforces 上,我记着曾经触发过比赛 A 题叫 XXX Problemset 被自动匹配成了问题集之类的,但是我找不到了,不知道修了没有。

添加一些新的翻译接口

Google翻译中除了现有的mock的手机版网页的方式外,再添加两个:

  • 添加一个无鉴权的API接口:translate.googleapis.com
  • 添加360 浏览器的代理接口:elephant.browser.360.cn

添加微软翻译

  • 添加微软翻译接口:api-edge.cognitive.microsofttranslator.com

AtCoder's Japanese homepage is not compatible with the dark mode

https://atcoder.jp/?lang=ja

After enabling the dark mode, I noticed that certain elements like #header, .m-box_inner, and .m-list-job_inner on the page have white backgrounds that are not properly adjusted. This affects the overall visual experience to some extent.

Btw, I think the .html2md-panel element (MarkDown 视图, Copy, 翻译) should not be displayed on the homepage. Is there a way to hide it?

翻译崩溃

23/12/15,在使用分段翻译时发现翻译崩溃,切换为普通模式后仍有问题
image
重新安装后问题解决

Like buttons

Problem

When add [likes:??] tags in a blog in Codeforces, and click "Markdown view", the following code will be shown.

$(function() { const likeFormUtil = {}; likeFormUtil.getCount = function ($count) { return Number($count.attr("data-value")); }; likeFormUtil.setCount = function ($count, value) { $count.attr("data-value", value); $count.text(value); }; likeFormUtil.like = function ($likeForm) { $likeForm.find(".likeState").addClass("liked"); const $likeCount = $likeForm.find(".likeCount"); likeFormUtil.setCount($likeCount, likeFormUtil.getCount($likeCount) + 1); }; likeFormUtil.unLike = function ($likeForm) { if ($likeForm.find(".likeState").hasClass("liked")) { $likeForm.find(".likeState").removeClass("liked"); const $likeCount = $likeForm.find(".likeCount"); likeFormUtil.setCount($likeCount, likeFormUtil.getCount($likeCount) - 1); } }; likeFormUtil.dislike = function ($likeForm) { $likeForm.find(".dislikeState").addClass("disliked"); const $dislikeCount = $likeForm.find(".dislikeCount"); likeFormUtil.setCount($dislikeCount, likeFormUtil.getCount($dislikeCount) + 1); }; likeFormUtil.unDislike = function ($likeForm) { if ($likeForm.find(".dislikeState").hasClass("disliked")) { $likeForm.find(".dislikeState").removeClass("disliked"); const $dislikeCount = $likeForm.find(".dislikeCount"); likeFormUtil.setCount($dislikeCount, likeFormUtil.getCount($dislikeCount) - 1); } }; likeFormUtil.disable = function ($likeForm) { $likeForm.find(".likeActionLink").off("click"); $likeForm.find(".likeActionLink").on("click", function () { return false; }); $likeForm.find(".dislikeActionLink").off("click"); $likeForm.find(".dislikeActionLink").on("click", function () { return false; }); }; likeFormUtil.enable = function ($likeForm) { $likeForm.find(".likeActionLink").off("click"); $likeForm.find(".likeActionLink").on("click", onLike); $likeForm.find(".dislikeActionLink").off("click"); $likeForm.find(".dislikeActionLink").on("click", onDislike); }; likeFormUtil.applyLikeableInformation = function(likeableInformation) { const id = likeableInformation.likeable.id; console.log(id); const $likeForm = $(".likeActionLink\[data-likeableId='" + id + "'\]").closest(".likeForm"); console.log($likeForm); likeFormUtil.setCount($likeForm.find(".likeCount"), likeableInformation.likeCount); likeFormUtil.setCount($likeForm.find(".dislikeCount"), likeableInformation.dislikeCount); if (likeableInformation.liked) { $likeForm.find(".likeState").addClass("liked"); } else { $likeForm.find(".likeState").removeClass("liked"); } if (likeableInformation.disliked) { $likeForm.find(".likeState").addClass("disliked"); } else { $likeForm.find(".likeState").removeClass("disliked"); } } likeFormUtil.applyLikeableInformations = function(likeableInformations) { likeableInformations.forEach((applyLikeableInformation) => { likeFormUtil.applyLikeableInformation(applyLikeableInformation); }); } function onLike() { const $likeActionLink = $(this); const likeableId = $likeActionLink.attr("data-likeableId"); const $likeForm = $likeActionLink.parent(); likeFormUtil.disable($likeForm); $.post("/data/like", { action: "like", likeableId: likeableId }, function (data) { if (data\["success"\] === true) { if (data\["liked"\]) { Codeforces.showMessage('Added to liked'); } else { Codeforces.showMessage('Removed from liked'); } likeFormUtil.applyLikeableInformations(data\["likeableInformations"\]); } else { Codeforces.showMessage(data\["message"\] || "Error"); } likeFormUtil.enable($likeForm); }, "json"); return false; } function onDislike() { const $dislikeActionLink = $(this); const likeableId = $dislikeActionLink.attr("data-likeableId"); const $likeForm = $dislikeActionLink.parent(); likeFormUtil.disable($likeForm); $.post("/data/like", { action: "dislike", likeableId: likeableId }, function (data) { if (data\["success"\] === true) { if (data\["disliked"\]) { Codeforces.showMessage('Added to disliked'); } else { Codeforces.showMessage('Removed from disliked'); } likeFormUtil.applyLikeableInformations(data\["likeableInformations"\]); } else { Codeforces.showMessage(data\["message"\] || "Error"); } likeFormUtil.enable($likeForm); }, "json"); return false; } $(".likeActionLink").click(onLike); $(".dislikeActionLink").click(onDislike); $(".likeCount").add(".dislikeCount").each(function () { const $count = $(this); likeFormUtil.setCount($count, likeFormUtil.getCount($count)); }); }); $(function () { });

(Sometimes the shorter one : $(function () { });)

Fix Suggestion

Do not show those useless codes, but show [likes:??] instead.

> 是之前一直能用,然后突然不能用了吗,还是之前没用过分段,第一次用

          > 是之前一直能用,然后突然不能用了吗,还是之前没用过分段,第一次用

最近没有更改插件配置,一直使用的是谷歌翻译+分段翻译;
今天在查看这个题单https://codeforces.com/contest/1910/problem/A 后,出现了google翻译报错,并且更改分段翻译为普通翻译无反应,更换翻译API无反应,考虑可能是缓存问题重装插件并清除浏览器数据后,使用DeepL+分段翻译无问题;

Originally posted by @shicxin in #11 (comment)
刚刚测试只要使用google翻译就会出现问题,与分段翻译无关,但是电脑具备外网环境,直接使用google翻译网站无问题,使用沉浸式翻译的google翻译服务无问题

Ubuntu firefox适配问题

平台:Ubuntu firefox

问题描述:
在Ubuntu的firefox插件里,首次加载弹出的更新提示弹窗关不掉,点击“我知道了”后没有反应。

补充:
在Mac系统的firefox没有这个问题。

UI优化建议

1.提交按钮位置
看题页面的提交模块,我很喜欢,很方便
就我和附近同学的习惯都是在idea中调试好代码+样例测试后,复制代码后提交。
页面中的提交按钮在代码块的下方,需要滚轮滑一下才可以找到,体验不够顺滑。
考虑一些用户可能会用这个代码块来检查一下代码,我希望在代码块顶部(“全屏 固定到底部 固定到右侧”附近)新增一个提交按钮

2.返回按钮位置不统一
“固定到底部 固定到右侧”中的“取消固定”按钮在右下角
“全屏”中的“退出全屏”按钮在右上角
希望可以统一成右下角。
(要是三个按钮都叫做“退出”的话,我个人会更喜欢)

3.返回按钮位置
右下角的按钮位置和边框有些冲突,不大好看,建议适当调高
image

一些扣细节的想法,见谅

Clist经常找不到题目

对于存在rating的题目,Clist通常无法正确显示,通常只会正确显示最近几场比赛的rating

插件文字显示错误

插件中除了汉化内容外所有信息几乎都显示异常。

比如显示了“Atcoder Better - loadSuccess”这样的异常显示,包括设置界面几乎所有文字都不显示。

打开源码在“i18next.t('...')”都提示“i18next未定义”。

1

为什么我用脚本编译器提交后他会跳转到cf的提交页面,点提交始终没用

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.