Cleanup bug reporter button

This commit is contained in:
Tankred Hase 2014-08-12 18:32:37 +02:00
parent 275a602274
commit 0e21616911
9 changed files with 11 additions and 22 deletions

View File

@ -89,7 +89,6 @@ define(function(require) {
message: message, message: message,
positiveBtnStr: str.updatePublicKeyPosBtn, positiveBtnStr: str.updatePublicKeyPosBtn,
negativeBtnStr: str.updatePublicKeyNegBtn, negativeBtnStr: str.updatePublicKeyNegBtn,
showBugReporter: false,
showNegativeBtn: true, showNegativeBtn: true,
callback: callback callback: callback
}); });

View File

@ -65,7 +65,6 @@ define(function(require) {
$scope.state.account.toggle(false); $scope.state.account.toggle(false);
$scope.$apply(); $scope.$apply();
$scope.onError({ $scope.onError({
showBugReporter: false,
title: 'Success', title: 'Success',
message: 'Exported keypair to file.' message: 'Exported keypair to file.'
}); });

View File

@ -25,7 +25,6 @@ define(function(require) {
$scope.importKey = function() { $scope.importKey = function() {
if (!$scope.state.agree) { if (!$scope.state.agree) {
$scope.onError({ $scope.onError({
showBugReporter: false,
message: termsMsg message: termsMsg
}); });
return; return;
@ -43,7 +42,6 @@ define(function(require) {
$scope.setPassphrase = function() { $scope.setPassphrase = function() {
if (!$scope.state.agree) { if (!$scope.state.agree) {
$scope.onError({ $scope.onError({
showBugReporter: false,
message: termsMsg message: termsMsg
}); });
return; return;

View File

@ -32,10 +32,7 @@ define(function(require) {
$scope.verifyRecoveryToken = function(callback) { $scope.verifyRecoveryToken = function(callback) {
if (!$scope.recoveryToken) { if (!$scope.recoveryToken) {
$scope.onError({ $scope.onError(new Error('Please set the recovery token!'));
message: 'Please set the recovery token!',
showBugReporter: false
});
return; return;
} }
@ -68,10 +65,7 @@ define(function(require) {
var inputCode = '' + $scope.code0 + $scope.code1 + $scope.code2 + $scope.code3 + $scope.code4 + $scope.code5; var inputCode = '' + $scope.code0 + $scope.code1 + $scope.code2 + $scope.code3 + $scope.code4 + $scope.code5;
if (!inputCode) { if (!inputCode) {
$scope.onError({ $scope.onError(new Error('Please enter the keychain code!'));
message: 'Please enter the keychain code!',
showBugReporter: false
});
return; return;
} }

View File

@ -27,8 +27,7 @@ define(function(require) {
// show message // show message
$scope.onError({ $scope.onError({
title: 'Info', title: 'Info',
message: 'Your PGP key has already been synced.', message: 'Your PGP key has already been synced.'
showBugReporter: false
}); });
return; return;
} }
@ -182,8 +181,7 @@ define(function(require) {
// show success message // show success message
$scope.onError({ $scope.onError({
title: 'Success', title: 'Success',
message: 'Whiteout Keychain setup successful!', message: 'Whiteout Keychain setup successful!'
showBugReporter: false
}); });
}); });
}); });

View File

@ -48,6 +48,7 @@ define(function(require) {
function onPassphraseChanged(err, newPrivateKeyArmored) { function onPassphraseChanged(err, newPrivateKeyArmored) {
if (err) { if (err) {
err.showBugReporter = false;
$scope.onError(err); $scope.onError(err);
return; return;
} }
@ -74,8 +75,7 @@ define(function(require) {
$scope.$apply(); $scope.$apply();
$scope.onError({ $scope.onError({
title: 'Success', title: 'Success',
message: 'Passphrase change complete.', message: 'Passphrase change complete.'
showBugReporter: false
}); });
} }
}; };

View File

@ -21,7 +21,7 @@ define(function(require) {
positiveBtnStr: options.positiveBtnStr || 'Ok', positiveBtnStr: options.positiveBtnStr || 'Ok',
negativeBtnStr: options.negativeBtnStr || 'Cancel', negativeBtnStr: options.negativeBtnStr || 'Cancel',
showNegativeBtn: options.showNegativeBtn || false, showNegativeBtn: options.showNegativeBtn || false,
showBugReporter: (typeof options.showBugReporter !== 'undefined' ? options.showBugReporter : true), showBugReporter: (typeof options.showBugReporter !== 'undefined' ? options.showBugReporter : !options.title), // if title is set, presume it's not an error by default
callback: options.callback callback: options.callback
}; };
// don't call apply for synchronous calls // don't call apply for synchronous calls

View File

@ -6,7 +6,7 @@
<li class="google enabled" popover="#google-info" wo-touch="connectToGoogle()"> <li class="google enabled" popover="#google-info" wo-touch="connectToGoogle()">
<div><img src="img/google_logo.png" alt="Google Mail"></div> <div><img src="img/google_logo.png" alt="Google Mail"></div>
</li> </li>
<li class="whiteout disabled" popover="#whiteout-info" wo-touch="onError({message:'Whiteout Mailbox coming soon!', sync:true, showBugReporter:false})"> <li class="whiteout disabled" popover="#whiteout-info" wo-touch="onError({message:'Whiteout Mailbox coming soon!', sync:true})">
<div><img src="img/whiteout_logo.svg" alt="Whiteout Mailbox"></div> <div><img src="img/whiteout_logo.svg" alt="Whiteout Mailbox"></div>
</li> </li>
<li class="tonline" popover="#tonline-info" wo-touch="connectToTonline()"> <li class="tonline" popover="#tonline-info" wo-touch="connectToTonline()">

View File

@ -7,9 +7,10 @@
<div class="content"> <div class="content">
<p>{{state.dialog.message}} <a ng-show="state.dialog.faqLink" href="{{state.dialog.faqLink}}" target="_blank">Learn more</a></p> <p>{{state.dialog.message}} <a ng-show="state.dialog.faqLink" href="{{state.dialog.faqLink}}" target="_blank">Learn more</a></p>
<div class="control"> <div class="control">
<button wo-touch="confirm(true); state.writer.reportBug()" class="btn btn-alt" ng-show="state.writer && state.dialog.showBugReporter">Report this bug</button><!-- only show if we can actually report a bug, i.e. the writer is attached to the scope -->
<button wo-touch="confirm(false)" class="btn btn-alt" ng-show="state.dialog.showNegativeBtn">{{state.dialog.negativeBtnStr}}</button> <button wo-touch="confirm(false)" class="btn btn-alt" ng-show="state.dialog.showNegativeBtn">{{state.dialog.negativeBtnStr}}</button>
<button wo-touch="confirm(true)" class="btn">{{state.dialog.positiveBtnStr}}</button> <!-- only show bug report button if we can actually report a bug, i.e. the writer is attached to the scope -->
<button wo-touch="confirm(true)" class="btn" ng-show="!state.writer || !state.dialog.showBugReporter">{{state.dialog.positiveBtnStr}}</button>
<button wo-touch="confirm(true); state.writer.reportBug()" class="btn" ng-show="state.writer && state.dialog.showBugReporter">Report bug</button>
</div> </div>
</div><!-- /.content --> </div><!-- /.content -->
</div><!-- /.lightbox-body --> </div><!-- /.lightbox-body -->