Permalink
Browse files

another CustomEvent.

  • Loading branch information...
1 parent 92cf1da commit 60a43f2833531eec9d1886bcdd5c4c9bca4709b5 @myakura committed Apr 23, 2012
Showing with 8 additions and 4 deletions.
  1. +1 −1 manifest.json
  2. +7 −3 wkversion.js
View
@@ -1,6 +1,6 @@
{
"name": "Dicentra",
- "version": "0.3",
+ "version": "0.3.1",
"description": "enhances WebKit changeset page.",
"manifest_version": 2,
View
@@ -24,7 +24,6 @@
throw new MyError('There was no conf file before r25325.');
}
- // path to Version.xcconfig
return 'http://trac.webkit.org/export/' + revision +
(revision >= 75314 ? '/trunk/Source' : '/trunk') +
'/WebCore/Configurations/Version.xcconfig';
@@ -50,7 +49,9 @@
var getWKVersion = function (data) {
var regVersions = /MAJOR_VERSION = (\d+);\nMINOR_VERSION = (\d+);/;
if (regVersions.test(data)) {
- return regVersions.exec(data).slice(1);
+ var version = regVersions.exec(data).slice(1);
+ var event = new CustomEvent('WKVersionObtained', { "detail": { "version": version }});
+ window.dispatchEvent(event);
} else {
throw new InvalidArgumentError(data);
}
@@ -68,7 +69,10 @@
var rev = getWKRevision(url);
var path = getWKConfFilePath(rev);
window.addEventListener('WKConfFileLoaded', function (e) {
- var version = getWKVersion(e.detail.response);
+ getWKVersion(e.detail.response);
+ });
+ window.addEventListener('WKVersionObtained', function (e) {
+ var version = e.detail.version;
updateChangesetHeading(version);
});
getWKConfFile(path);

0 comments on commit 60a43f2

Please sign in to comment.