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

Unified Diff: chrome/browser/resources/history/history.js

Issue 12039045: History: Fix RTL layout in grouped history and some other minor fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last minor fixes Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/history/history.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history/history.js
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index 66dcc1096519c624287190f32aab9807d7daca9f..acccde7a2c56bd2fe57d93dc66a48dd3d8b6d649 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -175,7 +175,8 @@ Visit.prototype.getResultDOM = function(propertyBag) {
* @private
*/
Visit.prototype.getDomainFromURL_ = function(url) {
- var domain = url.replace(/^.+:\/\//, '').match(/[^/]+/);
+ // TODO(sergiu): Extract the domain from the C++ side and send it here.
+ var domain = url.replace(/^.+?:\/\//, '').match(/[^/]+/);
return domain ? domain[0] : '';
};
@@ -406,8 +407,8 @@ HistoryModel.prototype.addResults = function(info, results) {
this.queryStartTime = info.queryStartTime;
this.queryEndTime = info.queryEndTime;
- // If the results are not for the current search term there's nothing more
- // to do.
+ // If the results are not for the current search term then there is nothing
+ // more to do.
if (info.term != this.searchText_)
return;
@@ -847,9 +848,9 @@ HistoryView.prototype.setVisitRendered_ = function(visit) {
};
/**
- * This function generates and adds the grouped visits DOM for a certain
- * domain. This includes the clickable arrow and domain name and the visit
- * entries for that domain.
+ * Generates and adds the grouped visits DOM for a certain domain. This
+ * includes the clickable arrow and domain name and the visit entries for
+ * that domain.
* @param {Element} results DOM object to which to add the elements.
* @param {string} domain Current domain name.
* @param {Array} domainVisits Array of visits for this domain.
@@ -871,7 +872,9 @@ HistoryView.prototype.getGroupedVisitsDOM_ = function(
var numberOfVisits = createElementWithClassName('span', 'number-visits');
numberOfVisits.textContent = loadTimeData.getStringF('numbervisits',
domainVisits.length);
- siteDomain.textContent = domain;
+ var domainElement = document.createElement('span');
+ domainElement.textContent = domain;
+ siteDomain.appendChild(domainElement);
siteDomain.appendChild(numberOfVisits);
siteResults.appendChild(siteDomainWrapper);
var resultsList = siteResults.appendChild(
@@ -949,9 +952,8 @@ HistoryView.prototype.groupVisitsByDomain_ = function(visits, results) {
};
domains.sort(sortByVisits);
- for (var i = 0, domain; domain = domains[i]; i++) {
+ for (var i = 0, domain; domain = domains[i]; i++)
this.getGroupedVisitsDOM_(results, domain, visitsByDomain[domain]);
- }
};
/**
« no previous file with comments | « chrome/browser/resources/history/history.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698