From 89a3e8f4f5e1952558f45757d3637e351547284d Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Wed, 8 Dec 2021 15:24:10 +0000 Subject: [PATCH 01/11] bumped version number --- build/__init__.py | 2 +- digipal/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/__init__.py b/build/__init__.py index 06d42fbb..d9ad77cc 100644 --- a/build/__init__.py +++ b/build/__init__.py @@ -1,3 +1,3 @@ # What version of Archetype is the latest image on dockerhub # See digipal/__init__.py -__version__ = '2.7' +__version__ = '2.7.1' diff --git a/digipal/__init__.py b/digipal/__init__.py index fe06b38c..e90ba7fa 100644 --- a/digipal/__init__.py +++ b/digipal/__init__.py @@ -1 +1 @@ -__version__ = '2.7' +__version__ = '2.7.1' From c4ec06e4682a408f7825a078184a854707d46aa8 Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Thu, 9 Dec 2021 00:23:07 +0000 Subject: [PATCH 02/11] dpim jp2tif only works on images in the db. Also allowed parallel execution of the command. --- digipal/management/commands/dpim.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/digipal/management/commands/dpim.py b/digipal/management/commands/dpim.py index 301f1714..ecc0f882 100644 --- a/digipal/management/commands/dpim.py +++ b/digipal/management/commands/dpim.py @@ -989,9 +989,10 @@ def transform_image(self, image_info, operations): path_src = os.path.join(settings.IMAGE_SERVER_ROOT, image_info['path']) path_original = path_src + pid = os.getpid() for i, op in enumerate(operations): op[0] = op[0].replace('%s', '{}') - ret = '/tmp/dpim-{}.{}'.format(i, op[1]) + ret = '/tmp/dpim-{}-{}.{}'.format(pid, i, op[1]) if os.path.exists(ret): os.remove(ret) command = op[0].format(path_src, ret) ret_shell = self.run_shell_command(command) @@ -1144,11 +1145,13 @@ def jp2tif(self): 'errors': 0, } + from time import time + for info in files: - if self.is_filtered_in(info) and info.get('disk', False) and info['image']: + if self.is_filtered_in(info) and info.get('disk', False) and info['image'] and getattr(info['image'], 'pk') > 0: if not info['path'].endswith(settings.IMAGE_SERVER_EXT): stats['total'] += 1 - print(stats['total'], info['image'].pk, info['path']) + print(int(time()), stats['total'], info['image'].pk, info['path']) operations = [ ['opj_decompress -quiet -i {} -OutFor TIF -o {}', 'png'], @@ -1166,4 +1169,3 @@ def jp2tif(self): stats['converted'], stats['errors'], )) - From 62100d91b6ff20a903873135ff9e96338f877f8e Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Mon, 10 Jan 2022 21:27:34 +0000 Subject: [PATCH 03/11] MoA SOW22, added Place and Dating clauses to the Text editor. --- digipal/settings.py | 10 ++++++++-- digipal_text/static/digipal_text/viewer/tinymce.css | 4 ++++ digipal_text/views/viewer.py | 9 ++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/digipal/settings.py b/digipal/settings.py index b511551c..a0332b92 100644 --- a/digipal/settings.py +++ b/digipal/settings.py @@ -753,11 +753,11 @@ def filter(self, record): TEXT_EDITOR_OPTIONS = { 'buttons': { - 'psclause': 'Address,Disposition,Witnesses', + 'psclause': 'Address,Disposition,Witnesses,Dating', 'psClauseSecondary': 'Arenga,Boundaries,Holding,Injunction,Malediction,Narration,Notification,Prohibition,Salutation,Sealing,Subscription,Intitulatio,Warrandice' }, 'toolbars': { - 'default': 'psclear undo redo pssave | psconvert | psclause | psClauseSecondary | psperson | pslocation | psex pssupplied psdel | code ', + 'default': 'psclear undo redo pssave | psconvert | psclause | psClauseSecondary | psperson | psplace | pslocation | psex pssupplied psdel | code ', }, 'panels': { 'north': { @@ -769,6 +769,12 @@ def filter(self, record): } } +'''Which type of XML elements in the texts will receive an id. +The id is needed to allow search indexing and image-text annotations. +e.g. my clause here +''' +TEXT_ELEMENTS_WITH_IDS = ['clause', 'location', 'person', 'place'] + ################## # LOCAL SETTINGS # ################## diff --git a/digipal_text/static/digipal_text/viewer/tinymce.css b/digipal_text/static/digipal_text/viewer/tinymce.css index 5d2732fb..75968b54 100644 --- a/digipal_text/static/digipal_text/viewer/tinymce.css +++ b/digipal_text/static/digipal_text/viewer/tinymce.css @@ -202,6 +202,10 @@ span[data-dpt] > span[data-dpt] { content: "Date"; } +.mce-content-body span[data-dpt-type=dating]:before { + content: "Dating"; +} + .mce-content-body span[data-dpt-type=witnesses]:before { content: "Witnesses"; } diff --git a/digipal_text/views/viewer.py b/digipal_text/views/viewer.py index 8147b257..a261194a 100644 --- a/digipal_text/views/viewer.py +++ b/digipal_text/views/viewer.py @@ -1124,11 +1124,14 @@ def get_elementid_from_xml_element(element, idcount, as_string=False): element_text = utils.get_xml_element_text(element) # eg. parts: [(u'', u'clause'), (u'type', u'disposition')] - parts = [(unicode(re.sub('data-dpt-?', '', k)), unicode(v)) - for k, v in element.attrib.iteritems() if k.startswith('data-dpt') and k not in ['data-dpt-cat']] + parts = [ + (unicode(re.sub('data-dpt-?', '', k)), unicode(v)) + for k, v in element.attrib.iteritems() + if k.startswith('data-dpt') and k not in ['data-dpt-cat'] + ] # white list to filter the elements - if parts[0][1] in ('clause', 'location', 'person'): + if parts[0][1] in (settings.TEXT_ELEMENTS_WITH_IDS): element_text = slugify(u'%s' % element_text.lower()) if len(element_text) > 0 and len(element_text) < 20: parts.append(['@text', element_text]) From f98c9bce56abcbc09653e5939c3dd4af138d021b Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Mon, 10 Jan 2022 23:09:13 +0000 Subject: [PATCH 04/11] MOA SOW22: R7: settings.py + ANNOTATOR_UNDESCRIBED_GRAPH_HTML --- digipal/settings.py | 2 ++ digipal/static/digipal/scripts/annotator-digipal.js | 2 +- digipal/templates/digipal/image_annotation.html | 1 + digipal/views/annotation.py | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/digipal/settings.py b/digipal/settings.py index a0332b92..2a81a27d 100644 --- a/digipal/settings.py +++ b/digipal/settings.py @@ -696,6 +696,8 @@ def filter(self, record): # Lower value for smaller increments (OL default = 2) ANNOTATOR_ZOOM_FACTOR = 1.4 +ANNOTATOR_UNDESCRIBED_GRAPH_HTML = '
  • This graph has no description.
  • ' + # Show ms date on annotator? PAGE_IMAGE_SHOW_MSDATE = False # Show MS summary on annotator? diff --git a/digipal/static/digipal/scripts/annotator-digipal.js b/digipal/static/digipal/scripts/annotator-digipal.js index b775d125..57cda240 100644 --- a/digipal/static/digipal/scripts/annotator-digipal.js +++ b/digipal/static/digipal/scripts/annotator-digipal.js @@ -2518,7 +2518,7 @@ function refresh_features_dialog(data, dialog) { components.push(component); } } else if (data.hasOwnProperty('features') && $.isEmptyObject(features)) { - s += "
  • This graph has not yet been described.
  • "; + s += window.ANNOTATOR_UNDESCRIBED_GRAPH_HTML; //dialog.css('height', '100px'); } diff --git a/digipal/templates/digipal/image_annotation.html b/digipal/templates/digipal/image_annotation.html index 3ae14d3b..2c38687c 100644 --- a/digipal/templates/digipal/image_annotation.html +++ b/digipal/templates/digipal/image_annotation.html @@ -147,6 +147,7 @@

    {% if show_image %} diff --git a/digipal/views/annotation.py b/digipal/views/annotation.py index 69a99e1a..595fc633 100644 --- a/digipal/views/annotation.py +++ b/digipal/views/annotation.py @@ -324,6 +324,7 @@ def image(request, image_id): 'hide_annotations': int(not is_model_visible('graph', request)), 'PAGE_IMAGE_SHOW_MSDATE': settings.PAGE_IMAGE_SHOW_MSDATE, 'text_content_xmls': TextContentXML.objects.filter(text_content__item_part=image.item_part), + 'ANNOTATOR_UNDESCRIBED_GRAPH_HTML': settings.ANNOTATOR_UNDESCRIBED_GRAPH_HTML, } if settings.PAGE_IMAGE_SHOW_MSSUMMARY: From 9409fdc57c11a9c961f4bfeb32eead23a1944e5d Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Mon, 10 Jan 2022 23:37:06 +0000 Subject: [PATCH 05/11] MOA SOW22: R17: fullscreenbar was still visible when the annotator was in fullscreen mode. --- digipal/static/css/dpbase.less | 6 +++++- digipal/static/digipal/scripts/annotator-digipal.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/digipal/static/css/dpbase.less b/digipal/static/css/dpbase.less index 6ac826eb..91713c8e 100644 --- a/digipal/static/css/dpbase.less +++ b/digipal/static/css/dpbase.less @@ -892,4 +892,8 @@ a[data-toggle="pill"]{ p, div { display: inline-block; } -} \ No newline at end of file +} + +.annotator-fullscreen nav.primary-nav.navbar { + display: none; +} diff --git a/digipal/static/digipal/scripts/annotator-digipal.js b/digipal/static/digipal/scripts/annotator-digipal.js index 57cda240..658d7fac 100644 --- a/digipal/static/digipal/scripts/annotator-digipal.js +++ b/digipal/static/digipal/scripts/annotator-digipal.js @@ -1883,6 +1883,7 @@ function DigipalAnnotator(mediaUrl, imageUrl, imageWidth, imageHeight, imageServ var map_size; var input_toolbar_position = $("input[name='toolbar_position']:checked"); if (!(this.fullScreen.active)) { + $('body').addClass('annotator-fullscreen') $('html, body').animate({ scrollTop: map.position().top }, 0); @@ -1892,6 +1893,7 @@ function DigipalAnnotator(mediaUrl, imageUrl, imageWidth, imageHeight, imageServ $(document).keyup(function(e) { if (e.keyCode == 27) { + $('body').removeClass('annotator-fullscreen') map.removeClass('fullScreenMap'); panel.removeClass('fullScreenPanel'); toolbar.removeClass('mapHorizontalFullscreen'); @@ -1912,6 +1914,7 @@ function DigipalAnnotator(mediaUrl, imageUrl, imageWidth, imageHeight, imageServ } } else { this.fullScreen.deactivate(); + $('body').removeClass('annotator-fullscreen') map.removeClass('fullScreenMap'); $('.olControlFullScreenFeatureItemInactive').attr('title', 'Activate Full Screen'); From a65aa7738f69e0554dfb999bcb479a9d61c6991e Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Tue, 11 Jan 2022 17:24:26 +0000 Subject: [PATCH 06/11] MoA SOW22: R10: now easier to change which blog categories are listed on the front page. --- digipal/templates/digipal/recent_posts.html | 24 +++++ digipal/templates/index.html | 109 +------------------- digipal/templates/index_default.html | 59 +++++++++++ 3 files changed, 84 insertions(+), 108 deletions(-) create mode 100644 digipal/templates/digipal/recent_posts.html create mode 100644 digipal/templates/index_default.html diff --git a/digipal/templates/digipal/recent_posts.html b/digipal/templates/digipal/recent_posts.html new file mode 100644 index 00000000..45beb748 --- /dev/null +++ b/digipal/templates/digipal/recent_posts.html @@ -0,0 +1,24 @@ +
    +

    {{ posts_title }}

    + {% load blog_tags keyword_tags i18n %} + {% blog_recent_posts 4 category=posts_category as recent_posts %} + {% if recent_posts %} +
      + {% for recent_post in recent_posts %} +
    • + + {{ recent_post.title }} + +
      + + {{ recent_post.publish_date|timesince }} + ago, by {{ recent_post.user.first_name }} {{ recent_post.user.last_name }} + +
    • + {% endfor %} +
    +

    + {{ posts_more }} » +

    + {% endif %} +
    diff --git a/digipal/templates/index.html b/digipal/templates/index.html index 00329e70..394ace12 100644 --- a/digipal/templates/index.html +++ b/digipal/templates/index.html @@ -1,110 +1,3 @@ -{% extends "base.html" %} +{% extends "index_default.html" %} {% load i18n %} {% load blog_tags keyword_tags i18n html_escape %} - -{% block meta_title_site %}{{ settings.SITE_TITLE }}{% endblock %} - -{% block meta_title %}{% endblock %} - -{% block title %} - {% trans "Home" %} -{% endblock %} - -{% block breadcrumb_menu %} -
  • {% trans "Home" %}
  • -{% endblock %} - -{% block main %} - {% block top %} -
    - - {% block top_left %} - {% include "digipal/home_carousel.html" %} - {% endblock %} - - {% block top_middle %} - {% endblock %} - - {% block top_right %} -
    - {% include "digipal/home_intro.html" %} -
    - {% endblock %} - -
    - {% endblock %} - - {% block bottom %} - -
    - - {% block bottom_left %} -
    - -

    Blog

    - {% load blog_tags keyword_tags i18n %} - {% blog_recent_posts 4 category="blog" as recent_posts %} - {% if recent_posts %} -
      - {% for recent_post in recent_posts %} -
    • - - {{ recent_post.title }} - -
      - - {{ recent_post.publish_date|timesince }} - ago, by {{ recent_post.user.first_name }} {{ recent_post.user.last_name }} - -
    • - {% endfor %} -
    -

    - More blog entries » -

    - {% endif %} -
    - {% endblock %} - - {% block bottom_middle %} - -
    - -

    News

    - {% load blog_tags keyword_tags i18n %} - {% blog_recent_posts 4 category="news" as recent_posts %} - {% if recent_posts %} -
      - {% for recent_post in recent_posts %} -
    • - - {{ recent_post.title }} - -
      - - {{ recent_post.publish_date|timesince }} - ago, by {{ recent_post.user.first_name }} {{ recent_post.user.last_name }} - -
    • - {% endfor %} -
    -

    - More news » -

    - {% endif %} -
    - {% endblock %} - - {% block bottom-right %} -
    - - {% render_mezzanine_page 'home.glossary' %} - -
    - {% endblock %} - -
    - - {% endblock %} - -{% endblock %} diff --git a/digipal/templates/index_default.html b/digipal/templates/index_default.html new file mode 100644 index 00000000..8d7c7ce8 --- /dev/null +++ b/digipal/templates/index_default.html @@ -0,0 +1,59 @@ +{% extends "base.html" %} +{% load i18n %} +{% load blog_tags keyword_tags i18n html_escape %} + +{% block meta_title_site %}{{ settings.SITE_TITLE }}{% endblock %} + +{% block meta_title %}{% endblock %} + +{% block title %} + {% trans "Home" %} +{% endblock %} + +{% block breadcrumb_menu %} +
  • {% trans "Home" %}
  • +{% endblock %} + +{% block main %} + {% block top %} +
    + + {% block top_left %} + {% include "digipal/home_carousel.html" %} + {% endblock %} + + {% block top_middle %} + {% endblock %} + + {% block top_right %} +
    + {% include "digipal/home_intro.html" %} +
    + {% endblock %} + +
    + {% endblock %} + + {% block bottom %} + +
    + + {% block bottom_left %} + {% include 'digipal/recent_posts.html' with posts_title='Blog' posts_category='blog' posts_more='More entries' %} + {% endblock %} + + {% block bottom_middle %} + {% include 'digipal/recent_posts.html' with posts_title='News' posts_category='news' posts_more='More news' %} + {% endblock %} + + {% block bottom-right %} +
    + {% render_mezzanine_page 'home.glossary' %} +
    + {% endblock %} + +
    + + {% endblock %} + +{% endblock %} From a46de26ada5923477964e9a5d35d7057ba83d4be Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Sun, 16 Jan 2022 19:13:33 +0000 Subject: [PATCH 07/11] Bugfix: entering a search phrase in the faceted search page was not updating the URL. Bugfix: it was also damaging the integrity of the querystring on server side as jx=1 wasn't removed properly. --- digipal/static/js/search_page.js | 11 +++++++---- digipal/utils.py | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/digipal/static/js/search_page.js b/digipal/static/js/search_page.js index 83f39d42..d5e7523d 100644 --- a/digipal/static/js/search_page.js +++ b/digipal/static/js/search_page.js @@ -281,18 +281,20 @@ function init_search_page(options) { var page_url = dputils.get_page_url($(location).attr('href')); // ! we use this.href instead of $element.attr('href') as the first one returns the absolute URL - $form = $element.parents('form'); + var $form = $element.parents('form'); //var url = this.hasAttribute('href') ? this.href : page_url + '?' + $form.serialize(); var url = this.hasAttribute('href') ? this.href : page_url; var $focus_selector = $element.data('focus'); - // check if the href is for this page + // leave if the href points to another page if (page_url !== dputils.get_page_url(url)) return true; - // check if control-click + // leave if control-click (reload in new tab) if (ev.ctrlKey) return true; window.dputils.fragment_refreshing("#search-ajax-fragment"); + var url_on_success = this.href ? url : page_url + '?' + $form.serialize().replace(/[^?&]+=(&|$)/g, ''); + // See http://stackoverflow.com/questions/9956255. // This tricks prevents caching of the fragment by the browser. // Without this if you move away from the page and then click back @@ -317,7 +319,8 @@ function init_search_page(options) { // insert the new HTML content $fragment.html($data.html()); - if (!is_post) dputils.update_address_bar(url, false, true); + if (!is_post) dputils.update_address_bar(url_on_success, false, true); + // if (!is_post) dputils.update_address_bar(url, false, true); $fragment.stop().animate({ 'background-color': 'white', diff --git a/digipal/utils.py b/digipal/utils.py index 8f5882a3..0692501a 100644 --- a/digipal/utils.py +++ b/digipal/utils.py @@ -907,15 +907,20 @@ def get_cms_url_from_slug(title): return u'/%s' % slugify(unicode(title)) -def remove_param_from_request(request, key): +def remove_param_from_request(request, key='jx'): ret = request - # print dir(ret.GET) - ret.GET = ret.GET.copy() - if 'jx' in ret.GET: - del ret.GET['jx'] - ret.META = ret.META.copy() - ret.META['QUERY_STRING'] = re.sub( - ur'\Wjx=1($|&|#)', ur'', ret.META.get('QUERY_STRING', '')) + if key in ret.GET: + ret.GET = ret.GET.copy() + ret.GET.pop(key) + + # ?hi_type=Charter&terms=london&locus=face&jx=1&result_type=images + # ?jx=1&hi_type=Charter&terms=london&jjx=1&locus=face&jx=1&result_type=images&jx=1#hash + # &hi_type=Charter&terms=london&jjx=1&locus=face&result_type=images#hash + qs = ret.META.get('QUERY_STRING', '') + if qs: + ret.META = ret.META.copy() + ret.META['QUERY_STRING'] = re.sub(r'(^|&)'+re.escape(key)+'=.*?(&|$)', r'\1', qs) + return ret From 254859fdf6822505413b775cec466fe42272fd7f Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Sun, 16 Jan 2022 21:48:53 +0000 Subject: [PATCH 08/11] Share graph or collection now works with long url. Disabled Google shortener. --- digipal/static/css/dpbase.less | 5 +++++ digipal/static/digipal/scripts/utils.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/digipal/static/css/dpbase.less b/digipal/static/css/dpbase.less index 91713c8e..32fbfe3e 100644 --- a/digipal/static/css/dpbase.less +++ b/digipal/static/css/dpbase.less @@ -897,3 +897,8 @@ a[data-toggle="pill"]{ .annotator-fullscreen nav.primary-nav.navbar { display: none; } + +// hide this btn as Google URL shortener service is closed +#long_url { + display: none; +} diff --git a/digipal/static/digipal/scripts/utils.js b/digipal/static/digipal/scripts/utils.js index 1ce6c721..ac9c75c0 100644 --- a/digipal/static/digipal/scripts/utils.js +++ b/digipal/static/digipal/scripts/utils.js @@ -211,6 +211,10 @@ * callback(short_url) */ gapi_shorten_url: function(long_url, callback) { + // this Google service is no longer available, return long_url + callback(long_url); + return; + window.dputils.gapi_call(function(google_api_client) { google_api_client.load('urlshortener', 'v1', function() { From b4f4976e56cd36ef740d8e1c02bfe49ddd3099e0 Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Sun, 16 Jan 2022 21:51:07 +0000 Subject: [PATCH 09/11] bumped version to 2.8 --- build/__init__.py | 2 +- digipal/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/__init__.py b/build/__init__.py index d9ad77cc..3fada23c 100644 --- a/build/__init__.py +++ b/build/__init__.py @@ -1,3 +1,3 @@ # What version of Archetype is the latest image on dockerhub # See digipal/__init__.py -__version__ = '2.7.1' +__version__ = '2.8' diff --git a/digipal/__init__.py b/digipal/__init__.py index e90ba7fa..0a799752 100644 --- a/digipal/__init__.py +++ b/digipal/__init__.py @@ -1 +1 @@ -__version__ = '2.7.1' +__version__ = '2.8' From 82980dd7192b773f5a3ea834b1f180c31e4d7f08 Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Sun, 16 Jan 2022 22:08:21 +0000 Subject: [PATCH 10/11] Updated version in Dockerfile. --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index cbf6afdf..1bdfd5ea 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -81,7 +81,7 @@ RUN mkdir /home/digipal WORKDIR /home/digipal # (inc. the number in echo to force docker build to fetch new version of the code) -RUN echo "19" && git clone -b develop https://github.com/kcl-ddh/digipal.git /home/digipal +RUN echo "2.8" && git clone -b develop https://github.com/kcl-ddh/digipal.git /home/digipal COPY * build/ COPY archetype/* build/archetype/ From 4d829656aafa3987cb05fef43c67d52ec1e54910 Mon Sep 17 00:00:00 2001 From: geoffroy-noel-ddh Date: Thu, 20 Jan 2022 00:18:51 +0000 Subject: [PATCH 11/11] fixed url button not working on the user annotation box. --- build/Dockerfile | 1 + digipal/static/digipal/scripts/annotator-digipal.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index 1bdfd5ea..02114b49 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -83,6 +83,7 @@ WORKDIR /home/digipal # (inc. the number in echo to force docker build to fetch new version of the code) RUN echo "2.8" && git clone -b develop https://github.com/kcl-ddh/digipal.git /home/digipal + COPY * build/ COPY archetype/* build/archetype/ diff --git a/digipal/static/digipal/scripts/annotator-digipal.js b/digipal/static/digipal/scripts/annotator-digipal.js index 658d7fac..0d25849e 100644 --- a/digipal/static/digipal/scripts/annotator-digipal.js +++ b/digipal/static/digipal/scripts/annotator-digipal.js @@ -690,7 +690,7 @@ function DigipalAnnotator(mediaUrl, imageUrl, imageWidth, imageHeight, imageServ events: function(dialog_instance, selectedFeature) { var url_allograph_button = dialog_instance.parent().find('.url_allograph'); - url_allograph_button.on('click', function() { + url_allograph_button.off('click').on('click', function() { show_url_allograph(dialog_instance, selectedFeature, $(this)); }); if (!window.digipal_settings.ARCHETYPE_GOOGLE_SHORTENER_CLIENTID) {