OpenLayers OpenLayers

Changeset 3317

Show
Ignore:
Timestamp:
06/11/07 15:28:48 (1 year ago)
Author:
euzuro
Message:

rollback r3284, reopening #734. This patch causes tests to break in IE6. I will help to debug this at some point, but right now I am doing other things and I need all tests to pass or I can't move forward.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Util.js

    r3284 r3317  
    610610        url = window.location.href; 
    611611    } 
    612  
    613     var start = url.indexOf('?'); 
    614     var stop = url.indexOf('#'); 
    615      
    616     if (start != -1) { 
    617         if (stop != -1) { 
    618             var query = url.substring(start + 1, stop); 
    619         } else { 
    620             var query = url.substring(start + 1); 
    621         } 
    622     } else { 
    623         return {}; 
    624     } 
    625          
     612    var query = (url.indexOf('?') != -1) ? url.substring(url.indexOf('?') + 1)  
     613                                         : ''; 
    626614    var args = new Object(); 
    627615    pairs = query.split(/[&;]/); 
     
    630618        if(keyValue.length == 2) { 
    631619            args[decodeURIComponent(keyValue[0])] = 
    632                 decodeURIComponent(keyValue[1]) || ''
     620                decodeURIComponent(keyValue[1])
    633621        } 
    634622    } 
  • trunk/openlayers/tests/test_Util.html

    r3284 r3317  
    572572    } 
    573573 
    574     function test_Util_getArgs(t) { 
    575         t.plan(5); 
    576         t.eq(OpenLayers.Util.getArgs('http://www.example.com'), {}, "getArgs works when args = ''"); 
    577         t.eq(OpenLayers.Util.getArgs('http://www.example.com?'), {}, "getArgs works when args = '?'"); 
    578         t.eq(OpenLayers.Util.getArgs('http://www.example.com?hello=world&foo=bar'),  
    579                                      {'hello' : 'world', 'foo': 'bar'}, "getArgs works when args = '?hello=world&foo=bar'"); 
    580         t.eq(OpenLayers.Util.getArgs('http://www.example.com?hello=&foo=bar'),  
    581                                      {'hello' : '', 'foo': 'bar'}, "getArgs works when args = '?hello=&foo=bar'"); 
    582         t.eq(OpenLayers.Util.getArgs('http://www.example.com?foo=bar#bugssucks'),  
    583                                      {'foo': 'bar'}, "getArgs works when using a fragment identifier"); 
    584     } 
    585  
    586574   // --> 
    587575  </script>