Permalink
Browse files

Adding basic demo for Sortable.

  • Loading branch information...
1 parent defc633 commit 11158eee3c224cbf53f6e67bc4d7f0645d6c2685 @akoprow akoprow committed Feb 25, 2012
Showing with 49 additions and 1 deletion.
  1. +47 −0 demo.opa
  2. +2 −1 packages/jQueryUI/jQueryUI/Makefile
View
@@ -0,0 +1,47 @@
+import jQueryUI
+
+module Sortable {
+
+ function xhtml() {
+ function mk_entry(i) {
+ <li>Item #{i}</>
+ }
+ function mk_sortable(_) {
+ jQueryUI.Sortable.mk_sortable(#sortable)
+ jQueryUI.Sortable.disable_selection(#sortable)
+ }
+ <ul id=sortable onready={mk_sortable}>
+ {List.init(mk_entry, 7)}
+ </ul>
+ }
+
+}
+
+demos = [(Sortable, "Sortable")]
+
+function mk_demo((demo, name)) {
+ function show(_) {
+ #demo = demo.xhtml()
+ }
+ <li><a onclick={show}>{name}</></>
+}
+
+function page() {
+ <div class=container>
+ <div class=row>
+ <div class=span2>
+ <ul class="nav nav-tabs nav-stacked">
+ {List.map(mk_demo, demos)}
+ </>
+ </>
+ <div class=span10 id=demo />
+ </>
+ </>
+}
+
+Server.start(Server.http,
+ [ {resources: @static_resource_directory("resources")}
+ , {register: ["resources/bootstrap.css"]}
+ , {title: "JQuery-UI in Opa", ~page}
+ ]
+)
@@ -2,7 +2,8 @@
# USER VARIABLES
MKLIB = opa-plugin-builder
PLUGNAME = jQueryUI.opp
-SRC = ui/jquery-ui.js jQueryUI.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.js
########################################
# MAKEFILE VARIABLES

0 comments on commit 11158ee

Please sign in to comment.