Author: abelevich
Date: 2007-12-17 12:36:39 -0500 (Mon, 17 Dec 2007)
New Revision: 4874
Modified:
trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js
Log:
add drop cursors support
Modified: trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-12-17 17:20:41 UTC
(rev 4873)
+++ trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-12-17 17:36:39 UTC
(rev 4874)
@@ -74,6 +74,14 @@
<defaultvalue>""</defaultvalue>
</property>
+ <property>
+ <name>cursorTypeMapping</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ mapping between drop types and acceptable cursors
+ </description>
+ </property>
+
<!--
<property>
<name>param</name>
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-12-17
17:20:41 UTC (rev 4873)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-12-17
17:36:39 UTC (rev 4874)
@@ -116,6 +116,17 @@
}
addOption("typeMapping", typeMapping);
+ Object cursorTypeMapping = zone.getCursorTypeMapping();
+ if (cursorTypeMapping instanceof String) {
+ try {
+ cursorTypeMapping = new JSONMap((String)cursorTypeMapping);
+ } catch (JSONException e) {
+ throw new FacesException(e);
+ }
+ }
+
+ addOption("cursorTypeMapping", cursorTypeMapping);
+
String acceptCursors = zone.getAcceptCursors();
if (!acceptCursors.equals("")) {
acceptCursors = convertCursorStyle(acceptCursors);
Modified:
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js
===================================================================
---
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js 2007-12-17
17:20:41 UTC (rev 4873)
+++
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js 2007-12-17
17:36:39 UTC (rev 4874)
@@ -23,6 +23,12 @@
this.typeMapping = {};
}
+ if (options.cursorTypeMapping) {
+ this.cursorTypeMapping = options.cursorTypeMapping;
+ } else {
+ this.cursorTypeMapping = {};
+ }
+
this.mouseoverBound = this.mouseover.bindAsEventListener(this);
this.mouseoutBound = this.mouseout.bindAsEventListener(this);
this.mouseupBound = this.mouseup.bindAsEventListener(this);
@@ -74,6 +80,11 @@
getTypeMapping: function() {
return this.typeMapping;
},
+
+ getCursorTypeMapping: function() {
+ return this.cursorTypeMapping;
+ },
+
drop: function(event, drag){
alert('I drop');
},
Show replies by date