Ignore:
Timestamp:
04/02/07 15:10:25 (13 years ago)
Author:
ray
Message:

updated branch

Location:
branches/ray/plugins/SmartReplace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ray/plugins/SmartReplace/dialog.html

    r762 r806  
    88  <tr> 
    99    <td style="width:15px"><input type="checkbox" id="[convert]" name="[convert]" /></td> 
    10     <td style="text-align:left"><l10n>Convert all quotes and dashes in the current document</l10n></td> 
     10    <td style="text-align:left"><l10n>Convert all quotes and dashes in the current document</l10n> <input style="display:none" type="button" id="[ok]" value="_(OK)" /></td> 
    1111  </tr> 
    1212</table> 
    1313</div> 
    1414<div class="buttons"> 
    15   <input type="button" id="[ok]"     value="_(OK)"     /> 
    16   <input type="button" id="[cancel]" value="_(Cancel)" /> 
     15   
    1716</div> 
  • branches/ray/plugins/SmartReplace/smart-replace.js

    r786 r806  
    243243        this.editor.setHTML(html); 
    244244} 
    245 SmartReplace.prototype.dialog = function() 
    246 { 
    247         var self = this; 
    248         var action = function (param) 
    249         { 
    250                 self.toggleActivity(param.enable);  
    251                 if (param.convert) 
    252                 { 
    253                         self.replaceAll(); 
    254                 } 
    255         } 
    256         var init = this; 
    257         Dialog(_editor_url+'plugins/SmartReplace/popups/dialog.html', action, init); 
    258 } 
    259  
    260245 
    261246SmartReplace.prototype.buttonPress = function(opts, obj) 
     
    304289  this.dialog = new Xinha.Dialog(editor, this.html, 'SmartReplace',{},{modal:false}); 
    305290  this.dialog.attachToPanel('top'); 
     291   
     292  this.dialog.getElementById('enable').onchange = function () 
     293  { 
     294        self.toggleActivity(this.checked);  
     295  } 
     296  this.dialog.getElementById('convert').onchange = function () 
     297  { 
     298        self.dialog.getElementById('ok').style.display = ( this.checked ) ? '' : 'none';  
     299  } 
     300  this.dialog.getElementById('ok').onclick = function () 
     301  { 
     302        self.replaceAll(); 
     303        self.dialog.getElementById('convert').checked = false;  
     304        this.style.display =  'none';  
     305  } 
    306306  this.ready = true; 
    307307}; 
    308308 
    309 SmartReplace.prototype.show = function(inputs, ok, cancel) 
     309SmartReplace.prototype.show = function(inputs) 
    310310{ 
    311311  if(!this.ready) 
     
    318318  // Connect the OK and Cancel buttons 
    319319  var self = this; 
    320   if(ok) 
    321   { 
    322     this.dialog.getElementById('ok').onclick = ok; 
    323   } 
    324   else 
    325   { 
    326     this.dialog.getElementById('ok').onclick = function() {self.dialog.hide();}; 
    327   } 
    328  
    329   if(cancel) 
    330   { 
    331     this.dialog.getElementById('cancel').onclick = cancel; 
    332   } 
    333   else 
    334   { 
    335     this.dialog.getElementById('cancel').onclick = function() { self.dialog.hide()}; 
    336   } 
    337320 
    338321  this.dialog.show(inputs); 
Note: See TracChangeset for help on using the changeset viewer.