Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from derDieDasJojo/master

added draggables
  • Loading branch information...
commit e75307f26de0258ccf059f9dc9057786464f1dd7 2 parents 5cdc95a + 039ce64
@akoprow authored
View
2  Makefile
@@ -13,7 +13,7 @@ OTHER_DEPENDS =
#Compiler variables
OPACOMPILER = opa
-MINIMAL_VERSION = 1150
+MINIMAL_VERSION = 0
FLAG = --minimal-version $(MINIMAL_VERSION) -v
PORT = 8080
View
1  README.markdown
@@ -4,6 +4,7 @@ This is a project binding [jQuery UI](http://jqueryui.com) and porting its demos
For now the only working functionality is:
* Sortables (default demo)
+* Draggables
Want to help?
View
24 jquery-ui-demo.opa
@@ -2,7 +2,27 @@ import jQueryUI
//type demo_page = { string name, ( -> xhtml) show }
//type demo = { string name, list(demo_page) pages }
+module Draggable {
+ demo =
+ { name: "Draggable"
+ , pages:
+ [ {name: "drag" , show: on_update_demo }
+ ]
+ }
+
+
+ client function on_update_demo(){
+ function mk_draggable(_) {
+ jQueryUI.Draggable.mk_draggable(#draggable)
+ //return js_void;
+ }
+
+ <div id=draggable style="background:#cccccc" onready={mk_draggable}>bla</div>
+
+ }
+
+}
module Sortable {
demo =
@@ -52,7 +72,7 @@ module Sortable {
}
-demos = [Sortable.demo]
+demos = [Sortable.demo, Draggable.demo]
function mk_demo(demo) {
function show_demo(gen)(_event) {
@@ -86,7 +106,7 @@ function page() {
Server.start(Server.http,
[ {resources: @static_resource_directory("resources")}
- , {register: ["resources/bootstrap.css", "resources/style.css", "resources/bootstrap.js"]}
+ , {register:{css: ["resources/bootstrap.css", "resources/style.css", "resources/bootstrap.js"]}}
, {title: "JQuery-UI in Opa", ~page}
]
)
View
6 packages/jQueryUI/jQueryUI.opa
@@ -20,5 +20,11 @@ module jQueryUI {
}
}
+ module Draggable {
+ function void mk_draggable(dom) {
+ elt = Dom.of_selection(dom)
+ %%JQueryUI.mk_draggable%%(elt)
+ }
+ }
}
View
2  packages/jQueryUI/jQueryUI/Makefile
@@ -2,7 +2,7 @@
# USER VARIABLES
MKLIB = opa-plugin-builder
PLUGNAME = jQueryUI.opp
-SRC = jQueryUI.js ui/jquery.ui.widget.js ui/jquery.ui.core.js ui/jquery.ui.mouse.js ui/jquery.ui.sortable.js
+SRC = jQueryUI.js ui/jquery.ui.widget.js ui/jquery.ui.core.js ui/jquery.ui.mouse.js ui/jquery.ui.sortable.js ui/jquery.ui.draggable.js
#ui/jquery-ui.js
########################################
View
6 packages/jQueryUI/jQueryUI/jQueryUI.js
@@ -20,3 +20,9 @@
return dom.bind( "sortupdate", function(event, ui) { on_update(); } );
}
+##register mk_draggable: Dom.private.element -> void
+##args(dom)
+{
+ dom.draggable();
+ return js_void;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.