Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/browser/resources/downloads.html

Issue 119318: Fix the in-progress download status in the download page for the RTL UI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html id="t" jsvalues="dir:textdirection;"> 2 <html id="t" jsvalues="dir:textdirection;">
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title jscontent="title"></title> 5 <title jscontent="title"></title>
6 <link rel="icon" href="../../app/theme/downloads_favicon.png"> 6 <link rel="icon" href="../../app/theme/downloads_favicon.png">
7 <style> 7 <style>
8 body { 8 body {
9 background-color:white; 9 background-color:white;
10 color:black; 10 color:black;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 } 197 }
198 198
199 /** 199 /**
200 * Sets the display style of a node. 200 * Sets the display style of a node.
201 */ 201 */
202 function showInline(node, isShow) { 202 function showInline(node, isShow) {
203 node.style.display = isShow ? 'inline' : 'none'; 203 node.style.display = isShow ? 'inline' : 'none';
204 } 204 }
205 205
206 function showInlineBlock(node, isShow) {
207 node.style.display = isShow ? 'inline-block' : 'none';
208 }
209
206 /** 210 /**
207 * Creates an element of a specified type with a specified class name. 211 * Creates an element of a specified type with a specified class name.
208 * @param {String} type The node type. 212 * @param {String} type The node type.
209 * @param {String} className The class name to use. 213 * @param {String} className The class name to use.
210 */ 214 */
211 function createElementWithClassName(type, className) { 215 function createElementWithClassName(type, className) {
212 var elm = document.createElement(type); 216 var elm = document.createElement(type);
213 elm.className = className; 217 elm.className = className;
214 return elm; 218 return elm;
215 } 219 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 this.nodeImg_.src = 'chrome://fileicon/' + this.filePath_; 508 this.nodeImg_.src = 'chrome://fileicon/' + this.filePath_;
505 509
506 if (this.state_ == Download.States.COMPLETE) { 510 if (this.state_ == Download.States.COMPLETE) {
507 this.nodeFileLink_.innerHTML = this.fileName_; 511 this.nodeFileLink_.innerHTML = this.fileName_;
508 this.nodeFileLink_.href = this.filePath_; 512 this.nodeFileLink_.href = this.filePath_;
509 } else { 513 } else {
510 this.nodeFileName_.innerHTML = this.fileName_; 514 this.nodeFileName_.innerHTML = this.fileName_;
511 } 515 }
512 516
513 showInline(this.nodeFileLink_, this.state_ == Download.States.COMPLETE); 517 showInline(this.nodeFileLink_, this.state_ == Download.States.COMPLETE);
514 showInline(this.nodeFileName_, this.state_ != Download.States.COMPLETE); 518 // nodeFileName_ has to be inline-block to avoid the 'interaction' with
519 // nodeStatus_. If both are inline, it appears that their text contents
520 // are merged before BiDi algorithm is applied leading to an undesirable
521 // reordering.
jeremy 2009/06/10 01:21:09 BiDi algorithm -> The bidi Algorithm Also, could
522 showInlineBlock(this.nodeFileName_, this.state_ != Download.States.COMPLETE) ;
515 523
516 if (this.state_ == Download.States.IN_PROGRESS) { 524 if (this.state_ == Download.States.IN_PROGRESS) {
517 this.nodeProgressForeground_.style.display = 'block'; 525 this.nodeProgressForeground_.style.display = 'block';
518 this.nodeProgressBackground_.style.display = 'block'; 526 this.nodeProgressBackground_.style.display = 'block';
519 527
520 // Draw a pie-slice for the progress. 528 // Draw a pie-slice for the progress.
521 this.canvasProgress_.clearRect(0, 0, 529 this.canvasProgress_.clearRect(0, 0,
522 Download.Progress.width, 530 Download.Progress.width,
523 Download.Progress.height); 531 Download.Progress.height);
524 this.canvasProgress_.beginPath(); 532 this.canvasProgress_.beginPath();
525 this.canvasProgress_.moveTo(Download.Progress.centerX, 533 this.canvasProgress_.moveTo(Download.Progress.centerX,
526 Download.Progress.centerY); 534 Download.Progress.centerY);
527 535
528 this.canvasProgress_.arc(Download.Progress.centerX, 536 this.canvasProgress_.arc(Download.Progress.centerX,
529 Download.Progress.centerY, 537 Download.Progress.centerY,
530 Download.Progress.radius, 538 Download.Progress.radius,
531 Download.Progress.base, 539 Download.Progress.base,
532 Download.Progress.base + Math.PI * 0.02 * 540 Download.Progress.base + Math.PI * 0.02 *
533 Number(this.percent_) * 541 Number(this.percent_),
534 (Download.Progress.dir ? -1 : 1), 542 false);
jeremy 2009/06/10 01:21:09 Could you add a comment with a link back to the bu
535 Download.Progress.dir);
536 543
537 this.canvasProgress_.lineTo(Download.Progress.centerX, 544 this.canvasProgress_.lineTo(Download.Progress.centerX,
538 Download.Progress.centerY); 545 Download.Progress.centerY);
539 this.canvasProgress_.fill(); 546 this.canvasProgress_.fill();
540 this.canvasProgress_.closePath(); 547 this.canvasProgress_.closePath();
541 } else if (this.nodeProgressBackground_) { 548 } else if (this.nodeProgressBackground_) {
542 this.nodeProgressForeground_.style.display = 'none'; 549 this.nodeProgressForeground_.style.display = 'none';
543 this.nodeProgressBackground_.style.display = 'none'; 550 this.nodeProgressBackground_.style.display = 'none';
544 } 551 }
545 552
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 chrome.send("cancel", [this.id_.toString()]); 657 chrome.send("cancel", [this.id_.toString()]);
651 return false; 658 return false;
652 } 659 }
653 660
654 /////////////////////////////////////////////////////////////////////////////// 661 ///////////////////////////////////////////////////////////////////////////////
655 // Page: 662 // Page:
656 var downloads, localStrings, resultsTimeout; 663 var downloads, localStrings, resultsTimeout;
657 664
658 function load() { 665 function load() {
659 localStrings = new LocalStrings($('l10n')); 666 localStrings = new LocalStrings($('l10n'));
660 Download.Progress.dir = document.documentElement.dir == 'rtl';
661 downloads = new Downloads(); 667 downloads = new Downloads();
662 $('term').focus(); 668 $('term').focus();
663 setSearch(""); 669 setSearch("");
664 } 670 }
665 671
666 function setSearch(searchText) { 672 function setSearch(searchText) {
667 downloads.clear(); 673 downloads.clear();
668 downloads.setSearchText(searchText); 674 downloads.setSearchText(searchText);
669 chrome.send("getDownloads", [searchText.toString()]); 675 chrome.send("getDownloads", [searchText.toString()]);
670 } 676 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 <span id="danger_save" jscontent="danger_save">Save</span> 752 <span id="danger_save" jscontent="danger_save">Save</span>
747 <span id="danger_discard" jscontent="danger_discard">Discard</span> 753 <span id="danger_discard" jscontent="danger_discard">Discard</span>
748 754
749 <span id="control_pause" jscontent="control_pause">Pause</span> 755 <span id="control_pause" jscontent="control_pause">Pause</span>
750 <span id="control_showinfolder" jscontent="control_showinfolder">Show in folde r</span> 756 <span id="control_showinfolder" jscontent="control_showinfolder">Show in folde r</span>
751 <span id="control_cancel" jscontent="control_cancel">Cancel</span> 757 <span id="control_cancel" jscontent="control_cancel">Cancel</span>
752 <span id="control_resume" jscontent="control_resume">Resume</span> 758 <span id="control_resume" jscontent="control_resume">Resume</span>
753 </div> 759 </div>
754 </body> 760 </body>
755 </html> 761 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698