Changeset 622

Show
Ignore:
Timestamp:
2007-09-29 23:17:00 (1 year ago)
Author:
MaierMan
Message:

Link-fingerprints (Hashes/Metalink) not recognized.
Regression by #359.

Files:

Legend:

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

    r618 r622  
    292292function DTA_URL(url, charset, usable, preference) { 
    293293        this.charset = this.str(charset); 
    294         this.usable = this.str(usable); 
    295         this._url = this.str(url).replace(/#.*$/, ''); 
     294        this.url = url; 
     295        if (usable) { 
     296                this.usable = this.str(usable); 
     297        } 
    296298        this.preference = preference ? preference : 100; 
    297299 
     
    307309        }, 
    308310        set url(nv) { 
    309                 this._url = this.str(nv).replace(/#.*$/, ''); 
     311                delete this.hash; 
     312                this._url = this.str(nv); 
     313                var hash = DTA_getLinkPrintHash(this._url); 
     314                if (hash) { 
     315                        this.hash = hash; 
     316                        alert(hash); 
     317                } 
     318                this._url = this._url.replace(/#.*$/, ''); 
    310319                this.usable = ''; 
    311320                this.decode(); 
     
    345354                } 
    346355                var doc = document.commandDispatcher.focusedWindow.document; 
    347                 url = new DTA_URL(url, doc.characterSet); 
     356                 
     357                var ml = DTA_getLinkPrintMetalink(url); 
     358                url = new DTA_URL(ml ? ml : url, doc.characterSet); 
     359                 
    348360                var ref = DTA_AddingFunctions.getRef(doc); 
    349361                this.func(url, ref); 
     
    444456 
    445457        saveSingleLink : function(turbo, url, referrer, description) { 
    446                 var hash = null;                 
    447458                var ml = DTA_getLinkPrintMetalink(url.url); 
    448459                if (ml) { 
    449460                        url.url = ml; 
    450                 } 
    451                 else { 
    452                         hash = DTA_getLinkPrintHash(url.url); 
    453                 } 
    454                 url.url = url.url.replace(/#.*$/, ''); 
    455                  
     461                }                
    456462                var item = { 
    457463                        'url': url, 
    458464                        'referrer': referrer, 
    459                         'description': description, 
    460                         'hash': hash 
     465                        'description': description 
    461466                }; 
    462467 
     
    732737        } 
    733738} 
     739DTA_Hash.prototype = { 
     740        toString: function() { 
     741                return this.type + " [" + this.sum + "]"; 
     742        } 
     743}; 
    734744 
    735745/** 
  • trunk/chrome/content/dta/manager.js

    r621 r622  
    22672267                        e.referrer 
    22682268                ); 
    2269                 if ('hash' in e && e.hash) { 
    2270                         d.hash = e.hash; 
     2269                if (e.url.hash) { 
     2270                        d.hash = e.url.hash; 
    22712271                } 
    22722272                else { 
  • trunk/chrome/content/integration/elements.js

    r527 r622  
    6767                        // remove anchor from url 
    6868                        var link = lnks[i]; 
    69                         var plink = link.href.replace(/#.*$/gi, ""); 
    7069                        // if it's valid and it's new 
    71                         if (!DTA_AddingFunctions.isLinkOpenable(plink)) { 
     70                        if (!DTA_AddingFunctions.isLinkOpenable(link.href)) { 
    7271                                continue; 
    7372                        } 
     
    8079                        } 
    8180                        urls.push({ 
    82                                 'url': new DTA_URL(plink, doc.characterSet), 
     81                                'url': new DTA_URL(link.href, doc.characterSet), 
    8382                                'referrer': ref, 
    8483                                'description': this.extractDescription(link), 
    85                                 'ultDescription': udesc, 
    86                                 'hash': DTA_getLinkPrintHash(link.hash) 
     84                                'ultDescription': udesc 
    8785                        }); 
    8886                         
     
    330328                        } 
    331329                         
    332                         url = new DTA_URL(url, win.document.characterSet); 
     330                        var ml = DTA_getLinkPrintMetalink(url); 
     331                        url = new DTA_URL(ml ? ml : url, win.document.characterSet); 
     332                         
    333333                        var ref = DTA_AddingFunctions.getRef(document.commandDispatcher.focusedWindow.document); 
    334334                        var desc = this.extractDescription(cur); 
  • trunk/chrome/content/integration/saveas.js

    r546 r622  
    8484                        this.referrer = this.url; 
    8585                } 
    86                 this.url = new DTA_URL(this.url); 
     86                var ml = getLinkPrintMetalink(this.url); 
     87                this.url = new DTA_ULR(ml ? ml : this.url); 
    8788 
    8889                this.ddDirectory = document.getElementById('tdtalist');