8000 Use Router.reverse · Pull Request #24 · dirkmc/press · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use Router.reverse #24

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
commands.pyc
.classpath
.project
.settings
eclipse
6 changes: 4 additions & 2 deletions app/press/Plugin.java
< C077 /div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.HashMap;
import java.util.Map;

import play.Play;
import play.PlayPlugin;
import play.mvc.Router;
import press.io.FileIO;
Expand Down Expand Up @@ -240,7 +241,7 @@ private static String getCompressedUrl(String action, String requestKey) {
* tags within the HTML.
*/
private static String getScriptTag(String src) {
return "<script src=\"" + press.PluginConfig.contentHostingDomain + src
return "<script src=\"" + press.PluginConfig.contentHostingDomain + Router.reverseWithCheck(src, Play.getVirtualFile(src), false)
+ "\" type=\"text/javascript\" language=\"javascript\" charset=\"utf-8\">"
+ "</script>\n";
}
Expand All @@ -250,7 +251,8 @@ private static String getScriptTag(String src) {
* within the HTML.
*/
private static String getLinkTag(String src) {
return "<link href=\"" + press.PluginConfig.contentHostingDomain + src + "\" rel=\"stylesheet\" type=\"text/css\" charset=\"utf-8\">"
return "<link href=\"" + press.PluginConfig.contentHostingDomain + Router.reverseWithCheck(src, Play.getVirtualFile(src), false)
+ "\" rel=\"stylesheet\" type=\"text/css\" charset=\"utf-8\">"
+ (press.PluginConfig.htmlCompatible ? "" : "</link>") + "\n";
}
}
Binary file removed commands.pyc
Binary file not shown.
0