| OLD | NEW |
| 1 | 1 |
| 2 // Helpers | 2 // Helpers |
| 3 | 3 |
| 4 function $(id) { | 4 function $(id) { |
| 5 return document.getElementById(id); | 5 return document.getElementById(id); |
| 6 } | 6 } |
| 7 | 7 |
| 8 // TODO(arv): Remove these when classList is available in HTML5. | 8 // TODO(arv): Remove these when classList is available in HTML5. |
| 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 | 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 |
| 10 function hasClass(el, name) { | 10 function hasClass(el, name) { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // There was some concern that a malformed malicious URL could cause an XSS | 249 // There was some concern that a malformed malicious URL could cause an XSS |
| 250 // attack but setting style.backgroundImage = 'url(javascript:...)' does | 250 // attack but setting style.backgroundImage = 'url(javascript:...)' does |
| 251 // not execute the JavaScript in WebKit. | 251 // not execute the JavaScript in WebKit. |
| 252 | 252 |
| 253 var thumbnailUrl = d.thumbnailUrl || 'chrome://thumb/' + d.url; | 253 var thumbnailUrl = d.thumbnailUrl || 'chrome://thumb/' + d.url; |
| 254 t.querySelector('.thumbnail-wrapper').style.backgroundImage = | 254 t.querySelector('.thumbnail-wrapper').style.backgroundImage = |
| 255 url(thumbnailUrl); | 255 url(thumbnailUrl); |
| 256 var titleDiv = t.querySelector('.title > div'); | 256 var titleDiv = t.querySelector('.title > div'); |
| 257 titleDiv.xtitle = titleDiv.textContent = d.title; | 257 titleDiv.xtitle = titleDiv.textContent = d.title; |
| 258 var faviconUrl = d.faviconUrl || 'chrome://favicon/' + d.url; | 258 var faviconUrl = d.faviconUrl || 'chrome://favicon/' + d.url; |
| 259 titleDiv.style.backgroundImage = encodeURI(url); | 259 titleDiv.style.backgroundImage = url(faviconUrl); |
| 260 titleDiv.dir = d.direction; | 260 titleDiv.dir = d.direction; |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 /** | 264 /** |
| 265 * Calls chrome.send with a callback and restores the original afterwards. | 265 * Calls chrome.send with a callback and restores the original afterwards. |
| 266 */ | 266 */ |
| 267 function chromeSend(name, params, callbackName, callback) { | 267 function chromeSend(name, params, callbackName, callback) { |
| 268 var old = global[callbackName]; | 268 var old = global[callbackName]; |
| 269 global[callbackName] = function() { | 269 global[callbackName] = function() { |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 el.addEventListener('dragover', bind(this.handleDragOver, this)); | 1427 el.addEventListener('dragover', bind(this.handleDragOver, this)); |
| 1428 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); | 1428 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); |
| 1429 el.addEventListener('drop', bind(this.handleDrop, this)); | 1429 el.addEventListener('drop', bind(this.handleDrop, this)); |
| 1430 el.addEventListener('dragend', bind(this.handleDragEnd, this)); | 1430 el.addEventListener('dragend', bind(this.handleDragEnd, this)); |
| 1431 el.addEventListener('drag', bind(this.handleDrag, this)); | 1431 el.addEventListener('drag', bind(this.handleDrag, this)); |
| 1432 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); | 1432 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); |
| 1433 } | 1433 } |
| 1434 }; | 1434 }; |
| 1435 | 1435 |
| 1436 dnd.init(); | 1436 dnd.init(); |
| OLD | NEW |