Subversion Repositories wimsdev

Rev

Rev 3427 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. //Ensemble de Fonctions génériques :
  2.  
  3. // Actuliste :
  4. function actuliste(liste, indice) {
  5.         var mytool_array = liste.split("-");
  6.         var n2 = mytool_array.length;
  7.         var liste2 = "";
  8.         for (var i = 0; i < n2; i++) {
  9.                 liste2 = liste2 + "<OPTION>" + mytool_array[i] + "</OPTION>";
  10.         }
  11.         document.forms['formu'].sel.innerHTML = liste2;
  12.         //var chaine=document.form.wims_deposit.value;
  13.         //var n=chaine.length;
  14. }
  15.  
  16. // parcoursTab :
  17. function parcoursTab(instructionwims, indice) {
  18.         if (instructionwims != "\\") {
  19.                 //var mytool_array=instructionwims.split("\\");
  20.                 //var instructionwims=mytool_array[1];
  21.                 //alert(instructionwims);
  22.                 var a = "^\\" + instructionwims + "";
  23.                 var n2 = instructionsss.length;
  24.                 for (var i = 0; i < n2; i++) {
  25.                         var instruction = instructionsss[i];
  26.                         var MonReg = new RegExp(a);
  27.                         if (MonReg.test(instruction)) {
  28.                                 liste = liste + instruction + "-";
  29.                         }
  30.                 }
  31.                 compter++;
  32.                 if (liste == "-") {
  33.                         var div_aide = document.getElementById("aide");
  34.                         div_aide.innerHTML = "<strong>Aide contextuelle</strong> - tapez antislash suivi d'une lettre en minuscule!";
  35.                         initlist();
  36.                 }
  37.                 else {
  38.                         actuliste(liste, indice);
  39.                 }
  40.                 liste = "-";
  41.                 if (compter == 4) {
  42.                         compter = 0;
  43.                         liste = "-";
  44.                         var div_aide = document.getElementById("aide");
  45.                         div_aide.innerHTML = "<strong>Aide contextuelle</strong> - tapez antislash suivi d'une lettre en minuscule!";
  46.                 }
  47.         }
  48. }
  49.  
  50. //anime :
  51. function anime() {
  52.         initlist();
  53.         //if (chrono == null) chrono = setInterval("change()", 10);
  54. }
  55.  
  56. //anime2 :
  57. function anime2() {
  58.         if (chrono2 == null) chrono2 = setInterval("instruction()", 10);
  59. }
  60.  
  61. //image :
  62. function image() {
  63.         var url = document.getElementById("url").value;
  64.         var description = document.getElementById("description").value;
  65.         hudAnimationFermeture('hud_video_intro');
  66.         if (description == "") {
  67.                 var image = "\\img{" + url + "}{alt='description manquante'}";
  68.         }
  69.         else {
  70.                 var image = "\\img{" + url + "}{alt='" + description + "'}";
  71.         }
  72.         Cursor_AddTexte('wims_deposit_id', image);
  73. }
  74.  
  75. //afficheaide :
  76. function afficheaide(langue) {
  77.  
  78.         var div_aide = document.getElementById("aide");
  79.         var selectedoption = document.getElementsByTagName("OPTION");
  80.         var instruction = selectedoption[document.forms['formu'].sel.selectedIndex].innerHTML;
  81.  
  82.         //alert(instruction);
  83.         if (langue == "undefined") langue = version;
  84.         if (langue == "eng") version = "eng";
  85.         if (langue == "fr") version = "fr";
  86.        
  87.         switch(instructionsss)
  88.         {
  89.         case cities :
  90.         var text = bd(instruction, version);
  91.         break;
  92.         case liste_func_latec :
  93.         var text = bdlatec(instruction, version);
  94.         break;
  95.         case ifffff :
  96.         var text = iffffffun(instruction, version);
  97.         break;
  98.         case special :
  99.         var text = specialfun(instruction, version);
  100.         break;
  101.         case oef0 :
  102.         var text = oef0fun(instruction, version);
  103.         break;
  104.         case oefparm1 :
  105.         var text = oef1fun(instruction, version);
  106.         break;
  107.         case oefparm2 :
  108.         var text = oef2fun(instruction, version);
  109.         break;
  110.         case oefparm4 :
  111.         var text = oef4fun(instruction, version);
  112.         break;
  113.         case oefparm5 :
  114.         var text = oef5fun(instruction, version);
  115.         break;
  116.        
  117.         }
  118.  
  119.         if (text == "<img src='images/t1.gif'>" || text == "<img src='images/t2.gif'>" || text == "<img src='images/t3.gif'>" || text == "<img src='images/t4.gif'>" || text == "<img src='images/t5.gif'>") {
  120.                 div_aide.innerHTML = "<p><strong>" + instruction + " -instruction latex</strong></p><div>" + text + "</div>";
  121.         }
  122.         else {
  123.  
  124.                 div_aide.innerHTML = "<p><strong>" + instruction + " -instruction wims</strong></p><div>" + text + "</div>";
  125.  
  126.         }
  127.  
  128.         //var mytool_array = text.split("\n");
  129.         //var lignes = mytool_array.length;
  130.         //if (lignes < 5) lignes = 0;
  131.         //div_aide.style.marginBottom="44px";
  132.         //div_aide.style.marginBottom = ""+lignes+"em";
  133.         //if(text=="<img src='images/t1.gif'>") div_aide.style.marginBottom ="222px";
  134.         //if(text=="<img src='images/t2.gif'>") div_aide.style.marginBottom ="200px";
  135.         //if(text=="<img src='images/t3.gif'>") div_aide.style.marginBottom ="144px";
  136.         //alert(text);
  137. }
  138.  
  139. //enregistrer() :
  140. function enregistrer() {
  141.         var chaine = document.forms['replyform'].wims_deposit.value;
  142.         alert(chaine);
  143. }
  144.  
  145. //initlist() :
  146. instructionsss=cities;
  147. function initlist() {
  148. //alert('initlist');
  149.         liste = "-";
  150.         compter = 0;
  151.         index = null;
  152.         k = null;
  153.         y = 0;
  154.         instructionwims = "";
  155.  
  156.         //ie error    alert(document.forms['replyform'].wims_deposit.value;);
  157.         var formselect = document.getElementById("divoptions");
  158.  
  159.         var n2 = instructionsss.length;
  160.         var liste = "";
  161.         for (var i = 0; i < n2; i++) {
  162.                 liste = liste + "<OPTION>" + instructionsss[i] + "</OPTION>";
  163.         }
  164.         formselect.innerHTML = "<FORM NAME='formu' onClick='afficheaide();'><SELECT ondblclick='inser()' id='select' NAME='sel' SIZE='10'>" + liste + "</SELECT><br><input type='button' value='insérer la sélection' onclick='inser()' /></FORM>";
  165.  
  166. }
  167. function changerListeInstruction() {
  168. afficherHud('hud_video_intro');
  169. }
  170.  
  171. function changerListeInstruction2(nomdutabo) {
  172. instructionsss=nomdutabo;
  173. hudAnimationFermeture('hud_video_intro');
  174. initlist();
  175. }
  176.  
  177.