mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
wip: js modularization of lightbox and cleanup
This commit is contained in:
@@ -26,6 +26,7 @@ gulp.task('build-common-css', ['build-common-font-css'],function(){
|
||||
|
||||
gulp.task('build-common-js', function(){
|
||||
var commonGroup = [
|
||||
config.paths.src + 'common/js/components/utils.js',
|
||||
config.paths.src + 'common/js/components/user.js',
|
||||
// config.paths.dist + 'assets/bootstrap/js/bootstrap.js', // should append no conflict
|
||||
config.paths.src + 'vendors/jquery-mousewheel/js/jquery.mousewheel.js',
|
||||
|
@@ -84,7 +84,6 @@ gulp.task('build-prod-js', function(){
|
||||
config.paths.src + 'prod/js/components/workzone/workzone-basket.js',
|
||||
config.paths.src + 'prod/js/components/workzone/workzone-facets.js',
|
||||
config.paths.src + 'prod/js/components/workzone/workzone-thesaurus.js',
|
||||
config.paths.src + 'prod/js/components/utils.js',
|
||||
config.paths.src + 'prod/js/components/cgu.js',
|
||||
config.paths.src + 'prod/js/components/preferences.js',
|
||||
// config.paths.src + 'prod/js/jquery.form.2.49.js',
|
||||
|
@@ -1,8 +1,23 @@
|
||||
;
|
||||
var dialogModule = (function ($) {
|
||||
|
||||
var $body = null;
|
||||
var bodySize = {};
|
||||
var _dialog = {};
|
||||
|
||||
$('document').ready(function(){
|
||||
$body = $('body');
|
||||
|
||||
$(window).on('resize', function () {
|
||||
bodySize.y = $body.height();
|
||||
bodySize.x = $body.width();
|
||||
|
||||
//@TODO modal resize should be in a stream
|
||||
$('.overlay').height(bodySize.y).width(bodySize.x);
|
||||
//_resizeAll();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function getLevel(level) {
|
||||
|
||||
level = parseInt(level);
|
||||
@@ -79,6 +94,10 @@ var dialogModule = (function ($) {
|
||||
height = dimension[1];
|
||||
width = dimension[0];
|
||||
} else {
|
||||
|
||||
bodySize.y = $body.height();
|
||||
bodySize.x = $body.width();
|
||||
|
||||
switch (this.options.size) {
|
||||
case 'Full':
|
||||
height = bodySize.y - 30;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -450,7 +450,6 @@ var recordEditorModule = (function (p4) {
|
||||
}
|
||||
|
||||
function _setPreviewEdit() {
|
||||
console.log('set preview edit on resize')
|
||||
if (!$('#TH_Opreview').is(':visible'))
|
||||
return false;
|
||||
|
||||
|
@@ -44,11 +44,11 @@ var pushModule = (function (window, p4) {
|
||||
return;
|
||||
},
|
||||
error: function () {
|
||||
dialogModule.dialog.get(2).Close();
|
||||
dialogModule.dialog.get(2).close();
|
||||
return;
|
||||
},
|
||||
timeout: function () {
|
||||
dialogModule.dialog.get(2).Close();
|
||||
dialogModule.dialog.get(2).close();
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -159,7 +159,7 @@ var pushModule = (function (window, p4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
|
||||
$('input[name="name"]', $FeedBackForm).val($('input[name="name"]', $dialog.getDomElement()).val());
|
||||
$('input[name="duration"]', $FeedBackForm).val($('select[name="duration"]', $dialog.getDomElement()).val());
|
||||
@@ -454,11 +454,11 @@ var pushModule = (function (window, p4) {
|
||||
return;
|
||||
},
|
||||
error: function () {
|
||||
dialogModule.dialog.get(2).Close();
|
||||
dialogModule.dialog.get(2).close();
|
||||
return;
|
||||
},
|
||||
timeout: function () {
|
||||
dialogModule.dialog.get(2).Close();
|
||||
dialogModule.dialog.get(2).close();
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -492,7 +492,7 @@ var pushModule = (function (window, p4) {
|
||||
|
||||
var callbackOK = function () {
|
||||
$('a.list_refresh', $container).trigger('click');
|
||||
dialogModule.dialog.get(2).Close();
|
||||
dialogModule.dialog.get(2).close();
|
||||
};
|
||||
|
||||
var name = $('input[name="name"]', dialogModule.dialog.get(2).getDomElement()).val();
|
||||
@@ -630,7 +630,7 @@ var pushModule = (function (window, p4) {
|
||||
|
||||
var callbackOK = function () {
|
||||
$('#ListManager .all-lists a.list_refresh').trigger('click');
|
||||
dialogModule.dialog.get(2).Close();
|
||||
dialogModule.dialog.get(2).close();
|
||||
};
|
||||
|
||||
var List = new document.List(list_id);
|
||||
|
@@ -133,30 +133,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/*function is_ctrl_key(event) {
|
||||
if (event.altKey)
|
||||
return true;
|
||||
if (event.ctrlKey)
|
||||
return true;
|
||||
if (event.metaKey) // apple key opera
|
||||
return true;
|
||||
if (event.keyCode == '17') // apple key opera
|
||||
return true;
|
||||
if (event.keyCode == '224') // apple key mozilla
|
||||
return true;
|
||||
if (event.keyCode == '91') // apple key safari
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_shift_key(event) {
|
||||
if (event.shiftKey)
|
||||
return true;
|
||||
return false;
|
||||
}*/
|
||||
|
||||
|
||||
Selectable.prototype = {
|
||||
push: function (element) {
|
||||
if (this.options.allow_multiple === true || !this.has(element)) {
|
||||
|
@@ -88,7 +88,7 @@ var prodModule = (function (p4, humane) {
|
||||
|
||||
$dialog.getDomElement().find('form').bind('submit.conbo', function () {
|
||||
$(this).unbind('submit.conbo');
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -623,12 +623,10 @@ var prodModule = (function (p4, humane) {
|
||||
});
|
||||
|
||||
function _resizeAll() {
|
||||
var body = $('#mainContainer');
|
||||
var body = $('body');
|
||||
bodySize.y = body.height();
|
||||
bodySize.x = body.width();
|
||||
|
||||
$('.overlay').height(bodySize.y).width(bodySize.x);
|
||||
|
||||
var headBlockH = $('#headBlock').outerHeight();
|
||||
var bodyY = bodySize.y - headBlockH - 2;
|
||||
var bodyW = bodySize.x - 2;
|
||||
@@ -845,7 +843,7 @@ var prodModule = (function (p4, humane) {
|
||||
$('.tabs', dialog.getDomElement()).tabs();
|
||||
|
||||
$('.close_button', dialog.getDomElement()).bind('click', function () {
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
return false;
|
||||
|
@@ -80,7 +80,7 @@
|
||||
|
||||
{% if app['conf'].get(['registry', 'actions', 'auth-required-for-export']) and app.getAuthenticatedUser().isGuest() %}
|
||||
<script type="text/javascript">
|
||||
dialogModule.dialog.get(1).Close();
|
||||
dialogModule.dialog.get(1).close();
|
||||
var $dialog = dialogModule.dialog.create({
|
||||
size : '500x100',
|
||||
closeOnEscape : true,
|
||||
@@ -615,7 +615,7 @@
|
||||
});
|
||||
|
||||
$('.close_button').bind('click',function(){
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
/*define([
|
||||
@@ -676,7 +676,7 @@
|
||||
}
|
||||
|
||||
$('#download form').submit();
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
$('#order .order_button').bind('click',function(){
|
||||
@@ -714,7 +714,7 @@
|
||||
if(!data.error)
|
||||
{
|
||||
humane.info(data.msg);
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
} else {
|
||||
humane.error(data.msg);
|
||||
}
|
||||
@@ -751,7 +751,7 @@
|
||||
|
||||
if(data.success) {
|
||||
humane.info(data.message);
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
} else {
|
||||
var alert = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
@@ -808,7 +808,7 @@
|
||||
}
|
||||
|
||||
$('#sendmail form').submit();
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
$('.datepicker', dialog.getDomElement()).datepicker({
|
||||
|
@@ -178,7 +178,7 @@
|
||||
<div id="dialog_dwnl" title="{{ 'action : exporter' | trans }}" style="display:none;"></div>
|
||||
<script type="text/javascript">
|
||||
{% if basket.getValidation() %}
|
||||
p4.releasable = {% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).isReleasable() %}"{{ 'Do you want to send your report ?' | trans }}"{% else %}false{% endif %}
|
||||
lightboxModule.setReleasable({% if basket.getValidation().getParticipant(app.getAuthenticatedUser()).isReleasable() %}"{{ 'Do you want to send your report ?' | trans }}"{% else %}false{% endif %});
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@@ -202,7 +202,7 @@
|
||||
alert(data.message);
|
||||
}
|
||||
p4.WorkZone.refresh('current');
|
||||
dialogModule.dialog.get(1).Close();
|
||||
dialogModule.dialog.get(1).close();
|
||||
|
||||
return;
|
||||
},
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
},
|
||||
success: function(data){
|
||||
$dialog = dialogModule.dialog.get(1).Close();
|
||||
$dialog = dialogModule.dialog.get(1).close();
|
||||
if(data.success) {
|
||||
humane.info(data.message);
|
||||
return p4.WorkZone.refresh(data.basket.id);
|
||||
|
@@ -210,7 +210,7 @@
|
||||
alert(data.message);
|
||||
}
|
||||
p4.WorkZone.refresh('current', null, false, 'story');
|
||||
dialogModule.dialog.get(1).Close();
|
||||
dialogModule.dialog.get(1).close();
|
||||
|
||||
return;
|
||||
},
|
||||
|
@@ -188,11 +188,11 @@
|
||||
data: {},
|
||||
success: function(datas){
|
||||
if(datas.success) {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
$('form[name="BasketBrowser"]', $container).trigger('submit');
|
||||
p4.WorkZone.refresh();
|
||||
} else {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
var alertBox = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
@@ -203,7 +203,7 @@
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
var alertBox = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
|
@@ -157,10 +157,10 @@ $(function() {
|
||||
data: {},
|
||||
success: function(datas){
|
||||
if(datas.success) {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
pushModule.reloadBridge(managerUrl);
|
||||
} else {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
var alertBox = dialogModule.dialog.create({
|
||||
size : 'Alert',
|
||||
closeOnEscape : true,
|
||||
|
@@ -151,7 +151,7 @@
|
||||
var $dialogBox = $dialog.getDomElement();
|
||||
|
||||
$("button.cancel", $dialogBox).bind("click", function(){
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
});
|
||||
|
||||
$("button.submiter", $dialogBox).bind("click", function(){
|
||||
@@ -169,7 +169,7 @@
|
||||
loader.show();
|
||||
},
|
||||
success: function(data){
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
},
|
||||
complete: function(){
|
||||
$this.attr("disabled", false);
|
||||
|
@@ -59,7 +59,7 @@
|
||||
var $dialogBox = $dialog.getDomElement();
|
||||
|
||||
$("button.cancel", $dialogBox).bind("click", function(){
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
});
|
||||
|
||||
$("button.submiter", $dialogBox).bind("click", function(){
|
||||
@@ -77,7 +77,7 @@
|
||||
loader.show();
|
||||
},
|
||||
success: function(data){
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
},
|
||||
complete: function(){
|
||||
$this.attr("disabled", false);
|
||||
|
@@ -383,7 +383,7 @@ $(document).ready(function(){
|
||||
humane.error(data.message);
|
||||
}else{
|
||||
var dialog = dialogModule.dialog.get(1);
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
}
|
||||
},
|
||||
complete: function(){
|
||||
@@ -396,7 +396,7 @@ $(document).ready(function(){
|
||||
|
||||
$(".action_cancel", $scope).bind("click", function(){
|
||||
var dialog = dialogModule.dialog.get(1);
|
||||
dialog.Close();
|
||||
dialog.close();
|
||||
|
||||
return false;
|
||||
});
|
||||
@@ -570,8 +570,8 @@ $(document).ready(function(){
|
||||
|
||||
if(data.success)
|
||||
{
|
||||
dialog.Close();
|
||||
dialogModule.dialog.get(1).Close();
|
||||
dialog.close();
|
||||
dialogModule.dialog.get(1).close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -35,7 +35,7 @@
|
||||
var $cancelButton = $("button.cancel", $dialogBox);
|
||||
|
||||
$cancelButton.bind("click", function(){
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
});
|
||||
|
||||
$("button.submiter", $dialogBox).bind("click", function(){
|
||||
@@ -56,7 +56,7 @@
|
||||
loader.show();
|
||||
},
|
||||
success: function(data){
|
||||
$dialog.Close();
|
||||
$dialog.close();
|
||||
$.each(data,function(i,n){
|
||||
var imgt = $('#IMGT_'+n),
|
||||
chim = $('.CHIM_'+n),
|
||||
|
@@ -110,7 +110,7 @@ function T_replaceBy2(f)
|
||||
cancelButton: true,
|
||||
buttons: {
|
||||
"Ok" : function() {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
T_replaceCandidates_OK();
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ function T_replaceCandidates_OK()
|
||||
trees.C._toReplace = null;
|
||||
thesauShowWizard("wiz_0", false);
|
||||
|
||||
replacingBox.Close();
|
||||
replacingBox.close();
|
||||
|
||||
if(result.msg != '')
|
||||
{
|
||||
@@ -346,10 +346,10 @@ function T_acceptCandidates_OK()
|
||||
}
|
||||
trees.C._toAccept = null;
|
||||
thesauShowWizard("wiz_0",false);
|
||||
acceptingBox.Close();
|
||||
acceptingBox.close();
|
||||
},
|
||||
error:function(){acceptingBox.Close();},
|
||||
timeout:function(){acceptingBox.Close();},
|
||||
error:function(){acceptingBox.close();},
|
||||
timeout:function(){acceptingBox.close();},
|
||||
_ret: null // private alchemy
|
||||
};
|
||||
|
||||
@@ -387,7 +387,7 @@ function C_deleteCandidates_OK()
|
||||
timeout:10*60*1000, // 10 minutes !
|
||||
success: function(result, textStatus)
|
||||
{
|
||||
deletingBox.Close();
|
||||
deletingBox.close();
|
||||
|
||||
if(result.msg != '')
|
||||
{
|
||||
@@ -451,7 +451,7 @@ function T_acceptCandidates(menuItem, menu, type)
|
||||
cancelButton: true,
|
||||
buttons: {
|
||||
"Ok" : function() {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
T_acceptCandidates_OK();
|
||||
}
|
||||
}
|
||||
@@ -573,7 +573,7 @@ function C_MenuOption(menuItem, menu, option, parm)
|
||||
cancelButton: true,
|
||||
buttons: {
|
||||
"Ok" : function() {
|
||||
confirmBox.Close();
|
||||
confirmBox.close();
|
||||
C_deleteCandidates_OK();
|
||||
}
|
||||
}
|
||||
@@ -638,7 +638,7 @@ function Xclick(e)
|
||||
{
|
||||
tids.pop();
|
||||
var tid3 = tids.join('.');
|
||||
if(!is_ctrl_key(e) && !is_shift_key(e))
|
||||
if(!utilsModule.is_ctrl_key(e) && !utilsModule.is_shift_key(e))
|
||||
{
|
||||
$("LI", trees[type].tree).removeClass('selected');
|
||||
p4.thesau.lastClickedCandidate = null;
|
||||
|
Reference in New Issue
Block a user