From bbe72aad2a204b9ba0d5edcd4cd5f2f92d8131ca Mon Sep 17 00:00:00 2001 From: gdetrez Date: Wed, 24 Jan 2007 14:04:01 +0100 Subject: [PATCH] fichiers dplacs darcs-hash:20070124130401-f46e9-30398d41669298d9325fb712a8121316c809b4dd.gz --- intranet/static/css/cransFactures.css | 205 ---------- intranet/static/css/digicode.css | 85 ---- intranet/static/css/impression.css | 162 -------- intranet/static/css/machines.css | 160 -------- intranet/static/css/monCompte.css | 368 ----------------- intranet/static/scripts/digicode.js | 170 -------- intranet/static/scripts/impression.js | 404 ------------------- intranet/static/scripts/machines.js | 348 ---------------- intranet/static/scripts/moncompte.js | 41 -- intranet/static/scripts/passwordGenerator.js | 66 --- 10 files changed, 2009 deletions(-) delete mode 100644 intranet/static/css/cransFactures.css delete mode 100644 intranet/static/css/digicode.css delete mode 100644 intranet/static/css/impression.css delete mode 100644 intranet/static/css/machines.css delete mode 100644 intranet/static/css/monCompte.css delete mode 100644 intranet/static/scripts/digicode.js delete mode 100644 intranet/static/scripts/impression.js delete mode 100644 intranet/static/scripts/machines.js delete mode 100644 intranet/static/scripts/moncompte.js delete mode 100644 intranet/static/scripts/passwordGenerator.js diff --git a/intranet/static/css/cransFactures.css b/intranet/static/css/cransFactures.css deleted file mode 100644 index dda0af9f..00000000 --- a/intranet/static/css/cransFactures.css +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************** - * -********************************************/ -#globalDiv { - //padding-left:20%; - position: relative; -} - -ul#actionMenu { - list-style-type:none; - width:18%; - padding:0; - float:left; -} - -h1 { - font-size:1.4em; - margin:2px; -} -td, tr { - margin:0; -} - -#factureListDiv { - padding:5px; - background:#fad163; - float:left; - width:75%; -} - -#factureListDiv table#listeFactures { - padding:0; - width:100%; -} - -.factureRow { - margin:2px; - position:relative; -} - -.help_text { - background:#fff7D7; - font-weight:normal; - padding:10px 20px; - -} - -.factureRow .factureSummary { - background:#fff7D7; - height:30px; - font-weight:bold; - padding:10px 20px; -} - -.factureRow .factureSummary span.intitule { - float:left; -} - -.factureRow .factureSummary span.montant { - float:right; - text-align:right; -} - -.tdNoFactures { - text-align:center; - font-size:1.2em; - background-color:#fff7D7; - color:#666; - margin:0; - padding:5px; -} - -.facturePayee { -} -.factureNonPayee .factureSummary { - color:red; -} - - -.actions { - display:block; - float:right; - font-size:0.9em; - font-weight:normal; -} -.actions a { - margin:2px 10px; -} - -/******************************************** - * -********************************************/ - -table.factureDetails { - background: #fff7D7 url(../images/fondFacturesDetails.png) repeat-x top; - padding:1%; - width:96%; - margin:0 1% 10px 1%; -} - -.tdTotalDetail, -.tdTotalDetailIntitule { - border-top:thin black solid; -} - -.tdTotalDetailIntitule { - text-align:right; - font-weight:bold; -} - -table.factureDetails th { - border-bottom:thin black solid; -} -table.factureDetails th, -table.factureDetails td { - border-right:thin black solid; - margin:0; - padding:5px 20px; -} - -/******************************************** - * -********************************************/ -.note { - display:block; - font-size:small; - margin:3px; - font-weight:normal; -} -.note { - color:#666 -} - -.linkToggle { - display:block; - float:left; - height:15px; - width:15px; - background:transparent url(../images/fl.png) top left; - margin-right:1px; -} - -/******************************************** - * -********************************************/ - -table#historique_sous { - width:100%; -} - -table#historique_sous td { - background:#fff7D7; - padding:5px; - text-align:center; - border-top:2px #fad163 solid; -} - -table#historique_sous th { - background:#fff7D7; - padding:5px; - text-decoration:underline; -} - -/******************************************** - * -********************************************/ - -form.search { - display:block; - border: thin black solid; - padding:.2em 1em; - float:left; - //position:absolute; - width:18%; - //top:0; - //left:0; - margin:0 1%; -} - -form.search input { - max-width:95%; - margin:.3em; - float:left; - border: thin gray solid; -} - -form.search label { - padding-top:7px; - display:block; - width:4em; - float:left; - clear:left; -font-weight:bold; -} - -form.search h3 { - margin:.2em 0; -} - -form.search input.button { - margin:.5em; - text-align:center; - clear:left; -} - diff --git a/intranet/static/css/digicode.css b/intranet/static/css/digicode.css deleted file mode 100644 index 921f9165..00000000 --- a/intranet/static/css/digicode.css +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -digicode.css - Intranet Style - - STYLE PAGE DU DIGICODE - - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ -#codesTable { -width:60%; -border:thin black solid; -float:left; -} - - -#codesTable thead { -color:gray; -} - -#codesTable .code { -border-right:thin gray solid; -width:70%; -} - -#codesTable tbody .age { -text-align:right; -} - -#codesTable td, -#codesTable th { -margin:0; -padding:2px 5px; -} - -#codesTable tbody td { -border-top:thin gray solid; -} - -#codesTable thead th { -border-top:none; -} - - -div#addCodeBox { -float: right; -border:thin black solid; -padding:10px; -margin:0 5%; -width:25%; -} - -div#addCodeBox h1 { -font-size:1.1em; -margin:2px 10px 20px 10px; -text-align:center; -} - -div#addCodeBox form { -} -div#addCodeBox form input, -div#addCodeBox form button { -margin:3px; -} - -form input.textinput { -border: thin gray solid; -} diff --git a/intranet/static/css/impression.css b/intranet/static/css/impression.css deleted file mode 100644 index 09f330ea..00000000 --- a/intranet/static/css/impression.css +++ /dev/null @@ -1,162 +0,0 @@ -/* ****************************************** * - * - * ****************************************** */ -#globalDiv { - padding-left:200px; - position: relative; -} - -ul#actionMenu { - list-style-type:none; - position:absolute; - width:150px; - top:0; - left:0; - margin:20px; - padding:0; -} -ul#actionMenu li { - clear:both; -} -/* ****************************************** * - * - * ****************************************** */ -#fileName { - display: block; - width:150px; - text-align:center; - padding:50px 5px 5px 5px; - background: url(../images/pdf-icon.png) center top no-repeat; - margin:0 0 10px 0; - overflow:auto; -} - -#actionMenu li { - margin: .8em 0; -} - -#actionEtatImprimante { - padding:0.4em; - border: thin black solid; -} - -/* ******************************************* * - * - * ******************************************* */ -form#form_impression { - margin: 0px; - font-size: 100%; - min-width:600px; -} -form#form_impression #preview { - border:1px black solid; - width:150px; - height:150px; - padding:10px; - background-color:#C0C0C0; -} - -form#form_impression #rightColumn { - margin:10px 10px 10px 240px; -} - -form#form_impression #leftColumn { - float:left; - width:170px; - margin:10px; - padding:0; -} -div#prix_placeholder { - margin:6px 0; - width:170px; - min-height:16px; - padding:0; - color:gray; -} -div#prix_placeholder img { - margin-right:2px; - float:right; -} -form#form_impression fieldset fieldset { - margin:10px; -} -form#form_impression>fieldset { - position:relative; - padding:20px; -} - -.clear { - clear:both; -} - -form#form_impression .bouttons { - text-align:right; -} -form#form_impression label.labelInput { - display:block; - width:4em; - margin-right:4px; - float:left; - text-align:right; -} - -/* ****************************************** * - * - * ****************************************** */ -#popupFichiers { - background:#AE0F3E; - z-index:500; - float:left; - position:fixed; - min-width:450px; - top:110px; - left:20%; - right:20%; - padding:0; -} -#popupFichiers #insideDiv { - background:white; - margin:2px 5px; -} -#popupFichiers #insideDiv form { - margin:2px 5px; -} -#popupFichiers h1 { - font-size:1em; - margin:0; - text-align:center; - color:white; -} -#popupFichiers h1:before { - content:url("../images/WindowTitleLogo.png"); - margin-right:5px; -} - -#popupFichiers h2 { - font-size:1.1em; - border-bottom:thin black solid; -} -#popupFichiers select, -#popupFichiers input.file { - width:100%; -} - -.button { - float:right; -} - -/* ****************************************** * - * - * ****************************************** */ -div#printingPopupContent { - background: white url("../images/printer.png") left center no-repeat;; - padding:10px 10px 10px 115px; - min-height:100px; -} - -#printingPopupContent a, -#printingPopupContent span { - display:block; - font-weight: bold; - margin:5px 0; -} diff --git a/intranet/static/css/machines.css b/intranet/static/css/machines.css deleted file mode 100644 index b25aba27..00000000 --- a/intranet/static/css/machines.css +++ /dev/null @@ -1,160 +0,0 @@ -/************************************************************* - .. - .... ............ ........ - . ....... . .... .. - . ... .. .. .. .. ..... . .. - .. .. ....@@@. .. . ........ . - .. . .. ..@.@@..@@. .@@@@@@@ @@@@@@. .... - .@@@@. .@@@@. .@@@@..@@.@@..@@@..@@@..@@@@.... .... - @@@@... .@@@.. @@ @@ .@..@@..@@...@@@. .@@@@@. .. - .@@@.. . @@@. @@.@@..@@.@@..@@@ @@ .@@@@@@.. ..... - ...@@@.... @@@ .@@.......... ........ ..... .. - . ..@@@@.. . .@@@@. .. ....... . ............. - . .. .... .. .. . ... .... -. . .... ............. .. ... -.. .. ... ........ ... ... - ................................ - -============================================================== -macines.css - Intranet Style - -Copyright (c) 2006 by www.crans.org - -**************************************************************/ -#globalDiv { - padding-left : 20%; - margin:0; - position:relative; -} -h2 { - margin: 0 5px .5em 5px;padding:5px; -} - -div.alias { - color:gray; - margin:0; - padding:0 0 0 60px; - display:block; - font-weight:normal; - font-size:0.6em; - -} - -table.blacklist_table, -table.ports_table { - border-top: thin black solid; - border-left: thin black solid; -} - -table.blacklist_table td, -table.blacklist_table th, -table.ports_table td, -table.ports_table th { - border-right: thin black solid; - border-bottom: thin black solid; - padding: 3px; -} - -.actif { - color:red; -} -.inactif { -} - - -#gestion_machines_main_frame { - padding:5px; -} - -dl.basicInfos dt { - float:left; - font-weight:bold; - clear:left; -} - -dl.basicInfos dd { - float:left; - margin:0 1em; -} - -ul#listeMachines { - list-style-type:none; - margin:0; - padding:0; -} - -ul#listeMachines li { - float:left; - height:70px; - width:100px; - margin:5px; - display:block; - text-align:center; -} - -ul#listeMachines li span { - margin-bottom:0; - display:block; -} - -ul#listeMachines li a { -display:block; - color:black; - text-decoration:none; -} - -ul#listeMachines li a:hover { - background:#bbbbff; -} - -ul#listeMachines li a:active { - background:#8888ff; -} - -ul#listeMachines li img { - margin:2px auto; - width:32px; - height:32px; -} - -#menu_actions { - background:#eeeeff; - padding:.3em; - width:18%; - float:left; - position:absolute; - top:1em; - left:0; - border: thin black solid; -} - -#menu_actions ul { - list-style-type:none; - padding:0; - margin:.5em; -} -#menu_actions ul li a { - text-decoration:none; -} -#menu_actions ul li a:hover { - text-decoration:underline; -} - -#menu_actions h1 { - font-size:1em; - margin:0; - text-align:center; - border-bottom: thin black solid; -} - -// on change la couleur des messages -.message { - background-color:#000080; - color:white; -} - -label { - width:175px; - display:block; - float:left; -} diff --git a/intranet/static/css/monCompte.css b/intranet/static/css/monCompte.css deleted file mode 100644 index 28d9ba70..00000000 --- a/intranet/static/css/monCompte.css +++ /dev/null @@ -1,368 +0,0 @@ -/******************************************** - * -********************************************/ -#globalDiv { - padding-left:100px; -} - -/* style du titre au dessus des onglet et des titres pour les pages PayPal */ -div.domtab>h1, -h2 { - font-size:1.4em; - margin:2px; -} - - -/******************************************** - * -********************************************/ -/* conteneur de l'ensemble */ -div.domtab{ - padding:3px; - width:100%; - background:#fad163; - clear:left; -} - -/* onglets */ -ul.domtabs{ - float:left; - width:100%; - margin:0; - padding:0; - list-style-type:none; - -} -ul.domtabs li{ - float:left; -} -ul.domtabs a:link, -ul.domtabs a:visited, -ul.domtabs a:active, -ul.domtabs a:hover{ - font-weight:bold; - display:block; - padding:0.4em; - text-align:center; - background:#fad163; -} - -ul.domtabs li.active a:link, -ul.domtabs li.active a:visited, -ul.domtabs li.active a:active, -ul.domtabs li.active a:hover{ - background:#fff7D7; - color:#000; - text-decoration:none; -} - -/* les pages */ -div.domtab>div { - padding:0; - clear:both; - border:5px solid #fff7D7; -} -/* ancre des pages */ -.mark { - height:0; - clear:both; - display:none; -} - -/******************************************** - * -********************************************/ -.tabbed_page { - padding:0; - margin:0; -} - -ul.tabbed_page { - list-style-type:none; -} - -dl.tabbed_page>dt, -dl.tabbed_page>dd, -ul.tabbed_page>li { - background:#fff7D7; - padding:10px; - margin:0 0 2px 0; - font-weight:bold; -} -dl.tabbed_page>dt.last, -dl.tabbed_page>dd.last, -ul.tabbed_page>li.last { - margin:0 0 0 0; -} - -dl.tabbed_page>dt { - width:40%; - display:block; - height:100%; - float:left; - clear:left; -} - -dl.tabbed_page>dd { - padding-left:45%; -} - -span.actions { - display:block; - float:right; - font-size:0.9em; - font-weight:normal; -} -.tabbed_page span.actions a { - margin:2px 10px; -} - - -.tabbed_page dl, -.tabbed_page dl dt, -.tabbed_page dl dd { - margin:0; - padding:0; -} - -.tabbed_page dl dt { - float:left; - margin-right:5px; -} - -.tabbed_page dl dd, -.tabbed_page p { - font-weight:normal; - margin:3px; -} - - -span.valide { - color:green; - font-weight:bold; -} - -span.invalide { - color:red; - font-weight:bold; -} - -.clear { - clear:both; -} - -ul.tabbed_page li.centrer { - padding:10px; - margin-left:0; - text-align:center; -} - - -/******************************************** - * -********************************************/ - -.textInputNote { - display:block; - padding-left:0; - font-size:0.8em; - font-weight:normal; -} - -dd .textInputNote { - padding-left:0; -} -li .textInputNote { - padding-left:175px; -} - -label.textInputLabel{ - width:175px; - display:block; - float:left; -} - -label.checkBoxLabel{ - float:none; - padding-left:175px; -} - -/******************************************** - * -********************************************/ -dl#machineList, -dl#machineList>dt { - margin:0; - padding:0; -} -#machineList>dt { - - font-size:1.2em; - font-weight:bold; - margin:5px 5px 5px 5px; - height:30px; - padding:10px 20px; - background:#fff7D7; -} -#machineList>dd { - margin:0 0 2px 0; -} -.linkToggle { - display:block; - float:left; - height:15px; - width:15px; - background:transparent url(../images/fl.png) top left; - margin-right:1px; -} -/******************************************** - * -********************************************/ -.machineDetails { - background: #fff7D7;/*/ url(../images/fondFacturesDetails.png) repeat-x top;*/ - padding:0; - /*width:96%;*/ - display:none; - margin:0; -} - -dl.machineInfos dt, dl.machineInfos dd { - float:left; - margin-top:0; - padding:.1em; - display:block; - width:20%; -} - -dl.machineInfos dt { - text-align:right; - width:20%; - -} -/******************************************** - * -********************************************/ -ul.listeAlias { - list-style-type:none; - margin:0; - padding:0; -} -ul.listeAlias li span { - color:#666; -} - - -/******************************************** - * -********************************************/ -#loadings { - background:#cc0000; - position:fixed; - top:1px; - right:1px; - z-index:1000; - display:none; - padding:2px 3px; - color:white; -} - -.messageText { - padding:2px 10px; - display:block; -} -#messagePlaceHolder { - height:0; - overflow:visible; - position:relative; - top:-4em; -} - -.message { - padding:0; - background:#fad163; - width:300px; - text-align:center; - margin : 1px auto 10px auto; -} -.errorMessage { - display:block; - background:white; - border:2px #cc0000 solid; - padding:5px; - text-align:center; - min-width:230px; - max-width:430px; - font-weight:bold; - margin : 1px auto 10px auto; -} - -/******************************************** - * -********************************************/ -div#popupInnerBody { - border:5px solid #fad163; - background: #fff7D7; - margin:5px; - padding:5px; -} - -div#popupInnerBody .liens { - list-style-type:none; - float:right; - height:1em; - background: #fff7D7; - border-color:#fad163; - border-style: none solid solid solid; - border-width:3px; - margin:0; - padding:2px; -} - -div#popupInnerBody .liens a { - display:block; - height:1em; - float : left; - margin:0 5px; -} - -a { color:blue; } - -/******************************************** - * -********************************************/ - -table.factureDetails { - padding:1%; - width:96%; - margin:0 1% 10px 1%; -} - - -.tdTotalDetail, -.tdTotalDetailIntitule { - border-top:thin black solid; -} - -.tdTotalDetailIntitule { - text-align:right; - font-weight:bold; -} - -table.factureDetails th { - border-bottom:thin black solid; -} -table.factureDetails th, -table.factureDetails td { - border-right:thin black solid; - margin:0; - padding:5px 20px; -} - - - -/******************************************** - * divers -********************************************/ -.empty { - color:gray; -} diff --git a/intranet/static/scripts/digicode.js b/intranet/static/scripts/digicode.js deleted file mode 100644 index 5fca191e..00000000 --- a/intranet/static/scripts/digicode.js +++ /dev/null @@ -1,170 +0,0 @@ -/* ************************************************************ - * Digicode - ************************************************************ - * Digicode.init : initialisation de la page - * Digicode.makeCode : creation de codes - * Digicode.codelist : liste des codes - * Digicode.AJAX : ajax - */ -Digicode = {}; - -/***************************** - Digicode.init - *****************************/ -Digicode.init = function() -{ - // afficher le tableau codelist - appendChildNodes("globalDiv", Digicode.codelist.create()); - // recuperer la liste des codes - this.codelist.load(); - // afficher le formulaire de creation de code - appendChildNodes("globalDiv", DIV({"id":"addCodeBox"})); - Digicode.makeCode.displayForm(); -} - -/***************************** - Digicode.makeCode - *****************************/ -Digicode.makeCode = {} - -Digicode.makeCode.displayForm = function() -{ - var myForm = FORM({'id':'createCodeForm', 'name':'createCodeForm','onsubmit':"Digicode.makeCode.createCode(document.createCodeForm.newCodeLogin.value, document.createCodeForm.newCode.value); return false;", 'style':'display: none;'}, - LABEL({'for':'newCodeLogin'}, "Login adhérent :"), - INPUT({"name":"newCodeLogin", "size":"10", "maxlength":"20", "class":"textinput"}), - BR(), - LABEL({'for':'newCode'}, "Code :"), - INPUT({"name":"newCode", "size":"6", "maxlength":"6", "class":"textinput"}), - BUTTON({"type":"submit","onclick":"Digicode.makeCode.createCode(document.createCodeForm.newCodeLogin.value, document.createCodeForm.newCode.value)", "style":"float:right;"},"Créer code"), - BUTTON({"type":"button","onclick":"Digicode.makeCode.createCode(document.createCodeForm.newCodeLogin.value)", "style":"float:right;"},"Code aléatoire") - ); - replaceChildNodes("addCodeBox", H1({},"Nouveau code"), myForm ); - appear(myForm); - -} - -Digicode.makeCode.restoreForm = function() -{ - try - { - removeElement("newCodeDisplay"); - removeElement("loading"); - } catch (error){} - appear("createCodeForm"); - -} - -Digicode.makeCode.disableForm = function() -{ - try - { - var form = getElement("createCodeForm"); - var elts = form.elements; - for (i=0 ; i < elts.length ; i++) - elts[i].disabled = true; - } - catch (error){} -} - -Digicode.makeCode.createCode = function(login, code) -{ - var image = createDOM("IMG",{'style':'margin-right:2px;float:right;','src':'/static/images/indicator.gif'}); - appendChildNodes("addCodeBox", DIV({'id':"loading",'style':'display:none;max-height:1em;float:left;'},image,"Loading")); - this.disableForm(); - //removeElement("createCodeForm"); - appear("loading"); - if (code) - Digicode.AJAX.call("createCode?code="+code + "&adherent=" + login, this.handleNewCode); - else - Digicode.AJAX.call("createCode?adherent=" + login, this.handleNewCode); - -} -Digicode.makeCode.handleNewCode = function(res) -{ - if (res.code) - { - replaceChildNodes("addCodeBox", - H1({}, "Code créé"), - DIV({'id':"newCodeDisplay", - 'style':'display:none;font-size:2em;maring:1em;font-weight:bold;text-align:center;', - 'onclick':"Digicode.makeCode.displayForm();"},res.code)); - appear("newCodeDisplay"); - //removeElement("loading"); - Digicode.codelist.addCode(res); - } else if (res.erreur) { - logError("Erreur distante : " + res.erreur); - alert("Erreur sur le serveur, le code est peut-être déjà pris.") - Digicode.makeCode.displayForm(); - } else if (res.formatErreur) { - alert("Ceci n'est pas un code valide"); - Digicode.makeCode.displayForm(); - } - -} -/***************************** - Digicode.codelist - *****************************/ -Digicode.codelist = {}; - -Digicode.codelist.create = function () -{ - var thead = createDOM("thead", {}, - createDOM("th", {'class':'code'}, "Code" ), - createDOM("th", {'class':'age'}, "Age") - ); - var tbody = createDOM("tbody", {"id":"codeList"}); - return TABLE({"id":"codesTable", "cellspacing":"0"}, thead, tbody) -} - - - -Digicode.codelist.load = function() -{ - Digicode.AJAX.call("codeList", Digicode.codelist.displayCodes); -} - -Digicode.codelist.displayCodes = function(result) -{ - if (result.codes) - replaceChildNodes('codeList',map(Digicode.codelist.newCodeTrNodeFromDict,result.codes)); - else if (result.erreur) - logError("Erreur distante : " + result.erreur); -} - -Digicode.codelist.newCodeTrNodeFromDict = function (aDict, style) -{ - if (style) { - var aRow = createDOM("TR", {'id':'code'+aDict.code,"style":style}); - } else - var aRow = createDOM("TR", {'id':'code'+aDict.code}); - appendChildNodes(aRow, createDOM("TD", {'class':'code'}, aDict.code, SPAN({'style':'color:gray;margin-left:2em;'}, aDict.desc ) ) ); - appendChildNodes(aRow, createDOM("TD", {'class':'age'}, aDict.age) ); - return aRow; -} - -Digicode.codelist.addCode = function (aDict) -{ - var newLine = this.newCodeTrNodeFromDict(aDict); - appendChildNodes("codeList", newLine); - pulsate(newLine); -} - - -/***************************** - Digicode.AJAX - *****************************/ -Digicode.AJAX = {} - -Digicode.AJAX.call = function(page, callBack) { - logDebug("calling AJAX : " + page); - var e = loadJSONDoc(page); - e.addCallback(callBack); - e.addErrback(this.errorHandler); -} - -Digicode.AJAX.errorHandler = function(d) { - //Digicode.AJAX..modifPrix("Erreur", false); - logError("AJAX Error: " + d); -} - -setInterval(Digicode.codelist.load, 30000); diff --git a/intranet/static/scripts/impression.js b/intranet/static/scripts/impression.js deleted file mode 100644 index 298ab375..00000000 --- a/intranet/static/scripts/impression.js +++ /dev/null @@ -1,404 +0,0 @@ -/* ************************************************************ - * Impression - ************************************************************ - * Impression.settings : panneau de configuration - * Impression.popup : popup - * Impression.AJAX : ajax - */ -Impression = {}; - -/***************************** - Impression.settings - *****************************/ - -Impression.settings = {}; - - // -//// images : images used for previewing -// -Impression.settings.images = [ - "portrait_couleurs_agraphediagonale.png", - "portrait_couleurs_pasdagraphes.png", - "portrait_couleurs_uneagraphe.png", - "portrait_couleurs_Deuxagraphes.png", - "portrait_couleurs_troisAgraphes.png", - "portrait_couleurs_stitching.png", - "portrait_nb_agraphediagonale.png", - "portrait_nb_pasdagraphes.png", - "portrait_nb_uneagraphe.png", - "portrait_nb_Deuxagraphes.png", - "portrait_nb_troisAgraphes.png", - "portrait_nb_stitching.png", - "portrait_transparent_couleurs.png", - "portrait_transparent_nb.png", - ]; - -Impression.settings.preloadImage = function(imageName) { - var image = new Image(); - image.src = "/static/images/"+imageName; -} - -Impression.settings.preloadAllImages = function() { - log("Preloading images..."); - map(this.preloadImage,this.images); -} - - // -//// init : parse every field and display preview -// -Impression.settings.init = function () { - log("Init settings..."); - this.theform = document.form_impression; - this.disableForm(false); -} - // -//// reset : reset form and then re-init settings -// -Impression.settings.reset = function () { - log("Reset form"); - this.theform.reset(); - this.init(); - Impression.settings.update(); -} - -Impression.settings.disableForm = function(bool) -{ - log("Set Disable Form : " + bool); - var fields = this.theform.elements; - for( var i=0; i< fields.length; i++) - { - this.setDisableField( fields[i], bool ); - } -} - - // -//// getValue : parse a field and store value in fielld.name -// -Impression.settings.getValue = function(field) -{ - if (field.value) - { - this[field.name] = field.value; - log( field.name + " is now " + this[field.name]); - } - else - { - logError("Can't get fieldValue"); - } -} - // -//// getCopies : parse copies field -// -Impression.settings.getCopies = function(field) { - if ( (!field.value) || (parseInt(field.value)!=field.value-0) || (parseInt(field.value) < 1) ) - { - this.copies = 1; - logError("Can't get copies"); - } - else - { - this.copies = parseInt(field.value); - } - log("copies is now " + this.copies); -} - - // -//// setValue : set field value -// -Impression.settings.setValue = function(afield, avalue) { - afield.value = avalue; - this.getValue(afield); -} - - // -//// setDisableField : set field disabled on/off -// -Impression.settings.setDisableField = function( afield, isdisabled ) { - afield.disabled = isdisabled ; -} - - // -//// disableField : set field disabled on -// -Impression.settings.disableField = function(afield) { - this.setDisableField(afield, true); -} - - // -//// fieldChanges : when a field is changed -// -Impression.settings.update = function () { - var orientation = "portrait"; - if (this.theform.type_impression_couleur.checked) - this.getValue(this.theform.type_impression_couleur); - else - this.getValue(this.theform.type_impression_nb); - - if (this.theform.disposition_recto.checked) - this.getValue(this.theform.disposition_recto); - else - this.getValue(this.theform.disposition_recto_verso); - this.getValue(this.theform.papier); - this.getCopies(this.theform.nb_copies); - this.getValue(this.theform.agrafes); - // Contraintes - if ( - ( this.papier != "A4" ) || - ( (this.disposition == "recto") && (this.nb_pages>50) ) || - ( (this.disposition == "rectoverso") && (this.nb_pages>100) ) ) - { - this.setValue(this.theform.agrafes, "pasdagraphes"); - this.disableField(this.theform.agrafes); - this.getValue(this.theform.agrafes); - } else { - this.setDisableField(this.theform.agrafes, false); - } - if (this.papier == "A4tr") - { - this.theform.disposition_recto.checked = true; - this.disableField(this.theform.disposition_recto); - this.disableField(this.theform.disposition_recto_verso); - this.getValue(this.theform.disposition_recto); - } - else - { - this.setDisableField(this.theform.disposition_recto, false); - this.setDisableField(this.theform.disposition_recto_verso, false); - } - - this.updatePreview(); - Impression.AJAX.recalcPrix(); - -} - - // -//// updatePreview : update preview with new value -// -Impression.settings.updatePreview = function() -{ - var image_name = ""; - if (this.papier == "A4tr") - image_name = "portrait_transparent_" + this.type_impression + ".png"; - else - image_name = "portrait_" + this.type_impression + '_' + this.agrafes + ".png"; - var image = createDOM("IMG",{'src':'/static/images/'+image_name}); - log("Updating preview (new image : " + image_name + ")"); - replaceChildNodes("preview",image) -} - - -/***************************** - Impression.popup - *****************************/ -Impression.popup = {}; - -Impression.popup.popupImpression = function(code) { - Popup.hide(); - Popup.create({}, "Impression en cours...", - DIV( - {"id":"printingPopupContent", "style":"background-image:url(/static/images/dialog-printer.png)"}, - SPAN("code: "+code), - A({"href":"https://wiki.crans.org/VieCrans/ImpressionReseau", "class":"aide", "target":"_blank"}, "Comment récupérer mon impression ? "), - A({"href":"index", "class":"aide", "style":"text-align:right;"}, "Nouvelle impression") - ) - - ); -Popup.display(); -} - -Impression.popup.popupError = function(erreur) { - Popup.hide(); - Popup.create({}, "Erreur", - DIV({"id":"printingPopupContent", "style":"background-image:url(/static/images/dialog-warning.png)"}, - SPAN(erreur), - A({"href":"mailto:nounous@crans.org", "class":"crans_help aide"}, "Envoyer un rapport aux nounous"), - Popup.closeLink({"class":"aide", "style":"text-align:right;"}, "Fermer"))); - Popup.display(); -} - -Impression.popup.popupSolde = function(code) { - Popup.hide(); - Popup.create({}, "Solde insuffisant", - DIV( - {"id":"printingPopupContent", "style":"background-image:url(/static/images/dialog-solde.png)"}, - SPAN("pas assez de sous"), - A({"href":"https://wiki.crans.org/CransPratique/SoldeImpression", "class":"aide", "target":"_blank"}, "Comment recharger mon compte ? "), - Popup.closeLink({"class":"aide", "style":"text-align:right;"}, "Fermer"))); - Popup.display(); -} - -Impression.popup.popupCodes = function(codeList) { - Popup.hide(); - Popup.create({}, "Codes de mes impressions", - DIV( - {"id":"printingPopupContent", "style":"background-image:url(/static/images/dialog-printer.png)"}, - SPAN("Mes codes"), - //UL({"size":"4", "style":"width:6em;; height:4em;padding:0;margin:0;list-style-type:none;overflow:auto;"}, map(function (code) {return LI({}, code);}, codeList)), - SELECT({"size":"4", "style":"width:100%;"}, map(function (code) {return LI({}, code);}, codeList)), - Popup.closeLink({"class":"aide", "style":"text-align:right;"}, "Fermer"))); - Popup.display(); -} - - - -/***************************** - Impression.mesCodes - *****************************/ -Impression.mesCodes = {}; -Impression.mesCodes.getCodes = function () -{ - Impression.AJAX.call('codeList', this.displayCodes ); -} - -Impression.mesCodes.displayCodes = function (result) { - if (result.codes) - Impression.popup.popupCodes(result.codes); - else if (result.erreur) - logError('erreur distante (codeLlist) : ' + result.erreur); - else - logError('erreur bizarre (codeLlist) : '); -} - -/***************************** - Impression.AJAX - *****************************/ -Impression.AJAX = {}; - - -Impression.AJAX.modifPrix = function( text, wheel ) -{ - if (wheel) - { - var image = createDOM("IMG",{'src':'/static/images/indicator.gif'}); - } - else - { - var image = new DIV({}); - } - var item = new DIV({'onclick':'Impression.AJAX.recalcPrix();'}, image, text); - replaceChildNodes("prix_placeholder",item); -} - -Impression.AJAX.modifNbPages = function( nbpages ) -{ - Impression.settings.nb_pages = nbpages; - replaceChildNodes("fileNbPages",nbpages); -} - -Impression.AJAX.call = function(page, callBack) { - logDebug("calling AJAX : " + page); - var e = loadJSONDoc(page); - e.addCallback(callBack); - e.addErrback(this.errorHandler); -} - -Impression.AJAX.errorHandler = function(d) { - logError("AJAX Error: " + d); - //Impression.AJAX.modifPrix("Erreur...", false); -} - - -Impression.AJAX.usefile = function(filename) { - var item = new DIV({}, "Calculs en cours..."); - this.modifPrix("Analyse du fichier...", true); - this.call('useFile?fileName=' + filename,this.analysefini ); -} - -Impression.AJAX.analysefini = function(AJAXResp) -{ - logDebug('AJAX terminated (usefile)'); - if (AJAXResp.erreur) { - Impression.AJAX.modifPrix(AJAXResp.erreur, false); - Impression.popup.popupError(AJAXResp.erreur); - Impression.settings.disableForm(true); - logWarning('Erreur distante : ' + AJAXResp.erreur); - } else { - Impression.AJAX.modifPrix("Analyse terminée", true); - Impression.settings.update(); - Impression.AJAX.modifNbPages(AJAXResp.nbPages); - } -} - -Impression.AJAX.recalcPrix = function() -{ - settings = Impression.settings; - var url = "changeSettings?copies=" + settings.copies - +"&couleurs="+ settings.type_impression - +"&papier="+ settings.papier - +"&recto_verso="+ settings.disposition - +"&agrafes="+ settings.agrafes; - this.modifPrix("Calcul en cours", true); - this.call(url, this.changePrix); -} - -Impression.AJAX.changePrix = function(AJAXResp) -{ - logDebug('AJAX terminated (recalcPrix)'); - if (AJAXResp.erreur) { - Impression.AJAX.modifPrix(AJAXResp.erreur, false); - Impression.popup.popupError(AJAXResp.erreur); - Impression.settings.disableForm(true); - logWarning('Erreur distante : ' + AJAXResp.erreur); - } else { - Impression.AJAX.modifPrix("Coût : " + AJAXResp.nouvPrix + "€", false); - } -} - -Impression.AJAX.lancerImpression = function(AJAXResp) -{ - var url = "lancerImpression"; - Impression.settings.disableForm(true); - this.call(url, this.finImpression); -} - -Impression.AJAX.finImpression = function(AJAXResp) -{ - logDebug('AJAX terminated (lancerImpression)'); - if (AJAXResp.erreur) { - Impression.popup.popupError(AJAXResp.erreur); - logWarning('Erreur distante : ' + AJAXResp.erreur); - } else if (AJAXResp.SoldeInsuffisant) { - Impression.popup.popupSolde(); - Impression.settings.disableForm(false); - Impression.settings.update(); - } else { - Impression.popup.popupImpression(AJAXResp.code); - } - Impression.AJAX.updateSolde(); - -} - -Impression.AJAX.getPrinterState = function() -{ - var url = "etatImprimante"; - Impression.AJAX.call(url, Impression.AJAX.displayPrinterState); -} - -Impression.AJAX.displayPrinterState = function(AJAXResp) -{ - logDebug('AJAX terminated (getPrinterState)'); - if (AJAXResp.erreur) { - logWarning('Erreur distante (etatImprimante) : ' + AJAXResp.erreur); - } else { - replaceChildNodes("etatImprimanteIci", AJAXResp.printer_state) - } -} - -Impression.AJAX.updateSolde = function() -{ - var url = "AJAXGetSolde"; - Impression.AJAX.call(url, Impression.AJAX.displaySolde); -} - -Impression.AJAX.displaySolde = function(AJAXResp) -{ - logDebug('AJAX terminated (updateSolde)'); - if (AJAXResp.erreur) { - logWarning('Erreur distante (etatImprimante) : ' + AJAXResp.erreur); - } else { - replaceChildNodes("soldePlaceHolder", AJAXResp.solde ) - } -} - -setInterval(Impression.AJAX.getPrinterState, 30000); -setInterval(Impression.AJAX.updateSolde, 60000); diff --git a/intranet/static/scripts/machines.js b/intranet/static/scripts/machines.js deleted file mode 100644 index 023002bb..00000000 --- a/intranet/static/scripts/machines.js +++ /dev/null @@ -1,348 +0,0 @@ -/* ************************************************************ - * Machines - ************************************************************ - * Machines.init : initialisation de la page - * Machines.listeMachines : liste des machines - * Machines.infoPane : information sur une machine - * Machines.actions : modifications, ajout... - * Machines.AJAX : ajax - */ -Machines = {}; - -/***************************** - Machines.init - *****************************/ -Machines.init = function() -{ - // afficher le tableau codelist - appendChildNodes("globalDiv", Machines.createFrames()); - appendChildNodes("globalDiv", Machines.actions.makeMenu()); - // recuperer la liste des codes - this.listeMachines.load(); -} - -Machines.createFrames = function() -{ - var main = DIV({"id":"gestion_machines_main_frame"}); - var inside = DIV({"id":"__insideDivId", "style":"background:white;margin:5px;padding:5px;"},main); - var outside = DIV({"id":"__outsideDivId","style":"background:#000080;z-index:500;padding:0;"}, inside ); - roundElement(outside); - roundElement(inside); - log("Creation du cadre"); - return outside -} - -/***************************** - Machines.listeMachines - *****************************/ -Machines.listeMachines = {}; - - -Machines.listeMachines.load = function() -{ - Machines.AJAX.call("AJAXListeMachines", Machines.listeMachines.display); - log("Chargement liste..."); - Machines.currentMachine = ''; -} - -Machines.listeMachines.display = function(result) -{ - Crans.loading.display(false); - log("display liste"); - - replaceChildNodes( "gestion_machines_main_frame", - H2({}, "Mes machines"), - UL({"id":"listeMachines"}), - DIV( {"style":"clear:both;"} ) - ); - if (result.machines) { - replaceChildNodes('listeMachines',map(Machines.listeMachines.newMachineNodeFromDict ,result.machines)); - Machines.actions.updateMenu(Machines.actions.actionForMachineList); - Machines.currentMid = ''; - } - else if (result.erreur) - logError("Erreur distante : " + result.erreur); - else - logError("Probleme bizarre..."); -} - -Machines.listeMachines.newMachineNodeFromDict = function (aDict, style) -{ - var nom = aDict.nomCourt; - var mid = aDict.mid; - var image = "machines_icon_" + aDict.type + ".png"; - //log("create an item : " + nom); - if (style) { - var anIcon = LI({'id':'machine_' + mid,"style":style}); - } else - var anIcon = LI( {'id':'machine_' + mid} ); - appendChildNodes(anIcon, A({"href":"#", "onclick":"Machines.infoPane.loadInfo('"+mid+"');return false;"}, IMG({"src":"/static/images/" + image}), SPAN({},nom) ) ); - return anIcon; -} - -/***************************** - Machines.infoPane - *****************************/ -Machines.infoPane = {}; - -Machines.infoPane.loadInfo = function(mid) -{ - if (!mid) - if (!Machines.currentMachine) { - logError("Machines.infoPane.loadInfo : pas de mid, pas de machine courrante..."); - return - } else - mid = Machines.currentMachine.mid; - - log("load info : " + mid); - Machines.AJAX.call("AJAXMachineInfo?mid=" + mid, Machines.infoPane.display); - try { - pulsate('machine_' + mid); - } catch (error) {} -} - -Machines.infoPane.display = function(result) -{ - Crans.loading.display(false); - if (result.nom) { - log("displaying info : " + result.mid); - // building pane - var machinePane = DIV({"id":"machine_pane"}); - - // lien pour retourner a la liste des machines - var back_link = A({"href":"#", "onclick":"Machines.listeMachines.load(); return false;"},"Retour"); - appendChildNodes( machinePane, back_link ); - - // titre (nom de machine + alias) - var title = H2({}, IMG({"src":"/static/images/machines_icon_" + result.type + ".png"}), " ", result.nom); - var alias = DIV({"class":"alias"}, - map(function(a_name) { return SPAN({}, a_name + " ")}, result.alias)); - appendChildNodes( title, alias ); - appendChildNodes( machinePane, title ); - - // infos de base (type, mac, ip, ipsec...) - var basicInfos = createDOM("DL", {"class":"basicInfos"}); - appendChildNodes(basicInfos, createDOM("DT", "type:" ), createDOM("DD",{},"Machine " + result.type ) ); - appendChildNodes(basicInfos, createDOM("DT", "mac: " ), createDOM("DD",{},result.mac ) ); - appendChildNodes(basicInfos, createDOM("DT", "ip: " ), createDOM("DD",{},result.ip ) ); - if (result.ipsec) - appendChildNodes(basicInfos, createDOM("DT", "Clef ipSec:" ), createDOM("DD",{},result.ipsec ) ); - appendChildNodes( machinePane, basicInfos ); - appendChildNodes( machinePane, DIV( {"style":"clear:both;"} ) ); - - - // blacklist - if (result.blacklist) - if (result.blacklist.length) { - var subtitle = H3({}, "Blacklist"); - appendChildNodes( machinePane, subtitle ); - var blacklist_table = TABLE({"class":"blacklist_table", "cellspacing":"0"}, - THEAD({}, - TH({}, "Cause"), - TH({}, "Debut"), - TH({}, "Fin") - ) - ); - map(function(a_blacklist_dict) { - var style = "inactif"; - if (a_blacklist_dict.actif) - style = "actif"; - var line = TR({"class":style}, - TD({}, a_blacklist_dict.type), - TD({}, a_blacklist_dict.begin), - TD({}, a_blacklist_dict.end) - ); - appendChildNodes(blacklist_table, line); - }, result.blacklist ); - appendChildNodes( machinePane, blacklist_table ); - } - // liste des ports ouverts - if (result.ports) - if (result.ports.length) { - var subtitle = H3({}, "Ports ouverts"); - appendChildNodes( machinePane, subtitle ); - var port_table = TABLE({"class":"ports_table", "cellspacing":"0"}); - map(function(a_port_dict) { - var line = TR({}, - TH({}, a_port_dict.titre), - map(function(a_port) {return TD({}, a_port);}, a_port_dict.ports) - ); - appendChildNodes(port_table, line); - }, result.ports ); - appendChildNodes( machinePane, port_table ); - } - - // attaching pane to document - replaceChildNodes( "gestion_machines_main_frame", machinePane); - // updationg actions - Machines.currentMachine = result; - Machines.actions.updateMenu(Machines.actions.actionsForInfoPane); - } else if (result.erreur) { - logError("Erreur distante : " + result.erreur); - } else - logError("Probleme bizarr..."); - -} - -/***************************** - Machines.actions - *****************************/ -Machines.actions = {} - -Machines.actions.disponibles = -{ - 'Ajouter machine fixe':'Machines.actions.formulaire.nouvelleMachine(\'fixe\');', - 'Ajouter machine wifi':'Machines.actions.formulaire.nouvelleMachine(\'wifi\');', - 'Modifier Mac':'Machines.actions.formulaire.modifierMac(Machines.currentMid);', - 'Renommer':'Machines.actions.formulaire.renommer(Machines.currentMid);', - 'Supprimer':'Machines.actions.formulaire.supprimer(Machines.currentMid);', - 'Demander l\'ouverture d\'un port':'Machines.actions.formulaire.ouverturePort(Machines.currentMid);' -} -Machines.actions.actionForMachineList = ['Ajouter machine fixe', 'Ajouter machine wifi']; -Machines.actions.actionsForInfoPane = ['Modifier Mac', 'Renommer', 'Supprimer']; - -Machines.actions.makeMenu = function(actionListe) -{ - log("building action menu"); - var liste = UL({"id":"liste_actions"}); - //this.updateMenu(actionListe, liste) - return DIV( {"id":"menu_actions"}, - H1( {}, "ACTIONS"), - liste - ); -} - -Machines.actions.updateMenu = function(actionListe, liste_actionsNode) -{ - if (!liste_actionsNode) - liste_actionsNode = "liste_actions"; - replaceChildNodes(liste_actionsNode); - map( - function(actionName) { - appendChildNodes(liste_actionsNode, LI({}, Machines.actions.makeActionLink(actionName))); - } - , actionListe); -} - -Machines.actions.makeActionLink = function(actionName) -{ - if (this.disponibles[actionName]) - { - return A({"href":"#", "onclick":this.disponibles[actionName] + "return false;"}, actionName); - } else - logError("action inconnue " + actionName); - return A({}, "???"); -} - - - -Machines.actions.callback = function(result) { - Crans.loading.display(false); - if (result.message){ - log(result.message); - Crans.messages.setMessage(result.message); - if (result.mid) - Machines.infoPane.loadInfo(result.mid); - else - Machines.listeMachines.load(); - } - if (result.error){ - alert(result.error); - logError("AJAX error"); - } -} - -// actions : affichage des formulaires -Machines.actions.formulaire = {} -Machines.actions.formulaire.modifierMac = function() -{ - if (!Machines.currentMachine) - logError("pas de machine courrante"); - else { - var c = ''; - while ( c == '') - c = prompt("Adresse MAC de la machine :",Machines.currentMachine.mac); - if (c == null) - return false; - // AJAX stuff - Machines.AJAX.call('AJAXchangerMAC?nouvelleMAC=' + c + '&mid=' + Machines.currentMachine.mid, - Machines.actions.callback); - } - return false; -} -Machines.actions.formulaire.renommer = function() { - if (!Machines.currentMachine) - logError("pas de machine courrante"); - else { - var c = ''; - while ( c == '') - c = prompt("Nom de la machine :",Machines.currentMachine.nomCourt); - if (c == null) - return false; - // AJAX stuff - Machines.AJAX.call('AJAXChangerNom?nouveauNom=' + c + '&mid=' + Machines.currentMachine.mid, - Machines.actions.callback); - } - return false; -} -Machines.actions.formulaire.supprimer = function() { - if (!Machines.currentMachine) - logError("pas de machine courrante"); - else { - if (confirm("Supprimer la machine " + Machines.currentMachine.nomCourt +" ?")) { - // AJAX stuff - Machines.AJAX.call('AJAXSupprimerMachine?mid=' + Machines.currentMachine.mid, - Machines.actions.callback); - } - } - return false; -} - -Machines.actions.formulaire.nouvelleMachine = function(type) { - replaceChildNodes( "gestion_machines_main_frame", - A({"href":"#", "onclick":"Machines.listeMachines.load(); return false;"},"Retour"), - H2({}, "Nouvelle machine"), - FORM({"style":"clear:both;", 'onsubmit':'Machines.actions.creerMachine(this.typeField.value, this.nom.value, this.mac.value);return false;'}, - createDOM('label', {'for':'add_machine_nom'}, "Nom de la machine : "), - INPUT({"name":"nom"}), - BR(), - createDOM('label', {'for':'add_machine_mac'}, "Adresse MAC : "), - INPUT({"name":"mac"}), - BR(), - createDOM('label', {'for':'add_machine_type'}, "Type de machine : "), - SPAN({'id':'add_machine_type'}, type), - INPUT({"name":"typeField", 'type':'hidden', 'value':type}), - BR(), - BUTTON({"class":"liens", 'type':'submit'}, 'Ajouter') - ) - ); - return false; -} - -Machines.actions.creerMachine = function(type, nom, mac) { - Machines.AJAX.call('AJAXCreerMachine?nomNouvelleMachine=' + nom - + '&MACNouvelleMachine=' + mac - + '&typeNouvelleMachine=' + type, - Machines.actions.callback); -} - -/***************************** - Machines.AJAX - *****************************/ -Machines.AJAX = {} - -Machines.AJAX.call = function(page, callBack) { - logDebug("calling AJAX : " + page); - var e = loadJSONDoc(page); - e.addCallback(callBack); - e.addErrback(this.errorHandler); - Crans.loading.display(true); - -} - -Machines.AJAX.errorHandler = function(d) { - //Machines.AJAX..modifPrix("Erreur", false); - logError("AJAX Error: " + d); - Crans.loading.display(false); -} - diff --git a/intranet/static/scripts/moncompte.js b/intranet/static/scripts/moncompte.js deleted file mode 100644 index 3abaac7e..00000000 --- a/intranet/static/scripts/moncompte.js +++ /dev/null @@ -1,41 +0,0 @@ -function askForName(oldName) { - var c = ''; - while ( c == '') - c = prompt("Votre nom :",oldName); - if (c == null) - return false; - else - window.location.href= 'changeNomAdherent?nouveauNom=' + c; -} - - -function askForSurname(oldSurname) { - var c = ''; - while ( c == '') - c = prompt("Votre prénom :",oldSurname); - if (c == null) - return false; - else - window.location.href= 'changePrenomAdherent?nouveauPrenom=' + c; -} - -function askForTel(oldTel) { - var c = ''; - while ( c == '') - c = prompt("Votre numéro de téléphone :",oldTel); - if (c == null) - return false; - else - window.location.href= 'changeTelAdherent?nouveauTel=' + c; -} - - -function newAlias() { - var c = ''; - while ( c == '') - c = prompt("Nouvel alias :"); - if (c == null) - return false; - else - window.location.href= 'newAlias?alias=' + c + "#mailTab"; -} diff --git a/intranet/static/scripts/passwordGenerator.js b/intranet/static/scripts/passwordGenerator.js deleted file mode 100644 index 18b6cf90..00000000 --- a/intranet/static/scripts/passwordGenerator.js +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************ - Password generator - ************************************************************************/ - -function GeneratePassword() { - - if (parseInt(navigator.appVersion) <= 3) { - alert("Sorry this only works in 4.0 browsers"); - return false; - } - - var length=8; - var sPassword = ""; - length = 10;//document.aForm.charLen.options[document.aForm.charLen.selectedIndex].value; - - var noPunction = false;//(document.aForm.punc.checked); - var randomLength = true;//(document.aForm.rLen.checked); - - if (randomLength) { - length = Math.random(); - - length = parseInt(length * 100); - length = (length % 7) + 6 - } - - - for (i=0; i < length; i++) { - - numI = getRandomNum(); - if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } } - - sPassword = sPassword + String.fromCharCode(numI); - } - - //document.aForm.passField.value = sPassword - c = prompt('Mot de passe généré : ', sPassword) - if (c!= null) { - document.changePasswordForm.nouveauPassword1.value = c - document.changePasswordForm.nouveauPassword2.value = c - } - return false; -} - -function getRandomNum() { - - // between 0 - 1 - var rndNum = Math.random() - - // rndNum from 0 - 1000 - rndNum = parseInt(rndNum * 1000); - - // rndNum from 33 - 127 - rndNum = (rndNum % 94) + 33; - - return rndNum; -} - -function checkPunc(num) { - - if ((num >=33) && (num <=47)) { return true; } - if ((num >=58) && (num <=64)) { return true; } - if ((num >=91) && (num <=96)) { return true; } - if ((num >=123) && (num <=126)) { return true; } - - return false; -}