diff options
| -rw-r--r-- | htroot/ConfigSearchPage_p.html | 2 | ||||
| -rw-r--r-- | htroot/yacysearchitem.html | 2 | ||||
| -rw-r--r-- | htroot/yacysearchitem.java | 23 | ||||
| -rw-r--r-- | locales/fr.lng | 2 | ||||
| -rw-r--r-- | locales/master.lng.xlf | 2 |
5 files changed, 26 insertions, 5 deletions
diff --git a/htroot/ConfigSearchPage_p.html b/htroot/ConfigSearchPage_p.html index 2d8d54693..3e05283fa 100644 --- a/htroot/ConfigSearchPage_p.html +++ b/htroot/ConfigSearchPage_p.html @@ -258,7 +258,7 @@ var solr= $.getJSON("solr/collection1/select?q=*:*&defType=edismax&start=0&rows= <td><span role="separator" aria-orientation="vertical"> | </span><a id="cacheLink" href="CacheResource_p.html" target="LayouTest">Cache</a></td> <td><span role="separator" aria-orientation="vertical"> | </span><a id="proxyLink" href="proxy.html" target="LayouTest">View via Proxy</a></td> <td><span role="separator" aria-orientation="vertical"> | </span><a id="browseIndexLink" href="HostBrowser.html" target="LayouTest"><img src="env/grafics/minitree.png" width="15" height="8" title="Browse index" alt="Browse index"/></a></td> - <td><span role="separator" aria-orientation="vertical"> | </span><a id="snapshotsLink" href="yacysearch.html" target="LayouTest">Snapshots</a></td> + <td><span role="separator" aria-orientation="vertical"> | </span><a id="snapshotsLink" href="yacysearch.html" target="LayouTest">JPG Snapshot</a></td> #(search.result.show.ranking)#::<td><span role="separator" aria-orientation="vertical"> | </span><span title="Raw ranking score value">Ranking: 1.12195955E9</span>#(/search.result.show.ranking)# </tr> <tr> diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html index 78bd3a080..5043c0df9 100644 --- a/htroot/yacysearchitem.html +++ b/htroot/yacysearchitem.html @@ -49,7 +49,7 @@ #(showProxy)#::<span role="separator" aria-orientation="vertical"> | </span><a href="proxy.html?url=#[link]#" target="_blank">View via proxy</a>#(/showProxy)# #(showHostBrowser)#::<span role="separator" aria-orientation="vertical"> | </span><a href="HostBrowser.html?path=#[link]#"><img src="env/grafics/minitree.png" width="15" height="8" title="Browse index" alt="Browse index"/></a>#(/showHostBrowser)# #(showVocabulary)#::<br/>#{vocabulary}##[name]#:#[terms]# #{/vocabulary}##(/showVocabulary)# - #(showSnapshots)#::<a href="#[link]#">Snapshots</a>#(/showSnapshots)# + #(showSnapshots)#::<span role="separator" aria-orientation="vertical"> | </span><a href="#[link]#" target="_blank">#[extension]# Snapshot</a>#(/showSnapshots)# #(showRanking)#::<span role="separator" aria-orientation="vertical"> | </span><span title="Raw ranking score value">Ranking: #[ranking]#</span>#(/showRanking)# </p> </div> diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index e2a3ce8d9..9a6ce2dee 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -33,6 +33,7 @@ import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Date; import java.util.Iterator; +import java.util.Locale; import java.util.StringTokenizer; import net.yacy.cora.date.GenericFormatter; @@ -338,7 +339,27 @@ public class yacysearchitem { prop.put("content_showVocabulary", 0); } if (snapshotPaths != null && snapshotPaths.size() > 0) { - prop.put("content_showSnapshots_link", snapshotPaths.iterator().next().getAbsolutePath()); + /* Only add a link to the eventual snapshot file in the format it is stored (no resource fetching and conversion here) */ + String selectedExt = null, ext; + for(final File snapshot : snapshotPaths) { + ext = MultiProtocolURL.getFileExtension(snapshot.getName()); + if("jpg".equals(ext) || "png".equals(ext)) { + /* Prefer snapshots in jpeg or png format */ + selectedExt = ext; + break; + } else if("pdf".equals(ext)) { + selectedExt = ext; + } else if("xml".equals(ext) && selectedExt == null) { + /* Use the XML metadata snapshot in last resort */ + selectedExt = ext; + } + } + if(selectedExt != null) { + prop.putHTML("content_showSnapshots_extension", selectedExt.toUpperCase(Locale.ROOT)); + prop.putHTML("content_showSnapshots_link", "api/snapshot." + selectedExt + "?url=" + resultURL); + } else { + prop.put("content_showSnapshots", 0); + } } prop.put("content_showRanking_ranking", Float.toString(result.score())); prop.put("content_ranking", Float.toString(result.score())); diff --git a/locales/fr.lng b/locales/fr.lng index f6c5b5b47..560c7b837 100644 --- a/locales/fr.lng +++ b/locales/fr.lng @@ -590,7 +590,7 @@ Maximum range (in days)==Période maximale (en jours) Maximum days number in the histogram. Beware that a large value may trigger high CPU loads both on the server and on the browser with large result sets.==Nombre maximum de jours de l'histogramme. Veuillez noter qu'une valeur élevée peut déclencher des charges CPU importantes tant sur le serveur que sur le navigateur lorsqu'il y a un grand nombre de résultats. keyword subject keyword2 keyword3==mot-clé sujet mot-clé2 mot-clé3 View via Proxy==Ouvrir via le proxy ->Snapshots<==>Captures< +>JPG Snapshot<==>Capture JPG< "Raw ranking score value"=="Score de classement brut" Ranking: 1.12195955E9==Score: 1.12195955E9 "Delete navigator"=="Supprimer le groupe" diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index d56331813..bc775a744 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -2172,7 +2172,7 @@ <source>View via Proxy</source> </trans-unit> <trans-unit id="43d1a9cb" xml:space="preserve" approved="no" translate="yes"> - <source>>Snapshots<</source> + <source>>JPG Snapshot<</source> </trans-unit> <trans-unit id="f5192903" xml:space="preserve" approved="no" translate="yes"> <source>"Raw ranking score value"</source> |
