apxtrib/setup/data/domain/apixpress/www/cdn/public/js/main.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2023-01-22 09:53:09 +00:00
'use strict';
var app = app || {};
var URLCENTRALE = "http://maildigit.ndda.fr";
if (location.href.indexOf('https:')>-1){
URLCENTRALE='https://maildigit.ndda.fr';
}
app.test = function(){
$('a.test').on('click',function(){
console.log('lance test pdf');
$.ajax({
url: "/pdf",
type: "POST",
data: {
tpl: 'tete',
info : 'tyty',
},
cache: false,
success: function(res) {
console.log(res.success)
},
error: function(res) {
},
});
});
};
$('.btncode').on('click',function(){
var clair = $('.clair').val();
var code = $('.code').val();
if (clair !='' && code!='') {
$('p.msgcode').html("Vider un champs pour générer le codage")
}
if (code=='') {
$('.code').val(window.btoa(unescape(encodeURIComponent( clair ))));
};
if (clair ==''){
$('.clair').val(decodeURIComponent(escape(window.atob( code ))));
}
});
$(document).ready(function () {
//permet d'afficher du code à copier coller du site
$( 'code' ).each(function(){$(this).find('pre').text( $(this).html() )});
//app.init()
md.tg("&s=s0");
$('form.formmaildigit').gestionform(URLCENTRALE);
$('.loginprocess').initlogin();
//app.sendform();
// app.test();
//pour tester
});