Skip to content

Commit

Permalink
Adding basic demo for Sortable.
Browse files Browse the repository at this point in the history
  • Loading branch information
akoprow committed Feb 25, 2012
1 parent defc633 commit 11158ee
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
47 changes: 47 additions & 0 deletions demo.opa
@@ -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}
]
)
3 changes: 2 additions & 1 deletion packages/jQueryUI/jQueryUI/Makefile
Expand Up @@ -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
Expand Down

0 comments on commit 11158ee

Please sign in to comment.