Skip to content

Commit

Permalink
Some formatting tidyups to help merging in future.
Browse files Browse the repository at this point in the history
Areas targetted are ones likely to change when new features are added.
 - Arrays: Make sure one entry per line, and always trail with a comma
 - CSS selectors: One selector per line, a no-op fake selector to ensure every real selector ends with a trailing comma

Both of the above mean when doing merges, the only lines changed are ones added/removed - not the final one in the list just because a comma was added to extend the list.

index.html: Fixed up some indenting to make editing in future clearer.

(cherry picked from merge request GH-68 )
  • Loading branch information
jmorgannz authored and ttyridal committed Nov 28, 2021
1 parent baf5110 commit a2f8e3f
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 64 deletions.
11 changes: 10 additions & 1 deletion ext/webextension/src/browser_action/main_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,16 @@ function popup(masterkey) {
}

window.addEventListener('load', function () {
config.get(['username', 'key_id', 'defaulttype', 'pass_to_clipboard', 'pass_store', 'passwdtimeout', 'use_sync', 'defaultname'])
config.get([
'username',
'key_id',
'defaulttype',
'pass_to_clipboard',
'pass_store',
'passwdtimeout',
'use_sync',
'defaultname',
])
.then(v=>{
return runtimeSendMessage({action: 'masterkey_get', use_pass_store: !!v.pass_store});
})
Expand Down
11 changes: 8 additions & 3 deletions ext/webextension/src/css/mpwd.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ button:focus, input:focus, mp-combobox:focus-within {
outline-style: auto;
}

input, select, mp-combobox {
input,
select,
mp-combobox,
no-op {
background: #1b1d23;
color: #d7dae0;
height: 2em;
Expand Down Expand Up @@ -198,7 +201,8 @@ button#siteconfig_show {
}
#siteconfig > input,
#siteconfig > select,
#siteconfig > option {
#siteconfig > option,
no-op {
font-size: 1em;
font-weight: normal;
width: 6em;
Expand Down Expand Up @@ -302,7 +306,8 @@ button#siteconfig_show {

.configitem > input,
.configitem > select,
.configitem > option {
.configitem > option,
no-op {
margin-top:1.5em;
margin-left:-8em;
font-size: 1em;
Expand Down
18 changes: 10 additions & 8 deletions ext/webextension/src/options/globaloptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,16 @@ document.querySelector('#use_sync').addEventListener('change', async function()
});

window.addEventListener('load', function() {
config.get(['defaulttype',
'defaultname',
'passwdtimeout',
'pass_to_clipboard',
'auto_submit_pass',
'auto_submit_username',
'pass_store',
'use_sync'])
config.get([
'defaulttype',
'defaultname',
'passwdtimeout',
'pass_to_clipboard',
'auto_submit_pass',
'auto_submit_username',
'pass_store',
'use_sync',
])
.then(data => {
data = Object.assign({defaulttype: 'l', passwdtimeout: 0, pass_to_clipboard: true,
defaultname: '',
Expand Down
102 changes: 51 additions & 51 deletions ext/webextension/src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,59 +34,59 @@
<h2 class="accordion_toggle">Global settings</h2>
<div class="configgroup">
<div class="configsubgroup left">
<div class="configitem">
<label class="w3-label w3-small w3-text-white" for="passwdtype">Default password type:</label>
<select class="w3-select w3-small w3-border" id="passwdtype">
<option value="x">Maximum
<option value="l">Long
<option value="m">Medium
<option value="b">Basic
<option value="s">Short
<option value="i">Pin
<option value="n">Name
<option value="p">Phrase
<option value="nx">Name [V]
<option value="px">Phrase [V]
</select>
</div>
<div class="configitem">
<label class="w3-label w3-small w3-text-white" for="passwdtimeout">Remember password:</label>
<select class="w3-select w3-small w3-border" id="passwdtimeout">
<option value="0">Never
<option value="5">5 minutes
<option value="15">15 minutes
<option value="30">30 minutes
<option value="60">1 hour
<option value="480">8 hours
<option value="-1">Until closed
</select>
</div>
<div class="configitem">
<label class="w3-label w3-small w3-text-white" for="defaultname">Default username:</label>
<input class="w3-select w3-small w3-border" id="defaultname">
</div>
<div class="configitem">
<label class="w3-label w3-small w3-text-white" for="passwdtype">Default password type:</label>
<select class="w3-select w3-small w3-border" id="passwdtype">
<option value="x">Maximum
<option value="l">Long
<option value="m">Medium
<option value="b">Basic
<option value="s">Short
<option value="i">Pin
<option value="n">Name
<option value="p">Phrase
<option value="nx">Name [V]
<option value="px">Phrase [V]
</select>
</div>
<div class="configitem">
<label class="w3-label w3-small w3-text-white" for="passwdtimeout">Remember password:</label>
<select class="w3-select w3-small w3-border" id="passwdtimeout">
<option value="0">Never
<option value="5">5 minutes
<option value="15">15 minutes
<option value="30">30 minutes
<option value="60">1 hour
<option value="480">8 hours
<option value="-1">Until closed
</select>
</div>
<div class="configitem">
<label class="w3-label w3-small w3-text-white" for="defaultname">Default username:</label>
<input class="w3-select w3-small w3-border" id="defaultname">
</div>
</div>
<div class="configsubgroup right">
<div class="configitem">
<label for="pass_to_clipboard">Copy password to clipboard</label>
<input id="pass_to_clipboard" type="checkbox"/>
</div>
<div class="configitem">
<label for="auto_submit_pass">Submit after password inject</label>
<input id="auto_submit_pass" type="checkbox"/>
</div>
<div class="configitem">
<label for="auto_submit_username">Inject username</label>
<input id="auto_submit_username" type="checkbox"/>
</div>
<div class="configitem">
<label for="pass_store">Use OS' password store</label>
<input id="pass_store" type="checkbox"/>
</div>
<div class="configitem">
<label for="use_sync">Let browser sync site data</label>
<input id="use_sync" type="checkbox"/>
</div>
<div class="configitem">
<label for="pass_to_clipboard">Copy password to clipboard</label>
<input id="pass_to_clipboard" type="checkbox"/>
</div>
<div class="configitem">
<label for="auto_submit_pass">Submit after password inject</label>
<input id="auto_submit_pass" type="checkbox"/>
</div>
<div class="configitem">
<label for="auto_submit_username">Inject username</label>
<input id="auto_submit_username" type="checkbox"/>
</div>
<div class="configitem">
<label for="pass_store">Use OS' password store</label>
<input id="pass_store" type="checkbox"/>
</div>
<div class="configitem">
<label for="use_sync">Let browser sync site data</label>
<input id="use_sync" type="checkbox"/>
</div>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion ext/webextension/src/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

input,
select,
option {
option,
no-op {
display:block;
border: 0;
width: 14em;
Expand Down

0 comments on commit a2f8e3f

Please sign in to comment.