Skip to content
This repository was archived by the owner on Jun 4, 2018. It is now read-only.

Commit 0bf8971

Browse files
committed
Update to PASSY 2.0.4, Update logo, Fix auto-login issues
1 parent 430a79a commit 0bf8971

15 files changed

+136
-135
lines changed

extension.crx

-43.4 KB
Binary file not shown.

extension/css/_buttons.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.btn > * {
1+
.btn, .btn > * {
22
cursor: pointer;
33
}
44

@@ -122,9 +122,6 @@
122122
text-transform: uppercase;
123123
font-size: 14px;
124124
-webkit-transition: background 300ms cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
125-
-moz-transition: background 300ms cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
126-
-ms-transition: background 300ms cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
127-
-o-transition: background 300ms cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
128125
transition: background 300ms cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
129126
}
130127

extension/css/extension.scss

-17
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@ body {
5454
min-width: 300px;
5555
}
5656

57-
.container {
58-
width: 100%;
59-
margin: 0 auto;
60-
}
61-
62-
@media screen and (min-width: 768px) {
63-
.container {
64-
width: 700px;
65-
}
66-
}
67-
68-
@media screen and (min-width: 1024px) {
69-
.container {
70-
width: 1000px;
71-
}
72-
}
73-
7457
.content {
7558
background-color: $colorForeground;
7659
padding: 25px 25px 50px;

extension/index.html extension/frontend.html

+6-5
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ <h1>PASSY</h1>
3434
</div>
3535
</form>
3636
</div>
37-
<div style="display: none" id="password-page">
38-
<button id="pass-switch-pages" class="btn btn-success pull-right">Insert new Password</button>
37+
<div id="password-page" style="display: none">
38+
<button id="pass-switch-pages" class="btn btn-success pull-right">Create new Password</button>
3939

4040
<table id="tablePasswords" class="table table-hover">
4141
<thead>
4242
<tr>
4343
<th>Username</th>
4444
<th>Description</th>
4545
<th>Date added</th>
46-
<th>Actions</th>
46+
<th></th>
4747
</tr>
4848
</thead>
4949
<tbody id="tbodyPasswords">
@@ -61,7 +61,8 @@ <h1>PASSY</h1>
6161
<label>Username</label>
6262
</div>
6363
<div class="textbox">
64-
<input type="password" id="pre-save-password" class="text-input" title="Password" name="password" required/>
64+
<input type="password" id="pre-save-password" class="text-input" title="Password"
65+
name="password" required/>
6566
<label>Password</label>
6667
</div>
6768
<button id="show-save-pass" class="btn pull-right">S</button>
@@ -79,6 +80,6 @@ <h1>PASSY</h1>
7980
</div>
8081
</div>
8182
<script src="js/jquery.min.js" type="application/javascript"></script>
82-
<script src="src/site.js" type="application/javascript"></script>
83+
<script src="src/frontend.js" type="application/javascript"></script>
8384
</body>
8485
</html>

extension/icon.png

-1.4 KB
Binary file not shown.

extension/img/icon-16.png

6.67 KB
Loading

extension/img/icon-24.png

7.08 KB
Loading

extension/img/icon-32.png

6.21 KB
Loading

extension/img/logo-128.png

8.1 KB
Loading

extension/img/logo-16.png

1.3 KB
Loading

extension/img/logo-48.png

2.85 KB
Loading

extension/manifest.json

+43-34
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
11
{
2-
"manifest_version": 2,
3-
"name": "PASSY Chrome Extension",
4-
"description": "This is the Chrome Extension for the PASSY Password Manager",
5-
"version": "1.1.1",
6-
"browser_action": {
7-
"default_icon": "icon.png",
8-
"default_popup": "index.html",
9-
"default_title": "PASSY"
10-
},
11-
"background": {
12-
"scripts": [
13-
"js/jquery.min.js",
14-
"src/service.js"
2+
"manifest_version": 2,
3+
"name": "PASSY Chrome Extension",
4+
"description": "Official Chrome Extension for PASSY",
5+
"version": "1.2",
6+
"icons": {
7+
"16": "img/logo-16.png",
8+
"48": "img/logo-48.png",
9+
"128": "img/logo-128.png"
10+
},
11+
"browser_action": {
12+
"default_icon": {
13+
"16": "img/icon-16.png",
14+
"24": "img/icon-24.png",
15+
"32": "img/icon-32.png"
16+
},
17+
"default_popup": "frontend.html",
18+
"default_title": "PASSY"
19+
},
20+
"background": {
21+
"scripts": [
22+
"js/jquery.min.js",
23+
"src/service.js"
24+
]
25+
},
26+
"content_scripts": [
27+
{
28+
"matches": [
29+
"http://*/*",
30+
"https://*/*"
31+
],
32+
"js": [
33+
"js/jquery.min.js",
34+
"src/background.js"
35+
],
36+
"run_at": "document_end"
37+
}
38+
],
39+
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
40+
"permissions": [
41+
"https://*/*",
42+
"activeTab",
43+
"storage",
44+
"contextMenus"
1545
]
16-
},
17-
"content_scripts": [
18-
{
19-
"matches": [
20-
"http://*/*",
21-
"https://*/*"
22-
],
23-
"js": [
24-
"js/jquery.min.js",
25-
"src/index.js"
26-
],
27-
"run_at": "document_end"
28-
}
29-
],
30-
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
31-
"permissions": [
32-
"activeTab",
33-
"storage",
34-
"https://*/*",
35-
"contextMenus"
36-
]
3746
}

extension/src/index.js extension/src/background.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
const port = chrome.runtime.connect({name: "site"});
2-
var activeField = null;
1+
const port = chrome.runtime.connect({name: "background"});
2+
let activeField = null;
33
const manuellSet = [];
4+
45
function handleForSave() {
56

67
if (activeField == null) return;
@@ -15,8 +16,6 @@ function handleForSave() {
1516
port.postMessage({action: "callback-save", field: "password", value: activeField.val()});
1617

1718
}
18-
19-
2019
}
2120

2221
port.onMessage.addListener(function (msg) {

extension/src/site.js extension/src/frontend.js

+22-16
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs.change(function () {
1414
me.removeClass("hastext");
1515
});
1616

17-
const port = chrome.runtime.connect({name: "extension"});
17+
const port = chrome.runtime.connect({name: "frontend"});
1818

1919
function switchPages() {
2020
if ($("#save-page").is(":visible")) {
@@ -23,14 +23,13 @@ function switchPages() {
2323
} else {
2424
$("#save-page").show();
2525
$("#password-page").hide();
26-
2726
}
2827
}
2928

3029
port.onMessage.addListener(function (msg) {
3130
console.debug(msg);
3231
switch (msg.action) {
33-
case "set-pass": {
32+
case "login-successful": {
3433
setPasswords(msg.data);
3534
break;
3635
}
@@ -40,6 +39,7 @@ port.onMessage.addListener(function (msg) {
4039
setPasswords(msg.data, false);
4140
break;
4241
}
42+
4343
case "reset": {
4444
const tableBody = $("#tbodyPasswords");
4545
const loginPage = $("#login-page");
@@ -52,19 +52,23 @@ port.onMessage.addListener(function (msg) {
5252
}, 300);
5353
break;
5454
}
55+
5556
case "saved-url-reply": {
5657
$("#form_login").find('input[name="url"]').val(msg.url);
5758
break;
5859
}
60+
5961
case "prepare-save": {
60-
if (msg.data.username !== null) $("#pre-save-username").val(msg.data.username);
61-
if (msg.data.password !== null) $("#pre-save-password").val(msg.data.password);
62+
if (msg.data.username !== null)
63+
$("#pre-save-username").val(msg.data.username);
64+
if (msg.data.password !== null)
65+
$("#pre-save-password").val(msg.data.password);
66+
break;
6267
}
63-
6468
}
6569
});
6670

67-
$(document).ready(function () {
71+
$(function () {
6872
port.postMessage({action: "saved-url"});
6973
});
7074

@@ -74,23 +78,23 @@ $("#form_login").submit(function (e) {
7478
url = me.find('input[name="url"]').val();
7579
port.postMessage({action: "login-call", url: url, data: me.serialize()});
7680
});
81+
7782
$("#form_save").submit(function (e) {
7883
e.preventDefault();
7984
const me = $(this);
8085
port.postMessage({action: "save-call", data: me.serialize()});
8186
});
8287

83-
$("#pass-switch-pages").click((ev) => {
88+
$("#pass-switch-pages").click(function () {
8489
switchPages();
8590
});
86-
$("#show-save-pass").click((ev) => {
8791

92+
$("#show-save-pass").click(function () {
8893
const current = $("#pre-save-password").attr("type");
8994

9095
$("#pre-save-password").attr("type", current === "text" ? "password" : "text");
91-
9296
});
93-
$("#save-switch-pages").click((ev) => {
97+
$("#save-switch-pages").click(function () {
9498
switchPages();
9599
});
96100

@@ -100,19 +104,19 @@ function insertPassword(id) {
100104
}
101105

102106
function setPasswords(data, fade = true) {
103-
104-
105107
const tableBody = $("#tbodyPasswords");
106108
tableBody.html("");
107109
const loginPage = $("#login-page");
108110
const passPage = $("#password-page");
109111

110112
data.forEach(function (value) {
113+
if (value.archived)
114+
return; // continue
111115
const button = "<button class='btn btn-success' id='pass-" + value.password_id + "'>Insert</button>";
112116
var add = "<tr>";
113-
add += field(value.username);
114-
add += field(value.description);
115-
add += field(value.date_added_readable);
117+
add += field(value.username.safe);
118+
add += field(value.description.safe);
119+
add += field(value.date_added.pretty);
116120
add += field(button);
117121
add += "</tr>";
118122

@@ -132,5 +136,7 @@ function setPasswords(data, fade = true) {
132136
}
133137

134138
function field(inner) {
139+
if (inner.trim().length === 0)
140+
inner = "<i>None</i>";
135141
return "<td>" + inner + "</td>";
136142
}

0 commit comments

Comments
 (0)