| <!DOCTYPE html> |
| <html> |
| <!-- |
| Copyright 2010 The Closure Library Authors. All Rights Reserved. |
| |
| Use of this source code is governed by the Apache License, Version 2.0. |
| See the COPYING file for details. |
| --> |
| <head> |
| <title>goog.ui.DragDropDetector</title> |
| <script src="../base.js"></script> |
| <script> |
| goog.require('goog.ui.DragDropDetector'); |
| goog.require('goog.ui.DragDropDetector.EventType'); |
| </script> |
| <link rel="stylesheet" href="css/demo.css"> |
| <link rel="stylesheet" href="../css/dragdropdetector.css"> |
| <style type="text/css"> |
| html, body { |
| width: 100%; |
| height: 100%; |
| margin: 0; |
| padding: 0; |
| } |
| </style> |
| </head> |
| <body> |
| <h1>goog.ui.DragDropDetector</h1> |
| <p>Try dropping images from other web pages on this page.</p> |
| <script type="text/javascript"> |
| var detector = new goog.ui.DragDropDetector(); |
| goog.events.listen(detector, |
| [ |
| goog.ui.DragDropDetector.EventType.IMAGE_DROPPED, |
| goog.ui.DragDropDetector.EventType.LINK_DROPPED |
| ], |
| function(e) { |
| var str = 'Detected ' + e.getUrl(); |
| if (e.getPosition) { |
| str += ' at ' + e.getPosition(); |
| } |
| alert(str); |
| }); |
| </script> |
| </body> |
| </html> |