Skip to content

Commit 340204b

Browse files
author
bthornto
committed
Add link to current page
1 parent 2ceb0de commit 340204b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

td4a/static/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
<div class="menubar">
4848
<div class="title">RESULT</div>
4949
<div class="buttons">
50+
<md-button class="md-small md-raised" target="_self" ng-href="/?{{ params }}">
51+
<md-icon aria-label="code" class="material-icons">link</md-icon>
52+
link
53+
</md-button>
5054
<md-button class="md-small md-raised" target="_blank" ng-href="http://github.com/cidrblock/td4a">
5155
<md-icon aria-label="code" class="material-icons">code</md-icon>
5256
github

td4a/static/js/app.js

+3
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ app.controller('main', function($scope, $http, $window, $mdToast, $timeout, $rou
8888
$scope.template.jinja = response.data
8989
}
9090
})
91+
} else if ('data' in $location.search() && 'template' in $location.search()) {
92+
$scope.template = { data: $location.search().data, jinja: $location.search().template }
9193
} else {
9294
$scope.template = localStorageService.get('data')
9395
};
9496

9597
$scope.render = function() {
98+
$scope.params = `data=${encodeURIComponent($scope.template.data)}&template=${encodeURIComponent($scope.template.jinja)}`
9699
$scope.renderButton = true;
97100
if ('line_number' in $scope.error) {
98101
$scope.error.codeMirrorEditor.removeLineClass($scope.error.line_number, 'wrap', 'error');

0 commit comments

Comments
 (0)