Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: chrome/common/extensions/docs/examples/api/cookies/manager.js

Issue 9289057: Changing manifest to v2 extension samples (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/cookies/manager.js
diff --git a/chrome/common/extensions/docs/examples/api/cookies/manager.html b/chrome/common/extensions/docs/examples/api/cookies/manager.js
similarity index 83%
copy from chrome/common/extensions/docs/examples/api/cookies/manager.html
copy to chrome/common/extensions/docs/examples/api/cookies/manager.js
index 8c644c92edbbb734f059ae473f1cab87f7ed2825..fd43af95b2fa7234b85d204420223ae24a8cf735 100644
--- a/chrome/common/extensions/docs/examples/api/cookies/manager.html
+++ b/chrome/common/extensions/docs/examples/api/cookies/manager.js
@@ -1,27 +1,3 @@
-<html>
-<head>
-<style>
-table {
- border-collapse:collapse;
-}
-
-td {
- border: 1px solid black;
- padding-left: 5px;
-}
-
-td.button {
- border: none;
-}
-
-td.cookie_count {
- text-align: right;
-}
-
-</style>
-
-<script>
-
if (!chrome.cookies) {
chrome.cookies = chrome.experimental.cookies;
}
@@ -155,10 +131,10 @@ function removeCookie(cookie) {
}
function removeCookiesForDomain(domain) {
- var timer = new Timer();
- cache.getCookies(domain).forEach(function(cookie) {
+ var timer = new Timer();
+ cache.getCookies(domain).forEach(function(cookie) {
removeCookie(cookie);
- });
+ });
}
function resetTable() {
@@ -269,29 +245,8 @@ function onload() {
});
}
-
-</script>
-</head>
-
-<body onload="onload()" onclick="focusFilter()">
-<h2>Cookies! ... Nom Nom Nom...</h2>
-<button onclick="removeAll()">DELETE ALL!</button>
-<div id="filter_div">
-Filter: <input id="filter" type="text" oninput="reloadCookieTable()">
-<button onclick="resetFilter()">x</button>
-</div>
-<br>
-<div id="summary_div">
-Showing <span id="filter_count"></span> of <span id="total_count"></span> cookie domains.
-<span id="delete_all_button"></span>
-</div>
-<br>
-<table id="cookies">
-<tr class="header">
-<th>Name</th>
-<th>#Cookies</th>
-</tr>
-</table>
-
-</body>
-</html>
+document.addEventListener('DOMContentLoaded', onload);
+document.body.addEventListener('click', focusFilter);
+document.querySelector('#remove_button').addEventListener('click', removeAll);
+document.querySelector('#filter_div input').addEventListener('input', reloadCookieTable);
+document.querySelector('#filter_div button').addEventListener('click', resetFilter);
Mike West 2012/01/26 22:16:33 80+ chars (which you already know). You'll need t

Powered by Google App Engine
This is Rietveld 408576698