You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.9 KiB
68 lines
1.9 KiB
package com.fr.plugin.xx.theme.sky; |
|
|
|
import com.fr.decision.config.AppearanceConfig; |
|
import com.fr.intelli.record.Focus; |
|
import com.fr.intelli.record.Original; |
|
import com.fr.plugin.PluginLicense; |
|
import com.fr.plugin.PluginLicenseManager; |
|
import com.fr.plugin.context.PluginContexts; |
|
import com.fr.plugin.transform.FunctionRecorder; |
|
import com.fr.plugin.xx.theme.sky.config.SkyThemeConfig; |
|
import com.fr.record.analyzer.EnableMetrics; |
|
import com.fr.web.struct.Component; |
|
import com.fr.web.struct.Filter; |
|
import com.fr.web.struct.category.ParserType; |
|
import com.fr.web.struct.category.ScriptPath; |
|
import com.fr.web.struct.category.StylePath; |
|
|
|
/** |
|
* @author k |
|
* @Project name starter |
|
* @description: |
|
* @created on 2019/10/24 22:13. |
|
* @email xx.xx@qq.com |
|
* @Modified By |
|
*/ |
|
@EnableMetrics |
|
@FunctionRecorder |
|
public class SkyComponent extends Component { |
|
public static final SkyComponent KEY = new SkyComponent(); |
|
|
|
private SkyComponent() { |
|
|
|
} |
|
|
|
|
|
@Focus(id = Constants.PLUGIN_ID, text = "Visit Sky Theme", source = Original.PLUGIN) |
|
@Override |
|
public ScriptPath script() { |
|
if (!PluginContexts.currentContext().isAvailable()) { |
|
return ScriptPath.build(""); |
|
} |
|
// if (isBefore()) { |
|
// return ScriptPath.build("/com/fr/plugin/xx/theme/sky/resource/oldtheme.js"); |
|
// } |
|
return ScriptPath.build("/com/fr/plugin/xx/theme/sky/resource/theme.js", ParserType.PLAIN); |
|
} |
|
|
|
@Override |
|
public StylePath style() { |
|
if (!PluginContexts.currentContext().isAvailable()) { |
|
return StylePath.build(""); |
|
} |
|
// if (isBefore()) { |
|
// return StylePath.build("/com/fr/plugin/xx/theme/sky/resource/oldstyle.css", ParserType.DYNAMIC); |
|
// } |
|
return StylePath.build("/com/fr/plugin/xx/theme/sky/resource/style.css", ParserType.DYNAMIC); |
|
} |
|
|
|
@Override |
|
public Filter filter() { |
|
return new Filter() { |
|
@Override |
|
public boolean accept() { |
|
return Constants.PLUGIN_ID.equals(AppearanceConfig.getInstance().getThemeId()); |
|
} |
|
}; |
|
} |
|
} |