Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
integrate simulated infobars into the gombot addon
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Nov 21, 2012
1 parent 6b94a9c commit ea7ca0e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -1,3 +1,6 @@
[submodule "server"]
path = server
url = git://github.com/mozilla/gombot
[submodule "infobar"]
path = infobar
url = git://github.com/lloyd/simulated_infobars
3 changes: 2 additions & 1 deletion background.html
Expand Up @@ -2,6 +2,7 @@
<script src="lib/jquery.js"></script>
<script src="lib/jsuri.js"></script>
<script src="lib/socket.io.js"></script>
<script src="infobar/manager.js"></script>
<script src="util.js"></script>
<script src="pin_ui.js"></script>
<script src="pin_ui_incontent.js"></script>
Expand All @@ -14,4 +15,4 @@
<body>
<!-- Invisible <textarea> used to copy data onto the clipboard -->
<textarea id="clipboard-sandbox"></textarea>
</body>
</body>
17 changes: 17 additions & 0 deletions data/remember_password_infobar.html
@@ -0,0 +1,17 @@
<html>
<head>
<style>
body {
background-color: red;
height: 40px;
}
</style>
</head>
<body>
This is my infobar. <button>ok</button>
<!-- gives you window.CompleteInfobar() which you call with
a javascript object to end your infobar -->
<script src="/infobar/api.js"></script>
<script src="remember_password_infobar.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions data/remember_password_infobar.js
@@ -0,0 +1,3 @@
document.querySelector('button').onclick = function() {
CompleteInfobar("all done");
};
1 change: 1 addition & 0 deletions infobar
Submodule infobar added at 0e3bb2
8 changes: 7 additions & 1 deletion main.js
Expand Up @@ -61,6 +61,12 @@ var messageHandlers = {
}
}
// Prompt the user to save the login
InfobarManager.run({
path: "data/remember_password_infobar.html"
}, function(err, response) {
console.log(err, response);
});

displayNotification({
notify: true,
tabId: tabID,
Expand Down Expand Up @@ -171,4 +177,4 @@ function validatePIN(_pin) {
// If there's no PIN set, accept.
if (!loginsLock || !loginsLock.pin) return true;
return _pin == loginsLock.pin;
}
}
3 changes: 2 additions & 1 deletion manifest.json
Expand Up @@ -28,6 +28,7 @@
"icons/small.png",
"data/pin_entry.html",
"data/pin_entry.js",
"data/css/pin_entry.css"
"data/css/pin_entry.css",
"data/remember_password_infobar.html"
]
}

0 comments on commit ea7ca0e

Please sign in to comment.