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(){
// 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);

View File

@@ -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,

View File

@@ -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));

View File

@@ -1,5 +1,6 @@
var p4 = p4 || {};
var commonModule = (function ($, p4) {
$(document).ready(function () {
$('input.input-button').hover(
function () {
@@ -22,7 +23,7 @@ $(document).ready(function () {
$.datepicker.setDefaults($.datepicker.regional[jq_date]);
$('body').on('click', '.infoDialog', function (event) {
infoDialog($(this));
_infoDialog($(this));
});
var cache = $('#mainMenu .helpcontextmenu');
@@ -42,7 +43,7 @@ $(document).ready(function () {
function infoDialog(el) {
function _infoDialog(el) {
$("#DIALOG").attr('title', '')
.empty()
.append(el.attr('infos'))
@@ -61,6 +62,57 @@ function infoDialog(el) {
}
}).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'
});
}
}
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();
}
// @deprecated
function manageSession(data, showMessages) {
@@ -148,63 +200,11 @@ function manageSession(data, showMessages) {
}
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('<div id="' + div + '" style="display:none;">&nbsp;</div>');
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);

View File

@@ -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');
}

View File

@@ -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);
}
}

View File

@@ -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 () {

View File

@@ -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,

View File

@@ -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);
}

View File

@@ -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
});

View File

@@ -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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -77,7 +77,7 @@
$completer_form = $('form[name="list_share_user"]', $container),
$owners_form = $('form[name="owners"]', $container),
$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(){
return false;

View File

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

View File

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

View File

@@ -8,7 +8,7 @@
{% endif %}
</div>
<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>
{% else %}

View File

@@ -382,7 +382,7 @@ $(document).ready(function(){
if(!data.success){
humane.error(data.message);
}else{
var dialog = p4.Dialog.get(1);
var dialog = dialogModule.dialog.get(1);
dialog.Close();
}
},
@@ -395,7 +395,7 @@ $(document).ready(function(){
});
$(".action_cancel", $scope).bind("click", function(){
var dialog = p4.Dialog.get(1);
var dialog = dialogModule.dialog.get(1);
dialog.Close();
return false;
@@ -485,7 +485,7 @@ $(document).ready(function(){
if(thumbnail.length === 0)
{
var dialog = p4.Dialog.Create({
var dialog = dialogModule.dialog.create({
size:'Alert',
title: '{{ "alert" | trans }}',
closeOnEscape:true
@@ -536,7 +536,7 @@ $(document).ready(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 loadingDiv = buttonPanel.find('.info-div');
@@ -571,7 +571,7 @@ $(document).ready(function(){
if(data.success)
{
dialog.Close();
p4.Dialog.get(1).Close();
dialogModule.dialog.get(1).Close();
}
else
{
@@ -584,7 +584,7 @@ $(document).ready(function(){
};
//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',
title:"{{ 'thumbnail validation' | trans }}",
cancelButton:true,

View File

@@ -29,7 +29,7 @@
</form>
<script type="text/javascript">
var $dialog = p4.Dialog.get(1);
var $dialog = dialogModule.dialog.get(1);
var $dialogBox = $dialog.getDomElement();
var $closeButton = $("button.ui-dialog-titlebar-close", $dialogBox.parent());
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='button' class='btn btn-inverse'
value="{{ 'boutton::fermer' | trans }}"
onClick="$('#EDITWINDOW').fadeOut();hideOverlay(2);return(false);" />
onClick="$('#EDITWINDOW').fadeOut();commonModule.hideOverlay(2);return(false);" />
</center>
</div>
@@ -402,7 +402,7 @@
<script type="text/javascript">
{% if multipleDataboxes or recordsRequest|length == 0 %}
$('#EDITWINDOW').hide();
hideOverlay(2);
commonModule.hideOverlay(2);
$(function() {
// 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">
$(document).ready(function(){
var dialog = p4.Dialog.get(1);
var dialog = dialogModule.dialog.get(1);
$('a.self-ajax', dialog.getDomElement()).bind('click', function(e){
e.preventDefault();

View File

@@ -105,7 +105,7 @@ $(document).ready(function(){
$('#notification_trigger').trigger('mousedown');
}
var dialog = p4.Dialog.get(1);
var dialog = dialogModule.dialog.get(1);
var order_id = $('input[name=order_id]').val();
$('.order_launcher', dialog.getDomElement()).bind('click',function(){
@@ -187,7 +187,7 @@ $(document).ready(function(){
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();
$('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)
{
var dialog = p4.Dialog.get(1);
var dialog = dialogModule.dialog.get(1);
var cont = dialog.getDomElement();
var elements = $('.order_list .selectable.selected', cont);
@@ -274,7 +274,7 @@ function deny_documents(order_id)
function send_documents(order_id)
{
var dialog = p4.Dialog.get(1);
var dialog = dialogModule.dialog.get(1);
var elements_ids = [];
$('.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 confirmBox = p4.Dialog.Create({
var confirmBox = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
cancelButton: true,
@@ -227,7 +227,7 @@ function T_replaceCandidates_OK()
{{ 'prod::thesaurusTab:dlg:Remplacement en cours.' | trans }}
{% endset %}
var replacingBox = p4.Dialog.Create({
var replacingBox = dialogModule.dialog.create({
size : 'Alert'
});
replacingBox.setContent("{{ replaceing_msg | e('js') }}");
@@ -252,7 +252,7 @@ function T_replaceCandidates_OK()
if(result.msg != '')
{
var alert = p4.Dialog.Create({
var alert = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
closeButton:true
@@ -280,7 +280,7 @@ function T_acceptCandidates_OK()
{{ 'prod::thesaurusTab:dlg:Acceptation en cours.' | trans }}
{% endset %}
var acceptingBox = p4.Dialog.Create({
var acceptingBox = dialogModule.dialog.create({
size : 'Alert'
});
acceptingBox.setContent("{{ accepting_msg | e('js') }}");
@@ -363,7 +363,7 @@ function C_deleteCandidates_OK()
{{ 'prod::thesaurusTab:dlg:Suppression en cours.' | trans }}
{% endset %}
var deletingBox = p4.Dialog.Create({
var deletingBox = dialogModule.dialog.create({
size : 'Alert'
});
deletingBox.setContent("{{ deleting_msg | e('js') }}");
@@ -391,7 +391,7 @@ function C_deleteCandidates_OK()
if(result.msg != '')
{
var alert = p4.Dialog.Create({
var alert = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
closeButton:true
@@ -445,7 +445,7 @@ function T_acceptCandidates(menuItem, menu, type)
trees.C._toAccept.type = type;
trees.C._toAccept.dst = lidst.eq(0).attr("id");
var confirmBox = p4.Dialog.Create({
var confirmBox = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
cancelButton: true,
@@ -567,7 +567,7 @@ function C_MenuOption(menuItem, menu, option, parm)
msg = $.sprintf("{{ messageMany | e('js') }}", trees.C._selInfos.n);
}
var confirmBox = p4.Dialog.Create({
var confirmBox = dialogModule.dialog.create({
size : 'Alert',
closeOnEscape : true,
cancelButton: true,

View File

@@ -346,7 +346,7 @@
if (this.getStats().files_queued === 0) {
$("#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
dialog.getDomElement().unbind("dialogbeforeclose");
@@ -366,7 +366,7 @@
$("button.upload-submitter", UploaderManager.getContainer()).bind("click", function(e){
//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) {
p4.Alerts(language.warning, language.fileBeingDownloaded);
return false;

View File

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