1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
\r
5 <title>Rico TV Networks</title>
\r
7 <script src="LoadRicoClient.js" type="text/javascript"></script>
\r
8 <link href="../demo.css" type="text/css" rel="stylesheet" />
\r
10 <script type='text/javascript'>
\r
11 var names = [ "CNN", "ZDF", "BBC", "MTV", "CBS", "NHK" ];
\r
12 var CustomDraggable;
\r
13 Rico.onLoad( function() {
\r
14 Rico.setDebugArea('logger');
\r
15 Rico.enableLogging();
\r
16 Rico.extend(CustomDraggable.prototype, new Rico.Draggable());
\r
17 Rico.extend(CustomDraggable.prototype, CustomDraggableMethods);
\r
19 PopulateZone(names, 'nameList', 0);
\r
20 // 0 is the default zone number, so it can be left out in the subsequent calls to registerDropZone
\r
21 Rico.registerDropZone( new Rico.Dropzone('dropZone1'));
\r
22 Rico.registerDropZone( new Rico.Dropzone('dropZone2'));
\r
23 Rico.registerDropZone( new Rico.Dropzone('nameListDeleted'));
\r
26 function PopulateZone(names, id, zoneNumber) {
\r
28 for ( var i=0; i < names.length; i++ ) {
\r
29 var d=document.createElement('div');
\r
30 d.className='CustomDraggable';
\r
31 d.innerHTML=names[i];
\r
33 Rico.registerDraggable( new CustomDraggable('Custom', d), zoneNumber );
\r
37 function CustomDraggable(type, htmlElement) {
\r
38 this.initialize(type, htmlElement);
\r
41 var CustomDraggableMethods = {
\r
43 startDrag: function() {
\r
44 this.startParent=this.htmlElement.parentNode;
45 Rico.log("startDragging: " + this.htmlElement.innerHTML + " from [" + this.startParent.id +"]");
\r
48 endDrag: function() {
\r
49 this.endParent=this.htmlElement.parentNode;
50 Rico.log("endDragging: " + this.htmlElement.innerHTML + " from [" + this.startParent.id + "] to [" + this.endParent.id + "]" );
\r
57 <style type="text/css">
\r
63 background-color : #ffffcc;
\r
64 border : 1px solid #8b8b8b;
\r
70 background-color : #ffffff;
\r
71 border : 1px solid #8b8b8b;
\r
80 font-family : Arial, Helvetica;
\r
83 font-family : Arial;
\r
97 div.CustomDraggable {
\r
107 <h1>Rico Drag-and-Drop: TV Networks</h1>
\r
110 <script type='text/javascript'>
\r
111 document.write(Rico.Lib+' '+Rico.LibVersion);
\r
115 <p>This example demonstrates how to track drop-and-drop objects as they are moved by the user. Watch the log messages!</p>
\r
117 <div id="exampleContainer" style="float:left;background-color:#DDD;">
\r
120 <div id="dragBox" class='zone'>
\r
121 <span class="catHeader">Channels</span>
\r
122 <div class="listBox" id="nameList"></div>
\r
125 <div id="deleteZone" class='zone'>
\r
126 <span class="catHeader">Delete zone</span>
\r
127 <div class="listBox" id="nameListDeleted"></div>
\r
131 <div style='clear:both'>
\r
132 <div id="dropBox1" class='zone'>
\r
133 <span class="catHeader">Drop1</span>
\r
134 <div class="listBox" id="dropZone1"></div>
\r
137 <div id="dropBox2" class='zone'>
\r
138 <span class="catHeader">Drop2</span>
\r
139 <div class="listBox" id="dropZone2"></div>
\r
143 <div style="clear:both;margin:8px;">
\r
144 <span id='loghead' class="catHeader">drag-n-drop message log:</span>
\r
145 <textarea class="logBox" id="logger" rows='7' cols='80'></textarea>
\r