Permalink
Browse files

Added a new plugin ($.tmpl) instead of overloading the String prototy…

…pe (corss-library compatibility)

Modified the localisation strings to work with $.tmpl
Added getters/setters + added a new error message (option readonly)
Modified the demo page to display API and make it more dynamic (fixed some links also)
Added some styles (needs to be cleaned)
Added form.php to catch form actions and return feedback
  • Loading branch information...
1 parent 46ec432 commit e63317f265bd2f226d8743065a3d132829a94969 Yanick Rochon committed Jun 5, 2009
Showing with 1,136 additions and 208 deletions.
  1. +133 −54 css/common.css
  2. +40 −0 form.php
  3. +753 −42 index.html
  4. +4 −3 js/locale/ui.multiselect-en.js
  5. +4 −3 js/locale/ui.multiselect-es.js
  6. +4 −3 js/locale/ui.multiselect-fr.js
  7. +58 −17 js/page.js
  8. +38 −0 js/plugins/tmpl/jquery.tmpl.1.1.1.js
  9. +102 −86 js/ui.multiselect.js
View
@@ -1,55 +1,134 @@
- /*
- Copyright (c) 2007, Yahoo! Inc. All rights reserved.
- Code licensed under the BSD License:
- http://developer.yahoo.net/yui/license.txt
- version: 2.2.0
- */
- body {font:13px 'Helvetica',arial,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
- body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}/*ol,ul {list-style:none;}*/caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
-
- /* end of yahoo reset and fonts */
-
- body {color:#333; background: #232f2e; line-height:1.3;}
- p {margin:0 0 20px;}
- a {color:#636363;}
- a:hover {text-decoration:none;}
- strong {font-weight:bold;}
- em {font-style: italic;}
- h1,h2,h3,h4,h5,h6 {font-weight:bold;}
- h1 {font-size:197%; margin:30px 0; color: #4f6f6c;}
- h2 {font-size:174%; margin:20px 0; color:#4f6f6c;}
- h3 {font-size:152%; margin:10px 0;}
- h4 {font-size:129%; margin:10px 0;}
- pre {background:#eee; margin:0 0 20px; padding:20px; border:1px solid #ccc; font-size:100%; overflow:auto;}
- code {font-size:100%; margin:0; padding:0;}
- ul, ol {margin:10px 0 10px 25px;}
- ol li {margin:0 0 10px;}
-
- div#wrapper {background:#fff; width:560px; margin:0 auto; padding:20px; border:10px solid #0f1616; border-width:0 10px 10px 10px;}
- div#header {position:relative; border-bottom:1px dotted; margin:0 0 10px; padding:0 0 10px;}
- div#header p {margin:0; padding:0;}
- div#header h1 {margin:0; padding:0;}
- ul#nav {position:absolute; top:0; right:0; list-style:none; margin:0; padding:0;}
- ul#nav li {display:inline; padding:0 0 0 5px;}
- ul#nav li a {}
- div#content {}
- div#footer {margin:40px 0 0; border-top:1px dotted; padding:10px 0 0;}
- .left {float:left;}
- .right {float:right;}
- .clear {clear:both;}
-
- dt { font-weight: bold; font-size: 110%; padding-bottom: 10px; }
- dd { margin-left: 20px; padding-bottom: 20px; }
-
- /* multiselect styles */
- .multiselect {
- width: 460px;
- height: 150px;
- }
-
- #switcher {
- margin-top: 20px;
- }
-
- form {margin: 0; padding: 0;}
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.2.0
+*/
+body {font:13px 'Helvetica',arial,clean,sans-serif;*font-size:small;*font:x-small;}
+table {font-size:inherit;font:100%;}
+select,input,textarea {font:99% arial,helvetica,clean,sans-serif;}
+pre,code {font:115% monospace;*font-size:100%;}
+body * {line-height:1.22em;}
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {margin:0;padding:0;}
+table {border-collapse:collapse;border-spacing:0;}
+fieldset,img {border:0;}
+address,caption,cite,code,dfn,em,strong,th,var {font-style:normal;font-weight:normal;}
+/*ol,ul {list-style:none;}*/
+caption,th {text-align:left;}
+h1,h2,h3,h4,h5,h6 {font-size:100%;font-weight:normal;}
+q:before,q:after {content:'';}
+abbr,acronym {border:0;}
+
+/* end of yahoo reset and fonts */
+
+body {color:#333; background: #232f2e; line-height:1.3;}
+p {margin:0 0 20px;}
+a {color:#636363;}
+a:hover {text-decoration:none;}
+strong {font-weight:bold;}
+em {font-style: italic;}
+h1,h2,h3,h4,h5,h6 {font-weight:bold;}
+h1 {font-size:197%; margin:30px 0; color: #4f6f6c;}
+h2 {font-size:174%; margin:20px 0; color:#4f6f6c;}
+h3 {font-size:152%; margin:10px 0;}
+h4 {font-size:129%; margin:10px 0;}
+pre {background:#eee; margin:0 0 20px; padding:20px; border:1px solid #ccc; font-size:100%; overflow:auto;}
+code {font-size:100%; margin:0; padding:0;}
+ul, ol {margin:10px 0 10px 25px;}
+ol li {margin:0 0 10px;}
+
+iframe {width:100%; height: 200px; background: #eef; color: black;}
+
+div#wrapper {background:#fff; width:640px; margin:0 auto; padding:20px; border:10px solid #0f1616; border-width:0 10px 10px 10px;}
+div#header {position:relative; border-bottom:1px dotted; margin:0 0 10px; padding:0 0 10px;}
+div#header p {margin:0; padding:0;}
+div#header h1 {margin:0; padding:0;}
+ul#nav {position:absolute; top:0; right:0; list-style:none; margin:0; padding:0;}
+ul#nav li {display:inline; padding:0 0 0 5px;}
+ul#nav li a {}
+div#content {}
+div#footer {margin:40px 0 0; border-top:1px dotted; padding:10px 0 0;}
+.left {float:left;}
+.right {float:right;}
+.clear {clear:both;}
+
+dt {font-weight: bold; font-size: 110%; padding-bottom: 10px;}
+dd {margin-left: 20px; padding-bottom: 20px;}
+
+/* multiselect styles */
+.multiselect {width: 460px; height: 150px;}
+
+#switcher {margin-top: 20px;}
+
+form {margin: 0; padding: 0;}
+
+.externalControlsWrapper {margin-top: 10px; margin-bottom: 20px;}
+.externalControlsWrapper .optionWrapper {vertical-align: middle; overflow: auto; width: 100%; margin-bottom: 10px;}
+.externalControlsWrapper a {font-size: 90%;}
+.externalControls {margin-top: 10px; border: 1px solid #bbb; background: #eee;}
+.externalControls .optionLabel {width: 160px;}
+.externalControls .optionInput {float: right; width: 280px;}
+
+/* JQuery API CSS */
+
+
+h2.top-header { color: #FFFFFF; margin: 0 0 20px 0 !important; padding: 5px 10px !important; background: #0F67A1; font-size: 15px; -moz-border-radius: 2px; text-transform: none; }
+ul.options-list a,
+ul.methods-list a {
+ font-size: 14px;
+ color: #0f67a1;
+ text-decoration: underline;
+}
+ul.options-list a:hover,
+ul.methods-list a:hover {
+ color: #176092;
+ text-decoration: underline;
+}
+
+
+.UIAPIPlugin #options h2,
+.UIAPIPlugin #events h2,
+.UIAPIPlugin #methods h2,
+.UIAPIPlugin #theming h2 { color: #FFFFFF; margin: 0 0 20px 0 !important; padding: 5px 10px !important; background: #0F67A1; font-size: 15px; -moz-border-radius: 2px; text-transform: none; }
+
+ul.options-list,
+ul.options-list li.option { margin: 0; padding: 0; list-style-type: none; list-style-image: none; }
+ul.options-list { margin-left: 6px; }
+ul.options-list li.option { padding-bottom: 10px !important; }
+ul.options-list li.option dl,
+ul.options-list li.option dt,
+ul.options-list li.option dd { margin: 0; padding: 0; }
+ul.options-list li.option .option-header { width: 100%; float: left; background-color: #E2EDF4 !important; }
+ul.options-list li.option .option-header .option-name { margin: 0 !important; padding: 0 !important; width: 35%; float: left; background-color: #E2EDF4 !important; }
+ul.options-list li.option .option-header dt,
+ul.options-list li.option .option-header dd { margin: 0; padding: 0; float: left; width: 18%; }
+ul.options-list li.option .option-header dt.option-type-label { display: none; }
+ul.options-list li.option .option-header dt.option-default-label { text-align: right; padding-right: 0.4em; color: #666666; }
+ul.options-list li.option .option-description { clear: left; padding: 5px 10px 0 10px; }
+ul.options-list li.option .option-examples-list dt p { line-height: 1.5 !important; margin: 0 !important; padding: 5px 0 !important; color: #666666; }
+ul.options-list li.option .option-examples-list dd pre { margin: 0 !important; }
+ul.options-list li.option .option-examples-list { padding: 0 10px; }
+ul.options-list li.option .option-examples-list dd { margin-left: 10px; }
+ul.options-list li.option .option-examples-list dd pre code { background: none; }
+
+ul.events-list,
+ul.events-list li.events { margin: 0; padding: 0; list-style-type: none; list-style-image: none; }
+ul.events-list { margin-left: 6px; }
+ul.events-list li.event { padding-bottom: 10px !important; }
+ul.events-list li.event dl,
+ul.events-list li.event dt,
+ul.events-list li.event dd { margin: 0; padding: 0; }
+ul.events-list li.event .event-header { width: 100%; float: left; background-color: #E2EDF4 !important; }
+ul.events-list li.event .event-header .event-name { margin: 0 !important; padding: 0 !important; width: 25%; float: left; background-color: #E2EDF4 !important; }
+ul.events-list li.event .event-header dt,
+ul.events-list li.event .event-header dd { margin: 0; padding: 0; float: left; width: 23%; }
+ul.events-list li.event .event-header dt.event-type-label { width: 10%; }
+ul.events-list li.event .event-header dt.event-default-label { text-align: right; padding-right: 0.5em; color: #666666; }
+ul.events-list li.event .event-description { clear: left; padding: 5px 10px 0 10px; }
+ul.events-list li.event .event-examples-list dt p { line-height: 1.5 !important; margin: 0 !important; padding: 5px 0 !important; color: #666666; }
+ul.events-list li.event .event-examples-list dd pre { margin: 0 !important; }
+ul.events-list li.event .event-examples-list { padding: 0 10px; }
+ul.events-list li.event .event-examples-list dd { margin-left: 10px; }
+ul.events-list li.event .event-examples-list dd pre code { background: none; }
+
View
@@ -0,0 +1,40 @@
+<?php
+@session_start();
+
+header('Content-type: text/plain; charset:utf-8');
+
+// ignore these fields in the $_REQUEST
+$ignoredKeys = array('PHPSESSID', 'jquery-ui-theme', 'reset');
+$formData = array();
+foreach ($_REQUEST as $key => $value) {
+ if (!in_array($key, $ignoredKeys) ) {
+ $formData[$key] = $value;
+ }
+}
+
+if (empty($formData) || isset($_REQUEST['reset'])) {
+
+ echo "Waiting form submission...";
+
+} else {
+
+ echo date('Y-m-d g:i:s', time()) . ' - '
+ . "The form has submitted the following values :\n\n";
+
+ foreach ($formData as $fieldName => $value) {
+ if (is_array($value)) {
+ $valueData = $value;
+ $value = '';
+ foreach ($valueData as $data) {
+ $value .= (!empty($value) ? ', ' : '') . $data;
+ }
+ }
+
+ echo "Field : " . $fieldName . "\n"
+ . "Value : " . $value . "\n\n";
+ }
+
+ echo "\n"
+ . "Done.";
+
+}
Oops, something went wrong.

0 comments on commit e63317f

Please sign in to comment.