mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Hnadle error in Lightbox API
This commit is contained in:
@@ -14,11 +14,11 @@ $(window).bind('beforeunload', function(){
|
|||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
||||||
$(window).bind('resize',function(){
|
$(window).bind('resize',function(){
|
||||||
resize();
|
resize();
|
||||||
}).trigger('resize');
|
}).trigger('resize');
|
||||||
|
|
||||||
function resize()
|
function resize()
|
||||||
{
|
{
|
||||||
var h = $(window).height();
|
var h = $(window).height();
|
||||||
@@ -31,19 +31,19 @@ $(document).ready(function(){
|
|||||||
$('#record_wrapper').width($('#innerWrapper').innerWidth() - $('#right_column').outerWidth() - 2);
|
$('#record_wrapper').width($('#innerWrapper').innerWidth() - $('#right_column').outerWidth() - 2);
|
||||||
// var right_column_wrapper_height = $('#right_column').innerHeight() - $('.right_column_title').outerHeight() - 10;
|
// var right_column_wrapper_height = $('#right_column').innerHeight() - $('.right_column_title').outerHeight() - 10;
|
||||||
// $('.right_column_wrapper').height(right_column_wrapper_height);
|
// $('.right_column_wrapper').height(right_column_wrapper_height);
|
||||||
|
|
||||||
$('.record_display_box').each(function(i,n){
|
$('.record_display_box').each(function(i,n){
|
||||||
$('.container',n).height($(n).innerHeight() - $('.header').outerHeight());
|
$('.container',n).height($(n).innerHeight() - $('.header').outerHeight());
|
||||||
});
|
});
|
||||||
display_record($('#record_compare').css('visibility') != 'hidden');
|
display_record($('#record_compare').css('visibility') != 'hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(this).data('slideshow',false);
|
$(this).data('slideshow',false);
|
||||||
$(this).data('slideshow_ctime', false);
|
$(this).data('slideshow_ctime', false);
|
||||||
|
|
||||||
$('#mainMenu, .unselectable').disableSelection();
|
$('#mainMenu, .unselectable').disableSelection();
|
||||||
|
|
||||||
display_basket();
|
display_basket();
|
||||||
|
|
||||||
$(window).bind('mousedown', function(){
|
$(window).bind('mousedown', function(){
|
||||||
@@ -53,7 +53,7 @@ $(document).ready(function(){
|
|||||||
$('.basket_downloader').bind('click', function(){
|
$('.basket_downloader').bind('click', function(){
|
||||||
download_basket();
|
download_basket();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.basket_wrapper').hover(
|
$('.basket_wrapper').hover(
|
||||||
function(){
|
function(){
|
||||||
$(this).addClass('hover');
|
$(this).addClass('hover');
|
||||||
@@ -83,16 +83,16 @@ $(document).ready(function(){
|
|||||||
$('.validate', title).addClass('highlight');
|
$('.validate', title).addClass('highlight');
|
||||||
}
|
}
|
||||||
}).addClass('clickable');
|
}).addClass('clickable');
|
||||||
|
|
||||||
var sselcont = $('#sc_container .basket_element:first');
|
var sselcont = $('#sc_container .basket_element:first');
|
||||||
if(sselcont.length > 0)
|
if(sselcont.length > 0)
|
||||||
{
|
{
|
||||||
display_basket_element(false, sselcont.attr('id').split('_').pop());
|
display_basket_element(false, sselcont.attr('id').split('_').pop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
set_sizeable($('#record_main .container, #record_compare .container'));
|
set_sizeable($('#record_main .container, #record_compare .container'));
|
||||||
|
|
||||||
$('#navigation')
|
$('#navigation')
|
||||||
.bind('change',
|
.bind('change',
|
||||||
function()
|
function()
|
||||||
@@ -107,16 +107,16 @@ $(document).ready(function(){
|
|||||||
function bind_keyboard()
|
function bind_keyboard()
|
||||||
{
|
{
|
||||||
$(document).bind('keydown', function(event){
|
$(document).bind('keydown', function(event){
|
||||||
|
|
||||||
var stop = false;
|
var stop = false;
|
||||||
$('.notes_wrapper').each(function(i,n){
|
$('.notes_wrapper').each(function(i,n){
|
||||||
if(parseInt($(n).css('top')) >= 0)
|
if(parseInt($(n).css('top')) >= 0)
|
||||||
stop = true;
|
stop = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if(stop)
|
if(stop)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var cancelKey = false;
|
var cancelKey = false;
|
||||||
|
|
||||||
var el, id;
|
var el, id;
|
||||||
@@ -159,7 +159,7 @@ function bind_keyboard()
|
|||||||
{
|
{
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
if(event.stopPropagation)
|
if(event.stopPropagation)
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -183,13 +183,11 @@ function set_release(el)
|
|||||||
$('.loader', el).css({
|
$('.loader', el).css({
|
||||||
visibility:'hidden'
|
visibility:'hidden'
|
||||||
});
|
});
|
||||||
if(data.error)
|
if(data.datas)
|
||||||
{
|
{
|
||||||
|
alert(data.datas);
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
alert(data.datas);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -216,17 +214,17 @@ function load_report()
|
|||||||
|
|
||||||
function set_sizeable(container)
|
function set_sizeable(container)
|
||||||
{
|
{
|
||||||
|
|
||||||
$(container).bind('mousewheel',function(event,delta){
|
$(container).bind('mousewheel',function(event,delta){
|
||||||
|
|
||||||
if($(this).hasClass('note_editing'))
|
if($(this).hasClass('note_editing'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var record = $('.record', this);
|
var record = $('.record', this);
|
||||||
|
|
||||||
if(record.length === 0)
|
if(record.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var o_top = parseInt(record.css('top'));
|
var o_top = parseInt(record.css('top'));
|
||||||
var o_left = parseInt(record.css('left'));
|
var o_left = parseInt(record.css('left'));
|
||||||
|
|
||||||
@@ -253,13 +251,13 @@ function set_sizeable(container)
|
|||||||
|
|
||||||
var top = Math.round((height / o_height) * (o_top - $(this).height() / 2) + $(this).height() / 2);
|
var top = Math.round((height / o_height) * (o_top - $(this).height() / 2) + $(this).height() / 2);
|
||||||
var left = Math.round((width / o_width) * (o_left - $(this).width() / 2) + $(this).width() / 2);
|
var left = Math.round((width / o_width) * (o_left - $(this).width() / 2) + $(this).width() / 2);
|
||||||
|
|
||||||
record.width(width).height(height).css({top:top, left:left});
|
record.width(width).height(height).css({top:top, left:left});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function display_basket()
|
function display_basket()
|
||||||
{
|
{
|
||||||
@@ -273,18 +271,18 @@ function display_basket()
|
|||||||
}).bind('click',function(){
|
}).bind('click',function(){
|
||||||
set_release($(this));
|
set_release($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.basket_element',sc_wrapper).parent()
|
$('.basket_element',sc_wrapper).parent()
|
||||||
.bind('click',function(event){
|
.bind('click',function(event){
|
||||||
scid_click(event, this);
|
scid_click(event, this);
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
.addClass('clickable');
|
.addClass('clickable');
|
||||||
|
|
||||||
$('.agree_button, .disagree_button',sc_wrapper).bind('click',function(event){
|
$('.agree_button, .disagree_button',sc_wrapper).bind('click',function(event){
|
||||||
|
|
||||||
var sselcont_id = $(this).closest('.basket_element').attr('id').split('_').pop();
|
var sselcont_id = $(this).closest('.basket_element').attr('id').split('_').pop();
|
||||||
|
|
||||||
var agreement = $(this).hasClass('agree_button') ? '1' : '-1';
|
var agreement = $(this).hasClass('agree_button') ? '1' : '-1';
|
||||||
|
|
||||||
set_agreement(event, $(this), sselcont_id, agreement);
|
set_agreement(event, $(this), sselcont_id, agreement);
|
||||||
@@ -297,18 +295,18 @@ function display_basket()
|
|||||||
$('.previewTips').tooltip();
|
$('.previewTips').tooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function display_basket_element(compare, sselcont_id)
|
function display_basket_element(compare, sselcont_id)
|
||||||
{
|
{
|
||||||
@@ -322,15 +320,15 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
container = $('#record_main');
|
container = $('#record_main');
|
||||||
}
|
}
|
||||||
$('.record_image', container).draggable();
|
$('.record_image', container).draggable();
|
||||||
|
|
||||||
var options_container = $('.options',container);
|
var options_container = $('.options',container);
|
||||||
|
|
||||||
$('.download_button', options_container).button({
|
$('.download_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
}).bind('click',function(){
|
}).bind('click',function(){
|
||||||
download($(this).next('form[name=download_form]').find('input').val());
|
download($(this).next('form[name=download_form]').find('input').val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.comment_button', options_container).button({
|
$('.comment_button', options_container).button({
|
||||||
text : true
|
text : true
|
||||||
}).bind('click',function()
|
}).bind('click',function()
|
||||||
@@ -345,7 +343,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
activate_notes(container);
|
activate_notes(container);
|
||||||
|
|
||||||
$('.previous_button', options_container).button({
|
$('.previous_button', options_container).button({
|
||||||
@@ -353,19 +351,19 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}).bind('click',function(){
|
}).bind('click',function(){
|
||||||
get_prev();
|
get_prev();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.play_button', options_container).button({
|
$('.play_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
}).bind('click',function(){
|
}).bind('click',function(){
|
||||||
slideshow(true);
|
slideshow(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pause_button', options_container).button({
|
$('.pause_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
}).bind('click',function(){
|
}).bind('click',function(){
|
||||||
slideshow(false);
|
slideshow(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
if($(document).data('slideshow'))
|
if($(document).data('slideshow'))
|
||||||
{
|
{
|
||||||
$('.play_button, .next_button.play, .previous_button.play', options_container).hide();
|
$('.play_button, .next_button.play, .previous_button.play', options_container).hide();
|
||||||
@@ -374,17 +372,17 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
{
|
{
|
||||||
$('.pause_button, .next_button.pause, .previous_button.pause', options_container).hide();
|
$('.pause_button, .next_button.pause, .previous_button.pause', options_container).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.next_button', options_container).button({
|
$('.next_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
}).bind('click',function(){
|
}).bind('click',function(){
|
||||||
get_next();
|
get_next();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.container', container).bind('dblclick',function(event){
|
$('.container', container).bind('dblclick',function(event){
|
||||||
display_record();
|
display_record();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#record_wrapper .agree_'+sselcont_id+', .big_box.agree')
|
$('#record_wrapper .agree_'+sselcont_id+', .big_box.agree')
|
||||||
.bind('click',
|
.bind('click',
|
||||||
function(event)
|
function(event)
|
||||||
@@ -393,7 +391,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.addClass('clickable');
|
.addClass('clickable');
|
||||||
|
|
||||||
$('#record_wrapper .disagree_'+sselcont_id+', .big_box.disagree')
|
$('#record_wrapper .disagree_'+sselcont_id+', .big_box.disagree')
|
||||||
.bind('click',
|
.bind('click',
|
||||||
function(event)
|
function(event)
|
||||||
@@ -402,7 +400,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.addClass('clickable');
|
.addClass('clickable');
|
||||||
|
|
||||||
if(compare == $('#record_wrapper').hasClass('single'))
|
if(compare == $('#record_wrapper').hasClass('single'))
|
||||||
{
|
{
|
||||||
if(compare)
|
if(compare)
|
||||||
@@ -420,13 +418,13 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
$('#record_infos, #right_column').show();
|
$('#record_infos, #right_column').show();
|
||||||
$('#record_compare .container').empty();
|
$('#record_compare .container').empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
display_record(compare);
|
display_record(compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -469,15 +467,15 @@ function activate_notes(container)
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function download(value)
|
function download(value)
|
||||||
{
|
{
|
||||||
var dialog_box = $('#dialog_dwnl');
|
var dialog_box = $('#dialog_dwnl');
|
||||||
|
|
||||||
dialog_box = $('#dialog_dwnl');
|
dialog_box = $('#dialog_dwnl');
|
||||||
|
|
||||||
dialog_box.empty().addClass('loading').dialog({
|
dialog_box.empty().addClass('loading').dialog({
|
||||||
width:800,
|
width:800,
|
||||||
@@ -491,38 +489,38 @@ function download(value)
|
|||||||
},
|
},
|
||||||
beforeclose:function(){
|
beforeclose:function(){
|
||||||
tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message');
|
tinyMCE.execCommand('mceRemoveControl',true,'sendmail_message');
|
||||||
tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
|
tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
|
||||||
}
|
}
|
||||||
}).dialog('open');
|
}).dialog('open');
|
||||||
|
|
||||||
$.post("/include/multiexports.php", "lst="+value, function(data) {
|
$.post("/include/multiexports.php", "lst="+value, function(data) {
|
||||||
|
|
||||||
dialog_box.removeClass('loading').empty().append(data);
|
dialog_box.removeClass('loading').empty().append(data);
|
||||||
$('.tabs', dialog_box).tabs();
|
$('.tabs', dialog_box).tabs();
|
||||||
tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
|
tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
|
||||||
tinyMCE.execCommand('mceAddControl',true,'order_usage');
|
tinyMCE.execCommand('mceAddControl',true,'order_usage');
|
||||||
|
|
||||||
$('.close_button', dialog_box).bind('click',function(){
|
$('.close_button', dialog_box).bind('click',function(){
|
||||||
dialog_box.dialog('close').dialog('destroy');
|
dialog_box.dialog('close').dialog('destroy');
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function display_record(compare)
|
function display_record(compare)
|
||||||
{
|
{
|
||||||
var main_container = $('#record_wrapper');
|
var main_container = $('#record_wrapper');
|
||||||
|
|
||||||
main_container.width($('#innerWrapper').innerWidth() - $('#right_column').outerWidth() - 2);
|
main_container.width($('#innerWrapper').innerWidth() - $('#right_column').outerWidth() - 2);
|
||||||
|
|
||||||
if(typeof compare == 'undefined')
|
if(typeof compare == 'undefined')
|
||||||
compare = !main_container.hasClass('single');
|
compare = !main_container.hasClass('single');
|
||||||
|
|
||||||
var main_box = $('#record_main');
|
var main_box = $('#record_main');
|
||||||
var compare_box = $('#record_compare');
|
var compare_box = $('#record_compare');
|
||||||
|
|
||||||
var main_record = $('.container .record', main_box);
|
var main_record = $('.container .record', main_box);
|
||||||
var compare_record = $('.container .record', compare_box);
|
var compare_record = $('.container .record', compare_box);
|
||||||
|
|
||||||
@@ -530,7 +528,7 @@ function display_record(compare)
|
|||||||
var main_record_height = parseInt($('input[name=height]', main_box).val());
|
var main_record_height = parseInt($('input[name=height]', main_box).val());
|
||||||
var compare_record_width = parseInt($('input[name=width]', compare_box).val());
|
var compare_record_width = parseInt($('input[name=width]', compare_box).val());
|
||||||
var compare_record_height = parseInt($('input[name=height]', compare_box).val());
|
var compare_record_height = parseInt($('input[name=height]', compare_box).val());
|
||||||
|
|
||||||
var main_container_width = main_container.width();
|
var main_container_width = main_container.width();
|
||||||
var main_container_innerwidth = main_container.innerWidth();
|
var main_container_innerwidth = main_container.innerWidth();
|
||||||
var main_container_height = main_container.height();
|
var main_container_height = main_container.height();
|
||||||
@@ -541,31 +539,31 @@ function display_record(compare)
|
|||||||
{
|
{
|
||||||
$('.agreement_selector').show();
|
$('.agreement_selector').show();
|
||||||
main_container.addClass('comparison');
|
main_container.addClass('comparison');
|
||||||
|
|
||||||
var double_portrait_width = main_container_innerwidth / 2;
|
var double_portrait_width = main_container_innerwidth / 2;
|
||||||
var double_portrait_height = main_container_innerheight - $('.header', main_box).outerHeight();
|
var double_portrait_height = main_container_innerheight - $('.header', main_box).outerHeight();
|
||||||
|
|
||||||
var double_paysage_width = main_container_innerwidth;
|
var double_paysage_width = main_container_innerwidth;
|
||||||
var double_paysage_height = main_container_innerheight / 2 - $('.header', main_box).outerHeight();
|
var double_paysage_height = main_container_innerheight / 2 - $('.header', main_box).outerHeight();
|
||||||
|
|
||||||
var main_display_portrait = calculate_display(
|
var main_display_portrait = calculate_display(
|
||||||
double_portrait_width, double_portrait_height,
|
double_portrait_width, double_portrait_height,
|
||||||
main_record_width, main_record_height
|
main_record_width, main_record_height
|
||||||
);
|
);
|
||||||
var main_display_paysage = calculate_display(
|
var main_display_paysage = calculate_display(
|
||||||
double_paysage_width, double_paysage_height,
|
double_paysage_width, double_paysage_height,
|
||||||
main_record_width, main_record_height
|
main_record_width, main_record_height
|
||||||
);
|
);
|
||||||
|
|
||||||
var compare_display_portrait = calculate_display(
|
var compare_display_portrait = calculate_display(
|
||||||
double_portrait_width, double_portrait_height,
|
double_portrait_width, double_portrait_height,
|
||||||
compare_record_width, compare_record_height
|
compare_record_width, compare_record_height
|
||||||
);
|
);
|
||||||
var compare_display_paysage = calculate_display(
|
var compare_display_paysage = calculate_display(
|
||||||
double_paysage_width, double_paysage_height,
|
double_paysage_width, double_paysage_height,
|
||||||
compare_record_width, compare_record_height
|
compare_record_width, compare_record_height
|
||||||
);
|
);
|
||||||
|
|
||||||
var surface_main_portrait = main_display_portrait.width * main_display_portrait.height;
|
var surface_main_portrait = main_display_portrait.width * main_display_portrait.height;
|
||||||
var surface_main_paysage = main_display_paysage.width * main_display_paysage.height;
|
var surface_main_paysage = main_display_paysage.width * main_display_paysage.height;
|
||||||
var surface_compare_portrait = compare_display_portrait.width * compare_display_portrait.height;
|
var surface_compare_portrait = compare_display_portrait.width * compare_display_portrait.height;
|
||||||
@@ -575,15 +573,15 @@ function display_record(compare)
|
|||||||
var double_paysage_surface = (surface_main_paysage + surface_compare_paysage) / 2;
|
var double_paysage_surface = (surface_main_paysage + surface_compare_paysage) / 2;
|
||||||
|
|
||||||
var smooth_image = false;
|
var smooth_image = false;
|
||||||
|
|
||||||
var m_width_image, m_height_image, c_width_image, c_height_image, dim_container;
|
var m_width_image, m_height_image, c_width_image, c_height_image, dim_container;
|
||||||
|
|
||||||
if(double_portrait_surface > double_paysage_surface)
|
if(double_portrait_surface > double_paysage_surface)
|
||||||
{
|
{
|
||||||
if(!main_container.hasClass('portrait'))
|
if(!main_container.hasClass('portrait'))
|
||||||
{
|
{
|
||||||
smooth_image = true;
|
smooth_image = true;
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
main_box,
|
main_box,
|
||||||
parseInt($('#innerWrapper').width() / 2 - 13),
|
parseInt($('#innerWrapper').width() / 2 - 13),
|
||||||
@@ -595,7 +593,7 @@ function display_record(compare)
|
|||||||
);
|
);
|
||||||
|
|
||||||
compare_box.css('visibility','hidden');
|
compare_box.css('visibility','hidden');
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
compare_box,
|
compare_box,
|
||||||
parseInt($('#innerWrapper').width() / 2 - 13),
|
parseInt($('#innerWrapper').width() / 2 - 13),
|
||||||
@@ -618,7 +616,7 @@ function display_record(compare)
|
|||||||
if(!main_container.hasClass('paysage'))
|
if(!main_container.hasClass('paysage'))
|
||||||
{
|
{
|
||||||
smooth_image = true;
|
smooth_image = true;
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
main_box,
|
main_box,
|
||||||
$('#innerWrapper').width(),
|
$('#innerWrapper').width(),
|
||||||
@@ -628,9 +626,9 @@ function display_record(compare)
|
|||||||
set_container_status('paysage');
|
set_container_status('paysage');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
compare_box.css('visibility','hidden');
|
compare_box.css('visibility','hidden');
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
compare_box,
|
compare_box,
|
||||||
$('#innerWrapper').width(),
|
$('#innerWrapper').width(),
|
||||||
@@ -657,7 +655,7 @@ function display_record(compare)
|
|||||||
{
|
{
|
||||||
$('.agreement_selector').hide();
|
$('.agreement_selector').hide();
|
||||||
main_container.removeClass('comparison');
|
main_container.removeClass('comparison');
|
||||||
|
|
||||||
if(compare_box.is(':visible'))
|
if(compare_box.is(':visible'))
|
||||||
{
|
{
|
||||||
compare_box.hide().css('visibility','hidden').css('display','block');
|
compare_box.hide().css('visibility','hidden').css('display','block');
|
||||||
@@ -669,15 +667,15 @@ function display_record(compare)
|
|||||||
, main_record_width
|
, main_record_width
|
||||||
, main_record_height
|
, main_record_height
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!main_container.hasClass('single'))
|
if(!main_container.hasClass('single'))
|
||||||
{
|
{
|
||||||
main_box.width('100%')
|
main_box.width('100%')
|
||||||
.height('100%');
|
.height('100%');
|
||||||
|
|
||||||
set_container_status('single');
|
set_container_status('single');
|
||||||
}
|
}
|
||||||
|
|
||||||
set_image_position(
|
set_image_position(
|
||||||
smooth_image
|
smooth_image
|
||||||
, main_record
|
, main_record
|
||||||
@@ -697,9 +695,9 @@ function set_agreement(event, el, sselcont_id, boolean_value)
|
|||||||
if(event.stopPropagation)
|
if(event.stopPropagation)
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
|
|
||||||
var id =
|
var id =
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/lightbox/ajax/SET_ELEMENT_AGREEMENT/"+sselcont_id+"/",
|
url: "/lightbox/ajax/SET_ELEMENT_AGREEMENT/"+sselcont_id+"/",
|
||||||
@@ -708,23 +706,30 @@ function set_agreement(event, el, sselcont_id, boolean_value)
|
|||||||
agreement : boolean_value
|
agreement : boolean_value
|
||||||
},
|
},
|
||||||
success: function(datas){
|
success: function(datas){
|
||||||
if(boolean_value == '1')
|
if(!datas.error)
|
||||||
{
|
|
||||||
$('.agree_'+sselcont_id+'').removeClass('not_decided');
|
|
||||||
$('.disagree_'+sselcont_id+'').addClass('not_decided');
|
|
||||||
$('.userchoice.me').addClass('agree').removeClass('disagree');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('.agree_'+sselcont_id+'').addClass('not_decided');
|
|
||||||
$('.disagree_'+sselcont_id+'').removeClass('not_decided');
|
|
||||||
$('.userchoice.me').addClass('disagree').removeClass('agree');
|
|
||||||
}
|
|
||||||
p4.releasable = datas.releasable;
|
|
||||||
if(datas.releasable !== false)
|
|
||||||
{
|
{
|
||||||
if(confirm(datas.releasable))
|
if(boolean_value == '1')
|
||||||
$('#basket_options .confirm_report').trigger('click');
|
{
|
||||||
|
$('.agree_'+sselcont_id+'').removeClass('not_decided');
|
||||||
|
$('.disagree_'+sselcont_id+'').addClass('not_decided');
|
||||||
|
$('.userchoice.me').addClass('agree').removeClass('disagree');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('.agree_'+sselcont_id+'').addClass('not_decided');
|
||||||
|
$('.disagree_'+sselcont_id+'').removeClass('not_decided');
|
||||||
|
$('.userchoice.me').addClass('disagree').removeClass('agree');
|
||||||
|
}
|
||||||
|
p4.releasable = datas.releasable;
|
||||||
|
if(datas.releasable !== false)
|
||||||
|
{
|
||||||
|
if(confirm(datas.releasable))
|
||||||
|
$('#basket_options .confirm_report').trigger('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
alert(datas.datas);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -739,15 +744,15 @@ function get_next()
|
|||||||
|
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
current_wrapper = current_wrapper.next();
|
current_wrapper = current_wrapper.next();
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
current_wrapper = $('#sc_container .basket_element_wrapper:first');
|
current_wrapper = $('#sc_container .basket_element_wrapper:first');
|
||||||
|
|
||||||
$('.basket_element', current_wrapper).trigger('click');
|
$('.basket_element', current_wrapper).trigger('click');
|
||||||
|
|
||||||
adjust_visibility($('.basket_element', current_wrapper));
|
adjust_visibility($('.basket_element', current_wrapper));
|
||||||
|
|
||||||
if($(document).data('slideshow'))
|
if($(document).data('slideshow'))
|
||||||
{
|
{
|
||||||
var timer = setTimeout('get_next();', 3500);
|
var timer = setTimeout('get_next();', 3500);
|
||||||
@@ -761,13 +766,13 @@ function get_prev()
|
|||||||
|
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
slideshow(false);
|
slideshow(false);
|
||||||
|
|
||||||
current_wrapper = current_wrapper.prev();
|
current_wrapper = current_wrapper.prev();
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
current_wrapper = $('#sc_container .basket_element_wrapper:last');
|
current_wrapper = $('#sc_container .basket_element_wrapper:last');
|
||||||
|
|
||||||
$('.basket_element', current_wrapper).trigger('click');
|
$('.basket_element', current_wrapper).trigger('click');
|
||||||
|
|
||||||
adjust_visibility($('.basket_element', current_wrapper));
|
adjust_visibility($('.basket_element', current_wrapper));
|
||||||
@@ -776,16 +781,16 @@ function is_viewable(el)
|
|||||||
{
|
{
|
||||||
var sc_wrapper = $('#sc_wrapper');
|
var sc_wrapper = $('#sc_wrapper');
|
||||||
var sc_container = $('#sc_container');
|
var sc_container = $('#sc_container');
|
||||||
|
|
||||||
var el_width = $(el).parent().outerWidth();
|
var el_width = $(el).parent().outerWidth();
|
||||||
var el_position = $(el).parent().position();
|
var el_position = $(el).parent().position();
|
||||||
var sc_scroll_left = sc_wrapper.scrollLeft();
|
var sc_scroll_left = sc_wrapper.scrollLeft();
|
||||||
|
|
||||||
var boundup = sc_wrapper.width(),
|
var boundup = sc_wrapper.width(),
|
||||||
bounddown = 0,
|
bounddown = 0,
|
||||||
placeup = el_position.left + el_width - sc_scroll_left,
|
placeup = el_position.left + el_width - sc_scroll_left,
|
||||||
placedown = el_position.left - sc_scroll_left;
|
placedown = el_position.left - sc_scroll_left;
|
||||||
|
|
||||||
if(placeup <= boundup && placedown >= bounddown)
|
if(placeup <= boundup && placedown >= bounddown)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -795,12 +800,12 @@ function adjust_visibility(el)
|
|||||||
{
|
{
|
||||||
if(is_viewable(el))
|
if(is_viewable(el))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sc_wrapper = $('#sc_wrapper');
|
var sc_wrapper = $('#sc_wrapper');
|
||||||
var el_parent = $(el).parent();
|
var el_parent = $(el).parent();
|
||||||
|
|
||||||
var sc_left = el_parent.position().left + el_parent.outerWidth() / 2 - sc_wrapper.width() / 2;
|
var sc_left = el_parent.position().left + el_parent.outerWidth() / 2 - sc_wrapper.width() / 2;
|
||||||
|
|
||||||
sc_wrapper.stop().animate({'scrollLeft':sc_left});
|
sc_wrapper.stop().animate({'scrollLeft':sc_left});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,17 +814,17 @@ function slideshow(boolean_value)
|
|||||||
{
|
{
|
||||||
if(boolean_value == $(document).data('slideshow'))
|
if(boolean_value == $(document).data('slideshow'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!boolean_value && $(document).data('slideshow_ctime'))
|
if(!boolean_value && $(document).data('slideshow_ctime'))
|
||||||
{
|
{
|
||||||
clearTimeout($(document).data('slideshow_ctime'));
|
clearTimeout($(document).data('slideshow_ctime'));
|
||||||
$(document).data('slideshow_ctime', false);
|
$(document).data('slideshow_ctime', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).data('slideshow', boolean_value);
|
$(document).data('slideshow', boolean_value);
|
||||||
|
|
||||||
var headers = $('#record_wrapper .header');
|
var headers = $('#record_wrapper .header');
|
||||||
|
|
||||||
if(boolean_value)
|
if(boolean_value)
|
||||||
{
|
{
|
||||||
$('.play_button, .next_button.play, .previous_button.play').hide();
|
$('.play_button, .next_button.play, .previous_button.play').hide();
|
||||||
@@ -838,7 +843,7 @@ function smooth_transform(box, width, height, callback)
|
|||||||
{
|
{
|
||||||
if(typeof callback == 'undefined')
|
if(typeof callback == 'undefined')
|
||||||
callback = function(){};
|
callback = function(){};
|
||||||
|
|
||||||
$(box).stop()
|
$(box).stop()
|
||||||
.css(
|
.css(
|
||||||
{
|
{
|
||||||
@@ -856,7 +861,7 @@ function save_note(container, button)
|
|||||||
{
|
{
|
||||||
var sselcont_id = $(button).attr('id').split('_').pop();
|
var sselcont_id = $(button).attr('id').split('_').pop();
|
||||||
var note = $('.notes_wrapper textarea', container).val();
|
var note = $('.notes_wrapper textarea', container).val();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/lightbox/ajax/SET_NOTE/"+sselcont_id+"/",
|
url: "/lightbox/ajax/SET_NOTE/"+sselcont_id+"/",
|
||||||
@@ -872,7 +877,7 @@ function save_note(container, button)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
function calculate_display(display_width, display_height, width, height, margin)
|
function calculate_display(display_width, display_height, width, height, margin)
|
||||||
{
|
{
|
||||||
@@ -905,12 +910,12 @@ function calculate_display(display_width, display_height, width, height, margin)
|
|||||||
function set_image_position(smooth, image, width, height, container, callback)
|
function set_image_position(smooth, image, width, height, container, callback)
|
||||||
{
|
{
|
||||||
var dimensions = {};
|
var dimensions = {};
|
||||||
|
|
||||||
if(typeof container !== 'undefined')
|
if(typeof container !== 'undefined')
|
||||||
{
|
{
|
||||||
var c_width = container.width;
|
var c_width = container.width;
|
||||||
var c_height = container.height;
|
var c_height = container.height;
|
||||||
|
|
||||||
dimensions.top = parseInt((c_height - height) / 2);
|
dimensions.top = parseInt((c_height - height) / 2);
|
||||||
dimensions.left = parseInt((c_width - width) / 2);
|
dimensions.left = parseInt((c_width - width) / 2);
|
||||||
}
|
}
|
||||||
@@ -918,7 +923,7 @@ function set_image_position(smooth, image, width, height, container, callback)
|
|||||||
{
|
{
|
||||||
callback = function(){};
|
callback = function(){};
|
||||||
}
|
}
|
||||||
|
|
||||||
dimensions.width = parseInt(width);
|
dimensions.width = parseInt(width);
|
||||||
dimensions.height = parseInt(height);
|
dimensions.height = parseInt(height);
|
||||||
// if(smooth)
|
// if(smooth)
|
||||||
@@ -936,7 +941,7 @@ function set_image_position(smooth, image, width, height, container, callback)
|
|||||||
function scid_click(event, el)
|
function scid_click(event, el)
|
||||||
{
|
{
|
||||||
var compare = is_ctrl_key(event);
|
var compare = is_ctrl_key(event);
|
||||||
|
|
||||||
if(compare)
|
if(compare)
|
||||||
{
|
{
|
||||||
if($('.basket_element', el).hasClass('selected'))
|
if($('.basket_element', el).hasClass('selected'))
|
||||||
@@ -947,18 +952,18 @@ function scid_click(event, el)
|
|||||||
$('#sc_container .basket_element.selected').removeClass('selected');
|
$('#sc_container .basket_element.selected').removeClass('selected');
|
||||||
$('.basket_element', el).addClass('selected');
|
$('.basket_element', el).addClass('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
|
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
|
||||||
var ssel_id = $('#navigation').val();
|
var ssel_id = $('#navigation').val();
|
||||||
|
|
||||||
var container = $('#sc_container');
|
var container = $('#sc_container');
|
||||||
|
|
||||||
var request = container.data('request');
|
var request = container.data('request');
|
||||||
if(request && typeof(request.abort) == 'function')
|
if(request && typeof(request.abort) == 'function')
|
||||||
{
|
{
|
||||||
request.abort();
|
request.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
request = $.ajax({
|
request = $.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: $(el).attr('href'),//"/lightbox/ajax/LOAD_BASKET_ELEMENT/"+sselcont_id+'/',
|
url: $(el).attr('href'),//"/lightbox/ajax/LOAD_BASKET_ELEMENT/"+sselcont_id+'/',
|
||||||
@@ -973,11 +978,11 @@ function scid_click(event, el)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
container = $('#record_main');
|
container = $('#record_main');
|
||||||
|
|
||||||
$('#record_infos .container')
|
$('#record_infos .container')
|
||||||
.empty()
|
.empty()
|
||||||
.append(data.caption);
|
.append(data.caption);
|
||||||
|
|
||||||
$('#basket_infos')
|
$('#basket_infos')
|
||||||
.empty()
|
.empty()
|
||||||
.append(data.agreement_html);
|
.append(data.agreement_html);
|
||||||
@@ -991,7 +996,7 @@ function scid_click(event, el)
|
|||||||
.empty()
|
.empty()
|
||||||
.append(data.title)
|
.append(data.title)
|
||||||
.attr('title', data.title);
|
.attr('title', data.title);
|
||||||
|
|
||||||
var options_container = $('.options',container);
|
var options_container = $('.options',container);
|
||||||
options_container
|
options_container
|
||||||
.empty()
|
.empty()
|
||||||
@@ -999,11 +1004,11 @@ function scid_click(event, el)
|
|||||||
|
|
||||||
$('.container', container).empty()
|
$('.container', container).empty()
|
||||||
.append(data.preview+data.selector_html+data.note_html);
|
.append(data.preview+data.selector_html+data.note_html);
|
||||||
|
|
||||||
|
|
||||||
display_basket_element(compare, sselcont_id);
|
display_basket_element(compare, sselcont_id);
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1034,7 +1039,7 @@ function is_ctrl_key(event)
|
|||||||
return true;
|
return true;
|
||||||
if(event.keyCode == '91') // apple key safari
|
if(event.keyCode == '91') // apple key safari
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1044,5 +1049,5 @@ function is_shift_key(event)
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3,18 +3,18 @@ var p4 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
$(this).data('slideshow',false);
|
$(this).data('slideshow',false);
|
||||||
$(this).data('slideshow_ctime', false);
|
$(this).data('slideshow_ctime', false);
|
||||||
|
|
||||||
$('#mainMenu, .unselectable').disableSelection();
|
$('#mainMenu, .unselectable').disableSelection();
|
||||||
|
|
||||||
display_basket();
|
display_basket();
|
||||||
|
|
||||||
$(window).bind('mousedown', function(){
|
$(window).bind('mousedown', function(){
|
||||||
$(this).focus();
|
$(this).focus();
|
||||||
}).trigger('mousedown');
|
}).trigger('mousedown');
|
||||||
|
|
||||||
$('.basket_wrapper').hover(
|
$('.basket_wrapper').hover(
|
||||||
function(){
|
function(){
|
||||||
$(this).addClass('hover');
|
$(this).addClass('hover');
|
||||||
@@ -58,10 +58,10 @@ $(document).ready(function(){
|
|||||||
{
|
{
|
||||||
display_basket_element(false, sselcont.attr('id').split('_').pop());
|
display_basket_element(false, sselcont.attr('id').split('_').pop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
set_sizeable($('#record_main .container, #record_compare .container'));
|
set_sizeable($('#record_main .container, #record_compare .container'));
|
||||||
|
|
||||||
$('#navigation')
|
$('#navigation')
|
||||||
.bind('change',
|
.bind('change',
|
||||||
function()
|
function()
|
||||||
@@ -69,7 +69,7 @@ $(document).ready(function(){
|
|||||||
window.location.replace(window.location.protocol+"//"+window.location.host+'/lightbox/validate/'+$(this).val()+'/');
|
window.location.replace(window.location.protocol+"//"+window.location.host+'/lightbox/validate/'+$(this).val()+'/');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$('#left_scroller')
|
$('#left_scroller')
|
||||||
.bind('click',
|
.bind('click',
|
||||||
function()
|
function()
|
||||||
@@ -77,14 +77,14 @@ $(document).ready(function(){
|
|||||||
scroll_elements(false);
|
scroll_elements(false);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$('#right_scroller')
|
$('#right_scroller')
|
||||||
.bind('click', function()
|
.bind('click', function()
|
||||||
{
|
{
|
||||||
scroll_elements(true);
|
scroll_elements(true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window)
|
$(window)
|
||||||
.bind('resize',function()
|
.bind('resize',function()
|
||||||
{
|
{
|
||||||
@@ -107,16 +107,16 @@ $(window).bind('beforeunload', function(){
|
|||||||
function bind_keyboard()
|
function bind_keyboard()
|
||||||
{
|
{
|
||||||
$(document).bind('keydown', function(event){
|
$(document).bind('keydown', function(event){
|
||||||
|
|
||||||
var stop = false;
|
var stop = false;
|
||||||
$('.notes_wrapper').each(function(i,n){
|
$('.notes_wrapper').each(function(i,n){
|
||||||
if(parseInt($(n).css('top')) >= 0)
|
if(parseInt($(n).css('top')) >= 0)
|
||||||
stop = true;
|
stop = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if(stop)
|
if(stop)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var cancelKey = false;
|
var cancelKey = false;
|
||||||
var el, id;
|
var el, id;
|
||||||
switch(event.keyCode)
|
switch(event.keyCode)
|
||||||
@@ -178,7 +178,7 @@ function is_ctrl_key(event)
|
|||||||
return true;
|
return true;
|
||||||
if(event.keyCode == '91') // apple key safari
|
if(event.keyCode == '91') // apple key safari
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,13 +217,11 @@ function set_release(el)
|
|||||||
$('.loader', el).css({
|
$('.loader', el).css({
|
||||||
visibility:'hidden'
|
visibility:'hidden'
|
||||||
});
|
});
|
||||||
if(data.error)
|
if(data.datas)
|
||||||
{
|
{
|
||||||
|
alert(data.datas);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
alert(data.datas);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -246,7 +244,7 @@ function load_report()
|
|||||||
resizable:false,
|
resizable:false,
|
||||||
height : Math.round($(window).height() * 0.8)
|
height : Math.round($(window).height() * 0.8)
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -272,17 +270,17 @@ function display_basket()
|
|||||||
.bind('click',function(){
|
.bind('click',function(){
|
||||||
set_release($(this));
|
set_release($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.basket_element',sc_wrapper).parent()
|
$('.basket_element',sc_wrapper).parent()
|
||||||
.bind('click',function(event){
|
.bind('click',function(event){
|
||||||
scid_click(event, this);
|
scid_click(event, this);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.agree_button, .disagree_button',sc_wrapper).bind('click',function(event){
|
$('.agree_button, .disagree_button',sc_wrapper).bind('click',function(event){
|
||||||
|
|
||||||
var sselcont_id = $(this).closest('.basket_element').attr('id').split('_').pop();
|
var sselcont_id = $(this).closest('.basket_element').attr('id').split('_').pop();
|
||||||
|
|
||||||
var agreement = $(this).hasClass('agree_button') ? '1' : '-1';
|
var agreement = $(this).hasClass('agree_button') ? '1' : '-1';
|
||||||
|
|
||||||
set_agreement(event, $(this), sselcont_id, agreement);
|
set_agreement(event, $(this), sselcont_id, agreement);
|
||||||
@@ -299,7 +297,7 @@ function display_basket()
|
|||||||
function scid_click(event, el)
|
function scid_click(event, el)
|
||||||
{
|
{
|
||||||
var compare = is_ctrl_key(event);
|
var compare = is_ctrl_key(event);
|
||||||
|
|
||||||
if(compare)
|
if(compare)
|
||||||
{
|
{
|
||||||
if($('.basket_element', el).hasClass('selected'))
|
if($('.basket_element', el).hasClass('selected'))
|
||||||
@@ -310,18 +308,18 @@ function scid_click(event, el)
|
|||||||
$('#sc_container .basket_element.selected').removeClass('selected');
|
$('#sc_container .basket_element.selected').removeClass('selected');
|
||||||
$('.basket_element', el).addClass('selected');
|
$('.basket_element', el).addClass('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
|
var sselcont_id = $('.basket_element', el).attr('id').split('_').pop();
|
||||||
var ssel_id = $('#navigation').val();
|
var ssel_id = $('#navigation').val();
|
||||||
|
|
||||||
var container = $('#sc_container');
|
var container = $('#sc_container');
|
||||||
|
|
||||||
var request = container.data('request');
|
var request = container.data('request');
|
||||||
if(request && typeof(request.abort) == 'function')
|
if(request && typeof(request.abort) == 'function')
|
||||||
{
|
{
|
||||||
request.abort();
|
request.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
request = $.ajax({
|
request = $.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: $(el).attr('href'),//"/lightbox/ajax/LOAD_BASKET_ELEMENT/"+sselcont_id+'/',
|
url: $(el).attr('href'),//"/lightbox/ajax/LOAD_BASKET_ELEMENT/"+sselcont_id+'/',
|
||||||
@@ -329,7 +327,7 @@ function scid_click(event, el)
|
|||||||
success: function(datas){
|
success: function(datas){
|
||||||
var container = false;
|
var container = false;
|
||||||
var data = datas;
|
var data = datas;
|
||||||
|
|
||||||
if(compare)
|
if(compare)
|
||||||
{
|
{
|
||||||
container = $('#record_compare');
|
container = $('#record_compare');
|
||||||
@@ -337,11 +335,11 @@ function scid_click(event, el)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
container = $('#record_main');
|
container = $('#record_main');
|
||||||
|
|
||||||
$('#record_infos .container')
|
$('#record_infos .container')
|
||||||
.empty()
|
.empty()
|
||||||
.append(data.caption);
|
.append(data.caption);
|
||||||
|
|
||||||
$('#basket_infos')
|
$('#basket_infos')
|
||||||
.empty()
|
.empty()
|
||||||
.append(data.agreement_html);
|
.append(data.agreement_html);
|
||||||
@@ -355,7 +353,7 @@ function scid_click(event, el)
|
|||||||
.empty()
|
.empty()
|
||||||
.append(data.title)
|
.append(data.title)
|
||||||
.attr('title', data.title);
|
.attr('title', data.title);
|
||||||
|
|
||||||
var options_container = $('.options',container);
|
var options_container = $('.options',container);
|
||||||
options_container
|
options_container
|
||||||
.empty()
|
.empty()
|
||||||
@@ -363,11 +361,11 @@ function scid_click(event, el)
|
|||||||
|
|
||||||
$('.container', container).empty()
|
$('.container', container).empty()
|
||||||
.append(data.preview+data.selector_html+data.note_html);
|
.append(data.preview+data.selector_html+data.note_html);
|
||||||
|
|
||||||
|
|
||||||
display_basket_element(compare, sselcont_id);
|
display_basket_element(compare, sselcont_id);
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -378,7 +376,7 @@ function save_note(container, button)
|
|||||||
{
|
{
|
||||||
var sselcont_id = $(button).attr('id').split('_').pop();
|
var sselcont_id = $(button).attr('id').split('_').pop();
|
||||||
var note = $('.notes_wrapper textarea', container).val();
|
var note = $('.notes_wrapper textarea', container).val();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/lightbox/ajax/SET_NOTE/"+sselcont_id+"/",
|
url: "/lightbox/ajax/SET_NOTE/"+sselcont_id+"/",
|
||||||
@@ -394,7 +392,7 @@ function save_note(container, button)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_basket_element(compare, sselcont_id)
|
function display_basket_element(compare, sselcont_id)
|
||||||
@@ -409,9 +407,9 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
container = $('#record_main');
|
container = $('#record_main');
|
||||||
}
|
}
|
||||||
$('.record_image', container).draggable();
|
$('.record_image', container).draggable();
|
||||||
|
|
||||||
var options_container = $('.options',container);
|
var options_container = $('.options',container);
|
||||||
|
|
||||||
$('.download_button', options_container).button({
|
$('.download_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
// ,
|
// ,
|
||||||
@@ -422,7 +420,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
// $(this).blur();
|
// $(this).blur();
|
||||||
download($(this).next('form[name=download_form]').find('input').val());
|
download($(this).next('form[name=download_form]').find('input').val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.comment_button', options_container).button({
|
$('.comment_button', options_container).button({
|
||||||
text : true
|
text : true
|
||||||
// ,
|
// ,
|
||||||
@@ -442,7 +440,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
activate_notes(container);
|
activate_notes(container);
|
||||||
|
|
||||||
$('.previous_button', options_container).button({
|
$('.previous_button', options_container).button({
|
||||||
@@ -455,7 +453,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
// $(this).blur();
|
// $(this).blur();
|
||||||
get_prev();
|
get_prev();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.play_button', options_container).button({
|
$('.play_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
// ,
|
// ,
|
||||||
@@ -466,7 +464,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
// $(this).blur();
|
// $(this).blur();
|
||||||
slideshow(true);
|
slideshow(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pause_button', options_container).button({
|
$('.pause_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
// ,
|
// ,
|
||||||
@@ -486,7 +484,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
{
|
{
|
||||||
$('.pause_button, .next_button.pause, .previous_button.pause', options_container).hide();
|
$('.pause_button, .next_button.pause, .previous_button.pause', options_container).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.next_button', options_container).button({
|
$('.next_button', options_container).button({
|
||||||
text : false
|
text : false
|
||||||
// ,
|
// ,
|
||||||
@@ -498,13 +496,13 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
slideshow(false);
|
slideshow(false);
|
||||||
get_next();
|
get_next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('.container', container).bind('dblclick',function(event){
|
$('.container', container).bind('dblclick',function(event){
|
||||||
display_record();
|
display_record();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#record_wrapper .agree_'+sselcont_id+', .big_box.agree')
|
$('#record_wrapper .agree_'+sselcont_id+', .big_box.agree')
|
||||||
.bind('click',
|
.bind('click',
|
||||||
function(event)
|
function(event)
|
||||||
@@ -513,7 +511,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.addClass('clickable');
|
.addClass('clickable');
|
||||||
|
|
||||||
$('#record_wrapper .disagree_'+sselcont_id+', .big_box.disagree')
|
$('#record_wrapper .disagree_'+sselcont_id+', .big_box.disagree')
|
||||||
.bind('click',
|
.bind('click',
|
||||||
function(event)
|
function(event)
|
||||||
@@ -522,7 +520,7 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.addClass('clickable');
|
.addClass('clickable');
|
||||||
|
|
||||||
if(compare == $('#record_wrapper').hasClass('single'))
|
if(compare == $('#record_wrapper').hasClass('single'))
|
||||||
{
|
{
|
||||||
if(compare)
|
if(compare)
|
||||||
@@ -545,13 +543,13 @@ function display_basket_element(compare, sselcont_id)
|
|||||||
$('#right_column').show();
|
$('#right_column').show();
|
||||||
$('#record_compare .container').empty();
|
$('#record_compare .container').empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
display_record(compare);
|
display_record(compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_notes(container)
|
function show_notes(container)
|
||||||
@@ -597,16 +595,16 @@ function is_viewable(el)
|
|||||||
{
|
{
|
||||||
var sc_wrapper = $('#sc_wrapper');
|
var sc_wrapper = $('#sc_wrapper');
|
||||||
var sc_container = $('#sc_container');
|
var sc_container = $('#sc_container');
|
||||||
|
|
||||||
var el_width = $(el).parent().outerWidth();
|
var el_width = $(el).parent().outerWidth();
|
||||||
var el_position = $(el).parent().position();
|
var el_position = $(el).parent().position();
|
||||||
var sc_scroll_left = sc_wrapper.scrollLeft();
|
var sc_scroll_left = sc_wrapper.scrollLeft();
|
||||||
|
|
||||||
var boundup = sc_wrapper.width(),
|
var boundup = sc_wrapper.width(),
|
||||||
bounddown = 0,
|
bounddown = 0,
|
||||||
placeup = el_position.left + el_width - sc_scroll_left,
|
placeup = el_position.left + el_width - sc_scroll_left,
|
||||||
placedown = el_position.left - sc_scroll_left;
|
placedown = el_position.left - sc_scroll_left;
|
||||||
|
|
||||||
if(placeup <= boundup && placedown >= bounddown)
|
if(placeup <= boundup && placedown >= bounddown)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -616,12 +614,12 @@ function adjust_visibility(el)
|
|||||||
{
|
{
|
||||||
if(is_viewable(el))
|
if(is_viewable(el))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sc_wrapper = $('#sc_wrapper');
|
var sc_wrapper = $('#sc_wrapper');
|
||||||
var el_parent = $(el).parent();
|
var el_parent = $(el).parent();
|
||||||
|
|
||||||
var sc_left = el_parent.position().left + el_parent.outerWidth() / 2 - sc_wrapper.width() / 2;
|
var sc_left = el_parent.position().left + el_parent.outerWidth() / 2 - sc_wrapper.width() / 2;
|
||||||
|
|
||||||
sc_wrapper.stop().animate({
|
sc_wrapper.stop().animate({
|
||||||
'scrollLeft':sc_left
|
'scrollLeft':sc_left
|
||||||
});
|
});
|
||||||
@@ -633,15 +631,15 @@ function get_next()
|
|||||||
|
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
current_wrapper = current_wrapper.next();
|
current_wrapper = current_wrapper.next();
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
current_wrapper = $('#sc_container .basket_element_wrapper:first');
|
current_wrapper = $('#sc_container .basket_element_wrapper:first');
|
||||||
|
|
||||||
$('.basket_element', current_wrapper).parent().trigger('click');
|
$('.basket_element', current_wrapper).parent().trigger('click');
|
||||||
|
|
||||||
adjust_visibility($('.basket_element', current_wrapper));
|
adjust_visibility($('.basket_element', current_wrapper));
|
||||||
|
|
||||||
if($(document).data('slideshow'))
|
if($(document).data('slideshow'))
|
||||||
{
|
{
|
||||||
var timer = setTimeout('get_next();', 3500);
|
var timer = setTimeout('get_next();', 3500);
|
||||||
@@ -655,13 +653,13 @@ function get_prev()
|
|||||||
|
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
slideshow(false);
|
slideshow(false);
|
||||||
|
|
||||||
current_wrapper = current_wrapper.prev();
|
current_wrapper = current_wrapper.prev();
|
||||||
if(current_wrapper.length === 0)
|
if(current_wrapper.length === 0)
|
||||||
current_wrapper = $('#sc_container .basket_element_wrapper:last');
|
current_wrapper = $('#sc_container .basket_element_wrapper:last');
|
||||||
|
|
||||||
$('.basket_element', current_wrapper).parent().trigger('click');
|
$('.basket_element', current_wrapper).parent().trigger('click');
|
||||||
|
|
||||||
adjust_visibility($('.basket_element', current_wrapper));
|
adjust_visibility($('.basket_element', current_wrapper));
|
||||||
@@ -671,17 +669,17 @@ function slideshow(boolean_value)
|
|||||||
{
|
{
|
||||||
if(boolean_value == $(document).data('slideshow'))
|
if(boolean_value == $(document).data('slideshow'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!boolean_value && $(document).data('slideshow_ctime'))
|
if(!boolean_value && $(document).data('slideshow_ctime'))
|
||||||
{
|
{
|
||||||
clearTimeout($(document).data('slideshow_ctime'));
|
clearTimeout($(document).data('slideshow_ctime'));
|
||||||
$(document).data('slideshow_ctime', false);
|
$(document).data('slideshow_ctime', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).data('slideshow', boolean_value);
|
$(document).data('slideshow', boolean_value);
|
||||||
|
|
||||||
var headers = $('#record_wrapper .header');
|
var headers = $('#record_wrapper .header');
|
||||||
|
|
||||||
if(boolean_value)
|
if(boolean_value)
|
||||||
{
|
{
|
||||||
$('.play_button, .next_button.play, .previous_button.play', headers).hide();
|
$('.play_button, .next_button.play, .previous_button.play', headers).hide();
|
||||||
@@ -697,17 +695,17 @@ function slideshow(boolean_value)
|
|||||||
|
|
||||||
function set_sizeable(container)
|
function set_sizeable(container)
|
||||||
{
|
{
|
||||||
|
|
||||||
$(container).bind('mousewheel',function(event,delta){
|
$(container).bind('mousewheel',function(event,delta){
|
||||||
|
|
||||||
if($(this).hasClass('note_editing'))
|
if($(this).hasClass('note_editing'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var record = $('.record_image', this);
|
var record = $('.record_image', this);
|
||||||
|
|
||||||
if(record.length === 0)
|
if(record.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var o_top = parseInt(record.css('top'));
|
var o_top = parseInt(record.css('top'));
|
||||||
var o_left = parseInt(record.css('left'));
|
var o_left = parseInt(record.css('left'));
|
||||||
|
|
||||||
@@ -734,13 +732,13 @@ function set_sizeable(container)
|
|||||||
|
|
||||||
var top = Math.round((height / o_height) * (o_top - $(this).height() / 2) + $(this).height() / 2);
|
var top = Math.round((height / o_height) * (o_top - $(this).height() / 2) + $(this).height() / 2);
|
||||||
var left = Math.round((width / o_width) * (o_left - $(this).width() / 2) + $(this).width() / 2);
|
var left = Math.round((width / o_width) * (o_left - $(this).width() / 2) + $(this).width() / 2);
|
||||||
|
|
||||||
record.width(width).height(height).css({
|
record.width(width).height(height).css({
|
||||||
top:top,
|
top:top,
|
||||||
left:left
|
left:left
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_agreement(event, el, sselcont_id, boolean_value)
|
function set_agreement(event, el, sselcont_id, boolean_value)
|
||||||
@@ -748,9 +746,9 @@ function set_agreement(event, el, sselcont_id, boolean_value)
|
|||||||
if(event.stopPropagation)
|
if(event.stopPropagation)
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
|
|
||||||
var id =
|
var id =
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/lightbox/ajax/SET_ELEMENT_AGREEMENT/"+sselcont_id+"/",
|
url: "/lightbox/ajax/SET_ELEMENT_AGREEMENT/"+sselcont_id+"/",
|
||||||
@@ -759,23 +757,30 @@ function set_agreement(event, el, sselcont_id, boolean_value)
|
|||||||
agreement : boolean_value
|
agreement : boolean_value
|
||||||
},
|
},
|
||||||
success: function(datas){
|
success: function(datas){
|
||||||
if(boolean_value == '1')
|
if(!datas.error)
|
||||||
{
|
{
|
||||||
$('.agree_'+sselcont_id+'').removeClass('not_decided');
|
if(boolean_value == '1')
|
||||||
$('.disagree_'+sselcont_id+'').addClass('not_decided');
|
{
|
||||||
$('.userchoice.me').addClass('agree').removeClass('disagree');
|
$('.agree_'+sselcont_id+'').removeClass('not_decided');
|
||||||
|
$('.disagree_'+sselcont_id+'').addClass('not_decided');
|
||||||
|
$('.userchoice.me').addClass('agree').removeClass('disagree');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('.agree_'+sselcont_id+'').addClass('not_decided');
|
||||||
|
$('.disagree_'+sselcont_id+'').removeClass('not_decided');
|
||||||
|
$('.userchoice.me').addClass('disagree').removeClass('agree');
|
||||||
|
}
|
||||||
|
p4.releasable = datas.releasable;
|
||||||
|
if(datas.releasable !== false)
|
||||||
|
{
|
||||||
|
if(confirm(datas.releasable))
|
||||||
|
$('#basket_options .confirm_report').trigger('click');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('.agree_'+sselcont_id+'').addClass('not_decided');
|
alert(datas.datas);
|
||||||
$('.disagree_'+sselcont_id+'').removeClass('not_decided');
|
|
||||||
$('.userchoice.me').addClass('disagree').removeClass('agree');
|
|
||||||
}
|
|
||||||
p4.releasable = datas.releasable;
|
|
||||||
if(datas.releasable !== false)
|
|
||||||
{
|
|
||||||
if(confirm(datas.releasable))
|
|
||||||
$('#basket_options .confirm_report').trigger('click');
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -817,13 +822,13 @@ function calculate_display(display_width, display_height, width, height, margin)
|
|||||||
function display_record(compare)
|
function display_record(compare)
|
||||||
{
|
{
|
||||||
var main_container = $('#record_wrapper');
|
var main_container = $('#record_wrapper');
|
||||||
|
|
||||||
if(typeof compare == 'undefined')
|
if(typeof compare == 'undefined')
|
||||||
compare = !main_container.hasClass('single');
|
compare = !main_container.hasClass('single');
|
||||||
|
|
||||||
var main_box = $('#record_main');
|
var main_box = $('#record_main');
|
||||||
var compare_box = $('#record_compare');
|
var compare_box = $('#record_compare');
|
||||||
|
|
||||||
var main_record = $('.container .record', main_box);
|
var main_record = $('.container .record', main_box);
|
||||||
var compare_record = $('.container .record', compare_box);
|
var compare_record = $('.container .record', compare_box);
|
||||||
|
|
||||||
@@ -831,23 +836,23 @@ function display_record(compare)
|
|||||||
var main_record_height = parseInt($('input[name=height]', main_box).val());
|
var main_record_height = parseInt($('input[name=height]', main_box).val());
|
||||||
var compare_record_width = parseInt($('input[name=width]', compare_box).val());
|
var compare_record_width = parseInt($('input[name=width]', compare_box).val());
|
||||||
var compare_record_height = parseInt($('input[name=height]', compare_box).val());
|
var compare_record_height = parseInt($('input[name=height]', compare_box).val());
|
||||||
|
|
||||||
var main_container_width = main_container.width();
|
var main_container_width = main_container.width();
|
||||||
var main_container_innerwidth = main_container.innerWidth();
|
var main_container_innerwidth = main_container.innerWidth();
|
||||||
var main_container_height = main_container.height();
|
var main_container_height = main_container.height();
|
||||||
var main_container_innerheight = main_container.innerHeight();
|
var main_container_innerheight = main_container.innerHeight();
|
||||||
|
|
||||||
if(compare)
|
if(compare)
|
||||||
{
|
{
|
||||||
$('.agreement_selector').show();
|
$('.agreement_selector').show();
|
||||||
main_container.addClass('comparison');
|
main_container.addClass('comparison');
|
||||||
|
|
||||||
var double_portrait_width = main_container_innerwidth / 2;
|
var double_portrait_width = main_container_innerwidth / 2;
|
||||||
var double_portrait_height = main_container_innerheight - $('.header', main_box).outerHeight();
|
var double_portrait_height = main_container_innerheight - $('.header', main_box).outerHeight();
|
||||||
|
|
||||||
var double_paysage_width = main_container_innerwidth;
|
var double_paysage_width = main_container_innerwidth;
|
||||||
var double_paysage_height = main_container_innerheight / 2 - $('.header', main_box).outerHeight();
|
var double_paysage_height = main_container_innerheight / 2 - $('.header', main_box).outerHeight();
|
||||||
|
|
||||||
var main_display_portrait = calculate_display(
|
var main_display_portrait = calculate_display(
|
||||||
double_portrait_width, double_portrait_height,
|
double_portrait_width, double_portrait_height,
|
||||||
main_record_width, main_record_height
|
main_record_width, main_record_height
|
||||||
@@ -865,7 +870,7 @@ function display_record(compare)
|
|||||||
double_paysage_width, double_paysage_height,
|
double_paysage_width, double_paysage_height,
|
||||||
compare_record_width, compare_record_height
|
compare_record_width, compare_record_height
|
||||||
);
|
);
|
||||||
|
|
||||||
var surface_main_portrait = main_display_portrait.width * main_display_portrait.height;
|
var surface_main_portrait = main_display_portrait.width * main_display_portrait.height;
|
||||||
var surface_main_paysage = main_display_paysage.width * main_display_paysage.height;
|
var surface_main_paysage = main_display_paysage.width * main_display_paysage.height;
|
||||||
var surface_compare_portrait = compare_display_portrait.width * compare_display_portrait.height;
|
var surface_compare_portrait = compare_display_portrait.width * compare_display_portrait.height;
|
||||||
@@ -875,15 +880,15 @@ function display_record(compare)
|
|||||||
var double_paysage_surface = (surface_main_paysage + surface_compare_paysage) / 2;
|
var double_paysage_surface = (surface_main_paysage + surface_compare_paysage) / 2;
|
||||||
|
|
||||||
var smooth_image = false;
|
var smooth_image = false;
|
||||||
|
|
||||||
var m_width_image, m_height_image, c_width_image, c_height_image, dim_container;
|
var m_width_image, m_height_image, c_width_image, c_height_image, dim_container;
|
||||||
|
|
||||||
if(double_portrait_surface > double_paysage_surface)
|
if(double_portrait_surface > double_paysage_surface)
|
||||||
{
|
{
|
||||||
if(!main_container.hasClass('portrait'))
|
if(!main_container.hasClass('portrait'))
|
||||||
{
|
{
|
||||||
smooth_image = true;
|
smooth_image = true;
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
main_box,
|
main_box,
|
||||||
'50%',
|
'50%',
|
||||||
@@ -895,7 +900,7 @@ function display_record(compare)
|
|||||||
);
|
);
|
||||||
|
|
||||||
compare_box.css('visibility','hidden');
|
compare_box.css('visibility','hidden');
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
compare_box,
|
compare_box,
|
||||||
'50%',
|
'50%',
|
||||||
@@ -922,7 +927,7 @@ function display_record(compare)
|
|||||||
if(!main_container.hasClass('paysage'))
|
if(!main_container.hasClass('paysage'))
|
||||||
{
|
{
|
||||||
smooth_image = true;
|
smooth_image = true;
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
main_box,
|
main_box,
|
||||||
'100%',
|
'100%',
|
||||||
@@ -932,9 +937,9 @@ function display_record(compare)
|
|||||||
set_container_status('paysage');
|
set_container_status('paysage');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
compare_box.css('visibility','hidden');
|
compare_box.css('visibility','hidden');
|
||||||
|
|
||||||
smooth_transform(
|
smooth_transform(
|
||||||
compare_box,
|
compare_box,
|
||||||
'100%',
|
'100%',
|
||||||
@@ -964,7 +969,7 @@ function display_record(compare)
|
|||||||
{
|
{
|
||||||
$('.agreement_selector').hide();
|
$('.agreement_selector').hide();
|
||||||
main_container.removeClass('comparison');
|
main_container.removeClass('comparison');
|
||||||
|
|
||||||
if(compare_box.is(':visible'))
|
if(compare_box.is(':visible'))
|
||||||
{
|
{
|
||||||
compare_box.hide().css('visibility','hidden').css('display','block');
|
compare_box.hide().css('visibility','hidden').css('display','block');
|
||||||
@@ -974,12 +979,12 @@ function display_record(compare)
|
|||||||
main_container_innerwidth, (main_container_innerheight - $('.header', main_box).outerHeight()),
|
main_container_innerwidth, (main_container_innerheight - $('.header', main_box).outerHeight()),
|
||||||
main_record_width, main_record_height
|
main_record_width, main_record_height
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!main_container.hasClass('single'))
|
if(!main_container.hasClass('single'))
|
||||||
{
|
{
|
||||||
main_box.width('100%')
|
main_box.width('100%')
|
||||||
.height('100%');
|
.height('100%');
|
||||||
|
|
||||||
set_container_status('single');
|
set_container_status('single');
|
||||||
}
|
}
|
||||||
set_image_position(smooth_image, main_record, main_display.width, main_display.height, {
|
set_image_position(smooth_image, main_record, main_display.width, main_display.height, {
|
||||||
@@ -1002,7 +1007,7 @@ function set_image_position(smooth, image, width, height, container, callback)
|
|||||||
{
|
{
|
||||||
var c_width = container.width;
|
var c_width = container.width;
|
||||||
var c_height = container.height;
|
var c_height = container.height;
|
||||||
|
|
||||||
dimensions.top = parseInt((c_height - height) / 2);
|
dimensions.top = parseInt((c_height - height) / 2);
|
||||||
dimensions.left = parseInt((c_width - width) / 2);
|
dimensions.left = parseInt((c_width - width) / 2);
|
||||||
}
|
}
|
||||||
@@ -1013,7 +1018,7 @@ function set_image_position(smooth, image, width, height, container, callback)
|
|||||||
|
|
||||||
dimensions.width = width;
|
dimensions.width = width;
|
||||||
dimensions.height = height;
|
dimensions.height = height;
|
||||||
|
|
||||||
if(smooth)
|
if(smooth)
|
||||||
{
|
{
|
||||||
$(image).stop().animate(dimensions,500,callback);
|
$(image).stop().animate(dimensions,500,callback);
|
||||||
@@ -1029,7 +1034,7 @@ function smooth_transform(box, width, height, callback)
|
|||||||
{
|
{
|
||||||
if(typeof callback == 'undefined')
|
if(typeof callback == 'undefined')
|
||||||
callback = function(){};
|
callback = function(){};
|
||||||
|
|
||||||
$(box).stop()
|
$(box).stop()
|
||||||
.animate(
|
.animate(
|
||||||
{
|
{
|
||||||
@@ -1050,7 +1055,7 @@ function scroll_elements(boolean_value)
|
|||||||
value = sc_wrapper.scrollLeft() + 400;
|
value = sc_wrapper.scrollLeft() + 400;
|
||||||
else
|
else
|
||||||
value = sc_wrapper.scrollLeft() - 400;
|
value = sc_wrapper.scrollLeft() - 400;
|
||||||
|
|
||||||
sc_wrapper.stop().animate({
|
sc_wrapper.stop().animate({
|
||||||
'scrollLeft':value
|
'scrollLeft':value
|
||||||
});
|
});
|
||||||
@@ -1068,7 +1073,7 @@ function download_basket()
|
|||||||
function download(value)
|
function download(value)
|
||||||
{
|
{
|
||||||
var dialog_box = $('#dialog_dwnl');
|
var dialog_box = $('#dialog_dwnl');
|
||||||
|
|
||||||
dialog_box = $('#dialog_dwnl');
|
dialog_box = $('#dialog_dwnl');
|
||||||
|
|
||||||
dialog_box.empty().addClass('loading').dialog({
|
dialog_box.empty().addClass('loading').dialog({
|
||||||
@@ -1086,9 +1091,9 @@ function download(value)
|
|||||||
tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
|
tinyMCE.execCommand('mceRemoveControl',true,'order_usage');
|
||||||
}
|
}
|
||||||
}).dialog('open');
|
}).dialog('open');
|
||||||
|
|
||||||
$.post("/include/multiexports.php", "lst="+value, function(data) {
|
$.post("/include/multiexports.php", "lst="+value, function(data) {
|
||||||
|
|
||||||
dialog_box.removeClass('loading').empty().append(data);
|
dialog_box.removeClass('loading').empty().append(data);
|
||||||
$('.tabs', dialog_box).tabs();
|
$('.tabs', dialog_box).tabs();
|
||||||
tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
|
tinyMCE.execCommand('mceAddControl',true,'sendmail_message');
|
||||||
@@ -1099,6 +1104,6 @@ function download(value)
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,15 +24,22 @@ $(document).ready(function(){
|
|||||||
$.mobile.pageLoading(true);
|
$.mobile.pageLoading(true);
|
||||||
},
|
},
|
||||||
success: function(datas){
|
success: function(datas){
|
||||||
if(agreement == '1')
|
if(!datas.error)
|
||||||
$('.valid_choice_'+sselcont_id).removeClass('disagree').addClass('agree');
|
{
|
||||||
|
if(agreement == '1')
|
||||||
|
$('.valid_choice_'+sselcont_id).removeClass('disagree').addClass('agree');
|
||||||
|
else
|
||||||
|
$('.valid_choice_'+sselcont_id).removeClass('agree').addClass('disagree');
|
||||||
|
$.mobile.pageLoading(true);
|
||||||
|
if(datas.error)
|
||||||
|
{
|
||||||
|
alert(datas.datas);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$('.valid_choice_'+sselcont_id).removeClass('agree').addClass('disagree');
|
|
||||||
$.mobile.pageLoading(true);
|
|
||||||
if(datas.error)
|
|
||||||
{
|
{
|
||||||
alert(datas.datas);
|
alert(datas.datas);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user