| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 if (oldClassName != newClassName) { | 227 if (oldClassName != newClassName) { |
| 228 t.className = newClassName; | 228 t.className = newClassName; |
| 229 } | 229 } |
| 230 | 230 |
| 231 // No need to continue if this is a filler. | 231 // No need to continue if this is a filler. |
| 232 if (newClassName == 'thumbnail-container filler') { | 232 if (newClassName == 'thumbnail-container filler') { |
| 233 continue; | 233 continue; |
| 234 } | 234 } |
| 235 | 235 |
| 236 t.href = d.url; | 236 t.href = d.url; |
| 237 // When we drag a thumbnail to the Bookmark Bar we need a title. |
| 238 t.title = d.title; |
| 237 t.querySelector('.pin').title = localStrings.getString(d.pinned ? | 239 t.querySelector('.pin').title = localStrings.getString(d.pinned ? |
| 238 'unpinthumbnailtooltip' : 'pinthumbnailtooltip'); | 240 'unpinthumbnailtooltip' : 'pinthumbnailtooltip'); |
| 239 t.querySelector('.remove').title = | 241 t.querySelector('.remove').title = |
| 240 localStrings.getString('removethumbnailtooltip'); | 242 localStrings.getString('removethumbnailtooltip'); |
| 241 | 243 |
| 242 // There was some concern that a malformed malicious URL could cause an XSS | 244 // There was some concern that a malformed malicious URL could cause an XSS |
| 243 // attack but setting style.backgroundImage = 'url(javascript:...)' does | 245 // attack but setting style.backgroundImage = 'url(javascript:...)' does |
| 244 // not execute the JavaScript in WebKit. | 246 // not execute the JavaScript in WebKit. |
| 245 | 247 |
| 246 var thumbnailUrl = d.thumbnailUrl || 'chrome://thumb/' + d.url; | 248 var thumbnailUrl = d.thumbnailUrl || 'chrome://thumb/' + d.url; |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 el.addEventListener('dragover', bind(this.handleDragOver, this)); | 1422 el.addEventListener('dragover', bind(this.handleDragOver, this)); |
| 1421 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); | 1423 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); |
| 1422 el.addEventListener('drop', bind(this.handleDrop, this)); | 1424 el.addEventListener('drop', bind(this.handleDrop, this)); |
| 1423 el.addEventListener('dragend', bind(this.handleDragEnd, this)); | 1425 el.addEventListener('dragend', bind(this.handleDragEnd, this)); |
| 1424 el.addEventListener('drag', bind(this.handleDrag, this)); | 1426 el.addEventListener('drag', bind(this.handleDrag, this)); |
| 1425 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); | 1427 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); |
| 1426 } | 1428 } |
| 1427 }; | 1429 }; |
| 1428 | 1430 |
| 1429 dnd.init(); | 1431 dnd.init(); |
| OLD | NEW |