includes/clientside/static/faders.js
changeset 215 94db56b8124f
parent 210 2b283402e4e4
child 326 ab66d6d1f1f4
equal deleted inserted replaced
214:a6ed8b6cdbe1 215:94db56b8124f
   182   
   182   
   183   if(type & MB_OK)
   183   if(type & MB_OK)
   184   {
   184   {
   185     btn = document.createElement('input');
   185     btn = document.createElement('input');
   186     btn.type = 'button';
   186     btn.type = 'button';
   187     btn.value = 'OK';
   187     btn.value = $lang.get('etc_ok');
       
   188     btn._GenericName = 'OK';
   188     btn.onclick = this.clickHandler;
   189     btn.onclick = this.clickHandler;
   189     btn.style.margin = '0 3px';
   190     btn.style.margin = '0 3px';
   190     buttondiv.appendChild(btn);
   191     buttondiv.appendChild(btn);
   191   }
   192   }
   192   
   193   
   193   if(type & MB_OKCANCEL)
   194   if(type & MB_OKCANCEL)
   194   {
   195   {
   195     btn = document.createElement('input');
   196     btn = document.createElement('input');
   196     btn.type = 'button';
   197     btn.type = 'button';
   197     btn.value = 'OK';
   198     btn.value = $lang.get('etc_ok');
       
   199     btn._GenericName = 'OK';
   198     btn.onclick = this.clickHandler;
   200     btn.onclick = this.clickHandler;
   199     btn.style.margin = '0 3px';
   201     btn.style.margin = '0 3px';
   200     buttondiv.appendChild(btn);
   202     buttondiv.appendChild(btn);
   201     
   203     
   202     btn = document.createElement('input');
   204     btn = document.createElement('input');
   203     btn.type = 'button';
   205     btn.type = 'button';
   204     btn.value = 'Cancel';
   206     btn.value = $lang.get('etc_cancel');
       
   207     btn._GenericName = 'Cancel';
   205     btn.onclick = this.clickHandler;
   208     btn.onclick = this.clickHandler;
   206     btn.style.margin = '0 3px';
   209     btn.style.margin = '0 3px';
   207     buttondiv.appendChild(btn);
   210     buttondiv.appendChild(btn);
   208   }
   211   }
   209   
   212   
   210   if(type & MB_YESNO)
   213   if(type & MB_YESNO)
   211   {
   214   {
   212     btn = document.createElement('input');
   215     btn = document.createElement('input');
   213     btn.type = 'button';
   216     btn.type = 'button';
   214     btn.value = 'Yes';
   217     btn.value = $lang.get('etc_yes');
       
   218     btn._GenericName = 'Yes';
   215     btn.onclick = this.clickHandler;
   219     btn.onclick = this.clickHandler;
   216     btn.style.margin = '0 3px';
   220     btn.style.margin = '0 3px';
   217     buttondiv.appendChild(btn);
   221     buttondiv.appendChild(btn);
   218     
   222     
   219     btn = document.createElement('input');
   223     btn = document.createElement('input');
   220     btn.type = 'button';
   224     btn.type = 'button';
   221     btn.value = 'No';
   225     btn.value = $lang.get('etc_no');
       
   226     btn._GenericName = 'No';
   222     btn.onclick = this.clickHandler;
   227     btn.onclick = this.clickHandler;
   223     btn.style.margin = '0 3px';
   228     btn.style.margin = '0 3px';
   224     buttondiv.appendChild(btn);
   229     buttondiv.appendChild(btn);
   225   }
   230   }
   226   
   231   
   227   if(type & MB_YESNOCANCEL)
   232   if(type & MB_YESNOCANCEL)
   228   {
   233   {
   229     btn = document.createElement('input');
   234     btn = document.createElement('input');
   230     btn.type = 'button';
   235     btn.type = 'button';
   231     btn.value = 'Yes';
   236     btn.value = $lang.get('etc_yes');
       
   237     btn._GenericName = 'Yes';
   232     btn.onclick = this.clickHandler;
   238     btn.onclick = this.clickHandler;
   233     btn.style.margin = '0 3px';
   239     btn.style.margin = '0 3px';
   234     buttondiv.appendChild(btn);
   240     buttondiv.appendChild(btn);
   235     
   241     
   236     btn = document.createElement('input');
   242     btn = document.createElement('input');
   237     btn.type = 'button';
   243     btn.type = 'button';
   238     btn.value = 'No';
   244     btn.value = $lang.get('etc_no');
       
   245     btn._GenericName = 'No';
   239     btn.onclick = this.clickHandler;
   246     btn.onclick = this.clickHandler;
   240     btn.style.margin = '0 3px';
   247     btn.style.margin = '0 3px';
   241     buttondiv.appendChild(btn);
   248     buttondiv.appendChild(btn);
   242     
   249     
   243     btn = document.createElement('input');
   250     btn = document.createElement('input');
   244     btn.type = 'button';
   251     btn.type = 'button';
   245     btn.value = 'Cancel';
   252     btn.value = $lang.get('etc_cancel');
       
   253     btn._GenericName = 'Cancel';
   246     btn.onclick = this.clickHandler;
   254     btn.onclick = this.clickHandler;
   247     btn.style.margin = '0 3px';
   255     btn.style.margin = '0 3px';
   248     buttondiv.appendChild(btn);
   256     buttondiv.appendChild(btn);
   249   }
   257   }
   250   
   258   
   293   fly_in_top(maindiv, true, false);
   301   fly_in_top(maindiv, true, false);
   294 }
   302 }
   295 
   303 
   296 function messagebox_click(obj, mb)
   304 function messagebox_click(obj, mb)
   297 {
   305 {
   298   val = obj.value;
   306   val = ( typeof ( obj._GenericName ) == 'string' ) ? obj._GenericName : obj.value;
   299   if(typeof mb.onbeforeclick[val] == 'function')
   307   if(typeof mb.onbeforeclick[val] == 'function')
   300   {
   308   {
   301     var o = mb.onbeforeclick[val];
   309     var o = mb.onbeforeclick[val];
   302     var resp = o();
   310     var resp = o();
   303     if ( resp )
   311     if ( resp )