-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Isaac Levin
committed
Apr 6, 2015
1 parent
3b4594b
commit 01ffa6f
Showing
7 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
buApp.controller('rawDataController', ['$scope', '$location', 'storage', 'shared', function ($scope, $location, storage, shared) { | ||
if (shared.exportData) { | ||
$scope.rawdata = toJsonString(shared.exportData); | ||
$scope.exporting = true; | ||
} | ||
|
||
$scope.importData = function () { | ||
var data = fromJsonString($scope.rawdata); | ||
if (!$.isArray(data)) { | ||
alert("Invalid data"); | ||
return; | ||
} | ||
for (var i=0; i<data.length; i++) { | ||
var examData = data[i]; | ||
if (!examData.key) { | ||
alert("Invalid data"); | ||
return; | ||
} | ||
storage.store(examData); | ||
} | ||
$location.path('/'); | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div ng-controller="rawDataController" class="rawData"> | ||
<h3>{{exporting ? 'Export' : 'Import'}} data</h3> | ||
<button ng-show="!exporting" ng-click="importData()">Import</button> | ||
<textarea ng-model="rawdata"> | ||
</textarea> | ||
</div> |