Skip to content

Commit 6937860

Browse files
committed
add a new feature of browsing certain question on the website of leetcode
1 parent ff845eb commit 6937860

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

resources/META-INF/plugin.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>leetcode-editor</id>
33
<name>leetcode editor</name>
4-
<version>4.4</version>
4+
<version>4.3</version>
55
<vendor email="shuzijun0109@gmail.com" url="https://github.com/shuzijun/idea-leetcode-plugin">shuzijun</vendor>
66

77
<description><![CDATA[
@@ -102,20 +102,15 @@
102102

103103
<change-notes><![CDATA[
104104
<ul>
105-
<li>v4.4<br>
106-
1.增加跳转到题目对应的leetcode官网地址的功能<br>
107-
</li>
108-
<li>v4.4<br>
109-
1.add a new feature of browsing certain question on the website of leetcode<br>
110-
</li>
111-
112105
<li>v4.3<br>
113106
1.修复付费用户订阅题目展示<br>
114107
2.修复leetcode-cn.com登陆问题<br>
108+
3.增加跳转到题目对应的leetcode官网地址的功能<br>
115109
</li>
116110
<li>v4.3<br>
117111
1.Fix subscription view<br>
118112
2.fix leetcode-cn.com login<br>
113+
3.add a new feature of browsing certain question on the website of leetcode<br>
119114
</li>
120115
121116
<li>v4.2<br>
@@ -282,8 +277,8 @@
282277
text="open question" description="open question" icon="AllIcons.Actions.Annotate">
283278
</action>
284279

285-
<action id="leetcode.OpenInLeetCodeAction" class="com.shuzijun.leetcode.plugin.actions.OpenInLeetCodeAction"
286-
text="open in leetcode" description="open in leetcode" icon="AllIcons.Actions.Annotate">
280+
<action id="leetcode.OpenInWebAction" class="com.shuzijun.leetcode.plugin.actions.OpenInWebAction"
281+
text="open in web" description="open in web" icon="AllIcons.Actions.MoveTo2">
287282
</action>
288283

289284
<action id="leetcode.SubmitAction" class="com.shuzijun.leetcode.plugin.actions.SubmitAction"
@@ -323,7 +318,7 @@
323318

324319
<group id="leetcode.NavigatorActionsMenu">
325320
<reference id="leetcode.OpenAction"/>
326-
<reference id="leetcode.OpenInLeetCodeAction"/>
321+
<reference id="leetcode.OpenInWebAction"/>
327322
<separator/>
328323
<reference id="leetcode.SubmitAction"/>
329324
<reference id="leetcode.SubmissionsAction"/>

src/com/shuzijun/leetcode/plugin/actions/OpenInLeetCodeAction.java renamed to src/com/shuzijun/leetcode/plugin/actions/OpenInWebAction.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
package com.shuzijun.leetcode.plugin.actions;
22

3-
import com.alibaba.fastjson.JSON;
43
import com.intellij.ide.BrowserUtil;
54
import com.intellij.openapi.actionSystem.AnActionEvent;
6-
import com.intellij.openapi.application.ApplicationManager;
7-
import com.intellij.openapi.project.Project;
8-
import com.shuzijun.leetcode.plugin.manager.CodeManager;
95
import com.shuzijun.leetcode.plugin.model.Config;
106
import com.shuzijun.leetcode.plugin.model.Question;
117
import com.shuzijun.leetcode.plugin.utils.DataKeys;
12-
import com.shuzijun.leetcode.plugin.utils.MessageUtils;
13-
import com.shuzijun.leetcode.plugin.utils.PropertiesUtils;
148
import com.shuzijun.leetcode.plugin.utils.URLUtils;
159

1610
import javax.swing.*;
1711
import javax.swing.tree.DefaultMutableTreeNode;
1812

19-
public class OpenInLeetCodeAction extends AbstractAction {
13+
/**
14+
* @author zzdcon
15+
*/
16+
public class OpenInWebAction extends AbstractAction {
2017
@Override public void actionPerformed(AnActionEvent anActionEvent, Config config) {
2118
JTree tree = anActionEvent.getData(DataKeys.LEETCODE_PROJECTS_TREE);
2219
DefaultMutableTreeNode note = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
2320
Question question = (Question) note.getUserObject();
24-
BrowserUtil.browse(URLUtils.getLeetcodeUrl()+"/problems/"+question.getTitleSlug());
21+
BrowserUtil.browse(URLUtils.getLeetcodeProblems()+question.getTitleSlug());
2522
}
2623
}

0 commit comments

Comments
 (0)