From c182b1ab78f062de7ed80a83cd682d6f86f2012a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 16 Jan 2016 18:51:16 +0100 Subject: [PATCH] use wcs native version of fargo.js (#9680) --- extra/modules/form.py | 2 +- static/js/fargo.js | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 static/js/fargo.js diff --git a/extra/modules/form.py b/extra/modules/form.py index 2b4ce8f..ed3375e 100644 --- a/extra/modules/form.py +++ b/extra/modules/form.py @@ -24,7 +24,7 @@ class FileWithPreviewAndStrongboxWidget(FileWithPreviewWidget): root_url, _('Pick a file on mon.Service-Public.fr'), _('Use file from mon.Service-Public.fr')) if get_publisher().get_site_option('fargo_url') is not None and not self.preview: - get_response().add_javascript(['../../aq/js/fargo.js']) + get_response().add_javascript(['fargo.js']) t += htmltext('''

'); - var dialog = $("

").append(iframe).appendTo("body").dialog({ - autoOpen: false, - modal: true, - resizable: false, - width: "auto", - height: "auto", - close: function () { - iframe.attr("src", ""); - } - }); - $('p.use-file-from-fargo span').click(function(e) { - e.preventDefault(); - var base_widget = $(this).parents('.file-upload-widget'); - document.fargo_set_token = function (token, title) { - if (token) { - $(base_widget).find('.filename').text(title); - $(base_widget).find('.fileinfo').show(); - $(base_widget).find('input[type=hidden]').val(token); - $(base_widget).find('input[type=file]').hide(); - } - document.fargo_close_dialog(); - } - document.fargo_close_dialog = function () { - document.fargo_set_token = undefined; - dialog.dialog('close'); - } - var src = $(this).data('src'); - var title = $(this).data("title"); - var width = $(this).data("width"); - var height = $(this).data("height"); - iframe.attr({ - width: parseInt(width), - height: parseInt(height), - src: src - }); - dialog.dialog("option", "title", title); - dialog.dialog("open"); - }); -}); -- 2.7.0.rc3