Subversion Repositories wimsdev

Rev

Rev 7850 | 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.   case oefcommand :
  89.     text = oefcommandfun(instruction);
  90.     break;
  91.   case latex :
  92.     text = latexfun(instruction);
  93.     break;
  94.   case iff :
  95.     text = ifffun(instruction);
  96.     break;
  97.   case special :
  98.     text = specialfun(instruction);
  99.     break;
  100.   case oefparm0 :
  101.     text = oefparm0fun(instruction);
  102.     break;
  103.   case oefparm1 :
  104.     text = oefparm1fun(instruction);
  105.     break;
  106.   case oefparm2 :
  107.     text = oefparm2fun(instruction);
  108.     break;
  109.   case oefparm3 :
  110.     text = oefparm3fun(instruction);
  111.     break;
  112.   case oefparm4 :
  113.     text = oefparm4fun(instruction);
  114.     break;
  115.   case oefparm5 :
  116.     text = oefparm5fun(instruction);
  117.     break;
  118.   case slib :
  119.     text = slibfun(instruction);
  120.     break;
  121.   case anstype :
  122.     text = anstypefun(instruction);
  123.     break;
  124.  
  125.   }
  126.   div_aide.innerHTML = "<h3 style='display:inline-block;margin-top:0;'>" + instruction + "</h3><div class='description'>" + text + "</div>";
  127.  
  128. }
  129.  
  130. function funcname() {
  131.   switch(instructionsss){
  132.   case oefcommand :
  133.     titre_bd= oefcommandname;
  134.     break;
  135.   case latex :
  136.     titre_bd= latexname;
  137.     break;
  138.   case iff :
  139.     titre_bd= iffname;
  140.     break;
  141.   case special :
  142.     titre_bd= specialname;
  143.     break;
  144.   case oefparm0 :
  145.     titre_bd=oefparm0name;
  146.     break;
  147.   case oefparm1 :
  148.     titre_bd=oefparm1name;
  149.     break;
  150.   case oefparm2 :
  151.     titre_bd=oefparm2name;
  152.     break;
  153.   case oefparm3 :
  154.     titre_bd=oefparm3name;
  155.     break;
  156.   case oefparm4 :
  157.     titre_bd=oefparm4name;
  158.     break;
  159.   case oefparm5 :
  160.     titre_bd=oefparm5name;
  161.     break;
  162.   case slib :
  163.     titre_bd= slibname;
  164.     break;
  165.   case anstype :
  166.     titre_bd= anstypename;
  167.     break;
  168.  
  169.   }
  170. }
  171. //enregistrer() :
  172. function enregistrer() {
  173.   var chaine = document.forms['replyform'].wims_deposit.value;
  174.   alert(chaine);
  175. }
  176.  
  177. //initlist() :
  178. instructionsss=oefcommand;
  179. function initlist() {
  180. //alert('initlist');
  181.   liste = "-";
  182.   compter = 0;
  183.   index = null;
  184.   k = null;
  185.   y = 0;
  186.   instructionwims = "";
  187.  
  188.   //ie error    alert(document.forms['replyform'].wims_deposit.value;);
  189.   var formselect = document.getElementById("divoptions");
  190.   funcname();
  191.   var n2 = instructionsss.length;
  192.   var liste = "";
  193.   for (var i = 0; i < n2; i++) {
  194.     liste = liste + "<option>" + instructionsss[i] + "</option>";
  195.   }
  196.   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>";
  197.   document.getElementById("name_list_instruction").innerHTML = titre_bd ;
  198. }
  199.  
  200. function changerListeInstruction() {
  201.   afficherHud('hud_video_intro');
  202. }
  203.  
  204. function changerListeInstruction2(nomdutabo) {
  205.   instructionsss=nomdutabo;
  206.   hudAnimationFermeture('hud_video_intro');
  207.   initlist();
  208. }
  209.