-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,18 @@ | |
* Created by alvince on 17-6-28. | ||
* | ||
* @author [email protected] | ||
* @version 1.0.1, 7/20/2017 | ||
* @version 1.0.1, 7/21/2017 | ||
* @since 1.0 | ||
*/ | ||
public interface Constants { | ||
String LINK_TINY_PNG_DEVELOPER = "https://tinypng.com/developers"; | ||
String APP_NAME = "Tinify Picture"; // Plugin name | ||
|
||
String DISPLAY_GROUP_PROMPT = "Tinify Picture Prompt"; | ||
|
||
String HTML_DESCRIPTION_IGNORE = "#ignore"; | ||
String HTML_DESCRIPTION_SETTINGS = "#settings"; | ||
String HTML_LINK_IGNORE = "<a href='" + HTML_DESCRIPTION_IGNORE + "'>不再提示</a>"; | ||
String HTML_LINK_SETTINGS = "<a href='" + HTML_DESCRIPTION_SETTINGS + "'>设置</a>"; | ||
|
||
String LINK_TINY_PNG_DEVELOPER = "https://tinypng.com/developers"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ import javax.swing.event.HyperlinkEvent | |
* Created by alvince on 17-7-20. | ||
* | ||
* @author [email protected] | ||
* @version 1.0.1, 7/20/2017 | ||
* @version 1.0.1, 7/21/2017 | ||
* @since 1.0.1 | ||
*/ | ||
class TinifyComponent(project: Project) : AbstractProjectComponent(project) { | ||
|
@@ -36,11 +36,10 @@ class TinifyComponent(project: Project) : AbstractProjectComponent(project) { | |
override fun projectOpened() { | ||
if (StringUtils.isEmpty(preferences.apiKey) | ||
&& !PropertiesComponent.getInstance().getBoolean(PROP_PROMPT_SETTINGS_IGNORE, false)) { | ||
val notificationContent = ("当前 Api Key 为空,请设置 Api Key" + | ||
"<br/>%s %s").format(Constants.HTML_LINK_SETTINGS, Constants.HTML_LINK_IGNORE) | ||
val notification = Notification( | ||
"TinyPic2 Settings", "TinyPic 2", | ||
notificationContent, NotificationType.WARNING, | ||
val notificationContent = "当前 Api Key 为空,请设置 Api Key<br/>%s %s" | ||
.format(Constants.HTML_LINK_SETTINGS, Constants.HTML_LINK_IGNORE) | ||
val notification = Notification(Constants.DISPLAY_GROUP_PROMPT, | ||
Constants.APP_NAME, notificationContent, NotificationType.WARNING, | ||
object : NotificationListener.Adapter() { | ||
override fun hyperlinkActivated(notification: Notification, event: HyperlinkEvent) { | ||
notification.expire() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
<idea-plugin> | ||
<id>com.alvincezy.TinyPic2</id> | ||
<name>TinyPic 2</name> | ||
<name>Tinify Picture</name> | ||
<version>1.0.1</version> | ||
<vendor email="[email protected]" url="https://github.com/alvince/TinyPic2">alvince</vendor> | ||
|
||
<description><![CDATA[ | ||
Compress images with TinyPng api.<br/> | ||
See <a href="https://tinypng.com">https://tinypng.com</a> | ||
<h1>Tinify Picture</h1> | ||
<br/> | ||
<b> | ||
<a href="https://github.com/alvince/TinyPic2">Home Page</a> | | ||
<a href="https://github.com/alvince/TinyPic2">GitHub</a> | | ||
<a href="https://github.com/alvince/TinyPic2/issues">Issues</a> | ||
</b> | ||
<!--<a href="https://plugins.jetbrains.com/idea/plugin/8579">Plugin Page</a> |--> | ||
<br/> | ||
<br/> | ||
Compress images with TinyPng api. | ||
<br/> | ||
<br/> | ||
👁️️ Website <a href="https://tinypng.com">https://tinypng.com</a> | ||
<br/> | ||
<br/> | ||
<i>Compiled with Java 1.8 and Kotlin 1.1</i> | ||
]]></description> | ||
|
||
<change-notes><![CDATA[ | ||
|