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

Side by Side Diff: chrome/common/extensions/docs/examples/api/tabs/inspector/tabs_api.html

Issue 411008: Remove use of innerHTML and Toolstrips from example extensions (Closed)
Patch Set: cr changes Created 11 years, 1 month 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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="jstemplate_compiled.js" type="text/javascript"></script> 3 <script src="jstemplate_compiled.js" type="text/javascript"></script>
4 <script> 4 <script>
5 5
6 tabs = {}; 6 tabs = {};
7 tabIds = []; 7 tabIds = [];
8 8
9 focusedWindowId = undefined; 9 focusedWindowId = undefined;
10 currentWindowId = undefined; 10 currentWindowId = undefined;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 try { 124 try {
125 chrome.tabs.remove(tabId, function() { 125 chrome.tabs.remove(tabId, function() {
126 appendToLog('tab: ' + tabId + ' removed.'); 126 appendToLog('tab: ' + tabId + ' removed.');
127 }); 127 });
128 } catch (e) { 128 } catch (e) {
129 alert(e); 129 alert(e);
130 } 130 }
131 } 131 }
132 132
133 function appendToLog(logLine) { 133 function appendToLog(logLine) {
134 var log = document.getElementById('log'); 134 document.getElementById('log')
135 log.innerHTML = '<div> &gt;&nbsp;' + logLine + '</div>' + log.innerHTML; 135 .appendChild(document.createElement('div'))
136 .innerText = "> " + logLine;
136 } 137 }
137 138
138 function clearLog() { 139 function clearLog() {
139 document.getElementById('log').innerHTML = ''; 140 document.getElementById('log').innerText = '';
140 } 141 }
141 142
142 chrome.windows.onCreated.addListener(function(createInfo) { 143 chrome.windows.onCreated.addListener(function(createInfo) {
143 appendToLog('windows.onCreated -- window: ' + createInfo.id); 144 appendToLog('windows.onCreated -- window: ' + createInfo.id);
144 loadWindowList(); 145 loadWindowList();
145 }); 146 });
146 147
147 chrome.windows.onFocusChanged.addListener(function(windowId) { 148 chrome.windows.onFocusChanged.addListener(function(windowId) {
148 focusedWindowId = windowId; 149 focusedWindowId = windowId;
149 appendToLog('windows.onFocusChanged -- window: ' + windowId); 150 appendToLog('windows.onFocusChanged -- window: ' + windowId);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 <button onclick="loadWindowList();">Refresh</button> 380 <button onclick="loadWindowList();">Refresh</button>
380 <button onclick="updateAll();">Update All</button> 381 <button onclick="updateAll();">Update All</button>
381 <button onclick="moveAll();">Move All</button> 382 <button onclick="moveAll();">Move All</button>
382 <button onclick="clearLog();">-->Clear Log</button> 383 <button onclick="clearLog();">-->Clear Log</button>
383 <button onclick="chrome.windows.create();">New Window</button> 384 <button onclick="chrome.windows.create();">New Window</button>
384 </div> 385 </div>
385 <div id="log" style="background-color: #EEAAEE; margin: 20px; padding: 8px"> 386 <div id="log" style="background-color: #EEAAEE; margin: 20px; padding: 8px">
386 </div> 387 </div>
387 </body> 388 </body>
388 </html> 389 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698