Changeset 622
- Timestamp:
- 2007-09-29 23:17:00 (1 year ago)
- Files:
-
- trunk/chrome/content/common/overlayFunctions.js (modified) (5 diffs)
- trunk/chrome/content/dta/manager.js (modified) (1 diff)
- trunk/chrome/content/integration/elements.js (modified) (3 diffs)
- trunk/chrome/content/integration/saveas.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/chrome/content/common/overlayFunctions.js
r618 r622 292 292 function DTA_URL(url, charset, usable, preference) { 293 293 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 } 296 298 this.preference = preference ? preference : 100; 297 299 … … 307 309 }, 308 310 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(/#.*$/, ''); 310 319 this.usable = ''; 311 320 this.decode(); … … 345 354 } 346 355 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 348 360 var ref = DTA_AddingFunctions.getRef(doc); 349 361 this.func(url, ref); … … 444 456 445 457 saveSingleLink : function(turbo, url, referrer, description) { 446 var hash = null;447 458 var ml = DTA_getLinkPrintMetalink(url.url); 448 459 if (ml) { 449 460 url.url = ml; 450 } 451 else { 452 hash = DTA_getLinkPrintHash(url.url); 453 } 454 url.url = url.url.replace(/#.*$/, ''); 455 461 } 456 462 var item = { 457 463 'url': url, 458 464 'referrer': referrer, 459 'description': description, 460 'hash': hash 465 'description': description 461 466 }; 462 467 … … 732 737 } 733 738 } 739 DTA_Hash.prototype = { 740 toString: function() { 741 return this.type + " [" + this.sum + "]"; 742 } 743 }; 734 744 735 745 /** trunk/chrome/content/dta/manager.js
r621 r622 2267 2267 e.referrer 2268 2268 ); 2269 if ( 'hash' in e && e.hash) {2270 d.hash = e. hash;2269 if (e.url.hash) { 2270 d.hash = e.url.hash; 2271 2271 } 2272 2272 else { trunk/chrome/content/integration/elements.js
r527 r622 67 67 // remove anchor from url 68 68 var link = lnks[i]; 69 var plink = link.href.replace(/#.*$/gi, "");70 69 // if it's valid and it's new 71 if (!DTA_AddingFunctions.isLinkOpenable( plink)) {70 if (!DTA_AddingFunctions.isLinkOpenable(link.href)) { 72 71 continue; 73 72 } … … 80 79 } 81 80 urls.push({ 82 'url': new DTA_URL( plink, doc.characterSet),81 'url': new DTA_URL(link.href, doc.characterSet), 83 82 'referrer': ref, 84 83 'description': this.extractDescription(link), 85 'ultDescription': udesc, 86 'hash': DTA_getLinkPrintHash(link.hash) 84 'ultDescription': udesc 87 85 }); 88 86 … … 330 328 } 331 329 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 333 333 var ref = DTA_AddingFunctions.getRef(document.commandDispatcher.focusedWindow.document); 334 334 var desc = this.extractDescription(cur); trunk/chrome/content/integration/saveas.js
r546 r622 84 84 this.referrer = this.url; 85 85 } 86 this.url = new DTA_URL(this.url); 86 var ml = getLinkPrintMetalink(this.url); 87 this.url = new DTA_ULR(ml ? ml : this.url); 87 88 88 89 this.ddDirectory = document.getElementById('tdtalist');
