diff --git a/resources/gulp/components/common.js b/resources/gulp/components/common.js index 52adf7f903..0a1111eea3 100644 --- a/resources/gulp/components/common.js +++ b/resources/gulp/components/common.js @@ -58,4 +58,4 @@ gulp.task('watch-common-css', function() { gulp.task('build-common', ['copy-common-images', 'build-common-css'], function(){ debugMode = false; return gulp.start('build-common-js'); -}); \ No newline at end of file +}); diff --git a/resources/gulp/watch.js b/resources/gulp/watch.js index 2bbb56f126..7f25545fa2 100644 --- a/resources/gulp/watch.js +++ b/resources/gulp/watch.js @@ -47,8 +47,7 @@ var browserSync = require('browser-sync').create(); gulp.task('sync', ['watch'], function(){ // will open browser in http://localhost:3000/ browserSync.init({ - proxy: "phraseanet-php55-nginx" - //proxy: "www.phraseanet.vb" + proxy: "dev.phraseanet.vb" }); gulp.watch(config.paths.build + '**/*.css').on('change', browserSync.reload); gulp.watch(config.paths.build + '**/*.js').on('change', browserSync.reload); diff --git a/resources/www/admin/js/template-dialogs.js b/resources/www/admin/js/template-dialogs.js index 1195650eab..1d3dd8c7ef 100644 --- a/resources/www/admin/js/template-dialogs.js +++ b/resources/www/admin/js/template-dialogs.js @@ -1,9 +1,9 @@ var dialogUserResetTemplateConfirm = function (callback) { var buttons = {}; - buttons[language.reset_template_do_reset_apply_button] = function () { p4.Dialog.Close(2); callback('1'); }; + buttons[language.reset_template_do_reset_apply_button] = function () { dialogModule.dialog.close(2); callback('1'); }; - var $dialog = p4.Dialog.Create({ + var $dialog = dialogModule.dialog.create({ size : '550x200', closeOnEscape : true, closeButton:false, @@ -17,10 +17,10 @@ var dialogUserResetTemplateConfirm = function (callback) { var dialogUserTemplate = function (callback) { var buttons = {}; - buttons[language.reset_template_do_not_reset_button] = function () { p4.Dialog.Close(1); callback('0'); }; - buttons[language.reset_template_do_reset_button] = function () { p4.Dialog.Close(1); dialogUserResetTemplateConfirm(callback); }; + buttons[language.reset_template_do_not_reset_button] = function () { dialogModule.dialog.close(1); callback('0'); }; + buttons[language.reset_template_do_reset_button] = function () { dialogModule.dialog.close(1); dialogUserResetTemplateConfirm(callback); }; - var $dialog = p4.Dialog.Create({ + var $dialog = dialogModule.dialog.create({ size : '550x200', closeOnEscape : true, closeButton:false, diff --git a/resources/www/common/js/jquery.Dialog.js b/resources/www/common/js/jquery.Dialog.js index 4e4426c959..05efb06e69 100644 --- a/resources/www/common/js/jquery.Dialog.js +++ b/resources/www/common/js/jquery.Dialog.js @@ -1,8 +1,7 @@ ; -var p4 = p4 || {}; +var dialogModule = (function ($) { -; -(function (p4, $) { + var _dialog = {}; function getLevel(level) { @@ -19,24 +18,24 @@ var p4 = p4 || {}; return 'DIALOG' + getLevel(level); }; - function addButtons(buttons, dialog) { + function _addButtons(buttons, dialog) { if (dialog.options.closeButton === true) { buttons[language.fermer] = function () { - dialog.Close(); + dialog.close(); }; } if (dialog.options.cancelButton === true) { buttons[language.annuler] = function () { - dialog.Close(); + dialog.close(); }; } return buttons; } - var phraseaDialog = function (options, level) { + var _phraseaDialog = function (options, level) { - var createDialog = function (level) { + var _createDialog = function (level) { var $dialog = $('#' + getId(level)); @@ -73,7 +72,7 @@ var p4 = p4 || {}; this.level = getLevel(level); - this.options.buttons = addButtons(this.options.buttons, this); + this.options.buttons = _addButtons(this.options.buttons, this); if (/\d+x\d+/.test(this.options.size)) { var dimension = this.options.size.split('x'); @@ -109,17 +108,17 @@ var p4 = p4 || {}; * - Small | 730 x 480 * **/ - this.$dialog = createDialog(this.level), + this.$dialog = _createDialog(this.level), zIndex = Math.min(this.level * 5000 + 5000, 32767); - var CloseCallback = function () { + var _closeCallback = function () { if (typeof $this.options.closeCallback === 'function') { $this.options.closeCallback($this.$dialog); } if ($this.closing === false) { $this.closing = true; - $this.Close(); + $this.close(); } }; @@ -140,7 +139,7 @@ var p4 = p4 || {}; open: function () { $(this).dialog("widget").css("z-index", zIndex); }, - close: CloseCallback + close: _closeCallback }) .dialog('open').addClass('dialog-' + this.options.size); @@ -164,9 +163,9 @@ var p4 = p4 || {}; return this; }; - phraseaDialog.prototype = { - Close: function () { - p4.Dialog.Close(this.level); + _phraseaDialog.prototype = { + close: function () { + _dialog.close(this.level); }, setContent: function (content) { this.$dialog.removeClass('loading').empty().append(content); @@ -218,7 +217,7 @@ var p4 = p4 || {}; }, setOption: function (optionName, optionValue) { if (optionName === 'buttons') { - optionValue = addButtons(optionValue, this); + optionValue = _addButtons(optionValue, this); } if (this.$dialog.data("ui-dialog")) { this.$dialog.dialog('option', optionName, optionValue); @@ -231,13 +230,13 @@ var p4 = p4 || {}; }; Dialog.prototype = { - Create: function (options, level) { + create: function (options, level) { - if (this.get(level) instanceof phraseaDialog) { - this.get(level).Close(); + if (this.get(level) instanceof _phraseaDialog) { + this.get(level).close(); } - $dialog = new phraseaDialog(options, level); + $dialog = new _phraseaDialog(options, level); this.currentStack[$dialog.getId()] = $dialog; @@ -253,7 +252,7 @@ var p4 = p4 || {}; return null; }, - Close: function (level) { + close: function (level) { $(window).unbind('resize.DIALOG' + getLevel(level)); @@ -272,6 +271,9 @@ var p4 = p4 || {}; } }; - p4.Dialog = new Dialog(); + _dialog = new Dialog(); + return { + dialog: _dialog + } -}(p4, jQuery)); +}(jQuery)); diff --git a/resources/www/common/js/jquery.common.js b/resources/www/common/js/jquery.common.js index 19edcba789..2bed238a19 100644 --- a/resources/www/common/js/jquery.common.js +++ b/resources/www/common/js/jquery.common.js @@ -1,210 +1,210 @@ var p4 = p4 || {}; -$(document).ready(function () { - $('input.input-button').hover( - function () { - $(this).addClass('hover'); - }, - function () { - $(this).removeClass('hover'); +var commonModule = (function ($, p4) { + $(document).ready(function () { + $('input.input-button').hover( + function () { + $(this).addClass('hover'); + }, + function () { + $(this).removeClass('hover'); + } + ); + + var locale = $.cookie('locale'); + + var jq_date = p4.lng = typeof locale !== "undefined" ? locale.split('_').reverse().pop() : 'en'; + + if (jq_date == 'en') { + jq_date = 'en-GB'; } - ); - var locale = $.cookie('locale'); + $.datepicker.setDefaults({showMonthAfterYear: false}); + $.datepicker.setDefaults($.datepicker.regional[jq_date]); - var jq_date = p4.lng = typeof locale !== "undefined" ? locale.split('_').reverse().pop() : 'en'; + $('body').on('click', '.infoDialog', function (event) { + _infoDialog($(this)); + }); - if (jq_date == 'en') { - jq_date = 'en-GB'; + var cache = $('#mainMenu .helpcontextmenu'); + $('.context-menu-item', cache).hover(function () { + $(this).addClass('context-menu-item-hover'); + }, function () { + $(this).removeClass('context-menu-item-hover'); + }); + + $('#help-trigger').contextMenu('#mainMenu .helpcontextmenu', {openEvt: 'click', dropDown: true, theme: 'vista', dropDown: true, + showTransition: 'slideDown', + hideTransition: 'hide', + shadow: false + }); + }); + + + + + function _infoDialog(el) { + $("#DIALOG").attr('title', '') + .empty() + .append(el.attr('infos')) + .dialog({ + + autoOpen: false, + closeOnEscape: true, + resizable: false, + draggable: false, + width: 600, + height: 400, + modal: true, + overlay: { + backgroundColor: '#000', + opacity: 0.7 + } + }).dialog('open').css({'overflow-x': 'auto', 'overflow-y': 'auto'}); + } + function showOverlay(n, appendto, callback, zIndex) { + + var div = "OVERLAY"; + if (typeof(n) != "undefined") + div += n; + if ($('#' + div).length === 0) { + if (typeof(appendto) == 'undefined') + appendto = 'body'; + $(appendto).append(''); + } + + var css = { + display: 'block', + opacity: 0, + right: 0, + bottom: 0, + position: 'absolute', + top: 0, + zIndex: zIndex, + left: 0 + }; + + if (parseInt(zIndex) > 0) + css['zIndex'] = parseInt(zIndex); + + if (typeof(callback) != 'function') + callback = function () { + }; + $('#' + div).css(css).addClass('overlay').fadeTo(500, 0.7).bind('click', function () { + (callback)(); + }); + if (( navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6/) )) { + $('select').css({ + visibility: 'hidden' + }); + } } - $.datepicker.setDefaults({showMonthAfterYear: false}); - $.datepicker.setDefaults($.datepicker.regional[jq_date]); - $('body').on('click', '.infoDialog', function (event) { - infoDialog($(this)); - }); - - var cache = $('#mainMenu .helpcontextmenu'); - $('.context-menu-item', cache).hover(function () { - $(this).addClass('context-menu-item-hover'); - }, function () { - $(this).removeClass('context-menu-item-hover'); - }); - - $('#help-trigger').contextMenu('#mainMenu .helpcontextmenu', {openEvt: 'click', dropDown: true, theme: 'vista', dropDown: true, - showTransition: 'slideDown', - hideTransition: 'hide', - shadow: false - }); -}); - - - - -function infoDialog(el) { - $("#DIALOG").attr('title', '') - .empty() - .append(el.attr('infos')) - .dialog({ - - autoOpen: false, - closeOnEscape: true, - resizable: false, - draggable: false, - width: 600, - height: 400, - modal: true, - overlay: { - backgroundColor: '#000', - opacity: 0.7 - } - }).dialog('open').css({'overflow-x': 'auto', 'overflow-y': 'auto'}); -} - -// @deprecated -function manageSession(data, showMessages) { - if (typeof(showMessages) == "undefined") - showMessages = false; - - if (data.status == 'disconnected' || data.status == 'session') { - disconnected(); - return false; + function hideOverlay(n) { + if (( navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6/) )) { + $('select').css({ + visibility: 'visible' + }); + } + var div = "OVERLAY"; + if (typeof(n) != "undefined") + div += n; + $('#' + div).hide().remove(); } - if (showMessages) { - var box = $('#notification_box'); - box.empty().append(data.notifications); - if (box.is(':visible')) - fix_notification_height(); - if ($('.notification.unread', box).length > 0) { - var trigger = $('#notification_trigger'); - $('.counter', trigger) - .empty() - .append($('.notification.unread', box).length); - $('.counter', trigger).css('visibility', 'visible'); + // @deprecated + function manageSession(data, showMessages) { + if (typeof(showMessages) == "undefined") + showMessages = false; + if (data.status == 'disconnected' || data.status == 'session') { + disconnected(); + return false; } - else - $('#notification_trigger .counter').css('visibility', 'hidden').empty(); + if (showMessages) { + var box = $('#notification_box'); + box.empty().append(data.notifications); - if (data.changed.length > 0) { - var current_open = $('.SSTT.ui-state-active'); - var current_sstt = current_open.length > 0 ? current_open.attr('id').split('_').pop() : false; + if (box.is(':visible')) + fix_notification_height(); + + if ($('.notification.unread', box).length > 0) { + var trigger = $('#notification_trigger'); + $('.counter', trigger) + .empty() + .append($('.notification.unread', box).length); + $('.counter', trigger).css('visibility', 'visible'); - var main_open = false; - for (var i = 0; i != data.changed.length; i++) { - var sstt = $('#SSTT_' + data.changed[i]); - if (sstt.size() === 0) { - if (main_open === false) { - $('#baskets .bloc').animate({'top': 30}, function () { - $('#baskets .alert_datas_changed:first').show() - }); - main_open = true; - } - } - else { - if (!sstt.hasClass('active')) - sstt.addClass('unread'); - else { - $('.alert_datas_changed', $('#SSTT_content_' + data.changed[i])).show(); - } - } } - } - if ('' !== $.trim(data.message)) { - if ($('#MESSAGE').length === 0) - $('body').append('
'); - $('#MESSAGE') - .empty() - .append('

' + data.message + '

') - .attr('title', 'Global Message') - .dialog({ - autoOpen: false, - closeOnEscape: true, - resizable: false, - draggable: false, - modal: true, - close: function () { - if ($('.dialog_remove:checked', $(this)).length > 0) { - // setTemporaryPref - $.ajax({ - type: "POST", - url: "/user/preferences/temporary/", - data: { - prop: 'message', - value: 0 - }, - success: function (data) { - return; - } + else + $('#notification_trigger .counter').css('visibility', 'hidden').empty(); + + if (data.changed.length > 0) { + var current_open = $('.SSTT.ui-state-active'); + var current_sstt = current_open.length > 0 ? current_open.attr('id').split('_').pop() : false; + + var main_open = false; + for (var i = 0; i != data.changed.length; i++) { + var sstt = $('#SSTT_' + data.changed[i]); + if (sstt.size() === 0) { + if (main_open === false) { + $('#baskets .bloc').animate({'top': 30}, function () { + $('#baskets .alert_datas_changed:first').show() }); + main_open = true; } } - }) - .dialog('open'); + else { + if (!sstt.hasClass('active')) + sstt.addClass('unread'); + else { + $('.alert_datas_changed', $('#SSTT_content_' + data.changed[i])).show(); + } + } + } + } + if ('' !== $.trim(data.message)) { + if ($('#MESSAGE').length === 0) + $('body').append('
'); + $('#MESSAGE') + .empty() + .append('

' + data.message + '

') + .attr('title', 'Global Message') + .dialog({ + autoOpen: false, + closeOnEscape: true, + resizable: false, + draggable: false, + modal: true, + close: function () { + if ($('.dialog_remove:checked', $(this)).length > 0) { + // setTemporaryPref + $.ajax({ + type: "POST", + url: "/user/preferences/temporary/", + data: { + prop: 'message', + value: 0 + }, + success: function (data) { + return; + } + }); + } + } + }) + .dialog('open'); + } } + return true; } - return true; -} - - - -function showOverlay(n, appendto, callback, zIndex) { - - var div = "OVERLAY"; - if (typeof(n) != "undefined") - div += n; - if ($('#' + div).length === 0) { - if (typeof(appendto) == 'undefined') - appendto = 'body'; - $(appendto).append(''); + return { + showOverlay: showOverlay, + hideOverlay: hideOverlay, + manageSession: manageSession } - var css = { - display: 'block', - opacity: 0, - right: 0, - bottom: 0, - position: 'absolute', - top: 0, - zIndex: zIndex, - left: 0 - }; - - if (parseInt(zIndex) > 0) - css['zIndex'] = parseInt(zIndex); - - if (typeof(callback) != 'function') - callback = function () { - }; - $('#' + div).css(css).addClass('overlay').fadeTo(500, 0.7).bind('click', function () { - (callback)(); - }); - if (( navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6/) )) { - $('select').css({ - visibility: 'hidden' - }); - } -} - -function hideDwnl() { - hideOverlay(2); - $('#MODALDL').css({ - 'display': 'none' - }); -} - -function hideOverlay(n) { - if (( navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6/) )) { - $('select').css({ - visibility: 'visible' - }); - } - var div = "OVERLAY"; - if (typeof(n) != "undefined") - div += n; - $('#' + div).hide().remove(); -} +})(jQuery, p4); diff --git a/resources/www/common/js/jquery.tooltip.js b/resources/www/common/js/jquery.tooltip.js index 27764d1895..bdc1eaa703 100644 --- a/resources/www/common/js/jquery.tooltip.js +++ b/resources/www/common/js/jquery.tooltip.js @@ -572,7 +572,7 @@ event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); - showOverlay('_tooltip', 'body', unfix_tooltip, settings(this).fixableIndex); + commonModule.showOverlay('_tooltip', 'body', unfix_tooltip, settings(this).fixableIndex); $('#tooltip .tooltip_closer').show().bind('click', unfix_tooltip); $.tooltip.blocked = true; } @@ -718,7 +718,7 @@ function unfix_tooltip() { $.tooltip.current = null; $('#tooltip').hide(); $('#tooltip .tooltip_closer').hide(); - hideOverlay('_tooltip'); + commonModule.hideOverlay('_tooltip'); } diff --git a/resources/www/prod/js/components/editor/record-editor.js b/resources/www/prod/js/components/editor/record-editor.js index 7a1c423187..2ae966789f 100644 --- a/resources/www/prod/js/components/editor/record-editor.js +++ b/resources/www/prod/js/components/editor/record-editor.js @@ -1262,7 +1262,7 @@ var recordEditorModule = (function (p4) { } $("#Edit_copyPreset_dlg").remove(); $('#EDITWINDOW').hide(); - hideOverlay(2); + commonModule.hideOverlay(2); if (p4.preview.open) recordPreviewModule.reloadPreview(); return; @@ -1307,7 +1307,7 @@ var recordEditorModule = (function (p4) { if (e) e.style.display = ""; } - self.setTimeout("$('#EDITWINDOW').fadeOut();hideOverlay(2);", 100); + self.setTimeout("$('#EDITWINDOW').fadeOut();commonModule.hideOverlay(2);", 100); } } diff --git a/resources/www/prod/js/components/preview/preview.js b/resources/www/prod/js/components/preview/preview.js index 8973dbcf6b..1c572821ae 100644 --- a/resources/www/prod/js/components/preview/preview.js +++ b/resources/www/prod/js/components/preview/preview.js @@ -24,7 +24,7 @@ var recordPreviewModule = (function (p4) { var justOpen = false; if (!p4.preview.open) { - showOverlay(); + commonModule.showOverlay(); $('#PREVIEWIMGCONT').disableSelection(); @@ -199,7 +199,7 @@ var recordPreviewModule = (function (p4) { function closePreview() { p4.preview.open = false; - hideOverlay(); + commonModule.hideOverlay(); $('#PREVIEWBOX').fadeTo(500, 0); $('#PREVIEWBOX').queue(function () { diff --git a/resources/www/prod/js/components/publication.js b/resources/www/prod/js/components/publication.js index 9ba8b754bd..4d2edc1aa4 100644 --- a/resources/www/prod/js/components/publication.js +++ b/resources/www/prod/js/components/publication.js @@ -200,7 +200,7 @@ var publicationModule = (function () { var buttons = {}; buttons[language.valider] = function () { - var dialog = p4.Dialog.get(1); + var dialog = dialogModule.dialog.get(1); var error = false; var $form = $('form.main_form', dialog.getDomElement()); @@ -258,13 +258,13 @@ var publicationModule = (function () { }); } - p4.Dialog.Close(1); + dialogModule.dialog.close(1); } }); - p4.Dialog.Close(1); + dialogModule.dialog.close(1); }; - var dialog = p4.Dialog.Create({ + var dialog = dialogModule.dialog.create({ size: 'Full', closeOnEscape: true, closeButton: true, diff --git a/resources/www/prod/js/components/push/push.js b/resources/www/prod/js/components/push/push.js index a655493de6..b160fdb3b5 100644 --- a/resources/www/prod/js/components/push/push.js +++ b/resources/www/prod/js/components/push/push.js @@ -37,18 +37,18 @@ var pushModule = (function (window, p4) { size: 'Medium', title: $this.html() }; - p4.Dialog.Create(options, 2).getDomElement().addClass('loading'); + dialogModule.dialog.create(options, 2).getDomElement().addClass('loading'); }, success: function (data) { - p4.Dialog.get(2).getDomElement().removeClass('loading').empty().append(data); + dialogModule.dialog.get(2).getDomElement().removeClass('loading').empty().append(data); return; }, error: function () { - p4.Dialog.get(2).Close(); + dialogModule.dialog.get(2).Close(); return; }, timeout: function () { - p4.Dialog.get(2).Close(); + dialogModule.dialog.get(2).Close(); return; } }); @@ -73,7 +73,7 @@ var pushModule = (function (window, p4) { title: $(this).attr('title') }; - $dialog = p4.Dialog.Create(options, 2); + $dialog = dialogModule.dialog.create(options, 2); $dialog.setContent(content); $dialog.getDomElement().find('a.adder').bind('click', function () { @@ -117,7 +117,7 @@ var pushModule = (function (window, p4) { success: function (data) { if (data.success) { humane.info(data.message); - p4.Dialog.Close(1); + dialogModule.dialog.close(1); p4.WorkZone.refresh(); } else { @@ -153,7 +153,7 @@ var pushModule = (function (window, p4) { closeButton: true, title: language.warning } - var $dialogAlert = p4.Dialog.Create(options, 3); + var $dialogAlert = dialogModule.dialog.create(options, 3); $dialogAlert.setContent(language.FeedBackNameMandatory); return false; @@ -179,7 +179,7 @@ var pushModule = (function (window, p4) { cancelButton: true }; - var $dialog = p4.Dialog.Create(options, 2); + var $dialog = dialogModule.dialog.create(options, 2); var $FeedBackForm = $('form[name="FeedBackForm"]', $container); @@ -427,7 +427,7 @@ var pushModule = (function (window, p4) { closeButton: true, title: $this.attr('title') }, - $dialog = p4.Dialog.Create(options, 2); + $dialog = dialogModule.dialog.create(options, 2); $dialog.load($this.attr('href'), 'GET'); @@ -447,18 +447,18 @@ var pushModule = (function (window, p4) { size: 'Medium', title: $this.html() }; - p4.Dialog.Create(options, 2).getDomElement().addClass('loading'); + dialogModule.dialog.create(options, 2).getDomElement().addClass('loading'); }, success: function (data) { - p4.Dialog.get(2).getDomElement().removeClass('loading').empty().append(data); + dialogModule.dialog.get(2).getDomElement().removeClass('loading').empty().append(data); return; }, error: function () { - p4.Dialog.get(2).Close(); + dialogModule.dialog.get(2).Close(); return; }, timeout: function () { - p4.Dialog.get(2).Close(); + dialogModule.dialog.get(2).Close(); return; } }); @@ -492,10 +492,10 @@ var pushModule = (function (window, p4) { var callbackOK = function () { $('a.list_refresh', $container).trigger('click'); - p4.Dialog.get(2).Close(); + dialogModule.dialog.get(2).Close(); }; - var name = $('input[name="name"]', p4.Dialog.get(2).getDomElement()).val(); + var name = $('input[name="name"]', dialogModule.dialog.get(2).getDomElement()).val(); if ($.trim(name) === '') { alert(language.listNameCannotBeEmpty); @@ -511,7 +511,7 @@ var pushModule = (function (window, p4) { size: '700x170' }; - p4.Dialog.Create(options, 2).setContent(box); + dialogModule.dialog.create(options, 2).setContent(box); }; var html = _.template($("#list_editor_dialog_add_tpl").html()); @@ -630,7 +630,7 @@ var pushModule = (function (window, p4) { var callbackOK = function () { $('#ListManager .all-lists a.list_refresh').trigger('click'); - p4.Dialog.get(2).Close(); + dialogModule.dialog.get(2).Close(); }; var List = new document.List(list_id); @@ -643,7 +643,7 @@ var pushModule = (function (window, p4) { size: 'Alert' }; - p4.Dialog.Create(options, 2).setContent(box); + dialogModule.dialog.create(options, 2).setContent(box); }; var html = _.template($("#list_editor_dialog_delete_tpl").html()); @@ -692,7 +692,7 @@ var pushModule = (function (window, p4) { function reloadBridge(url) { var options = $('#dialog_publicator form[name="current_datas"]').serializeArray(); - var dialog = p4.Dialog.get(1); + var dialog = dialogModule.dialog.get(1); dialog.load(url, 'POST', options); } diff --git a/resources/www/prod/js/prod.js b/resources/www/prod/js/prod.js index 17c4b23e83..0158b8e73d 100644 --- a/resources/www/prod/js/prod.js +++ b/resources/www/prod/js/prod.js @@ -34,7 +34,7 @@ var prodModule = (function (p4, humane) { closeOnEscape: true }; - $dialog = p4.Dialog.Create(options); + $dialog = dialogModule.dialog.create(options); $.ajax({ type: "GET", @@ -79,7 +79,7 @@ var prodModule = (function (p4, humane) { } }; - $dialog = p4.Dialog.Create(options); + $dialog = dialogModule.dialog.create(options); searchForm.appendTo($dialog.getDomElement()); @@ -373,7 +373,11 @@ var prodModule = (function (p4, humane) { if ($('#MODALDL').is(':visible')) { switch (event.keyCode) { case 27: - hideDwnl(); + // hide download + commonModule.hideOverlay(2); + $('#MODALDL').css({ + 'display': 'none' + }); break; } } @@ -708,7 +712,7 @@ var prodModule = (function (p4, humane) { function openRecordEditor(type, value) { $('#idFrameE').empty().addClass('loading'); - showOverlay(2); + commonModule.showOverlay(2); $('#EDITWINDOW').show(); @@ -754,7 +758,7 @@ var prodModule = (function (p4, humane) { } function openShareModal(bas, rec) { - var dialog = p4.Dialog.Create({ + var dialog = dialogModule.dialog.create({ title: language['share'] }); @@ -802,7 +806,7 @@ var prodModule = (function (p4, humane) { function openToolModal(datas, activeTab) { - var dialog = p4.Dialog.Create({ + var dialog = dialogModule.dialog.create({ size: 'Medium', title: language.toolbox, loading: true @@ -832,7 +836,7 @@ var prodModule = (function (p4, humane) { } // @TODO duplicate with external module function _onOpenDownloadModal(datas) { - var dialog = p4.Dialog.Create({title: language['export']}); + var dialog = dialogModule.dialog.create({title: language['export']}); $.post("../prod/export/multi-export/", datas, function (data) { @@ -899,7 +903,7 @@ var prodModule = (function (p4, humane) { return false; } - var $dialog = p4.Dialog.Create({ + var $dialog = dialogModule.dialog.create({ size: 'Small', title: language.deleteRecords }); diff --git a/resources/www/report/js/report.js b/resources/www/report/js/report.js index 21031b1f22..a929d86868 100644 --- a/resources/www/report/js/report.js +++ b/resources/www/report/js/report.js @@ -1099,7 +1099,7 @@ function pollNotifications() { }, success: function (data) { if (data) { - manageSession(data); + commonModule.manageSession(data); } var t = 120000; if (data.apps && parseInt(data.apps) > 1) { diff --git a/templates/web/common/dialog_export.html.twig b/templates/web/common/dialog_export.html.twig index e1aad473d1..67a287acb0 100644 --- a/templates/web/common/dialog_export.html.twig +++ b/templates/web/common/dialog_export.html.twig @@ -80,8 +80,8 @@ {% if app['conf'].get(['registry', 'actions', 'auth-required-for-export']) and app.getAuthenticatedUser().isGuest() %}