modularize dialog Module (no more p4.dialog)

This commit is contained in:
Florian BLOUET
2016-02-29 15:36:02 +01:00
parent 4ff3239c92
commit 5eec250624
32 changed files with 314 additions and 309 deletions

View File

@@ -47,8 +47,7 @@ var browserSync = require('browser-sync').create();
gulp.task('sync', ['watch'], function(){ gulp.task('sync', ['watch'], function(){
// will open browser in http://localhost:3000/ // will open browser in http://localhost:3000/
browserSync.init({ browserSync.init({
proxy: "phraseanet-php55-nginx" proxy: "dev.phraseanet.vb"
//proxy: "www.phraseanet.vb"
}); });
gulp.watch(config.paths.build + '**/*.css').on('change', browserSync.reload); gulp.watch(config.paths.build + '**/*.css').on('change', browserSync.reload);
gulp.watch(config.paths.build + '**/*.js').on('change', browserSync.reload); gulp.watch(config.paths.build + '**/*.js').on('change', browserSync.reload);

View File

@@ -1,9 +1,9 @@
var dialogUserResetTemplateConfirm = function (callback) { var dialogUserResetTemplateConfirm = function (callback) {
var buttons = {}; 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', size : '550x200',
closeOnEscape : true, closeOnEscape : true,
closeButton:false, closeButton:false,
@@ -17,10 +17,10 @@ var dialogUserResetTemplateConfirm = function (callback) {
var dialogUserTemplate = function (callback) { var dialogUserTemplate = function (callback) {
var buttons = {}; var buttons = {};
buttons[language.reset_template_do_not_reset_button] = function () { p4.Dialog.Close(1); callback('0'); }; buttons[language.reset_template_do_not_reset_button] = function () { dialogModule.dialog.close(1); callback('0'); };
buttons[language.reset_template_do_reset_button] = function () { p4.Dialog.Close(1); dialogUserResetTemplateConfirm(callback); }; 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', size : '550x200',
closeOnEscape : true, closeOnEscape : true,
closeButton:false, closeButton:false,

View File

@@ -1,8 +1,7 @@
; ;
var p4 = p4 || {}; var dialogModule = (function ($) {
; var _dialog = {};
(function (p4, $) {
function getLevel(level) { function getLevel(level) {
@@ -19,24 +18,24 @@ var p4 = p4 || {};
return 'DIALOG' + getLevel(level); return 'DIALOG' + getLevel(level);
}; };
function addButtons(buttons, dialog) { function _addButtons(buttons, dialog) {
if (dialog.options.closeButton === true) { if (dialog.options.closeButton === true) {
buttons[language.fermer] = function () { buttons[language.fermer] = function () {
dialog.Close(); dialog.close();
}; };
} }
if (dialog.options.cancelButton === true) { if (dialog.options.cancelButton === true) {
buttons[language.annuler] = function () { buttons[language.annuler] = function () {
dialog.Close(); dialog.close();
}; };
} }
return buttons; return buttons;
} }
var phraseaDialog = function (options, level) { var _phraseaDialog = function (options, level) {
var createDialog = function (level) { var _createDialog = function (level) {
var $dialog = $('#' + getId(level)); var $dialog = $('#' + getId(level));
@@ -73,7 +72,7 @@ var p4 = p4 || {};
this.level = getLevel(level); 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)) { if (/\d+x\d+/.test(this.options.size)) {
var dimension = this.options.size.split('x'); var dimension = this.options.size.split('x');
@@ -109,17 +108,17 @@ var p4 = p4 || {};
* - Small | 730 x 480 * - Small | 730 x 480
* *
**/ **/
this.$dialog = createDialog(this.level), this.$dialog = _createDialog(this.level),
zIndex = Math.min(this.level * 5000 + 5000, 32767); zIndex = Math.min(this.level * 5000 + 5000, 32767);
var CloseCallback = function () { var _closeCallback = function () {
if (typeof $this.options.closeCallback === 'function') { if (typeof $this.options.closeCallback === 'function') {
$this.options.closeCallback($this.$dialog); $this.options.closeCallback($this.$dialog);
} }
if ($this.closing === false) { if ($this.closing === false) {
$this.closing = true; $this.closing = true;
$this.Close(); $this.close();
} }
}; };
@@ -140,7 +139,7 @@ var p4 = p4 || {};
open: function () { open: function () {
$(this).dialog("widget").css("z-index", zIndex); $(this).dialog("widget").css("z-index", zIndex);
}, },
close: CloseCallback close: _closeCallback
}) })
.dialog('open').addClass('dialog-' + this.options.size); .dialog('open').addClass('dialog-' + this.options.size);
@@ -164,9 +163,9 @@ var p4 = p4 || {};
return this; return this;
}; };
phraseaDialog.prototype = { _phraseaDialog.prototype = {
Close: function () { close: function () {
p4.Dialog.Close(this.level); _dialog.close(this.level);
}, },
setContent: function (content) { setContent: function (content) {
this.$dialog.removeClass('loading').empty().append(content); this.$dialog.removeClass('loading').empty().append(content);
@@ -218,7 +217,7 @@ var p4 = p4 || {};
}, },
setOption: function (optionName, optionValue) { setOption: function (optionName, optionValue) {
if (optionName === 'buttons') { if (optionName === 'buttons') {
optionValue = addButtons(optionValue, this); optionValue = _addButtons(optionValue, this);
} }
if (this.$dialog.data("ui-dialog")) { if (this.$dialog.data("ui-dialog")) {
this.$dialog.dialog('option', optionName, optionValue); this.$dialog.dialog('option', optionName, optionValue);
@@ -231,13 +230,13 @@ var p4 = p4 || {};
}; };
Dialog.prototype = { Dialog.prototype = {
Create: function (options, level) { create: function (options, level) {
if (this.get(level) instanceof phraseaDialog) { if (this.get(level) instanceof _phraseaDialog) {
this.get(level).Close(); this.get(level).close();
} }
$dialog = new phraseaDialog(options, level); $dialog = new _phraseaDialog(options, level);
this.currentStack[$dialog.getId()] = $dialog; this.currentStack[$dialog.getId()] = $dialog;
@@ -253,7 +252,7 @@ var p4 = p4 || {};
return null; return null;
}, },
Close: function (level) { close: function (level) {
$(window).unbind('resize.DIALOG' + getLevel(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));

View File

@@ -1,210 +1,210 @@
var p4 = p4 || {}; var p4 = p4 || {};
$(document).ready(function () { var commonModule = (function ($, p4) {
$('input.input-button').hover( $(document).ready(function () {
function () { $('input.input-button').hover(
$(this).addClass('hover'); function () {
}, $(this).addClass('hover');
function () { },
$(this).removeClass('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') { var cache = $('#mainMenu .helpcontextmenu');
jq_date = 'en-GB'; $('.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('<div id="' + div + '" style="display:none;">&nbsp;</div>');
}
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) { function hideOverlay(n) {
infoDialog($(this)); if (( navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6/) )) {
}); $('select').css({
visibility: 'visible'
var cache = $('#mainMenu .helpcontextmenu'); });
$('.context-menu-item', cache).hover(function () { }
$(this).addClass('context-menu-item-hover'); var div = "OVERLAY";
}, function () { if (typeof(n) != "undefined")
$(this).removeClass('context-menu-item-hover'); div += n;
}); $('#' + div).hide().remove();
$('#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;
} }
if (showMessages) {
var box = $('#notification_box');
box.empty().append(data.notifications);
if (box.is(':visible'))
fix_notification_height();
if ($('.notification.unread', box).length > 0) { // @deprecated
var trigger = $('#notification_trigger'); function manageSession(data, showMessages) {
$('.counter', trigger) if (typeof(showMessages) == "undefined")
.empty() showMessages = false;
.append($('.notification.unread', box).length);
$('.counter', trigger).css('visibility', 'visible');
if (data.status == 'disconnected' || data.status == 'session') {
disconnected();
return false;
} }
else if (showMessages) {
$('#notification_trigger .counter').css('visibility', 'hidden').empty(); var box = $('#notification_box');
box.empty().append(data.notifications);
if (data.changed.length > 0) { if (box.is(':visible'))
var current_open = $('.SSTT.ui-state-active'); fix_notification_height();
var current_sstt = current_open.length > 0 ? current_open.attr('id').split('_').pop() : false;
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();
}
}
} }
} else
if ('' !== $.trim(data.message)) { $('#notification_trigger .counter').css('visibility', 'hidden').empty();
if ($('#MESSAGE').length === 0)
$('body').append('<div id="#MESSAGE"></div>'); if (data.changed.length > 0) {
$('#MESSAGE') var current_open = $('.SSTT.ui-state-active');
.empty() var current_sstt = current_open.length > 0 ? current_open.attr('id').split('_').pop() : false;
.append('<div style="margin:30px 10px;"><h4><b>' + data.message + '</b></h4></div><div style="margin:20px 0px 10px;"><label class="checkbox"><input type="checkbox" class="dialog_remove" />' + language.hideMessage + '</label></div>')
.attr('title', 'Global Message') var main_open = false;
.dialog({ for (var i = 0; i != data.changed.length; i++) {
autoOpen: false, var sstt = $('#SSTT_' + data.changed[i]);
closeOnEscape: true, if (sstt.size() === 0) {
resizable: false, if (main_open === false) {
draggable: false, $('#baskets .bloc').animate({'top': 30}, function () {
modal: true, $('#baskets .alert_datas_changed:first').show()
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;
}
}); });
main_open = true;
} }
} }
}) else {
.dialog('open'); 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('<div id="#MESSAGE"></div>');
$('#MESSAGE')
.empty()
.append('<div style="margin:30px 10px;"><h4><b>' + data.message + '</b></h4></div><div style="margin:20px 0px 10px;"><label class="checkbox"><input type="checkbox" class="dialog_remove" />' + language.hideMessage + '</label></div>')
.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; return {
} showOverlay: showOverlay,
hideOverlay: hideOverlay,
manageSession: manageSession
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('<div id="' + div + '" style="display:none;">&nbsp;</div>');
} }
var css = { })(jQuery, p4);
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();
}

View File

@@ -572,7 +572,7 @@
event.cancelBubble = true; event.cancelBubble = true;
if (event.stopPropagation) if (event.stopPropagation)
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 .tooltip_closer').show().bind('click', unfix_tooltip);
$.tooltip.blocked = true; $.tooltip.blocked = true;
} }
@@ -718,7 +718,7 @@ function unfix_tooltip() {
$.tooltip.current = null; $.tooltip.current = null;
$('#tooltip').hide(); $('#tooltip').hide();
$('#tooltip .tooltip_closer').hide(); $('#tooltip .tooltip_closer').hide();
hideOverlay('_tooltip'); commonModule.hideOverlay('_tooltip');
} }

View File

@@ -1262,7 +1262,7 @@ var recordEditorModule = (function (p4) {
} }
$("#Edit_copyPreset_dlg").remove(); $("#Edit_copyPreset_dlg").remove();
$('#EDITWINDOW').hide(); $('#EDITWINDOW').hide();
hideOverlay(2); commonModule.hideOverlay(2);
if (p4.preview.open) if (p4.preview.open)
recordPreviewModule.reloadPreview(); recordPreviewModule.reloadPreview();
return; return;
@@ -1307,7 +1307,7 @@ var recordEditorModule = (function (p4) {
if (e) if (e)
e.style.display = ""; e.style.display = "";
} }
self.setTimeout("$('#EDITWINDOW').fadeOut();hideOverlay(2);", 100); self.setTimeout("$('#EDITWINDOW').fadeOut();commonModule.hideOverlay(2);", 100);
} }
} }

View File

@@ -24,7 +24,7 @@ var recordPreviewModule = (function (p4) {
var justOpen = false; var justOpen = false;
if (!p4.preview.open) { if (!p4.preview.open) {
showOverlay(); commonModule.showOverlay();
$('#PREVIEWIMGCONT').disableSelection(); $('#PREVIEWIMGCONT').disableSelection();
@@ -199,7 +199,7 @@ var recordPreviewModule = (function (p4) {
function closePreview() { function closePreview() {
p4.preview.open = false; p4.preview.open = false;
hideOverlay(); commonModule.hideOverlay();
$('#PREVIEWBOX').fadeTo(500, 0); $('#PREVIEWBOX').fadeTo(500, 0);
$('#PREVIEWBOX').queue(function () { $('#PREVIEWBOX').queue(function () {

View File

@@ -200,7 +200,7 @@ var publicationModule = (function () {
var buttons = {}; var buttons = {};
buttons[language.valider] = function () { buttons[language.valider] = function () {
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
var error = false; var error = false;
var $form = $('form.main_form', dialog.getDomElement()); 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', size: 'Full',
closeOnEscape: true, closeOnEscape: true,
closeButton: true, closeButton: true,

View File

@@ -37,18 +37,18 @@ var pushModule = (function (window, p4) {
size: 'Medium', size: 'Medium',
title: $this.html() title: $this.html()
}; };
p4.Dialog.Create(options, 2).getDomElement().addClass('loading'); dialogModule.dialog.create(options, 2).getDomElement().addClass('loading');
}, },
success: function (data) { success: function (data) {
p4.Dialog.get(2).getDomElement().removeClass('loading').empty().append(data); dialogModule.dialog.get(2).getDomElement().removeClass('loading').empty().append(data);
return; return;
}, },
error: function () { error: function () {
p4.Dialog.get(2).Close(); dialogModule.dialog.get(2).Close();
return; return;
}, },
timeout: function () { timeout: function () {
p4.Dialog.get(2).Close(); dialogModule.dialog.get(2).Close();
return; return;
} }
}); });
@@ -73,7 +73,7 @@ var pushModule = (function (window, p4) {
title: $(this).attr('title') title: $(this).attr('title')
}; };
$dialog = p4.Dialog.Create(options, 2); $dialog = dialogModule.dialog.create(options, 2);
$dialog.setContent(content); $dialog.setContent(content);
$dialog.getDomElement().find('a.adder').bind('click', function () { $dialog.getDomElement().find('a.adder').bind('click', function () {
@@ -117,7 +117,7 @@ var pushModule = (function (window, p4) {
success: function (data) { success: function (data) {
if (data.success) { if (data.success) {
humane.info(data.message); humane.info(data.message);
p4.Dialog.Close(1); dialogModule.dialog.close(1);
p4.WorkZone.refresh(); p4.WorkZone.refresh();
} }
else { else {
@@ -153,7 +153,7 @@ var pushModule = (function (window, p4) {
closeButton: true, closeButton: true,
title: language.warning title: language.warning
} }
var $dialogAlert = p4.Dialog.Create(options, 3); var $dialogAlert = dialogModule.dialog.create(options, 3);
$dialogAlert.setContent(language.FeedBackNameMandatory); $dialogAlert.setContent(language.FeedBackNameMandatory);
return false; return false;
@@ -179,7 +179,7 @@ var pushModule = (function (window, p4) {
cancelButton: true cancelButton: true
}; };
var $dialog = p4.Dialog.Create(options, 2); var $dialog = dialogModule.dialog.create(options, 2);
var $FeedBackForm = $('form[name="FeedBackForm"]', $container); var $FeedBackForm = $('form[name="FeedBackForm"]', $container);
@@ -427,7 +427,7 @@ var pushModule = (function (window, p4) {
closeButton: true, closeButton: true,
title: $this.attr('title') title: $this.attr('title')
}, },
$dialog = p4.Dialog.Create(options, 2); $dialog = dialogModule.dialog.create(options, 2);
$dialog.load($this.attr('href'), 'GET'); $dialog.load($this.attr('href'), 'GET');
@@ -447,18 +447,18 @@ var pushModule = (function (window, p4) {
size: 'Medium', size: 'Medium',
title: $this.html() title: $this.html()
}; };
p4.Dialog.Create(options, 2).getDomElement().addClass('loading'); dialogModule.dialog.create(options, 2).getDomElement().addClass('loading');
}, },
success: function (data) { success: function (data) {
p4.Dialog.get(2).getDomElement().removeClass('loading').empty().append(data); dialogModule.dialog.get(2).getDomElement().removeClass('loading').empty().append(data);
return; return;
}, },
error: function () { error: function () {
p4.Dialog.get(2).Close(); dialogModule.dialog.get(2).Close();
return; return;
}, },
timeout: function () { timeout: function () {
p4.Dialog.get(2).Close(); dialogModule.dialog.get(2).Close();
return; return;
} }
}); });
@@ -492,10 +492,10 @@ var pushModule = (function (window, p4) {
var callbackOK = function () { var callbackOK = function () {
$('a.list_refresh', $container).trigger('click'); $('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) === '') { if ($.trim(name) === '') {
alert(language.listNameCannotBeEmpty); alert(language.listNameCannotBeEmpty);
@@ -511,7 +511,7 @@ var pushModule = (function (window, p4) {
size: '700x170' 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()); var html = _.template($("#list_editor_dialog_add_tpl").html());
@@ -630,7 +630,7 @@ var pushModule = (function (window, p4) {
var callbackOK = function () { var callbackOK = function () {
$('#ListManager .all-lists a.list_refresh').trigger('click'); $('#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); var List = new document.List(list_id);
@@ -643,7 +643,7 @@ var pushModule = (function (window, p4) {
size: 'Alert' 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()); var html = _.template($("#list_editor_dialog_delete_tpl").html());
@@ -692,7 +692,7 @@ var pushModule = (function (window, p4) {
function reloadBridge(url) { function reloadBridge(url) {
var options = $('#dialog_publicator form[name="current_datas"]').serializeArray(); 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); dialog.load(url, 'POST', options);
} }

View File

@@ -34,7 +34,7 @@ var prodModule = (function (p4, humane) {
closeOnEscape: true closeOnEscape: true
}; };
$dialog = p4.Dialog.Create(options); $dialog = dialogModule.dialog.create(options);
$.ajax({ $.ajax({
type: "GET", 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()); searchForm.appendTo($dialog.getDomElement());
@@ -373,7 +373,11 @@ var prodModule = (function (p4, humane) {
if ($('#MODALDL').is(':visible')) { if ($('#MODALDL').is(':visible')) {
switch (event.keyCode) { switch (event.keyCode) {
case 27: case 27:
hideDwnl(); // hide download
commonModule.hideOverlay(2);
$('#MODALDL').css({
'display': 'none'
});
break; break;
} }
} }
@@ -708,7 +712,7 @@ var prodModule = (function (p4, humane) {
function openRecordEditor(type, value) { function openRecordEditor(type, value) {
$('#idFrameE').empty().addClass('loading'); $('#idFrameE').empty().addClass('loading');
showOverlay(2); commonModule.showOverlay(2);
$('#EDITWINDOW').show(); $('#EDITWINDOW').show();
@@ -754,7 +758,7 @@ var prodModule = (function (p4, humane) {
} }
function openShareModal(bas, rec) { function openShareModal(bas, rec) {
var dialog = p4.Dialog.Create({ var dialog = dialogModule.dialog.create({
title: language['share'] title: language['share']
}); });
@@ -802,7 +806,7 @@ var prodModule = (function (p4, humane) {
function openToolModal(datas, activeTab) { function openToolModal(datas, activeTab) {
var dialog = p4.Dialog.Create({ var dialog = dialogModule.dialog.create({
size: 'Medium', size: 'Medium',
title: language.toolbox, title: language.toolbox,
loading: true loading: true
@@ -832,7 +836,7 @@ var prodModule = (function (p4, humane) {
} }
// @TODO duplicate with external module // @TODO duplicate with external module
function _onOpenDownloadModal(datas) { 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) { $.post("../prod/export/multi-export/", datas, function (data) {
@@ -899,7 +903,7 @@ var prodModule = (function (p4, humane) {
return false; return false;
} }
var $dialog = p4.Dialog.Create({ var $dialog = dialogModule.dialog.create({
size: 'Small', size: 'Small',
title: language.deleteRecords title: language.deleteRecords
}); });

View File

@@ -1099,7 +1099,7 @@ function pollNotifications() {
}, },
success: function (data) { success: function (data) {
if (data) { if (data) {
manageSession(data); commonModule.manageSession(data);
} }
var t = 120000; var t = 120000;
if (data.apps && parseInt(data.apps) > 1) { if (data.apps && parseInt(data.apps) > 1) {

View File

@@ -80,8 +80,8 @@
{% if app['conf'].get(['registry', 'actions', 'auth-required-for-export']) and app.getAuthenticatedUser().isGuest() %} {% if app['conf'].get(['registry', 'actions', 'auth-required-for-export']) and app.getAuthenticatedUser().isGuest() %}
<script type="text/javascript"> <script type="text/javascript">
p4.Dialog.get(1).Close(); dialogModule.dialog.get(1).Close();
var $dialog = p4.Dialog.Create({ var $dialog = dialogModule.dialog.create({
size : '500x100', size : '500x100',
closeOnEscape : true, closeOnEscape : true,
closeButton:false, closeButton:false,
@@ -493,7 +493,7 @@
$('#ftp_form_selector').bind('change',function(){ $('#ftp_form_selector').bind('change',function(){
$('#ftp .ftp_form').hide(); $('#ftp .ftp_form').hide();
$('#ftp .ftp_form_'+$(this).val()).show(); $('#ftp .ftp_form_'+$(this).val()).show();
$('.ftp_folder_check', p4.Dialog.get(1).getDomElement()).unbind('change').bind('change', function(){ $('.ftp_folder_check', dialogModule.dialog.get(1).getDomElement()).unbind('change').bind('change', function(){
if($(this).prop('checked')) if($(this).prop('checked'))
$(this).next().prop('disabled',false); $(this).next().prop('disabled',false);
else else
@@ -519,7 +519,7 @@
{{ 'You must agree to the Terms of Use to continue.' | trans }} {{ 'You must agree to the Terms of Use to continue.' | trans }}
{% endset %} {% endset %}
var alert = p4.Dialog.Create({ var alert = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true, closeButton:true,
@@ -562,7 +562,7 @@
{{ 'Certains champs sont obligatoires, veuillez les remplir' | trans }} {{ 'Certains champs sont obligatoires, veuillez les remplir' | trans }}
{% endset %} {% endset %}
var alert = p4.Dialog.Create({ var alert = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true, closeButton:true,
@@ -579,7 +579,7 @@
{{ 'Vous devez selectionner un type de sous definitions' | trans }} {{ 'Vous devez selectionner un type de sous definitions' | trans }}
{% endset %} {% endset %}
var alert = p4.Dialog.Create({ var alert = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true, closeButton:true,
@@ -599,7 +599,7 @@
{% endset %} {% endset %}
$(document).ready(function(){ $(document).ready(function(){
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
var tabs = $('.tabs', dialog.getDomElement()); var tabs = $('.tabs', dialog.getDomElement());
$('a.TOUview').bind('click', function(){ $('a.TOUview').bind('click', function(){
@@ -609,7 +609,7 @@
title :'{{ TOUTitle|e('js') }}' title :'{{ TOUTitle|e('js') }}'
}; };
$dialog = p4.Dialog.Create(options, 2); $dialog = dialogModule.dialog.create(options, 2);
$.get($(this).attr('href'), function(content){$dialog.setContent(content);}); $.get($(this).attr('href'), function(content){$dialog.setContent(content);});
}); });
@@ -709,7 +709,7 @@
title : title title : title
}; };
p4.Dialog.Create(options, 2).setContent(data.msg); dialogModule.dialog.create(options, 2).setContent(data.msg);
if(!data.error) if(!data.error)
{ {
@@ -753,7 +753,7 @@
humane.info(data.message); humane.info(data.message);
dialog.Close(); dialog.Close();
} else { } else {
var alert = p4.Dialog.Create({ var alert = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true, closeButton:true,
@@ -785,7 +785,7 @@
title : data.success ? '{{ "Success" | trans | e('js') }}' : '{{ "Warning !" | trans | e('js') }}' title : data.success ? '{{ "Success" | trans | e('js') }}' : '{{ "Warning !" | trans | e('js') }}'
}; };
p4.Dialog.Create(options, 3).setContent(data.message); dialogModule.dialog.create(options, 3).setContent(data.message);
$this.prop('disabled', false); $this.prop('disabled', false);

View File

@@ -14,7 +14,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
var $dialog = p4.Dialog.get(1); var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement(); var $dialogBox = $dialog.getDomElement();
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize()); $('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
@@ -45,7 +45,7 @@
success: function(data){ success: function(data){
p4.WorkZone.refresh(data.basket.id); p4.WorkZone.refresh(data.basket.id);
p4.Dialog.Close(1); dialogModule.dialog.close(1);
return; return;
}, },

View File

@@ -37,7 +37,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
var container = $('#reorder_box');//p4.Dialog.get(1).getDomElement(); var container = $('#reorder_box');
$('button.autoorder', container).bind('click', function(){ $('button.autoorder', container).bind('click', function(){
autoorder(); autoorder();
@@ -202,7 +202,7 @@
alert(data.message); alert(data.message);
} }
p4.WorkZone.refresh('current'); p4.WorkZone.refresh('current');
p4.Dialog.get(1).Close(); dialogModule.dialog.get(1).Close();
return; return;
}, },

View File

@@ -29,7 +29,7 @@
}, },
success: function(data){ success: function(data){
$dialog = p4.Dialog.get(1).Close(); $dialog = dialogModule.dialog.get(1).Close();
if(data.success) { if(data.success) {
humane.info(data.message); humane.info(data.message);
return p4.WorkZone.refresh(data.basket.id); return p4.WorkZone.refresh(data.basket.id);

View File

@@ -17,7 +17,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
var $dialog = p4.Dialog.get(1); var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement(); var $dialogBox = $dialog.getDomElement();
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize()); $('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
@@ -48,7 +48,7 @@
success: function(data){ success: function(data){
p4.WorkZone.refresh(data.WorkZone, '', true, 'story'); p4.WorkZone.refresh(data.WorkZone, '', true, 'story');
p4.Dialog.Close(1); dialogModule.dialog.close(1);
return; return;
}, },

View File

@@ -210,7 +210,7 @@
alert(data.message); alert(data.message);
} }
p4.WorkZone.refresh('current', null, false, 'story'); p4.WorkZone.refresh('current', null, false, 'story');
p4.Dialog.get(1).Close(); dialogModule.dialog.get(1).Close();
return; return;
}, },

View File

@@ -193,7 +193,7 @@
p4.WorkZone.refresh(); p4.WorkZone.refresh();
} else { } else {
confirmBox.Close(); confirmBox.Close();
var alertBox = p4.Dialog.Create({ var alertBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true closeButton:true
@@ -204,7 +204,7 @@
}, },
error: function() { error: function() {
confirmBox.Close(); confirmBox.Close();
var alertBox = p4.Dialog.Create({ var alertBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true closeButton:true
@@ -215,7 +215,7 @@
}); });
}; };
var confirmBox = p4.Dialog.Create({ var confirmBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
cancelButton: true, cancelButton: true,

View File

@@ -161,7 +161,7 @@ $(function() {
pushModule.reloadBridge(managerUrl); pushModule.reloadBridge(managerUrl);
} else { } else {
confirmBox.Close(); confirmBox.Close();
var alertBox = p4.Dialog.Create({ var alertBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true closeButton:true
@@ -173,7 +173,7 @@ $(function() {
}); });
}; };
var confirmBox = p4.Dialog.Create({ var confirmBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true, closeButton:true,

View File

@@ -77,7 +77,7 @@
$completer_form = $('form[name="list_share_user"]', $container), $completer_form = $('form[name="list_share_user"]', $container),
$owners_form = $('form[name="owners"]', $container), $owners_form = $('form[name="owners"]', $container),
$autocompleter = $('input[name="user"]', $completer_form), $autocompleter = $('input[name="user"]', $completer_form),
$dialog = p4.Dialog.get(2); $dialog = dialogModule.dialog.get(2); //p4.Dialog.get(2);
$completer_form.bind('submit', function(){ $completer_form.bind('submit', function(){
return false; return false;

View File

@@ -147,7 +147,7 @@
} }
}); });
var $dialog = p4.Dialog.get(1); var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement(); var $dialogBox = $dialog.getDomElement();
$("button.cancel", $dialogBox).bind("click", function(){ $("button.cancel", $dialogBox).bind("click", function(){

View File

@@ -55,7 +55,7 @@
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
var $dialog = p4.Dialog.get(1); var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement(); var $dialogBox = $dialog.getDomElement();
$("button.cancel", $dialogBox).bind("click", function(){ $("button.cancel", $dialogBox).bind("click", function(){

View File

@@ -8,7 +8,7 @@
{% endif %} {% endif %}
</div> </div>
<div style="text-align:center;margin-top:15px;"> <div style="text-align:center;margin-top:15px;">
<button class="btn btn-inverse" onclick="p4.Dialog.Close(1)">{{ "boutton::fermer" | trans }}</button> <button class="btn btn-inverse" onclick="dialogModule.dialog.close(1)">{{ "boutton::fermer" | trans }}</button>
</div> </div>
</div> </div>
{% else %} {% else %}

View File

@@ -382,7 +382,7 @@ $(document).ready(function(){
if(!data.success){ if(!data.success){
humane.error(data.message); humane.error(data.message);
}else{ }else{
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
dialog.Close(); dialog.Close();
} }
}, },
@@ -395,7 +395,7 @@ $(document).ready(function(){
}); });
$(".action_cancel", $scope).bind("click", function(){ $(".action_cancel", $scope).bind("click", function(){
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
dialog.Close(); dialog.Close();
return false; return false;
@@ -485,7 +485,7 @@ $(document).ready(function(){
if(thumbnail.length === 0) if(thumbnail.length === 0)
{ {
var dialog = p4.Dialog.Create({ var dialog = dialogModule.dialog.create({
size:'Alert', size:'Alert',
title: '{{ "alert" | trans }}', title: '{{ "alert" | trans }}',
closeOnEscape:true closeOnEscape:true
@@ -536,7 +536,7 @@ $(document).ready(function(){
} }
buttons[language.valider] = function(){ buttons[language.valider] = function(){
var dialog = p4.Dialog.get(2); var dialog = dialogModule.dialog.get(2);
var buttonPanel = dialog.getDomElement().closest('.ui-dialog').find(".ui-dialog-buttonpane"); var buttonPanel = dialog.getDomElement().closest('.ui-dialog').find(".ui-dialog-buttonpane");
var loadingDiv = buttonPanel.find('.info-div'); var loadingDiv = buttonPanel.find('.info-div');
@@ -571,7 +571,7 @@ $(document).ready(function(){
if(data.success) if(data.success)
{ {
dialog.Close(); dialog.Close();
p4.Dialog.get(1).Close(); dialogModule.dialog.get(1).Close();
} }
else else
{ {
@@ -584,7 +584,7 @@ $(document).ready(function(){
}; };
//show confirm box, content is loaded here /prod/tools/thumb-extractor/confirm-box/ //show confirm box, content is loaded here /prod/tools/thumb-extractor/confirm-box/
var dialog = p4.Dialog.Create({ var dialog = dialogModule.dialog.create({
size:'Small', size:'Small',
title:"{{ 'thumbnail validation' | trans }}", title:"{{ 'thumbnail validation' | trans }}",
cancelButton:true, cancelButton:true,

View File

@@ -29,7 +29,7 @@
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
var $dialog = p4.Dialog.get(1); var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement(); var $dialogBox = $dialog.getDomElement();
var $closeButton = $("button.ui-dialog-titlebar-close", $dialogBox.parent()); var $closeButton = $("button.ui-dialog-titlebar-close", $dialogBox.parent());
var $cancelButton = $("button.cancel", $dialogBox); var $cancelButton = $("button.cancel", $dialogBox);

View File

@@ -372,7 +372,7 @@
<input type="hidden" name="edit-lst" id="edit_lst" value="{{ recordsRequest.serializedList() }}" /> <input type="hidden" name="edit-lst" id="edit_lst" value="{{ recordsRequest.serializedList() }}" />
<input type='button' class='btn btn-inverse' <input type='button' class='btn btn-inverse'
value="{{ 'boutton::fermer' | trans }}" value="{{ 'boutton::fermer' | trans }}"
onClick="$('#EDITWINDOW').fadeOut();hideOverlay(2);return(false);" /> onClick="$('#EDITWINDOW').fadeOut();commonModule.hideOverlay(2);return(false);" />
</center> </center>
</div> </div>
@@ -402,7 +402,7 @@
<script type="text/javascript"> <script type="text/javascript">
{% if multipleDataboxes or recordsRequest|length == 0 %} {% if multipleDataboxes or recordsRequest|length == 0 %}
$('#EDITWINDOW').hide(); $('#EDITWINDOW').hide();
hideOverlay(2); commonModule.hideOverlay(2);
$(function() { $(function() {
// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore! // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!

View File

@@ -75,7 +75,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
$('a.self-ajax', dialog.getDomElement()).bind('click', function(e){ $('a.self-ajax', dialog.getDomElement()).bind('click', function(e){
e.preventDefault(); e.preventDefault();

View File

@@ -105,7 +105,7 @@ $(document).ready(function(){
$('#notification_trigger').trigger('mousedown'); $('#notification_trigger').trigger('mousedown');
} }
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
var order_id = $('input[name=order_id]').val(); var order_id = $('input[name=order_id]').val();
$('.order_launcher', dialog.getDomElement()).bind('click',function(){ $('.order_launcher', dialog.getDomElement()).bind('click',function(){
@@ -187,7 +187,7 @@ $(document).ready(function(){
function do_send_documents(order_id, elements_ids, force) function do_send_documents(order_id, elements_ids, force)
{ {
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
var cont = dialog.getDomElement(); var cont = dialog.getDomElement();
$('button.deny, button.send', cont).prop('disabled', true); $('button.deny, button.send', cont).prop('disabled', true);
@@ -224,7 +224,7 @@ function do_send_documents(order_id, elements_ids, force)
function deny_documents(order_id) function deny_documents(order_id)
{ {
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
var cont = dialog.getDomElement(); var cont = dialog.getDomElement();
var elements = $('.order_list .selectable.selected', cont); var elements = $('.order_list .selectable.selected', cont);
@@ -274,7 +274,7 @@ function deny_documents(order_id)
function send_documents(order_id) function send_documents(order_id)
{ {
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
var elements_ids = []; var elements_ids = [];
$('.order_list .selectable.selected', dialog.getDomElement()).each(function(i,n){ $('.order_list .selectable.selected', dialog.getDomElement()).each(function(i,n){

View File

@@ -104,7 +104,7 @@ function T_replaceBy2(f)
var msg = $.sprintf("{{ message | e('js') }}", {'from':term, 'to':f}); var msg = $.sprintf("{{ message | e('js') }}", {'from':term, 'to':f});
var confirmBox = p4.Dialog.Create({ var confirmBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
cancelButton: true, cancelButton: true,
@@ -227,7 +227,7 @@ function T_replaceCandidates_OK()
{{ 'prod::thesaurusTab:dlg:Remplacement en cours.' | trans }} {{ 'prod::thesaurusTab:dlg:Remplacement en cours.' | trans }}
{% endset %} {% endset %}
var replacingBox = p4.Dialog.Create({ var replacingBox = dialogModule.dialog.create({
size : 'Alert' size : 'Alert'
}); });
replacingBox.setContent("{{ replaceing_msg | e('js') }}"); replacingBox.setContent("{{ replaceing_msg | e('js') }}");
@@ -252,7 +252,7 @@ function T_replaceCandidates_OK()
if(result.msg != '') if(result.msg != '')
{ {
var alert = p4.Dialog.Create({ var alert = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true closeButton:true
@@ -280,7 +280,7 @@ function T_acceptCandidates_OK()
{{ 'prod::thesaurusTab:dlg:Acceptation en cours.' | trans }} {{ 'prod::thesaurusTab:dlg:Acceptation en cours.' | trans }}
{% endset %} {% endset %}
var acceptingBox = p4.Dialog.Create({ var acceptingBox = dialogModule.dialog.create({
size : 'Alert' size : 'Alert'
}); });
acceptingBox.setContent("{{ accepting_msg | e('js') }}"); acceptingBox.setContent("{{ accepting_msg | e('js') }}");
@@ -363,7 +363,7 @@ function C_deleteCandidates_OK()
{{ 'prod::thesaurusTab:dlg:Suppression en cours.' | trans }} {{ 'prod::thesaurusTab:dlg:Suppression en cours.' | trans }}
{% endset %} {% endset %}
var deletingBox = p4.Dialog.Create({ var deletingBox = dialogModule.dialog.create({
size : 'Alert' size : 'Alert'
}); });
deletingBox.setContent("{{ deleting_msg | e('js') }}"); deletingBox.setContent("{{ deleting_msg | e('js') }}");
@@ -391,7 +391,7 @@ function C_deleteCandidates_OK()
if(result.msg != '') if(result.msg != '')
{ {
var alert = p4.Dialog.Create({ var alert = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
closeButton:true closeButton:true
@@ -445,7 +445,7 @@ function T_acceptCandidates(menuItem, menu, type)
trees.C._toAccept.type = type; trees.C._toAccept.type = type;
trees.C._toAccept.dst = lidst.eq(0).attr("id"); trees.C._toAccept.dst = lidst.eq(0).attr("id");
var confirmBox = p4.Dialog.Create({ var confirmBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
cancelButton: true, cancelButton: true,
@@ -567,7 +567,7 @@ function C_MenuOption(menuItem, menu, option, parm)
msg = $.sprintf("{{ messageMany | e('js') }}", trees.C._selInfos.n); msg = $.sprintf("{{ messageMany | e('js') }}", trees.C._selInfos.n);
} }
var confirmBox = p4.Dialog.Create({ var confirmBox = dialogModule.dialog.create({
size : 'Alert', size : 'Alert',
closeOnEscape : true, closeOnEscape : true,
cancelButton: true, cancelButton: true,

View File

@@ -346,7 +346,7 @@
if (this.getStats().files_queued === 0) { if (this.getStats().files_queued === 0) {
$("#cancel-all", UploaderManager.getContainer()).addClass("disabled").attr("disabled", true); $("#cancel-all", UploaderManager.getContainer()).addClass("disabled").attr("disabled", true);
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
//unbind check before close event & disabled button for cancel all download //unbind check before close event & disabled button for cancel all download
dialog.getDomElement().unbind("dialogbeforeclose"); dialog.getDomElement().unbind("dialogbeforeclose");
@@ -366,7 +366,7 @@
$("button.upload-submitter", UploaderManager.getContainer()).bind("click", function(e){ $("button.upload-submitter", UploaderManager.getContainer()).bind("click", function(e){
//prevent dialog box from being closed while files are being downloaded //prevent dialog box from being closed while files are being downloaded
p4.Dialog.get(1).getDomElement().bind("dialogbeforeclose", function(event, ui) { dialogModule.dialog.get(1).getDomElement().bind("dialogbeforeclose", function(event, ui) {
if ( swfu.getStats().files_queued > 0) { if ( swfu.getStats().files_queued > 0) {
p4.Alerts(language.warning, language.fileBeingDownloaded); p4.Alerts(language.warning, language.fileBeingDownloaded);
return false; return false;

View File

@@ -270,7 +270,7 @@ $(document).ready(function () {
$(".number-files-to-transmit").html(totalElement); $(".number-files-to-transmit").html(totalElement);
$(".transmit-box").show(); $(".transmit-box").show();
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
//reset progressbar for iframe uploads //reset progressbar for iframe uploads
if( ! $.support.xhrFileUpload && ! $.support.xhrFormDataFileUpload) { if( ! $.support.xhrFileUpload && ! $.support.xhrFormDataFileUpload) {
@@ -386,7 +386,7 @@ $(document).ready(function () {
progressbarAll.width('100%'); progressbarAll.width('100%');
bitrateBox.empty(); bitrateBox.empty();
$('#uploadBoxRight .progress').removeClass('progress-striped active'); $('#uploadBoxRight .progress').removeClass('progress-striped active');
var dialog = p4.Dialog.get(1); var dialog = dialogModule.dialog.get(1);
//unbind check before close event & disabled button for cancel all download //unbind check before close event & disabled button for cancel all download
dialog.getDomElement().unbind("dialogbeforeclose"); dialog.getDomElement().unbind("dialogbeforeclose");
//disabled cancel-all button, if queue is empty and last upload success //disabled cancel-all button, if queue is empty and last upload success