diff --git a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html index 2e65d80f1cd..27a5415bd04 100644 --- a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html +++ b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/includes/toolbar.html @@ -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(); - }); @@ -54,11 +56,7 @@ diff --git a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html index 26a3af22f0a..51a22036690 100644 --- a/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html +++ b/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/annotations/metadata_general.html @@ -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"; diff --git a/components/tools/OmeroWeb/omeroweb/webclient/views.py b/components/tools/OmeroWeb/omeroweb/webclient/views.py index 1204f959943..4dfb0f94428 100755 --- a/components/tools/OmeroWeb/omeroweb/webclient/views.py +++ b/components/tools/OmeroWeb/omeroweb/webclient/views.py @@ -1537,8 +1537,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 @@ -2054,7 +2053,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
- +