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

Unified Diff: gm/rebaseline_server/static/loader.js

Issue 205273002: rebaseline_server: image URLs are relative to JSON file's location (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/static/loader.js
diff --git a/gm/rebaseline_server/static/loader.js b/gm/rebaseline_server/static/loader.js
index fea5aa0404632ad52797464a99a27c6ce1e6b988..c691b361f524b9c3a02fba24406480601f9c8904 100644
--- a/gm/rebaseline_server/static/loader.js
+++ b/gm/rebaseline_server/static/loader.js
@@ -164,6 +164,20 @@ Loader.controller(
// If any defaults were overridden in the URL, get them now.
$scope.queryParameters.load();
+ // All image URLs are relative to the JSON file's source directory.
epoger 2014/03/19 21:01:40 Reason for the change: wherever we store the JSON
borenet 2014/03/20 13:05:05 This seems inconsistent with the above comment, wh
+ var baseUrlKey = constants.KEY__IMAGESETS__FIELD__BASE_URL;
+ angular.forEach(
+ $scope.imageSets,
+ function(imageSet) {
+ var baseUrl = imageSet[baseUrlKey];
+ if (!(baseUrl.substring(0, 1) === '/') &&
+ !(baseUrl.substring(0, 5).toUpperCase() === 'HTTP:') &&
+ !(baseUrl.substring(0, 6).toUpperCase() === 'HTTPS:')) {
+ imageSet[baseUrlKey] = $scope.resultsToLoad + '/../' + baseUrl;
borenet 2014/03/20 13:05:05 Maybe move the above comment here and modify to so
+ }
+ }
+ );
+
$scope.updateResults();
$scope.loadingMessage = "";
$scope.windowTitle = "Current GM Results";
« 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