| OLD | NEW |
| 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 Loading... |
| 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> > ' + 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 Loading... |
| 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> |
| OLD | NEW |