Skip to content

Commit 9c0513c

Browse files
authored
Merge pull request #107 from shuzijun/gradle
1.Modify leetcode.com login method. 2.Fix the problem that the shortcut keys cannot be used. 3.Fix the problem that the title name does not show Chinese. 4.Automatically save when adding commits. 5.Increase result stdout information. 6.Add custom title color. 7.Optimize the title description.
2 parents 922bc89 + 823dabf commit 9c0513c

File tree

117 files changed

+1260
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1260
-378
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323
hs_err_pid*
2424
/*.iml
2525
.idea/
26+
/build/
27+
/out/

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
- **`Password`**: Login password
3737
- **`Temp File Path`**: Temporary file storage catalogue
3838
- **`proxy(HTTP Proxy)`**: HTTP Proxy,config path:`File` -> `settings`->`Appearance & Behavior`->`System Settings`->`HTTP Proxy`
39-
- **`Custom code template`**: Custom code template ([details](https://github.com/shuzijun/leetcode-editor/blob/master/CustomCode.md))([demo](https://github.com/shuzijun/leetcode-question))
39+
- **`Custom code template`**: Custom code template ([details](https://github.com/shuzijun/leetcode-editor/blob/master/doc/CustomCode.md))([demo](https://github.com/shuzijun/leetcode-question))
40+
- **`LevelColour`**: Customize the difficulty color of the question, it will take effect after restart
4041

4142
### Window (Icon in the lower right corner of the main window![icon](https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/LeetCodeIcon.png))
4243

README_ZH.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
- **`Password`**: 登录密码
3737
- **`Temp File Path`**: 临时文件存放目录
3838
- **`proxy(HTTP Proxy)`**: 使用http代理,配置路径:`File` -> `settings`->`Appearance & Behavior`->`System Settings`->`HTTP Proxy`
39-
- **`Custom code template`**: 自定义代码生成模板 ([详细介绍](https://github.com/shuzijun/leetcode-editor/blob/master/CustomCode_ZH.md))([示例](https://github.com/shuzijun/leetcode-question))
39+
- **`Custom code template`**: 自定义代码生成模板 ([详细介绍](https://github.com/shuzijun/leetcode-editor/blob/master/doc/CustomCode_ZH.md))([示例](https://github.com/shuzijun/leetcode-question))
40+
- **`LevelColour`**: 自定义题目难度颜色,重启后生效
4041

4142
### 窗口(主窗口右下角![icon](https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/LeetCodeIcon.png))
4243

build.gradle

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
plugins {
2+
id 'java'
3+
id 'org.jetbrains.intellij' version '0.4.14'
4+
id "de.undercouch.download" version "4.0.2"
5+
}
6+
7+
group 'com.shuzijun.leetcode'
8+
version "6.0" + (project.build_env.isEmpty() ? "" : "-") + project.build_env
9+
10+
sourceCompatibility = 1.8
11+
targetCompatibility = 1.8
12+
13+
repositories {
14+
mavenCentral()
15+
}
16+
17+
dependencies {
18+
compile 'com.alibaba:fastjson:1.2.47'
19+
compile 'org.jsoup:jsoup:1.11.3'
20+
compile('io.sentry:sentry:1.7.9') {
21+
exclude module: 'slf4j-api'
22+
}
23+
compile fileTree(dir: 'src/main/resources/lib', include: ['*.jar'])
24+
25+
}
26+
27+
// See https://github.com/JetBrains/gradle-intellij-plugin/
28+
intellij {
29+
pluginName 'leetcode-editor'
30+
version 'IU-193.5233.102'
31+
type 'IU'
32+
downloadSources false
33+
buildSearchableOptions.enabled(false)
34+
/* updateSinceUntilBuild false
35+
localPath project.idea_local_path
36+
alternativeIdePath project.idea_local_path*/
37+
38+
prepareSandbox {
39+
from("src/main/natives" + (project.build_env.isEmpty() ? "" : "-") + project.build_env) { into(getPluginName() + '/natives') }
40+
}
41+
42+
}
43+
44+
tasks.withType(JavaCompile) {
45+
options.encoding = "UTF-8"
46+
}
47+
48+
49+
50+
51+
52+
/*
53+
task downloadJCEF(type: Copy) {
54+
if (project.build_env.isEmpty()) {
55+
return
56+
}
57+
def tempFile = new File(buildDir, "/download/natives-" + project.build_env + ".zip")
58+
download {
59+
src("https://github.com/shuzijun/leetcode-editor/releases/download/" + project.jcef_version + "/natives-" + project.build_env + ".zip")
60+
dest tempFile
61+
}
62+
63+
from zipTree(tempFile)
64+
into "src/main/"
65+
}
66+
*/
67+
68+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# custom code generation
22
The custom code generation template can be configured to generate the code format freely, the IDE can debug the code locally.[demo](https://github.com/shuzijun/leetcode-question)
33
- [English Document]()
4-
- [中文文档](https://github.com/shuzijun/leetcode-editor/blob/master/CustomCode_ZH.md)
4+
- [中文文档](https://github.com/shuzijun/leetcode-editor/blob/master/doc/CustomCode_ZH.md)
55
<p align="center">
66
<img src="https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/customConfig-100.gif" alt="demo"/>
77
</p>

CustomCode_ZH.md renamed to doc/CustomCode_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 自定义代码生成介绍
22
通过配置自定义代码生成模板可以自由生成代码格式,配合IDE可在本地调试代码。[示例工程](https://github.com/shuzijun/leetcode-question)
3-
- [English Document](https://github.com/shuzijun/leetcode-editor/blob/master/CustomCode.md)
3+
- [English Document](https://github.com/shuzijun/leetcode-editor/blob/master/doc/CustomCode.md)
44
- [中文文档](#配置)
55
<p align="center">
66
<img src="https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/customConfig-100.gif" alt="demo"/>

doc/LoginHelp.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#login config
2+
- [English Document](#login config)
3+
- [中文文档](https://github.com/shuzijun/leetcode-editor/blob/master/LoginHelp_ZH.md)
4+
Login method: Configure username and password login, cookie login, browser login
5+
##Username password login
6+
Configure the username and password on the configuration page of the leetcode plugin. If the login fails, the following two login methods will be loaded. This method only supports leetcode-cn.
7+
##cookie login
8+
First log in to leetcode in your browser, open the browser console, copy the cookie to the login popup, and click login.
9+
<p align="center">
10+
<img src="https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/browserCookie.png" alt="browserCookie"/>
11+
</p>
12+
<p align="center">
13+
<img src="https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/cookieLogin.png" alt="cookieLogin"/>
14+
</p>
15+
16+
##browser login
17+
This login requires additional download of dependent files. Download the compressed package with the version number ** jcef ** at the [releases](https://github.com/shuzijun/leetcode-editor/releases) address. After downloading, decompress it to the path of JCEFFilePath shown on the configuration page.
18+
If there is a resource file in the path, this login method will be used first, but this method is not compatible. If it cannot be loaded normally, you need to delete the contents of the folder and log in using other methods.

doc/LoginHelp_ZH.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#登录配置
2+
- [English Document](https://github.com/shuzijun/leetcode-editor/blob/master/LoginHelp.md)
3+
- [中文文档](#登录配置)
4+
登录方式:配置用户名密码登录,cookie登录,浏览器登录
5+
##用户名密码登录
6+
在leetcode插件配置页配置用户名密码,如登录失败将加载下面两种登录方式,此方式仅支持leetcode-cn.com
7+
##cookie登录
8+
首先在浏览器中登录leetcode,打开浏览器控制台,复制cookie到登录弹出框,点击login
9+
<p align="center">
10+
<img src="https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/browserCookie.png" alt="browserCookie"/>
11+
</p>
12+
<p align="center">
13+
<img src="https://raw.githubusercontent.com/shuzijun/leetcode-editor/master/doc/cookieLogin.png" alt="cookieLogin"/>
14+
</p>
15+
##浏览器登录
16+
此登录需要额外下载依赖文件,在地址[releases](https://github.com/shuzijun/leetcode-editor/releases)下载版号带有**jcef**的压缩包,
17+
下载后,解压到配置页展示的JCEFFilePath的路径中。
18+
如路径中存在资源文件,将首先使用此登录方式,但此方式兼容性差,如不能正常加载,需删除文件夹下内容,使用其他方式登录。

doc/browserCookie.png

116 KB
Loading

doc/cookieLogin.png

68.4 KB
Loading

0 commit comments

Comments
 (0)