aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rebaseline_server/static
diff options
context:
space:
mode:
authorGravatar epoger <epoger@google.com>2014-08-20 10:55:27 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-20 10:55:27 -0700
commit3144d37e5ffcf3f75c39fb938258e4e6b6694ac9 (patch)
tree2db1048d2aa79b8394cbd80aa42a0082c33ee6a5 /gm/rebaseline_server/static
parent46bc6217ca41178c357a68be2869b8b2f6defe47 (diff)
rebaseline_server: add download link for SKP diff patchfile
BUG=skia:1918 NOTREECHECKS=true NOTRY=true R=stephana@google.com TBR=stephana (SkipBuildbotRuns) Author: epoger@google.com Review URL: https://codereview.chromium.org/489183002
Diffstat (limited to 'gm/rebaseline_server/static')
-rw-r--r--gm/rebaseline_server/static/live-loader.js8
-rw-r--r--gm/rebaseline_server/static/live-view.html4
2 files changed, 12 insertions, 0 deletions
diff --git a/gm/rebaseline_server/static/live-loader.js b/gm/rebaseline_server/static/live-loader.js
index 30d05061be..ab15aee41a 100644
--- a/gm/rebaseline_server/static/live-loader.js
+++ b/gm/rebaseline_server/static/live-loader.js
@@ -8,6 +8,12 @@ var Loader = angular.module(
['ConstantsModule']
);
+// This configuration is needed to allow downloads of the diff patch.
+// See https://github.com/angular/angular.js/issues/3889
+Loader.config(['$compileProvider', function($compileProvider) {
+ $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|blob):/);
+}]);
+
Loader.directive(
'resultsUpdatedCallbackDirective',
['$timeout',
@@ -841,6 +847,8 @@ Loader.controller(
data: modificationData
}).success(function(data, status, headers, config) {
$scope.diffResults = data;
+ var blob = new Blob([$scope.diffResults], {type: 'text/plain'});
+ $scope.diffResultsBlobUrl = window.URL.createObjectURL(blob);
$scope.submitPending = false;
}).error(function(data, status, headers, config) {
alert("There was an error submitting your baselines.\n\n" +
diff --git a/gm/rebaseline_server/static/live-view.html b/gm/rebaseline_server/static/live-view.html
index 6c158a6e7e..1662adf89c 100644
--- a/gm/rebaseline_server/static/live-view.html
+++ b/gm/rebaseline_server/static/live-view.html
@@ -203,6 +203,10 @@
Here is the patch to apply to your local checkout:
<br>
<textarea rows="8" cols="50">{{diffResults}}</textarea>
+ <br>
+ <a download="patch.txt" ng-href="{{diffResultsBlobUrl}}">
+ Click here to download that patch as a text file.
+ </a>
</div>
</div>