Changeset 16806 for util

Show
Ignore:
Timestamp:
07/03/07 11:40:48 (17 months ago)
Author:
agentz
Message:

smartlinks.pl - removed trailing spaces in JS and skipped S26 when --check is specified

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/smartlinks.pl

    r16545 r16806  
    6969      element['on' + type] = handleEvent; 
    7070    } 
    71      
     71 
    7272    // store the event handler in the hash table 
    7373    handlers[handler.$$guid] = handler; 
     
    8989  // grab the event object (IE uses a global event object) 
    9090  event = event || fixEvent(window.event); 
    91    
     91 
    9292  var returnValue = true; 
    93    
     93 
    9494  // get a reference to the hash table of event handlers 
    9595  var handlers = this.events[event.type]; 
     
    134134  var matches = this.id.match(/smartlink_toggle(\d+)/); 
    135135  var num = matches[1]; 
    136    
     136 
    137137  var id = 'smartlink_' + num; 
    138138  var div = document.getElementById(id); 
    139139  div.style.display = (div.style.display == 'none') ? '' : 'none'; 
    140    
     140 
    141141  var text = this.firstChild; 
    142142  text.nodeValue = text.nodeValue.replace(/^- (Show|Hide)/, function (full, p1) { return "- " + ((p1 == 'Show') ? 'Hide' : 'Show') }); // this may be unnecessarily complicated, or it may not.  you get to decide. :-) 
    143    
     143 
    144144  e.stopPropagation(); 
    145145  e.preventDefault(); 
     
    162162addEvent(window, 'load', function () { 
    163163  var divs = collectionToArray(document.getElementsByTagName('div')); 
    164    
     164 
    165165  for (var i = 0, j = divs.length; i < j; i++) { 
    166166    var curr = divs[i]; 
     
    176176 
    177177      var p = curr.previousSibling; 
    178        
     178 
    179179      while (p.nodeType != 1) { p = p.previousSibling; } // ignore any whitespace-only nodes 
    180        
     180 
    181181      var text = p.firstChild; 
    182182      text.nodeValue = text.nodeValue.replace(/^From/, '- Show'); 
    183        
     183 
    184184      var link = document.createElement('a'); 
    185        
     185 
    186186      var child; 
    187187      while (child = p.firstChild) { 
    188188        link.appendChild(child); 
    189189      } 
    190        
     190 
    191191      var end = link.lastChild; 
    192192      if ((end.nodeType == 3) && (end.nodeValue.search(/:$/) > -1)) { 
    193193        end.nodeValue = end.nodeValue.replace(/:$/, ' -'); 
    194194      } 
    195        
     195 
    196196      link.href = '#'; 
    197197      link.id = 'smartlink_toggle' + num; 
    198198      addEvent(link, 'click', toggle_snippet); 
    199        
     199 
    200200      p.appendChild(link); 
    201201      curr.parentNode.insertBefore(p, curr); 
     
    613613    # S26 is in Pod6, we treat it specifically for now. 
    614614    if ($syn_id == 26) { 
     615      return if $check; 
    615616      eval "use Perl6::Perldoc 0.000005; use Perl6::Perldoc::Parser; use Perl6::Perldoc::To::Xhtml;"; 
    616617      if ($@) {