Debian Codegraph @

closure-library/closure/goog/demos/dragdropdetector.html

raw
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2010 The Closure Library Authors. All Rights Reserved.
5
6 Use of this source code is governed by the Apache License, Version 2.0.
7 See the COPYING file for details.
8 -->
9 <head>
10 <title>goog.ui.DragDropDetector</title>
11 <script src="../base.js"></script>
12 <script>
13 goog.require('goog.ui.DragDropDetector');
14 goog.require('goog.ui.DragDropDetector.EventType');
15 </script>
16 <link rel="stylesheet" href="css/demo.css">
17 <link rel="stylesheet" href="../css/dragdropdetector.css">
18 <style type="text/css">
19 html, body {
20 width: 100%;
21 height: 100%;
22 margin: 0;
23 padding: 0;
24 }
25 </style>
26 </head>
27 <body>
28 <h1>goog.ui.DragDropDetector</h1>
29 <p>Try dropping images from other web pages on this page.</p>
30 <script type="text/javascript">
31 var detector = new goog.ui.DragDropDetector();
32 goog.events.listen(detector,
33 [
34 goog.ui.DragDropDetector.EventType.IMAGE_DROPPED,
35 goog.ui.DragDropDetector.EventType.LINK_DROPPED
36 ],
37 function(e) {
38 var str = 'Detected ' + e.getUrl();
39 if (e.getPosition) {
40 str += ' at ' + e.getPosition();
41 }
42 alert(str);
43 });
44 </script>
45 </body>
46 </html>