Subversion Repositories wimsdev

Rev

Rev 6975 | 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 = "<h3>"+names["contextual_help"]+"</h3> - "+names["contextual_help_desc"];
  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 = "<h3>"+names["contextual_help"]+"</h3> - "+names["contextual_help_desc"];
  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()", 15);
  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.                 description=names["image_alt"];
  68.         }
  69.     var image = "\\img{" + url + "}{alt='" + description + "'}";
  70.         Cursor_AddTexte('wims_deposit_id', image);
  71. }
  72.  
  73. //afficheaide :
  74. function afficheaide(langue) {
  75.  
  76.         var div_aide = document.getElementById("aide");
  77.         var selectedoption = document.getElementsByTagName("OPTION");
  78.         var instruction = selectedoption[document.forms['formu'].sel.selectedIndex].innerHTML;
  79.  
  80.         //alert(instruction);
  81.         if (langue == "undefined") langue = version;
  82.         if (langue == "eng") version = "eng";
  83.         if (langue == "fr") version = "fr";
  84.  
  85.         var text="";
  86.  
  87.     switch(instructionsss)
  88.         {
  89.         case oefcommand :
  90.                 text = oefcommandfun(instruction);
  91.                 break;
  92.         case latex :
  93.                 text = latexfun(instruction);
  94.                 break;
  95.         case iff :
  96.                 text = ifffun(instruction);
  97.                 break;
  98.         case special :
  99.                 text = specialfun(instruction);
  100.                 break;
  101.         case oefparm0 :
  102.                 text = oefparm0fun(instruction);
  103.                 break;
  104.         case oefparm1 :
  105.                 text = oefparm1fun(instruction);
  106.                 break;
  107.         case oefparm2 :
  108.                 text = oefparm2fun(instruction);
  109.                 break;
  110.         case oefparm3 :
  111.                 text = oefparm3fun(instruction);
  112.                 break;
  113.         case oefparm4 :
  114.                 text = oefparm4fun(instruction);
  115.                 break;
  116.         case oefparm5 :
  117.                 text = oefparm5fun(instruction);
  118.                 break;
  119.         case slib :
  120.                 text = slibfun(instruction);
  121.                 break;
  122.     case anstype :
  123.                 text = anstypefun(instruction);
  124.                 break;
  125.  
  126.         }
  127.         div_aide.innerHTML = "<h3 style='display:inline-block;margin-top:0;'>" + instruction + "</h3><div class='description'>" + text + "</div>";
  128.  
  129. }
  130.  
  131. function funcname() {
  132. switch(instructionsss)
  133.         {
  134.         case oefcommand :
  135.                 titre_bd= oefcommandname;
  136.                 break;
  137.         case latex :
  138.                 titre_bd= latexname;
  139.                 break;
  140.         case iff :
  141.                 titre_bd= iffname;
  142.                 break;
  143.         case special :
  144.                 titre_bd= specialname;
  145.                 break;
  146.         case oefparm0 :
  147.                 titre_bd=oefparm0name;
  148.                 break;
  149.         case oefparm1 :
  150.                 titre_bd=oefparm1name;
  151.                 break;
  152.         case oefparm2 :
  153.                 titre_bd=oefparm2name;
  154.                 break;
  155.         case oefparm3 :
  156.                 titre_bd=oefparm3name;
  157.                 break;
  158.         case oefparm4 :
  159.                 titre_bd=oefparm4name;
  160.                 break;
  161.         case oefparm5 :
  162.                 titre_bd=oefparm5name;
  163.         break;
  164.         case slib :
  165.                 titre_bd= slibname;
  166.                 break;
  167.     case anstype :
  168.                 titre_bd= anstypename;
  169.                 break;
  170.  
  171.         }
  172. }
  173. //enregistrer() :
  174. function enregistrer() {
  175.         var chaine = document.forms['replyform'].wims_deposit.value;
  176.         alert(chaine);
  177. }
  178.  
  179. //initlist() :
  180. instructionsss=oefcommand;
  181. function initlist() {
  182. //alert('initlist');
  183.         liste = "-";
  184.         compter = 0;
  185.         index = null;
  186.         k = null;
  187.         y = 0;
  188.         instructionwims = "";
  189.  
  190.         //ie error    alert(document.forms['replyform'].wims_deposit.value;);
  191.         var formselect = document.getElementById("divoptions");
  192.         funcname();
  193.         var n2 = instructionsss.length;
  194.         var liste = "";
  195.         for (var i = 0; i < n2; i++) {
  196.                 liste = liste + "<option>" + instructionsss[i] + "</option>";
  197.         }
  198.         formselect.innerHTML = "<form name='formu' onclick='afficheaide();'><select ondblclick='inser()' id='select' name='sel' size='10'>" + liste + "</select><br/><input type='button' class='wims_button' value='"+names["insert_selection"]+"' onclick='inser()' /></form>";
  199.     document.getElementById("name_list_instruction").innerHTML = titre_bd ;
  200. }
  201.  
  202. function changerListeInstruction() {
  203.         afficherHud('hud_video_intro');
  204. }
  205.  
  206. function changerListeInstruction2(nomdutabo) {
  207.         instructionsss=nomdutabo;
  208.         hudAnimationFermeture('hud_video_intro');
  209.         initlist();
  210. }
  211.