diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3a7719d..3fd65da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
# Leetcode Editor Changelog
+[![English Document][badge:en-doc]][gh:en-doc]
+[![中文文档][badge:zh-doc]][gh:zh-doc]
+[![捐赠][badge:donate]][shuzijun-donate]
+[![捐赠][badge:donate-zh]][shuzijun-donate]
+[![内推][badge:referrals]][shuzijun-referrals]
## 8.2.0
@@ -34,4 +39,17 @@
### Deprecated
-### Removed
\ No newline at end of file
+### Removed
+
+[badge:en-doc]: https://img.shields.io/badge/Docs-English%20Document-blue?logo=docs&style=flat-square
+[badge:zh-doc]: https://img.shields.io/badge/Docs-中文文档-blue?logo=docs&style=flat-square
+[badge:donate]: https://img.shields.io/badge/Docs-donate-ff69c4?logo=docs&style=flat-square
+[badge:donate-zh]: https://img.shields.io/badge/Docs-捐赠-ff69c4?logo=docs&style=flat-square
+[badge:referrals]: https://img.shields.io/badge/Docs-内推-ff69c4?logo=docs&style=flat-square
+
+
+[gh:en-doc]: https://github.com/shuzijun/leetcode-editor/blob/master/README.md
+[gh:zh-doc]: https://github.com/shuzijun/leetcode-editor/blob/master/README_ZH.md
+
+[shuzijun-donate]: https://shuzijun.cn/donate.html
+[shuzijun-referrals]: https://shuzijun.cn/referrals.html
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 80e160d..f5ee6fd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -50,6 +50,7 @@ intellij {
patchPluginXml {
sinceBuild = project.pluginSinceBuild
untilBuild = project.pluginUntilBuild
+ pluginDescription = new File(project.pluginDescription).getText('UTF-8')
changeNotes.set(provider { changelog.get(project.version+".0").toHTML() })
}
diff --git a/doc/description.html b/doc/description.html
new file mode 100644
index 0000000..42c034d
--- /dev/null
+++ b/doc/description.html
@@ -0,0 +1,128 @@
+
+
Support for leetcode.com and leetcode.cn, can test and submit questions.
+ More tutorial please visit: here
+
+
+
+
Introduction
+
+
+ - Support for leetcode.com and leetcode.cn, can test and submit questions
+ - More tutorial please visit: here
+
+
+ - 支持leetcode.com和leetcode.cn,可测试与提交问题
+ - 更多的插件使用教程: 插件使用介绍
+
+
+
+Getting Started
+
+
+Local debugging
+
+
+Configuration (configuration for first installation)
+
+
+
+ - Configuration path:
File
->
+ settings
->tools
->leetcode plugin
+
+ URL options
: leetcode.com
ORleetcode.cn
+ Code Type
: Java
,Python
,C++
,Python3
,C
,C#
,JavaScript
,Ruby
,Swift
,Go
+ ,Scala
,Kotlin
,Rust
,PHP
,Bash
,SQL
+
+ LoginName
: Login Username
+ Password
: Login password
+ Temp File Path
: Temporary file storage catalogue
+ proxy(HTTP Proxy)
: HTTP Proxy,config path:File
-> settings
->Appearance
+ & Behavior
->System Settings
->HTTP Proxy
+ Custom code template
: Custom code template (details) (demo)
+
+ LevelColour
: Customize the difficulty color of the question, it will take
+ effect after restart
+
+
+
+
+Window
+
+
+
+ - Toolbar:
+
+ Sign in
:The login accounts of the two websites are not
+ interoperable and the corresponding users need to be configured when switching websites.
+
+ Sign out
:Exit the current account, if you encounter a
+ login error, try to exit first.
+
+ Refresh
:You can also refresh and load questions if you
+ are not logged in, but you cannot submit it.
+
+ pick
:Open a problem randomly.
+
+ - <
Find
:Open filter panel. You can search, filter and sort.
+
+ Session
:Open the Session panel. You can view or switch
+ sessions.
+
+ Toggle List
:Switch to other list windows, including "All
+ Problem List" , "Paginated Problem List" , "CodeTop Problem List".
+
+ Settings
:Quick jump to the configuration page.
+
+ Clear
:Clean up the files in the configured cache
+ directories. The cache directories of the two websites are different and only the current configured
+ websites are cleaned up. Carefully clean up cases without submitting.
+
+
+
+
+Menu
+
+
+
+
+ - Menu (right-click on the questions):
+
+ open question
:Open the question or double click on the question
+ open content
:Show content(Rely on Markdown)
+ Submit
:Submit the question
+ Submissions
:View the submission record, select the record details in the
+ pop-up window(Show detail
)
+
+ Run Code
:Run the code, the test case for the question is used by default
+
+ Testcase
:Customize test cases
+ favorite
:Add or remove favorite
+ Clear cache
:Clean up the current question
+ Timer
:Timer, when it is turned on, it will prompt the problem solving time
+ in the status bar in the lower right corner
+
+
+
+
+
+
+ - Editor Menu(Right-click on Editor to appear):
Function as above
+
+
+
+ - Question Editor:
+
+ Content
:Show content(Rely on Markdown)
+ Solution
:show solution
+ Submissions
:View the submission record
+ Note
:Show note
+
+
+
diff --git a/gradle.properties b/gradle.properties
index ff86e6f..b6934d5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,6 +4,7 @@ pluginVersion = 8.2
pluginSinceBuild = 202.0
pluginUntilBuild =
+pluginDescription = doc/description.html
platformType = IU
platformVersion = 2022.1
diff --git a/src/main/java/com/shuzijun/leetcode/plugin/listener/RegisterPluginInstallerStateListener.java b/src/main/java/com/shuzijun/leetcode/plugin/listener/RegisterPluginInstallerStateListener.java
index d401c4d..2836c4b 100644
--- a/src/main/java/com/shuzijun/leetcode/plugin/listener/RegisterPluginInstallerStateListener.java
+++ b/src/main/java/com/shuzijun/leetcode/plugin/listener/RegisterPluginInstallerStateListener.java
@@ -1,15 +1,51 @@
package com.shuzijun.leetcode.plugin.listener;
+import com.intellij.ide.plugins.PluginManagerCore;
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.openapi.extensions.PluginId;
+import com.intellij.openapi.fileEditor.impl.HTMLEditorProvider;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupActivity;
+import com.shuzijun.leetcode.plugin.model.Config;
+import com.shuzijun.leetcode.plugin.model.PluginConstant;
+import com.shuzijun.leetcode.plugin.setting.PersistentConfig;
import org.jetbrains.annotations.NotNull;
/**
* @author shuzijun
*/
public class RegisterPluginInstallerStateListener implements StartupActivity {
+
+ private final static String ShowNewHTMLEditorKey = PluginConstant.PLUGIN_ID + "ShowNewHTMLEditor";
+
+ private final static String CHANGELOGURL = "https://github.com/shuzijun/leetcode-editor/blob/master/CHANGELOG.md";
+
@Override
public void runActivity(@NotNull Project project) {
+ String newVersion = PluginManagerCore.getPlugin(PluginId.getId(PluginConstant.PLUGIN_ID)).getVersion();
+ Config config = PersistentConfig.getInstance().getInitConfig();
+ String oldVersion;
+ if (config == null) {
+ oldVersion = PropertiesComponent.getInstance().getValue(ShowNewHTMLEditorKey);
+ PropertiesComponent.getInstance().setValue(ShowNewHTMLEditorKey, newVersion);
+ } else {
+ oldVersion = config.getPluginVersion();
+ config.setPluginVersion(newVersion);
+ }
+
+ if (!newVersion.equals(oldVersion)) {
+ HTMLEditorProvider.openEditor(project,
+ "What's New in " + PluginConstant.PLUGIN_ID,
+ CHANGELOGURL,
+ "'" +
+ "
Failed to load!
" +
+ "'
" +
+ "
"
+ );
+ }
+
+
/* PluginInstaller.addStateListener(new PluginStateListener() {
@Override
public void install(@NotNull IdeaPluginDescriptor ideaPluginDescriptor) {
diff --git a/src/main/java/com/shuzijun/leetcode/plugin/model/Config.java b/src/main/java/com/shuzijun/leetcode/plugin/model/Config.java
index 3d18254..3ad044d 100644
--- a/src/main/java/com/shuzijun/leetcode/plugin/model/Config.java
+++ b/src/main/java/com/shuzijun/leetcode/plugin/model/Config.java
@@ -17,6 +17,8 @@ public class Config implements Cloneable {
private Integer version;
+ private String pluginVersion;
+
private String id;
/**
@@ -419,6 +421,14 @@ public void setShowQuestionEditorSign(boolean showQuestionEditorSign) {
this.showQuestionEditorSign = showQuestionEditorSign;
}
+ public String getPluginVersion() {
+ return pluginVersion;
+ }
+
+ public void setPluginVersion(String pluginVersion) {
+ this.pluginVersion = pluginVersion;
+ }
+
public boolean isModified(Config config) {
if (config == null) {
diff --git a/src/main/java/com/shuzijun/leetcode/plugin/window/NavigatorTabsPanel.java b/src/main/java/com/shuzijun/leetcode/plugin/window/NavigatorTabsPanel.java
index bf29c68..07d2317 100644
--- a/src/main/java/com/shuzijun/leetcode/plugin/window/NavigatorTabsPanel.java
+++ b/src/main/java/com/shuzijun/leetcode/plugin/window/NavigatorTabsPanel.java
@@ -224,17 +224,17 @@ public void dispose() {
public static synchronized void loadUser(boolean login) {
User user = null;
if (login) {
- for (int i = 0; i < 10; i++) {
+ for (int i = 0; i <= 50; i++) {
user = QuestionManager.getUser();
if (!user.isSignedIn()) {
try {
- Thread.sleep(500);
+ Thread.sleep(500 + (i / 10 * 100));
} catch (InterruptedException ignore) {
}
} else {
break;
}
- if(i == 9){
+ if(i == 50){
LogUtils.LOG.warn("User data is not synchronized");
}
}
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 054bc32..118ffd2 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -4,116 +4,7 @@
8.1
shuzijun
-
- Support for leetcode.com and leetcode.cn, can test and submit questions.
- More tutorial please visit: here
-
-
-
Introduction
-
-
- - Support for leetcode.com and leetcode.cn, can test and submit questions
- - More tutorial please visit: here
-
-
- - 支持leetcode.com和leetcode.cn,可测试与提交问题
- - 更多的插件使用教程: 插件使用介绍
-
-
-
-
How to use
-
-
-
-
-
-
-
-
Local debugging
-
-
-
-
-
-
-
-
Configuration (configuration for first installation)
-
-
-
-
-
-
Configuration path: File -> settings->tools->leetcode plugin
-
-
- - URL options: leetcode.com and leetcode.cn
- - Code Type: Java, Python, C++, Python3, C, C#, JavaScript, Ruby, Swift, Go, Scala, Kotlin, Rust, PHP
- - Login Name: Login Username
- - Password: Login password
- - Temp File Path: Temporary file storage catalogue
- - proxy(HTTP Proxy): HTTP Proxy,config path:`File` -> `settings`->`Appearance & Behavior`->`System Settings`->`HTTP Proxy`
- - 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))
-
-
-
-
-
-
-
Window (Icon in the lower right corner of the main window)
-
-
-
-
-
-
Toolbar:
-
- - Login: The login accounts of the two websites are not interoperable and the corresponding users need to be
- configured when switching websites.
- - Logout: Exit the current account, if you encounter a login error, try to exit first
- - Refresh: You can also refresh and load questions if you are not logged in, but you cannot submit it.
- - Find: Input the content and press Enter to search , press again to search for the next one. It can only
- search under the question bank node.
- - Collapse: Collapse all nodes.
- - Configuration: Quick jump to the configuration page
- - Clear: Clean up the files in the configured cache directories. The cache directories of the two websites
- are different and only the current configured websites are cleaned up. Carefully clean up cases without
- submitting.
-
-
-
Tree:
-
- - Questions: All questions
- - Difficulty: Classification of difficulties
- - Tags: Classification of types
- - Explore: Explore content, only contains titles of the questions, exclusive content that needs to pay ; some
- questions are loaded in order
- - Color: The color represents the difficulty of the question
- - Symbol: The symbols of “√” and “?” represent the status of the current questions, and explores with the
- beginning of “$” needs to pay or that cannot be viewed due to other causes.
-
-
-
-
-
-
Menu:
-
-
-
-
-
-
Menu (right-click on the questions)
-
- - Open question: Open the question or double click on the question
- - Submit: Submit the question
- - Submissions: View the submission record, select the record details in the pop-up window (Show detail)
- - Run Code: Run the code, the test case for the question is used by default
- - Test case: Customize test cases
- - favorite:Add or remove favorite
- - Clear cache: Clean up the current questionL
-
-
- ]]>
+
@@ -131,7 +22,7 @@
-
+