Skip to content
Merged
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
7 changes: 7 additions & 0 deletions components/tools/OmeroWeb/omeroweb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,13 @@ def leave_none_unset_int(s):
" 'webtest/webclient_plugins/center_plugin.overlay.js.html',"
" 'channel_overlay_panel']``. "
"The javascript loads data into ``$('#div_id')``.")],
"omero.web.ui.external_link_baseurl":
["WEB_EXTERNAL_LINK_BASEURL",
None,
identity,
("Use this host (including protocol) for absolute HTML urls "
"in the client, such as social media links. This does not include "
"client-side generated URLs.")],
}

DEPRECATED_SETTINGS_MAPPINGS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
$(this).css('visibility', 'hidden');
}).hide();

{% if link_string %}
$("#link_info_popup_string").val(location.protocol + "//" + location.host + "{{ webclient_path }}?show={{ link_string }}");
{% endif %}

// We do this here and in batch_annotate panel
OME.initToolbarDropdowns();

});

</script>
Expand All @@ -54,11 +56,7 @@
<table>
<tr><td>
<!-- In 'batch_annotate' panel we have 'link_string'. In 'metadata_general' we use js to get value -->
<input type="text" size="30"
{% if link_string %}
value="{{ webclient_path }}?show={{ link_string }}"
{% endif %}
/>
<input type="text" size="30" id="link_info_popup_string" />
</td><td>
<img title="Close" src="{% static 'webgateway/img/close.gif' %}" />
</td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,7 @@
// show a link to the current object
$("#show_link_btn").click(function(){
$("#link_info_popup").show();
{% if webclient_path %}
var lnk = "{{ webclient_path }}";
{% else %}
var lnk = location.href.substring(0,location.href.length - location.search.length);
if (lnk.charAt( lnk.length-1 ) == "#") { lnk = lnk.substring(0, lnk.length-1)}
{% endif %}
var lnk = location.protocol + "//" + location.host + "{{ webclient_path }}";
var obj_type = "{{manager.obj_type}}";
if (obj_type === "acquisition") {
obj_type = "run";
Expand Down
5 changes: 2 additions & 3 deletions components/tools/OmeroWeb/omeroweb/webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1566,8 +1566,7 @@ def load_metadata_details(request, c_type, c_id, conn=None, share_id=None,

context['figScripts'] = figScripts
context['template'] = template
context['webclient_path'] = request.build_absolute_uri(
reverse('webindex'))
context['webclient_path'] = reverse('webindex')
return context


Expand Down Expand Up @@ -2095,7 +2094,7 @@ def batch_annotate(request, conn=None, **kwargs):
context['differentGroups'] = True # E.g. don't run scripts etc
context['canDownload'] = manager.canDownload(objs)
context['template'] = "webclient/annotations/batch_annotate.html"
context['webclient_path'] = request.build_absolute_uri(reverse('webindex'))
context['webclient_path'] = reverse('webindex')
return context


Expand Down
14 changes: 9 additions & 5 deletions components/tools/OmeroWeb/omeroweb/webgateway/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,12 +1974,16 @@ def full_viewer(request, iid, conn=None, **kwargs):
prefix = kwargs.get(
'thumbprefix', 'webgateway.views.render_thumbnail')

def urlprefix(iid):
return reverse(prefix, args=(iid,))
def reverse_urlprefix(p, iid):
r = reverse(p, args=(iid,))
if settings.WEB_EXTERNAL_LINK_BASEURL:
return "%s%s" % (
settings.WEB_EXTERNAL_LINK_BASEURL, r)
else:
return request.build_absolute_uri(r)

image_preview = request.build_absolute_uri(urlprefix(iid))
page_url = request.build_absolute_uri(reverse(
'webgateway.views.full_viewer', args=(iid,)))
image_preview = reverse_urlprefix(prefix, iid)
page_url = reverse_urlprefix('webgateway.views.full_viewer', iid)

d = {'blitzcon': conn,
'image': image,
Expand Down