Skip to content

doc #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2022
Merged

doc #533

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# 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

Expand Down Expand Up @@ -34,4 +39,17 @@

### Deprecated

### Removed
### 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
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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() })
}

Expand Down
128 changes: 128 additions & 0 deletions doc/description.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<div>
<p>Support for leetcode.com and leetcode.cn, can test and submit questions.
More tutorial please visit: <a href="https://github.com/shuzijun/leetcode-editor">here</a></p>
</div>
<br>
<div>
<h2>Introduction</h2>
<br>
<ul>
<li>Support for leetcode.com and leetcode.cn, can test and submit questions</li>
<li>More tutorial please visit: <a href="https://github.com/shuzijun/leetcode-editor">here</a></li>
</ul>
<ul>
<li>支持leetcode.com和leetcode.cn,可测试与提交问题</li>
<li>更多的插件使用教程: <a href="https://github.com/shuzijun/leetcode-editor">插件使用介绍</a></li>
</ul>
</div>
<br>
<h2 >Getting Started</h2>
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/leetcode-editor-3.0.gif"
alt="start" style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>

<h2 >Local debugging</h2>
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/customConfig-100.gif"
alt="loacl" style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>

<h3 >Configuration (configuration for first installation)</h3>
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/config-3.0.jpg" alt="config"
style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>

<ul>
<li><strong>Configuration path</strong>: <code>File</code> -&gt;
<code>settings</code>-&gt;<code>tools</code>-&gt;<code>leetcode plugin</code>
<ul>
<li><strong><code>URL options</code></strong>: <code>leetcode.com</code>OR<code>leetcode.cn</code></li>
<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>
,<code>Scala</code>,<code>Kotlin</code>,<code>Rust</code>,<code>PHP</code>,<code>Bash</code>,<code>SQL</code>
</li>
<li><strong><code>LoginName</code></strong>: Login Username</li>
<li><strong><code>Password</code></strong>: Login password</li>
<li><strong><code>Temp File Path</code></strong>: Temporary file storage catalogue</li>
<li><strong><code>proxy(HTTP Proxy)</code></strong>: HTTP Proxy,config path:<code>File</code> -&gt; <code>settings</code>-&gt;<code>Appearance
&amp; Behavior</code>-&gt;<code>System Settings</code>-&gt;<code>HTTP Proxy</code></li>
<li><strong><code>Custom code template</code></strong>: Custom code template (<a
href="https://github.com/shuzijun/leetcode-editor/blob/master/doc/CustomCode.md">details</a>) (<a
href="https://github.com/shuzijun/leetcode-question">demo</a>)
</li>
<li><strong><code>LevelColour</code></strong>: Customize the difficulty color of the question, it will take
effect after restart
</li>
</ul>
</li>
</ul>
<h3 >Window</h3>
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/window-3.0.jpg" alt="window"
style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>

<ul>
<li><strong>Toolbar</strong>:
<ul>
<li><strong><code>Sign in</code></strong>:The login accounts of the two websites are not
interoperable and the corresponding users need to be configured when switching websites.
</li>
<li><strong><code>Sign out</code></strong>:Exit the current account, if you encounter a
login error, try to exit first.
</li>
<li><strong><code>Refresh</code></strong>:You can also refresh and load questions if you
are not logged in, but you cannot submit it.
</li>
<li><strong><code>pick</code></strong>:Open a problem randomly.
</li>
<li><<strong><code>Find</code></strong>:Open filter panel. You can search, filter and sort.
</li>
<li><strong><code>Session</code></strong>:Open the Session panel. You can view or switch
sessions.
</li>
<li><strong><code>Toggle List</code></strong>:Switch to other list windows, including "All
Problem List" , "Paginated Problem List" , "CodeTop Problem List".
</li>
<li><strong><code>Settings</code></strong>:Quick jump to the configuration page.
</li>
<li><strong><code>Clear</code></strong>: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.
</li>
</ul>
</li>
</ul>
<h3 >Menu</h3>
<p align="center"><img src="https://s1.imagehub.cc/images/2022/07/17/menu-3.0.jpg" alt="menu"
style="width: auto;height: auto;max-width: 90%; max-height: 90%;"></p>


<ul>
<li><strong>Menu (right-click on the questions)</strong>:
<ul>
<li><strong><code>open question</code></strong>:Open the question or double click on the question</li>
<li><strong><code>open content</code></strong>:Show content(Rely on Markdown)</li>
<li><strong><code>Submit</code></strong>:Submit the question</li>
<li><strong><code>Submissions</code></strong>:View the submission record, select the record details in the
pop-up window(<code>Show detail</code>)
</li>
<li><strong><code>Run Code</code></strong>:Run the code, the test case for the question is used by default
</li>
<li><strong><code>Testcase</code></strong>:Customize test cases</li>
<li><strong><code>favorite</code></strong>:Add or remove favorite</li>
<li><strong><code>Clear cache</code></strong>:Clean up the current question</li>
<li><strong><code>Timer</code></strong>:Timer, when it is turned on, it will prompt the problem solving time
in the status bar in the lower right corner
</li>
</ul>
</li>
</ul>
<p><br></p>
<ul>
<li><strong>Editor Menu(Right-click on Editor to appear)</strong>:<br>Function as above</li>
</ul>
<p><br></p>
<ul>
<li><strong>Question Editor</strong>:
<ul>
<li><strong><code>Content</code></strong>:Show content(Rely on Markdown)</li>
<li><strong><code>Solution</code></strong>:show solution</li>
<li><strong><code>Submissions</code></strong>:View the submission record</li>
<li><strong><code>Note</code></strong>:Show note</li>
</ul>
</li>
</ul>
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pluginVersion = 8.2

pluginSinceBuild = 202.0
pluginUntilBuild =
pluginDescription = doc/description.html

platformType = IU
platformVersion = 2022.1
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
"'<div style='text-align: center;padding-top: 3rem'>" +
"<div style='padding-top: 1rem; margin-bottom: 0.8rem;'>Failed to load!</div>" +
"'<div><a href='" + CHANGELOGURL + "' target='_blank'" +
"style='font-size: 2rem'>Open in browser</a></div>" +
"</div>"
);
}


/* PluginInstaller.addStateListener(new PluginStateListener() {
@Override
public void install(@NotNull IdeaPluginDescriptor ideaPluginDescriptor) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/shuzijun/leetcode/plugin/model/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class Config implements Cloneable {

private Integer version;

private String pluginVersion;

private String id;

/**
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down
Loading