Subversion Repositories wimsdev

Rev

Rev 7850 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3425 obado 1
//Ensemble de Fonctions génériques :
2
 
7850 bpr 3
// Actuliste :
3425 obado 4
function actuliste(liste, indice) {
14239 obado 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;
3425 obado 14
}
15
 
7850 bpr 16
// parcoursTab :
3425 obado 17
function parcoursTab(instructionwims, indice) {
14239 obado 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
  }
3425 obado 48
}
49
 
50
//anime :
51
function anime() {
14239 obado 52
  initlist();
53
  //if (chrono == null) chrono = setInterval("change()", 10);
3425 obado 54
}
55
 
56
//anime2 :
57
function anime2() {
14239 obado 58
  if (chrono2 === null) chrono2 = setInterval("instruction()", 15);
3425 obado 59
}
60
 
61
//image :
62
function image() {
14239 obado 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);
3425 obado 71
}
72
 
73
//afficheaide :
74
function afficheaide(langue) {
75
 
14239 obado 76
  var div_aide = document.getElementById("aide");
77
  var selectedoption = document.getElementsByTagName("OPTION");
78
  var instruction = selectedoption[document.forms['formu'].sel.selectedIndex].innerHTML;
3425 obado 79
 
14239 obado 80
  //alert(instruction);
81
  if (langue == "undefined") langue = version;
82
  if (langue == "eng") version = "eng";
83
  if (langue == "fr") version = "fr";
7850 bpr 84
 
14239 obado 85
  var text="";
7850 bpr 86
 
14239 obado 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;
7850 bpr 124
 
14239 obado 125
  }
126
  div_aide.innerHTML = "<h3 style='display:inline-block;margin-top:0;'>" + instruction + "</h3><div class='description'>" + text + "</div>";
7850 bpr 127
 
3461 bpr 128
}
3425 obado 129
 
3478 bpr 130
function funcname() {
14239 obado 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;
7850 bpr 168
 
14239 obado 169
  }
3425 obado 170
}
171
//enregistrer() :
172
function enregistrer() {
14239 obado 173
  var chaine = document.forms['replyform'].wims_deposit.value;
174
  alert(chaine);
3425 obado 175
}
176
 
177
//initlist() :
3461 bpr 178
instructionsss=oefcommand;
3425 obado 179
function initlist() {
180
//alert('initlist');
14239 obado 181
  liste = "-";
182
  compter = 0;
183
  index = null;
184
  k = null;
185
  y = 0;
186
  instructionwims = "";
3425 obado 187
 
14239 obado 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 ;
3425 obado 198
}
3437 obado 199
 
3425 obado 200
function changerListeInstruction() {
14239 obado 201
  afficherHud('hud_video_intro');
3425 obado 202
}
203
 
204
function changerListeInstruction2(nomdutabo) {
14239 obado 205
  instructionsss=nomdutabo;
206
  hudAnimationFermeture('hud_video_intro');
207
  initlist();
7850 bpr 208
}