[extensions-web] review: Namespace CSS classes better
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] review: Namespace CSS classes better
- Date: Tue, 7 Feb 2012 18:08:08 +0000 (UTC)
commit 091c9e9ba50612f92d09ced16a03e31744951cbb
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Feb 7 13:03:25 2012 -0500
review: Namespace CSS classes better
sweettooth/static/css/review.css | 16 ++++++----------
sweettooth/static/js/diff.js | 10 +++++-----
2 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/sweettooth/static/css/review.css b/sweettooth/static/css/review.css
index 7156c4a..45321ad 100644
--- a/sweettooth/static/css/review.css
+++ b/sweettooth/static/css/review.css
@@ -84,7 +84,7 @@ p.nochanges {
border-right: 1px solid #ccc;
}
-.line {
+.diff-line {
white-space: pre;
/* makes blank lines "expand",
@@ -93,27 +93,23 @@ p.nochanges {
}
/* colors stolen from Splinter */
-.deleted {
+.diff-line.deleted, .fileselector.deleted {
background-color: #ffccaa;
}
-.inserted, .added {
+.diff-line.inserted, .fileselector.added {
background-color: #bbffbb;
}
-.replaced {
+.diff-line.replaced {
background-color: #aaccff;
}
-.changed {
+.diff-inline.changed {
background-color: #cceeff;
}
-.fileselector.changed {
- background-color: transparent;
-}
-
-.unchanged {
+.fileselector.unchanged {
color: #747474;
}
diff --git a/sweettooth/static/js/diff.js b/sweettooth/static/js/diff.js
index 2362561..8d04668 100644
--- a/sweettooth/static/js/diff.js
+++ b/sweettooth/static/js/diff.js
@@ -47,7 +47,7 @@ define(['jquery'], function($) {
var contents = oldContents[oldLinum - 1];
- var $row = $('<tr>', {'class': 'line equal'}).
+ var $row = $('<tr>', {'class': 'diff-line equal'}).
append($('<td>', {'class': 'old linum'}).text(oldLinum)).
append($('<td>', {'class': 'old contents'}).html(contents)).
append($('<td>', {'class': 'new linum'}).text(newLinum)).
@@ -81,7 +81,7 @@ define(['jquery'], function($) {
var linum = line[2];
var contents = newContents[linum - 1];
- return $('<tr>', {'class': 'line inserted'}).
+ return $('<tr>', {'class': 'diff-line inserted'}).
append($('<td>', {'class': 'linum'})).
append($('<td>')).
append($('<td>', {'class': 'new linum'}).text(linum)).
@@ -94,7 +94,7 @@ define(['jquery'], function($) {
var linum = line[1];
var contents = oldContents[linum - 1];
- return $('<tr>', {'class': 'line deleted'}).
+ return $('<tr>', {'class': 'diff-line deleted'}).
append($('<td>', {'class': 'old linum'}).text(linum)).
append($('<td>', {'class': 'old contents'}).html(contents)).
append($('<td>', {'class': 'linum'})).
@@ -117,7 +117,7 @@ define(['jquery'], function($) {
// half-row.
function buildReplaceRegions(regions, contents) {
function span(tag, text) {
- return $('<span>', {'class': 'inline'}).addClass(tag).html(text);
+ return $('<span>', {'class': 'diff-inline'}).addClass(tag).html(text);
}
function unchanged(text) { return span('unchanged', text); }
@@ -160,7 +160,7 @@ define(['jquery'], function($) {
var oldContent = oldContents[oldLinum - 1];
var newContent = newContents[newLinum - 1];
- return $('<tr>', {'class': 'line replaced'}).
+ return $('<tr>', {'class': 'diff-line replaced'}).
append($('<td>', {'class': 'old linum'}).text(oldLinum)).
append($('<td>', {'class': 'old contents'})
.append(flatten(buildReplaceRegions(oldRegion, oldContent)))).
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]