Changeset 1030

Show
Ignore:
Timestamp:
2008-08-02 17:24:28 (2 months ago)
Author:
MaierMan
Message:

#830: use nsIURL for DTA_URL
Some bugfixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/common/overlayFunctions.js

    r1027 r1030  
    201201                        url = url.url.spec; 
    202202                } 
     203                else if (url instanceof Components.interfaces.nsIURL) { 
     204                        url = url.spec; 
     205                } 
    203206                try { 
    204207                        var scheme = this.ios.extractScheme(url); 
  • trunk/chrome/content/dta/select.js

    r993 r1030  
    5959                                function() { 
    6060                                        if (!this._icon) { 
    61                                                 this._icon = getIcon(this.url, 'metalink' in this); 
     61                                                this._icon = getIcon(this.url.url.spec, 'metalink' in this); 
    6262                                        } 
    6363                                        return this._icon; 
  • trunk/chrome/content/integration/elements.js

    r1027 r1030  
    106106                        return; 
    107107                } 
    108  
     108                 
    109109                var ref = DTA_AddingFunctions.getRef(doc); 
    110110 
    111111                for (var i = 0; i < lnks.length; ++i) { 
    112112                        var src = lnks[i].src; 
    113                         if (!DTA_AddingFunctions.isLinkOpenable(src)) { 
    114                                 try { 
    115                                         src = DTA_AddingFunctions.composeURL(doc, src).spec; 
    116                                 } 
    117                                 catch (ex) { 
    118                                         DTA_debug.log("failed to compose: " + src, ex); 
    119                                         continue; 
    120                                 } 
     113                        try { 
     114                                src = DTA_AddingFunctions.composeURL(doc, src); 
     115                        } 
     116                        catch (ex) { 
     117                                DTA_debug.log("failed to compose: " + src, ex); 
     118                                continue; 
    121119                        } 
    122120                        // if it's valid and it's new 
     
    133131                        } 
    134132                        images.push({ 
    135                                 'url': new DTA_URL(DTA_AddingFunctions.ios.newURI(src, doc.characterSet)), 
     133                                'url': new DTA_URL(src), 
    136134                                'referrer': ref, 
    137135                                'description': desc 
     
    263261                                return i.filter( 
    264262                                        function(e) { 
    265                                                 var url = e.url.url
     263                                                let url = e.url.url.spec
    266264                                                if (url in known) { 
    267265                                                        return false; 
     
    275273                        if (turbo) { 
    276274                                DTA_debug.logString("findLinks(): DtaOneClick request from the user"); 
    277                         } else { 
     275                        } 
     276                        else { 
    278277                                DTA_debug.logString("findLinks(): DtaStandard request from the user"); 
    279278                        } 
     
    289288                        var urls = []; 
    290289                        var images = []; 
    291                         windows.forEach( 
    292                                 function(win) { 
    293                                         this.addLinks(win, urls, images, !all); 
    294                                 }, 
    295                                 this 
    296                         ); 
     290                        for each (let win in windows) { 
     291                                this.addLinks(win, urls, images, !all); 
     292                        } 
    297293                        urls = makeUnique(urls); 
    298294                        images = makeUnique(images); 
     
    307303                                        DTA_AddingFunctions.saveLinkArray(true, urls, images); 
    308304                                        return; 
    309                                 } catch (ex) { 
     305                                } 
     306                                catch (ex) { 
    310307                                        DTA_debug.log('findLinks', ex); 
    311308                                        DTA_Prompts.alert(window, this.getString('error'), this.getString('errorinformation'));