Revision e663b3a7
b/src/gr/grnet/pithos/web/client/FileList.java | ||
---|---|---|
282 | 282 |
sb.append(Templates.INSTANCE.filenameSpan(object.getName())); |
283 | 283 |
if (object.getContentType() != null && (object.getContentType().endsWith("png") || object.getContentType().endsWith("gif") || object.getContentType().endsWith("jpeg"))) { |
284 | 284 |
sb.appendHtmlConstant(" ") |
285 |
.append(Templates.INSTANCE.viewLink(Pithos.getStorageAPIURL() + object.getOwnerID() + object.getUri(), object.getName()));
|
|
285 |
.append(Templates.INSTANCE.viewLink(Pithos.getFileViewURL(object), object.getName()));
|
|
286 | 286 |
} |
287 | 287 |
|
288 | 288 |
return sb.toSafeHtml(); |
... | ... | |
409 | 409 |
if (DOM.eventGetType(event) == Event.ONDBLCLICK) |
410 | 410 |
if (getSelectedFiles().size() == 1) { |
411 | 411 |
File file = getSelectedFiles().get(0); |
412 |
Window.open(Pithos.getStorageViewURL() + file.getOwnerID() + file.getUri(), "_blank", "");
|
|
412 |
Window.open(Pithos.getFileViewURL(file), "_blank", "");
|
|
413 | 413 |
event.preventDefault(); |
414 | 414 |
return; |
415 | 415 |
} |
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
99 | 99 |
} |
100 | 100 |
|
101 | 101 |
public static final Dictionary otherProperties = Dictionary.getDictionary(Const.OTHER_PROPERTIES); |
102 |
public static String getFromOtherPropertiesOrNull(String key) {
|
|
102 |
public static String getFromOtherPropertiesOrDefault(String key, String def) {
|
|
103 | 103 |
try { |
104 |
return otherProperties.get(key); |
|
104 |
final String value = otherProperties.get(key); |
|
105 |
return value == null ? def : value; |
|
105 | 106 |
} |
106 | 107 |
catch(Exception e) { |
107 |
LOGError(e); |
|
108 |
return null; |
|
108 |
return def; |
|
109 | 109 |
} |
110 | 110 |
} |
111 | 111 |
|
112 |
public static String getFromOtherPropertiesOrNull(String key) { |
|
113 |
return getFromOtherPropertiesOrDefault(key, null); |
|
114 |
} |
|
115 |
|
|
112 | 116 |
public static final String OTHERPROPS_STORAGE_API_URL = getFromOtherPropertiesOrNull("STORAGE_API_URL"); |
113 | 117 |
public static final String OTHERPROPS_USER_CATALOGS_API_URL = getFromOtherPropertiesOrNull("USER_CATALOGS_API_URL"); |
114 | 118 |
static { |
... | ... | |
144 | 148 |
LOG("Computed STORAGE_VIEW_URL = ", STORAGE_VIEW_URL); |
145 | 149 |
} |
146 | 150 |
|
151 |
public static final String PUBLIC_LINK_VIEW_PREFIX = getFromOtherPropertiesOrDefault("PUBLIC_LINK_VIEW_PREFIX", ""); |
|
152 |
|
|
147 | 153 |
public static final String USER_CATALOGS_API_URL; |
148 | 154 |
static { |
149 | 155 |
if(OTHERPROPS_USER_CATALOGS_API_URL != null) { |
... | ... | |
1105 | 1111 |
return USER_CATALOGS_API_URL; |
1106 | 1112 |
} |
1107 | 1113 |
|
1114 |
public static String getFileViewURL(File file) { |
|
1115 |
return Pithos.getStorageViewURL() + file.getOwnerID() + file.getUri(); |
|
1116 |
} |
|
1117 |
|
|
1108 | 1118 |
/** |
1109 | 1119 |
* History support for folder navigation |
1110 | 1120 |
* adds a new browser history entry |
Also available in: Unified diff