Changeset 1083
- Timestamp:
- 2008-09-10 06:08:27 (2 months ago)
- Files:
-
- trunk/chrome/content/about/about.xul (modified) (2 diffs)
- trunk/chrome/content/about/notice.html (moved) (moved from trunk/chrome/content/about/about.html) (7 diffs, 1 prop)
- trunk/chrome/content/about/notice.xul (modified) (4 diffs)
- trunk/chrome/content/common/overlayFunctions.js (modified) (4 diffs)
- trunk/chrome/content/dta/manager.js (modified) (1 diff)
- trunk/chrome/content/dta/manager.xul (modified) (2 diffs)
- trunk/chrome/content/dta/manager/metalinker.js (modified) (1 diff)
- trunk/chrome/content/dta/select.js (modified) (1 diff)
- trunk/chrome/content/preferences/prefs.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/chrome/content/about/about.xul
r1078 r1083 69 69 Components.utils.import('resource://dta/version.jsm', DTA); 70 70 function openTab(url) { 71 DTA_Mediator.open Tab(url);71 DTA_Mediator.open(url); 72 72 self.close(); 73 73 } … … 79 79 } 80 80 function openNotice() { 81 openTab('chrome://dta/content/about/about.html#privacy');81 DTA.mediator.showNotice(window); 82 82 } 83 83 ]]></script> trunk/chrome/content/about/notice.html
- Property svn:mergeinfo set
r1078 r1083 4 4 <head> 5 5 <title>About DownThemAll!</title> 6 <script type="text/javascript"> 7 // We need to "convert" the links" 8 var Mediator = { 9 open: function(url) { 10 this.openUrl(window, url); 11 } 12 }; 13 Components.utils.import('resource://dta/mediator.jsm', Mediator); 14 function load() { 15 links = document.links; 16 for (var i = 0; i < links.length; ++i) { 17 var link = links[i]; 18 link.addEventListener('click', function() { Mediator.open(link.url); }, true); 19 link.url = link.getAttribute('href'); 20 link.setAttribute('href', ''); 21 } 22 scrollTo(0, 0); 23 } 24 addEventListener('DOMContentLoaded', load, true); 25 </script> 6 26 <style type="text/css"> 7 27 * { … … 12 32 color: #333; 13 33 line-height: 128%; 14 } 15 16 a { 17 color: #333; 34 background-color: white; 18 35 } 19 a:hover { 20 color: #663300; 36 body { 37 margin: 0; 38 padding: 15px; 39 padding-bottom: 3em; 21 40 } 22 41 23 42 p { 24 43 margin: 15px; … … 26 45 margin-bottom: 5px; 27 46 line-height: 150%; 28 }29 30 ul {31 margin: 6px 15px 5px 20px;32 padding: 5px;33 }34 35 ul ul {36 margin-top: 0px;37 }38 39 li {40 margin-top: 6px;41 margin-bottom: 6px;42 47 } 43 48 … … 54 59 } 55 60 56 table {57 text-align: left;58 margin-left: auto;59 margin-top: 5px;60 margin-bottom: 5px;61 margin-right: auto;62 width: 85%;63 border-collapse: collapse;64 border-bottom: #ddd solid 3px;65 }66 67 td {68 vertical-align: top;69 margin-bottom: 3px;70 padding-bottom: 3px;71 padding-right: 20px;72 padding-left: 10px;73 border-bottom: #ddd solid 1px;74 }75 76 th {77 text-align: center;78 font-weight: bold;79 border-top: #FFE391 solid 1px;80 border-bottom: #FFE391 solid 1px;81 background-color: #FFF9DF;82 }83 84 61 strong { 85 62 font-style: normal; … … 87 64 } 88 65 89 code { 90 font-family: monospace !important; 91 background-color: #f3f3f3; 92 padding: 1px; 93 border-top: 1px solid #e3e3e3; 94 border-bottom: 1px solid #e3e3e3; 66 a { 67 text-decoration: underline; 95 68 } 96 69 97 pre {70 #license { 98 71 font-family: monospace !important; 99 72 overflow: auto; 100 background-color: #fff9df;101 border: 1px solid #ffe391;102 margin: 15px;103 }104 105 pre#license {106 73 background-color: transparent; 107 74 margin: 0px; 108 75 border-width: 0px; 109 font-size: 90%;110 76 } 111 112 #main { 113 margin: 0; 114 padding: 15px; 115 padding-top: 42px; 116 padding-bottom: 3em; 117 background: white url(chrome://dta/skin/common/logo.png) no-repeat right top; 118 } 77 #license, #license a { 78 font-size: 85%; 79 } 80 </style> 81 </head> 82 83 <body> 84 <!-- Fake anchor so that xul:iframe will not reposition --> 85 <h1 id="privacy">Privacy Notice<a href="#"></a></h1> 86 <p>DownThemAll protects your privacy.</p> 87 <p>You can remove complete, canceled, and unfinished downloads from the download window by changing the settings in the Preferences->Privacy panel.</p> 88 <p>You can enable diagnostic messages which will be logged to both the error console and written to the dta_log.txt file (contained in the dTa folder) by the Preferences->Privacy panel. Diagnostic messages will likely contain sensitive information like URLs, file paths, filenames you're downloading, or even cookie information. This option is DISABLED by default to protect your privacy. If you submit a diagnostic message, you may wish to censor this sensitive information.</p> 89 <p>DownThemAll connects to our website to get news, donation messages, and latest version number. This feature can be disabled by changing the setting in the Preferences->Privacy panel.</p> 90 <p>This notice is always available from this help and additionally linked on the About window.</p> 91 92 <h1 id="copyright">Copyright and License</h1> 93 <div id="license"> 94 <p>Copyright (C) 2004-2007 Federico Parodi and Stefano Verna<br/> 95 Copyright (C) 2007-2008 Nils Maier, Federico Parodi and Stefano Verna</p> 119 96 120 .shortcut { 121 padding: 1px 3px; 122 background-color: #EFEAD1; 123 border: 1px solid #DFD299; 124 -moz-border-radius: 4px; 125 } 126 </style> 127 </head> 128 <body> 97 <p>DownThemAll! is licensed under <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GPL 2.0</a>. See the GPL file. This applies to all source code files.</p> 129 98 130 <div id="main"> 131 <h1 id="copyright">Copyright and License</h1> 132 <pre id="license">Copyright (C) 2004-2007 Federico Parodi and Stefano Verna 133 Copyright (C) 2007-2008 Nils Maier, Federico Parodi and Stefano Verna 134 135 DownThemAll! is licensed under <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GPL 2.0</a>. See the GPL file. 136 This applies to all source code files. 137 138 Individual files may have different licenses. 139 See the corresponding repository files available from 140 <a href="http://code.downthemall.net/repos/">http://code.downthemall.net/repos/</a> 141 Many files are tri-licensed under a MPL 1.1/GPL 2.0/LGPL 2.1 license; 142 See the MPL, GPL, LGPL files respectively. 143 144 Most important parts from the GPL 2.0: 145 146 NO WARRANTY 147 148 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 99 <p>Individual files may have different licenses. See the corresponding repository files available from <a href="http://code.downthemall.net/repos/">http://code.downthemall.net/repos/</a>. 100 Many files are tri-licensed under a MPL 1.1/GPL 2.0/LGPL 2.1 license; See the MPL, GPL, LGPL files respectively.</p> 101 102 <p>Most important parts from the GPL 2.0:</p> 103 104 <h3>NO WARRANTY</h3> 105 <p>11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 149 106 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 150 107 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES … … 154 111 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 155 112 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 156 REPAIR OR CORRECTION. 113 REPAIR OR CORRECTION.</p> 157 114 158 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING115 <p>12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 159 116 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 160 117 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, … … 164 121 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 165 122 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 166 POSSIBILITY OF SUCH DAMAGES. 123 POSSIBILITY OF SUCH DAMAGES.</p> 167 124 125 <h3>Icons and buttons</h3> 126 <p>Icons and buttons are based on the works of Mike Matas, Jakub Steiner and Mark James</p> 127 <ul> 128 <li>© Michael Matas,</li> 129 <li>© Jakub Steiner, © Novell, Inc.</li> 130 <li>© Mark James (famfamfam silk icons)</li> 131 </ul> 132 </div> 168 133 169 dTa contains pieces of code taken from:170 Linky * Copyright (C) 2002-2003 Henrik Gemal171 172 Icons and buttons are based on the works of Mike Matas, Jakub Steiner and Mark James173 * (C) Michael Matas,174 * (C) Jakub Steiner, (C) Novell, Inc.175 * (C) Mark James (famfamfam silk icons)176 </pre>177 178 <h1 id="privacy">Privacy Notice</h1>179 <p>DownThemAll protects your privacy.</p>180 <p>You can remove complete, canceled, and unfinished downloads from the download window by changing the settings in the Preferences->Privacy panel.</p>181 <p>You can enable diagnostic messages which will be logged to both the error console and written to the dta_log.txt file (contained in the dTa folder) by the Preferences->Privacy panel. Diagnostic messages will likely contain sensitive information like URLs, file paths, filenames you're downloading, or even cookie information. This option is DISABLED by default to protect your privacy. If you submit a diagnostic message, you may wish to censor this sensitive information.</p>182 <p>DownThemAll connects to our website to get news, donation messages, and latest version number. This feature can be disabled by changing the setting in the Preferences->Privacy panel.</p>183 <p>This notice is always available from this help and additionally linked on the About window.</p>184 185 134 <h2 id="contact">Contacts</h2> 186 135 <p>We like to receive your feedback, suggestions or offers to help.</p> 187 136 <p>Please see our <a href="http://www.downthemall.net/main/contacts/">Contact page</a> online.</p> 188 189 </div>190 137 </body> 191 138 </html> trunk/chrome/content/about/notice.xul
r1078 r1083 11 11 title="DownThemAll! - License and Privacy Notice" 12 12 buttons="accept,cancel" 13 buttonlabelaccept="&accept;"14 13 buttonlabelcancel="&decline;" 15 14 ondialogaccept="return accept();" … … 17 16 width="500" height="420" 18 17 style="padding: 0px 0px 3px 0px;" 18 acceptLabel="&accept;" 19 19 > 20 20 <script type="application/javascript"><![CDATA[ 21 21 22 22 function load(evt) { 23 if (evt.originalTarget.location.href.search(/about\.html$/) != -1) { 24 var doc = document.getElementById('frame').contentDocument; 25 var head = doc.getElementById('header') 26 head.parentNode.removeChild(head); 23 if (!window.arguments || !window.arguments.length) { 24 document.documentElement.getButton('cancel').hidden = true; 27 25 } 26 else { 27 button = document.documentElement.getButton('accept'); 28 button.setAttribute('label', document.documentElement.getAttribute('acceptLabel')); 29 } 30 document.getElementById('frame').contentWindow.scrollTo(0, 0); 28 31 } 29 32 function accept() { 33 if (!window.arguments || !window.arguments.length) { 34 return true; 35 } 36 30 37 let Preferences = {}; 31 38 Components.utils.import('resource://dta/preferences.jsm', Preferences); … … 42 49 } 43 50 function cancel() { 44 if (!confirm(_("conf"))) { 51 if (!window.arguments || !window.arguments.length) { 52 return true; 53 } 54 if (!confirm(document.getElementById('bundle').getString('conf'))) { 45 55 return false; 46 56 } … … 61 71 ]]></script> 62 72 <stringbundleset> 63 <stringbundle src="chrome://dta/locale/notice.properties"/>73 <stringbundle id="bundle" src="chrome://dta/locale/notice.properties"/> 64 74 </stringbundleset> 65 <iframe id="frame" src="chrome://dta/content/about/about.html" flex="1"/> 75 <hbox style="background: white url(chrome://dta/skin/common/logo.png) no-repeat top right; height: 43px;"/> 76 <iframe id="frame" style="background: white;" src="chrome://dta/content/about/notice.html" flex="1"/> 66 77 </dialog> trunk/chrome/content/common/overlayFunctions.js
r1078 r1083 359 359 openManager : function (quite) { 360 360 try { 361 var win = DTA_Mediator.get ByUrl("chrome://dta/content/dta/manager.xul");361 var win = DTA_Mediator.getMostRecent('DTA:Manager'); 362 362 if (win) { 363 363 if (!quite) { … … 371 371 "chrome, centerscreen, resizable=yes, dialog=no, all, modal=no, dependent=no" 372 372 ); 373 return DTA_Mediator.get ByUrl("chrome://dta/content/dta/manager.xul");373 return DTA_Mediator.getMostRecent('DTA:Manager'); 374 374 } catch(ex) { 375 375 DTA_debug.log("openManager():", ex); … … 379 379 380 380 sendToDown : function(start, links) { 381 var win = DTA_Mediator.get ByUrl("chrome://dta/content/dta/manager.xul");381 var win = DTA_Mediator.getMostRecent('DTA:Manager'); 382 382 if (win) { 383 383 win.self.startDownloads(start, links); … … 393 393 } 394 394 } 395 var DTA_Mediator = { 396 _m: Components.classes["@mozilla.org/appshell/window-mediator;1"] 397 .getService(Components.interfaces.nsIWindowMediator), 398 _ios: Components.classes["@mozilla.org/network/io-service;1"] 399 .getService(Components.interfaces.nsIIOService), 400 401 getMostRecent: function(name) { 402 var names = ['navigator:browser', 'mail:messageWindow', 'mail:3pane']; 403 if (name) { 404 names.unshift(name); 405 } 406 var rv = null; 407 names.some( 408 function(name) { 409 rv = this._m.getMostRecentWindow(name); 410 return rv; 411 }, 412 this 413 ); 414 return rv; 415 }, 416 getByUrl: function(url) { 417 if (!url) { 418 return null; 419 } 420 if (url instanceof DTA_URL) { 421 url = url.url; 422 } 423 if (url instanceof Components.interfaces.nsIURI) { 424 url = url.spec; 425 } 426 var enumerator = this._m.getEnumerator(null); 427 while (enumerator.hasMoreElements()) { 428 var win = enumerator.getNext(); 429 if (win.location == url) { 430 return win; 431 } 432 } 433 return null; 434 }, 435 getAllByType: function(type) { 436 var rv = []; 437 var enumerator = this._m.getEnumerator(type); 438 while (enumerator.hasMoreElements()) { 439 rv.push(enumerator.getNext()); 440 } 441 return rv; 442 }, 443 openTab: function WM_openTab(url, ref) { 444 if (!url) { 445 return; 446 } 447 var win = this.getMostRecent(); 448 if (!win) { 449 window.open(); 450 win = this.getMostRecent(); 451 } 452 if (url instanceof DTA_URL) { 453 url = url.url; 454 } 455 if (ref instanceof DTA_URL) { 456 ref = ref.url; 457 } 458 if (!url instanceof Components.interfaces.nsIURI) { 459 throw new Error("Cannot open non nsIURI"); 460 } 461 if (ref && !(ref instanceof Components.interfaces.nsIURI)) { 462 try { 463 ref = DTA_AddingFunctions.ios.newURI(ref, null, null); 464 } 465 catch (ex) { 466 DTA_debug.log(ref, ex); 467 ref = null; 468 } 469 } 470 try { 471 if ('delayedOpenTab' in win) { 472 win.delayedOpenTab(url, ref); 473 return; 474 } 475 win.getBrowser().addTab(url, ref); 476 } 477 // thunderbird? 478 catch (ex) { 479 try { 480 var ps = Components.classes['@mozilla.org/uriloader/external-protocol-service;1'] 481 .getService(Components.interfaces.nsIExternalProtocolService); 482 ps.loadUrl(url); 483 } 484 catch (ex) { 485 DTA_debug.log("cannot open link", ex); 486 } 487 } 488 }, 489 removeTab: function WM_removeTab(url) { 490 function chk(browser, url) { 491 if (browser.currentURI.spec == url) { 492 return true; 493 } 494 var frames = browser.contentWindow.frames; 495 if (frames && frames.length) { 496 for (var i = 0; i < frames.length; i++) { 497 if (frames[i].location && frames[i].location == url) { 498 return true; 499 } 500 } 501 } 502 return false; 503 }; 504 505 var enumerator = this._m.getEnumerator("navigator:browser"); 506 while (enumerator.hasMoreElements()) { 507 var win = enumerator.getNext(); 508 var browser = win.getBrowser(); 509 for (var i = browser.browsers.length - 1; i >= 0; --i) { 510 if (chk(browser.getBrowserAtIndex(i), url)) { 511 browser.removeTab(browser.mTabContainer.childNodes[i]); 512 return; 513 } 514 } 515 } 516 } 517 }; 395 396 let DTA_Mediator = { 397 open: function DTA_Mediator_open(url, ref) { 398 this.openUrl(window, url, ref); 399 } 400 } 401 Components.utils.import('resource://dta/mediator.jsm', DTA_Mediator); 518 402 519 403 /** trunk/chrome/content/dta/manager.js
r1078 r1083 188 188 }, 189 189 190 openDonate: function D_openDonate() { 191 try { 192 DTA_Mediator.open('http://www.downthemall.net/howto/donate/'); 193 } 194 catch(ex) { 195 alert(ex); 196 } 197 }, 198 190 199 start: function D_start() { 191 200 if ("arguments" in window) { trunk/chrome/content/dta/manager.xul
r1078 r1083 22 22 23 23 <window 24 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 24 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 25 windowtype="DTA:Manager" 25 26 onload="Dialog.init();" 26 27 title="DownThemAll!" … … 140 141 <toolbarbutton label="&movebottom.label;" id="toolmovebottom" oncommand="Tree.bottom();" /> 141 142 <spacer flex="1" /> 142 <image chromedir="&locale.dir;" id="tooldonate" onc ommand="DTA_Mediator.openTab('http://www.downthemall.net/howto/donate/');" tooltiptext="&tooldonate.tooltiptext;" />143 <image chromedir="&locale.dir;" id="tooldonate" onclick="Dialog.openDonate();" tooltiptext="&tooldonate.tooltiptext;" /> 143 144 </toolbar> 144 145 </toolbox> trunk/chrome/content/dta/manager/metalinker.js
r1039 r1083 416 416 }, 417 417 openLink: function(e) { 418 DTA_Mediator.open Tab(e.link);418 DTA_Mediator.open(e.link); 419 419 }, 420 420 select: function(type) { trunk/chrome/content/dta/select.js
r1078 r1083 759 759 tree.selection.getRangeAt(r, start, end); 760 760 for (var i = start.value; i <= end.value; ++i) { 761 DTA_Mediator.open Tab(tree._links[i].url.url, tree._links[i].referrer);761 DTA_Mediator.open(tree._links[i].url.url, tree._links[i].referrer); 762 762 } 763 763 } trunk/chrome/content/preferences/prefs.js
r1078 r1083 93 93 showLog: function() { 94 94 if (Debug.file.exists()) { 95 DTA_Mediator.open Tab("file://" + Debug.file.path);95 DTA_Mediator.open("file://" + Debug.file.path); 96 96 } 97 97 }, … … 112 112 }, 113 113 showNotice: function() { 114 DTA_Mediator. openTab('chrome://dta/content/about/about.html#privacy');114 DTA_Mediator.showNotice(window); 115 115 } 116 116 }; … … 186 186 }, 187 187 openMinTrayR: function() { 188 DTA_Mediator.open Tab('http://tn123.ath.cx/mintrayr/?fromdta');188 DTA_Mediator.open('http://tn123.ath.cx/mintrayr/?fromdta'); 189 189 } 190 190 };
