Skip to content

Commit

Permalink
Merge pull request akoprow#2 from derDieDasJojo/master
Browse files Browse the repository at this point in the history
added draggables
  • Loading branch information
akoprow committed Jul 16, 2012
2 parents 5cdc95a + 039ce64 commit e75307f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OTHER_DEPENDS =


#Compiler variables #Compiler variables
OPACOMPILER = opa OPACOMPILER = opa
MINIMAL_VERSION = 1150 MINIMAL_VERSION = 0
FLAG = --minimal-version $(MINIMAL_VERSION) -v FLAG = --minimal-version $(MINIMAL_VERSION) -v
PORT = 8080 PORT = 8080


Expand Down
1 change: 1 addition & 0 deletions README.markdown
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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: For now the only working functionality is:


* Sortables (default demo) * Sortables (default demo)
* Draggables


Want to help? Want to help?


Expand Down
24 changes: 22 additions & 2 deletions jquery-ui-demo.opa
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@ import jQueryUI


//type demo_page = { string name, ( -> xhtml) show } //type demo_page = { string name, ( -> xhtml) show }
//type demo = { string name, list(demo_page) pages } //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 { module Sortable {


demo = demo =
Expand Down Expand Up @@ -52,7 +72,7 @@ module Sortable {


} }


demos = [Sortable.demo] demos = [Sortable.demo, Draggable.demo]


function mk_demo(demo) { function mk_demo(demo) {
function show_demo(gen)(_event) { function show_demo(gen)(_event) {
Expand Down Expand Up @@ -86,7 +106,7 @@ function page() {


Server.start(Server.http, Server.start(Server.http,
[ {resources: @static_resource_directory("resources")} [ {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} , {title: "JQuery-UI in Opa", ~page}
] ]
) )
6 changes: 6 additions & 0 deletions packages/jQueryUI/jQueryUI.opa
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ module jQueryUI {
} }


} }
module Draggable {
function void mk_draggable(dom) {
elt = Dom.of_selection(dom)
%%JQueryUI.mk_draggable%%(elt)


}
}
} }
2 changes: 1 addition & 1 deletion packages/jQueryUI/jQueryUI/Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# USER VARIABLES # USER VARIABLES
MKLIB = opa-plugin-builder MKLIB = opa-plugin-builder
PLUGNAME = jQueryUI.opp 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 #ui/jquery-ui.js


######################################## ########################################
Expand Down
6 changes: 6 additions & 0 deletions packages/jQueryUI/jQueryUI/jQueryUI.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
return dom.bind( "sortupdate", function(event, ui) { on_update(); } ); return dom.bind( "sortupdate", function(event, ui) { on_update(); } );
} }


##register mk_draggable: Dom.private.element -> void
##args(dom)
{
dom.draggable();
return js_void;
}

0 comments on commit e75307f

Please sign in to comment.