- Added functional demo application

- Removed datepicker folder from functional demo folder
This commit is contained in:
Eduardo Lundgren 2008-06-09 06:20:15 +00:00
parent a6b0fc7a83
commit d185e8cc05
81 changed files with 3851 additions and 1264 deletions

View File

@ -0,0 +1,961 @@
/* Site
-------------------------------- */
html {
overflow-y: scroll;
background: #5f5f5f url('../images/html_bg.png') repeat-x scroll;
}
body {
margin: 0;
padding: 0 0 20px;
background: transparent url('../images/body_bg.jpg') no-repeat center top;
min-height: 100%;
/* font-family: "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif"; */
font-family: "Arial", "Helvetica", "Verdana", "sans-serif";
}
#wrapper {
margin: 0 auto;
width: 956px;
position: relative;
/*
background: url('../images/body_footer_bg.jpg') no-repeat center bottom;
padding-bottom: 365px;
*/
}
#banner {
height: 125px;
}
#content .bg {
opacity: 0;
-moz-opacity: 0;
filter: alpha(opacity=0);
}
table.layout-grid a.disabled, table.layout-grid a.disabled:hover {
color: #aaa;
cursor: default;
text-decoration: line-through;
}
div.notice {
background: #FFF1AF;
padding: 3px;
margin-bottom: 5px;
font-size: 12px;
border: 1px solid #EFD500;
}
/* Logo
-------------------------------- */
h1.logo {
position: absolute;
top: 55px;
left: 28px;
margin: 0;
}
h1.logo,
h1.logo a {
width: 235px;
height: 55px;
}
h1.logo a {
display: block;
background: url('../images/logo.gif') no-repeat;
}
h1.logo a span {
display: none;
}
/* Dock
-------------------------------- */
#dock {
height: 25px;
float: left;
position: absolute;
top: 0;
right: 2px;
}
#dock .left {
float: left;
width: 3px;
height: 25px;
background: url('../images/dock.png') no-repeat left top;
}
#dock .right {
float: left;
width: 3px;
height: 25px;
background: url('../images/dock.png') no-repeat right top;
}
#dock ul,
#dock ul li {
float: left;
list-style-type: none;
margin: 0;
padding: 0;
}
#dock ul {
padding: 0 6px;
height: 25px;
background-color: #000;
}
#dock ul li {
padding: 0 6px;
position: relative;
}
#dock ul li a {
float: left;
display: block;
padding: 0 5px;
color: #ccc;
text-decoration: none;
font-size: 12px;
line-height: 22px;
}
#dock ul li a:hover,
#dock ul li.selected a {
color: #fff;
border-bottom: 2px solid #ff9c08;
}
#dock ul li.selected a {
font-weight: bold;
}
/* Navigation
-------------------------------- */
#navigation {
height: 41px;
float: left;
position: absolute;
top: 62px;
right: 0px;
}
#navigation .left {
float: left;
width: 5px;
height: 41px;
/* background: url('../images/navigation.png') no-repeat left top; */
background: url('../images/navigation_l.png') no-repeat left top;
}
#ie6 #navigation .left {
background: transparent none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/navigation_l.png', sizingMethod='scale');
zoom: 1;
}
#navigation .right {
float: left;
width: 3px;
height: 41px;
background: url('../images/navigation.png') no-repeat right top;
}
#navigation ul,
#navigation ul li {
float: left;
list-style-type: none;
margin: 0;
padding: 0;
font-size: 13px;
line-height: 38px;
}
#navigation ul {
height: 41px;
background: url('../images/navigation.png') repeat-x 0 -41px;
}
#navigation ul li a {
float: left;
display: block;
height: 41px;
padding: 0 18px;
color: #ccc;
text-decoration: none;
background: url('../images/navigation_s.png') no-repeat right top;
}
#navigation ul li.selected a {
color: #fff;
}
#navigation ul li.last a{
background-image: none;
}
#navigation ul li a:hover {
color: #fff;
}
/* Content
-------------------------------- */
#content-wrapper {
background: #FFF url('../images/content_bg.png') repeat-y 0 0;
}
#content {
background: url('../images/content_body_bg.png') no-repeat 0 13px;
zoom: 1;
}
.content-top {
font-size: 1px;
height: 13px;
background: url('../images/content_top_bg.png');
}
.content {
padding: 0 3px 0 3px;
overflow: hidden;
}
#content .content {
min-height: 380px;
background: url('../images/dot.png') repeat-y 203px 0;
}
#home #content .content,
#download #content .content,
#demos #content .content {
background: none;
}
#ie6 #content .content {
height: 380px;
overflow-y: visible;
}
/* Layout */
.content-head {
height: 74px;
border-bottom: 1px solid #ccc;
background-color: #fff;
}
.content-head h2 {
float: left;
margin: 0;
padding: 20px 0 20px 24px;
color: #ff9c08;
font: normal 29px/30px "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
letter-spacing: .5px;
}
.content-head h2 span {
padding-right: 16px;
border-right: 1px solid #ccc;
}
.content-head p {
margin: 0;
padding: 28px 0 0 12px;
float: left;
font: normal 15px "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
letter-spacing: .5px;
}
/* Layout
-------------------------------- */
.themes {
background: url('../images/themes_bg.png') repeat-x scroll 0 -1px;
}
/* Layout
-------------------------------- */
.layout-grid {
width: 100%;
}
.layout-grid td {
vertical-align: top;
}
.layout-grid td.home {
background: url('../images/home_bg.jpg') no-repeat scroll right top;
height: 412px;
padding: 0 600px 0 24px;
}
.layout-grid td.left-nav {
width: 200px;
}
.layout-grid td.normal {
border-left: 1px solid #ccc;
padding: 20px 24px;
font-family: "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
}
.layout-grid td.demos {
background: url('../images/demos_bg.jpg') no-repeat;
height: 337px;
overflow: hidden;
}
.layout-grid td.download {
background: url('../images/demos_bg.jpg') no-repeat;
height: 337px;
}
/* Home
-------------------------------- */
.home h3 {
margin: 0;
padding: 17px 0 11px 0;
color: #ff9c08;
font: normal 30px "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
letter-spacing: .5px;
}
.home p.large {
padding-bottom: 15px;
color: #000;
font: bold 13px/19px "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
letter-spacing: .2px;
line-height: 16px;
}
.home p {
margin: 0;
padding-bottom: 14px;
color: #333;
font: normal 11px/14px 'Trebuchet MS', 'Arial', 'Helvetica', sans-serif;
}
.teaserbox {
position: absolute;
top: 265px;
left: 452px;
width: 450px;
}
.teaserbox ul {
list-style-type: square;
}
.teaserbox p {
margin: 5px;
padding: 0px;
}
.teaserbox h4 {
margin-bottom: 0px;
position: relative;
left: 1px;
top: 1px;
color: #fff;
}
.teaserbox h4 span {
position: absolute;
top: -1px;
left: -1px;
color: #000;
}
/* Side Menu
-------------------------------- */
.section {
padding: 24px 23px 8px 22px;
border-bottom: 1px dashed #ccc;
}
ul.side-menu,
ul.side-menu li,
p.side-menu-title {
list-style-type: none;
margin: 0;
padding: 0;
letter-spacing: 0.75pt;
}
ul.side-menu li a {
font: normal 11px 'Arial', 'Helvetica', sans-serif;
text-decoration: none;
color: #000;
}
ul.side-menu li a:hover {
color: #e87b10;
}
p.side-menu-title {
font: bold 15px 'Arial', 'Helvetica', sans-serif;
color: #e87b10;
}
ul.side-menu {
padding: 5px 2px 0;
}
/* Normal
-------------------------------- */
.normal h3,
.normal h4 {
margin: 0;
font-weight: normal;
}
.normal h3 {
padding: 0 0 9px;
}
.normal h4 {
padding-bottom: 21px;
border-bottom: 1px dashed #999;
font-size: 12px;
font-weight: bold;
}
.normal .pull-quote {
padding: 6px 0;
line-height: 20px;
text-transform: uppercase;
font-size: 12px;
}
.normal p {
font-size: 12px;
}
/* Download
-------------------------------- */
td.download {
/*height: 650px !important;*/
}
.download .click-to-download {
position: relative;
margin: 61px 3px 0;
padding: 0 19px;
background: url('../images/download-top.gif') no-repeat left top;
width: 270px;
height: 226px;
float: left;
font-family: "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
}
.download .click-to-download .bg-footer,
.download .click-to-download .bg {
position: absolute;
bottom: 0;
left: 0;
width: 308px;
height: 102px;
background: url('../images/download-bottom.png') no-repeat left top;
}
.download .click-to-download .bg {
background-position: left bottom;
}
.download .click-to-download h3 {
margin: 0;
padding: 14px 0 10px;
font-weight: normal;
font-size: 21px;
}
.download .click-to-download h3 span {
font-size: 10px;
}
.download .click-to-download p {
margin: 0;
padding: 12px 0 0;
font-size: 12px;
}
.download .click-to-download a.download {
display: block;
position: absolute;
left: 65px;
top: 136px;
height: 38px !important;
width: 240px;
font-size: 16px;
font-weight: bold;
}
.download .click-to-download a.download:link {
color: #333;
text-decoration: none;
}
.download .click-to-download a.download:visited {
color: #333;
text-decoration: none;
}
.download .builder {
position: absolute;
top: 475px;
right: 16px;
width: 612px;
font-family: "Lucida Grande", "Arial", "Helvetica", "Verdana", "sans-serif";
font-size: 12px;
opacity: 0;
filter: alpha(opacity=0);
}
.download .builder h3 {
margin: 0;
padding: 5px 10px 10px;
font-weight: normal;
font-size: 21px;
}
.download .builder p {
margin: 0;
padding: 0 0 0 12px;
font-size: 12px;
}
.download .builder .top {
height: 8px;
background-image: url('../images/builder_top.png');
}
.download .builder .bottom {
height: 8px;
background-image: url('../images/builder_bottom.png');
}
.download .builder .content {
background-image: url('../images/builder_bg.png');
}
.download .p {
padding: 5px 10px 10px;
}
.components-list {
font-size: 12px;
}
.components-list table {
width: 100%;
}
.components-list th,
.components-list td {
text-align: left;
vertical-align: middle !important;
padding: 3px;
}
.components-list th {
line-height: 22px;
padding: 0 0 4px 2px;
cursor: default;
}
.components-list label {
padding-left: 5px;
}
.list-section {
border-bottom: 1px dashed #bbb;
background: #EAEAEA;
padding: 10px 10px 10px 10px;
width: 715px;
line-height: 18px;
}
.list-padding {
padding: 5px;
line-height: 18px;
}
.list-component {
background-color: #F4F4F4;
}
.list-component-selected {
font-weight: bold;
}
.text-bg-up,
.text-bg-down {
background:#FFFFFF url(../images/text-bg-up.gif) repeat-x scroll 0pt;
background-position:0px 0px;
}
.text-bg-down { background:#FFFFFF url(../images/text-bg-down.gif) repeat-x scroll 0pt !important; }
.ui-transparent {
opacity:0;
filter:Alpha(Opacity=0);
}
.text-align-right {
text-align: right !important;
}
.text-align-left {
text-align: left !important;
}
.text-align-center {
text-align: center !important;
}
.label-files {
background: url(../images/group.png) no-repeat;
padding-left: 19px;
line-height: 20px;
cursor: pointer;
}
.download #total-size {
width: 160px;
margin-left: 90px;
text-align: right;
}
.big {
font-size: 13px;
font-weight: bold;
}
.title-big {
font-size: 14px;
font-weight: bold;
letter-spacing: .3px;
}
/* Launch Pad
-------------------------------- */
#launch-pad {
height: 127px;
overflow: hidden;
background: url('../images/launch-pad_bg.png') repeat-y center top;
padding: 11px 0px 11px 16px;
}
#launch-pad .launch-pad-button {
float: left;
width: 255px;
height: 106px;
background: url('../images/launch-pad_button.png') no-repeat;
padding: 21px 22px 0 23px;
margin: 0 6px;
cursor: pointer;
cursor: hand;
position: relative;
}
#ie6 #launch-pad .launch-pad-button {
height: 106px;
}
#launch-pad .launch-pad-button .bg {
position: absolute;
top: 0;
left: 0;
width: 310px;
height: 127px;
background: url('../images/launch-pad_button.png') no-repeat left bottom;
}
#launch-pad .launch-pad-button h3,
#launch-pad .launch-pad-button p {
position: relative;
}
#launch-pad .launch-pad-button.left {
margin-left: 0;
}
#launch-pad .launch-pad-button.right {
margin-right: 0;
}
#launch-pad .launch-pad-button h3 {
margin: 0;
padding: 0 0 4px;
color: #ff9c08;
font: normal 18px 'Arial', 'Helvetica', sans-serif;
letter-spacing: .8px
}
#launch-pad .launch-pad-button h3 a,
#launch-pad .launch-pad-button h3 a:hover {
color: #ff9c08;
text-decoration: none;
}
#launch-pad .launch-pad-button p {
margin: 0;
padding: 0 2px;
color: #cbcbcb;
font: normal 11px/15px 'Arial', 'Helvetica', sans-serif;
letter-spacing: .2px;
}
/* Footer
-------------------------------- */
#footer {
height: 45px;
padding: 10px 0;
position: relative;
}
#footer .inner {
position: relative;
z-index: 2;
}
#ie6 #footer .inner {
zoom: 1;
}
#footer .bg {
background: url('../images/footer_bg.png') no-repeat left top;
width: 100%;
height: 65px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
#ie6 #footer .bg {
background: transparent none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/footer_bg.png', sizingMethod='scale');
zoom: 1;
}
#footer p {
margin: 0;
padding: 0;
color: #5e5e5e;
font: normal 9px 'Arial', 'Helvetica', sans-serif;
text-transform: uppercase;
}
#footer p a {
color: #bbb;
}
#footer span.first {
display: block;
float: left;
padding: 6px 0 0 16px;
}
#footer .block {
display: block;
float: left;
}
#footer .block span,
#footer span.empty {
display: none;
}
#footer .liferay {
margin: 3px 22px 0px 3px;
background: url('../images/icon_liferay.gif');
width: 98px;
height: 22px;
border: 0;
}
#footer .adobe {
margin: 2px 0 0 0;
background: url('../images/icon_adobe.png');
width: 28px;
height: 28px;
}
/* Demoflow
-------------------------------- */
div.demoflow-button-left {
position: absolute;
left: -3px;
top: 371px;
background: url('../images/demos_arrows.png') no-repeat left top;
width: 52px;
height: 45px;
cursor: pointer; cursor: hand;
z-index: 999;
}
div.demoflow-button-left .bg {
background: url('../images/demos_arrows.png') no-repeat left bottom;
width: 52px;
height: 45px;
position: absolute;
top: 0;
left: 0;
}
div.demoflow-button-right {
position: absolute;
right: -4px;
top: 371px;
background: url('../images/demos_arrows.png') no-repeat right top;
width: 52px;
height: 45px;
cursor: pointer; cursor: hand;
z-index: 999;
}
div.demoflow-button-right .bg {
position: absolute;
left: 0;
top: 0;
background: url('../images/demos_arrows.png') no-repeat right bottom;
width: 52px;
height: 45px;
}
.demoflow {
position: relative;
top: 22px;
left: 0;
width: 950px;
height: 337px;
}
.demoflow div {
float: left;
height: 100px;
width: 75px;
cursor: pointer; cursor: hand;
}
.ie .demoflow div {
zoom: 1;
}
.demoflow div {
border: 1px solid #666;
}
.demoflow div:hover {
border: 1px solid #666;
/*opacity: 1 !important;*/
}
.demoflow div img {
height: 100%;
width: 100%;
}
.demoflow div.shadow {
height: 100%;
width: 100%;
position: absolute;
top: 0px;
left: 0px;
background-color: black;
}
.ie .demoflow div.shadow {
display: none;
}
/* Functional Demos */
#links {
float:left;
width:155px;
font-size: 13px;
}
#functional ul {
list-style: none;
padding: 0;
margin: 0;
}
#functional #links ul {
margin-top:10px;
line-height:1.2em;
}
#functional #links ul li a{
border-bottom: 1px solid #F4F4F4;
display:block;
padding: 3px 3px 3px 12px;
font-size: 95%;
text-decoration: none;
color: #000;
height: 15px;
}
#functional #links ul li a:hover,
#functional #links ul li a:focus {
background: #EAEAEA;
border-color: #BBBBBB;
}
/* About */
div.about ul {
list-style-type: square;
margin-bottom: 50px;
}
div.about ul li h5 {
font-size: 16px;
margin-bottom: 10px;
}
div.about ul li a:link, div.about ul li a:visited {
text-decoration: none;
color: #666;
}
div.about ul li a:hover {
color: #000;
}
div.about ul li p {
padding-right: 40px;
padding-left: 20px;
}

View File

@ -0,0 +1,98 @@
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
===============================================================================
*/
/*
this file shows how to configure a static setup
it must be linked from the head of a page like:
<link rel="stylesheet" type="text/css" href="chili/recipes.css"/>
*/
.html .php { color: red; font-weight: bold; }
.html .tag { color: navy; font-weight: bold; }
.html .aname { color: purple; }
.html .avalue { color: fuchsia; }
.html .mlcom { color: green; }
.html .entity { color: teal; }
.javascript .mlcom { color: #4040c2; }
.javascript .com { color: green; }
.javascript .regexp { color: maroon; }
.javascript .string { color: teal; }
.javascript .keywords { color: navy; font-weight: bold; }
.javascript .global { color: blue; }
.javascript .numbers { color: red; }
.mysql .function { color: #e17100; }
.mysql .keyword { color: navy; font-weight: bold; }
.mysql .mlcom { color: gray; }
.mysql .com { color: green; }
.mysql .number { color: red; }
.mysql .hexnum { color: red; font-weight: bold; }
.mysql .string { color: purple; }
.mysql .quid { color: fuchsia; }
.mysql .id { color: maroon; }
.mysql .value { color: gray; font-weight: bold; }
.mysql .variable { color: #4040c2; }
.php .com { color: green; }
.php .const1 { color: red; }
.php .const2 { color: red; }
.php .func { color: #e17100; }
.php .global { color: red; }
.php .keyword { color: navy; font-weight: bold; }
.php .mlcom { color: gray; }
.php .name { color: maroon; }
.php .number { color: red; }
.php .string1 { color: purple; }
.php .string2 { color: fuchsia; }
.php .value { color: gray; font-weight: bold; }
.php .variable { color: #4040c2; }
.css .mlcom { color: #4040c2; }
.css .color { color: green; }
.css .string { color: teal; }
.css .attrib { color: navy; font-weight: bold; }
.css .value { color: blue; }
.css .number { color: red; }
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
===============================================================================
*/
.javascript .mlcom { color: #4040c2; }
.javascript .com { color: green; }
.javascript .regexp { color: maroon; }
.javascript .string { color: teal; }
.javascript .keywords { color: navy; font-weight: bold; }
.javascript .global { color: blue; }
.javascript .numbers { color: red; }
.javascript .jquery .object { color: red; font-weight: bold; }
.javascript .jquery .private { background-color: #CCCC99; }
.javascript .jquery .attributes { background-color: #CCCC00; }
.javascript .jquery .traversing { background-color: #CCCC00; }
.javascript .jquery .manipulation { background-color: #CCCC00; }
.javascript .jquery .utilities { background-color: #CCCCFF; }
.javascript .jquery .core { background-color: #7F7FFF; color: white; }
.javascript .jquery .ajax { background-color: #7F7FFF; color: #FFD400; }
.javascript .jquery .css { background-color: #999900; color: white; }
.javascript .jquery .effects { background-color: #FFAA00; }
.javascript .jquery .events { background-color: #FFD400; }

View File

@ -0,0 +1,205 @@
/*************************************/
/* Viewer: models */
#containerDemo {
width: 690px;
zoom: 1;
}
#containerDemo .ui-wrapper {
margin:0px 10px;
}
#containerDemo .ui-details {
margin:0px 10px 10px 0px;
border-bottom: 2px solid #bbb;
}
#containerDemo .menutitle {
font-size: 14px;
letter-spacing: .5px;
padding-bottom: 3px;
}
#containerDemo .ui-demo-options {
background: #f2f2f2;
border-bottom: 1px #bbb solid;
padding: 10px;
margin: 10px 0 20px 0;
width: 690px;
_width: 670px;
font-size: 12px;
}
.sortable-container li {
margin: 0;
padding: 0;
border: 0;
outline: 0;
list-style: circle;
background: #EAEAEA;
font-size: 12px;
margin:2px;
padding: 3px;
width: 100px;
}
.colored {
display: block;
background: #fff;
margin-top: 5px;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
white-space: pre;
padding: 10px;
font-size: 11px;
font-family: Courier New;
width: 640px;
overflow-x: auto;
overflow-y: hidden;
/*min height hack*/
* min-height:25px;
* height:auto !important;
* height:25px;
* padding: 15px;
}
#containerDemo .ui-demo-description {
margin-bottom: 10px;
font-size: 12px;
}
#containerDemo .link-view-source {
margin-left: 5px;
}
#containerDemo .proxy {
border: 1px dashed #000;
}
#containerDemo .lightblue-bg{
background: #E8EEF7;
}
#containerDemo .blue-bg {
background: #C3D9FF;
}
#containerDemo .green-bg {
background: #74DD82;
}
#containerDemo a {
color:#000;
}
.snippet {
white-space: nowrap;
overflow: hidden;
empty-cells: show;
}
/*************************************/
/* Components */
.proxy {
border: 1px dashed #000/*#3399ff*/;
}
.resizable {
width: 100px; height: 100px;
border: 1px solid #000;
padding: 10px;
font-size: 12px;
}
.draggable {
width: 100px;
height: 40px;
top: 10px;
right: 10px;
background-color: #68BFEF;
border: 2px solid #0090DF;
padding: 5px;
margin: 0 0 12px 12px;
font-size: 12px;
}
div.drag-handle
{
cursor: move;
background-color: #0090DF;
height: 15px;
}
.block {
border: 2px solid #0090DF;
background-color: #68BFEF;
width: 75px;
height: 75px;
margin: 10px;
z-index: 100;
}
.drop {
background-color: #e9b96e;
border: 3px double #c17d11;
width: 150px;
margin: 10px;
min-height: 200px;
min-height:200px;
height:auto !important;
height:200px;
opacity: 0.7;
filter:alpha(opacity:70);
text-align: center;
}
.droppable-active {
opacity: 1.0;
filter:alpha(opacity:100);
}
.droppable-hover {
outline: 1px dotted black;
background-color: #73d216;
border-color: #4e9a06;
}
.silver {
background-color: #fafafa;
border-color: silver;
}
.draggable.green {
background-color: #73d216;
border-color: #4e9a06;
}
.draggable.red {
background-color: #ef2929;
border-color: #cc0000;
}
.ui-selecting {
background-color: #eee;
}
.ui-selected {
background-color: #E6F7D4;
}
.sortable-container #example2 li {
background: none;
}
.sortable-container #example3 li {
list-style: none;
}
.droppable-photos-container {
border: 2px #ccc dotted;
width:144px;
height: 108px;
float:left;
margin-top: 2px;
padding: 2px;
}
.droppable-img-content {
float: left; padding: 5px;
}
#accordionDemo, select {
position: relative;
font-size: 12px;
}
.ui-accordion-data {
padding: 10px;
}

View File

@ -1,21 +0,0 @@
<html>
<head>
<title>Only core files for easy debug</title>
<link rel="stylesheet" href="../../../themes/ui.datepicker.css" type="text/css" media="screen" title="default" charset="utf-8">
</head>
<body>
<input type="text" name="testing" value="click" id="testing" />
<!-- Include jQuery -->
<script src="../../../jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script>
<!-- Include UI Datepicker -->
<script src="../../../ui/ui.datepicker.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
$('#testing').datepicker();
});
</script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

View File

@ -1,64 +0,0 @@
/* http://keith-wood.name/localisation.html
Localisation assistance for jQuery v1.0.2.
Written by Keith Wood (kbwood@iprimus.com.au) June 2007.
Under the Creative Commons Licence http://creativecommons.org/licenses/by/3.0/
Share or Remix it but please Attribute the author. */
(function($) { // Hide scope, no $ conflict
/* Load applicable localisation package(s) for one or more jQuery packages.
Assumes that the localisations are named <base>-<lang>.js
and loads them in order from least to most specific.
For example, $.localise('jquery-calendar');
with the browser set to 'en-US' would attempt to load
jquery-calendar-en.js and jquery-calendar-en-US.js.
Also accepts an array of package names to process.
Optionally specify whether or not to include the base file,
the desired language, and/or the timeout period, e.g.
$.localise(['jquery-calendar', 'jquery-timeentry'],
{loadBase: true; language: 'en-AU', timeout: 300}); */
$.localise = function(pkg, settings) {
var saveSettings = {async: $.ajaxSettings.async, timeout: $.ajaxSettings.timeout};
$.ajaxSetup({async: false, timeout: (settings && settings.timeout ? settings.timeout : 500)});
var localiseOne = function(pkg, lang) {
if (settings && settings.loadBase) {
$.getScript(pkg + '.js');
}
if (lang.length >= 2) {
$.getScript(pkg + '-' + lang.substring(0, 2) + '.js');
}
if (lang.length >= 5) {
$.getScript(pkg + '-' + lang.substring(0, 5) + '.js');
}
};
var lang = normaliseLang(settings && settings.language ? settings.language : $.defaultLanguage);
if (isArray(pkg)) {
for (i = 0; i < pkg.length; i++) {
localiseOne(pkg[i], lang);
}
}
else {
localiseOne(pkg, lang);
}
$.ajaxSetup(saveSettings);
};
/* Retrieve the default language set for the browser. */
$.defaultLanguage = normaliseLang(navigator.language ? navigator.language /* Mozilla */ :
navigator.userLanguage /* IE */);
/* Ensure language code is in the format aa-AA. */
function normaliseLang(lang) {
lang = lang.replace(/_/, '-').toLowerCase();
if (lang.length > 3) {
lang = lang.substring(0, 3) + lang.substring(3).toUpperCase();
}
return lang;
}
/* Determine whether an object is an array. */
function isArray(a) {
return (a.constructor && a.constructor.toString().match(/\Array\(\)/));
}
})(jQuery);

View File

@ -1,158 +0,0 @@
/* Alternate UI date picker styles */
#ui-datepicker-div, .ui-datepicker-inline {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
padding: 0;
margin: 0;
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
color: #008;
width: 220px;
}
#ui-datepicker-div {
display: none;
border: 1px solid #008;
z-index: 9999; /*must have*/
}
.ui-datepicker-inline {
float: left;
display: block;
border: 0;
}
.ui-datepicker-dialog {
padding: 5px !important;
border: 4px ridge #88c !important;
}
button.ui-datepicker-trigger {
width: 25px;
}
img.ui-datepicker-trigger {
margin: 2px;
vertical-align: middle;
}
.ui-datepicker-prompt {
float: left;
padding: 2px;
xbackground: #d8d8d8 url(../img/dark-bg.gif) repeat;
background: transparent;
color: #008;
}
* html .ui-datepicker-prompt {
width: 185px;
}
.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker {
clear: both;
float: left;
width: 100%;
}
.ui-datepicker-control, .ui-datepicker-links {
font-weight: bold;
font-size: 80%;
letter-spacing: 1px;
}
.ui-datepicker-links label { /* disabled links */
padding: 2px 5px;
color: #88c;
}
.ui-datepicker-clear, .ui-datepicker-prev {
float: left;
width: 34%;
}
.ui-datepicker-current {
float: left;
width: 30%;
text-align: center;
}
.ui-datepicker-close, .ui-datepicker-next {
float: right;
width: 34%;
text-align: right;
}
.ui-datepicker-header {
padding: 1px 0 3px;
text-align: center;
font-weight: bold;
height: 1.3em;
}
.ui-datepicker-header select {
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
color: #008;
border: 0px;
font-weight: bold;
}
.ui-datepicker {
background: #f8f8f8 url(../img/normal-bg.gif) repeat;
color: #008;
text-align: center;
font-size: 100%;
}
.ui-datepicker a {
display: block;
width: 100%;
}
.ui-datepicker-titleRow {
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
}
.ui-datepicker-weekEndCell {
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
}
.ui-datepicker-daysCellOver {
background: #3c75c4 url(../img/active-bg.gif) repeat;
}
.ui-datepicker-unselectable {
color: #88c;
}
.ui-datepicker-today {
font-weight: bold;
}
.ui-datepicker-currentDay {
background: #3c75c4 url(../img/active-bg.gif) repeat;
}
/* ________ CALENDAR LINKS _______
** Reset link properties and then override them with !important */
#ui-datepicker-div a, .ui-datepicker-inline a {
cursor: pointer;
margin: 0;
padding: 0;
background: none;
color: #000;
}
.ui-datepicker-control a, .ui-datepicker-links a {
padding: 2px 5px !important;
}
.ui-datepicker-control a:hover {
background: #9dbae1 url(../img/hover-bg.gif) repeat !important;
}
.ui-datepicker-links a:hover, .ui-datepicker-titleRow a:hover {
background: #9dbae1 url(../img/hover-bg.gif) repeat !important;
}
/* ___________ MULTIPLE MONTHS _________*/
.ui-datepicker-multi .datepicker {
border: 1px solid #008;
}
.ui-datepicker-oneMonth {
float: left;
width: 220px;
}
.ui-datepicker-newRow {
clear: left;
}
/* ___________ IE6 IFRAME FIX ________ */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}

View File

@ -1,53 +0,0 @@
#tab_menu1 { margin:0.5em 0 0 0; padding:0; font-size:1em; }
.tab_group1 { clear:left; padding-top:0; display:none; }
.demoLabel { float: left; width: 18em; }
.ar_day { color: white !important; background: #eee url(img/ar.gif) no-repeat center !important; }
.au_day { color: blue !important; background: #eee url(img/au.gif) no-repeat center !important; }
.br_day { color: green !important; background: #eee url(img/br.gif) no-repeat center !important; }
.cn_day { color: red !important; background: #eee url(img/cn.gif) no-repeat center !important; }
.id_day { color: white !important; background: #eee url(img/id.gif) no-repeat center !important; }
.ie_day { color: white !important; background: #eee url(img/ie.gif) no-repeat center !important; }
.ke_day { color: red !important; background: #eee url(img/ke.gif) no-repeat center !important; }
.lb_day { color: white !important; background: #eee url(img/lb.gif) no-repeat center !important; }
.nz_day { color: blue !important; background: #eee url(img/nz.gif) no-repeat center !important; }
.se_day { color: blue !important; background: #eee url(img/se.gif) no-repeat center !important; }
.us_day { color: white !important; background: #eee url(img/us.gif) no-repeat center !important; }
.za_day { color: green !important; background: #eee url(img/za.gif) no-repeat center !important; }
code { font-size: 13px; font-family: Verdana, Arial, Helvetica, sans-serif; }
pre { clear: both; padding-left: 2em; background: #eee; }
#embedButton { width: 7em; }
#embedButton + img { position: relative; left: -21px; top: -1px; }
.tabs {
list-style: none;
}
.tabs li {
float: left;
}
.tabs li a {
display:block;
padding: 0.4em .75em;
margin: 0;
border-left: 1px solid #fff;
border-right: 1px solid #ddd;
cursor: pointer;
cursor: hand;
text-decoration: none;
color: #eee;
border-top: 1px solid #F9F9F9;
background: #78A5CE;
}
.tabs li a:hover, .tabs li a.over {
border-top: 1px solid #000;
background: #333;
}
.tab_group1 h3 {
font-weight: bold;
margin-top:15px;
border-bottom: 1px solid #ddd;
}
.nextFeature {
margin-top: 15px;
}
ol li {
margin-top: 1em;
}

View File

@ -1,81 +0,0 @@
// Initialise the date picker demonstrations
$(document).ready(function () {
// initialize tab interface
tabs.init();
// reset defaults to English
$.datepicker.setDefaults($.datepicker.regional['']);
// replace script tags with HTML code
$(".demojs").each(function () {
$(this).before( '<pre><code class="javascript">' +
$(this).html().replace(/</g, '&lt;') + "</code></pre>" );
eval( $(this).html() );
});
// Localization
if ($.browser.safari)
$('.languageSelect,.l10nDatepicker,#frFullFormat').attr({ disabled: 'disabled' });
else
$('.languageSelect').change(localise);
// Stylesheets
$('#altStyle').datepicker({buttonImage: 'demo/img/calendar2.gif',
prevText: '<img src="demo/img/prev.gif" style="vertical-align: middle;"/> Prev',
nextText: 'Next <img src="demo/img/next.gif" style="vertical-align: middle;"/>'});
$('#button3').click(function() {
$(this).datepicker('dialog', $('#altDialog').val(),
setAltDateFromDialog, {prompt: 'Choose a date', speed: '',
prevText: '<img src="demo/img/prev.gif" style="vertical-align: middle;"/> Prev',
nextText: 'Next <img src="demo/img/next.gif" style="vertical-align: middle;"/>'});
});
});
// Load and apply a localisation package for the date picker
function localise() {
var input = $('input', this.parentNode.parentNode);
var date = $(input).datepicker('getDate');
var language = $(this).val();
$.localise('../../../source/i18n/ui.datepicker', {language: language});
$(input).datepicker('change', $.datepicker.regional[language]);
$.datepicker.setDefaults($.datepicker.regional['']); // Reset for general usage
if (date) {
$(input).datepicker('setDate', date);
input.val($.datepicker.formatDate(
$.datepicker.regional[language].dateFormat, date));
}
}
// Demonstrate a callback from inline configuration
function showDay(input) {
var date = $(input).datepicker('getDate');
$('#inlineDay').html(date ? $.datepicker.formatDate('DD', date) : 'blank');
}
// Display a date selected in a "dialog"
function setAltDateFromDialog(date) {
$('#altDialog').val(date);
}
// Custom Tabs written by Marc Grabanski
var tabs =
{
init : function ()
{
// Setup tabs
$("div[@class^=tab_group]").hide();
$("div[@class^=tab_group]:first").show().id;
$("ul[@id^=tab_menu] a:eq(0)").addClass('over');
// Slide visible up and clicked one down
$("ul[@id^=tab_menu] a").each(function(i){
$(this).click(function () {
$("ul[@id^=tab_menu] a.over").removeClass('over');
$(this).addClass('over');
$("div[@class^=tab_group]:visible").hide();
$( $(this).attr("href") ).fadeIn();
tabs.stylesheet = $(this).attr("href") == "#styles" ? 'alt' : 'default';
$('link').each(function() {
this.disabled = (this.title != '' && this.title != tabs.stylesheet);
});
return false;
});
});
}
}

View File

@ -1,887 +0,0 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>jQuery UI Datepicker</title>
<!-- Include UI Datepicker CSS -->
<link rel="stylesheet" href="../../../themes/ui.datepicker.css" type="text/css" media="screen" title="default" charset="utf-8">
<!-- Include Demo Stylesheets -->
<link rel="stylesheet" type="text/css" href="demo/ui.datepicker.alt.css" title="alt" id="alt" disabled="disabled"/>
<link rel="stylesheet" type="text/css" href="demo/ui.datepicker.demo.css" />
</head>
<body>
<div id="wrap">
<div id="content">
<ul id="tab_menu1" class="tabs">
<li><a href="#default">Defaults</a></li>
<li><a href="#invoke">Invocation</a></li>
<li><a href="#keys">Keystrokes</a></li>
<li><a href="#restrict">Restricting</a></li>
<li><a href="#formats">Formats</a></li>
<li><a href="#custom">Customize</a></li>
<li><a href="#l10n">Localisation</a></li>
<li style="clear: left;"><a href="#range">Date range</a></li>
<li><a href="#misc1">Misc. 1</a></li>
<li><a href="#misc2">Misc. 2</a></li>
<li><a href="#change">Change Settings</a></li>
<li><a href="#inline">Inline</a></li>
<li><a href="#styles">Stylesheets</a></li>
<li><a href="#compat">Compatibility</a></li>
</ul>
<div style="clear:left"></div>
<div id="default" class="tab_group1 container" style="display:block">
<h3>Defaults</h3>
<p>A date picker can easily be added to an input field with default settings.</p>
<p><span class="demoLabel">Default date picker:</span>
<input type="text" size="30" value="click to show datepicker" id="defaultFocus"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#defaultFocus').datepicker();
</script>
<p><span class="demoLabel">IE select issue:</span>
<select><option>Show how the date picker covers a select in IE</option></select></p>
<p>The defaults are:</p>
<ul>
<li>Date picker appears on focus</li>
<li>Text is in English</li>
<li>Date format is mm/dd/yyyy</li>
<li><em>Clear</em>/<em>Close</em> controls show at the top</li>
<li>Month and year are selectable directly</li>
<li>10 years before and after the selected year are shown</li>
<li>Show a single month</li>
<li>Select a single date</li>
<li>Week starts on Sunday</li>
<li>Day names are clickable to change the first day of the week</li>
<li>Days in other months are not displayed</li>
<li>No date restrictions</li>
<li>Clicking elsewhere closes the date picker</li>
</ul>
<p>Processed fields are marked with a class of <code>hasDatepicker</code>
and are not re-processed if targetted a second time.</p>
<p>You can override the default settings that apply to all date picker instances.</p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$.datepicker.setDefaults({showOn: 'both', buttonImageOnly: true,
buttonImage: 'demo/img/calendar.gif', buttonText: 'Calendar'});
</script>
</div>
<div id="invoke" class="tab_group1 container">
<h3>Invocation</h3>
<p>The date picker can be invoked in a variety of ways, as shown below.
Also shown is the use of an image only trigger,
and how the controls and buttons appear when disabled.</p>
<p><span class="demoLabel">Datepicker appears on focus:</span>
<input type="text" size="10" id="invokeFocus"/>
<input type="button" id="enableFocus" value="Disable"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#invokeFocus').datepicker({showOn: 'focus'});
</script>
<p><span class="demoLabel">Appears via text button:</span>
<input type="text" size="10" id="invokeButton"/>
<input type="button" id="enableButton" value="Disable"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#invokeButton').datepicker({showOn: 'button', buttonText: '...',
buttonImage: '', buttonImageOnly: false});
</script>
<p style="clear:both"><span class="demoLabel">Appears both ways:</span>
<input type="text" size="10" class="invokeBoth"/>
<input type="button" id="enableBoth" value="Disable"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('.invokeBoth').datepicker({showOn: 'both', buttonImage: 'demo/img/calendar.gif', buttonImageOnly: true});
</script>
<p>You can embed the trigger image within the input area via CSS.</p>
<p style="clear:both"><span class="demoLabel">Embedded button:</span>
<input type="text" size="10" id="embedButton"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#embedButton').datepicker({showOn: 'button', buttonImage: 'demo/img/calendar.gif', buttonImageOnly: true});
// CSS
// #embedButton + img { position: relative; left: -21px; top: -1px; }
</script>
<p>Enable and disable datepicker with 'enable' and 'disable' commands.</p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#enableFocus').toggle(
function () { this.value = 'Enable'; $('#invokeFocus').datepicker('disable'); },
function () { this.value = 'Disable'; $('#invokeFocus').datepicker('enable'); });
$('#enableButton').toggle(
function () { this.value = 'Enable'; $('#invokeButton').datepicker('disable'); },
function () { this.value = 'Disable'; $('#invokeButton').datepicker('enable'); });
$('#enableBoth').toggle(
function () { this.value = 'Enable'; $('.invokeBoth:first').datepicker('disable'); },
function () { this.value = 'Disable'; $('.invokeBoth:first').datepicker('enable'); });
</script>
<p>The date picker can also be triggered externally for a particular input.</p>
<p><span class="demoLabel">External trigger:</span>
<button id="button1">Open date picker</button></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#button1').click(function() {
$('#invokeFocus').datepicker('show');
});
</script>
<p>Or even opened as a "dialog". If the <em>blockUI</em> plugin is available,
it is used to create a modal dialog.</p>
<p><span class="demoLabel">Date picker dialog:</span>
<input type="text" size="10" id="invokeDialog" readonly="readonly"/>
<button id="button2">Open dialog</button></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#button2').click(function() {
$(this).datepicker('dialog', $('#invokeDialog').val(),
setDateFromDialog, {prompt: 'Choose a date', speed: ''});
});
// Display a date selected in a "dialog"
function setDateFromDialog(date) {
$('#invokeDialog').val(date);
}
</script>
</div>
<div id="keys" class="tab_group1 container">
<h3>Keystrokes</h3>
<p>The date picker also responds to keystrokes entered in the input field.</p>
<p><span class="demoLabel">Keyboard driven:</span>
<input type="text" size="10" class="invokeBoth"/></p>
<p>The relevant keystrokes are:</p>
<ul>
<li><span class="demoLabel">page up/down</span>previous/next month</li>
<li><span class="demoLabel">ctrl+page up/down</span>previous/next year</li>
<li><span class="demoLabel">ctrl+home</span>current month or open when closed</li>
<li><span class="demoLabel">ctrl+left/right</span>previous/next day</li>
<li><span class="demoLabel">ctrl+up/down</span>previous/next week</li>
<li><span class="demoLabel">enter</span>accept the selected date</li>
<li><span class="demoLabel">ctrl+end</span>close and erase the date</li>
<li><span class="demoLabel">escape</span>close the date picker without selection</li>
</ul>
</div>
<div id="restrict" class="tab_group1 container">
<h3>Restricting</h3>
<p>You can restrict the functionality of the date picker in various ways.
The first example sets the first day of the week to Monday and prevents it from being
changed, as well as preventing the month and year from being selected directly.</p>
<p><span class="demoLabel">Restricted functionality:</span>
<input type="text" size="10" id="restrictControls"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#restrictControls').datepicker({firstDay: 1, changeFirstDay: false,
changeMonth: false, changeYear: false});
</script>
<p>You can also limit the range of dates selectable within the date picker.
Here it's between 26-Jan-05 and 26-Jan-07.</p>
<p><span class="demoLabel">Limited dates:</span>
<input type="text" size="10" id="restrictDates"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#restrictDates').datepicker({minDate: new Date(2005, 1 - 1, 26),
maxDate: new Date(2007, 1 - 1, 26)});
</script>
<p>Or set a range relative to today by specifying a number
rather than an exact date, in this case in the coming year.</p>
<p><span class="demoLabel">Limited dates (relative):</span>
<input type="text" size="10" id="relativeDates"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#relativeDates').datepicker({minDate: 0, maxDate: 365});
</script>
<p>The relative dates can also be specified as a number and a period -
'd' for days, 'w' for weeks, 'm' for months, or 'y' for years.</p>
<p><span class="demoLabel">Limited dates (extended):</span>
<input type="text" size="10" id="extendedDates"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#extendedDates').datepicker({minDate: '-1d', maxDate: '6y'});
</script>
<p>Note that the range of selectable months and years changes appropriately. Also,
note that the <em>Today</em> link is no longer available as today is not in the range.
By default, the <em>Prev</em> and <em>Next</em> links are disabled if they are not
applicable. You can override this to remove them instead, with the
<code>hideIfNoPrevNext</code> setting.</p>
</div>
<div id="formats" class="tab_group1 container">
<h3>Date Formats</h3>
<p>You can set a variety of date formats for the date picker,
with the default being 'mm/dd/yy'.</p>
<p><span class="demoLabel">Medium format:</span>
<input type="text" size="10" id="mediumFormat"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#mediumFormat').datepicker({dateFormat: 'M d, yy'});
</script>
<p><span class="demoLabel">Long format:</span>
<input type="text" size="20" id="longFormat"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#longFormat').datepicker({dateFormat: 'MM d, yy'});
</script>
<p><span class="demoLabel">Full format:</span>
<input type="text" size="30" id="fullFormat"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#fullFormat').datepicker({dateFormat: 'DD, MM d, yy'});
</script>
<p>Display dates without the century. The century is then determined based on the
<code>shortYearCutoff</code> setting, which defaults to 10 years in the future ('+10').
Year values less than or equal to this cutoff are interpreted as being in the current
century, while those greater than the cutoff are taken to be in the previous century.</p>
<p><span class="demoLabel">No century:</span>
<input type="text" size="10" id="noCentury"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#noCentury').datepicker({dateFormat: 'dd/mm/y'});
</script>
<p><span class="demoLabel">ISO date format:</span>
<input type="text" size="10" id="isoFormat"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#isoFormat').datepicker({dateFormat: 'yy-mm-dd'});
</script>
<p><span class="demoLabel">French full format:</span>
<input type="text" size="30" id="frFullFormat"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#frFullFormat').datepicker($.datepicker.regional['fr']);
$('#frFullFormat').datepicker('change', {dateFormat: 'DD, MM d, yy'});
</script>
<p>The formatting codes are:</p>
<ul>
<li><span class="demoLabel">d</span>day of month (no leading zero)</li>
<li><span class="demoLabel">dd</span>day of month (two digit)</li>
<li><span class="demoLabel">D</span>day name short</li>
<li><span class="demoLabel">DD</span>day name long</li>
<li><span class="demoLabel">m</span>month of year (no leading zero)</li>
<li><span class="demoLabel">mm</span>month of year (two digit)</li>
<li><span class="demoLabel">M</span>month name short</li>
<li><span class="demoLabel">MM</span>month name long</li>
<li><span class="demoLabel">y</span>year (two digit)</li>
<li><span class="demoLabel">yy</span>year (four digit)</li>
<li><span class="demoLabel">'...'</span>literal text</li>
<li><span class="demoLabel">''</span>single quote</li>
</ul>
</div>
<div id="custom" class="tab_group1 container">
<h3>Customize</h3>
<p>You can customize the selectability and/or appearance of individual days
by setting a callback function that accepts a date and returns an array
with the first entry being true/false for selectability and the second
entry being a CSS class to apply (or '' for none). One appropriate
function is built-in that prevents the selection of days on weekends.</p>
<p><span class="demoLabel">No weekends:</span>
<input type="text" size="10" id="noWeekends"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#noWeekends').datepicker({beforeShowDay: $.datepicker.noWeekends});
</script>
<p>Or you can provide your own function. The one below highlights and
prevents selection of a set of national days.</p>
<p><span class="demoLabel">National days:</span>
<input type="text" size="10" id="nationalDays"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#nationalDays').datepicker({beforeShowDay: nationalDays});
// Highlight certain national days on the calendar
var natDays = [[1, 26, 'au'], [2, 6, 'nz'], [3, 17, 'ie'], [4, 27, 'za'], [5, 25, 'ar'], [6, 6, 'se'],
[7, 4, 'us'], [8, 17, 'id'], [9, 7, 'br'], [10, 1, 'cn'], [11, 22, 'lb'], [12, 12, 'ke']];
function nationalDays(date) {
for (i = 0; i < natDays.length; i++) {
if (date.getMonth() == natDays[i][0] - 1 && date.getDate() == natDays[i][1]) {
return [false, natDays[i][2] + '_day'];
}
}
return [true, ''];
}
</script>
<p>With CSS like the following:</p>
<pre><code>.au_day { color: blue !important; background: #eee url(au.gif) no-repeat center !important; }</code></pre>
</div>
<div id="l10n" class="tab_group1 container">
<h3>Localisation</h3>
<p>You can localise the date picker for other languages and regional differences.
The date picker defaults to English with a date format of MM/DD/YYYY,
but you can easily translate the text into another language and date format.</p>
<p><span class="demoLabel">
<select class="languageSelect">
<option value="zh-CN">&#31616;&#20307;&#20013;&#25991; (Chinese Simplified)</option>
<option value="zh-TW">&#31777;&#39636;&#20013;&#25991; (Chinese Traditional)</option>
<option value="bg">&#1073;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080; &#1077;&#1079;&#1080;&#1082; (Bulgarian)</option>
<option value="ca">Catal&agrave; (Catalan)</option>
<option value="cs">&#268;e&#353;tina (Czech)</option>
<option value="da">Dansk (Danish)</option>
<option value="de">Deutsch (German)</option>
<option value="es">Espa&ntilde;ol (Spanish)</option>
<option value="fr" selected="selected">Fran&ccedil;ais (French)</option>
<option value="ko">&#54620;&#44397;&#50612; (Korean)</option>
<option value="is">&Iacute;slenska (Icelandic)</option>
<option value="it">Italiano (Italian)</option>
<option value="hu">Magyar (Hungarian)</option>
<option value="nl">Nederlands (Dutch)</option>
<option value="ja">&#26085;&#26412;&#35486; (Japanese)</option>
<option value="lt">lietuvi&#371; kalba (Lithuanian)</option>
<option value="no">Norsk (Norwegian)</option>
<option value="th">Phasa thai (Thai)</option>
<option value="pl">Polski (Polish)</option>
<option value="pt-BR">Portugu&ecirc;s (Portuguese)</option>
<option value="ro">Rom&acirc;n&#259; (Romanian)</option>
<option value="ru">&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; (Russian)</option>
<option value="sk">Sloven&#269;ina (Slovak)</option>
<option value="fi">suomi (Finnish)</option>
<option value="sv">Svenska (Swedish)</option>
<option value="tr">T&uuml;rk&ccedil;e (Turkish)</option>
</select>:</span>
<input type="text" size="10" id="l10nDatepicker"/></p>
<p>The presentation is slightly different for right-to-left languages.</p>
<p><span class="demoLabel">
<select class="languageSelect">
<option value="he" selected="selected">&#1506;&#1489;&#1512;&#1497;&#1514; (Hebrew)</option>
</select>:</span>
<input type="text" size="10" id="rtlDatepicker"/></p>
<p>You need to load the appropriate language package, which
adds a language set ($.datepicker.regional[langCode]) and
automatically sets this language as the default for all date pickers.</p>
<pre><code class="html">&lt;script type="text/javascript" src="ui.datepicker-fr.js">&lt;/script></code></pre>
<p>Thereafter, if desired, you can restore the original language settings.</p>
<pre><code class="javascript">$.datepicker.setDefaults($.datepicker.regional['']);</code></pre>
<p>And then configure the language per date picker instance.</p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#l10nDatepicker').datepicker($.extend({showStatus: true}, $.datepicker.regional['fr']));
$('#rtlDatepicker').datepicker($.extend({showStatus: true}, $.datepicker.regional['he']));
</script>
<p><strong>Localisation packages:</strong></p>
<p>Localisation packages can be found below under <a href="#documentation">Settings and Documentation</a>.</p>
</div>
<div id="range" class="tab_group1 container">
<h3>Date Range</h3>
<p>Use a custom field settings function to create a date range control:
two date fields, each restricting the other. The function takes an
input field as an argument and returns a settings object (anonymous).</p>
<p><span class="demoLabel">Date range:</span>
<input type="text" size="10" class="dateRange" id="dFrom"/> to
<input type="text" size="10" class="dateRange" id="dTo"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('.dateRange').datepicker({beforeShow: customRange});
// Customize two date pickers to work as a date range
function customRange(input) {
return {minDate: (input.id == 'dTo' ? $('#dFrom').datepicker('getDate') : null),
maxDate: (input.id == 'dFrom' ? $('#dTo').datepicker('getDate') : null)};
}
</script>
<p>Select a date range on one date picker, first click is the start date and second click is the end date.
The last example show six months in two rows of three months
with <i>Previous</i> and <i>Next</i> moving three months at a time.</p>
<p><span class="demoLabel">Date range:</span>
<input type="text" size="25" id="rangeSelect"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#rangeSelect').datepicker({rangeSelect: true});
</script>
<p><span class="demoLabel">Two months with range select:</span>
<input type="text" size="25" id="rangeSelect2Months"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#rangeSelect2Months').datepicker({rangeSelect: true, numberOfMonths: 2});
</script>
<p><span class="demoLabel">Six months with range select:</span>
<input type="text" size="25" id="rangeSelect6Months"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#rangeSelect6Months').datepicker({rangeSelect: true, numberOfMonths: [2, 3],
stepMonths: 3, prevText: '&lt;&lt; Previous Months', nextText: 'Next Months &gt;&gt;'});
</script>
</div>
<div id="misc1" class="tab_group1 container">
<h3>Miscellaneous 1</h3>
<p>Set the date shown when first opening the date picker. The default is today.</p>
<p><span class="demoLabel">Open at 01-Jan-2007:</span>
<input type="text" size="10" id="openDateJan01"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#openDateJan01').datepicker({defaultDate: new Date(2007, 1 - 1, 1)});
</script>
<p><span class="demoLabel">Open at 7 days from today:</span>
<input type="text" size="10" id="openDatePlus7"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#openDatePlus7').datepicker({defaultDate: +7});
</script>
<p>Or specify a period from today - 'd' for days,
'w' for weeks, 'm' for months, or 'y' for years.</span>
<p><span class="demoLabel">Open at 2 weeks from today:</span>
<input type="text" size="10" id="openDate2Weeks"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#openDate2Weeks').datepicker({defaultDate: '2w'});
</script>
<p>Show the weeks of the year. Defaults to the ISO 8601 definition (weeks start
on Mondays and the first week of the year contains January 4). Change the
week calculation by setting <code>calculateWeek</code> to a function that
takes a date as a parameter and returns the number of the week.</p>
<p><span class="demoLabel">Show week of the year:</span>
<input type="text" size="10" id="showWeeks"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#showWeeks').datepicker({showWeeks: true, firstDay: 1, changeFirstDay: false, showOtherMonths: true});
</script>
<p>Additional settings let you move the <em>Clear</em>/<em>Close</em> controls
to the bottom, hide the <em>Clear</em> control to make the date mandatory,
display the days in other months (non-selectable),
and show a status bar (with a custom display for today).
Callback functions are also added to operate when a date
is selected and when the datepicker is closed.
If no <code>onSelect</code> callback is specified, the
<code>onchange</code> event of the input field is triggered.</p>
<p><span class="demoLabel">Additional settings:</span>
<input type="text" size="10" id="addSettings"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#addSettings').datepicker({
closeAtTop: false,
mandatory: true,
showOtherMonths: true,
showStatus: true,
statusForDate: highlightToday,
onSelect: alertDate, // invoke alertDate function
onClose: function(date) { alert('Closed with ' + date); }
});
// Demonstrate the callback on select
function alertDate(date) {
alert('The date is ' + date);
}
// Demonstrate the callback for date status
function highlightToday(date, inst) {
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
return $.datepicker.dateStatus(date, inst) +
(today.getTime() == date.getTime() ? ' (today)' : '');
}
</script>
</div>
<div id="misc2" class="tab_group1 container">
<h3>Miscellaneous 2</h3>
<p>Hide the datepicker on demand (press <em>alt-h</em> here) or
remove the datepicker altogether if you've finished with it.</p>
<p><span class="demoLabel">Remove popup datepicker:</span>
<input type="text" size="10" id="hideDatepicker" class="removeDatepicker"/>&nbsp;
<button id="removeButton">Remove</button></p>
<p><span class="demoLabel">Remove inline datepicker:</span>
<span class="removeDatepicker"></span></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
var opts = {beforeShowDay: $.datepicker.noWeekends};
$('.removeDatepicker').datepicker(opts);
$('#hideDatepicker').keypress(function(e) {
if (e.altKey && (e.charCode || e.keyCode) == 104) {
$('#hideDatepicker').datepicker('hide');
}
});
$('#removeButton').toggle(function() {
$(this).text('Re-attach');
$('.removeDatepicker').datepicker('destroy');
},
function() {
$(this).text('Remove');
$('.removeDatepicker').datepicker(opts);
}
);
</script>
<p><strong>(Advanced Technique)</strong><br />Connect the date picker to linked drop-downs. You still need an input field,
but it is hidden following the drop-downs.</p>
<p><span class="demoLabel">Linked drop-downs:</span>
<select id="selectMonth"><option value="01">Jan</option><option value="02">Feb</option>
<option value="03">Mar</option><option value="04">Apr</option>
<option value="05">May</option><option value="06">Jun</option>
<option value="07">Jul</option><option value="08">Aug</option>
<option value="09">Sep</option><option value="10">Oct</option>
<option value="11">Nov</option><option value="12">Dec</option></select>
<select id="selectDay"><option value="01">1</option><option value="02">2</option>
<option value="03">3</option><option value="04">4</option>
<option value="05">5</option><option value="06">6</option>
<option value="07">7</option><option value="08">8</option>
<option value="09">9</option><option value="10">10</option>
<option value="11">11</option><option value="12">12</option>
<option value="13">13</option><option value="14">14</option>
<option value="15">15</option><option value="16">16</option>
<option value="17">17</option><option value="18">18</option>
<option value="19">19</option><option value="20">20</option>
<option value="21">21</option><option value="22">22</option>
<option value="23">23</option><option value="24">24</option>
<option value="25">25</option><option value="26">26</option>
<option value="27">27</option><option value="28">28</option>
<option value="29">29</option><option value="30">30</option>
<option value="31">31</option></select>
<select id="selectYear"><option value="2001">2001</option><option value="2002">2002</option>
<option value="2003">2003</option><option value="2004">2004</option>
<option value="2005">2005</option><option value="2006">2006</option>
<option value="2007">2007</option><option value="2008">2008</option>
<option value="2009">2009</option><option value="2010">2010</option></select>
<input type="hidden" size="10" id="linkedDates" disabled="disabled"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#linkedDates').datepicker({
minDate: new Date(2001, 1 - 1, 1),
maxDate: new Date(2010, 12 - 1, 31),
beforeShow: readLinked,
onSelect: updateLinked
});
// Prepare to show a date picker linked to three select controls
function readLinked() {
$('#linkedDates').val(
$('#selectMonth').val() + '/' +
$('#selectDay').val() + '/' +
$('#selectYear').val()
);
return {};
}
// Update three select controls to match a date picker selection
function updateLinked(date) {
$('#selectMonth').val(date.substring(0, 2));
$('#selectDay').val(date.substring(3, 5));
$('#selectYear').val(date.substring(6, 10));
}
$('#selectMonth, #selectYear').change(checkLinkedDays);
// Prevent selection of invalid dates through the select controls
function checkLinkedDays() {
var daysInMonth = 32 - new Date($('#selectYear').val(),
$('#selectMonth').val() - 1, 32).getDate();
$('#selectDay option').attr('disabled', '');
$('#selectDay option:gt(' + (daysInMonth - 1) +')').attr('disabled', 'disabled');
if ($('#selectDay').val() > daysInMonth) {
$('#selectDay').val(daysInMonth);
}
}
</script>
</div>
<div id="change" class="tab_group1 container">
<h3>Changing Settings</h3>
<p>If necessary, the datepicker settings for an input (or set of inputs)
can be changed on the fly. As an example, here we change the
animation and speed at which the datepicker appears.</p>
<p><span class="demoLabel">Display animation and speed:</span>
<select id="animSelector">
<option value="show">show</option>
<option value="fadeIn">fade in</option>
<option value="slideDown">slide down</option>
</select>
<select id="speedSelector">
<option value="">immediate</option>
<option value="slow">slow</option>
<option value="medium" selected="selected">medium</option>
<option value="fast">fast</option>
</select>
</p>
<p><span class="demoLabel">Change datepicker:</span>
<input type="text" size="10" id="changeDP"/></p>
<p>When the option in the select changes, the following function is called:</p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#changeDP').datepicker();
// Change the datepicker to selected speed.
$('#animSelector,#speedSelector').change(function() {
$('#changeDP').datepicker('change', {showAnim: $('#animSelector').val(),
speed: $('#speedSelector').val()});
});
</script>
<p>Date pickers can also be configured inline.
Add attributes to the input control with the namespace "date:"
corresponding to the date picker properties.
The attribute values are evaluated as JavaScript.</p>
<p><span class="demoLabel">Inline configuration 1:</span>
<input type="text" size="10" class="inlineConfig" onchange="showDay(this);"
date:closeAtTop="false" date:firstDay="1" date:appendText="which is a"/>
<span id="inlineDay">blank</span></p>
<p><span class="demoLabel">Inline configuration 2:</span>
<input type="text" size="10" class="inlineConfig"
date:minDate="new Date(2007, 1 - 1, 1)" date:maxDate="new Date(2007, 12 - 1, 31)"/></p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
/* HTML Markup for inline configuration
Example #1:
<input type="text" size="10" class="inlineConfig" onchange="showDay(this);"
date:closeAtTop="false" date:firstDay="1" date:appendText="which is a" />
Example #2:
<input type="text" size="10" class="inlineConfig"
date:minDate="new Date(2007, 1 - 1, 1)" date:maxDate="new Date(2007, 12 - 1, 31)"/>
*/
// Invoke inline configured datepickers
$('.inlineConfig').datepicker();
</script>
</div>
<div id="inline" class="tab_group1 container">
<h3>Inline</h3>
<p>The date picker can be used inline rather than as a popup.
Use inline mode by attaching the datepicker to a span or div element.</p>
<span id="inlineDemo"></span>
<div style="clear:both;height:1em"></div>
<script type="text/jsdemo" charset="utf-8" class="demojs">
// HTML <span id="inlineDemo"></span>
$('#inlineDemo').datepicker({
onSelect: function(date) {
alert(date);
}
});
</script>
<p>Show a number of months at once and set the range directly.</p>
<p>Inline range with two months:</p>
<div style="clear: both">
<span id="rangeInline"></span>
</div>
<p style="clear: both; padding-top: 0.5em;">
<span>Selected range is:</span>&nbsp;&nbsp;
<input type="text" size="25" id="inlineRange" readonly="readonly"/>
</p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
$('#rangeInline').datepicker({rangeSelect: true, rangeSeparator: ' to ',
numberOfMonths: 2, onSelect: updateInlineRange});
$('#rangeInline').find('div:first').width(370); // Unfortunately not automatic
// Display the date range from a multi-month inline date picker
function updateInlineRange(dateStr) {
var dates = $('#rangeInline').datepicker('getDate');
var dateFormat = $.datepicker.regional[''].dateFormat;
$('#inlineRange').val(dateStr ? dateStr :
$.datepicker.formatDate(dateFormat, dates[0]) + ' to ' +
$.datepicker.formatDate(dateFormat, dates[1]));
}
</script>
<p><strong>(Advanced Technique)</strong><br />
Set initial value of inline date range to one week before and after today's date.
Set the text field to current selected date.</p>
<p>
<button type="button" id="setInlineRange">Set Inline Range to +and- one week</button>
</p>
<script type="text/jsdemo" charset="utf-8" class="demojs">
var nextWeek = new Date();
nextWeek.setDate(nextWeek.getDate() + 7);
var lastWeek = new Date();
lastWeek.setDate(lastWeek.getDate() - 7);
$('#setInlineRange').click(function() {
// Set Inline Date Range Selection
$('#rangeInline').datepicker('setDate', lastWeek, nextWeek);
// Update text field with current date selections
var dates = $('#rangeInline').datepicker('getDate');
var dateFormat = $.datepicker.regional[''].dateFormat;
$('#inlineRange').val($.datepicker.formatDate(dateFormat, dates[0]) + ' to ' +
$.datepicker.formatDate(dateFormat, dates[1]));
});
</script>
</div>
<div id="styles" class="tab_group1 container">
<h3>Stylesheets</h3>
<p>The date picker can be formatted through the use of a stylesheet.
The default stylesheet is used in the rest of this demo
with an alternate one used here.</p>
<p><span class="demoLabel">Alternate style:</span>
<input type="text" size="10" id="altStyle"/></p>
<p><span class="demoLabel">In a dialog:</span>
<input type="text" size="10" id="altDialog" readonly="readonly"/>
<button id="button3">Open dialog</button></p>
<p>The basic HTML structure of the date picker is shown below:</p>
<pre><code class="html">&lt;div id="datepicker_div" class="datepicker_multi">
&lt;div class="datepicker_control">
&lt;div class="datepicker_clear">&lt;a>Clear&lt;/a>&lt;/div>
&lt;div class="datepicker_close">&lt;a>Close&lt;/a>&lt;/div>
&lt;/div>
&lt;div class="datepicker_links">
&lt;div class="datepicker_prev">&lt;a>&amp;lt;Prev&lt;/a>&lt;/div>
&lt;div class="datepicker_current">&lt;a>Today&lt;/a>&lt;/div>
&lt;div class="datepicker_next">&lt;a>Next&amp;gt;&lt;/a>&lt;/div>
&lt;/div>
&lt;div class="datepicker_oneMonth datepicker_newRow">
&lt;div class="datepicker_header">
&lt;select class="datepicker_newMonth">&lt;/select>
&lt;select class="datepicker_newYear">&lt;/select>
&lt;/div>
&lt;table class="datepicker" cellpadding="0" cellspacing="0">
&lt;thead>
&lt;tr class="datepicker_titleRow">
&lt;td>&lt;a>Su&lt;/a>&lt;/td>&lt;td>&lt;a>Mo&lt;/a>&lt;/td>...
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr class="datepicker_daysRow">
&lt;td class="datepicker_daysCell datepicker_weekEndCell
datepicker_otherMonth datepicker_unselectable">31&lt;/td>
&lt;td class="datepicker_daysCell">&lt;a>1&lt;/a>&lt;/td>
&lt;td class="datepicker_daysCell datepicker_daysCellOver">&lt;a>2&lt;/a>&lt;/td>
&lt;td class="datepicker_daysCell datepicker_daysCellOver datepicker_currentDay">&lt;a>3&lt;/a>&lt;/td>
&lt;td class="datepicker_daysCell datepicker_today">&lt;a>4&lt;/a>&lt;/td>
...
&lt;/tr>
...
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;div class="datepicker_oneMonth">
...
&lt;/div>
&lt;div style="clear: both;">&lt;/div>
&lt;/div></code></pre>
</div>
<div id="compat" class="tab_group1 container">
<h3>Compatibility</h3>
<h4>v3.3 to v3.4</h4>
<p>The jQuery UI interfaces changed again, so here's another compatibility module.</p>
<p>Users of v3.3 of the datepicker should use the following
header code to work with their existing implementation:</p>
<pre><code class="html">&lt;link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/&gt;
&lt;script type="text/javascript" src="<b>ui.datepicker.js</b>"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<b>ui.datepicker.compatibility-3.3.js</b>"&gt;&lt;/script&gt;</code></pre>
<p>Download the <a href="compatibility/ui.datepicker.compatibility-3.3.js" target="_blank">ui.datepicker.compatibility-3.3.js</a> module.</p>
<p>To migrate fully, the following steps need to be taken:</p>
<ul>
<li>Replace references to the <code>$(selector).attachDatepicker(...)</code>
function with <code>$(selector).datepicker(...)</code>.</li>
<li>Replace references to the <code>$(selector).removeDatepicker()</code>
function with <code>$(selector).datepicker('destroy')</code>.</li>
<li>Replace references to the <code>$(selector).datepicker.changDatepicker(...)</code>
function with <code>$(selector).datepicker('change', ...)</code>.</li>
<li>Replace references to the <code>$(selector).datepicker.enableDatepicker()</code>
function with <code>$(selector).datepicker('enable')</code>.</li>
<li>Replace references to the <code>$(selector).disableDatepicker()</code>
function with <code>$(selector).datepicker('disable')</code>.</li>
<li>Replace references to the <code>$(selector).isDisabledDatepicker()</code>
function with <code>$(selector).datepicker('isDisabled')</code>.</li>
<li>Replace references to the <code>$(selector).showDatepicker()</code>
function with <code>$(selector).datepicker('show')</code>.</li>
<li>Replace references to the <code>$.datepicker.hideDatepicker()</code>
function with <code>$(selector).datepicker('hide')</code>.</li>
<li>Replace references to the <code>$(selector).getDatepickerDate()</code>
function with <code>$(selector).datepicker('getDate')</code>.</li>
<li>Replace references to the <code>$(selector).setDatepickerDate(...)</code>
function with <code>$(selector).datepicker('setDate', ...)</code>.</li>
</ul>
<p>For example, this old style code:</p>
<pre><code class="javascript">$('inputs').<b>attachDatepicker</b>(...);
$('inputs').<b>changeDatepicker</b>(...);</code></pre>
<p>becomes:</p>
<pre><code class="javascript">$('inputs').<b>datepicker</b>(...);
$('inputs').<b>datepicker('change',</b> ...);</code></pre>
<h4>v3.2 to v3.4</h4>
<p>To align the datepicker more closely with other jQuery UI components,
further changes were made in v3.3, resulting in another compatibility module.</p>
<p>Users of v3.2 of the datepicker should use the following
header code to work with their existing implementation:</p>
<pre><code class="html">&lt;link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/&gt;
&lt;script type="text/javascript" src="<b>ui.datepicker.js</b>"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<b>ui.datepicker.compatibility-3.2.js</b>"&gt;&lt;/script&gt;</code></pre>
<p>Download the <a href="compatibility/ui.datepicker.compatibility-3.2.js" target="_blank">ui.datepicker.compatibility-3.2.js</a> module.</p>
<p>To migrate fully, the following steps need to be taken:</p>
<ul>
<li>Replace references to the <code>$.datepicker.reconfigureFor(selector, ...)</code>
function with <code>$(selector).datepicker('change', ...)</code>.</li>
<li>Replace references to the <code>$.datepicker.enableFor(selector)</code>
function with <code>$(selector).datepicker('enable')</code>.</li>
<li>Replace references to the <code>$.datepicker.disableFor(selector)</code>
function with <code>$(selector).datepicker('disable')</code>.</li>
<li>Replace references to the <code>$.datepicker.isDisabled(selector)</code>
function with <code>$(selector).datepicker('isDisabled')</code>.</li>
<li>Replace references to the <code>$.datepicker.showFor(selector)</code>
function with <code>$(selector).datepicker('show')</code>.</li>
<li>Replace references to the <code>$.datepicker.getDateFor(selector)</code>
function with <code>$(selector).datepicker('getDate')</code>.</li>
<li>Replace references to the <code>$.datepicker.setDateFor(selector, ...)</code>
function with <code>$(selector).datepicker('setDate', ...)</code>.</li>
</ul>
<p>For example, this old style code:</p>
<pre><code class="javascript">$.<b>datepicker.reconfigureFor</b>('inputs', {...});</code></pre>
<p>becomes:</p>
<pre><code class="javascript">$('inputs').<b>datepicker('change',</b> {...});</code></pre>
<h4>v2.x to v3.3</h4>
<p>The date picker has been refactored to better fit
within the <a href="http://ui.jquery.com">jQuery UI</a> project.
This has involved renaming the main function and some properties,
resulting in current uses of the plugin no longer functioning correctly.
To assist in the transition to the new format a compatibility
plugin is also provided, allowing current code to continue
to operate with minimal changes.</p>
<p>Existing users of v2 of the calendar should use the following
header code to work with their existing implementation:</p>
<pre><code class="html">&lt;link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/&gt;
&lt;script type="text/javascript" src="<b>ui.datepicker.js</b>"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="<b>jquery-calendar-compatibility.js</b>"&gt;&lt;/script&gt;</code></pre>
<p>Download the <a href="compatibility/jquery-calendar-compatibility.js" target="_blank">jquery-calendar-compatibility.js</a> module.</p>
<p>To migrate fully, the following steps need to be taken:</p>
<ul>
<li>Replace references to the <code>jquery-calendar*</code>
files with <code>ui.datepicker*</code>.</li>
<li>Replace references to the <code>popUpCal</code>
object with <code>$.datepicker</code>.</li>
<li>Replace references to the <code>calendar</code>
function with <code>datepicker</code>.</li>
<li>Replace references to the <code>autoPopUp</code>
setting with <code>showOn</code>.</li>
<li>Replace references to the <code>fieldSettings</code>
setting with <code>beforeShow</code>.</li>
<li>Replace references to the <code>customDate</code>
setting with <code>beforeShowDay</code>.</li>
<li>Replace references to inline attributes with the <code>cal:</code>
namespace with <code>date:</code>.</li>
<li>Replace references to the <code>hideCalendar</code>
function with <code>hideDatepicker</code>.</li>
<li>Replace references to the <code>dialogCalendar</code>
function with <code>dialogDatepicker</code>.</li>
<li>Replace references to the <code>$.datepicker.reconfigureFor(selector, ...)</code>
function with <code>$(selector).datepicker('change', ...)</code>.</li>
<li>Replace references to the <code>$.datepicker.enableFor(selector)</code>
function with <code>$(selector).datepicker('enable')</code>.</li>
<li>Replace references to the <code>$.datepicker.disableFor(selector)</code>
function with <code>$(selector).datepicker('disable')</code>.</li>
<li>Replace references to the <code>$.datepicker.showFor(selector)</code>
function with <code>$(selector).datepicker('show')</code>.</li>
<li>Replace references to the <code>$.datepicker.getDateFor(selector)</code>
function with <code>$(selector).datepicker('getDate')</code>.</li>
<li>Replace references to the <code>$.datepicker.setDateFor(selector, ...)</code>
function with <code>$(selector).datepicker('setDate', ...)</code>.</li>
<li>Replace references to the <code>calendar*</code>
CSS styles with <code>datepicker*</code>.</li>
</ul>
<p>For example, this old style code:</p>
<pre><code class="javascript">$('inputs').<b>calendar</b>({<b>autoPopUp</b>: 'both', <b>fieldSettings</b>: setDateRange,
<b>customDate</b>: <b>popUpCal</b>.noWeekends});
&lt;input type="text" id="inlineConfig" <b>cal:</b>defaultDate="+7"/&gt;</code></pre>
<p>becomes:</p>
<pre><code class="javascript">$('inputs').<b>datepicker</b>({<b>showOn</b>: 'both', <b>beforeShow</b>: setDateRange,
<b>beforeShowDay</b>: <b>$.datepicker</b>.noWeekends});
&lt;input type="text" id="inlineConfig" <b>date:</b>defaultDate="+7"/&gt;</code></pre>
</div>
<h4>Localization Packages</h4>
<ul style="float:left;width:220px;margin-top:0">
<li><a href="../../../source/i18n/ui.datepicker-ca.js" target="_blank">Bulgarian</a></li>
<li><a href="../../../source/i18n/ui.datepicker-ca.js" target="_blank">Catalan of Spain</a></li>
<li><a href="../../../source/i18n/ui.datepicker-zh-CN.js" target="_blank">Chinese Simplified</a></li>
<li><a href="../../../source/i18n/ui.datepicker-zh-TW.js" target="_blank">Chinese Traditional</a></li>
<li><a href="../../../source/i18n/ui.datepicker-cs.js" target="_blank">Czech</a></li>
<li><a href="../../../source/i18n/ui.datepicker-da.js" target="_blank">Danish</a></li>
<li><a href="../../../source/i18n/ui.datepicker-nl.js" target="_blank">Dutch</a></li>
<li><a href="../../../source/i18n/ui.datepicker-fi.js" target="_blank">Finnish</a></li>
<li><a href="../../../source/i18n/ui.datepicker-fr.js" target="_blank">French</a></li>
<li><a href="../../../source/i18n/ui.datepicker-de.js" target="_blank">German</a></li>
<li><a href="../../../source/i18n/ui.datepicker-he.js" target="_blank">Hebrew</a></li>
<li><a href="../../../source/i18n/ui.datepicker-hu.js" target="_blank">Hungarian</a></li>
<li><a href="../../../source/i18n/ui.datepicker-is.js" target="_blank">Icelandic</a></li>
<li><a href="../../../source/i18n/ui.datepicker-it.js" target="_blank">Italian</a></li>
</ul>
<ul>
<li><a href="../../../source/i18n/ui.datepicker-ja.js" target="_blank">Japanese</a></li>
<li><a href="../../../source/i18n/ui.datepicker-ko.js" target="_blank">Korean</a></li>
<li><a href="../../../source/i18n/ui.datepicker-lt.js" target="_blank">Lithuanian</a></li>
<li><a href="../../../source/i18n/ui.datepicker-no.js" target="_blank">Norwegian</a></li>
<li><a href="../../../source/i18n/ui.datepicker-pl.js" target="_blank">Polish</a></li>
<li><a href="../../../source/i18n/ui.datepicker-pt-BR.js" target="_blank">Portuguese of Brazil</a></li>
<li><a href="../../../source/i18n/ui.datepicker-ro.js" target="_blank">Romanian</a></li>
<li><a href="../../../source/i18n/ui.datepicker-ru.js" target="_blank">Russian</a></li>
<li><a href="../../../source/i18n/ui.datepicker-sk.js" target="_blank">Slovak</a></li>
<li><a href="../../../source/i18n/ui.datepicker-es.js" target="_blank">Spanish</a></li>
<li><a href="../../../source/i18n/ui.datepicker-sv.js" target="_blank">Swedish</a></li>
<li><a href="../../../source/i18n/ui.datepicker-th.js" target="_blank">Thai</a></li>
<li><a href="../../../source/i18n/ui.datepicker-tr.js" target="_blank">Turkish</a></li>
</ul>
<!-- Include jQuery -->
<script src="../../../jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script>
<!-- Include UI Datepicker -->
<script src="../../../ui/ui.datepicker.js" type="text/javascript" charset="utf-8"></script>
<!-- Include Demo Files -->
<script type="text/javascript" src="demo/jquery.localisation.js"></script>
<script src="../../../ui/i18n/ui.datepicker-fr.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../ui/i18n/ui.datepicker-he.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="demo/ui.datepicker.demo.js"></script>
</body>
</html>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

164
demos/functional/index.html Normal file
View File

@ -0,0 +1,164 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>jQuery UI - Functional demos</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="jquery,user interface,ui,widgets,interaction,javascript" />
<meta name="description" content="jQuery UI is jQuery's user interface library that comes with many widgets, interaction modules and themes." />
<meta name="author" content="Paul Bakaus" />
<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/functional_demos.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/chilli-recipes.css" type="text/css" media="screen">
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../ui/ui.core.js"></script>
<script type="text/javascript" src="../../ui/ui.accordion.js"></script>
<script type="text/javascript" src="../../ui/ui.datepicker.js"></script>
<script type="text/javascript" src="../../ui/ui.dialog.js"></script>
<script type="text/javascript" src="../../ui/ui.draggable.js"></script>
<script type="text/javascript" src="../../ui/ui.droppable.js"></script>
<script type="text/javascript" src="../../ui/ui.resizable.js"></script>
<script type="text/javascript" src="../../ui/ui.selectable.js"></script>
<script type="text/javascript" src="../../ui/ui.slider.js"></script>
<script type="text/javascript" src="../../ui/ui.sortable.js"></script>
<script type="text/javascript" src="../../ui/ui.tabs.js"></script>
<script type="text/javascript" src="../../ui/effects.core.js"></script>
<script type="text/javascript" src="../../ui/effects.blind.js"></script>
<script type="text/javascript" src="../../ui/effects.bounce.js"></script>
<script type="text/javascript" src="../../ui/effects.clip.js"></script>
<script type="text/javascript" src="../../ui/effects.drop.js"></script>
<script type="text/javascript" src="../../ui/effects.explode.js"></script>
<script type="text/javascript" src="../../ui/effects.fold.js"></script>
<script type="text/javascript" src="../../ui/effects.highlight.js"></script>
<script type="text/javascript" src="../../ui/effects.pulsate.js"></script>
<script type="text/javascript" src="../../ui/effects.scale.js"></script>
<script type="text/javascript" src="../../ui/effects.shake.js"></script>
<script type="text/javascript" src="../../ui/effects.slide.js"></script>
<script type="text/javascript" src="../../ui/effects.transfer.js"></script>
<script src="js/behaviour.js" type="text/javascript"></script>
<script src="js/behaviour.functionaldemos.js" type="text/javascript"></script>
<script src="js/beautify.js" type="text/javascript"></script>
<script src="js/functional.demo.js" type="text/javascript"></script>
<script src="js/jquery.chili.pack.js" type="text/javascript"></script>
<script src="js/chili-recipes.js" type="text/javascript"></script>
</head>
<body id="functional_demos">
<!--[if IE 5]><div id="ie5" class="ie"><![endif]-->
<!--[if IE 6]><div id="ie6" class="ie"><![endif]-->
<!--[if IE 7]><div id="ie7" class="ie"><![endif]-->
<div id="wrapper">
<div id="banner">
<h1 class="logo">
<a href="/home" title="jQuery User Interface"><span>jQuery User Interface</span></a>
</h1>
</div>
<div id="content-wrapper">
<div id="content">
<div class="content-top"></div>
<div class="content"><link rel="stylesheet" href="../../themes/flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)" />
<form id="components-fm" action="/actions/download_builder.php" method="post">
<div class="content-head">
<h2>
<span>Functional Demos</span>
</h2>
<p>
Learn how to build Cross-Browser Rich Internet Applications!
</p>
</div>
<div class="content-body">
<table cellspacing="0" cellpadding="0" class="layout-grid" id="functional">
<tr>
<td class="left-nav">
<div class="section" style="border:0; width:155px;">
<p class="side-menu-title">
Interaction
</p>
<div id="links" class="normal" style="width:100%;">
<ul class="component-links">
<li><a href="#ui.draggable" title="Goto Draggable's Component Page">Draggable</a></li>
<li><a href="#ui.droppable" title="Goto Droppable's Component Page">Droppable</a></li>
<li><a href="#ui.resizable" title="Goto Resizable's Component Page">Resizable</a></li>
<li><a href="#ui.selectable" title="Goto Selectable's Component Page">Selectable</a></li>
<li><a href="#ui.sortable" title="Goto Sortable's Component Page">Sortable</a></li>
</ul>
</div>
<br style="clear:both;">
</div>
<div class="section" style="border:0;">
<p class="side-menu-title">
Widgets
</p>
<div id="links" class="normal">
<ul class="component-links">
<li><a href="#ui.accordion" title="Goto Accordion's Component Page">Accordion</a></li>
<li><a href="#ui.tabs" title="Goto Tabs Component Page">Tabs</a></li>
<li><a href="#ui.slider" title="Goto Slider Component Page">Slider</a></li>
<li><a href="#ui.dialog" title="Goto Dialog's Component Page">Dialog</a></li>
</ul>
</div>
<br style="clear:both;">
</div>
</td>
<td class="normal">
<div class="normal" id="containerDemo">
<h3>
Instructions
</h3>
<p>
The functional demos are provided to give users an idea of how jQueryUI works. You only need to copy and paste code from the demos. Have fun playing with it.
</p>
<div id="functional-demo-face" style="margin-left: 10px;">
<img src="images/functional-demo-face.png">
</div>
<br>
</div>
</td>
</tr>
</table>
</div>
</form> </div>
</div>
</div>
<div id="footer">
<div class="bg"></div>
<div class="inner">
<p>
<span class="first">Sponsored by: </span><a class="block liferay" href="http://www.liferay.com"><span>Liferay</span></a>
<span class="first" style="float: right; padding-right: 12px;">© 2007 Paul Bakaus and the <a href="/about">jQuery UI Team</a>.</span>
</p>
</div>
</div>
</div>
<!--[if lte IE 7]></div><![endif]-->
</body>
</html>

View File

@ -0,0 +1,533 @@
/*
JS Beautifier
---------------
$Date: 2008-04-21 16:13:36 +0300 (Mon, 21 Apr 2008) $
$Revision: 53 $
Written by Einars "elfz" Lielmanis, <elfz@laacz.lv>
http://elfz.laacz.lv/beautify/
Originally converted to javascript by Vital, <vital76@gmail.com>
http://my.opera.com/Vital/blog/2007/11/21/javascript-beautify-on-javascript-translated
You are free to use this in any way you want, in case you find this useful or working for you.
Usage:
js_beautify(js_source_text);
*/
function js_beautify(js_source_text, indent_size, indent_character)
{
var input, output, token_text, last_type, last_text, last_word, current_mode, modes, indent_level, indent_string;
var whitespace, wordchar, punct, parser_pos, line_starters, in_case;
var prefix, token_type;
function print_newline(ignore_repeated)
{
ignore_repeated = typeof ignore_repeated === 'undefined' ? true: ignore_repeated;
// remove trailing whitespace and indent
while (output.length && (output[output.length - 1] === ' ' || output[output.length - 1] === indent_string)) {
output.pop();
}
if (!output.length) {
return; // no newline on start of file
}
if (output[output.length - 1] !== "\n" || !ignore_repeated) {
output.push("\n");
}
for (var i = 0; i < indent_level; i++) {
output.push(indent_string);
}
}
function print_space()
{
var last_output = output.length ? output[output.length - 1] : ' ';
if (last_output !== ' ' && last_output !== '\n' && last_output !== indent_string) { // prevent occassional duplicate space
output.push(' ');
}
}
function print_token()
{
output.push(token_text);
}
function indent()
{
indent_level++;
}
function unindent()
{
if (indent_level) {
indent_level--;
}
}
function remove_indent()
{
if (output.length && output[output.length - 1] === indent_string) {
output.pop();
}
}
function set_mode(mode)
{
modes.push(current_mode);
current_mode = mode;
}
function restore_mode()
{
current_mode = modes.pop();
}
function in_array(what, arr)
{
for (var i = 0; i < arr.length; i++)
{
if (arr[i] === what) {
return true;
}
}
return false;
}
function get_next_token()
{
var n_newlines = 0;
var c = '';
do {
if (parser_pos >= input.length) {
return ['', 'TK_EOF'];
}
c = input.charAt(parser_pos);
parser_pos += 1;
if (c === "\n") {
n_newlines += 1;
}
}
while (in_array(c, whitespace));
if (n_newlines > 1) {
for (var i = 0; i < 2; i++) {
print_newline(i === 0);
}
}
var wanted_newline = (n_newlines === 1);
if (in_array(c, wordchar)) {
if (parser_pos < input.length) {
while (in_array(input.charAt(parser_pos), wordchar)) {
c += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos === input.length) {
break;
}
}
}
// small and surprisingly unugly hack for 1E-10 representation
if (parser_pos !== input.length && c.match(/^[0-9]+[Ee]$/) && input.charAt(parser_pos) === '-') {
parser_pos += 1;
var t = get_next_token(parser_pos);
c += '-' + t[0];
return [c, 'TK_WORD'];
}
if (c === 'in') { // hack for 'in' operator
return [c, 'TK_OPERATOR'];
}
return [c, 'TK_WORD'];
}
if (c === '(' || c === '[') {
return [c, 'TK_START_EXPR'];
}
if (c === ')' || c === ']') {
return [c, 'TK_END_EXPR'];
}
if (c === '{') {
return [c, 'TK_START_BLOCK'];
}
if (c === '}') {
return [c, 'TK_END_BLOCK'];
}
if (c === ';') {
return [c, 'TK_END_COMMAND'];
}
if (c === '/') {
var comment = '';
// peek for comment /* ... */
if (input.charAt(parser_pos) === '*') {
parser_pos += 1;
if (parser_pos < input.length) {
while (! (input.charAt(parser_pos) === '*' && input.charAt(parser_pos + 1) && input.charAt(parser_pos + 1) === '/') && parser_pos < input.length) {
comment += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos >= input.length) {
break;
}
}
}
parser_pos += 2;
return ['/*' + comment + '*/', 'TK_BLOCK_COMMENT'];
}
// peek for comment // ...
if (input.charAt(parser_pos) === '/') {
comment = c;
while (input.charAt(parser_pos) !== "\x0d" && input.charAt(parser_pos) !== "\x0a") {
comment += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos >= input.length) {
break;
}
}
parser_pos += 1;
if (wanted_newline) {
print_newline();
}
return [comment, 'TK_COMMENT'];
}
}
if (c === "'" || // string
c === '"' || // string
(c === '/' &&
((last_type === 'TK_WORD' && last_text === 'return') || (last_type === 'TK_START_EXPR' || last_type === 'TK_END_BLOCK' || last_type === 'TK_OPERATOR' || last_type === 'TK_EOF' || last_type === 'TK_END_COMMAND')))) { // regexp
var sep = c;
var esc = false;
c = '';
if (parser_pos < input.length) {
while (esc || input.charAt(parser_pos) !== sep) {
c += input.charAt(parser_pos);
if (!esc) {
esc = input.charAt(parser_pos) === '\\';
} else {
esc = false;
}
parser_pos += 1;
if (parser_pos >= input.length) {
break;
}
}
}
parser_pos += 1;
if (last_type === 'TK_END_COMMAND') {
print_newline();
}
return [sep + c + sep, 'TK_STRING'];
}
if (in_array(c, punct)) {
while (parser_pos < input.length && in_array(c + input.charAt(parser_pos), punct)) {
c += input.charAt(parser_pos);
parser_pos += 1;
if (parser_pos >= input.length) {
break;
}
}
return [c, 'TK_OPERATOR'];
}
return [c, 'TK_UNKNOWN'];
}
//----------------------------------
indent_character = indent_character || ' ';
indent_size = indent_size || 4;
indent_string = '';
while (indent_size--) {
indent_string += indent_character;
}
input = js_source_text;
last_word = ''; // last 'TK_WORD' passed
last_type = 'TK_START_EXPR'; // last token type
last_text = ''; // last token text
output = [];
whitespace = "\n\r\t ".split('');
wordchar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'.split('');
punct = '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |='.split(' ');
// words which should always start on new line.
line_starters = 'continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(',');
// states showing if we are currently in expression (i.e. "if" case) - 'EXPRESSION', or in usual block (like, procedure), 'BLOCK'.
// some formatting depends on that.
current_mode = 'BLOCK';
modes = [current_mode];
indent_level = 0;
parser_pos = 0; // parser position
in_case = false; // flag for parser that case/default has been processed, and next colon needs special attention
while (true) {
var t = get_next_token(parser_pos);
token_text = t[0];
token_type = t[1];
if (token_type === 'TK_EOF') {
break;
}
switch (token_type) {
case 'TK_START_EXPR':
set_mode('EXPRESSION');
if (last_type === 'TK_END_EXPR' || last_type === 'TK_START_EXPR') {
// do nothing on (( and )( and ][ and ]( ..
} else if (last_type !== 'TK_WORD' && last_type !== 'TK_OPERATOR') {
print_space();
} else if (in_array(last_word, line_starters) && last_word !== 'function') {
print_space();
}
print_token();
break;
case 'TK_END_EXPR':
print_token();
restore_mode();
break;
case 'TK_START_BLOCK':
set_mode('BLOCK');
if (last_type !== 'TK_OPERATOR' && last_type !== 'TK_START_EXPR') {
if (last_type === 'TK_START_BLOCK') {
print_newline();
} else {
print_space();
}
}
print_token();
indent();
break;
case 'TK_END_BLOCK':
if (last_type === 'TK_START_BLOCK') {
// nothing
unindent();
} else {
unindent();
print_newline();
}
print_token();
restore_mode();
break;
case 'TK_WORD':
if (token_text === 'case' || token_text === 'default') {
if (last_text === ':') {
// switch cases following one another
remove_indent();
} else {
// case statement starts in the same line where switch
unindent();
print_newline();
indent();
}
print_token();
in_case = true;
break;
}
prefix = 'NONE';
if (last_type === 'TK_END_BLOCK') {
if (!in_array(token_text.toLowerCase(), ['else', 'catch', 'finally'])) {
prefix = 'NEWLINE';
} else {
prefix = 'SPACE';
print_space();
}
} else if (last_type === 'TK_END_COMMAND' && current_mode === 'BLOCK') {
prefix = 'NEWLINE';
} else if (last_type === 'TK_END_COMMAND' && current_mode === 'EXPRESSION') {
prefix = 'SPACE';
} else if (last_type === 'TK_WORD') {
prefix = 'SPACE';
} else if (last_type === 'TK_START_BLOCK') {
prefix = 'NEWLINE';
} else if (last_type === 'TK_END_EXPR') {
print_space();
prefix = 'NEWLINE';
}
if (in_array(token_text, line_starters) || prefix === 'NEWLINE') {
if (last_text === 'else') {
// no need to force newline on else break
print_space();
} else if ((last_type === 'TK_START_EXPR' || last_text === '=') && token_text === 'function') {
// no need to force newline on 'function': (function
// DONOTHING
} else if (last_type === 'TK_WORD' && (last_text === 'return' || last_text === 'throw')) {
// no newline between 'return nnn'
print_space();
} else if (last_type !== 'TK_END_EXPR') {
if ((last_type !== 'TK_START_EXPR' || token_text !== 'var') && last_text !== ':') {
// no need to force newline on 'var': for (var x = 0...)
if (token_text === 'if' && last_type === 'TK_WORD' && last_word === 'else') {
// no newline for } else if {
print_space();
} else {
print_newline();
}
}
}
} else if (prefix === 'SPACE') {
print_space();
}
print_token();
last_word = token_text;
break;
case 'TK_END_COMMAND':
print_token();
break;
case 'TK_STRING':
if (last_type === 'TK_START_BLOCK' || last_type === 'TK_END_BLOCK') {
print_newline();
} else if (last_type === 'TK_WORD') {
print_space();
}
print_token();
break;
case 'TK_OPERATOR':
var start_delim = true;
var end_delim = true;
if (token_text === ':' && in_case) {
print_token(); // colon really asks for separate treatment
print_newline();
break;
}
in_case = false;
if (token_text === ',') {
if (last_type === 'TK_END_BLOCK') {
print_token();
print_newline();
} else {
if (current_mode === 'BLOCK') {
print_token();
print_newline();
} else {
print_token();
print_space();
}
}
break;
} else if (token_text === '--' || token_text === '++') { // unary operators special case
if (last_text === ';') {
// space for (;; ++i)
start_delim = true;
end_delim = false;
} else {
start_delim = false;
end_delim = false;
}
} else if (token_text === '!' && last_type === 'TK_START_EXPR') {
// special case handling: if (!a)
start_delim = false;
end_delim = false;
} else if (last_type === 'TK_OPERATOR') {
start_delim = false;
end_delim = false;
} else if (last_type === 'TK_END_EXPR') {
start_delim = true;
end_delim = true;
} else if (token_text === '.') {
// decimal digits or object.property
start_delim = false;
end_delim = false;
} else if (token_text === ':') {
// zz: xx
// can't differentiate ternary op, so for now it's a ? b: c; without space before colon
start_delim = false;
}
if (start_delim) {
print_space();
}
print_token();
if (end_delim) {
print_space();
}
break;
case 'TK_BLOCK_COMMENT':
print_newline();
print_token();
print_newline();
break;
case 'TK_COMMENT':
// print_newline();
print_space();
print_token();
print_newline();
break;
case 'TK_UNKNOWN':
print_token();
break;
}
last_type = token_type;
last_text = token_text;
}
return output.join('');
}

View File

@ -0,0 +1,13 @@
$(document).ready(function() {
$('.component-links a').click(function() {
var comp = $(this).attr('href').replace(/^#/, "");
loadDemo(comp);
});
// hash listener
if (location.hash) {
loadDemo(location.hash.replace(/^#/, ""));
}
});

View File

@ -0,0 +1,205 @@
$(document).ready(function() {
// link demos
$(".demoflow div.wrapper").click(function() {
var demo = $(this).children('img').attr('_demo');
if (demo) {
location.href = '/repository/real-world/' + demo;
}else {
//alert('Under construction!');
}
});
if ($("div.demoflow").size()) {
var inst = new $.ui.carousel($("div.demoflow")[0], { height: 200, width: 310 });
$("div.demoflow-button-left, div.demoflow-button-right").bind("mousedown", function() {
var right = this.className.indexOf("right") == -1;
if(inst.autoRotator) window.clearInterval(inst.autoRotator);
inst.timer = window.setInterval(function() { inst.rotate(right ? "right" : null); }, 13);
})
.bind("mouseup", function() {
window.clearInterval(inst.timer);
});
$('.demoflow div.shadow').hover(function() {
this._lastopacity = $(this).css('opacity');
$(this).stop().animate({opacity: 0 }, 300);
}, function() {
$(this).stop().animate({opacity: this._lastopacity }, 300);
});
window.setTimeout(function() {
inst.element.animate({ opacity: 1 },2000); inst.rotate(0,2000,0.45);
window.setTimeout(function() {
inst.autoRotator = window.setInterval(function() { inst.rotate(0,2000,0.45); },5000);
},3000);
},0);
}
$('a').click(function(){
this.blur();
});
// smooth hover effects by DragonInteractive
var hover = hoverEffects();
hover.init();
});
$.ui.carousel = function(element, options) {
this.element = $(element);
this.options = $.extend({}, options);
var self = this;
$.extend(this, {
start: Math.PI/2,
step: 2*Math.PI/$("> *", this.element).length,
radiusX: 400,
radiusY: -45,
paddingX: this.element.outerWidth() / 2,
paddingY: this.element.outerHeight() / 2
});
$("> *", this.element).css({ position: "absolute", top: 0, left: 0, zIndex: 1 });
this.rotate();
this.rotate("right");
this.element.parent().bind("mousewheel", function(e,delta) {
if(self.autoRotator) window.clearInterval(self.autoRotator);
self.rotate(delta < 0 ? "right" : "left");
return false;
});
};
$.ui.carousel.prototype.rotate = function(d,ani,speed) {
this.start = this.start + (d == "right" ? -(speed || 0.03) : (speed || 0.03));
var o = this.options;
var self = this;
setTimeout(function(){
$("> *", self.element).each(function(i) {
var angle = self.start + i * self.step;
var x = self.radiusX * Math.cos(angle);
var y = self.radiusY * Math.sin(angle);
var _self = this;
var width = o.width * ((self.radiusY+y) / (2 * self.radiusY));
width = (width * width * width) / (o.width * o.width); //This makes the pieces smaller
var height = parseInt(width * o.height / o.width);
//This is highly custom - it will hide the elements at the back
$(_self).css({ visibility: height < 30 ? "hidden" : "visible" });
if(height < 30 && !ani) return; //This imrpoves the speed, but cannot be used with animation
if(ani) {
$(_self).animate({
top: Math.round(self.paddingY + y - height/2) + "px",
left: Math.round(self.paddingX + x - width/2) + "px",
width: Math.round(width) + "px",
height: Math.round(height) + "px"
},{ duration: ani, easing: "easeOutQuad" });
$(_self).css({ zIndex: Math.round(parseInt(100 * (self.radiusY+y) / (2 * self.radiusY))) });
} else {
$(_self).css({
top: self.paddingY + y - height/2 + "px",
left: self.paddingX + x - width/2 + "px",
width: width + "px",
height: height + "px",
zIndex: parseInt(100 * (self.radiusY+y) / (2 * self.radiusY))
});
}
$("div.shadow",_self).css({ opacity: 1 - (width / o.width) });
});
}, 0);
}
/**
* All credit here goes to DragonInteractive and Yuri Vishnevsky
*/
var hoverEffects = function() {
var me = this;
var args = arguments;
var self = {
c: {
navItems: '.download .click-to-download, #launch-pad .launch-pad-button, div.demoflow-button-left, div.demoflow-button-right',
navSpeed: ($.browser.safari ? 600: 350),
snOpeningSpeed: ($.browser.safari ? 400: 250),
snOpeningTimeout: 150,
snClosingSpeed: function() {
if (self.subnavHovered()) return 123450;
return 150
},
snClosingTimeout: 700
},
init: function() {
//$('.bg', this.c.navItems).css({
// 'opacity': 0
//});
this.initHoverFades()
},
subnavHovered: function() {
var hovered = false;
$(self.c.navItems).each(function() {
if (this.hovered) hovered = true
});
return hovered
},
initHoverFades: function() {
//$('#navigation .bg').css('opacity', 0);
$(self.c.navItems).hover(function() {
self.fadeNavIn.apply(this)
},
function() {
var el = this;
setTimeout(function() {
if (!el.open) self.fadeNavOut.apply(el)
},
10)
})
},
fadeNavIn: function() {
$('.bg', this).stop().animate({
'opacity': 1
},
self.c.navSpeed)
},
fadeNavOut: function() {
$('.bg', this).stop().animate({
'opacity': 0
},
self.c.navSpeed)
},
initSubmenus: function() {
$(this.c.navItems).hover(function() {
$(self.c.navItems).not(this).each(function() {
self.fadeNavOut.apply(this);
});
this.hovered = true;
var el = this;
self.fadeNavIn.apply(el);
},
function() {
this.hovered = false;
var el = this;
if (!el.open) self.fadeNavOut.apply(el);
})
}
};
return self;
};

View File

@ -0,0 +1,163 @@
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
===============================================================================
*/
/*
this file shows how to configure a static setup
it must be linked from the head of a page like:
<script type="text/javascript" src="chili/recipes.js"></script>
*/
ChiliBook.recipeLoading = false;
ChiliBook.recipes[ "jquery.js" ] =
{
steps:
{
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
, com : { exp: /\/\/.*/ }
, regexp : { exp: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/ }
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
, numbers : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
, keywords: { exp: /\b(arguments|break|case|catch|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|try|typeof|var|void|while|with)\b/ }
, global : { exp: /\b(toString|valueOf|window|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ }
, "jquery utilities" : {
exp : /(?:\$\.browser|\$\.each|\$\.extend|\$\.grep|\$\.map|\$\.merge|\$\.trim)\b/
, replacement: '<span class="jquery" title="$0"><span class="global">$$</span></span>'
}
,"jquery private" : {
exp : /(?:\$\.find|\$\.parents|\$\.sibling|\.domManip|\.eventTesting|\.extend|\.get|\.init|\.jquery|\.pushStack)\b/
, replacement: '<span class="jquery" title="$0"><span class="private">$$</span></span>'
}
,"jquery ajax" : {
exp : /(?:\$\.ajax|\$\.ajaxSetup|\$\.ajaxTimeout|\$\.get|\$\.getIfModified|\$\.getJSON|\$\.getScript|\$\.post|.ajaxComplete|.ajaxError|.ajaxSend|.ajaxStart|.ajaxStop|.ajaxSuccess|.load|.loadIfModified|.serialize)\b/
, replacement: '<span class="jquery" title="$0"><span class="ajax">$$</span></span>'
}
, "jquery object" : {
exp : /jQuery|\$(?=\W)/
, replacement: '<span class="jquery" title="$0"><span class="object">$$</span></span>'
}
,"jquery core" : {
exp : /\$\.extend|\$\.noConflict|\.(?:each|eq|get|gt|index|lt|size)\b/
, replacement: '<span class="jquery" title="$0"><span class="core">$$</span></span>'
}
,"jquery css" : {
exp : /\.(?:css|height|width)\b/
, replacement: '<span class="jquery" title="$0"><span class="css">$$</span></span>'
}
,"jquery attributes" : {
exp : /\.(?:addClass|attr|html|removeAttr|removeClass|text|toggleClass|val)\b/
, replacement: '<span class="jquery" title="$0"><span class="attributes">$$</span></span>'
}
,"jquery traversing" : {
exp : /\.(?:add|children|contains|end|filter|find|is|next|not|parent|parents|prev|siblings)\b/
, replacement: '<span class="jquery" title="$0"><span class="traversing">$$</span></span>'
}
,"jquery manipulation": {
exp : /\.(?:after|append|appendTo|before|clone|empty|insertAfter|insertBefore|prepend|prependTo|remove|wrap)\b/
, replacement: '<span class="jquery" title="$0"><span class="manipulation">$$</span></span>'
}
,"jquery effects" : {
exp : /\.(?:animate|fadeIn|fadeOut|fadeTo|hide|show|slideDown|slideToggle|slideUp|toggle)\b/
, replacement: '<span class="jquery" title="$0"><span class="effects">$$</span></span>'
}
,"jquery events" : {
exp : /\.(?:bind|blur|change|click|dblclick|error|focus|hover|keydown|keypress|keyup|load|mousedown|mousemove|mouseout|mouseover|mouseup|one|ready|resize|scroll|select|submit|toggle|trigger|unbind|unload)\b/
, replacement: '<span class="jquery" title="$0"><span class="events">$$</span></span>'
}
}
};
ChiliBook.recipes[ "html.js" ] =
{
steps: {
mlcom : { exp: /\<!--(?:\w|\W)*?--\>/ }
, tag : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ }
, php : { exp: /(?:\<\?php\s)|(?:\<\?)|(?:\?\>)/ }
, aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ }
, avalue: { exp: /(=\s*)(([\"\'])(?:(?:[^\3\\]*?(?:\3\3|\\.))*?[^\3\\]*?)\3)/
, replacement: '$1<span class="$0">$2</span>' }
, entity: { exp: /&[\w#]+?;/ }
}
};
ChiliBook.recipes[ "javascript.js" ] =
{
steps: {
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
, com : { exp: /\/\/.*/ }
, regexp : { exp: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/ }
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
, numbers : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
, keywords: { exp: /\b(arguments|break|case|catch|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|try|typeof|var|void|while|with)\b/ }
, global : { exp: /\b(toString|valueOf|window|self|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ }
}
};
ChiliBook.recipes[ "mysql.js" ] =
{
ignoreCase: true
, steps: {
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// }
, com : { exp: /(?:--\s+.*)|(?:[^\\]\#.*)/ }
, string : { exp: /([\"\'])(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ }
, quid : { exp: /(`)(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ }
, value : { exp: /\b(?:NULL|TRUE|FALSE)\b/ }
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ }
, hexnum : { exp: /\b0[xX][\dA-Fa-f]+\b|\b[xX]([\'\"])[\dA-Fa-f]+\1/ }
, op : { exp: /!=|&&|<|<<|<=|<=>|<>|=|>|>=|>>|\|\|/ }
, variable : { exp: /@([$.\w]+|([`\"\'])(?:(?:[^\2\\\r\n]*?(?:\2\2|\\.))*[^\2\\\r\n]*?)\2)/
, replacement: '<span class="keyword">@</span><span class="variable">$1</span>' }
, keyword : { exp: /\b(?:A(?:CTION|DD|FTER|G(?:AINST|GREGATE)|L(?:GORITHM|L|TER)|N(?:ALYZE|D|Y)|S(?:C(?:II|)|ENSITIVE|)|UTO_INCREMENT|VG(?:_ROW_LENGTH|))|B(?:ACKUP|DB|E(?:FORE|GIN|RKELEYDB|TWEEN)|I(?:GINT|N(?:ARY|LOG)|T)|LOB|O(?:OL(?:EAN|)|TH)|TREE|Y(?:TE|))|C(?:A(?:CHE|LL|S(?:CADE(?:D|)|E))|H(?:A(?:IN|NGE(?:D|)|R(?:ACTER|SET|))|ECK(?:SUM|))|IPHER|L(?:IENT|OSE)|O(?:DE|L(?:LAT(?:E|ION)|UMN(?:S|))|M(?:M(?:ENT|IT(?:TED|))|P(?:ACT|RESSED))|N(?:CURRENT|DITION|NECTION|S(?:ISTENT|TRAINT)|T(?:AINS|INUE)|VERT))|R(?:EATE|OSS)|U(?:BE|R(?:RENT_(?:DATE|TIME(?:STAMP|)|USER)|SOR)))|D(?:A(?:T(?:A(?:BASE(?:S|)|)|E(?:TIME|))|Y(?:_(?:HOUR|MI(?:CROSECOND|NUTE)|SECOND)|))|E(?:ALLOCATE|C(?:IMAL|LARE|)|F(?:AULT|INER)|L(?:AY(?:ED|_KEY_WRITE)|ETE)|S(?:C(?:RIBE|)|_KEY_FILE)|TERMINISTIC)|I(?:RECTORY|S(?:ABLE|CARD|TINCT(?:ROW|))|V)|O(?:UBLE|)|ROP|U(?:AL|MPFILE|PLICATE)|YNAMIC)|E(?:ACH|LSE(?:IF|)|N(?:ABLE|CLOSED|D|GINE(?:S|)|UM)|RRORS|SCAPE(?:D|)|VENTS|X(?:ECUTE|I(?:STS|T)|P(?:ANSION|LAIN)|TENDED))|F(?:A(?:LSE|ST)|ETCH|I(?:ELDS|LE|RST|XED)|L(?:OAT(?:4|8|)|USH)|O(?:R(?:CE|EIGN|)|UND)|R(?:AC_SECOND|OM)|U(?:LL(?:TEXT|)|NCTION))|G(?:E(?:OMETRY(?:COLLECTION|)|T_FORMAT)|LOBAL|R(?:ANT(?:S|)|OUP))|H(?:A(?:NDLER|SH|VING)|ELP|IGH_PRIORITY|O(?:STS|UR(?:_(?:MI(?:CROSECOND|NUTE)|SECOND)|)))|I(?:DENTIFIED|F|GNORE|MPORT|N(?:DEX(?:ES|)|FILE|N(?:ER|O(?:BASE|DB))|OUT|SE(?:NSITIVE|RT(?:_METHOD|))|T(?:1|2|3|4|8|E(?:GER|RVAL)|O|)|VOKER|)|O_THREAD|S(?:OLATION|SUER|)|TERATE)|JOIN|K(?:EY(?:S|)|ILL)|L(?:A(?:NGUAGE|ST)|E(?:A(?:DING|VE(?:S|))|FT|VEL)|I(?:KE|MIT|NES(?:TRING|))|O(?:AD|C(?:AL(?:TIME(?:STAMP|)|)|K(?:S|))|GS|NG(?:BLOB|TEXT|)|OP|W_PRIORITY))|M(?:A(?:STER(?:_(?:CONNECT_RETRY|HOST|LOG_(?:FILE|POS)|P(?:ASSWORD|ORT)|S(?:ERVER_ID|SL(?:_(?:C(?:A(?:PATH|)|ERT|IPHER)|KEY)|))|USER)|)|TCH|X_(?:CONNECTIONS_PER_HOUR|QUERIES_PER_HOUR|ROWS|U(?:PDATES_PER_HOUR|SER_CONNECTIONS)))|E(?:DIUM(?:BLOB|INT|TEXT|)|RGE)|I(?:CROSECOND|DDLEINT|GRATE|N(?:UTE(?:_(?:MICROSECOND|SECOND)|)|_ROWS))|O(?:D(?:E|IF(?:IES|Y)|)|NTH)|U(?:LTI(?:LINESTRING|PO(?:INT|LYGON))|TEX))|N(?:A(?:ME(?:S|)|T(?:IONAL|URAL))|CHAR|DB(?:CLUSTER|)|E(?:W|XT)|O(?:NE|T|_WRITE_TO_BINLOG|)|U(?:LL|MERIC)|VARCHAR)|O(?:FFSET|LD_PASSWORD|N(?:E(?:_SHOT|)|)|P(?:EN|TI(?:MIZE|ON(?:ALLY|)))|R(?:DER|)|UT(?:ER|FILE|))|P(?:A(?:CK_KEYS|RTIAL|SSWORD)|HASE|O(?:INT|LYGON)|R(?:E(?:CISION|PARE|V)|I(?:MARY|VILEGES)|OCE(?:DURE|SS(?:LIST|)))|URGE)|QU(?:ARTER|ERY|ICK)|R(?:AID(?:0|_(?:CHUNKS(?:IZE|)|TYPE))|E(?:A(?:D(?:S|)|L)|COVER|DUNDANT|FERENCES|GEXP|L(?:AY_(?:LOG_(?:FILE|POS)|THREAD)|EASE|OAD)|NAME|P(?:AIR|EAT(?:ABLE|)|L(?:ACE|ICATION))|QUIRE|S(?:ET|T(?:ORE|RICT)|UME)|TURN(?:S|)|VOKE)|IGHT|LIKE|O(?:LL(?:BACK|UP)|UTINE|W(?:S|_FORMAT|))|TREE)|S(?:AVEPOINT|CHEMA(?:S|)|E(?:C(?:OND(?:_MICROSECOND|)|URITY)|LECT|NSITIVE|PARATOR|RIAL(?:IZABLE|)|SSION|T)|H(?:ARE|OW|UTDOWN)|I(?:GNED|MPLE)|LAVE|MALLINT|NAPSHOT|O(?:ME|NAME|UNDS)|P(?:ATIAL|ECIFIC)|QL(?:EXCEPTION|STATE|WARNING|_(?:B(?:IG_RESULT|UFFER_RESULT)|CA(?:CHE|LC_FOUND_ROWS)|NO_CACHE|SMALL_RESULT|T(?:HREAD|SI_(?:DAY|FRAC_SECOND|HOUR|M(?:INUTE|ONTH)|QUARTER|SECOND|WEEK|YEAR)))|)|SL|T(?:A(?:RT(?:ING|)|TUS)|O(?:P|RAGE)|R(?:AIGHT_JOIN|I(?:NG|PED)))|U(?:BJECT|PER|SPEND))|T(?:ABLE(?:S(?:PACE|)|)|E(?:MP(?:ORARY|TABLE)|RMINATED|XT)|HEN|I(?:ME(?:STAMP(?:ADD|DIFF|)|)|NY(?:BLOB|INT|TEXT))|O|R(?:A(?:ILING|NSACTION)|IGGER(?:S|)|U(?:E|NCATE))|YPE(?:S|))|U(?:N(?:COMMITTED|D(?:EFINED|O)|I(?:CODE|ON|QUE)|KNOWN|LOCK|SIGNED|TIL)|P(?:DATE|GRADE)|S(?:AGE|E(?:R(?:_RESOURCES|)|_FRM|)|ING)|TC_(?:DATE|TIME(?:STAMP|)))|V(?:A(?:LUE(?:S|)|R(?:BINARY|CHAR(?:ACTER|)|IABLES|YING))|IEW)|W(?:ARNINGS|EEK|H(?:E(?:N|RE)|ILE)|ITH|ORK|RITE)|X(?:509|A|OR)|YEAR(?:_MONTH|)|ZEROFILL)\b/ }
, func : { exp: /\b(?:A(?:BS|COS|DD(?:DATE|TIME)|ES_(?:DECRYPT|ENCRYPT)|REA|S(?:BINARY|IN|TEXT|WK(?:B|T))|TAN(?:2|))|B(?:ENCHMARK|I(?:N|T_(?:AND|COUNT|LENGTH|OR|XOR)))|C(?:AST|E(?:IL(?:ING|)|NTROID)|HAR(?:ACTER_LENGTH|_LENGTH)|O(?:ALESCE|ERCIBILITY|MPRESS|N(?:CAT(?:_WS|)|NECTION_ID|V(?:ERT_TZ|))|S|T|UNT)|R(?:C32|OSSES)|UR(?:DATE|TIME))|D(?:A(?:TE(?:DIFF|_(?:ADD|FORMAT|SUB))|Y(?:NAME|OF(?:MONTH|WEEK|YEAR)))|E(?:CODE|GREES|S_(?:DECRYPT|ENCRYPT))|I(?:MENSION|SJOINT))|E(?:LT|N(?:C(?:ODE|RYPT)|DPOINT|VELOPE)|QUALS|X(?:P(?:ORT_SET|)|T(?:ERIORRING|RACT)))|F(?:I(?:ELD|ND_IN_SET)|LOOR|O(?:RMAT|UND_ROWS)|ROM_(?:DAYS|UNIXTIME))|G(?:E(?:OM(?:COLLFROM(?:TEXT|WKB)|ETRY(?:COLLECTIONFROM(?:TEXT|WKB)|FROM(?:TEXT|WKB)|N|TYPE)|FROM(?:TEXT|WKB))|T_LOCK)|LENGTH|R(?:EATEST|OUP_(?:CONCAT|UNIQUE_USERS)))|HEX|I(?:FNULL|N(?:ET_(?:ATON|NTOA)|STR|TER(?:IORRINGN|SECTS))|S(?:CLOSED|EMPTY|NULL|SIMPLE|_(?:FREE_LOCK|USED_LOCK)))|L(?:AST_(?:DAY|INSERT_ID)|CASE|E(?:AST|NGTH)|INE(?:FROM(?:TEXT|WKB)|STRINGFROM(?:TEXT|WKB))|N|O(?:AD_FILE|CATE|G(?:10|2|)|WER)|PAD|TRIM)|M(?:A(?:KE(?:DATE|TIME|_SET)|STER_POS_WAIT|X)|BR(?:CONTAINS|DISJOINT|EQUAL|INTERSECTS|OVERLAPS|TOUCHES|WITHIN)|D5|I(?:D|N)|LINEFROM(?:TEXT|WKB)|ONTHNAME|PO(?:INTFROM(?:TEXT|WKB)|LYFROM(?:TEXT|WKB))|ULTI(?:LINESTRINGFROM(?:TEXT|WKB)|PO(?:INTFROM(?:TEXT|WKB)|LYGONFROM(?:TEXT|WKB))))|N(?:AME_CONST|OW|U(?:LLIF|M(?:GEOMETRIES|INTERIORRINGS|POINTS)))|O(?:CT(?:ET_LENGTH|)|RD|VERLAPS)|P(?:ERIOD_(?:ADD|DIFF)|I|O(?:INT(?:FROM(?:TEXT|WKB)|N)|LY(?:FROM(?:TEXT|WKB)|GONFROM(?:TEXT|WKB))|SITION|W(?:ER|)))|QUOTE|R(?:A(?:DIANS|ND)|E(?:LEASE_LOCK|VERSE)|O(?:UND|W_COUNT)|PAD|TRIM)|S(?:E(?:C_TO_TIME|SSION_USER)|HA(?:1|)|I(?:GN|N)|LEEP|OUNDEX|PACE|QRT|RID|T(?:ARTPOINT|D(?:DEV(?:_(?:POP|SAMP)|)|)|R(?:CMP|_TO_DATE))|U(?:B(?:DATE|STR(?:ING(?:_INDEX|)|)|TIME)|M)|YS(?:DATE|TEM_USER))|T(?:AN|IME(?:DIFF|_(?:FORMAT|TO_SEC))|O(?:UCHES|_DAYS)|RIM)|U(?:CASE|N(?:COMPRESS(?:ED_LENGTH|)|HEX|I(?:QUE_USERS|X_TIMESTAMP))|PPER|UID)|V(?:AR(?:IANCE|_(?:POP|SAMP))|ERSION)|W(?:EEK(?:DAY|OFYEAR)|ITHIN)|X|Y(?:EARWEEK|))(?=\()/ }
, id : { exp: /[$\w]+/ }
}
};
ChiliBook.recipes[ "php.js" ] =
{
steps: {
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// }
, com : { exp: /(?:\/\/.*)|(?:[^\\]\#.*)/ }
, string1 : { exp: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/ }
, string2 : { exp: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/ }
, value : { exp: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/ }
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ }
, const1 : { exp: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/ }
, const2 : { exp: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/ }
, global : { exp: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/ }
, keyword : { exp: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/ }
, variable: { exp: /\$(\w+)/
, replacement: '<span class="keyword">$</span><span class="variable">$1</span>' }
, heredoc : { exp: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
, replacement: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>' }
}
};
ChiliBook.recipes[ "css.js" ] =
{
steps: {
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
, string: { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
, number: { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/ }
, attrib: { exp: /\b(?:z-index|x-height|word-spacing|widths|width|widows|white-space|volume|voice-family|visibility|vertical-align|units-per-em|unicode-range|unicode-bidi|text-transform|text-shadow|text-indent|text-decoration|text-align|table-layout|stress|stemv|stemh|src|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|slope|size|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|mathline|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|empty-cells|elevation|display|direction|descent|definition-src|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|centerline|caption-side|cap-height|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|bbox|baseline|background-repeat|background-position|background-image|background-color|background-attachment|background|azimuth|ascent)\b/ }
, value : { exp: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/ }
, color : { exp: /(?:\#[a-zA-Z0-9]{3,6})|(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua)/ }
}
};
ChiliBook.elementPath = '.colored';
ChiliBook.elementClass = 'colored';

View File

@ -0,0 +1,175 @@
var uid = 0;
/**
* Render a demo template page
* @author Eduardo Lundgren (braeker)
* @param {Object} model
*/
var uiRenderDemo = function(model) {
var title = model.title, renderAt = $(model.renderAt);
function nl2br( str ) {
return str.replace(/([^>])\n/g, '$1<br />\n');
}
var js2html = function(code) {
var src = (js_beautify(code) || "");
//if ($.browser.msie)
// src = src.replace(/([^>])\n/g, '$1<br />\n');
return src;
};
renderAt.append(
'<h3>'+ title +'</h3>'
);
$.each(model.demos, function(i, demo) {
/**
* Rendering each demo
*/
if (!demo) return;
var uiHtmlRendered = $('<div class="ui-html-rendered"></div>');
if (model.onRenderStart) model.onRenderStart.apply(window);
var gid = 'ui-gen-'+uid++, demoBox = $('<div id="'+gid+'"></div>');
renderAt.append(demoBox);
var detailsHtml = $(
'<br><div class="ui-details"><div class="menutitle">'+demo.title+'</div></div>'
);
var descBox = $(
'<div class="ui-demo-description">'+(demo.desc||'')+'</div>'
);
var optionsBox = $(
'<div class="ui-demo-options"><label for="select-'+gid+'">Try more options on the fly: </label></div>'
);
var codesBox = $(
'<div id="code-'+gid+'"></div>'
)
.css({display: 'none'});
var sourceTmpl = $(
'<div></div>'
);
var preTmpl = $(
'<span style="white-space: pre;"></span>'
);
var codeTmpl = $(
'<code></code>'
);
var htmlCode = '', sourceHtml = sourceTmpl.clone(), sourceJs = sourceTmpl.clone(), entitiesHtml = function(html) {
return html.replace(/</g,"&lt;").replace(/>/g,"&gt;");
};
// Render simple HTML
if (typeof demo.html == 'string') {
uiHtmlRendered.html(demo.html);
htmlCode = demo.html;
}
// Render data html by URL
if (typeof demo.html == 'object' && demo.html.url) {
uiHtmlRendered.html("<img src='/images/ajax-loader.gif'>");
$.ajax({
type: "GET",
url: demo.html.url,
cache: false,
success: function(data) {
uiHtmlRendered.html(data);
htmlCode = data;
// set html code view
sourceHtml.html(preTmpl.clone().html( codeTmpl.clone().addClass('colored html').html(entitiesHtml(htmlCode)) ));
$.each(demo.options, function(x, o) {
// eval the first source of <select>
if (!x) jQuery.globalEval(o.source);
});
$('#'+gid).find('.colored.html').chili();
// fire renderEnd callback to ajax async transactions
if (model.onRenderEnd) model.onRenderEnd.apply(window);
}
});
}
// set html code view
sourceHtml.html(preTmpl.clone().html( codeTmpl.clone().addClass('colored html').html(entitiesHtml(htmlCode)) ));
var select = $('<select id="select-'+ gid+'"></select>').change(function() {
var ecode = decodeURIComponent($(this).val());
jQuery.globalEval(demo.destroy);
jQuery.globalEval(ecode);
sourceJs.html(preTmpl.html( codeTmpl.clone().addClass('colored javascript').html(js2html(ecode, 4)) ));
$('.colored.javascript').chili();
});
var a = $('<a>View Source</a>').attr('href', 'javascript:void(0);').addClass('link-view-source').toggle(function() {
var self = this;
$(codesBox).show("fast");
$(this).text("Hide Source");
},
function() {
$(codesBox).hide();
$(this).text("Show Source");
});
demoBox.append(
detailsHtml, descBox, uiHtmlRendered, optionsBox.append(
select, a, '<br>', codesBox.append('<br>JavaScript:<br>', sourceJs, '<br>HTML:<br>', sourceHtml)
)
);
// population select with the demo options
$.each(demo.options, function(x, o) {
if (o && o.desc) {
var source = encodeURIComponent(o.source);
select.append($('<option>' + o.desc + '</option>').val(source));
// eval the first source of <select>
if (!x) {
sourceJs.html(preTmpl.html(codeTmpl.clone().addClass('colored javascript').html(js2html(o.source, 4))));
jQuery.globalEval(o.source);
}
}
});
$('#'+gid).find('.colored.javascript').chili();
$('#'+gid).find('.colored.html').chili();
// fire renderEnd callback to direct-html-render
if (typeof demo.html != 'object' && model.onRenderEnd) model.onRenderEnd.apply(window);
});
};
var loadDemo = function(comp) {
$('#containerDemo').html("<img src='images/ajax-loader.gif'>");
$("#containerDemo").ajaxError(function(request, settings){
$(this).html("Ops, there is no template file for this component.");
});
$.get('templates/'+comp+'.html', function(data) {
$('#containerDemo').html(data);
});
};

View File

@ -0,0 +1,12 @@
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
Copyright 2007 / Andrea Ercolino
===============================================================================
*/
(function($){ChiliBook={version:"1.9",automatic:true,automaticSelector:"code",codeLanguage:function(a){var b=$(a).attr("class");return b?b:''},metadataSelector:"object.chili",recipeLoading:true,recipeFolder:"",stylesheetLoading:true,stylesheetFolder:"",defaultReplacement:'<span class="$0">$$</span>',replaceSpace:"&#160;",replaceTab:"&#160;&#160;&#160;&#160;",replaceNewLine:"&#160;<br/>",recipes:{},queue:{},preFixCopy:document.selection&&document.selection.createRange,preContent:"",preElement:null};$.metaobjects=function(c){c=$.extend({context:document,clean:true,selector:'object.metaobject'},c);function jsValue(a){eval('value = '+a+";");return a}return $(c.selector,c.context).each(function(){var b={target:this.parentNode};$('> param[@name=metaparam]',this).each(function(){$.extend(b,jsValue(this.value))});$('> param',this).not('[@name=metaparam]').each(function(){var a=this.name,value=jsValue(this.value);$(b.target).each(function(){this[a]=value})});if(c.clean){$(this).remove()}})};$.fn.chili=function(r){var s=$.extend({},ChiliBook,r||{});function cook(k,l){function prepareStep(a,b){var c=(typeof b.exp=="string")?b.exp:b.exp.source;o.push({stepName:a,exp:"("+c+")",length:1+(c.replace(/\\./g,"%").replace(/\[.*?\]/g,"%").match(/\((?!\?)/g)||[]).length,replacement:(b.replacement)?b.replacement:s.defaultReplacement})}function knowHow(){var b=1;var c=[];for(var i=0;i<o.length;i++){var d=o[i].exp;d=d.replace(/\\\\|\\(\d+)/g,function(m,a){return!a?m:"\\"+(b+1+parseInt(a,10))});c.push(d);b+=o[i].length}var e='((?:\\s|\\S)*?)';var f='((?:\\s|\\S)+)';var g='(?:'+c.join("|")+')';g=e+g+'|'+f;return new RegExp(g,(l.ignoreCase)?"gi":"g")}function escapeHTML(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;")}function replaceSpaces(b){return b.replace(/ +/g,function(a){return a.replace(/ /g,n)})}function filter(a){a=escapeHTML(a);if(n){a=replaceSpaces(a)}return a}function chef(){var i=0;var j=2;var c=arguments[1];var d=arguments[arguments.length-3];if(!d){var e;while(e=o[i++]){var f=arguments;if(f[j]){var g=/(\\\$)|(?:\$\$)|(?:\$(\d+))/g;var h=e.replacement.replace(g,function(m,a,K){var b='';if(a){return"$"}else if(!K){return filter(f[j])}else if(K=="0"){return e.stepName}else{return filter(f[j+parseInt(K,10)])}});return filter(c)+h}else{j+=e.length}}}else{return filter(d)}}var n=s.replaceSpace;var o=[];for(var p in l.steps){prepareStep(p,l.steps[p])}var q=k.replace(knowHow(),chef);return q}function checkCSS(a){if(!s.queue[a]){var e=document.createElement("link");e.rel="stylesheet";e.type="text/css";e.href=a;document.getElementsByTagName("head")[0].appendChild(e);s.queue[a]=true}}function makeDish(a,b){var c=s.recipes[b];if(!c){return}$el=$(a);var d=$el.text();if(!d){return}d=d.replace(/\r\n?/g,"\n");var e=cook(d,c);if(s.replaceTab){e=e.replace(/\t/g,s.replaceTab)}if(s.replaceNewLine){e=e.replace(/\n/g,s.replaceNewLine)}a.innerHTML=e;if(ChiliBook.preFixCopy){$el.parents().filter("pre").bind("mousedown",function(){ChiliBook.preElement=this}).bind("mouseup",function(){if(ChiliBook.preElement==this){ChiliBook.preContent=document.selection.createRange().htmlText}})}}function getPath(a,b){var c={recipeFolder:s.recipeFolder,recipeFile:a+".js",stylesheetFolder:s.stylesheetFolder,stylesheetFile:a+".css"};var d;if(b&&typeof b=="object"){d=$.extend(c,b)}else{d=c}return{recipe:d.recipeFolder+d.recipeFile,stylesheet:d.stylesheetFolder+d.stylesheetFile}}if(s.metadataSelector){$.metaobjects({context:this,selector:s.metadataSelector})}this.each(function(){var b=this;var c=s.codeLanguage(b);if(''!=c){var d=getPath(c,b.chili);if(s.recipeLoading||b.chili){if(!s.queue[d.recipe]){try{s.queue[d.recipe]=[b];$.getJSON(d.recipe,function(a){a.path=d.recipe;s.recipes[d.recipe]=a;if(s.stylesheetLoading){checkCSS(d.stylesheet)}var q=s.queue[d.recipe];for(var i=0,iTop=q.length;i<iTop;i++){makeDish(q[i],d.recipe)}})}catch(recipeNotAvailable){alert("the recipe for '"+c+"' was not found in '"+d.recipe+"'")}}else{s.queue[d.recipe].push(b)}makeDish(b,d.recipe)}else{makeDish(b,d.recipe)}}});return this};$(function(){if(ChiliBook.automatic){if(ChiliBook.elementPath){ChiliBook.automaticSelector=ChiliBook.elementPath;if(ChiliBook.elementClass){ChiliBook.codeLanguage=function(a){var b=new RegExp("\\b"+ChiliBook.elementClass+"\\b","gi");var c=$(a).attr("class");if(!c){return''}var d=$.trim(c.replace(b,""));return d}}}$(ChiliBook.automaticSelector).chili()}if(ChiliBook.preFixCopy){function preformatted(a){if(''==a){return""}do{var b=(new Date()).valueOf()}while(a.indexOf(b)>-1);a=a.replace(/\<br[^>]*?\>/ig,b);var c=document.createElement('<pre>');c.innerHTML=a;a=c.innerText.replace(new RegExp(b,"g"),'\r\n');return a}$("body").bind("copy",function(){if(''!=ChiliBook.preContent){window.clipboardData.setData('Text',preformatted(ChiliBook.preContent));event.returnValue=false}}).bind("mousedown",function(){ChiliBook.preContent=""}).bind("mouseup",function(){ChiliBook.preElement=null})}})})(jQuery);

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,35 @@
<ul id="accordionDemo" class="ui-accordion-container" style="width: 200px; height: 450px;">
<li>
<span class="ui-accordion-left"></span>
<a href='#' class="ui-accordion-link">
Test 1
<span class="ui-accordion-right"></span>
</a>
<div class="ui-accordion-data">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</li>
<li>
<span class="ui-accordion-left"></span>
<a href='#' class="ui-accordion-link">Test 2<span class="ui-accordion-right"></span></a>
<div class="ui-accordion-data">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
</li>
<li>
<span class="ui-accordion-left"></span>
<a href='#' class="ui-accordion-link">Test 3<span class="ui-accordion-right"></span></a>
<div class="ui-accordion-data">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</div>
</li>
<li>
<span class="ui-accordion-left"></span>
<a href='#' class="ui-accordion-link">Test 4<span class="ui-accordion-right"></span></a>
<div class="ui-accordion-data">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</div>
</li>
<li>
<span class="ui-accordion-left"></span>
<a href='#' class="ui-accordion-link">Test 5<span class="ui-accordion-right"></span></a>
<div class="ui-accordion-data">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</div>
</li>
</ul>

View File

@ -0,0 +1,33 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Accordion Demos',
desc: 'Simple accordion',
demos: [
{
title: 'Simple accordion',
html: { url: 'templates/ui.accordion.data.html' },
destroy: '$("#accordionDemo").accordion("destroy");',
options: [
{ desc: 'Simple Accordion Mouse over', source: '$("#accordionDemo").accordion({event: "mouseover"});' },
{ desc: 'Simple Accordion', source: '$("#accordionDemo").accordion();' }
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,85 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Draggable Demos',
demos: [
{
title: 'Simple image drag',
desc: 'You also can make images draggable!',
html: '<img id="dragImage" src="templates/images/puppy.jpg" style="width: 228px; height:157px;">',
destroy: '$("#dragImage").draggable("destroy");',
options: [
{ desc: 'Using a helper clone', source: '$("#dragImage").draggable({ helper: "clone" });' },
{ desc: 'Simple Drag', source: '$("#dragImage").draggable();' },
{ desc: 'Axis x', source: '$("#dragImage").draggable({ axis: "x" });' },
{ desc: 'Axis y', source: '$("#dragImage").draggable({ axis: "y" });' },
{ desc: 'Axis x, Change cursor', source: '$("#dragImage").draggable({ axis: "x", cursor: "move" });' },
{ desc: 'Cursor position [top/left]', source: '$("#dragImage").draggable({ cursorAt: {top: 2, left: 2 } });' },
{ desc: 'Cursor position [right/bottom]', source: '$("#dragImage").draggable({ cursorAt: {bottom: 20, right: 14} });' },
{ desc: 'Drag on a Grid', source: '$("#dragImage").draggable({ grid: [50, 50] });' },
{ desc: 'Change the opacity', source: '$("#dragImage").draggable({ opacity: 0.40 });' },
{ desc: 'Drag and Revert to the original position', source: '$("#dragImage").draggable({ revert: true, helper: "clone" });' }
]
},
{
title: 'Drag div element',
desc: 'With few lines of code you could make a div draggable. You can try more options on the fly!',
html: '<div id="divDrag" class="draggable">Drag me</div><br>',
destroy: '$("#divDrag").draggable("destroy");',
options: [
{ desc: 'Simple Drag', source: '$("#divDrag").draggable();' },
{ desc: 'Dragging elements in a Region', source: '$("#divDrag").draggable({ containment: "parent" });' },
{ desc: 'Axis x', source: '$("#divDrag").draggable({ axis: "x" });' },
{ desc: 'Axis y', source: '$("#divDrag").draggable({ axis: "y" });' },
{ desc: 'Axis x, Change cursor', source: '$("#divDrag").draggable({ axis: "x", cursor: "move" });' },
{ desc: 'Cursor position [top/left]', source: '$("#divDrag").draggable({ cursorAt: {top: 2, left: 2 } });' },
{ desc: 'Cursor position [right/bottom]', source: '$("#divDrag").draggable({ cursorAt: {bottom: 20, right: 14} });' },
{ desc: 'Drag on a Grid', source: '$("#divDrag").draggable({ grid: [50, 50] });' },
{ desc: 'Using a helper clone', source: '$("#divDrag").draggable({ helper: "clone" });' },
{ desc: 'Change the opacity', source: '$("#divDrag").draggable({ opacity: 0.40 });' },
{ desc: 'Drag and Revert to the original position', source: '$("#divDrag").draggable({ revert: true, helper: "clone" });' }
]
},
{
title: 'Drag with a handle',
desc: 'Drag element by a handle.',
html: '<div id="draggable-handle-div" class="draggable"><div class="drag-handle"></div>Drag me</div>',
destroy: '$("#draggable-handle-div").draggable("destroy");',
options: [
{ desc: 'Drag using a handle', source: '$("#draggable-handle-div").draggable({ handle: "div" });' },
{ desc: 'Drag using a handle with a helper', source: '$("#draggable-handle-div").draggable({ helper: "clone", handle: "div" });' }
]
},
{
title: 'Drag prevention for pre-defined elements',
desc: 'You can change elements to not drag the parent.',
html: '<div id="draggable-dragPrevention" class="draggable"><a href="#">Drag me</a><br><input type="text" value="select me" style="width: 90px; font-size: 10px;" /></div>',
destroy: '$("#draggable-dragPrevention").draggable("destroy");',
options: [
{ desc: 'Drag using a handle', source: '$("#draggable-dragPrevention").draggable({ dragPrevention: "a,input,textarea" });' },
{ desc: 'Drag using a handle with a helper', source: '$("#draggable-dragPrevention").draggable({ helper: "clone", dragPrevention: "a,input,textarea" });' }
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,87 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Doppable Demos',
demos: [
{
title: 'Droppable',
desc: 'With few lines of code you could make an element droppable. You can try more options on the fly!',
html: { url: 'templates/ui.droppable.photos.html' },
destroy: '$(".droppable-photos-container").droppable("destroy");',
options: [
{
desc: 'Photo manager',
source: '$(".droppable-photos-container").droppable({ accept: ".img_content", drop: function(ev, ui) { ui.draggable.clone().fadeOut("fast", function() { $(this).fadeIn("fast") }).appendTo($(this).empty()); } });'
}
]
},
{
title: 'Droppable',
desc: 'With few lines of code you could make an element droppable. You can try more options on the fly!',
html: '<div class="block">.block</div><div class="draggable red">.red</div><div class="draggable green">.green</div><div class="drop">Drop on me!<br><br></div>',
destroy: '$(".drop").droppable("destroy");',
options: [
{
desc: 'Accept all, Active Class',
source: '$(".drop").droppable({ accept: ".block, .red, .green", activeClass: "droppable-active", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Only accept .block',
source: '$(".drop").droppable({ accept: ".block", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Only accept .red',
source: '$(".drop").droppable({ accept: ".red", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Only accept .green',
source: '$(".drop").droppable({ accept: ".green", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Accept all, Hover Class',
source: '$(".drop").droppable({ accept: ".block, .red, .green", hoverClass: "droppable-hover", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Accept all, Mouse tolerance',
source: '$(".drop").droppable({ accept: ".block, .red, .green", hoverClass: "silver", tolerance: "pointer", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Accept all, Touch tolerance',
source: '$(".drop").droppable({ accept: ".block, .red, .green", hoverClass: "silver", tolerance: "touch", drop: function(ev, ui) { $(this).append("Dropped! "); }});'
},
{
desc: 'Accept all, Activate/Deactivate callbacks',
source: '$(".drop").droppable({ accept: ".block, .red, .green, .red, .green", activate: function(ev, ui) { $(this).append("Activate! "); }, deactivate: function(ev, ui) { $(this).append("Deactivate! "); }});'
},
{
desc: 'Accept all, Over/Out callbacks',
source: '$(".drop").droppable({ accept: ".block, .red, .green", over: function(ev, ui) { $(this).append("Over! "); }, out: function(ev, ui) { $(this).append("Out! "); }});'
}
]
}
],
onRenderEnd: function() {
$(".block, .green, .red").draggable({helper: "clone"});
$('ul.droppable-gallery img').addClass('img_content').draggable({
helper: 'clone'
});
}
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,17 @@
<div id="droppablePhotos" style="min-height: 130px; min-height:130px; height:auto !important; zoom:1;">
<ul class="droppable-gallery">
<li class="droppable-img-content">
<img src="templates/images/P1010020.JPG" alt="Tatry 1" title="Drag me!" />
</li>
<li class="droppable-img-content">
<img src="templates/images/P1010039.JPG" alt="Tatry 3" title="Drag me!" />
</li>
<li class="droppable-img-content">
<img src="templates/images/P1010044.JPG" alt="Tatry 4" title="Drag me!" />
</li>
</ul>
<div class="droppable-photos-container" style="text-align: center;">Drop here!</div>
</div>

View File

@ -0,0 +1,92 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Resizable Demos',
demos: [
{
title: 'Simple div Resizing',
desc: 'You can play with the options listed below and check the results on the div.',
html: '<div id="simpleDiv" class="resizable">Resize me!</div><br>',
destroy: '$("#simpleDiv").resizable("destroy");',
options: [
{ desc: 'All handles', source: '$("#simpleDiv").resizable({ handles: "all"});' },
{ desc: 'Using proxy', source: '$("#simpleDiv").resizable({ handles: "all", proxy: "proxy" });' },
{ desc: 'Preserving ratio', source: '$("#simpleDiv").resizable({ handles: "all", aspectRatio: true, proxy: "proxy" });' },
{ desc: 'Autohide handles', source: '$("#simpleDiv").resizable({ handles: "all", autohide:true });' },
{ desc: 'Transparent handles', source: '$("#simpleDiv").resizable({ handles: "all", transparent: true, proxy: "proxy" });' },
{ desc: 'Pre-defined handles (e,w)', source: '$("#simpleDiv").resizable({ handles: "e,w" });' },
{ desc: 'Resize on a grid [50, 50]', source: '$("#simpleDiv").resizable({ handles: "all", grid: [50, 50] });' },
{ desc: 'Min/Max height and width', source: '$("#simpleDiv").resizable({ handles: "all", minWidth: 100, minHeight: 100, maxWidth: 250, maxHeight: 250 });' },
{ desc: 'Animated resizing', source: '$("#simpleDiv").resizable({ handles: "all", animate: true, animateDuration: "slow", animateEasing: "swing" });' },
{ desc: 'Knob handles (image cropper like)', source: '$("#simpleDiv").resizable({ handles: "all", knobHandles: true });' },
{ desc: 'Ghost resizing', source: '$("#simpleDiv").resizable({ handles: "all", ghost:true });' },
{ desc: 'Prevent default browser resize (safari textarea)', source: '$("#simpleDiv").resizable({ handles: "all", preventDefault: true });' },
{ desc: 'Preserve cursor on resize', source: '$("#simpleDiv").resizable({ handles: "all", preserveCursor: true });' },
{ desc: 'Using callbacks', source: '$("#simpleDiv").resizable({ handles: "all", start: function(e, ui) { $(this).append("<br>Start!") }, stop: function(e, ui) { $(this).append("<br>Stop!") }, resize: function(e, ui) { /*$(this).append("<br>Resize!");*/ } });' }
]
},
{
title: 'Image Resizing',
desc: 'Try resize images! You can play with the options listed below.',
html: '<img id="resizebleImage" src="templates/images/puppy.jpg" width="200px" height="135px">',
destroy: '$("#resizebleImage").resizable("destroy");',
options: [
{ desc: 'Ghost resizing', source: '$("#resizebleImage").resizable({ handles: "all", ghost:true });' },
{ desc: 'All handles', source: '$("#resizebleImage").resizable({ handles: "all"});' },
{ desc: 'Using proxy', source: '$("#resizebleImage").resizable({ handles: "all", proxy: "proxy" });' },
{ desc: 'Preserving ratio', source: '$("#resizebleImage").resizable({ handles: "all", aspectRatio: true, proxy: "proxy" });' },
{ desc: 'Autohide handles', source: '$("#resizebleImage").resizable({ handles: "all", autohide:true });' },
{ desc: 'Transparent handles', source: '$("#resizebleImage").resizable({ handles: "all", transparent: true, proxy: "proxy" });' },
{ desc: 'Pre-defined handles (e,w)', source: '$("#resizebleImage").resizable({ handles: "e,w" });' },
{ desc: 'Resize on a grid [50, 50]', source: '$("#resizebleImage").resizable({ handles: "all", grid: [50, 50] });' },
{ desc: 'Min/Max height and width', source: '$("#resizebleImage").resizable({ handles: "all", minWidth: 100, minHeight: 100, maxWidth: 250, maxHeight: 250 });' },
{ desc: 'Animated resizing', source: '$("#resizebleImage").resizable({ handles: "all", animate: true, animateDuration: "slow", animateEasing: "swing" });' },
{ desc: 'Knob handles (image cropper like)', source: '$("#resizebleImage").resizable({ handles: "all", knobHandles: true });' },
{ desc: 'Prevent default browser resize (safari textarea)', source: '$("#resizebleImage").resizable({ handles: "all", preventDefault: true });' },
{ desc: 'Preserve cursor on resize', source: '$("#resizebleImage").resizable({ handles: "all", preserveCursor: true });' },
{ desc: 'Using callbacks', source: '$("#resizebleImage").resizable({ handles: "all", start: function(e, ui) { $(this).append("<br>Start!") }, stop: function(e, ui) { $(this).append("<br>Stop!") }, resize: function(e, ui) { /*$(this).append("<br>Resize!");*/ } });' }
]
},
{
title: 'Textarea Resizing',
desc: 'Try to <b>resize textarea</b>! You can play with the options listed below.',
html: '<textarea id="resizebleTextarea">I am a textarea!</textarea>',
destroy: '$("#resizebleTextarea").resizable("destroy");',
options: [
{ desc: 'All handles', source: '$("#resizebleTextarea").resizable({ handles: "all"});' },
{ desc: 'Using proxy', source: '$("#resizebleTextarea").resizable({ handles: "all", proxy: "proxy" });' },
{ desc: 'Preserving ratio', source: '$("#resizebleTextarea").resizable({ handles: "all", aspectRatio: true, proxy: "proxy" });' },
{ desc: 'Autohide handles', source: '$("#resizebleTextarea").resizable({ handles: "all", autohide:true });' },
{ desc: 'Transparent handles', source: '$("#resizebleTextarea").resizable({ handles: "all", transparent: true, proxy: "proxy" });' },
{ desc: 'Pre-defined handles (e,w)', source: '$("#resizebleTextarea").resizable({ handles: "e,w" });' },
{ desc: 'Resize on a grid [50, 50]', source: '$("#resizebleTextarea").resizable({ handles: "all", grid: [50, 50] });' },
{ desc: 'Min/Max height and width', source: '$("#resizebleTextarea").resizable({ handles: "all", minWidth: 100, minHeight: 100, maxWidth: 250, maxHeight: 250 });' },
{ desc: 'Animated resizing', source: '$("#resizebleTextarea").resizable({ handles: "all", animate: true, animateDuration: "slow", animateEasing: "swing" });' },
{ desc: 'Knob handles (image cropper like)', source: '$("#resizebleTextarea").resizable({ handles: "all", knobHandles: true });' },
{ desc: 'Ghost resizing', source: '$("#resizebleTextarea").resizable({ handles: "all", ghost:true });' },
{ desc: 'Prevent default browser resize (safari textarea)', source: '$("#resizebleTextarea").resizable({ handles: "all", preventDefault: true });' },
{ desc: 'Preserve cursor on resize', source: '$("#resizebleTextarea").resizable({ handles: "all", preserveCursor: true });' },
{ desc: 'Using callbacks', source: '$("#resizebleTextarea").resizable({ handles: "all", start: function(e, ui) { $(this).append("<br>Start!") }, stop: function(e, ui) { $(this).append("<br>Stop!") }, resize: function(e, ui) { /*$(this).append("<br>Resize!");*/ } });' }
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,8 @@
<ul id="selectable-example" style="list-style:none; cursor: default;">
<li style='padding: 5px; border: 1px solid #bbb; margin: 3px;'>MacBook Pro</li>
<li style='padding: 5px; border: 1px solid #bbb; margin: 3px;'>iMac</li>
<li style='padding: 5px; border: 1px solid #bbb; margin: 3px;'>MacBook</li>
<li style='padding: 5px; border: 1px solid #bbb; margin: 3px;'>Time Capsule</li>
<li style='padding: 5px; border: 1px solid #bbb; margin: 3px;'>Apple Cinema Display</li>
<li style='padding: 5px; border: 1px solid #bbb; margin: 3px;'>Mac mini</li>
</ul>

View File

@ -0,0 +1,31 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Selectable Demos',
demos: [
{
title: 'Selectable',
desc: 'With few lines of code you could have selectable elements. You can try more options on the fly!',
html: { url: 'templates/ui.selectable.data.html' },
destroy: '$("#selectable-example").selectable("destroy");',
options: [
{ desc: 'Make a simple selectable list', source: '$("#selectable-example").selectable();' },
{ desc: 'Tolerance touch', source: '$("#selectable-example").selectable({ tolerance: "touch" });' }
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,44 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Slider Demos',
demos: [
{
title: 'Simple slider',
desc: 'With few lines of code you could build a slider. You can try more options on the fly!',
html: '<div id="slider3"><div class="ui-slider-handle"></div></div>',
destroy: '$("#slider3").sortable("destroy");',
options: [
{
desc: 'Make a simple slider',
source: '$("#slider3").slider();'
}
]
},
{
title: 'Multiple slides',
desc: 'You can also have multiples slides.',
html: '<div id="slider1" class="ui-slider-2"><div class="ui-slider-handle"></div><div class="ui-slider-handle" style="left:100px"></div></div>',
destroy: '$("#slider1").slider("destroy");',
options: [
{ desc: 'Multiple slides', source: '$("#slider1").slider();' }
//, { desc: 'Multiple slides with range', source: '$("#slider1").slider({ range: true });' }
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,40 @@
<div class="sortable-container">
<div id="example1">
<button onclick="$('#selectedUsers').sortable('enable')">Enable</button>
<button onclick="$('#selectedUsers').sortable('disable')">Disable</button>
<button onclick="alert($('#selectedUsers').sortable('serialize'))">Serialize!</button>
<button onclick="alert($('#selectedUsers').sortable('toArray'))">ID's to Array!</button>
<br><br>
<div id="sortable-ex" style="min-height: 110px; min-height:110px; height: auto !important;">
<div style="float: left;">
Selected users
<ul id="selectedUsers" style="cursor: hand; cursor: pointer;">
<li id='user_Susan'>Susan</li>
<li id='user_Beth'>Beth</li>
<li id='user_Bob'>Bob</li>
<li id='user_Edward'>Edward</li>
<li id='user_Kate'>Kate</li>
</ul>
</div>
<div style="float: left; margin-left: 50px;">
User list
<ul id="userList" style="cursor: hand; cursor: pointer;">
<li id='user_Jack'>Jack</li>
<li id='user_John'>John</li>
<li id='user_Marry'>Marry</li>
<li id='user_Claire'>Claire</li>
<li id='user_Daniel'>Daniel</li>
</ul>
</div>
<br style="clear: both;">
</div>
</div>
</div>

View File

@ -0,0 +1,19 @@
<div class="sortable-container">
<div id="example3">
<div style="min-height: 50px; min-height:50px; height:auto !important;">
<ul id="placeholderSortable" style="list-style-position: inside; height: 30px; cursor: hand; cursor: pointer;">
<li id='user_Jack' style="float: left;">Jack</li>
<li id='user_John' style="float: left;">John</li>
<li id='user_Marry' style="float: left;">Marry</li>
<li id='user_Claire' style="float: left;">Claire</li>
<li id='user_Daniel' style="float: left;">Daniel</li>
</ul>
</div>
</div>
</div>

View File

@ -0,0 +1,55 @@
<script type="text/javascript">
var model = {
onRenderEnd: function() {
$.ui.disableSelection($('#sortable-ex').get(0));
},
renderAt: '#containerDemo',
title: 'Sortable Demos',
demos: [
{
title: 'Sortable',
desc: 'With few lines of code you could have sortable elements. You can try more options on the fly!',
html: { url: 'templates/ui.sortable.ex1.html' },
destroy: '$("#selectedUsers").sortable("destroy");',
options: [
{
desc: 'Make a simple sortable list',
source:
'$("#selectedUsers").sortable({ connectWith: ["#userList"] }); ' +
'$("#userList").sortable({ connectWith: ["#selectedUsers"] });'
}
]
},
{
title: 'Sortable',
desc: 'Floating, with defined placeholder class',
html: { url: 'templates/ui.sortable.ex3.html' },
destroy: '$("#placeholderSortable").sortable("destroy");',
options: [
{
desc: 'Floating, with defined placeholder class',
source: '$("#placeholderSortable").sortable({ placeholder: "ui-selected", revert: true });'
}
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,35 @@
<div id="tabsEx1">
<input type="button" onclick="$('#tabsEx1 > ul').tabs('add', '#appended-tab', 'New Tab');" value="Add new tab">
<input type="button" onclick="$('#tabsEx1 > ul').tabs('add', '#inserted-tab', 'New Tab', 1);" value="Insert tab">
<input type="button" onclick="$('#tabsEx1 > ul').tabs('disable', 1);" value="Disable tab 2">
<input type="button" onclick="$('#tabsEx1 > ul').tabs('enable', 1);" value="Enable tab 2">
<input type="button" onclick="$('#tabsEx1 > ul').tabs('select', 2);" value="Select tab 3">
<br><br>
<ul style="height: 30px;">
<li><a href="#fragment-1"><span>One</span></a></li>
<li><a href="#fragment-2"><span>Two</span></a></li>
<li><a href="#fragment-3"><span>Three</span></a></li>
</ul>
<div id="fragment-1">
<p>First tab is active by default</p>
</div>
<div id="fragment-2">
<p><b>Second tab is active</b></p><br>
<p>Alternative ways to specify the active tab will overrule this argument, listed in the order of their precedence:</p><br>
<ol>
<li>If a fragment identifier (hash) in the URL of the page refers to the id of a tab panel of a tab interface the corresponding tab will become the initial tab.</li>
<li>Same if you use the cookie option to save the latest selected tab in.</li>
<li>Last not least you can set the selected tab by attaching the selected tab class
class (default: "ui-tabs-selected") to one of the <code>li</code> elements
representing a single tab.</li>
</ol>
</div>
<div id="fragment-3">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
</div>

View File

@ -0,0 +1,54 @@
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Tabs Demos',
demos: [
{
title: 'Simple Tabs',
desc: 'With few lines of code you could make tabs. You can try more options on the fly!',
html: { url: 'templates/ui.tabs.ex1.html' },
destroy: '$("tabsEx1 > ul").tabs("destroy");',
options: [
{
desc: 'First tab active by default',
source: '$("#tabsEx1 > ul").tabs();'
},
{
desc: 'Start With Custom Tab',
source: '$("#tabsEx1 > ul").tabs({selected:1});'
},
{
desc: 'Use a slide effect to switch tabs',
source: '$("#tabsEx1 > ul").tabs({ fx: { height: "toggle" } });'
},
{
desc: 'Use a fade effect to switch tabs',
source: '$("#tabsEx1 > ul").tabs({ fx: { opacity: "toggle" } });'
},
{
desc: 'Use a combined slide and fade effect to switch tabs',
source: '$("#tabsEx1 > ul").tabs({ fx: { height: "toggle", opacity: "toggle" } });'
},
{
desc: 'Define event to switch tabs (mouseover)',
source: '$("#tabsEx1 > ul").tabs({ event: "mouseover" });'
}
]
}
]
};
$(function(){
uiRenderDemo(model);
});
</script>

View File

@ -0,0 +1,88 @@
<style>
#divTabs, #divAddTabs {
height:30px;
}
</style>
<div id="containerDemo"></div>
<script type="text/javascript">
var model = {
renderAt: '#containerDemo',
title: 'Tabs Demos',
demos: [
{
title: 'Simple Tabs',
html: ['<div><ul id="divTabs" class="flora">',
'<li><a href="#tabs-fragment-1"><span>One</span></a></li>',
'<li><a href="#tabs-fragment-2"><span>Two</span></a></li>',
'<li><a href="#tabs-fragment-3"><span>Three</span></a></li>',
'</ul>',
'<div id="tabs-fragment-1">',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'</div>',
'<div id="tabs-fragment-2">',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'</div>',
'<div id="tabs-fragment-3">',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'</div></div>'].join(''),
destroy: '$("#divTabs").tabs("destroy");',
options: [
{ desc: 'Simple Tabs', source: '$("#divTabs").tabs();' },
{ desc: 'Simple Cloned Tabs', source: '$("#divTabs").clone().tabs();' },
{ desc: 'Simple Empty Tabs', source: '$("#divTabs").tabs();' },
{ desc: 'Simple Detached Tabs', source: '$("<div/>").tabs();' }
]
},
{
title: 'Add A Tab',
html: ['<div><ul id="divAddTabs" class="flora">',
'<li><a href="#addtabs-fragment-1"><span>One</span></a></li>',
'<li><a href="#addtabs-fragment-2"><span>Two</span></a></li>',
'<li><a href="#addtabs-fragment-3"><span>Three</span></a></li>',
'</ul>',
'<div id="addtabs-fragment-1">',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'</div>',
'<div id="addtabs-fragment-2">',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'</div>',
'<div id="addtabs-fragment-3">',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.',
'</div></div>'].join(''),
destroy: '$("#divAddTabs").tabs("destroy");',
options: [
{ desc: 'Simple Dialog', source: '$("#divAddTabs").tabs("add", "#", "Added");' }
]
},
]
};
$(window).load(function(){
uiRenderDemo(model);
});
</script>

455
tests/oldresizable.html Normal file
View File

@ -0,0 +1,455 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Resizables Test Page</title>
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
<script type="text/javascript" src="../ui/ui.resizable.js"></script>
<link rel="stylesheet" href="../themes/flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)" />
<style type="text/css" media="all">
body
{
background: #fff;
margin: 0;
padding: 0;
font-family: Arial;
font-size: 12px;
}
.proxy {
border: 1px dashed #000/*#3399ff*/;
/*background-color: #b7d3ef;*/
/*opacity: 0.3;
alpha: 0.3;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);*/
}
/*.ui-resizable-handle { position: absolute; background: #D0E3FC; display: none; }
.ui-resizable .ui-resizable-handle { display: block }
.ui-resizable-n { cursor: n-resize; height: 8px; left: 8px; right: 8px; }
.ui-resizable-e { cursor: e-resize; width: 8px; top: 8px; bottom: 8px; }
.ui-resizable-s { cursor: s-resize; height: 8px; left: 8px; right: 8px; }
.ui-resizable-w { cursor: w-resize; width: 8px; top: 8px; bottom: 8px; }
.ui-resizable-se { cursor: se-resize; width: 8px; height: 8px; }
.ui-resizable-sw { cursor: sw-resize; width: 8px; height: 8px; }
.ui-resizable-ne { cursor: ne-resize; width: 8px; height: 8px; }
.ui-resizable-nw { cursor: nw-resize; width: 8px; height: 8px; }
*/
#log {
right:0px;
top:0px;
background-color:#FAFCFE;
border:1px solid #DFE8F6;
height:400px;
width:300px;
position:absolute;
overflow:auto;
}
.ui-resizable-knob {
border: 1px #fff dashed;
}
</style>
</head>
<body >
<div id="log">log</div>
<div id='containment_parent' style='width: 400px; height: 300px; margin: 20px; position: relative; background:#F7FFEF;border:20px solid #E6F7D4; overflow:auto;'>
<div id='resizeme_containment' style='width: 200px; height: 100px; border: 1px solid black; position: absolute; background:#fff; padding:10px;'>
<div style='position: relative;'>Relative position, containment enabled.</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
<div style='width: 300px; height: 300px; margin: 20px; position: relative; background:#F7FFEF;border:0px solid #E6F7D4;'>
<img id="resizeme_containment_image" src="images/houses.jpg" style='width: 70px; height:70px;border: 0px solid #F0F1F3; margin: 0px;'>
</div>
<div id="resizeme_containment_div_wrapper" style='width: 460px; height: 306px; margin: 20px; position: relative; display: block; background:#F7FFEF;'>
<div id="resizeme_containment_wrap_image" style='width: 460px; height: 306px;background: transparent url(../../fx/images/very-cute-puppy.jpg) no-repeat scroll 0%;'></div>
<div id="resizeme_containment_div" style='top:0px; left:0px; width: 150px; height:150px; position: absolute; background: transparent url(../../fx/images/very-cute-puppy.jpg) no-repeat scroll 0px 0px;'></div>
</div>
<div style='width: 400px; height: 300px; margin: 20px; position: relative; background:#F7FFEF;border:2px solid #E6F7D4;'>
<textarea id='resizeme_containment_prop' style='width: 300px; height: 200px; margin: 0px; padding:0px; border:0px solid #ccc;'>
I was made resizable with this code only: $('#textarea').resizable();
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed leo. Proin commodo. Nullam nisl ipsum, sagittis sit amet, mattis id, aliquam ac, purus. Suspendisse dignissim lorem id odio. Duis tortor nisl, imperdiet placerat, accumsan eu, lacinia sit amet, mauris. Mauris tellus erat, ullamcorper in, faucibus ut, consectetuer quis, mi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean mollis lectus lacinia augue. Nam eget leo. Fusce magna. Etiam eros. Quisque eget dui. Donec fringilla, libero non rhoncus bibendum, nibh turpis varius orci, quis bibendum metus justo quis nibh. Proin blandit. Suspendisse feugiat consequat lectus. Etiam pharetra suscipit velit. Donec imperdiet quam sit amet erat pretium ullamcorper. Donec quis nisl vitae lacus accumsan faucibus. Vivamus velit turpis, tristique sit amet, malesuada id, molestie et, magna.
Nullam blandit, odio rutrum sagittis consectetuer, metus nulla malesuada eros, sit amet aliquam sem leo at augue. Quisque gravida. In et augue ac neque ultricies dictum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Ut est ante, egestas eget, dignissim quis, elementum vel, nunc. Suspendisse potenti. Suspendisse mattis feugiat ipsum. Proin at lorem sit amet erat auctor pharetra. Vivamus sit amet augue. Pellentesque consequat ligula in erat. In aliquam porttitor nisl. Donec sed quam. Aliquam accumsan mi nec diam. Etiam imperdiet vehicula nisl.
</textarea>
</div>
<div style='width: 300px; height: 200px; margin: 20px; position: relative;'>
<textarea id='textarea' style='width: 400px; height: 200px; margin: 0px; padding:0px; border:0px solid #ccc;'>
I was made resizable with this code only: $('#textarea').resizable();
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed leo. Proin commodo. Nullam nisl ipsum, sagittis sit amet, mattis id, aliquam ac, purus. Suspendisse dignissim lorem id odio. Duis tortor nisl, imperdiet placerat, accumsan eu, lacinia sit amet, mauris. Mauris tellus erat, ullamcorper in, faucibus ut, consectetuer quis, mi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean mollis lectus lacinia augue. Nam eget leo. Fusce magna. Etiam eros. Quisque eget dui. Donec fringilla, libero non rhoncus bibendum, nibh turpis varius orci, quis bibendum metus justo quis nibh. Proin blandit. Suspendisse feugiat consequat lectus. Etiam pharetra suscipit velit. Donec imperdiet quam sit amet erat pretium ullamcorper. Donec quis nisl vitae lacus accumsan faucibus. Vivamus velit turpis, tristique sit amet, malesuada id, molestie et, magna.
Nullam blandit, odio rutrum sagittis consectetuer, metus nulla malesuada eros, sit amet aliquam sem leo at augue. Quisque gravida. In et augue ac neque ultricies dictum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Ut est ante, egestas eget, dignissim quis, elementum vel, nunc. Suspendisse potenti. Suspendisse mattis feugiat ipsum. Proin at lorem sit amet erat auctor pharetra. Vivamus sit amet augue. Pellentesque consequat ligula in erat. In aliquam porttitor nisl. Donec sed quam. Aliquam accumsan mi nec diam. Etiam imperdiet vehicula nisl.
</textarea>
</div>
<div style='width: 300px; height: 200px; margin: 20px; position: relative; top:100px;'>
<img id="image" src="images/houses.jpg" style='width: 100px; height:200px;border: 0px solid #F0F1F3; margin: 0px;'>
</div>
<div style='width: 300px; height: 200px; margin: 20px; position: relative;top:30px;'>
<img id="image2" src="images/bamboo.jpg" style='width: 300px; height:100px;border: 2px solid #F0F1F3; margin: 0px;'>
</div>
<div style='width: 300px; height: 200px; margin: 20px; position: relative;top:30px;'>
<input id="input" type="text" value="Input text test" style='width:300px; height:50px;'>
</div>
<div id='resizeme' style='width: 300px; height: 200px; border: 1px solid black; margin: 20px; position: relative;'>
<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Relative position without proxy (w,nw,n automatically disabled)</div>
</div>
<div id='resizeme4' style='width: 300px; height: 200px; border: 1px solid black; margin: 20px; position: relative;'>
<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Relative position with proxy (all directions enabled, manual handlers)</div>
<div class='ui-resizable-n ui-resizable-handle'></div>
<div class='ui-resizable-e ui-resizable-handle'></div>
<div class='ui-resizable-s ui-resizable-handle'></div>
<div class='ui-resizable-w ui-resizable-handle'></div>
<div class='ui-resizable-se ui-resizable-handle'></div>
<div class='ui-resizable-sw ui-resizable-handle'></div>
<div class='ui-resizable-ne ui-resizable-handle'></div>
<div class='ui-resizable-nw ui-resizable-handle'></div>
</div>
<div id='resizeme2' style='width: 300px; height: 200px; border: 1px solid black; position: absolute; top: 100px; right: 400px;'>
<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'>Absolute position without proxy (all directions enabled)</div>
</div>
<div id='resizeme3' style='width: 300px; height: 200px; border: 1px solid black; position: relative; position: absolute; bottom: 20px; right: 20px;'>
<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'><b>Transparent axis</b><br>Absolute position with proxy (all directions enabled), ah, and I'm draggable, too!</div>
</div>
<div id='resizeme5' style='width: 300px; height: 200px; border: 1px solid black; position: relative; position: absolute; bottom: 20px; right: 550px;'>
<div style='position: absolute; top: 20px; left: 20px; bottom: 20px; right: 20px;'><b>Animated Resizing</b><br>Absolute position with proxy (all directions enabled), ah, and I'm draggable, too!<br><br>
$('#resizable5').resizable({ <br>animate: { opacity:.5, fontSize: '0.8em' }, <br>duration: 'slow', <br>easing: 'swing' <br>});
<br>
<button onclick="$('#resizeme5').resizable({ animate: true, animateDuration: 'slow', animateEasing: 'swing' });">Enable</button>
<button onclick="$('#resizeme5').resizable('destroy');">Disable</button>
</div>
</div>
<div id='resizeme6' style='position: relative;'>
<table border='1'><tr><td><div style="padding:10px;" id="tdResize">Resize-me!</div></td><td>Teste</td></td></tr></table>
</div>
<br><br><br><br>
<div class="package" id="pkg1" style="margin: 5px; padding: 20px; background-color: #eee; left: 15%; width: 40%;">
<div style="float: left; background-color: #ccc; width: 20%;">Package #1</div>
<div style="float: left; background-color: #f00; width: 80px;">$250.00</a></div>
</div>
<br>
<div class="package" id="pkg1" style="margin: 5px; padding: 20px; background-color: #eee; left: 167px; width: 236px;">
<div style="float: left; background-color: #ccc; width: 20%;">Package #1</div>
<div style="float: left; background-color: #f00; width: 80px;">$250.00</a></div>
</div>
<script type="text/javascript">
if(!window.console) {
window.console = {
log: function() {
$('#log').append(arguments[0]+"<br>");
$('#log').scrollTop(999999);
}
}
}
$(document).ready(function(){
$(".package").resizable({ handles: 'w, e', autohide: true, minWidth: 10, containment: 'parent'});
$('#tdResize').resizable();
$('#resizeme_containment_div').resizable({
containment: $('#resizeme_containment_div_wrapper'),
//proxy: 'proxy',
//ghost: true,
knobHandles: true,
//animate:true,
handles: 'all',
//transparent: true,
aspectRatio: true,
//autohide: true,
minWidth: 100,
minHeight: 100,
maxWidth: 250,
maxHeight: 250,
resize: function(e, ui) {
this.style.backgroundPosition = '-' + (ui.instance.position.left) + 'px -' + (ui.instance.position.top) + 'px';
},
stop: function(e, ui) {
this.style.backgroundPosition = '-' + (ui.instance.position.left) + 'px -' + (ui.instance.position.top) + 'px';
}
})
.draggable({
cursor: 'move',
containment: $('#resizeme_containment_div_wrapper'),
drag: function(e, ui) {
this.style.backgroundPosition = '-' + (ui.position.left) + 'px -' + (ui.position.top) + 'px';
}
});
$('#resizeme_containment_wrap_image').css({ opacity: 0.5 });
$('#resizeme_containment, #resizeme_containment_prop, #resizeme_containment_image').resizable({
proxy: "proxy",
handles: 'all',
//autohide: true,
minWidth: 50,
minHeight: 50,
//ghost: true,
//grid: [40,40],
start: function() {
//console.log('start')
},
resize: function() {
//console.log('resize')
},
stop: function() {
//console.log('stop')
},
//containment: 'document',
//containment:$('#containment_parent'),
containment:'parent',
//aspectRatio: 'preserve',
preventDefault: true,
preserveCursor: true,
disableSelection: true
});
$('#textarea').resizable({
//proxy: "proxy",
handles: 'all',
ghost: true,
autohide: true,
maxHeight: 500,
maxWidth: 500,
minWidth: 100,
minHeight: 50,
grid: [50, 50],
animate: true,
//containment: document,
containment: 'document',
//aspectRatio: 'preserve',
preventDefault: true,
preserveCursor: true,
disableSelection: true
});
$('#image').resizable({
proxy: "proxy",
handles: 'all',
minWidth: 50,
minHeight: 50,
//grid: [50, 50],
ghost: 'ghost',
knobHandles: true,
animate: true,
maxHeight: 400,
maxWidth: 400,
//containment: 'parent',
aspectRatio: 'preserve',
autohide: true
});
$('#image2').resizable({
proxy: "proxy",
handles: 'all',
//containment: 'parent',
minWidth: 50,
minHeight: 50,
maxHeight: 200,
maxWidth: 400,
animate: true,
animateDuration: 'slow',
animateEasing: 'swing',
aspectRatio: 'preserve'
//aspectRatio: false
//aspectRatio: 1.1
});
$('#input').resizable({
proxy: "proxy",
handles: 'e,se,s',
//ghost: true,
//containment: 'parent',
aspectRatio: 'preserve'
});
$('#resizeme, #resizeme2').resizable({
//proxy: "proxy",
minWidth: 200,
minHeight: 100,
//maxWidth: 500,
//maxHeight: 300,
start: function(e,ui) {
//console.log('start ', ui);
},
stop: function(e,ui) {
//console.log('stop ', ui);
},
resize: function(e,ui) {
//console.log(e);
},
alsoResize: [ "#resizeme3" ]
});
$('#resizeme3').resizable({
//proxy: "proxy",
minWidth: 200,
minHeight: 100,
maxWidth: 500,
maxHeight: 300,
transparent: true,
handles: "s, se, e",
preventDefault: true,
start: function(e,ui) {
//console.log('start ', ui);
},
stop: function(e,ui) {
//console.log('stop ', ui);
},
resize: function(e,ui) {
//console.log(e);
}
});
$('#resizeme5').resizable({
//proxy: "proxy",
minWidth: 200,
minHeight: 100,
maxWidth: 500,
maxHeight: 300,
ghost: true,
handles: "all",
preventDefault: true,
//animate: true,
//animate: false,
animate: true,
animateDuration: 'slow',
animateEasing: 'swing',
start: function(e,ui) {
//console.log('start ', ui);
},
stop: function(e,ui) {
//console.log('stop ', ui);
},
resize: function(e,ui) {
//console.log(e);
}
});
$('#resizeme4').resizable({
proxy: "proxy",
minWidth: 200,
minHeight: 100,
//maxWidth: 500,
//maxHeight: 300,
handles: {
n: '.ui-resizable-n',
e: '.ui-resizable-e',
s: '.ui-resizable-s',
w: '.ui-resizable-w',
se: '.ui-resizable-se',
sw: '.ui-resizable-sw',
ne: '.ui-resizable-ne',
nw: '.ui-resizable-nw'
},
start: function(e,ui) {
//console.log('start ', ui);
},
stop: function(e,ui) {
//console.log('stop ', ui);
},
resize: function(e,ui) {
//console.log(e);
}
});
$('#resizeme3, #resizeme5, .ui-wrapper:parent').draggable({ handle: "div:not(.ui-resizable-handle)" });
//$('#resizeme_containment').draggable({containment: 'parent'});
//$("#resizeme3").animate({ height: 500, width: 500, opacity: 'hide' }, "easein");
});
</script>
</body>
</html>

View File

@ -0,0 +1,83 @@
<!DOCTYPE html>
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
<script type="text/javascript" src="../ui/ui.resizable.js"></script>
<script>
$(function() {
$("#userList").sortable({
connectWith: ["#selectedUsers"]
});
$("#selectedUsers").sortable({
connectWith: ["#userList"]
});
});
</script>
<style>
body {
font-family: arial;
font-size: 12px;
}
ul {
margin:0; padding: 5px;
list-style: none;
background: #efefef;
}
li {
width: 100px;
padding: 10px; margin: 5px;
background: lightblue;
}
</style>
<div class="sortable-container">
<div id="example1">
<button onclick="$('#selectedUsers').sortable('enable')">Enable</button>
<button onclick="$('#selectedUsers').sortable('disable')">Disable</button>
<button onclick="alert($('#selectedUsers').sortable('serialize'))">Serialize!</button>
<button onclick="alert($('#selectedUsers').sortable('toArray'))">ID's to Array!</button>
<br><br>
<div id="sortable-ex" style="min-height: 110px; min-height:110px; height: auto !important;">
<div style="float: left;">
Selected users
<ul id="selectedUsers" style="cursor: hand; cursor: pointer;">
<li id='user_Susan'>Susan</li>
<li id='user_Beth'>Beth</li>
<li id='user_Bob'>Bob</li>
<li id='user_Edward'>Edward</li>
<li id='user_Kate'>Kate</li>
</ul>
</div>
<div style="float: left; margin-left: 50px;">
User list
<ul id="userList" style="cursor: hand; cursor: pointer;">
<li id='user_Jack'>Jack</li>
<li id='user_John'>John</li>
<li id='user_Marry'>Marry</li>
<li id='user_Claire'>Claire</li>
<li id='user_Daniel'>Daniel</li>
</ul>
</div>
<br style="clear: both;">
</div>
</div>
</div>

61
tests/test.html Normal file
View File

@ -0,0 +1,61 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>jQuery UI Resizable Containment Bug</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style>
#container {
width: 900px;
text-align: center;
margin: auto;
border: 2px solid black;
position: relative;
}
#resizable {
position: absolute;
width: 120px;
height: 120px;
border: 2px solid green;
top: 200px;
left: 300px;
z-index: 100;
zoom:1;
}
.proxy {
border:1px solid red;
}
</style>
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
<script type="text/javascript" src="../ui/ui.resizable.js"></script>
<script type="text/javascript">
$(function() {
$('#resizable').resizable({
handles: 'all',
ghost: true,
knobHandles: true,
proxy: 'proxy',
containment: $('#containment')
}).
parent().draggable({
containment: $('#containment')
});
})
</script>
</head>
<body>
<div id="container">
<img src="http://images.packtpub.com/images/full/1847192505.jpg" id="resizable" width="100px" height="100px">
<img src="http://images.packtpub.com/images/full/1847192505.jpg" id="containment">
</div>
</body>
</html>