Set default password picker tab when no credentials are found. Fixes #96
This commit is contained in:
Родитель
dbe64ad27b
Коммит
b681205ce4
|
@ -55,6 +55,17 @@
|
|||
<span class="bar"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="group">
|
||||
<select id="firstTab" class="input-md" ng-model="settings.no_results_found_tab">
|
||||
<option value="list">List</option>
|
||||
<option value="search">Search</option>
|
||||
<option value="add">Add</option>
|
||||
<option value="generate">Generate</option>
|
||||
</select>
|
||||
<span class="highlight"></span>
|
||||
<span class="bar"></span>
|
||||
<label>{{'select_password_picker_default_tab' | translate}}</label>
|
||||
</div>
|
||||
<div class="switch-row">
|
||||
<input type="checkbox" id="ignore_protocol" ng-model="settings.ignoreProtocol" class="switch-input">
|
||||
<label for="ignore_protocol" class="switch-label">{{'ignore_protocol' | translate}}</label>
|
||||
|
|
|
@ -100,6 +100,9 @@ var background = (function () {
|
|||
if (!_self.settings.hasOwnProperty('disable_browser_autofill')) {
|
||||
_self.settings.disable_browser_autofill = true;
|
||||
}
|
||||
if (!_self.settings.hasOwnProperty('no_results_found_tab')) {
|
||||
_self.settings.no_results_found_tab = 'list';
|
||||
}
|
||||
|
||||
|
||||
PAPI.host = _settings.nextcloud_host;
|
||||
|
@ -155,6 +158,10 @@ var background = (function () {
|
|||
settings.disable_browser_autofill = true;
|
||||
}
|
||||
|
||||
if (!_self.settings.hasOwnProperty('password_picker_first_tab')) {
|
||||
_self.settings.disable_browser_autofill = 'list';
|
||||
}
|
||||
|
||||
//window.settings contains the run-time settings
|
||||
_self.settings = settings;
|
||||
|
||||
|
|
|
@ -234,6 +234,15 @@ $(document).ready(function () {
|
|||
method: "getCredentialsByUrl",
|
||||
args: [tab.url]
|
||||
}).then(function (logins) {
|
||||
if(logins.length === 0){
|
||||
API.runtime.sendMessage(API.runtime.id, {
|
||||
'method': 'getSetting',
|
||||
args: 'no_results_found_tab'
|
||||
}).then(function (value) {
|
||||
makeTabActive(value);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (logins.length !== 0) {
|
||||
picker.find('.tab-list-content').html('');
|
||||
}
|
||||
|
@ -293,6 +302,7 @@ $(document).ready(function () {
|
|||
}
|
||||
|
||||
|
||||
|
||||
function searchCredentials() {
|
||||
$('#searchResults').html('');
|
||||
var searchText = $('#password_search').val();
|
||||
|
|
Загрузка…
Ссылка в новой задаче