Skip to content

Commit

Permalink
version 1.0 !
Browse files Browse the repository at this point in the history
  • Loading branch information
edithli committed Jun 6, 2016
1 parent db087c6 commit d206c13
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion extension/client/bkg/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ var mpw, username, checksum;
var IV_WORD_LEN = 4;
var SALT_BIT_LEN = 128;
var IV_BIT_LEN = 128;
var mydomain = "10.131.1.36";
var mydomain = "localhost";
var LOGIN_URL = "http://" + mydomain + ":8080/pm-server/login.html";
var REGISTER_URL = "http://" + mydomain + ":8080/pm-server/register.html";
var USER_PAGE_URL = "http://" + mydomain + ":8080/pm-server/userpage.jsp";
Expand Down
2 changes: 1 addition & 1 deletion extension/client/front/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
console.log('content script running!');

// Constants
var mydomain = "10.131.1.36";
var mydomain = "localhost";
var LOGIN_URL = "http://" + mydomain + ":8080/pm-server/login.html";
var REGISTER_URL = "http://" + mydomain + ":8080/pm-server/register.html";
var URL_QUERY_URL = "http://" + mydomain + ":8080/pm-server/QueryURLServlet";
Expand Down
6 changes: 3 additions & 3 deletions extension/client/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</head>
<body>
<p>校验码:<span id="checksum"></span></p>
<a id="vault" class="entry" href="http://10.131.1.36:8080/pm-server/userpage.jsp">密码库</a>
<button id="logout" onclick="logout();">退出</button>
<div id="url"></div>
<a id="vault" class="entry" href="http://localhost:8080/pm-server/userpage.jsp">密码库</a>
<br />
<button id="logout">退出</button>

</body>
</html>
24 changes: 12 additions & 12 deletions extension/client/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function getChecksum(){
}

document.addEventListener('DOMContentLoaded', function() {
getCurrentURL(function(url){
document.getElementById('url').textContent = url;
});
// getCurrentURL(function(url){
// document.getElementById('url').textContent = url;
// });
var links = document.getElementsByTagName("a");
for (var i = links.length - 1; i >= 0; i--) {
(function() {
Expand All @@ -44,6 +44,11 @@ document.addEventListener('DOMContentLoaded', function() {
})();
}
// getChecksum();

document.getElementById("logout").addEventListener("click", function(){
var port2 = chrome.extension.connect({name: "logout"});
port2.postMessage("logout");
});
});

var port1 = chrome.extension.connect({name: "getchecksum"});
Expand All @@ -52,12 +57,7 @@ port1.onMessage.addListener(function(msg){
document.getElementById("checksum").textContent = (msg == "__TOLOGIN" ? "请登录" : msg);
});

function logout(){
var port2 = chrome.extension.connect({name: "logout"});
port2.postMessage("logout");
}

document.getElementById("logout").addEventListener("click", function(){
var port2 = chrome.extension.connect({name: "logout"});
port2.postMessage("logout");
});
// function logout(){
// var port2 = chrome.extension.connect({name: "logout"});
// port2.postMessage("logout");
// }
2 changes: 1 addition & 1 deletion extension/server/web/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
width: 30%;
height: 25%;
position: relative;
background-color: rgb(188, 165, 247);
background-color: antiquewhite;
padding: 20px;
border: 2px solid lightgray;
-webkit-border-radius: 5px;
Expand Down
17 changes: 7 additions & 10 deletions extension/server/web/userpage.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@
}
#container {
width: 60%;
height: 100%;
position: relative;
background-color: antiquewhite;
padding: 20px;
border: 2px solid lightgray;
border-bottom: 0;
border-top: 0;
min-width:200px;
min-height: 300px;
max-width: 550px;
Expand Down Expand Up @@ -82,8 +79,9 @@
}
table {
width: 100%;
margin-top: 10px;
margin-top: 30px;
text-align: center;
float: right;
}
table tr {
border: 3px solid brown;
Expand All @@ -96,11 +94,12 @@
</head>
<div id="container">
<div id="user-info">
<div>WELCOME ABOARD</div>
<p>Username: <span><%=username%></span></p>
<p>Checksum: <span id="checksum"><%=cipherChecksum%></span></p>
<button id="logout">退出</button>
<div>欢迎使用!</div>
<p>用户名:<span><%=username%></span></p>
<p>校验码:<span id="checksum"><%=cipherChecksum%></span></p>
</div>
<button id="show-password">显示密码</button>
<button id="hide-password">隐藏密码</button>
<table>
<tr>
<th>域名</th>
Expand All @@ -115,8 +114,6 @@
</tr>
<%}%>
</table>
<button id="show-password">显示密码</button>
<button id="hide-password">隐藏密码</button>
</div>
</body>
</html>

0 comments on commit d206c13

Please sign in to comment.