2013-09-16 15:41:31 +00:00

114 lines
3.9 KiB
JavaScript

$(document).ready( function()
{
$('a.dial,.ev_code').on('click', function(e){
e.preventDefault();
var title = $(this).attr('title');
var href = $(this).attr('href');
var dlgOpts = {
bgiframe: true,
title: title,
width: 710,
height: 530,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {'Fermer': function() { $(this).dialog('close'); }},
close: function() { $('#dial').remove(); }};
$('<div id="dial"></div>').dialog(dlgOpts);
return false;
});
function getPays(){
$('select[name=LanguageCode]').fadeOut();
$("select[name=Pays] option:selected").each(function () {
var values = $(this).attr('value');
//alert(values);
$.post('/giant/getpays',{Pays: values}, function(data) {
alert(data);
});
});
$('select[name=LanguageCode]').fadeIn(500);
}
getPays();
$('.idpr,.id_cr').on('click', function(){
//e.preventDefault();
var n = $(this).attr('id');
if ($('#p'+n).css('display')=='none'){
$('#p'+n).css('display', 'block');
} else {
$('#p'+n).css('display', 'none');
}
});
$('.tooltip').each(function(){
var title = $(this).attr('title');
var width = $(this).attr('wdth');
$(this).attr('title', '');
$(this).qtip({
solo:true,
content: title,
style: { width: width },
position: { at: "bottom center", my: "top center" }
});
});
$(function() {
$( "#radio" ).buttonset();
$("#radio1").trigger('click');
});
$('.radio').on('click', function() {
$('.lang_img').fadeOut();
$.alink = this.value.toLowerCase();
$.alink_h = this.value;
$(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+$('.lang0').text().substr($('.lang0').text().length - 2));
$(".lang").attr("src","/themes/default/images/drapeaux/"+$('.lang0').text().substr($('.lang0').text().length - 2)+".png");
$(".lang_val").val($('.lang0').text().substr($('.lang0').text().length - 2));
$('.'+$.alink+'').fadeIn(500);
});
$('select.lang_val').on('change', function() {
$('.lang_img').fadeOut();
$(".id_cr").attr("href","/giant/"+$.alink+"/Pays/"+location.pathname.match(/\/Pays\/([^\/]+)/)[1]+"/Type/"+$.alink_h+"/CompanyId/"+location.pathname.match(/\/CompanyId\/([^\/]+)/)[1]+"/Language/"+this.value);
$(".lang").attr("src","/themes/default/images/drapeaux/"+this.value+".png");
$('.'+$.alink+'').fadeIn(500);
});
$('select[name=Pays]').on('change', function() {
getPays();
});
$(function() {
$( ".monitor_but a,.retrive_but a" )
.button();
});
$.mon_type = $('.mon_type').val();
$('.retr').on('click', function(e){
e.preventDefault();
var title = $(this).attr('title');
var href = $(this).attr('href');
var dlgOpts = {
bgiframe: true,
title: title,
height: 241,
width: 250,
modal: true,
buttons: {'Envoyer': function() {$(location).attr('href',href+'/InternalOrderId/'+$("[name=InternalOrderId]").val()+'/StartFrom/'+$("[name=StartFrom]").val()+'/monitor_type/'+$.mon_type);
$(".ui-dialog-buttonpane button:contains('Envoyer')").button("disable");},
'Fermer': function() { $(this).dialog('close'); }},
close: function() { $(this).dialog('close'); }};
$('.dialog-form').dialog(dlgOpts);
return false;
});
if($('.mon_type').val()!='Order')
{
$('.int_order').fadeOut(500);
}
$('select.mon_type').on('change', function() {
$.mon_type = $(this).val();
if($(this).val()=='Order')
{
$('.int_order').fadeIn(500);
}
else{
$('.int_order').fadeOut(500);
}
});
});