Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

a bit saner variable names.

  • Loading branch information...
commit 4fe1721547534b4dbcba401a75fb7c1cd3d41d0b 1 parent 18ccb5a
@myakura authored
Showing with 20 additions and 19 deletions.
  1. +7 −7 content.js
  2. +1 −1  manifest.json
  3. +12 −11 wkversion.js
View
14 content.js
@@ -1,7 +1,7 @@
(function () {
- var msgelem = document.querySelector('dd.message p'),
- msgtext = msgelem.textContent,
- reurls = /https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=\d+|<\s*(?:https?:\/\/webkit\.org\/b|rdar:\/\/problem)\/\d+>/g;
+ var msgElem = document.querySelector('dd.message p'),
+ msgText = msgElem.textContent,
+ reURLs = /https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=\d+|<\s*(?:https?:\/\/webkit\.org\/b|rdar:\/\/problem)\/\d+>/g;
/*
bugzilla : /https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=\d+/g,
@@ -11,13 +11,13 @@
*/
// remove wk bug and rdar urls, then trim.
- msgtext = msgtext.replace(reurls, '').trim();
+ msgText = msgText.replace(reURLs, '').trim();
// if there are multiple "paragraphs" in the element, grab the first one
- if (/\s+\n/.test(msgtext)) {
- msgtext = msgtext.split(/\s+\n/)[0];
+ if (/\n\s*\n/.test(msgText)) {
+ msgText = msgText.split(/\n\s*\n/)[0];
}
- document.title += '' + msgtext.replace(/\n/,' ');
+ document.title += '' + msgText.replace(/\n/,' ');
}());
View
2  manifest.json
@@ -1,6 +1,6 @@
{
"name": "Dicentra",
- "version": "0.21",
+ "version": "0.2.2",
"description": "enhances WebKit changeset page.",
"manifest_version": 2,
View
23 wkversion.js
@@ -1,32 +1,33 @@
(function () {
var url = location.href,
- rechangeset = /^https?:\/\/trac\.webkit\.org\/changeset\/(\d+)$/;
+ reChangeset = /^https?:\/\/trac\.webkit\.org\/changeset\/(\d+)$/;
- if (!rechangeset.test(url)) return;
- var revision = parseInt(url.match(rechangeset)[1], 10);
+ if (!reChangeset.test(url)) return;
+ var revision = parseInt(url.match(reChangeset)[1], 10);
// looks like r25325 is the oldest revision
if (revision < 25325) return;
// path to Version.xcconfig
- var pathtoconf = 'http://trac.webkit.org/export/' + revision + '/trunk/' +
- (revision >= 75314 ? 'Source/' : '') +
- 'WebCore/Configurations/Version.xcconfig';
+ var pathFile = 'http://trac.webkit.org/export/' + revision + '/trunk/' +
+ (revision >= 75314 ? 'Source/' : '') +
+ 'WebCore/Configurations/Version.xcconfig';
var xhr = new XMLHttpRequest();
xhr.onload = function () {
showVersion(xhr.response);
};
- xhr.open('GET', pathtoconf);
+ xhr.open('GET', pathFile);
xhr.send();
- function showVersion(res) {
- var revers = /MAJOR_VERSION = (\d+);\nMINOR_VERSION = (\d+);/;
+ function showVersion(response) {
+ var reVersions = /MAJOR_VERSION = (\d+);\nMINOR_VERSION = (\d+);/;
- if (!revers.test(res)) return;
- var version = res.match(revers).slice(1);
+ if (!reVersions.test(response)) return;
+ var version = response.match(reVersions).slice(1);
document.querySelector('h1').textContent += ' (' + version.join('.') + ')';
}
+
}());
Please sign in to comment.
Something went wrong with that request. Please try again.