Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion js/background/inject/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ $j(document).ready(function () {
}

function getMaxZ() {
return Math.max.apply(null,
var maxIndex = Math.max.apply(null,
$j.map($j('body *'), function (e) {
if ($j(e).css('position') !== 'static')
return parseInt($j(e).css('z-index')) || 1;
}));
maxIndex = maxIndex>0?maxIndex:9999;
return maxIndex;
}

var activeForm;
Expand Down
15 changes: 12 additions & 3 deletions js/background/service/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,21 @@ var background = (function () {
if (!master_password) {
return;
}
//console.log('Loading vault with the following settings: ', settings);
// console.log('Loading vault with the following settings: ', settings);
var tmpList = [];

for (var i = 0; i < _self.settings.accounts.length; i++) {
var account = _self.settings.accounts[i];
/* jshint ignore:start */
(function (inner_account) {
PAPI.getVault(inner_account, function (vault) {
PAPI.host = inner_account.nextcloud_host;
PAPI.username = inner_account.nextcloud_username;
PAPI.password = inner_account.nextcloud_password;
PAPI.getVaults(function(vaults) {
if (vaults.hasOwnProperty('error')) {
return;
}
PAPI.getVault(inner_account, function (vault) {
if (vault.hasOwnProperty('error')) {
return;
}
Expand Down Expand Up @@ -219,7 +226,9 @@ var background = (function () {
getSharedCredentials(inner_account);


});
});
});

}(account));
/* jshint ignore:end */
}
Expand Down
2 changes: 1 addition & 1 deletion js/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ window.PAPI = (function () {
var timeoutTimer = setTimeout(function () {
API.notifications.create('Error', 'Error connecting to server (Error: Connection timeout)');
callback({error: true, result: {statusText: 'Connection timeout', status: 0}});
}, 10000);
}, 30000);

fetch(request).then(function(response){
clearTimeout(timeoutTimer);
Expand Down
39 changes: 28 additions & 11 deletions js/ui/popup/controllers/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,34 @@
PAPI.username = $scope.settings.nextcloud_username;
PAPI.password = $scope.settings.nextcloud_password;
PAPI.getVaults(function (vaults) {
if (vaults.hasOwnProperty('error')) {
var errors = API.i18n.getMessage('invalid_response_from_server', [vaults.result.status, vaults.result.statusText]);
$scope.errors.push(errors);
notify(errors);
callback(false);
}
else {
$scope.vaults = vaults;
callback(true);
}
$scope.$apply();
if(angular.equals(vaults, [])) {
// retry if returns empty
PAPI.getVaults(function(vaults) {
if (vaults.hasOwnProperty('error')) {
var errors = API.i18n.getMessage('invalid_response_from_server', [vaults.result.status, vaults.result.statusText]);
$scope.errors.push(errors);
notify(errors);
callback(false);
}
else {
$scope.vaults = vaults;
callback(true);
}
$scope.$apply();
});
} else {
if (vaults.hasOwnProperty('error')) {
var errors = API.i18n.getMessage('invalid_response_from_server', [vaults.result.status, vaults.result.statusText]);
$scope.errors.push(errors);
notify(errors);
callback(false);
}
else {
$scope.vaults = vaults;
callback(true);
}
$scope.$apply();
}
});
},
vault: function (callback) {
Expand Down
6 changes: 1 addition & 5 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extName__",
"short_name": "__MSG_extName__",
"version": "2.1.2",
"version": "2.1.7",
"manifest_version": 2,
"author": "Sander Brand",
"default_locale": "en",
Expand All @@ -14,9 +14,6 @@
"64": "icons/icon64.png",
"128": "icons/icon128.png"
},
"externally_connectable": {
"ids": []
},
"background": {
"scripts": [
"/js/vendor/jquery/jquery.js",
Expand Down Expand Up @@ -77,7 +74,6 @@
"https://*/*"
],
"all_frames": true,
"jsBuild": [],
"js": [
"/js/lib/promise.js",
"/js/vendor/sjcl/sjcl.js",
Expand Down