Skip to content

Commit 2299645

Browse files
committed
doc
1 parent a050e81 commit 2299645

File tree

8 files changed

+200
-115
lines changed

8 files changed

+200
-115
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
22

33
# Leetcode Editor Changelog
4+
[![English Document][badge:en-doc]][gh:en-doc]
5+
[![中文文档][badge:zh-doc]][gh:zh-doc]
6+
[![捐赠][badge:donate]][shuzijun-donate]
7+
[![捐赠][badge:donate-zh]][shuzijun-donate]
8+
[![内推][badge:referrals]][shuzijun-referrals]
49

510
## 8.2.0
611

@@ -34,4 +39,17 @@
3439

3540
### Deprecated
3641

37-
### Removed
42+
### Removed
43+
44+
[badge:en-doc]: https://img.shields.io/badge/Docs-English%20Document-blue?logo=docs&style=flat-square
45+
[badge:zh-doc]: https://img.shields.io/badge/Docs-中文文档-blue?logo=docs&style=flat-square
46+
[badge:donate]: https://img.shields.io/badge/Docs-donate-ff69c4?logo=docs&style=flat-square
47+
[badge:donate-zh]: https://img.shields.io/badge/Docs-捐赠-ff69c4?logo=docs&style=flat-square
48+
[badge:referrals]: https://img.shields.io/badge/Docs-内推-ff69c4?logo=docs&style=flat-square
49+
50+
51+
[gh:en-doc]: https://github.com/shuzijun/leetcode-editor/blob/master/README.md
52+
[gh:zh-doc]: https://github.com/shuzijun/leetcode-editor/blob/master/README_ZH.md
53+
54+
[shuzijun-donate]: https://shuzijun.cn/donate.html
55+
[shuzijun-referrals]: https://shuzijun.cn/referrals.html

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ intellij {
5050
patchPluginXml {
5151
sinceBuild = project.pluginSinceBuild
5252
untilBuild = project.pluginUntilBuild
53+
pluginDescription = new File(project.pluginDescription).getText('UTF-8')
5354
changeNotes.set(provider { changelog.get(project.version+".0").toHTML() })
5455
}
5556

doc/description.html

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<div>
2+
<p>Support for leetcode.com and leetcode.cn, can test and submit questions.
3+
More tutorial please visit: <a href="https://github.com/shuzijun/leetcode-editor">here</a></p>
4+
</div>
5+
<br>
6+
<div>
7+
<h2>Introduction</h2>
8+
<br>
9+
<ul>
10+
<li>Support for leetcode.com and leetcode.cn, can test and submit questions</li>
11+
<li>More tutorial please visit: <a href="https://github.com/shuzijun/leetcode-editor">here</a></li>
12+
</ul>
13+
<ul>
14+
<li>支持leetcode.com和leetcode.cn,可测试与提交问题</li>
15+
<li>更多的插件使用教程: <a href="https://github.com/shuzijun/leetcode-editor">插件使用介绍</a></li>
16+
</ul>
17+
</div>
18+
<br>
19+
<h2 >Getting Started</h2>
20+
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/leetcode-editor-3.0.gif"
21+
alt="start" style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>
22+
23+
<h2 >Local debugging</h2>
24+
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/customConfig-100.gif"
25+
alt="loacl" style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>
26+
27+
<h3 >Configuration (configuration for first installation)</h3>
28+
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/config-3.0.jpg" alt="config"
29+
style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>
30+
31+
<ul>
32+
<li><strong>Configuration path</strong>: <code>File</code> -&gt;
33+
<code>settings</code>-&gt;<code>tools</code>-&gt;<code>leetcode plugin</code>
34+
<ul>
35+
<li><strong><code>URL options</code></strong>: <code>leetcode.com</code>OR<code>leetcode.cn</code></li>
36+
<li><strong><code>Code Type</code></strong>: <code>Java</code>,<code>Python</code>,<code>C++</code>,<code>Python3</code>,<code>C</code>,<code>C#</code>,<code>JavaScript</code>,<code>Ruby</code>,<code>Swift</code>,<code>Go</code>
37+
,<code>Scala</code>,<code>Kotlin</code>,<code>Rust</code>,<code>PHP</code>,<code>Bash</code>,<code>SQL</code>
38+
</li>
39+
<li><strong><code>LoginName</code></strong>: Login Username</li>
40+
<li><strong><code>Password</code></strong>: Login password</li>
41+
<li><strong><code>Temp File Path</code></strong>: Temporary file storage catalogue</li>
42+
<li><strong><code>proxy(HTTP Proxy)</code></strong>: HTTP Proxy,config path:<code>File</code> -&gt; <code>settings</code>-&gt;<code>Appearance
43+
&amp; Behavior</code>-&gt;<code>System Settings</code>-&gt;<code>HTTP Proxy</code></li>
44+
<li><strong><code>Custom code template</code></strong>: Custom code template (<a
45+
href="https://github.com/shuzijun/leetcode-editor/blob/master/doc/CustomCode.md">details</a>) (<a
46+
href="https://github.com/shuzijun/leetcode-question">demo</a>)
47+
</li>
48+
<li><strong><code>LevelColour</code></strong>: Customize the difficulty color of the question, it will take
49+
effect after restart
50+
</li>
51+
</ul>
52+
</li>
53+
</ul>
54+
<h3 >Window</h3>
55+
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/window-3.0.jpg" alt="window"
56+
style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>
57+
58+
<ul>
59+
<li><strong>Toolbar</strong>:
60+
<ul>
61+
<li><strong><code>Sign in</code></strong>:The login accounts of the two websites are not
62+
interoperable and the corresponding users need to be configured when switching websites.
63+
</li>
64+
<li><strong><code>Sign out</code></strong>:Exit the current account, if you encounter a
65+
login error, try to exit first.
66+
</li>
67+
<li><strong><code>Refresh</code></strong>:You can also refresh and load questions if you
68+
are not logged in, but you cannot submit it.
69+
</li>
70+
<li><strong><code>pick</code></strong>:Open a problem randomly.
71+
</li>
72+
<li><<strong><code>Find</code></strong>:Open filter panel. You can search, filter and sort.
73+
</li>
74+
<li><strong><code>Session</code></strong>:Open the Session panel. You can view or switch
75+
sessions.
76+
</li>
77+
<li><strong><code>Toggle List</code></strong>:Switch to other list windows, including "All
78+
Problem List" , "Paginated Problem List" , "CodeTop Problem List".
79+
</li>
80+
<li><strong><code>Settings</code></strong>:Quick jump to the configuration page.
81+
</li>
82+
<li><strong><code>Clear</code></strong>:Clean up the files in the configured cache
83+
directories. The cache directories of the two websites are different and only the current configured
84+
websites are cleaned up. Carefully clean up cases without submitting.
85+
</li>
86+
</ul>
87+
</li>
88+
</ul>
89+
<h3 >Menu</h3>
90+
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/menu-3.0.jpg" alt="menu"
91+
style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>
92+
93+
94+
<ul>
95+
<li><strong>Menu (right-click on the questions)</strong>:
96+
<ul>
97+
<li><strong><code>open question</code></strong>:Open the question or double click on the question</li>
98+
<li><strong><code>open content</code></strong>:Show content(Rely on Markdown)</li>
99+
<li><strong><code>Submit</code></strong>:Submit the question</li>
100+
<li><strong><code>Submissions</code></strong>:View the submission record, select the record details in the
101+
pop-up window(<code>Show detail</code>)
102+
</li>
103+
<li><strong><code>Run Code</code></strong>:Run the code, the test case for the question is used by default
104+
</li>
105+
<li><strong><code>Testcase</code></strong>:Customize test cases</li>
106+
<li><strong><code>favorite</code></strong>:Add or remove favorite</li>
107+
<li><strong><code>Clear cache</code></strong>:Clean up the current question</li>
108+
<li><strong><code>Timer</code></strong>:Timer, when it is turned on, it will prompt the problem solving time
109+
in the status bar in the lower right corner
110+
</li>
111+
</ul>
112+
</li>
113+
</ul>
114+
<p><br></p>
115+
<ul>
116+
<li><strong>Editor Menu(Right-click on Editor to appear)</strong>:<br>Function as above</li>
117+
</ul>
118+
<p><br></p>
119+
<ul>
120+
<li><strong>Question Editor</strong>:
121+
<ul>
122+
<li><strong><code>Content</code></strong>:Show content(Rely on Markdown)</li>
123+
<li><strong><code>Solution</code></strong>:show solution</li>
124+
<li><strong><code>Submissions</code></strong>:View the submission record</li>
125+
<li><strong><code>Note</code></strong>:Show note</li>
126+
</ul>
127+
</li>
128+
</ul>

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pluginVersion = 8.2
44

55
pluginSinceBuild = 202.0
66
pluginUntilBuild =
7+
pluginDescription = doc/description.html
78

89
platformType = IU
910
platformVersion = 2022.1

src/main/java/com/shuzijun/leetcode/plugin/listener/RegisterPluginInstallerStateListener.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,51 @@
11
package com.shuzijun.leetcode.plugin.listener;
22

3+
import com.intellij.ide.plugins.PluginManagerCore;
4+
import com.intellij.ide.util.PropertiesComponent;
5+
import com.intellij.openapi.extensions.PluginId;
6+
import com.intellij.openapi.fileEditor.impl.HTMLEditorProvider;
37
import com.intellij.openapi.project.Project;
48
import com.intellij.openapi.startup.StartupActivity;
9+
import com.shuzijun.leetcode.plugin.model.Config;
10+
import com.shuzijun.leetcode.plugin.model.PluginConstant;
11+
import com.shuzijun.leetcode.plugin.setting.PersistentConfig;
512
import org.jetbrains.annotations.NotNull;
613

714
/**
815
* @author shuzijun
916
*/
1017
public class RegisterPluginInstallerStateListener implements StartupActivity {
18+
19+
private final static String ShowNewHTMLEditorKey = PluginConstant.PLUGIN_ID + "ShowNewHTMLEditor";
20+
21+
private final static String CHANGELOGURL = "https://github.com/shuzijun/leetcode-editor/blob/master/CHANGELOG.md";
22+
1123
@Override
1224
public void runActivity(@NotNull Project project) {
25+
String newVersion = PluginManagerCore.getPlugin(PluginId.getId(PluginConstant.PLUGIN_ID)).getVersion();
26+
Config config = PersistentConfig.getInstance().getInitConfig();
27+
String oldVersion;
28+
if (config == null) {
29+
oldVersion = PropertiesComponent.getInstance().getValue(ShowNewHTMLEditorKey);
30+
PropertiesComponent.getInstance().setValue(ShowNewHTMLEditorKey, newVersion);
31+
} else {
32+
oldVersion = config.getPluginVersion();
33+
config.setPluginVersion(newVersion);
34+
}
35+
36+
if (!newVersion.equals(oldVersion)) {
37+
HTMLEditorProvider.openEditor(project,
38+
"What's New in " + PluginConstant.PLUGIN_ID,
39+
CHANGELOGURL,
40+
"'<div style='text-align: center;padding-top: 3rem'>" +
41+
"<div style='padding-top: 1rem; margin-bottom: 0.8rem;'>Failed to load!</div>" +
42+
"'<div><a href='" + CHANGELOGURL + "' target='_blank'" +
43+
"style='font-size: 2rem'>Open in browser</a></div>" +
44+
"</div>"
45+
);
46+
}
47+
48+
1349
/* PluginInstaller.addStateListener(new PluginStateListener() {
1450
@Override
1551
public void install(@NotNull IdeaPluginDescriptor ideaPluginDescriptor) {

src/main/java/com/shuzijun/leetcode/plugin/model/Config.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public class Config implements Cloneable {
1717

1818
private Integer version;
1919

20+
private String pluginVersion;
21+
2022
private String id;
2123

2224
/**
@@ -419,6 +421,14 @@ public void setShowQuestionEditorSign(boolean showQuestionEditorSign) {
419421
this.showQuestionEditorSign = showQuestionEditorSign;
420422
}
421423

424+
public String getPluginVersion() {
425+
return pluginVersion;
426+
}
427+
428+
public void setPluginVersion(String pluginVersion) {
429+
this.pluginVersion = pluginVersion;
430+
}
431+
422432
public boolean isModified(Config config) {
423433

424434
if (config == null) {

src/main/java/com/shuzijun/leetcode/plugin/window/NavigatorTabsPanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,17 @@ public void dispose() {
224224
public static synchronized void loadUser(boolean login) {
225225
User user = null;
226226
if (login) {
227-
for (int i = 0; i < 10; i++) {
227+
for (int i = 0; i <= 50; i++) {
228228
user = QuestionManager.getUser();
229229
if (!user.isSignedIn()) {
230230
try {
231-
Thread.sleep(500);
231+
Thread.sleep(500 + (i / 10 * 100));
232232
} catch (InterruptedException ignore) {
233233
}
234234
} else {
235235
break;
236236
}
237-
if(i == 9){
237+
if(i == 50){
238238
LogUtils.LOG.warn("User data is not synchronized");
239239
}
240240
}

0 commit comments

Comments
 (0)