Commit 27adf326 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

commit a prototype of the new UI using RenderJS.

parent 6cb4e6c6
.bold {
font-weight: bold;
}
.note {
font-weight: bold;
display: block;
}
.center {
display: block;
text-align: center;
}
.left {
display: block;
text-align: left;
}
.right {
display: block;
text-align: right;
}
.starred {
color: #0FBABD;
}
.large {
font-size: 125%;
}
.ui-popup .file {
max-width: 70%;
}
.inline {
max-width: 50%;
margin: 0 auto;
}
.inline a.ui-btn:after {
font-size: .9em;
}
@media (max-width: 40em) {
.inline {
max-width: 70%;
margin: 0 auto;
}
}
.alert {
color: red;
font-weight: bold;
}
.alert textarea {
color: red !important;
font-weight: normal;
}
.alert label {
display: block;
width: 100%;
float: none;
}
tbody .alert,
tbody .proceed,
tbody .large {
display: block;
text-align: center
}
@media (max-width: 40em) {
tbody .alert,
tbody .proceed {
font-size: 1.5em;
}
}
.proceed {
color: #0FBABD;
font-weight: bold;
}
.static {
cursor: default;
}
.input_board {
margin: 0;
}
.input_board .ui-controlgroup-controls {
width: 100%;
}
.input_board .ui-controlgroup-controls .ui-input-text input {
box-shadow: 0 0 2px #999999 inset;
-webkit-box-shadow: 0 0 2px #999999 inset;
}
.button_board {
text-align: center;
}
a.confirm, a.action {
font-weight: bold !important;
}
.profile {
display: inline-block;
border: 1px solid;
}
@media (max-width: 40em) {
.profile {
margin-top: 1em;
}
}
.profile img {
padding-right: 1em;
float: left;
vertical-align: middle;
max-width: 120px;
}
.tag {
margin: 0;
font-size: 200%;
}
/* Modified on BASE */
.mini {
font-size: 80%;
}
@media (max-width: 40em) {
.tag {
margin: 0;
font-size: 150%;
}
}
.downloads:before {
content: "·";
}
.inline-icon {
padding: 0 .5em;
}
.logo_wrap {
margin-top: 0em;
margin-bottom: 2em;
padding: 0.5em;
text-align: center;
}
.logo_wrap img {
max-height: 8em;
}
@media (max-width: 40em) {
.logo_wrap {
margin-top: 1em;
margin-bottom: 1em;
}
.logo_wrap img {
max-height: 7em;
}
}
@media (max-width: 30em) {
.logo_wrap {
margin-top: .5em;
margin-bottom: .5em;
}
}
@media (max-width: 20em) {
.logo_wrap {
margin-top: .25em;
margin-bottom: .25em;
}
}
/* custom signin buttons: thx Zocial http://zocial.smcllns.com/ */
.signin_google,
.signin_google:visited {
background: #DD4B39 !important;
color: #fff !important;
text-shadow: none !important;
cursor: pointer !important;
}
.signin_fb,
.signin_fb:visited {
background: #4863ae !important;
color: #fff !important;
text-shadow: none !important;
cursor: pointer !important;
}
.signin_fb:hover,
.signin_fb:active,
.signin_fb.ui-btn-active,
.signin_google:hover,
.signin_google:active,
.signin_google.ui-btn-active {
background-image: -webkit-gradient(linear, center bottom, center top, from(rgba(255, 255, 255, 0.1)), color-stop(0.30, rgba(255, 255, 255, 0)), to(rgba(0, 0, 0, 0.1))) !important;
background-image: -webkit-linear-gradient(center bottom , rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, transparent 50%, rgba(0, 0, 0, 0.1)) !important;
background-image: -ms-linear-gradient(center bottom , rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, transparent 50%, rgba(0, 0, 0, 0.1)) !important;
background-image: -moz-linear-gradient(center bottom , rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, transparent 50%, rgba(0, 0, 0, 0.1)) !important;
background-image: -o-linear-gradient(center bottom , rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, transparent 50%, rgba(0, 0, 0, 0.1)) !important;
background-image: linear-gradient(center bottom , rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 30%, transparent 50%, rgba(0, 0, 0, 0.1)) !important;
}
.signin_google:focus,
.signin_google.ui-focus
.signin_fb:focus,
.signin_fb.ui-focus {
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
.popup_element {
padding-top: .75em;
padding-left: .75em;
padding-right: .75em;
}
.popup_element p {
margin-bottom: 0.15em;
}
.content_element {
display: inline-block;
vertical-align: top;
width: 45%;
padding-left: 2%;
padding-right: 2%;
/* ~ 98% for 2 col layout */
padding-top: 2%;
}
.content_element_fullscreen {
width: 96% /* 2% padding-left/right */
}
/* is this padding really necessary? */
.content_element .ui-controlgroup-vertical,
.content_element .ui-controlgroup-horizontal,
.content_element form {
margin-top: 1em;
margin-bottom: 1em;
vertical-align: middle;
}
@media (max-width: 40em) {
.content_element {
width: 100%;
padding: 0;
}
}
.content_element .ui-input-search {
width: 50%;
}
@media (max-width: 45em) {
.content_element .ui-input-search {
width: 60%;
}
}
@media (max-width: 30em) {
.content_element .ui-input-search {
width: 65%;
}
}
@media (max-width: 20em) {
.content_element .ui-input-search{
width: 70%;
}
}
.panel .ui-panel-inner .panel_element {
margin-left: -1em;
margin-right: -1em;
}
.panel .ui-panel-inner .panel_element.panel_element_first {
margin-top: -1em;
}
.panel .ui-panel-inner .panel_element.panel_element_last {
margin-bottom: -1em;
}
.panel .panel_element.panel_header {
border-width: 0;
padding-top: 1px;
top: -1px;
}
/* navbar */
.navbar ul li a.ui-btn-active.clone_item span.navbar_clone {
font-weight: bold;
}
div.ui-content > iframe {
height: 500px;
min-width: 1300px;
}
div.ui-content2 > iframe {
height: 500px;
min-width: 1300px;
}
\ No newline at end of file
/* =========================== action button ========================*/
.ui-input-search-no-pseudo:after {
content: none;
}
.ui-input-has-action {
position: relative;
}
.ui-input-search .ui-input-action,
.ui-input-text .ui-input-action {
position: absolute;
right: 0;
top: 50%;
margin: -15px .3125em 0;
border: 0;
background-color: transparent;
}
.ui-input-has-action.ui-input-has-clear input {
padding-left: 0.25em;
padding-right: 4.5em;
}
.ui-input-has-action.ui-input-has-clear .ui-input-clear {
right: 2em !important;
}
html body .ui-input-search .ui-input-action:after,
html body .ui-input-text .ui-input-action:after {
margin-top: -12px;
}
html body .ui-input-search .ui-input-action:hover,
html body .ui-input-text .ui-input-action:hover,
html body .ui-input-search .ui-input-action:active,
html body .ui-input-text .ui-input-action:active {
background: transparent;
background-image: none;
-webkit-box-shadow: none /* iOS3 */ !important;
box-shadow: none /* iOS3 */ !important;
}
/* =========================== carousel widget ========================*/
.ui-carousel {
list-style: none outside none;
margin: 0 auto;
padding: 0;
position: relative;
text-align: center;
width: auto;
min-height: 25em;
overflow: hidden; /* firefox seems the only browser to properly overflow-hide round corners... */
margin: 0 -15px;
}
.ui-carousel-inset {
margin: 1em auto;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
border-radius: 1em;
}
.ui-carousel li {
list-style: none;
width: 100%;
position: absolute;
display: none;
height: 100%;
-webkit-border-radius: inherit;
-moz-border-radius: inherit;
border-radius: inherit;
overflow: inherit;
min-height: inherit;
}
.ui-carousel li.ui-carousel-transitioning {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.ui-carousel li.ui-carousel-active {
display: block;
}
.ui-carousel li a {
height: inherit;
-webkit-border-radius: inherit;
-moz-border-radius: inherit;
border-radius: inherit;
overflow: inherit;
min-height: inherit;
}
.ui-carousel img {
width: 100%;
display: block;
-webkit-border-radius: inherit;
-moz-border-radius: inherit;
border-radius: inherit;
min-height: inherit;
}
.ui-carousel-controls {
text-align: center;
}
.ui-carousel-controls .ui-radio {
display: inline-block;
padding: 0 0.25em;
}
.ui-carousel-controls .ui-radio input:checked {
border: 1px solid red !important;
}
.ui-carousel-captions .ui-carousel-captions-heading {
margin: 0;
padding: 0;
}
.ui-carousel-captions-content {
left: 0;
margin: 0;
padding: 0.5em 0;
position: absolute;
right: 0;
}
.ui-carousel-captions-bottom {
bottom: 0;
}
.ui-carousel-captions-top {
top: 0;
}
@media (max-width: 77.5em) {
.ui-carousel.ui-responsive {
max-width: 80%;
}
}
@media (max-width: 45em) {
.ui-carousel.ui-responsive {
max-width: 85%;
}
}
@media (max-width: 40em) {
.ui-carousel.ui-responsive {
max-width: 90%;
}
}
@media (max-width: 30em) {
.ui-carousel.ui-responsive {
max-width: 90%;
}
}
@media (max-width: 20em) {
.ui-carousel.ui-responsive {
max-width: 90%;
}
}
/* font-size */
html table.ui-table {
font-size: 90%;
}
html div.ui-table-wrapper-top > *,
html div.ui-table-wrapper-bottom > *,
html div.ui-collapsible-set {
font-size: 100%;
}
@media (min-width: 40em) {
html table.ui-table {
font-size: 80%;
}
html div.ui-table-wrapper-top > *,
html div.ui-table-wrapper-bottom > *,
html div.ui-collapsible-set {
font-size: 90%;
}
html table thead th a.ui-btn {
font-size: 100%;
}
}
/* shrink icon font-size (should not be set here...) */
.ui-page .ui-table-wrapper-top .ui-btn[class*="ui-icon-"]:after ,
.ui-page .ui-table-wrapper-bottom .ui-btn[class*="ui-icon-"]:after,
.ui-page .ui-table-wrapper-top .ui-btn[class*="ui-icon-"]:after,
.ui-page .ui-table-wrapper-bottom .ui-btn[class*="ui-icon-"]:after,
html div.ui-collapsible-set h1 .ui-btn[class*="ui-icon-"]:after{
font-size: 125%;
margin-top: -9px;
}
html table.ui-table tbody td a,
html table.ui-table tbody th a {
text-decoration: none;
font-weight: normal;
}
html table.ui-table tbody td:hover a,
html table.ui-table tbody th:hover a {
text-decoration: underline;
}
/* override JQM */
html table.ui-table {
width: 100.15%;
border: 0 none;
border-left: 1px solid;
border-right: 1px solid;
}
html table td, html table th {
padding: 0px !important;
}
/* checkbox cells */
html table th .ui-checkbox .ui-btn,
html table th .ui-checkbox .ui-btn,
html table td .ui-checkbox .ui-btn,
html table td .ui-checkbox .ui-btn {
border: 0 none;
border-radius: 0 0 0 0;
box-shadow: none !important;
height: inherit;
padding-bottom: 0.5em;
padding-top: 0.5em;
width: 100%;
}
html table th .ui-checkbox .ui-btn.ui-btn-icon-notext.ui-icon-checkbox-on:after,
html table th .ui-checkbox .ui-btn.ui-btn-icon-notext.ui-icon-checkbox-off:after,
html table td .ui-checkbox .ui-btn.ui-btn-icon-notext.ui-icon-checkbox-on:after,
html table td .ui-checkbox .ui-btn.ui-btn-icon-notext.ui-icon-checkbox-off:after {
margin-left: -.5em;
}
html table tr th .ui-checkbox input,
html table tr td .ui-checkbox input {
position: absolute !important;
top: -9999px;
left: -9999px;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px 1px 1px 1px);
}
html table tr th .ui-checkbox,
html table tr td .ui-checkbox {
margin: 0;
min-width: 1em;
padding: 0;
height: inherit;
position: static;
}
/* top radii - can use :first/last-child, because IE can't do corners anyway */
/* inherit = 0!, not inheriting = radius */
.ui-table-wrapper-top.ui-table-wrapper-inset,
.ui-table-wrapper-top.ui-table-wrapper-inset * {
-webkit-border-bottom-right-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
border-bottom-left-radius: 0;
}
/* first grid and button get top left */
.ui-table-wrapper-top.ui-table-wrapper-inset > div:first-child,
.ui-table-wrapper-top.ui-table-wrapper-inset > div:first-child .ui-btn,
.ui-table-wrapper-top.ui-table-wrapper-inset > div:first-child .ui-select {
border-radius: inherit;
-webkit-border-radius: inherit;
border-top-right-radius: 0;
-webkit-border-top-right-radius: 0;
}
/* last grid and button get top right */
.ui-table-wrapper-top.ui-table-wrapper-inset > div:last-child,
.ui-table-wrapper-top.ui-table-wrapper-inset > div:last-child .ui-btn,
.ui-table-wrapper-top.ui-table-wrapper-inset > div:last-child .ui-select {
border-radius: 0;
-webkit-border-radius: 0;
border-top-right-radius: inherit;
-webkit-border-top-right-radius: inherit;
}
/* bottom radii */
.ui-table-wrapper-bottom.ui-table-wrapper-inset,
.ui-table-wrapper-bottom.ui-table-wrapper-inset * {
-webkit-border-top-right-radius: 0;
border-top-right-radius: 0;
-webkit-border-top-left-radius: 0;
border-top-left-radius: 0;
}
/* first grid and button get bottom left */
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:first-child,
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:first-child .ui-btn,
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:first-child .ui-select {
border-radius: inherit;
-webkit-border-radius: inherit;
border-bottom-right-radius: 0;
-webkit-border-bottom-right-radius: 0;
}
/* last grid and button get bottom right */
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:last-child,
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:last-child .ui-btn,
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:last-child .ui-select {
border-radius: 0;
-webkit-border-radius: 0;
border-bottom-right-radius: inherit;
-webkit-border-bottom-right-radius: inherit;
}
/* and overwrite again for controlgroups... */
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-btn,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-btn,
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-select,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-select {
border-radius: 0;
-webkit-border-radius: 0;
}
/* table wrappers */
.ui-table-wrapper-top, .ui-table-wrapper-bottom {
min-height: 25px;
width: 100%;
vertical-align: middle;
border-style: solid;
-webkit-box-shadow: none /* iOS3 */ !important;
box-shadow: none /* iOS3 */ !important;
}
.ui-table-wrapper-top div > .ui-select,
.ui-table-wrapper-top div > .ui-btn,
.ui-table-wrapper-bottom div > .ui-select,
.ui-table-wrapper-bottom div > .ui-btn {
width: 100%;
margin: 0;
}
/* table borders */
.ui-table-wrapper-top {
border-width: 1px 1px 0;
}
.ui-table-wrapper-bottom {
border-width: 0 1px 1px;
}
/* inherit border to table ... */
.ui-table-wrapper-top ~ table,
.ui-table-wrapper-bottom ~ table {
border: 1px solid;
}
/* wrapper buttons */
.ui-table-wrapper-top .ui-btn:not(.ui-input-clear),
.ui-table-wrapper-bottom .ui-btn:not(.ui-input-clear) {
margin: 0;
border: 0 none;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
-webkit-border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
font-weight: normal;
padding: .625em 1em;
vertical-align: middle;
}
.ui-table-wrapper-top > div, .ui-table-wrapper-bottom > div {
text-align: center;
}
.ui-table-wrapper-top .ui-table-columntoggle-btn {
float: none;
}
/* wrapper plain text */
.ui-table-wrapper-top .ui-plain-text,
.ui-table-wrapper-bottom .ui-plain-text {
font-size: .95em;
margin: 0;
padding: .625em 1em;
display: block;
position: relative;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
cursor: normal;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
vertical-align: middle;
}
/* wrapper controlgroups */
.ui-table-wrapper-top .ui-controlgroup,
.ui-table-wrapper-bottom .ui-controlgroup {
text-align: center;
margin: 0 !important;
}
.ui-table-wrapper-top .ui-controlgroup > *,
.ui-table-wrapper-bottom .ui-controlgroup > * {
border: 0 none;
margin: 0 !important;
}
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls ,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls {
/* width: 100%; *//* in single block, this prevents centering */
}
/* buttons */
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-btn ,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-btn
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select ,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-select {
width: auto;
}
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn {
padding-top: 0;
padding-bottom: 0;
}
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn {
padding-top: 6px;
padding-bottom: 6px;
}
@media (max-width: 20em) {
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls {
width: 100%;
}
/* why? if not 5 buttons, this breaks...*/
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-btn,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-btn,
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-select {
width: 16%;
padding-left: 2%;
padding-right: 2%;
}
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-select {
width: 20%;
padding-left: 0;
padding-right: 0;
}
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn {
width: 100%;
}
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-btn:after,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-btn:after,
.ui-table-wrapper-top .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn:after,
.ui-table-wrapper-bottom .ui-controlgroup .ui-controlgroup-controls .ui-select .ui-btn:after {
left: auto;
right: auto;
margin-left: 5% /* bad... */;
}
/* only child */
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:only-child,
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:only-child .ui-btn,
.ui-table-wrapper-bottom.ui-table-wrapper-inset > div:only-child .ui-select {
border-bottom-right-radius: inherit;
-webkit-border-bottom-right-radius: inherit;
border-bottom-right-radius: inherit;
-webkit-border-bottom-right-radius: inherit;
}
/* only child */
.ui-table-wrapper-top.ui-table-wrapper-inset > div:only-child,
.ui-table-wrapper-top.ui-table-wrapper-inset > div:only-child .ui-btn,
.ui-table-wrapper-top.ui-table-wrapper-inset > div:only-child .ui-select {
border-top-right-radius: inherit;
-webkit-border-top-right-radius: inherit;
border-top-right-radius: inherit;
-webkit-border-top-right-radius: inherit;
}
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-first-child,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-first-child {
-webkit-border-bottom-right-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: inherit;
border-bottom-left-radius: inherit;
}
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-last-child,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-controlgroup .ui-controlgroup-controls .ui-last-child {
-webkit-border-bottom-right-radius: inherit;
border-bottom-right-radius: inherit;
-webkit-border-bottom-left-radius: 0;
border-bottom-left-radius: 0;
}
}
/* alignment */
.ui-table th, .ui-table td {
vertical-align: middle;
}
.ui-table thead th, .ui-table thead td {
text-align: center;
}
/* sortable buttons */
.ui-table thead th {
font-weight: normal !important;
/* padding: 0px; */
}
.ui-table thead th a {
margin: 0px !important;
border-width: 0px !important;
height: inherit !important;
}
/* multi row header */
.ui-table thead th[rowspan="2"] a {
height: auto; padding: 10px 0;
}
/* responsiveness */
@media (max-width: 40em) {
html table.ui-table {
width: 100.55%;
}
html table.ui-table-reflow tbody th {
border-top: 1px solid;
margin-top: 1.5em;
}
html table.ui-table-reflow tbody th:before {
width: 100%;
}
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-btn,
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-select,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-btn,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-select {
/* width: auto; */
text-indent: -9999px;
white-space: nowrap !important;
}
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-btn:after,
.ui-table-wrapper-top.ui-table-wrapper-inset .ui-select:after,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-btn:after,
.ui-table-wrapper-bottom.ui-table-wrapper-inset .ui-select:after {
text-indent: 0px;
left: auto;
}
}
/* ui-controlbar */
.ui-controlbar {
position: static;
text-align: center;
}
.ui-controlbar > * {
display: inline-block;
vertical-align: middle;
padding: 0;
}
.ui-controlbar .ui-select {
padding: 0 1%;
}
/* ui-collapsible-tabs - above 40em */
@media (min-width: 40em) {
.ui-collapsible-tabs {
display: table;
table-layout: fixed;
width: 100%;
}
.ui-collapsible-tabs .ui-collapsible {
display: table-cell;
}
.ui-collapsible-tabs .ui-collapsible-content {
margin: 0;
padding: 0;
position: relative;
}
/* content - IE8 ignores this and falls back to regular collapsible-set */
.ui-collapsible-tabs[data-tabs="10"] .ui-collapsible .ui-collapsible-content {width: 1000%; }
.ui-collapsible-tabs[data-tabs="9"] .ui-collapsible .ui-collapsible-content {width: 900%; }
.ui-collapsible-tabs[data-tabs="8"] .ui-collapsible .ui-collapsible-content {width: 800%;}
.ui-collapsible-tabs[data-tabs="7"] .ui-collapsible .ui-collapsible-content {width: 700%;}
.ui-collapsible-tabs[data-tabs="6"] .ui-collapsible .ui-collapsible-content {width: 600%;}
.ui-collapsible-tabs[data-tabs="5"] .ui-collapsible .ui-collapsible-content {width: 500%;}
.ui-collapsible-tabs[data-tabs="4"] .ui-collapsible .ui-collapsible-content {width: 400%;}
.ui-collapsible-tabs[data-tabs="3"] .ui-collapsible .ui-collapsible-content {width: 300%;}
.ui-collapsible-tabs[data-tabs="2"] .ui-collapsible .ui-collapsible-content {width: 200%;}
.ui-collapsible-tabs[data-tabs="1"] .ui-collapsible .ui-collapsible-content {width: 100%;}
/* positioning (can use nth-child because IE8 does not care for the above */
.ui-collapsible-tabs .ui-collapsible:nth-child(1) .ui-collapsible-content {left: 0;}
.ui-collapsible-tabs .ui-collapsible:nth-child(2) .ui-collapsible-content {left: -100%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(3) .ui-collapsible-content {left: -200%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(4) .ui-collapsible-content {left: -300%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(5) .ui-collapsible-content {left: -400%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(6) .ui-collapsible-content {left: -500%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(7) .ui-collapsible-content {left: -600%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(8) .ui-collapsible-content {left: -700%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(9) .ui-collapsible-content {left: -800%;}
.ui-collapsible-tabs .ui-collapsible:nth-child(10) .ui-collapsible-content {left: -900%;}
/* corners */
/* hardcode inset content-theme bottom corners, because can't inherit 0 on bottom left/right first/last tab */
.ui-collapsible-tabs .ui-collapsible-inset.ui-collapsible-themed-content:not(.ui-collapsible-collapsed) .ui-collapsible-content {
-webkit-border-bottom-left-radius: .6em;
border-bottom-left-radius: .6em;
-webkit-border-bottom-right-radius: .6em;
border-bottom-right-radius: .6em;
}
.ui-collapsible-tabs .ui-collapsible.ui-first-child {
-webkit-border-top-left-radius: inherit;
border-top-left-radius: inherit;
-webkit-border-top-right-radius: 0;
border-top-right-radius: 0;
-webkit-border-bottom-right-radius: 0;
border-bottom-right-radius: 0;
}
.ui-collapsible-tabs .ui-collapsible.ui-last-child {
-webkit-border-top-right-radius: inherit;
border-top-right-radius: inherit;
-webkit-border-top-left-radius: 0;
border-top-left-radius: 0;
-webkit-border-bottom-left-radius: 0;
border-bottom-left-radius: 0;
}
/* straight corner last-tab if one tab is open */
.ui-collapsible-tabs .ui-collapsible:not(.ui-collapsible-collapsed) ~ .ui-collapsible.ui-last-child {
-webkit-border-bottom-right-radius: 0;
border-bottom-right-radius: 0;
}
/* first tab, needs extra JS-assigned class... */
.ui-collapsible-tabs .ui-collapsible.ui-first-child {
-webkit-border-bottom-left-radius: 0;
border-bottom-left-radius: 0;
}
.ui-collapsible-tabs.ui-collapsible-set-all-closed .ui-collapsible.ui-first-child {
-webkit-border-bottom-left-radius: inherit;
border-bottom-left-radius: inherit;
}
/* hide status text */
.ui-collapsible-tabs .ui-collapsible-heading-status {
position: absolute !important;
left: -9999px;
clip: rect(1px 1px 1px 1px);
}
/* borders */
.ui-collapsible-tabs .ui-collapsible:not(.ui-collapsible-collapsed) h1 a {
border-bottom-color: transparent;
}
.ui-collapsible-tabs .ui-collapsible .ui-collapsible-content {
border-top-color: transparent;
border-top-width: 1px; /* magic */
}
html .ui-page .ui-collapsible-tabs .ui-collapsible + .ui-collapsible h1 a.ui-btn {
border-left-color: transparent;
}
}
/* hide icons */
html .ui-page .ui-collapsible-tabs .ui-collapsible h1 a.ui-collapsible-hide-icon.ui-btn:after {
content: none;
left: 0;
}
html .ui-page .ui-collapsible-tabs .ui-collapsible h1 a.ui-collapsible-hide-icon.ui-btn {
padding-left: 1em;
}
/* ===================================================================== */
/* FontAwesome */
/* ===================================================================== */
/*!
* Font Awesome 3.2.0
* the iconic font designed for Bootstrap
* ------------------------------------------------------------------------------
* The full suite of pictographic icons, examples, and documentation can be
* found at http://fontawesome.io. Stay up to date on Twitter at
* http://twitter.com/fontawesome.
*
* License
* ------------------------------------------------------------------------------
* - The Font Awesome font is licensed under SIL OFL 1.1 -
* http://scripts.sil.org/OFL
* - Font Awesome CSS, LESS, and SASS files are licensed under MIT License -
* http://opensource.org/licenses/mit-license.html
* - Font Awesome documentation licensed under CC BY 3.0 -
* http://creativecommons.org/licenses/by/3.0/
* - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
* "Font Awesome by Dave Gandy - http://fontawesome.io"
*
* Author - Dave Gandy
* ------------------------------------------------------------------------------
* Email: dave@fontawesome.io
* Twitter: http://twitter.com/byscuits
* Work: Lead Product Designer @ Kyruus - http://kyruus.com
*/
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome-webfont';
src: url('../lib/fontawesome-webfont.eot?v=3.2.0'); /* IE9 Compat Modes */
src: url('../lib/fontawesome-webfont.eot?#iefix&v=3.2.0') format('embedded-opentype'), /* IE6-IE8 */
url('../lib/fontawesome-webfont.woff?v=3.2.0') format('woff'), /* Modern Browsers */
url('../lib/fontawesome-webfont.ttf?v=3.2.0') format('truetype'), /* Safari, Android, iOS */
url('../lib/fontawesome-webfont.ff#fontawesomeregular?v=3.2.0') format('svg'); /* Legacy iOS */
font-weight: normal;
font-style: normal;
}
/* FONT AWESOME CORE
* -------------------------- */
html [class^="ui-icon-"]:after,
html [class*=" ui-icon-"]:after {
font-family: FontAwesome-webfont;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
-webkit-font-smoothing: antialiased;
*margin-right: .3em;
}
html [class^="ui-icon-"]:after,
html [class*=" ui-icon-"]:after {
text-decoration: inherit;
display: inline-block;
cursor: pointer;
speak: none;
}
/* makes the font 33% larger relative to the icon container */
html .ui-page .icon-large:after {
vertical-align: -10%;
font-size: 1.3333333333333333em;
}
/* makes sure icons active on rollover in links */
html a[class^="ui-icon-"]:after,
html a[class*=" ui-icon-"]:after {
display: inline;
}
/* increased font size for icon-large */
html [class^="ui-icon-"].icon-fixed-width:after,
html [class*=" ui-icon-"].icon-fixed-width:after {
display: inline-block;
width: 1.1428571428571428em;
text-align: right;
padding-right: 0.2857142857142857em;
}
html [class^="ui-icon-"].icon-fixed-width.icon-large:after,
html [class*=" ui-icon-"].icon-fixed-width.icon-large:after {
width: 1.4285714285714286em;
}
html .ui-page .icons-ul {
margin-left: 2.142857142857143em;
list-style-type: none;
}
html .ui-page .icons-ul > li {
position: relative;
}
html .ui-page .icons-ul .icon-li {
position: absolute;
left: -2.142857142857143em;
width: 2.142857142857143em;
text-align: center;
line-height: inherit;
}
html [class^="ui-icon-"].hide:after,
html [class*=" ui-icon-"].hide:after {
display: none;
}
html .ui-page .icon-muted {
color: #eeeeee;
}
html .ui-page .icon-light {
color: #ffffff;
}
html .ui-page .icon-dark {
color: #333333;
}
html .ui-page .icon-border {
border: solid 1px #eeeeee;
padding: .2em .25em .15em;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
html .ui-page .icon-2x {
font-size: 2em;
}
html .ui-page .icon-2x.icon-border {
border-width: 2px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
html .ui-page .icon-3x {
font-size: 3em;
}
html .ui-page .icon-3x.icon-border {
border-width: 3px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
html .ui-page .icon-4x {
font-size: 4em;
}
html .ui-page .icon-4x.icon-border {
border-width: 4px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
html .ui-page .icon-5x {
font-size: 5em;
}
html .ui-page .icon-5x.icon-border {
border-width: 5px;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
border-radius: 7px;
}
html .ui-page .pull-right {
float: right;
}
html .ui-page .pull-left {
float: left;
}
html [class^="ui-icon-"].pull-left:after,
html [class*=" ui-icon-"].pull-left:after {
margin-right: .3em;
}
html [class^="ui-icon-"].pull-right:after,
html [class*=" ui-icon-"].pull-right:after {
margin-left: .3em;
}
/* EXTRAS
* -------------------------- */
/* Stacked and layered icon */
html .ui-page .icon-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: -35%;
}
html .ui-page .icon-stack [class^="ui-icon-"]:after,
html .ui-page .icon-stack [class*=" ui-icon-"]:after {
display: block;
text-align: center;
position: absolute;
width: 100%;
height: 100%;
font-size: 1em;
line-height: inherit;
*line-height: 2em;
}
html .ui-page .icon-stack .icon-stack-base {
font-size: 2em;
*line-height: 1em;
}
/* Animated rotating icon */
html .ui-page .icon-spin {
display: inline-block;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
html a .icon-spin {
display: inline-block;
text-decoration: none;
}
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
}
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@-o-keyframes spin {
0% {
-o-transform: rotate(0deg);
}
100% {
-o-transform: rotate(359deg);
}
}
@-ms-keyframes spin {
0% {
-ms-transform: rotate(0deg);
}
100% {
-ms-transform: rotate(359deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(359deg);
}
}
/* Icon rotations and mirroring */
html .ui-page .icon-rotate-90:after {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
}
html .ui-page .icon-rotate-180:after {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
}
html .ui-page .icon-rotate-270:after {
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
html .ui-page .icon-flip-horizontal:after {
-webkit-transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
transform: scale(-1, 1);
}
html .ui-page .icon-flip-vertical:after {
-webkit-transform: scale(1, -1);
-moz-transform: scale(1, -1);
-ms-transform: scale(1, -1);
-o-transform: scale(1, -1);
transform: scale(1, -1);
}
/* ensure rotation occurs inside anchor tags */
html a .icon-rotate-90:after,
html a .icon-rotate-180:after,
html a .icon-rotate-270:after,
html a .icon-flip-horizontal:after,
html a .icon-flip-vertical:after {
display: inline-block;
}
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons */
html .ui-page .ui-icon-glass:after {
content: "\f000";
}
html .ui-page .ui-icon-music:after {
content: "\f001";
}
html .ui-page .ui-icon-search:after {
content: "\f002";
}
html .ui-page .ui-icon-envelope-alt:after {
content: "\f003";
}
html .ui-page .ui-icon-heart:after {
content: "\f004";
}
html .ui-page .ui-icon-star:after {
content: "\f005";
}
html .ui-page .ui-icon-star-empty:after {
content: "\f006";
}
html .ui-page .ui-icon-user:after {
content: "\f007";
}
html .ui-page .ui-icon-film:after {
content: "\f008";
}
html .ui-page .ui-icon-th-large:after {
content: "\f009";
}
html .ui-page .ui-icon-th:after {
content: "\f00a";
}
html .ui-page .ui-icon-th-list:after {
content: "\f00b";
}
html .ui-page .ui-icon-ok:after {
content: "\f00c";
}
html .ui-page .ui-icon-remove:after, html .ui-page .ui-icon-delete:after {
content: "\f00d";
}
html .ui-page .ui-icon-zoom-in:after {
content: "\f00e";
}
html .ui-page .ui-icon-zoom-out:after {
content: "\f010";
}
html .ui-page .ui-icon-power-off:after,
html .ui-page .ui-icon-off:after {
content: "\f011";
}
html .ui-page .ui-icon-signal:after {
content: "\f012";
}
html .ui-page .ui-icon-cog:after {
content: "\f013";
}
html .ui-page .ui-icon-trash:after {
content: "\f014";
}
html .ui-page .ui-icon-home:after {
content: "\f015";
}
html .ui-page .ui-icon-file-alt:after {
content: "\f016";
}
html .ui-page .ui-icon-time:after {
content: "\f017";
}
html .ui-page .ui-icon-road:after {
content: "\f018";
}
html .ui-page .ui-icon-download-alt:after {
content: "\f019";
}
html .ui-page .ui-icon-download:after {
content: "\f01a";
}
html .ui-page .ui-icon-upload:after {
content: "\f01b";
}
html .ui-page .ui-icon-inbox:after {
content: "\f01c";
}
html .ui-page .ui-icon-play-circle:after {
content: "\f01d";
}
html .ui-page .ui-icon-rotate-right:after,
html .ui-page .ui-icon-repeat:after {
content: "\f01e";
}
html .ui-page .ui-icon-refresh:after {
content: "\f021";
}
html .ui-page .ui-icon-list-alt:after {
content: "\f022";
}
html .ui-page .ui-icon-lock:after {
content: "\f023";
}
html .ui-page .ui-icon-flag:after {
content: "\f024";
}
html .ui-page .ui-icon-headphones:after {
content: "\f025";
}
html .ui-page .ui-icon-volume-off:after {
content: "\f026";
}
html .ui-page .ui-icon-volume-down:after {
content: "\f027";
}
html .ui-page .ui-icon-volume-up:after {
content: "\f028";
}
html .ui-page .ui-icon-qrcode:after {
content: "\f029";
}
html .ui-page .ui-icon-barcode:after {
content: "\f02a";
}
html .ui-page .ui-icon-tag:after {
content: "\f02b";
}
html .ui-page .ui-icon-tags:after {
content: "\f02c";
}
html .ui-page .ui-icon-book:after {
content: "\f02d";
}
html .ui-page .ui-icon-bookmark:after {
content: "\f02e";
}
html .ui-page .ui-icon-print:after {
content: "\f02f";
}
html .ui-page .ui-icon-camera:after {
content: "\f030";
}
html .ui-page .ui-icon-font:after {
content: "\f031";
}
html .ui-page .ui-icon-bold:after {
content: "\f032";
}
html .ui-page .ui-icon-italic:after {
content: "\f033";
}
html .ui-page .ui-icon-text-height:after {
content: "\f034";
}
html .ui-page .ui-icon-text-width:after {
content: "\f035";
}
html .ui-page .ui-icon-align-left:after {
content: "\f036";
}
html .ui-page .ui-icon-align-center:after {
content: "\f037";
}
html .ui-page .ui-icon-align-right:after {
content: "\f038";
}
html .ui-page .ui-icon-align-justify:after {
content: "\f039";
}
html .ui-page .ui-icon-list:after {
content: "\f03a";
}
html .ui-page .ui-icon-indent-left:after {
content: "\f03b";
}
html .ui-page .ui-icon-indent-right:after {
content: "\f03c";
}
html .ui-page .ui-icon-facetime-video:after {
content: "\f03d";
}
html .ui-page .ui-icon-picture:after {
content: "\f03e";
}
html .ui-page .ui-icon-pencil:after {
content: "\f040";
}
html .ui-page .ui-icon-map-marker:after {
content: "\f041";
}
html .ui-page .ui-icon-adjust:after {
content: "\f042";
}
html .ui-page .ui-icon-tint:after {
content: "\f043";
}
html .ui-page .ui-icon-edit:after {
content: "\f044";
}
html .ui-page .ui-icon-share:after {
content: "\f045";
}
html .ui-page .ui-icon-check:after,
html .ui-page .ui-icon-checkbox-on:after {
content: "\f046";
}
html .ui-page .ui-icon-move:after {
content: "\f047";
}
html .ui-page .ui-icon-step-backward:after {
content: "\f048";
}
html .ui-page .ui-icon-fast-backward:after {
content: "\f049";
}
html .ui-page .ui-icon-backward:after {
content: "\f04a";
}
html .ui-page .ui-icon-play:after {
content: "\f04b";
}
html .ui-page .ui-icon-pause:after {
content: "\f04c";
}
html .ui-page .ui-icon-stop:after {
content: "\f04d";
}
html .ui-page .ui-icon-forward:after {
content: "\f04e";
}
html .ui-page .ui-icon-fast-forward:after {
content: "\f050";
}
html .ui-page .ui-icon-step-forward:after {
content: "\f051";
}
html .ui-page .ui-icon-eject:after {
content: "\f052";
}
html .ui-page .ui-icon-chevron-left:after {
content: "\f053";
}
html .ui-page .ui-icon-chevron-right:after {
content: "\f054";
}
html .ui-page .ui-icon-plus-sign:after {
content: "\f055";
}
html .ui-page .ui-icon-minus-sign:after {
content: "\f056";
}
html .ui-page .ui-icon-remove-sign:after {
content: "\f057";
}
html .ui-page .ui-icon-ok-sign:after {
content: "\f058";
}
html .ui-page .ui-icon-question-sign:after {
content: "\f059";
}
html .ui-page .ui-icon-info-sign:after {
content: "\f05a";
}
html .ui-page .ui-icon-screenshot:after {
content: "\f05b";
}
html .ui-page .ui-icon-remove-circle:after {
content: "\f05c";
}
html .ui-page .ui-icon-ok-circle:after,
html .ui-page .ui-icon-radio-on:after {
content: "\f05d";
}
html .ui-page .ui-icon-ban-circle:after {
content: "\f05e";
}
html .ui-page .ui-icon-arrow-left:after {
content: "\f060";
}
html .ui-page .ui-icon-arrow-right:after {
content: "\f061";
}
html .ui-page .ui-icon-arrow-up:after {
content: "\f062";
}
html .ui-page .ui-icon-arrow-down:after {
content: "\f063";
}
html .ui-page .ui-icon-mail-forward:after,
html .ui-page .ui-icon-share-alt:after {
content: "\f064";
}
html .ui-page .ui-icon-resize-full:after {
content: "\f065";
}
html .ui-page .ui-icon-resize-small:after {
content: "\f066";
}
html .ui-page .ui-icon-plus:after {
content: "\f067";
}
html .ui-page .ui-icon-minus:after {
content: "\f068";
}
html .ui-page .ui-icon-asterisk:after {
content: "\f069";
}
html .ui-page .ui-icon-exclamation-sign:after {
content: "\f06a";
}
html .ui-page .ui-icon-gift:after {
content: "\f06b";
}
html .ui-page .ui-icon-leaf:after {
content: "\f06c";
}
html .ui-page .ui-icon-fire:after {
content: "\f06d";
}
html .ui-page .ui-icon-eye-open:after {
content: "\f06e";
}
html .ui-page .ui-icon-eye-close:after {
content: "\f070";
}
html .ui-page .ui-icon-warning-sign:after {
content: "\f071";
}
html .ui-page .ui-icon-plane:after {
content: "\f072";
}
html .ui-page .ui-icon-calendar:after {
content: "\f073";
}
html .ui-page .ui-icon-random:after {
content: "\f074";
}
html .ui-page .ui-icon-comment:after {
content: "\f075";
}
html .ui-page .ui-icon-magnet:after {
content: "\f076";
}
html .ui-page .ui-icon-chevron-up:after {
content: "\f077";
}
html .ui-page .ui-icon-chevron-down:after {
content: "\f078";
}
html .ui-page .ui-icon-retweet:after {
content: "\f079";
}
html .ui-page .ui-icon-shopping-cart:after {
content: "\f07a";
}
html .ui-page .ui-icon-folder-close:after {
content: "\f07b";
}
html .ui-page .ui-icon-folder-open:after {
content: "\f07c";
}
html .ui-page .ui-icon-resize-vertical:after {
content: "\f07d";
}
html .ui-page .ui-icon-resize-horizontal:after {
content: "\f07e";
}
html .ui-page .ui-icon-bar-chart:after {
content: "\f080";
}
html .ui-page .ui-icon-twitter-sign:after {
content: "\f081";
}
html .ui-page .ui-icon-facebook-sign:after {
content: "\f082";
}
html .ui-page .ui-icon-camera-retro:after {
content: "\f083";
}
html .ui-page .ui-icon-key:after {
content: "\f084";
}
html .ui-page .ui-icon-cogs:after {
content: "\f085";
}
html .ui-page .ui-icon-comments:after {
content: "\f086";
}
html .ui-page .ui-icon-thumbs-up-alt:after {
content: "\f087";
}
html .ui-page .ui-icon-thumbs-down-alt:after {
content: "\f088";
}
html .ui-page .ui-icon-star-half:after {
content: "\f089";
}
html .ui-page .ui-icon-heart-empty:after {
content: "\f08a";
}
html .ui-page .ui-icon-signout:after {
content: "\f08b";
}
html .ui-page .ui-icon-linkedin-sign:after {
content: "\f08c";
}
html .ui-page .ui-icon-pushpin:after {
content: "\f08d";
}
html .ui-page .ui-icon-external-link:after {
content: "\f08e";
}
html .ui-page .ui-icon-signin:after {
content: "\f090";
}
html .ui-page .ui-icon-trophy:after {
content: "\f091";
}
html .ui-page .ui-icon-github-sign:after {
content: "\f092";
}
html .ui-page .ui-icon-upload-alt:after {
content: "\f093";
}
html .ui-page .ui-icon-lemon:after {
content: "\f094";
}
html .ui-page .ui-icon-phone:after {
content: "\f095";
}
html .ui-page .ui-icon-unchecked:after,
html .ui-page .ui-icon-checkbox-off:after,
html .ui-page .ui-icon-check-empty:after {
content: "\f096";
}
html .ui-page .ui-icon-bookmark-empty:after {
content: "\f097";
}
html .ui-page .ui-icon-phone-sign:after {
content: "\f098";
}
html .ui-page .ui-icon-twitter:after {
content: "\f099";
}
html .ui-page .ui-icon-facebook:after {
content: "\f09a";
}
html .ui-page .ui-icon-github:after {
content: "\f09b";
}
html .ui-page .ui-icon-unlock:after {
content: "\f09c";
}
html .ui-page .ui-icon-credit-card:after {
content: "\f09d";
}
html .ui-page .ui-icon-rss:after {
content: "\f09e";
}
html .ui-page .ui-icon-hdd:after {
content: "\f0a0";
}
html .ui-page .ui-icon-bullhorn:after {
content: "\f0a1";
}
html .ui-page .ui-icon-bell:after {
content: "\f0a2";
}
html .ui-page .ui-icon-certificate:after {
content: "\f0a3";
}
html .ui-page .ui-icon-hand-right:after {
content: "\f0a4";
}
html .ui-page .ui-icon-hand-left:after {
content: "\f0a5";
}
html .ui-page .ui-icon-hand-up:after {
content: "\f0a6";
}
html .ui-page .ui-icon-hand-down:after {
content: "\f0a7";
}
html .ui-page .ui-icon-circle-arrow-left:after {
content: "\f0a8";
}
html .ui-page .ui-icon-circle-arrow-right:after {
content: "\f0a9";
}
html .ui-page .ui-icon-circle-arrow-up:after {
content: "\f0aa";
}
html .ui-page .ui-icon-circle-arrow-down:after {
content: "\f0ab";
}
html .ui-page .ui-icon-globe:after {
content: "\f0ac";
}
html .ui-page .ui-icon-wrench:after {
content: "\f0ad";
}
html .ui-page .ui-icon-tasks:after {
content: "\f0ae";
}
html .ui-page .ui-icon-filter:after {
content: "\f0b0";
}
html .ui-page .ui-icon-briefcase:after {
content: "\f0b1";
}
html .ui-page .ui-icon-fullscreen:after {
content: "\f0b2";
}
html .ui-page .ui-icon-group:after {
content: "\f0c0";
}
html .ui-page .ui-icon-link:after {
content: "\f0c1";
}
html .ui-page .ui-icon-cloud:after {
content: "\f0c2";
}
html .ui-page .ui-icon-beaker:after {
content: "\f0c3";
}
html .ui-page .ui-icon-cut:after {
content: "\f0c4";
}
html .ui-page .ui-icon-copy:after {
content: "\f0c5";
}
html .ui-page .ui-icon-paperclip:after,
html .ui-page .ui-icon-paper-clip:after {
content: "\f0c6";
}
html .ui-page .ui-icon-save:after {
content: "\f0c7";
}
html .ui-page .ui-icon-sign-blank:after {
content: "\f0c8";
}
html .ui-page .ui-icon-reorder:after {
content: "\f0c9";
}
html .ui-page .ui-icon-list-ul:after {
content: "\f0ca";
}
html .ui-page .ui-icon-list-ol:after {
content: "\f0cb";
}
html .ui-page .ui-icon-strikethrough:after {
content: "\f0cc";
}
html .ui-page .ui-icon-underline:after {
content: "\f0cd";
}
html .ui-page .ui-icon-table:after {
content: "\f0ce";
}
html .ui-page .ui-icon-magic:after {
content: "\f0d0";
}
html .ui-page .ui-icon-truck:after {
content: "\f0d1";
}
html .ui-page .ui-icon-pinterest:after {
content: "\f0d2";
}
html .ui-page .ui-icon-pinterest-sign:after {
content: "\f0d3";
}
html .ui-page .ui-icon-google-plus-sign:after {
content: "\f0d4";
}
html .ui-page .ui-icon-google-plus:after {
content: "\f0d5";
}
html .ui-page .ui-icon-money:after {
content: "\f0d6";
}
html .ui-page .ui-icon-caret-down:after,
html .ui-page .ui-icon-carat-d:after {
content: "\f0d7";
}
html .ui-page .ui-icon-caret-up:after,
html .ui-page .ui-icon-carat-u:after {
content: "\f0d8";
}
html .ui-page .ui-icon-caret-left:after,
html .ui-page .ui-icon-carat-l:after {
content: "\f0d9";
}
html .ui-page .ui-icon-caret-right:after,
html .ui-page .ui-icon-carat-r:after {
content: "\f0da";
}
html .ui-page .ui-icon-columns:after {
content: "\f0db";
}
html .ui-page .ui-icon-sort:after, {
content: "\f0dc";
}
html .ui-page .ui-icon-sort-down:after {
content: "\f0dd";
}
html .ui-page .ui-icon-sort-up:after {
content: "\f0de";
}
html .ui-page .ui-icon-envelope:after {
content: "\f0e0";
}
html .ui-page .ui-icon-linkedin:after {
content: "\f0e1";
}
html .ui-page .ui-icon-rotate-left:after,
html .ui-page .ui-icon-undo:after {
content: "\f0e2";
}
html .ui-page .ui-icon-legal:after {
content: "\f0e3";
}
html .ui-page .ui-icon-dashboard:after {
content: "\f0e4";
}
html .ui-page .ui-icon-comment-alt:after {
content: "\f0e5";
}
html .ui-page .ui-icon-comments-alt:after {
content: "\f0e6";
}
html .ui-page .ui-icon-bolt:after {
content: "\f0e7";
}
html .ui-page .ui-icon-sitemap:after {
content: "\f0e8";
}
html .ui-page .ui-icon-umbrella:after {
content: "\f0e9";
}
html .ui-page .ui-icon-paste:after {
content: "\f0ea";
}
html .ui-page .ui-icon-lightbulb:after {
content: "\f0eb";
}
html .ui-page .ui-icon-exchange:after {
content: "\f0ec";
}
html .ui-page .ui-icon-cloud-download:after {
content: "\f0ed";
}
html .ui-page .ui-icon-cloud-upload:after {
content: "\f0ee";
}
html .ui-page .ui-icon-user-md:after {
content: "\f0f0";
}
html .ui-page .ui-icon-stethoscope:after {
content: "\f0f1";
}
html .ui-page .ui-icon-suitcase:after {
content: "\f0f2";
}
html .ui-page .ui-icon-bell-alt:after {
content: "\f0f3";
}
html .ui-page .ui-icon-coffee:after {
content: "\f0f4";
}
html .ui-page .ui-icon-food:after {
content: "\f0f5";
}
html .ui-page .ui-icon-file-text-alt:after {
content: "\f0f6";
}
html .ui-page .ui-icon-building:after {
content: "\f0f7";
}
html .ui-page .ui-icon-hospital:after {
content: "\f0f8";
}
html .ui-page .ui-icon-ambulance:after {
content: "\f0f9";
}
html .ui-page .ui-icon-medkit:after {
content: "\f0fa";
}
html .ui-page .ui-icon-fighter-jet:after {
content: "\f0fb";
}
html .ui-page .ui-icon-beer:after {
content: "\f0fc";
}
html .ui-page .ui-icon-h-sign:after {
content: "\f0fd";
}
html .ui-page .ui-icon-plus-sign-alt:after {
content: "\f0fe";
}
html .ui-page .ui-icon-double-angle-left:after {
content: "\f100";
}
html .ui-page .ui-icon-double-angle-right:after {
content: "\f101";
}
html .ui-page .ui-icon-double-angle-up:after {
content: "\f102";
}
html .ui-page .ui-icon-double-angle-down:after {
content: "\f103";
}
html .ui-page .ui-icon-angle-left:after {
content: "\f104";
}
html .ui-page .ui-icon-angle-right:after {
content: "\f105";
}
html .ui-page .ui-icon-angle-up:after {
content: "\f106";
}
html .ui-page .ui-icon-angle-down:after {
content: "\f107";
}
html .ui-page .ui-icon-desktop:after {
content: "\f108";
}
html .ui-page .ui-icon-laptop:after {
content: "\f109";
}
html .ui-page .ui-icon-tablet:after {
content: "\f10a";
}
html .ui-page .ui-icon-mobile-phone:after {
content: "\f10b";
}
html .ui-page .ui-icon-circle-blank:after,
html .ui-page .ui-icon-radio-off:after {
content: "\f10c";
}
html .ui-page .ui-icon-quote-left:after {
content: "\f10d";
}
html .ui-page .ui-icon-quote-right:after {
content: "\f10e";
}
html .ui-page .ui-icon-spinner:after {
content: "\f110";
}
html .ui-page .ui-icon-circle:after {
content: "\f111";
}
html .ui-page .ui-icon-mail-reply:after,
html .ui-page .ui-icon-reply:after {
content: "\f112";
}
html .ui-page .ui-icon-github-alt:after {
content: "\f113";
}
html .ui-page .ui-icon-folder-close-alt:after {
content: "\f114";
}
html .ui-page .ui-icon-folder-open-alt:after {
content: "\f115";
}
html .ui-page .ui-icon-expand-alt:after {
content: "\f116";
}
html .ui-page .ui-icon-collapse-alt:after {
content: "\f117";
}
html .ui-page .ui-icon-smile:after {
content: "\f118";
}
html .ui-page .ui-icon-frown:after {
content: "\f119";
}
html .ui-page .ui-icon-meh:after {
content: "\f11a";
}
html .ui-page .ui-icon-gamepad:after {
content: "\f11b";
}
html .ui-page .ui-icon-keyboard:after {
content: "\f11c";
}
html .ui-page .ui-icon-flag-alt:after {
content: "\f11d";
}
html .ui-page .ui-icon-flag-checkered:after {
content: "\f11e";
}
html .ui-page .ui-icon-terminal:after {
content: "\f120";
}
html .ui-page .ui-icon-code:after {
content: "\f121";
}
html .ui-page .ui-icon-reply-all:after {
content: "\f122";
}
html .ui-page .ui-icon-mail-reply-all:after {
content: "\f122";
}
html .ui-page .ui-icon-star-half-full:after,
html .ui-page .ui-icon-star-half-empty:after {
content: "\f123";
}
html .ui-page .ui-icon-location-arrow:after {
content: "\f124";
}
html .ui-page .ui-icon-crop:after {
content: "\f125";
}
html .ui-page .ui-icon-code-fork:after {
content: "\f126";
}
html .ui-page .ui-icon-unlink:after {
content: "\f127";
}
html .ui-page .ui-icon-question:after {
content: "\f128";
}
html .ui-page .ui-icon-info:after {
content: "\f129";
}
html .ui-page .ui-icon-exclamation:after {
content: "\f12a";
}
html .ui-page .ui-icon-superscript:after {
content: "\f12b";
}
html .ui-page .ui-icon-subscript:after {
content: "\f12c";
}
html .ui-page .ui-icon-eraser:after {
content: "\f12d";
}
html .ui-page .ui-icon-puzzle-piece:after {
content: "\f12e";
}
html .ui-page .ui-icon-microphone:after {
content: "\f130";
}
html .ui-page .ui-icon-microphone-off:after {
content: "\f131";
}
html .ui-page .ui-icon-shield:after {
content: "\f132";
}
html .ui-page .ui-icon-calendar-empty:after {
content: "\f133";
}
html .ui-page .ui-icon-fire-extinguisher:after {
content: "\f134";
}
html .ui-page .ui-icon-rocket:after {
content: "\f135";
}
html .ui-page .ui-icon-maxcdn:after {
content: "\f136";
}
html .ui-page .ui-icon-chevron-sign-left:after {
content: "\f137";
}
html .ui-page .ui-icon-chevron-sign-right:after {
content: "\f138";
}
html .ui-page .ui-icon-chevron-sign-up:after {
content: "\f139";
}
html .ui-page .ui-icon-chevron-sign-down:after {
content: "\f13a";
}
html .ui-page .ui-icon-html5:after {
content: "\f13b";
}
html .ui-page .ui-icon-css3:after {
content: "\f13c";
}
html .ui-page .ui-icon-anchor:after {
content: "\f13d";
}
html .ui-page .ui-icon-unlock-alt:after {
content: "\f13e";
}
html .ui-page .ui-icon-bullseye:after {
content: "\f140";
}
html .ui-page .ui-icon-ellipsis-horizontal:after {
content: "\f141";
}
html .ui-page .ui-icon-ellipsis-vertical:after {
content: "\f142";
}
html .ui-page .ui-icon-rss-sign:after {
content: "\f143";
}
html .ui-page .ui-icon-play-sign:after {
content: "\f144";
}
html .ui-page .ui-icon-ticket:after {
content: "\f145";
}
html .ui-page .ui-icon-minus-sign-alt:after {
content: "\f146";
}
html .ui-page .ui-icon-check-minus:after {
content: "\f147";
}
html .ui-page .ui-icon-level-up:after {
content: "\f148";
}
html .ui-page .ui-icon-level-down:after {
content: "\f149";
}
html .ui-page .ui-icon-check-sign:after {
content: "\f14a";
}
html .ui-page .ui-icon-edit-sign:after {
content: "\f14b";
}
html .ui-page .ui-icon-external-link-sign:after {
content: "\f14c";
}
html .ui-page .ui-icon-share-sign:after {
content: "\f14d";
}
html .ui-page .ui-icon-compass:after {
content: "\f14e";
}
html .ui-page .ui-icon-collapse:after {
content: "\f150";
}
html .ui-page .ui-icon-collapse-top:after {
content: "\f151";
}
html .ui-page .ui-icon-expand:after {
content: "\f152";
}
html .ui-page .ui-icon-euro:after,
html .ui-page .ui-icon-eur:after {
content: "\f153";
}
html .ui-page .ui-icon-gbp:after {
content: "\f154";
}
html .ui-page .ui-icon-dollar:after,
html .ui-page .ui-icon-usd:after {
content: "\f155";
}
html .ui-page .ui-icon-rupee:after,
html .ui-page .ui-icon-inr:after {
content: "\f156";
}
html .ui-page .ui-icon-yen:after,
html .ui-page .ui-icon-jpy:after {
content: "\f157";
}
html .ui-page .ui-icon-renminbi:after,
html .ui-page .ui-icon-cny:after {
content: "\f158";
}
html .ui-page .ui-icon-won:after,
html .ui-page .ui-icon-krw:after {
content: "\f159";
}
html .ui-page .ui-icon-bitcoin:after,
html .ui-page .ui-icon-btc:after {
content: "\f15a";
}
html .ui-page .ui-icon-file:after {
content: "\f15b";
}
html .ui-page .ui-icon-file-text:after {
content: "\f15c";
}
html .ui-page .ui-icon-sort-by-alphabet:after {
content: "\f15d";
}
html .ui-page .ui-icon-sort-by-alphabet-alt:after {
content: "\f15e";
}
html .ui-page .ui-icon-sort-by-attributes:after {
content: "\f160";
}
html .ui-page .ui-icon-sort-by-attributes-alt:after {
content: "\f161";
}
html .ui-page .ui-icon-sort-by-order:after {
content: "\f162";
}
html .ui-page .ui-icon-sort-by-order-alt:after {
content: "\f163";
}
html .ui-page .ui-icon-thumbs-up:after {
content: "\f164";
}
html .ui-page .ui-icon-thumbs-down:after {
content: "\f165";
}
html .ui-page .ui-icon-youtube-sign:after {
content: "\f166";
}
html .ui-page .ui-icon-youtube:after {
content: "\f167";
}
html .ui-page .ui-icon-xing:after {
content: "\f168";
}
html .ui-page .ui-icon-xing-sign:after {
content: "\f169";
}
html .ui-page .ui-icon-youtube-play:after {
content: "\f16a";
}
html .ui-page .ui-icon-dropbox:after {
content: "\f16b";
}
html .ui-page .ui-icon-stackexchange:after {
content: "\f16c";
}
html .ui-page .ui-icon-instagram:after {
content: "\f16d";
}
html .ui-page .ui-icon-flickr:after {
content: "\f16e";
}
html .ui-page .ui-icon-adn:after {
content: "\f170";
}
html .ui-page .ui-icon-bitbucket:after {
content: "\f171";
}
html .ui-page .ui-icon-bitbucket-sign:after {
content: "\f172";
}
html .ui-page .ui-icon-tumblr:after {
content: "\f173";
}
html .ui-page .ui-icon-tumblr-sign:after {
content: "\f174";
}
html .ui-page .ui-icon-long-arrow-down:after {
content: "\f175";
}
html .ui-page .ui-icon-long-arrow-up:after {
content: "\f176";
}
html .ui-page .ui-icon-long-arrow-left:after {
content: "\f177";
}
html .ui-page .ui-icon-long-arrow-right:after {
content: "\f178";
}
html .ui-page .ui-icon-apple:after {
content: "\f179";
}
html .ui-page .ui-icon-windows:after {
content: "\f17a";
}
html .ui-page .ui-icon-android:after {
content: "\f17b";
}
html .ui-page .ui-icon-linux:after {
content: "\f17c";
}
html .ui-page .ui-icon-dribble:after {
content: "\f17d";
}
html .ui-page .ui-icon-skype:after {
content: "\f17e";
}
html .ui-page .ui-icon-foursquare:after {
content: "\f180";
}
html .ui-page .ui-icon-trello:after {
content: "\f181";
}
html .ui-page .ui-icon-female:after {
content: "\f182";
}
html .ui-page .ui-icon-male:after {
content: "\f183";
}
html .ui-page .ui-icon-gittip:after {
content: "\f184";
}
html .ui-page .ui-icon-sun:after {
content: "\f185";
}
html .ui-page .ui-icon-moon:after {
content: "\f186";
}
html .ui-page .ui-icon-archive:after {
content: "\f187";
}
html .ui-page .ui-icon-bug:after {
content: "\f188";
}
html .ui-page .ui-icon-vk:after {
content: "\f189";
}
html .ui-page .ui-icon-weibo:after {
content: "\f18a";
}
html .ui-page .ui-icon-renren:after {
content: "\f18b";
}
/* JQM compat */
/* clear background */
html .ui-page .ui-btn:after {
background: 0 none;
border-radius: 0;
-webkit-border-radius: 0;
}
/* iconsize, positioning */
.ui-page .ui-btn[class*="ui-icon-"]:after,
.ui-page .ui-btn[class*="ui-icon-"]:after {
font-size: 1.5em;
}
.ui-page .ui-header .ui-btn[class*="ui-icon-"]:after,
.ui-page .ui-header .ui-btn[class*="ui-icon-"]:after {
margin-top: 0;
top: 0;
}
/* revert for no-svg */
.ui-nosvg .ui-page .ui-btn[class*="ui-icon-"]:after,
.ui-nosvg .ui-page .ui-btn[class*="ui-icon-"]:after {
margin-top: -11px;
top: 50%;
content: "";
}
/* FALLBACK Icons - JQM compat: user, reorder, search, delete */
/* bars */
.ui-nosvg .ui-icon-reorder:after {
background-image: url(img/jquery-mobile/icons-png/bars-black.png);
}
/* delete */
.ui-nosvg .ui-icon-delete:after {
background-image: url(images/icons-png/delete-black.png);
}
/* search */
.ui-nosvg .ui-icon-search:after {
background-image: url(images/icons-png/search-black.png);
}
/* user */
.ui-nosvg .ui-icon-user:after {
background-image: url(images/icons-png/user-white.png);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
* Correct `inline-block` display not defined in IE 8/9.
*/
audio,
canvas,
video {
display: inline-block;
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9.
* Hide the `template` element in IE, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background: transparent;
}
/**
* Address `outline` inconsistency between Chrome and other browsers.
*/
a:focus {
outline: thin dotted;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari 5, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Correct font family set oddly in Safari 5 and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
/**
* Improve readability of pre-formatted text in all browsers.
*/
pre {
white-space: pre-wrap;
}
/**
* Set consistent quote types.
*/
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* ==========================================================================
Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9.
*/
img {
border: 0;
}
/**
* Correct overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* ==========================================================================
Figures
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari 5.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Correct font family not being inherited in all browsers.
* 2. Correct font size not being inherited in all browsers.
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 2 */
margin: 0; /* 3 */
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
button,
input {
line-height: normal;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
* Correct `select` style inheritance in Firefox 4+ and Opera.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* 1. Remove default vertical scrollbar in IE 8/9.
* 2. Improve readability and alignment in all browsers.
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
/* GLOBALS */
/* Font: */
/* BASE */
body, input, select, textarea, button, p, legend, html.ui-mobile label, .ui-btn {
font-family: Helvetica, Arial, sans-serif;
color: #333;
font-size: 95%;
}
body .ui-controlgroup-label legend {
font-size: 82.5%;
}
@media (max-width: 40em) {
body, input, select, textarea, button, p, legend, html.ui-mobile label, .ui-btn, body .ui-controlgroup-label legend {
font-size: 92.5%;
}
}
/* Modified on BASE */
html .listview .ui-li-divider {
font-size: 80%;
}
/* Watermark NOTE: breaks links if ui-content is kept position:static
.ui-page-active:before,
.ui-page-active .ui-panel-wrapper:before {
background: url("../img/slapos.png") no-repeat center center;
background-attachment: fixed;
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
opacity: .2;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
filter: gray;
-webkit-filter: grayscale(100%) brightness(10%) contrast(100%);
}
.ui-page.ui-page-active:before,
.ui-page.ui-page-active .ui-panel-wrapper:before{
pointer-events: none;
}
@media (max-width: 40em) {
.ui-page-theme-slapos-white:before,
.ui-page-theme-slapos-white .ui-panel-wrapper:before {
-webkit-background-size: 30%;
background-size: 30%;
}
}
@media (max-width: 30em) {
.ui-page-theme-slapos-white:before,
.ui-page-theme-slapos-white .ui-panel-wrapper:before {
-webkit-background-size: 35%;
background-size: 35%;
}
}
@media (max-width: 20em) {
.ui-page-theme-slapos-white:before,
.ui-page-theme-slapos-white .ui-panel-wrapper:before {
-webkit-background-size: 40%;
background-size: 40%;
}
}
*/
/* JQM custom themes */
/* slapos-white */
/*-----------------------------------------------------------------------------------------------------------*/
/* Bar: Toolbars, dividers, slider track */
.ui-bar-slapos-white,
.ui-page-theme-slapos-white .ui-bar-inherit,
html .ui-bar-slapos-white .ui-bar-inherit,
html .ui-body-slapos-white .ui-bar-inherit,
html body .ui-group-theme-slapos-white .ui-bar-inherit {
background: 0 none;
background-color: #fff;
color: rgb(129, 137, 138);
color: rgba(0, 0, 0, 0.25);
text-shadow: none;
border-color: #aaa;
font-weight: normal;
}
.ui-bar-slapos-white {
border-width: 1px;
border-style: solid;
}
/* tables & controlbar & tabs */
html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-top .ui-btn,
html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-top .ui-plain-text,
html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-bottom .ui-btn,
html .ui-page-theme-slapos-white .ui-table-wrapper.ui-table-wrapper-bottom .ui-plain-text,
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn {
color: #aaa;
text-shadow: #FFFFFF 0px 1px 0px;
}
html .ui-page-theme-slapos-white .ui-table {
background-color: #fff;
border-color: #aaa;
}
html .ui-page-theme-slapos-white .ui-table-wrapper,
html .ui-page-theme-slapos-white .ui-table-wrapper .ui-btn,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn {
background-image: -webkit-gradient(linear, left top, left bottom, from( #fff ), to( #f1f1f1 ));
background-image: -webkit-linear-gradient( #fff , #f1f1f1 );
background-image: -moz-linear-gradient( #fff , #f1f1f1 );
background-image: -ms-linear-gradient( #fff , #f1f1f1 );
background-image: -o-linear-gradient( #fff , #f1f1f1 );
background-image: linear-gradient( #fff , #f1f1f1 );
border-color: #aaa;
}
/* Page: background */
.ui-page-theme-slapos-white,
.ui-page-theme-slapos-white .ui-panel-wrapper {
color: #333;
text-shadow: none;
background: #f9f9f9;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f9f9f9), to( #eee ));
background-image: -webkit-linear-gradient( #f9f9f9, #eee );
background-image: -moz-linear-gradient( #f9f9f9, #eee );
background-image: -ms-linear-gradient( #f9f9f9, #eee );
background-image: -o-linear-gradient( #f9f9f9, #eee );
background-image: linear-gradient( #f9f9f9, #eee );
}
/* Body: Read-only lists, text inputs, collapsible content */
.ui-body-slapos-white,
.ui-page-theme-slapos-white .ui-body-inherit,
html .ui-bar-slapos-white .ui-body-inherit,
html .ui-body-slapos-white .ui-body-inherit,
html body .ui-group-theme-slapos-white .ui-body-inherit,
.ui-overlay-slapos-white {
background-image: none;
background: #fff;
border-color: #aaa;
color: #111;
text-shadow: none;
}
.ui-body-slapos-white {
border-width: 1px;
border-style: solid;
}
/* Links */
.ui-page-theme-slapos-white a,
html .ui-bar-slapos-white a,
html .ui-body-slapos-white a
/* visited */
.ui-page-theme-slapos-white a:visited,
html .ui-bar-slapos-white a:visited,
html .ui-body-slapos-white a:visited,
html body .ui-group-theme-slapos-white a:visited,
/* hover */
.ui-overlay-slapos-white a:hover,
.ui-page-theme-slapos-white a:hover,
html .ui-bar-slapos-white a:hover,
html .ui-body-slapos-white a:hover,
html body .ui-group-theme-slapos-white a:hover,
.ui-overlay-slapos-white .ui-btn:hover,
.ui-page-theme-slapos-white .ui-btn:hover,
html .ui-bar-slapos-white .ui-btn:hover,
html .ui-body-slapos-white .ui-btn:hover,
html body .ui-group-theme-slapos-white .ui-btn:hover,
/* texts */
html body .ui-group-theme-slapos-white p, /* overwritten by ui-btn */
html body .ui-group-theme-slapos-white h1,
html body .ui-group-theme-slapos-white h2,
html body .ui-group-theme-slapos-white h3,
html body .ui-group-theme-slapos-white h4,
html body .ui-group-theme-slapos-white h5,
html body .ui-group-theme-slapos-white h6 {
color: rgb(115, 115, 115);
color: rgba(0, 0, 0, 0.55);
}
.ui-page-theme-slapos-white .ui-btn:active,
html .ui-bar-slapos-white .ui-btn:active,
html .ui-body-slapos-white .ui-btn:active,
html body .ui-group-theme-slapos-white .ui-btn:active {
color: #fff;
}
/* Button up */
.ui-page-theme-slapos-white .ui-btn,
html .ui-bar-slapos-white .ui-btn,
html .ui-body-slapos-white .ui-btn,
html body .ui-btn.ui-btn-slapos-white,
html body .ui-group-theme-slapos-white .ui-btn,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white,
.ui-page-theme-slapos-white .ui-bar-plain,
/* Button visited */
.ui-page-theme-slapos-white .ui-btn:visited,
html .ui-bar-slapos-white .ui-btn:visited,
html .ui-body-slapos-white .ui-btn:visited,
html body .ui-btn.ui-btn-slapos-white:visited,
html body .ui-group-theme-slapos-white .ui-btn:visited,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white:visited,
/* table wrappers
html .ui-page-theme-slapos-white .ui-table-wrapper-top,
html .ui-page-theme-slapos-white .ui-table-wrapper-bottom,*/
html .ui-page-theme-slapos-white .ui-table-wrapper-top ~ table,
html .ui-page-theme-slapos-white .ui-table-wrapper-bottom ~ table,
html .ui-page-theme-slapos-white table tr td a:visited {
background: #fff;
color: rgb(115, 115, 115);
color: rgba(0, 0, 0, 0.55);
text-shadow: none;
border-color: #aaa;
}
html .ui-page-theme-slapos-white .ui-input-clear:active,
html .ui-page-theme-slapos-white .ui-input-clear.ui-btn-active,
html .ui-page-theme-slapos-white .ui-input-action:active,
html .ui-page-theme-slapos-white .ui-input-action.ui-btn-active {
background: #fff !important;
}
/* Header Buttons */
.ui-page-theme-slapos-white .ui-header .ui-btn,
html .ui-bar-slapos-white .ui-header .ui-btn,
html .ui-body-slapos-white .ui-header .ui-btn,
html body .ui-header .ui-btn.ui-btn-slapos-white,
html body .ui-header .ui-group-theme-slapos-white .ui-btn,
.ui-header [class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white,
/* Button visited */
.ui-page-theme-slapos-white .ui-header .ui-btn:visited,
html .ui-bar-slapos-white .ui-header .ui-btn:visited,
html .ui-body-slapos-white .ui-header .ui-btn:visited,
html body .ui-header .ui-btn.ui-btn-slapos-white:visited,
html body .ui-header .ui-group-theme-slapos-white .ui-btn:visited,
.ui-header [class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white:visited,
.ui-page-theme-slapos-white .ui-header a:visited,
html .ui-bar-slapos-white .ui-header a:visited,
html .ui-body-slapos-white .ui-header a:visited,
html body .ui-header a.ui-btn-slapos-white:visited,
html body .ui-header .ui-group-theme-slapos-white a:visited,
.ui-header [class*="ui-group-theme-"] a.ui-btn-slapos-white:visited {
background: none repeat scroll 0 center transparent;
border: 0 none;
-webkit-border-radius: 0 0 0 0 /* iOS3 */ !important;
border-radius: 0 0 0 0 /* iOS3 */ !important;
-webkit-box-shadow: none /* iOS3 */ !important;
box-shadow: none /* iOS3 */ !important;
color: rgb(129, 137, 138);
color: rgba(0, 0, 0, 0.25);
text-shadow: none;
font-weight: normal;
line-height: 325% /* could also be 3.25em, but this is more flexible, while being crap! */;
}
/* Button special handling: panel listitems */
.ui-page-theme-slapos-white .ui-panel-inner li .ui-btn,
html .ui-bar-slapos-white .ui-panel-inner li .ui-btn,
html .ui-body-slapos-white .ui-panel-inner li .ui-btn,
html body .ui-panel-inner li .ui-btn.ui-btn-slapos-white,
html body .ui-panel-inner li .ui-group-theme-slapos-white .ui-btn,
[class*="ui-group-theme-"] .ui-panel-inner li .ui-btn.ui-btn-slapos-white,
/* Button visited */
.ui-page-theme-slapos-white .ui-panel-inner li .ui-btn:visited,
html .ui-bar-slapos-white .ui-panel-inner li .ui-btn:visited,
html .ui-body-slapos-white .ui-panel-inner li .ui-btn:visited,
html body .ui-panel-inner li .ui-btn.ui-btn-slapos-white:visited,
html body .ui-panel-inner li .ui-group-theme-slapos-white .ui-btn:visited,
[class*="ui-group-theme-"] .ui-panel-inner li .ui-btn.ui-btn-slapos-white:visited {
background: none repeat scroll 0 0 transparent;
border-color: rgb(232, 232, 232);
border-color: rgba(255,255,255,.3);
}
/* dropshadow */
html body .ui-group-theme-slapos-white li {
border-top: 1px solid #111;
}
html body .ui-group-theme-slapos-white li.ui-last-child {
border-top: 1px solid #111;
border-bottom: 1px solid #111;
}
html body .ui-group-theme-slapos-black li.ui-last-child a.ui-btn {
border-bottom: none
}
/* Button background hover */
.ui-page-theme-slapos-white .ui-btn:hover,
html .ui-bar-slapos-white .ui-btn:hover,
html .ui-body-slapos-white .ui-btn:hover,
html body .ui-btn.ui-btn-slapos-white:hover,
html body .ui-group-theme-slapos-white .ui-btn:hover,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white:hover,
/* table wrapper buttons */
html .ui-page-theme-slapos-white .ui-table-wrapper .ui-btn:hover,
/* table rows */
html .ui-page-theme-slapos-white table tr th:hover ~ td,
/* controlbars */
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn:hover,
/* tabs */
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn:hover {
background-color: #e8e8e8;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#e8e8e8));
background: -webkit-linear-gradient(bottom, #fff, #e8e8e8);
background: linear-gradient(bottom, #fff, #e8e8e8);
background: -moz-linear-gradient(bottom, #fff, #e8e8e8);
background: -o-linear-gradient(bottom, #fff, #e8e8e8);
background: -ms-linear-gradient(bottom, #fff, #e8e8e8);
}
/* slapos-black */
/*-----------------------------------------------------------------------------------------------------------*/
/* Bar: Toolbars, dividers, slider track */
.ui-bar-slapos-black,
.ui-page-theme-slapos-black .ui-bar-inherit,
html .ui-bar-slapos-black .ui-bar-inherit,
html .ui-body-slapos-black .ui-bar-inherit,
html body .ui-group-theme-slapos-black .ui-bar-inherit {
background: 0 none;
background: #222;
color: #fff;
text-shadow: 0 1px 0 #111111;
font-weight: normal;
}
.ui-bar-slapos-black {
border-width: 1px;
border-style: solid;
}
/* tables & controlbar & tabs */
html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-top .ui-btn,
html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-top .ui-plain-text,
html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-bottom .ui-btn,
html .ui-page-theme-slapos-black .ui-table-wrapper.ui-table-wrapper-bottom .ui-plain-text,
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn,
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn {
color: #444;
text-shadow: 0 1px 0 #111111;
}
/* tables & controlbars */
.ui-page-theme-slapos-black .ui-table {
background-color: #222;
border-color: rgb(232, 232, 232);
border-color: rgba(255,255,255,.3);
}
html .ui-page-theme-slapos-black .ui-table-wrapper,
html .ui-page-theme-slapos-black .ui-table-wrapper .ui-btn,
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn {
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
background-image: -webkit-linear-gradient( #444 , #222 );
background-image: -moz-linear-gradient( #444 , #222 );
background-image: -ms-linear-gradient( #444 , #222 );
background-image: -o-linear-gradient( #444 , #222 );
background-image: linear-gradient( #444 , #222 );
border-color: #444;
}
/* Page background */
.ui-page-theme-slapos-black,
.ui-page-theme-slapos-black .ui-panel-wrapper {
color: #fff;
text-shadow: 0 1px 0 #111111;
background: #222;
border-color: #444;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
background-image: -webkit-linear-gradient( #444 , #222 );
background-image: -moz-linear-gradient( #444 , #222 );
background-image: -ms-linear-gradient( #444 , #222 );
background-image: -o-linear-gradient( #444 , #222 );
background-image: linear-gradient( #444 , #222 );
}
/* Body: Read-only lists, text inputs, collapsible content */
.ui-body-slapos-black,
.ui-page-theme-slapos-black .ui-body-inherit,
html .ui-bar-slapos-black .ui-body-inherit,
html .ui-body-slapos-black .ui-body-inherit,
html body .ui-group-theme-slapos-black .ui-body-inherit,
.ui-overlay-slapos-black,
html .ui-page-theme-slapos-black .ui-table-wrapper {
color: #fff;
text-shadow: 0 1px 0 #111111;
background: #222;
border-color: #444;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
background-image: -webkit-linear-gradient( #444 , #222 );
background-image: -moz-linear-gradient( #444 , #222 );
background-image: -ms-linear-gradient( #444 , #222 );
background-image: -o-linear-gradient( #444 , #222 );
background-image: linear-gradient( #444 , #222 );
}
.ui-body-slapos-black {
border-width: 1px;
border-style: solid;
}
/* Input filterable */
html .ui-body-slapos-black .ui-body-inherit.ui-input-search {
background-image: none;
}
/* Links */
.ui-page-theme-slapos-black a,
html .ui-bar-slapos-black a,
html .ui-body-slapos-black a,
html body .ui-group-theme-slapos-black a,
/* visited */
.ui-page-theme-slapos-black a:visited,
html .ui-bar-slapos-black a:visited,
html .ui-body-slapos-black a:visited,
html body .ui-group-theme-slapos-black a:visited,
/* hover */
.ui-overlay-slapos-black a:hover,
.ui-page-theme-slapos-black a:hover,
html .ui-bar-slapos-black a:hover,
html .ui-body-slapos-black a:hover,
html body .ui-group-theme-slapos-white a:hover,
.ui-overlay-slapos-black .ui-btn:hover,
.ui-page-theme-slapos-black .ui-btn:hover,
html .ui-page-theme-slapos-black .ui-btn:hover,
html .ui-page-theme-slapos-black .ui-btn:hover,
html body .ui-group-theme-slapos-black .ui-btn:hover,
/* active */
.ui-page-theme-slapos-black .ui-btn:active,
html .ui-bar-slapos-black .ui-btn:active,
html .ui-body-slapos-black .ui-btn:active,
html body .ui-group-theme-slapos-black .ui-btn:active,
/* Texts */
html body .ui-group-theme-slapos-black p,
html body .ui-group-theme-slapos-black h1,
html body .ui-group-theme-slapos-black h2,
html body .ui-group-theme-slapos-black h3,
html body .ui-group-theme-slapos-black h4,
html body .ui-group-theme-slapos-black h5,
html body .ui-group-theme-slapos-black h6 {
color: #fff;
}
/* Button up */
.ui-page-theme-slapos-black .ui-btn,
html .ui-bar-slapos-black .ui-btn,
html .ui-body-slapos-black .ui-btn,
html body .ui-btn.ui-btn-slapos-black,
html body .ui-group-theme-slapos-black .ui-btn,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black,
.ui-page-theme-slapos-black .ui-bar-plain,
/* Button visited */
.ui-page-theme-slapos-black .ui-btn:visited,
html .ui-bar-slapos-black .ui-btn:visited,
html .ui-body-slapos-black .ui-btn:visited,
html body .ui-btn.ui-btn-slapos-black:visited,
html body .ui-group-theme-slapos-black .ui-btn:visited,
[class*="ui-group-theme-"] a.ui-btn-slapos-black:visited,
.ui-page-theme-slapos-black a:visited,
html .ui-bar-slapos-black a:visited,
html .ui-body-slapos-black a:visited,
html body a.ui-btn-slapos-black:visited,
html body .ui-group-theme-slapos-black a:visited,
[class*="ui-group-theme-"] a.ui-btn-slapos-black:visited,
html .ui-page-theme-slapos-black table tr td a:visited,
/* table wrappers
html .ui-page-theme-slapos-black .ui-table-wrapper-top,
html .ui-page-theme-slapos-black .ui-table-wrapper-bottom, */
html .ui-page-theme-slapos-black .ui-table-wrapper-top ~ table,
html .ui-page-theme-slapos-black .ui-table-wrapper-bottom ~ table {
background: #222;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
background-image: -webkit-linear-gradient( #444 , #222 );
background-image: -moz-linear-gradient( #444 , #222 );
background-image: -ms-linear-gradient( #444 , #222 );
background-image: -o-linear-gradient( #444 , #222 );
background-image: linear-gradient( #444 , #222 );
border-color: #444;
color: #fff;
text-shadow: 0px 1px 0px #111;
}
html .ui-page-theme-slapos-black .ui-input-clear:active,
html .ui-page-theme-slapos-black .ui-input-clear.ui-btn-active,
html .ui-page-theme-slapos-black .ui-input-action:active,
html .ui-page-theme-slapos-black .ui-input-action.ui-btn-active {
background: #222 !important;
}
/* Header Buttons */
.ui-page-theme-slapos-black .ui-header .ui-btn,
html .ui-bar-slapos-black .ui-header .ui-btn,
html .ui-body-slapos-black .ui-header .ui-btn,
html body .ui-header .ui-btn.ui-btn-slapos-black,
html body .ui-header .ui-group-theme-slapos-black .ui-btn,
.ui-header [class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black,
/* Button visited */
.ui-page-theme-slapos-black .ui-header .ui-btn:visited,
html .ui-bar-slapos-black .ui-header .ui-btn:visited,
html .ui-body-slapos-black .ui-header .ui-btn:visited,
html body .ui-header .ui-btn.ui-btn-slapos-black:visited,
html body .ui-header .ui-group-theme-slapos-black .ui-btn:visited,
.ui-header [class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black:visited,
/* ADD also not on :hover */
.ui-page-theme-slapos-black .ui-header .ui-btn:hover,
html .ui-bar-slapos-black .ui-header .ui-btn:hover,
html .ui-body-slapos-black .ui-header .ui-btn:hover,
html body .ui-header .ui-btn.ui-btn-slapos-black:hover,
html body .ui-header .ui-group-theme-slapos-black .ui-btn:hover,
.ui-header [class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black:hover {
background: none repeat scroll 0 center transparent;
-webkit-border-radius: 0 0 0 0 /* iOS3 */ !important;
border-radius: 0 0 0 0 /* iOS3 */ !important;
-webkit-box-shadow: none /* iOS3 */ !important;
box-shadow: none /* iOS3 */ !important;
color: #fff;
text-shadow: none;
font-weight: normal;
line-height: 325% /* could also be 3.25em, but this is more flexible, while being crap! */;
}
/* Button special handling: listitem */
.ui-page-theme-slapos-black .ui-panel-inner li .ui-btn,
html .ui-bar-slapos-black .ui-panel-inner li .ui-btn,
html .ui-body-slapos-black .ui-panel-inner li .ui-btn,
html body .ui-panel-inner li .ui-btn.ui-btn-slapos-black,
html body .ui-panel-inner li .ui-group-theme-slapos-black .ui-btn,
[class*="ui-group-theme-"] .ui-panel-inner li .ui-btn.ui-btn-slapos-black,
/* Button visited */
.ui-page-theme-slapos-black .ui-panel-inner li .ui-btn:visited,
html .ui-bar-slapos-black .ui-panel-inner li .ui-btn:visited,
html .ui-body-slapos-black .ui-panel-inner li .ui-btn:visited,
html body .ui-panel-inner li .ui-btn.ui-btn-slapos-black:visited,
html body .ui-panel-inner li .ui-group-theme-slapos-black .ui-btn:visited,
[class*="ui-group-theme-"] .ui-panel-inner li .ui-btn.ui-btn-slapos-black:visited {
background: none repeat scroll 0 0 transparent;
border-color: rgb(232, 232, 232);
border-color: rgba(255,255,255,.3);
}
/* dropshadow */
html body .ui-group-theme-slapos-black li {
border-top: 1px solid #111;
}
html body .ui-group-theme-slapos-black li.ui-last-child {
border-bottom: 1px solid #111;
}
html body .ui-group-theme-slapos-black li.ui-last-child a.ui-btn {
border-bottom: none
}
/* Button hover */
.ui-page-theme-slapos-black .ui-btn:hover,
html .ui-bar-slapos-black .ui-btn:hover,
html .ui-body-slapos-black .ui-btn:hover,
html body .ui-btn.ui-btn-slapos-black:hover,
html body .ui-group-theme-slapos-black .ui-btn:hover,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black:hover,
/* table wrapper buttons */
html .ui-page-theme-slapos-black .ui-table-wrapper .ui-btn:hover,
/* table rows */
html .ui-page-theme-slapos-black table tr th:hover ~ td,
/* controlbars */
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn:hover,
/* tabs */
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn:hover {
background: #222;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 ));
background-image: -webkit-linear-gradient( #444 , #222 );
background-image: -moz-linear-gradient( #444 , #222 );
background-image: -ms-linear-gradient( #444 , #222 );
background-image: -o-linear-gradient( #444 , #222 );
background-image: linear-gradient( #444 , #222 );
border-color: rgb(232, 232, 232);
border-color: rgba(255,255,255,.3);
/* border-color: #444 */
color: #fff;
text-shadow: 0px 1px 0px #111;
}
/* swatch "active" - need this for every swatch!!! */
/*-----------------------------------------------------------------------------------------------------------*/
/* Count bubble */
/* white */
.ui-page-theme-slapos-white .ui-li-count,
html .ui-bar-slapos-white .ui-li-count,
html .ui-body-slapos-white .ui-li-count,
html body .ui-group-theme-slapos-white .ui-li-count,
.ui-btn.ui-btn-slapos-white > .ui-li-count,
.ui-li-static.ui-body-slapos-white > .ui-li-count,
.ui-li-divider.ui-bar-slapos-white > .ui-li-count,
.ui-listview li .ui-li-count.ui-body-slapos-white,
/* black */
.ui-page-theme-slapos-black .ui-li-count,
html .ui-bar-slapos-black .ui-li-count,
html .ui-body-slapos-black .ui-li-count,
html body .ui-group-theme-slapos-black .ui-li-count,
.ui-btn.ui-btn-slapos-black > .ui-li-count,
.ui-li-static.ui-body-slapos-black > .ui-li-count,
.ui-li-divider.ui-bar-slapos-black > .ui-li-count,
.ui-listview li .ui-li-count.ui-body-slapos-black {
color: #ffffff;
font-size: .8em;
text-shadow: none;
font-weight: bold;
font-family: arial;
-webkit-box-shadow: 0 1px 2px #999;
box-shadow: 0 1px 2px #999;
padding: 0 6px 1px;
border: 0.15em solid #ffffff;
border-radius: 14px;
-moz-border-radius: 14px;
-webkit-border-radius: 14px;
display: inline-block;
background-position: 0 0 !important;
position: absolute;
right: 0;
line-height: 1.75em;
top: -14px;
background-color: #0FBABD;
background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0,#0FBABD),color-stop(1,#94f2f1));
background-image: -webkit-linear-gradient(top, #0FBABD, #94f2f1);
background-image: linear-gradient(top, #0FBABD, #94f2f1);
background-image: -moz-linear-gradient(top, #0FBABD, #94f2f1);
background-image: -o-linear-gradient(top, #0FBABD, #94f2f1);
background-image: -ms-linear-gradient(top, #0FBABD, #94f2f1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#0FBABD', EndColorStr='#94f2f1');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#0FBABD', EndColorStr='#94f2f1')";
}
/* Button down */
html .ui-page-theme-slapos-white .ui-bar-active, /* if we do more like this, we need to have a proper theme */
.ui-page-theme-slapos-white .ui-btn:active,
html .ui-bar-slapos-white .ui-btn:active,
html .ui-body-slapos-white .ui-btn:active,
html body .ui-btn.ui-btn-slapos-white:active,
html body .ui-group-theme-slapos-white .ui-btn:active,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white:active,
/* Active button */
.ui-page-theme-slapos-white .ui-btn.ui-btn-active,
html .ui-bar-slapos-white .ui-btn.ui-btn-active,
html .ui-body-slapos-white .ui-btn.ui-btn-active,
html body .ui-btn.ui-btn-slapos-white.ui-btn-active,
html body .ui-group-theme-slapos-white .ui-btn.ui-btn-active,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white.ui-btn-active,
/* radio button */
.ui-page-theme-slapos-white .ui-btn.ui-icon-radio-on,
html .ui-bar-slapos-white .ui-btn.ui-icon-radio-on,
html .ui-body-slapos-white .ui-btn.ui-icon-radio-on,
html body .ui-group-theme-slapos-white .ui-btn.ui-icon-radio-on,
.ui-btn.ui-icon-radio-on.ui-btn-slapos-white,
/* Active flipswitch background */
.ui-page-theme-slapos-white .ui-flipswitch-active,
html .ui-bar-slapos-white .ui-flipswitch-active,
html .ui-body-slapos-white .ui-flipswitch-active,
html body .ui-group-theme-slapos-white .ui-flipswitch-active,
html body .ui-flipswitch.ui-bar-slapos-white.ui-flipswitch-active,
/* Active slider track */
.ui-page-theme-slapos-white .ui-slider-track .ui-btn-active,
html .ui-bar-slapos-white .ui-slider-track .ui-btn-active,
html .ui-body-slapos-white .ui-slider-track .ui-btn-active,
html body .ui-group-theme-slapos-white .ui-slider-track .ui-btn-active,
html body div.ui-slider-track.ui-body-slapos-white .ui-btn-active,
/* Table buttons */
html .ui-page-theme-slapos-white .ui-table-wrapper .ui-btn:active,
html .ui-page-theme-slapos-white .ui-table-wrapper .ui.btn.ui-btn-active,
/* Controlbar */
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn:active,
html .ui-page-theme-slapos-white .ui-controlbar .ui-btn.ui-btn-active,
/* Tab Buttons */
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn:active,
html .ui-page-theme-slapos-white .ui-collapsible-set .ui-collapsible h1 a.ui-btn.ui-btn-active,
/* black */
html .ui-page-theme-slapos-black .ui-bar-active,
.ui-page-theme-slapos-black .ui-btn:active,
html .ui-bar-slapos-black .ui-btn:active,
html .ui-body-slapos-black .ui-btn:active,
html body .ui-btn.ui-btn-slapos-black:active,
html body .ui-group-theme-slapos-black .ui-btn:active,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black:active,
/* Active button */
.ui-page-theme-slapos-black .ui-btn.ui-btn-active,
html .ui-bar-slapos-black .ui-btn.ui-btn-active,
html .ui-body-slapos-black .ui-btn.ui-btn-active,
html body .ui-btn.ui-btn-slapos-black.ui-btn-active,
html body .ui-group-theme-slapos-black .ui-btn.ui-btn-active,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black.ui-btn-active,
/* radio on */
.ui-page-theme-slapos-black .ui-btn.ui-icon-radio-on,
html .ui-bar-slapos-black .ui-btn.ui-icon-radio-on,
html .ui-body-slapos-black .ui-btn.ui-icon-radio-on,
html body .ui-group-theme-slapos-black .ui-btn.ui-icon-radio-on,
.ui-btn.ui-icon-radio-on.ui-btn-slapos-black ,
/* Active flipswitch background */
.ui-page-theme-slapos-black .ui-flipswitch-active,
html .ui-bar-slapos-black .ui-flipswitch-active,
html .ui-body-slapos-black .ui-flipswitch-active,
html body .ui-group-theme-slapos-black .ui-flipswitch-active,
html body .ui-flipswitch.ui-bar-slapos-black.ui-flipswitch-active,
/* Active slider track */
.ui-page-theme-slapos-black .ui-slider-track .ui-btn-active,
html .ui-bar-slapos-black .ui-slider-track .ui-btn-active,
html .ui-body-slapos-black .ui-slider-track .ui-btn-active,
html body .ui-group-theme-slapos-black .ui-slider-track .ui-btn-active,
html body div.ui-slider-track.ui-body-slapos-black .ui-btn-active,
/* Table buttons */
html .ui-page-theme-slapos-black .ui-table-wrapper .ui-btn:active,
html .ui-page-theme-slapos-black .ui-table-wrapper .ui.btn.ui-btn-active,
/* Controlbar */
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn:active,
html .ui-page-theme-slapos-black .ui-controlbar .ui-btn.ui-btn-active,
/* Tab Buttons */
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn:active,
html .ui-page-theme-slapos-black .ui-collapsible-set .ui-collapsible h1 a.ui-btn.ui-btn-active {
background-color: #94f2f1;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0fbabd), to(#94f2f1));
background: -webkit-linear-gradient(bottom, #0fbabd, #94f2f1);
background: linear-gradient(bottom, #0fbabd, #94f2f1);
background: -moz-linear-gradient(bottom, #0fbabd, #94f2f1);
background: -o-linear-gradient(bottom, #0fbabd, #94f2f1);
background: -ms-linear-gradient(bottom, #0fbabd, #94f2f1);
color: #fff !important;
text-shadow: none;
cursor: pointer;
}
/* Active radio button */
/* white */
.ui-page-theme-slapos-white .ui-btn.ui-icon-radio-on:after,
html .ui-bar-slapos-white .ui-btn.ui-icon-radio-on:after,
html .ui-body-slapos-white .ui-btn.ui-icon-radio-on:after,
html body .ui-group-theme-slapos-white .ui-btn.ui-icon-radio-on:after,
.ui-btn.ui-icon-radio-on.ui-btn-slapos-white:after,
/* black */
.ui-page-theme-slapos-black .ui-btn.ui-icon-radio-on:after,
html .ui-bar-slapos-black .ui-btn.ui-icon-radio-on:after,
html .ui-body-slapos-black .ui-btn.ui-icon-radio-on:after,
html body .ui-group-theme-slapos-black .ui-btn.ui-icon-radio-on:after,
.ui-btn.ui-icon-radio-on.ui-btn-slapos-black:after {
border-color: #fff;
}
/* Focus */
/* white */
.ui-page-theme-slapos-white .ui-btn:focus,
html .ui-bar-slapos-white .ui-btn:focus,
html .ui-body-slapos-white .ui-btn:focus,
html body .ui-btn.ui-btn-slapos-white:focus,
html body .ui-group-theme-slapos-white .ui-btn:focus,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-white:focus,
/* Focus buttons and text inputs with div wrap */
.ui-page-theme-slapos-white .ui-focus,
html .ui-bar-slapos-white .ui-focus,
html .ui-body-slapos-white .ui-focus,
html body .ui-btn-slapos-white.ui-focus,
html body .ui-body-slapos-white.ui-focus,
html body .ui-group-theme-slapos-white .ui-focus,
[class*="ui-group-theme-"] .ui-btn-slapos-white.ui-focus,
[class*="ui-group-theme-"] .ui-body-slapos-white.ui-focus,
/* black */
.ui-page-theme-slapos-black .ui-btn:focus,
html .ui-bar-slapos-black .ui-btn:focus,
html .ui-body-slapos-black .ui-btn:focus,
html body .ui-btn.ui-btn-slapos-black:focus,
html body .ui-group-theme-slapos-black .ui-btn:focus,
[class*="ui-group-theme-"] .ui-btn.ui-btn-slapos-black:focus,
/* Focus buttons and text inputs with div wrap */
.ui-page-theme-slapos-black .ui-focus,
html .ui-bar-slapos-black .ui-focus,
html .ui-body-slapos-black .ui-focus,
html body .ui-btn-slapos-black.ui-focus,
html body .ui-body-slapos-black.ui-focus,
html body .ui-group-theme-slapos-black .ui-focus,
[class*="ui-group-theme-"] .ui-btn-slapos-black.ui-focus,
[class*="ui-group-theme-"] .ui-body-slapos-black.ui-focus {
-webkit-box-shadow: 0 0 12px #0066ff;
-moz-box-shadow: 0 0 12px #0066ff;
box-shadow: 0 0 12px #0066ff;
}
/* ================================ overwriting widgets ==================================== */
/* toolbar */
/* unset theme overwriting structure */
.ui-header, .ui-footer {
border-width: 1px 0;
}
.ui-header .wrap {
position: absolute;
/* top: 0; JQM: setting this will throw off header by 1px when ui-header-fixed is removed */
bottom: 0;
}
.ui-header .wrap.left {
left: 0;
}
.ui-header .wrap.right {
right: 0;
}
/* double borders */
.ui-header .wrap.left .ui-btn {
border-right: 1px solid rgb(232, 232, 232);
border-right: 1px solid rgba(232, 232, 232, 0.1);
}
.ui-header .wrap.right .ui-btn {
border-left: 1px solid rgb(47, 79, 79);
border-left: 1px solid rgba(0, 0, 0, 0.25);
}
.ui-header .wrap .ui-btn:before {
content: "";
height: 100%;
position: absolute;
width: 0;
bottom: 0;
top: 0;
}
.ui-header .wrap.left .ui-btn:before {
right: -1px;
border-right: 1px solid rgb(47, 79, 79);
border-right: 1px solid rgba(0, 0, 0, 0.25);
}
.ui-header .wrap.right .ui-btn:before {
left: -1px;
border-left: 1px solid rgb(232, 232, 232);
border-left: 1px solid rgba(232, 232, 232, 0.1);
}
/* controlgroup */
/* > overwrite in header */
.ui-page-theme-slapos-white .ui-header .ui-controlgroup,
.ui-page-theme-slapos-white .ui-header .ui-controlgroup fieldset.ui-controlgroup {
padding: 0;
margin: 0;
height: 100%;
}
.ui-page-theme-slapos-white .ui-header .ui-controlgroup-controls {
height: 100%;
}
/* button */
.ui-page-theme-slapos-white .ui-header a.ui-btn ,
html .ui-bar-slapos-white.ui-header a.ui-btn ,
html .ui-body-slapos-white .ui-header a.ui-btn ,
html body .ui-group-theme-slapos-white .ui-header a.ui-btn {
height: 100%;
margin: 0;
position: relative; /* otherwise multiple buttons break */
padding-top: 0;
padding-bottom: 0;
}
html .ui-btn, label.ui-btn {
font-weight: normal;
}
/* hide button text on small screens */
@media (max-width: 40em) {
.responsive.ui-btn,
.responsive .ui-btn {
text-indent: -9999px;
white-space: nowrap !important;
}
.responsive.ui-btn:after,
.responsive .ui-btn:after {
text-indent: 0px;
left: auto;
}
}
/* no bold buttons */
html .ui-btn, label.ui-btn {
font-weight: normal;
}
/* fix svg icon positioning */
.ui-btn-icon-notext:after,
.ui-btn-icon-left:after,
.ui-btn-icon-right:after,
.ui-listview > li > .ui-btn[class*="ui-icon-"]:after {
margin-top: -15px;
}
/* reset fix */
.ui-nosvg .ui-btn-icon-notext:after,
.ui-nosvg .ui-btn-icon-left:after,
.ui-nosvg .ui-btn-icon-right:after,
.ui-nosvg .ui-listview > li > .ui-btn[class*="ui-icon-"]:after {
margin-top: -11px;
}
/* fix text-indent when trying to use custom icons on iconpos-notext buttons */
.ui-btn-icon-notext {
text-indent: -9999px;
}
.ui-btn-icon-notext:after {
text-indent: 0px;
}
/* fix font-size on notext buttons, so icons don't zoom, JQMs-px font-size */
.ui-header .ui-btn-icon-notext,
.ui-footer .ui-btn-icon-notext {
font-size: 12.5px;
}
/* popup */
.ui-popup {
max-width: 20em; /* so... all popups should get this??? */
/* width: 25%; does not work, because max-width will still be screen-padding */
min-width: 20em;
margin: 0 auto;
}
@media (max-width: 40em) {
.ui-popup {
min-width: auto;
margin: 0;
width: auto;
}
}
.ui-popup fieldset {
display: block; /* fix offset caused when using display: table-column */
}
/* panel */
.ui-panel {
border-width: 0px; /* overwrite border-width reset by panel-swatch ui-overlay... */
}
/* panel closer */
html .ui-panel-inner .ui-btn.panel-close {
background-color: transparent;
background-image: none;
margin: 12px 0.3125em 0; /* no friend ... */
}
html .ui-panel-inner .ui-btn.panel-close:hover {
border-color: transparent;
}
html .ui-panel-inner .ui-btn.panel-close:after {
font-size: 1.25em;
margin-top: -12px; /* no friend ... */
}
html .ui-panel-inner .ui-btn.panel-close {
position: absolute !important;
top: 0;
left: -9999px;
clip: rect(1px 1px 1px 1px);
}
@media (max-width: 30em) {
html .ui-panel-inner .ui-btn.panel-close {
right: .5em;
left: auto;
clip: auto !important;
}
}
/* panel search input overriding width */
html .ui-panel-inner .ui-input-search {
margin: 2% 1%;
}
@media (max-width: 30em) {
html .ui-panel-inner .ui-input-search {
width: 77%;
}
}
@media (max-width: 25em) {
html .ui-panel-inner .ui-input-search {
width: 77%;
}
}
@media (max-width: 20em) {
html .ui-panel-inner .ui-input-search {
width: 77%;
}
}
/* filterable */
html .ui-filterable {
width: 75%;
margin: 0 auto;
}
@media (max-width: 40em) {
html .ui-filterable {
width: 100%;
margin: 0.5em 0;
}
}
/* extend panel to fullwidth on small screens */
@media (max-width: 30em) {
/* override JQM 17em */
.ui-panel {
width: 100%;
}
/* positioning: panel */
/* panel left */
.ui-panel-position-left {
left: -100%;
}
/* animated: panel left (for overlay and push) */
.ui-panel-animate.ui-panel-position-left.ui-panel-display-overlay,
.ui-panel-animate.ui-panel-position-left.ui-panel-display-push {
left: 0;
-webkit-transform: translate3d(-100%,0,0);
-moz-transform: translate3d(-100%,0,0);
transform: translate3d(-100%,0,0);
}
/* panel left open */
.ui-panel-position-left.ui-panel-display-reveal, /* negate "panel left" for reveal */
.ui-panel-position-left.ui-panel-open {
left: 0;
}
/* animated: panel left open (for overlay and push) */
.ui-panel-animate.ui-panel-position-left.ui-panel-open.ui-panel-display-overlay,
.ui-panel-animate.ui-panel-position-left.ui-panel-open.ui-panel-display-push {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
-moz-transform: none;
}
/* panel right */
.ui-panel-position-right {
right: -100%;
}
/* animated: panel right (for overlay and push) */
.ui-panel-animate.ui-panel-position-right.ui-panel-display-overlay,
.ui-panel-animate.ui-panel-position-right.ui-panel-display-push {
right: 0;
-webkit-transform: translate3d(100%,0,0);
-moz-transform: translate3d(100%,0,0);
transform: translate3d(100%,0,0);
}
/* panel right open */
.ui-panel-position-right.ui-panel-display-reveal, /* negate "panel right" for reveal */
.ui-panel-position-right.ui-panel-open {
right: 0;
}
/* animated: panel right open (for overlay and push) */
.ui-panel-animate.ui-panel-position-right.ui-panel-open.ui-panel-display-overlay,
.ui-panel-animate.ui-panel-position-right.ui-panel-open.ui-panel-display-push {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
-moz-transform: none;
}
/* positioning: pages, fixed toolbars and dismiss */
/* panel left open */
.ui-panel-page-content-position-left.ui-panel-page-content-open,
.ui-panel-dismiss-position-left.ui-panel-dismiss-open {
left: 100%;
right: -100%;
}
/* animated: panel left open (for reveal and push) */
.ui-panel-animate.ui-panel-page-content-position-left.ui-panel-page-content-open.ui-panel-page-content-display-reveal,
.ui-panel-animate.ui-panel-page-content-position-left.ui-panel-page-content-open.ui-panel-page-content-display-push {
left: 0;
right: 0;
-webkit-transform: translate3d(100%,0,0);
-moz-transform: translate3d(100%,0,0);
transform: translate3d(100%,0,0);
}
/* panel right open */
.ui-panel-page-content-position-right.ui-panel-page-content-open,
.ui-panel-dismiss-position-right.ui-panel-dismiss-open {
left: -100%;
right: 100%;
}
/* animated: panel right open (for reveal and push) */
.ui-panel-animate.ui-panel-page-content-position-right.ui-panel-page-content-open.ui-panel-page-content-display-reveal,
.ui-panel-animate.ui-panel-page-content-position-right.ui-panel-page-content-open.ui-panel-page-content-display-push {
left: 0;
right: 0;
-webkit-transform: translate3d(-100%,0,0);
-moz-transform: translate3d(-100%,0,0);
transform: translate3d(-100%,0,0);
}
/* negate "panel left/right open" for overlay */
.ui-panel-page-content-open.ui-panel-page-content-display-overlay {
left: 0;
}
}
/* allow interaction with page on large displays */
@media (min-width: 30em) {
/* wrap on wide viewports once open */
.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-left,
.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-left,
.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-left,
.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-left {
margin-right: 17em;
}
.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-right,
.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-right,
.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-right,
.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-right {
margin-left: 17em;
}
.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push,
.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal {
width: auto;
}
/* disable "dismiss" on wide viewports */
.ui-panel-dismiss {
display: none;
}
/* same as the above but for panels with display mode "push" only */
.ui-panel-dismiss-display-push {
display: none;
}
}
/* action/input buttons */
.bare_button,
.bare_button .ui-btn-inner,
.bare_button .ui-icon {
background: 0 none;
border: 0 none;
box-shadow: none !important;
-webkit-box-shadow: none !important;
}
.bare_button .ui-icon {
bottom: 0;
line-height: 1em;
margin: 0;
text-align: center;
top: 31%;
font-size: 1.25em;
border-radius: 0px !important;
-webkit-border-radius: 0px !important;
}
/* listview/list */
/* plain list */
.list {
list-style: none;
text-align: center;
padding: 0;
margin: 0.5em 0;
}
.list li a {
text-decoration: none;
}
/* listview */
/* should support!
<li>
<a> || no link
<span.icon> || <span.iconstack><i><i><i> || no icon
<img> || no image
<h3> required
<p> || no subtext
<span.bubble> || no bubble
</a>
<a> || no side link
</li>
*/
html .ui-panel-inner .listview .ui-li-divider {
font-weight: bold;
padding: 0.5em 1em;
border: 0 none;
}
html .ui-panel-inner .listview .listview_item a {
padding: 0.4em 2.75em !important;
}
.ui-panel-inner .ui-listview > li h1,
.ui-panel-inner .ui-listview > li h2,
.ui-panel-inner .ui-listview > li h3,
.ui-panel-inner .ui-listview > li h4,
.ui-panel-inner .ui-listview > li h5,
.ui-panel-inner .ui-listview > li h6 {
font-size: .9em;
margin: 0;
}
.ui-panel-inner .ui-listview > li p {
font-size: .7em;
margin: 0;
}
.ui-panel-inner .ui-listview .ui-li-has-thumb > img:first-child,
.ui-panel-inner .ui-listview .ui-li-has-thumb > .ui-btn > img:first-child {
max-height: 2.5em;
max-width: 2.5em;
overflow: hidden;
padding: 0.2em 0;
}
/* overwrite icon positioning for fontawesome */
.ui-panel-inner .ui-btn-icon-right:after,
.ui-panel-inner .ui-listview > li > .ui-btn[class*="ui-icon-"]:after {
right: 0;
}
.ui-btn-icon-right:after,
.ui-listview > li > .ui-btn[class*="ui-icon-"]:after {
right: 0.3625em;
}
/* reset */
html.ui-nosvg .ui-btn-icon-right:after,
html.ui-nosvg .ui-panel-inner .ui-listview > li > .ui-btn[class*="ui-icon-"]:after {
right: 0.5625em;
}
.ui-btn.ui-btn-icon-left:after {
left: 0.3625em;
}
html.ui-nosvg .ui-btn-icon-left:after {
left: 0.5625em;
}
/* custom icons */
.ui-listview li span.ui-li-icon-custom {
bottom: 0;
top: 0;
box-shadow: none !important;
font-size: 1.25em;
height: 100%;
left: 0.25em;
line-height: 1em;
margin: 0;
max-height: 80px;
max-width: 80px;
position: absolute;
text-align: center;
width: 22px;
top: 19%; /* no friend... */
}
.ui-listview li span.ui-li-icon-custom:after {
background: none repeat scroll 0 center transparent;
}
/* checkboxradio */
/* overwrite icon background for fontawesome */
.ui-radio .ui-btn.ui-icon-radio-on:after {
background: 0 none;
border-width: 0;
}
/* reset */
.ui-nosvg .ui-radio .ui-btn-ui-icon-radio-on:after {
background-color: #FFFFFF;
background-image: none;
border-width: 5px;
}
/* position icons */
.ui-radio .ui-btn.ui-icon-radio-on:after,
.ui-radio .ui-btn.ui-icon-radio-off:after,
.ui-checkbox .ui-btn.ui-icon-checkbox-on:after,
.ui-checkbox .ui-btn.ui-icon-checkbox-off:after {
margin: -14px 2px 0;
}
/* icon size */
.ui-checkbox .ui-btn.ui-icon-checkbox-on:after,
.ui-checkbox .ui-btn.ui-icon-checkbox-off:after {
font-size: 1.25em;
opacity: 1; /* overwrite JQM .3 for off... */
}
/* reset */
.ui-nosvg .ui-radio .ui-btn.ui-icon-radio-on:after,
.ui-nosvg .ui-radio .ui-btn.ui-icon-radio-off:after,
.ui-checkbox .ui-btn.ui-icon-checkbox-on:after,
.ui-checkbox .ui-btn.ui-icon-checkbox-off:after {
margin: -9px 2px 0;
}
/* filterable */
html .ui-panel-inner .ui-input-search.ui-input-has-clear .ui-btn.ui-input-clear,
html .ui-panel-inner .ui-input-search .ui-input-action {
background-image: none;
margin: -9px 0.3125em 0;
}
html .ui-input-search .ui-input-clear:after,
html .ui-input-search .ui-input-action:after {
margin-top: -12px;
}
html .ui-panel-inner .ui-input-search .ui-input-clear:after,
html .ui-panel-inner .ui-input-search .ui-input-action:after {
margin-top: -16px;
}
/* reset */
html.ui-nosvg .ui-panel-inner .ui-input-search.ui-input-has-clear .ui-btn.ui-input-clear,
html.ui-nosvg .ui-panel-inner .ui-input-search .ui-input-action {
margin: -15px 0.3125em 0;
}
html .ui-panel-inner .ui-input-search .ui-input-clear:after,
html .ui-panel-inner .ui-input-search .ui-input-action:after {
font-size: 1.25em;
}
html .ui-panel-inner .ui-input-search .ui-input-clear:focus,
html .ui-panel-inner .ui-input-search .ui-input-action:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
html .ui-input-search .ui-input-action {
display:none;
}
html .ui-input-search input:focus ~ .ui-input-action,
html .ui-input-search input.ui-focus ~ .ui-input-action{
display:block;
}
html body .ui-input-search .ui-input-clear:hover,
html body .ui-input-search .ui-input-clear:active {
background: transparent;
background-image: none;
-webkit-box-shadow: none /* iOS3 */ !important;
box-shadow: none /* iOS3 */ !important;
}
/* collapsibles - fix default 200% font-size set by browser */
html .ui-collapsible h1 {
font-size: 100%; /* clean this up... should not be necessary */
}
html .ui-collapsible .ui-collapsible-content .ui-listview li a.ui-btn {
font-weight: normal;
}
/* custom bar */
.ui-bar-plain {
padding: .7em 1em;
border: 1px solid;
font-size: 1em;
}
/* search filter bar? */
.ui-controlbar {
margin-top: 1em;
margin-bottom: 1em;
}
.ui-controlbar .ui-plain-text {
display: block;
font-size: 80%;
}
/* selectmenu */
.ui-select .ui-btn-corner-all,
.ui-select .ui-btn.ui-corner-all {
border-radius: .6em;
-webkit-border-radius: .6em;
/* padding-bottom: 6px;
padding-top: 7px;
*/
}
/* inside controlgroup */
.ui-controlgroup .ui-controlgroup-controls div.ui-select,
.ui-controlgroup .ui-controlgroup-controls div.ui-select div.ui-btn {
border-radius: 0;
-webkit-border-radius: 0;
}
html .ui-select .ui-btn-icon-notext:after,
html .ui-select .ui-btn-icon-left:after,
html .ui-select .ui-btn-icon-right:after {
margin-top: -12px;
}
.ui-input-text .ui-input-clear:hover {
background: transparent;
}
/* breadcrumbs - need work!
.ui-breadcrumbs {
background: none repeat scroll 0 0 #DDDDDD;
border-bottom: 1px solid #81898A;
box-shadow: 0 -7px 4px -6px #aaa inset;
-webkit-box-shadow: 0 -7px 4px -6px #aaa inset;
display: block;
margin: -15px -15px 0;
padding: 0.5em 0;
white-space: nowrap;
}
/* experimental ... thx http://fiddle.jshell.net/leaverou/EjE7c/show/light */
/* -moz-border-radius: 0.6em 10px 10px 0.6em / 0.6em 100px 100px 0.6em; */
/*
div.round {
background:
-moz-radial-gradient(0 100%, circle, rgba(204,0,0,0) 14px, #c00 15px),
-moz-radial-gradient(100% 100%, circle, rgba(204,0,0,0) 14px, #c00 15px),
-moz-radial-gradient(100% 0, circle, rgba(204,0,0,0) 14px, #c00 15px),
-moz-radial-gradient(0 0, circle, rgba(204,0,0,0) 14px, #c00 15px);
background:
-o-radial-gradient(0 100%, circle, rgba(204,0,0,0) 14px, #c00 15px),
-o-radial-gradient(100% 100%, circle, rgba(204,0,0,0) 14px, #c00 15px),
-o-radial-gradient(100% 0, circle, rgba(204,0,0,0) 14px, #c00 15px),
-o-radial-gradient(0 0, circle, rgba(204,0,0,0) 14px, #c00 15px);
background:
-webkit-radial-gradient(0 100%, circle, rgba(204,0,0,0) 14px, #c00 15px),
-webkit-radial-gradient(100% 100%, circle, rgba(204,0,0,0) 14px, #c00 15px),
-webkit-radial-gradient(100% 0, circle, rgba(204,0,0,0) 14px, #c00 15px),
-webkit-radial-gradient(0 0, circle, rgba(204,0,0,0) 14px, #c00 15px);
}
div, div.round {
background-position: bottom left, bottom right, top right, top left;
-moz-background-size: 50% 50%;
-webkit-background-size: 50% 50%;
background-size: 50% 50%;
background-repeat: no-repeat;
}*/
/*
.ui-breadcrumbs .ui-btn {
border-top-left-radius: .6em ;
border-bottom-left-radius: .6em;
border-top-right-radius: 10px / 100px;
border-bottom-right-radius: 10px / 100px;
border-right-width: 0;
padding-right: 2em;
overflow: visible;
margin: auto .5em;
padding-left: 30px;
font-weight: bold;
}
.ui-breadcrumbs .ui-btn.ui-btn-active {
cursor: default;
}
.ui-breadcrumbs .ui-btn:before {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: none repeat scroll 0 0 transparent;
border-color: #DDDDDD #DDDDDD transparent;
border-style: solid;
border-width: 0.4em 2em 2em;
content: "";
display: block;
height: 0;
position: absolute;
right: -1.2em;
top: 0.25em;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
width: 0;
}
.ui-breadcrumbs .ui-btn.ui-last-child {
border-right-width: 1px;
padding-right: .5em;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
outline: 0 !important;
display: inline-block;
border-radius: .6em;
}
.ui-breadcrumbs .ui-btn.ui-last-child:before {
content: none;
}
.ui-breadcrumbs .ui-btn.ui-crumbs {
font-size: 70%;
max-width: 23%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
margin: auto .5em;
}
.ui-breadcrumbs .ui-btn.ui-crumbs:after {
margin-top: -10px;
}*/
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DREAM</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<link rel="stylesheet" href="../css/dream2.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.js"></script>
<script type="text/javascript" src="../lib/jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="../lib/jschannel.js"></script>
<script type="text/javascript" src="../lib/renderjs.js"></script>
<script type="text/javascript" src="../lib/md5.js"></script>
<script type="text/javascript" src="../lib/jio.js"></script>
<script type="text/javascript" src="../lib/jio.localstorage.js"></script>
<script type="text/javascript" src="../lib/pubsub.js"></script>
<script type="text/javascript" src="../lib/jquery.jsPlumb-1.5.3-min.js"></script>
<script type="text/javascript" src="../lib/jquery.jsoneditor.js"></script>
<script type="text/javascript" src="../js/gadget_dream.js"></script>
</head>
<body>
<div data-role="page" class="ui-responsive-panel">
<div id="main"></div>
<div>
<textarea rows="20" cols="47" id="debug_zone" style="align:left"></textarea>
<button id="load_json">Load JSON</button>
</div>
</div>
<div data-role="page" data-url="dialog.html" id="dialog">
<div data-role="header">
<h1>Properties</h1>
</div>
<div data-role="content">
<p>XXX property editor screeen will be implemented here.</p>
<fieldset id="dialog-fieldset">
</fieldset>
<a href="#" data-role="button" data-rel="back" data-theme="b">Validate</a>
<a href="#" data-role="button" data-rel="back" data-theme="c">Deleve</a>
<a href="#" data-role="button" data-rel="back" data-theme="c">Cancel</a>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Nexedi ERP5 | Computers</title>
<!-- TODO: gadget mobile meta -->
<!-- TODO: schema.org? -->
<!-- TODO: all JQM widgets should have enhanced markup vs
letting JQM enhance -->
<!-- normalize -->
<link rel="stylesheet" href="../css/normalize.css">
<!-- JQM structure -->
<link rel="stylesheet" href="../css/jquery.mobile.css">
<!-- JQM extensions -->
<link rel="stylesheet" href="../css/extensions.css">
<!-- fontawesome icons -->
<link rel="stylesheet" href="../css/fontawesome.css">
<!-- JQM custom themes (slapos-white, slapos-black, slapos-active) -->
<link rel="stylesheet" href="../css/themes.css">
<!-- generic CSS -->
<link rel="stylesheet" href="../css/css.css">
<!-- Jquery, JQM, JQM extensions -->
<script src="../lib/jquery.js" type="text/javascript"></script>
<script src="../lib/jquery.mobile.js" type="text/javascript"></script>
<script src="../lib/extensions.js" type="text/javascript"></script>
<!-- renderjs -->
<script src="../lib/jschannel.js" type="text/javascript"></script>
<script src="../lib/renderjs.js" type="text/javascript"></script>
<!-- route -->
<script src="../lib/route.js" type="text/javascript"></script>
<script src="../lib/url.js" type="text/javascript"></script>
<!-- custom script -->
<!--script src="../js/erp5_loader.js" type="text/javascript"></script-->
<script src="../js/gadget_index.js" type="text/javascript"></script>
</head>
<body>
<div id="computers" data-role="page" data-theme="slapos-white">
<!-- left panel -->
<div data-role="panel" id="menu_computers" data-theme="slapos-black"
class="panel" data-position="left" data-display="push">
<div class="panel_element panel_element_first panel_header">
<!--input type="search" data-role="button" value=""
placeholder="Search" class="panel_search" /-->
<a href="#menu" class="panel-close" data-role="button"
data-iconpos="notext" data-icon="remove"
data-rel="close">Close</a>
</div>
<!--div class="panel_element">
<ul data-role="listview" class="listview" data-theme="slapos-black">
<li data-role="list-divider">Modules</li>
<li class="listview_item listview_icon">
<a href="webpages.html">
<span
class="ui-li-icon ui-li-icon-custom ui-icon-file-alt ui-icon"
>&nbsp;</span>
<h3>Webpages</h3>
<p>Generated Webpages</p>
</a>
</li>
</ul>
</div-->
<div class="panel_element">
<ul data-role="listview" class="listview" data-theme="slapos-black">
<li data-role="list-divider">Connection</li>
<li class="listview_item listview_icon">
<a href="#/login/">
<span class="ui-li-icon ui-li-icon-custom ui-icon-folder-open-alt ui-icon"
>&nbsp;</span>
<h3>Login</h3>
</a>
</li>
<li data-role="list-divider">Dream</li>
<li class="listview_item listview_icon">
<a href="#/graph/">
<span class="ui-li-icon ui-li-icon-custom ui-icon-folder-open-alt ui-icon"
>&nbsp;</span>
<h3>Graph editor</h3>
</a>
</li>
<li class="listview_item listview_icon">
<a href="#/simulation/">
<span class="ui-li-icon ui-li-icon-custom ui-icon-folder-open-alt ui-icon"
>&nbsp;</span>
<h3>Simulation</h3>
</a>
</li>
<li data-role="list-divider">General</li>
<li class="listview_item listview_icon">
<a href="#/about/">
<span class="ui-li-icon ui-li-icon-custom ui-icon-folder-open-alt ui-icon"
>&nbsp;</span>
<h3>About</h3>
</a>
</li>
<li class="listview_item listview_icon">
<a href="#/contact/">
<span class="ui-li-icon ui-li-icon-custom ui-icon-folder-open-alt ui-icon"
>&nbsp;</span>
<h3>Contact Us</h3>
</a>
</li>
<!--li class="listview_item listview_icon">
<a href="">
<span class="ui-li-icon ui-li-icon-custom ui-icon-folder-open-alt ui-icon"
>&nbsp;</span>
<h3>Software</h3>
</a>
</li>
<li class="listview_item listview_icon">
<a href="">
<span class="ui-li-icon ui-li-icon-custom ui-icon-book ui-icon"
>&nbsp;</span>
<h3>Documentation</h3>
</a>
</li>
<li class="listview_item listview_icon">
<a href=""><span
class="ui-li-icon ui-li-icon-custom ui-icon-cloud-download ui-icon"
>&nbsp;</span><h3>Download</h3></a></li>
<li class="listview_item listview_icon"><a href=""><span
class="ui-li-icon ui-li-icon-custom ui-icon-comments ui-icon"
>&nbsp;</span><h3>Forum</h3></a></li>
<li class="listview_item listview_icon"><a href=""><span
class="ui-li-icon ui-li-icon-custom ui-icon-microphone ui-icon"
>&nbsp;</span><h3>Blog</h3></a></li-->
</ul>
</div>
<div class="panel_element" data-theme="slapos-black">
<ul class="list mini">
<li><a href="http://nexedi.com/">Nexedi &copy; 2013</a></li>
</ul>
</div>
</div>
<!-- gadget header -->
<div id="headergadget" data-role="header" data-position="fixed">
<div class="wrap left">
<div data-role="controlgroup" data-type="horizontal"
class="buttongroup">
<a href="#menu_computers" data-rel="panel" data-role="button"
data-icon="reorder" class="responsive">Navigate</a>
</div>
</div>
<h1 class="ui-title"></h1>
<div class="wrap right">
<div data-role="controlgroup" data-type="horizontal"
class="buttongroup">
<a href="#/login/" data-position-to="window" data-role="button"
data-icon="user" class="responsive">Login</a>
</div>
</div>
</div>
<div id="iogadget"></div>
<!-- content -->
<div class="ui-content">
<!--table class="erp5_table" data-type="Computer">
</table-->
</div>
<!-- IO manager -->
<!-- <div id="io" class="wrap left buttongroup" data-type="horizontal" data-role="controlgroup"> -->
<!-- <div data-role="fieldcontain"> -->
<!-- <textarea name="Filename" id="io-doc" placeholder="Filename"></textarea> -->
<!-- </div> -->
<!-- <span href="" id="save-doc" data-role="button" href="#page1"> -->
<!-- Save -->
<!-- </span> -->
<!-- <span href="" id="load-doc" data-role="button" href="#page1"> -->
<!-- Load -->
<!-- </span> -->
<!-- <span href="" id="new-doc" data-role="button" href="#page1"> -->
<!-- New -->
<!-- </span> -->
<!-- </div> -->
<!-- Interactor -->
<div id="interactorgadget"></div>
<!-- footer -->
<div id="footergadget" data-role="footer" data-position="fixed">
<div data-role="navbar" class="navbar">
<!--ul>
<li>
<a href="#" data-rel="popup" data-icon="compass">Browse</a>
</li>
<li>
<a class="new_item" href="computer.html?mode=add"
data-rel="popup" data-icon="plus">
<span class="navbar_add">Add</span>/<span
class="navbar_clone">Clone</span>
</a>
</li>
<li><a class="remove_item" href="#" data-rel="popup"
data-icon="minus">Remove</a></li>
<li><a href="#" data-rel="popup" data-icon="cog">Action</a></li>
<li><a href="#" data-rel="popup"
data-icon="share">Import/Export</a></li>
</ul-->
</div>
</div>
</div>
<script type="text/javascript">
// force reload iframe in development environment
//$('#ui-content iframe').first().contentWindow.location.reload(true);
</script>
</body>
</html>
<html>
<head>
<title>IO</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<!-- Jquery -->
<script src="../lib/jquery.js" type="text/javascript"></script>
<!-- renderjs -->
<script src="../lib/jschannel.js" type="text/javascript"></script>
<script src="../lib/renderjs.js" type="text/javascript"></script>
<!-- JIO -->
<script src="../lib/md5.amd.js" type="text/javascript"></script>
<script src="../lib/jio.js" type="text/javascript"></script>
<script src="../lib/complex_queries.js" type="text/javascript"></script>
<script src="../lib/localstorage.js" type="text/javascript"></script>
<script src="../js/gadget_io.js" type="text/javascript"></script>
<link rel="http://www.renderjs.org/rel/interface"
href="http://www.renderjs.org/interface/io"/>
</head>
<body>
<input type="text" name="fileName" id="svg-edit_docid" value="" placeholder="File name here">
<button id="save-doc" type="submit" class="btn btn-primary">
<i class="icon-download-alt icon-white"></i>
Save
</button>
<button id="load-doc" type="submit" class="btn btn-primary">
<i class="icon-download-alt icon-white"></i>
Load
</button>
<button id="new-doc" type="submit" class="btn btn-primary">
<i class="icon-download-alt icon-white"></i>
New document
</button>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Login</title>
<!-- Jquery -->
<script src="../lib/jquery.js" type="text/javascript"></script>
<!-- renderjs -->
<script src="../lib/jschannel.js" type="text/javascript"></script>
<script src="../lib/renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="../js/gadget_login.js" type="text/javascript"></script>
</head>
<body>
<div class="content_element">
<h2>Login</h2>
<p>Please enter your jIO localstorage username and validate.</p>
<form id="connect">
<input type="text" value="" name="username"
placeholder="jIO local username" spellcheck="false"
required autofocus="autofocus" />
<input type="submit" value="Login" data-inline="True" />
</form>
</div>
</body>
</html>
/* ===========================================================================
* Copyright 2013 Nexedi SA and Contributors
*
* This file is part of DREAM.
*
* DREAM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DREAM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DREAM. If not, see <http://www.gnu.org/licenses/>.
* =========================================================================== */
/*jslint indent: 2, maxlen: 80, nomen: true */
/*global window, jQuery, rJS*/
(function (window, $, rJS) {
"use strict";
$.widget("dream.grapheditor", {
options: {
node_class: "graph_node", // CSS class for nodes
node_data_key: "grapheditor_node_data", // Key to store data on nodes using $.data
// XXX is it good idea to use
// $.data ???
draggable_nodes: true // Can nodes be dragged
},
_create: function () {
this.nodes = {};
this.edges = {};
if (this.options.graph) {
this.graph(this.options.graph);
}
},
destroy: function () {
this.clear();
this._destroy();
},
clear: function () {
this.edges = {};
$.each(this.nodes, $.proxy(function (node_id, node) {
jsPlumb.remove(node);
delete(this["nodes"][node_id]);
}, this));
},
create_node_element: function (node_id, node_data) {
// Create an element for a node, and add it to the main element.
return $('<div>')
.uniqueId()
.addClass(this.options.node_class)
.text(node_data['name'] || node_id)
.appendTo(this.element);
},
add_node: function (node_id, node_data) {
/* add a node */
var element = this.create_node_element(node_id, node_data);
if (this.options.draggable_nodes) {
// make the node draggable
jsPlumb.draggable(element, {
containment: this.element,
stop: $.proxy(function (node_id, event) {
this.node_position(node_id, this.node_position(node_id));
this._trigger("node_moved", event, node_id);
}, this, node_id)
});
}
this.nodes[node_id] = element;
this.node_position(node_id, node_data);
this.node_data(node_id, node_data);
this._trigger('node_added', node_id);
},
create_edge_element: function (edge_id, source_node_id,
destination_node_id, edge_data) {
// Create an element for an edge
var edge_label = edge_data['name'] || "";
jsPlumb.connect({
source: this.nodes[source_node_id].attr("id"),
target: this.nodes[destination_node_id].attr("id"),
paintStyle: {
lineWidth: 1,
strokeStyle: "#000"
}, // XXX make this an option
overlays: [
["Label", {
label: edge_label
}]
]
});
},
add_edge: function (edge_id, source_node_id, destination_node_id,
edge_data) {
/* add an edge */
this.create_edge_element(edge_id, source_node_id,
destination_node_id, edge_data);
this.edges[edge_id] = [source_node_id, destination_node_id,
edge_data
];
this._trigger('edge_added', edge_id);
},
node_data: function (node_id, node_data) {
/* get or set data for a node */
var node = this.nodes[node_id];
if (node_data === undefined) {
return node.data(this.options.node_data_key);
}
this.nodes[node_id].data(this.options.node_data_key, node_data);
this._trigger("node_data_changed", node_id);
return this;
},
edge_data: function (edge_id, edge_data) {
/* get or set data for an edge */
var edge = this.edges[edge_id];
if (edge_data === undefined) {
return edge[2];
}
this.edges[edge_id] = [edge[0], edge[1], edge_data];
this._trigger("edge_data_changed", edge_id);
return this;
},
node_position: function (node_id, position) {
/* Get or set the position of a node with position given on a 0..1 scale */
var node = this.nodes[node_id],
node_position = node.position(),
element_position = this.element.position();
if (position === undefined) {
return {
"top": (node_position.top - element_position.top) / (this.element
.height() - node.height()),
"left": (node_position.left - element_position.left) / (this.element
.width() - node.width())
};
}
node.css({
"top": element_position.top +
Math.floor(position.top * (this.element.height() - node.height())) +
"px",
"left": element_position.left +
Math.floor(position.left * (this.element.width() - node.width())) +
"px"
});
// update node data with position
this.node_data(node_id, $.extend(this.node_data(node_id), {
top: position.top,
left: position.left
}));
jsPlumb.repaintEverything();
return this;
},
graph: function (value) {
// get or set the graph data
if (value === undefined) {
// get
var graph = {
"nodes": {},
"edges": {}
};
$.each(this.nodes, $.proxy(function (node_id, node) {
graph["nodes"][node_id] = node.data(this.options.node_data_key);
}, this));
$.each(this.edges, $.proxy(function (edge_id, edge) {
graph["edges"][edge_id] = this.edges[edge_id];
}, this));
return graph;
}
this.clear();
$.each(value.nodes, $.proxy(function (node_id, node) {
this.add_node(node_id, node);
}, this));
$.each(value.edges, $.proxy(function (edge_id, edge) {
this.add_edge(edge_id, edge[0], edge[1], edge[2] || {});
}, this));
return this;
}
});
jsPlumb.bind("ready", function () {
/* Initialize jsPlumb defaults
*/
// TODO: default for connections ?
jsPlumb.setRenderMode(jsPlumb.SVG);
jsPlumb.importDefaults({
Endpoint: ["Dot", {
radius: 2
}],
ConnectionOverlays: [
["Arrow", {
location: 1,
width: 10
}]
],
Anchor: "Continuous"
});
$.getJSON("../JSONInputs/Topology01.json", function (data) {
$("#main").grapheditor({
graph: data,
node_moved: function (event, node_id) {
$("#debug_zone").val(JSON.stringify(
$("#main").grapheditor("graph"), undefined, " "));
}
});
// Access the nodes
var grapheditor = $("#main").data("dreamGrapheditor");
$.each(grapheditor.nodes, function (node_id, node) {
// test: click to add a property
node.click(function (e) {
$.mobile.changePage("#dialog", {
role: "dialog"
});
$("#main").grapheditor("node_data", node_id,
$.extend($("#main").grapheditor("node_data", node_id), {
"dbclick": 1
}));
});
});
// reload from json
$("#load_json").click(function () {
$("#main").grapheditor("graph",
JSON.parse($("#debug_zone").val()));
});
});
});
function init() {
}
rJS(window).declareMethod('getContent', function () {
return JSON.stringify($('#main').grapheditor('graph'), undefined, ' ');
})
.declareMethod('setContent', function (content) {
$('#main').grapheditor('graph', JSON.parse(content));
})
.declareMethod('clearContent', function () {
$('#main').grapheditor('clear');
})
.ready(function () {
init.apply(rJS(this));
});
}(window, jQuery, rJS));
/*global window, jQuery, rJS */
"use strict";
(function (window, $, rJS) {
$.mobile.ajaxEnabled = false;
$.mobile.linkBindingEnabled = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
rJS(window).ready(function () {
var g = rJS(this),
body = g.context,
main_context = g.context.find('.ui-content').first(),
ioGadgetConfig = {"type": "local",
"username": "officejs",
"application_name": "officejs"
},
jioGadget;
function setTitle(title) {
g.context.find("#headergadget").find("h1").text(title);
return $('title').text("OfficeJS | " + title);
}
function enhanceGadgetRendering(gadget) {
gadget.context.enhanceWithin();
return gadget.getTitle()
.then(setTitle);
}
function registerSaveButton(gadget) {
window.jqs = gadget;
$("#save-doc").click(function () {
var fileName = $("#iogadget input").val();
jioGadget.configureIO(ioGadgetConfig, fileName)
.then(gadget.getContent)
.then(function (o) {jioGadget.setIO(o); });
});
return gadget;
}
function registerLoadButton(gadget) {
$("#load-doc").click(function () {
var fileName = $("#iogadget input").val();
jioGadget.configureIO(ioGadgetConfig, fileName)
.then(jioGadget.getIO)
.then(gadget.setContent);
});
return gadget;
}
function registerClearButton(gadget) {
$("#new-doc").click(function () {
gadget.clearContent();
});
}
function registerIOButtons(gadget) {
registerSaveButton(gadget);
registerLoadButton(gadget);
registerClearButton(gadget);
}
function initializeRoute() {
body
.route("add", "", 1)
.done(function () {
$.url.redirect('/login/');
});
body
.route("add", "/about/", 1)
.done(function () {
g.declareGadget('./about.html', main_context)
.then(enhanceGadgetRendering);
});
body
.route("add", "/contact/", 1)
.done(function () {
g.declareGadget('./contact.html', main_context)
.then(enhanceGadgetRendering);
});
body
.route("add", "/login/", 1)
.done(function () {
g.declareGadget('./login.html', main_context)
.then(enhanceGadgetRendering);
});
body
.route("add", "/graph/", 1)
.done(function () {
g.declareIframedGadget('./graph.html', main_context)
.then(registerIOButtons);
});
body
.route("add", "/simulation/", 1)
.done(function () {
g.declareIframedGadget('./simulation.html', main_context)
.then(registerIOButtons);
});
}
g.declareGadget('./io.html', g.context.find("#iogadget"))
.done(function (ioGadget) {
window.jio = ioGadget;
jioGadget = ioGadget;
// Trigger route change
initializeRoute();
$.url.onhashchange(function () {
body.route("go", $.url.getPath())
.fail(function () {
g.declareGadget('./error.html', main_context)
.then(enhanceGadgetRendering)
.then(initializeRoute);
});
});
});
});
}(window, jQuery, rJS));
/*global window, jQuery, jIO, rJS */
/*jslint unparam: true*/
"use strict";
(function (window, $, jIO, rJS) {
var gk = rJS(window);
gk.declareMethod('configureIO', function (json_configuration, key) {
rJS(this).jio = jIO.newJio(json_configuration);
rJS(this).jio_key = key;
//console.log(rJS(this).jio);
return key;
})
.declareMethod('getIO', function () {
var deferred = $.Deferred(),
default_value = "",
gadget = rJS(this);
gadget.jio.getAttachment({
"_id": gadget.jio_key,
"_attachment": "body.txt"
}, function (err, response) {
if (err) {
if (err.status === 404) {
deferred.resolve(default_value);
} else {
deferred.reject(err);
}
} else {
//console.log("getIO: " + response);
deferred.resolve(response || default_value);
}
});
return deferred.promise();
})
.declareMethod('setIO', function (value) {
//console.log("couscous");
var deferred = $.Deferred(),
gadget = rJS(this);
gadget.jio.put({"_id": gadget.jio_key},
function (err, response) {
if (err) {
deferred.reject(err);
} else {
gadget.jio.putAttachment({
"_id": gadget.jio_key,
"_attachment": "body.txt",
"_data": value,
"_mimetype": "text/plain"
}, function (err, response) {
if (err) {
deferred.reject(err);
} else {
//console.log("putIO: " + value);
deferred.resolve();
}
});
}
});
return deferred.promise();
});
}(window, jQuery, jIO, rJS));
/*global window, jQuery, rJS */
"use strict";
(function (window, $, rJS, undefined) {
var gk = rJS(window);
rJS(window).ready(function () {
var g = rJS(this),
form_context = g.context.find('form'),
field_context = form_context.find("input[type=text]");
function submit_event() {
var jio_json = {
"type": "local",
"username": field_context.val()
};
// XXX What to do?
g.context.text(JSON.stringify(jio_json));
return false;
}
form_context.submit(submit_event);
});
}(window, jQuery, rJS));
/*
* Copyright 2013, Nexedi SA
* Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html
*/
/**
* Provides some function to use complex queries with item list
*
* @module complex_queries
*/
// define([module_name], [dependencies], module);
(function (dependencies, module) {
"use strict";
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
if (typeof exports === 'object') {
return module(exports);
}
window.complex_queries = {};
module(window.complex_queries);
}(['exports'], function (to_export) {
"use strict";
/**
* Add a secured (write permission denied) property to an object.
*
* @param {Object} object The object to fill
* @param {String} key The object key where to store the property
* @param {Any} value The value to store
*/
function _export(key, value) {
Object.defineProperty(to_export, key, {
"configurable": false,
"enumerable": true,
"writable": false,
"value": value
});
}
/**
* Parse a text request to a json query object tree
*
* @param {String} string The string to parse
* @return {Object} The json query tree
*/
function parseStringToObject(string) {
/*
Default template driver for JS/CC generated parsers running as
browser-based JavaScript/ECMAScript applications.
WARNING: This parser template will not run as console and has lesser
features for debugging than the console derivates for the
various JavaScript platforms.
Features:
- Parser trace messages
- Integrated panic-mode error recovery
Written 2007, 2008 by Jan Max Meyer, J.M.K S.F. Software Technologies
This is in the public domain.
*/
var NODEJS__dbg_withtrace = false;
var NODEJS__dbg_string = new String();
function __NODEJS_dbg_print( text )
{
NODEJS__dbg_string += text + "\n";
}
function __NODEJS_lex( info )
{
var state = 0;
var match = -1;
var match_pos = 0;
var start = 0;
var pos = info.offset + 1;
do
{
pos--;
state = 0;
match = -2;
start = pos;
if( info.src.length <= start )
return 19;
do
{
switch( state )
{
case 0:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 8 ) || ( info.src.charCodeAt( pos ) >= 10 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || info.src.charCodeAt( pos ) == 59 || ( info.src.charCodeAt( pos ) >= 63 && info.src.charCodeAt( pos ) <= 64 ) || ( info.src.charCodeAt( pos ) >= 66 && info.src.charCodeAt( pos ) <= 77 ) || ( info.src.charCodeAt( pos ) >= 80 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 9 ) state = 2;
else if( info.src.charCodeAt( pos ) == 40 ) state = 3;
else if( info.src.charCodeAt( pos ) == 41 ) state = 4;
else if( info.src.charCodeAt( pos ) == 60 || info.src.charCodeAt( pos ) == 62 ) state = 5;
else if( info.src.charCodeAt( pos ) == 34 ) state = 11;
else if( info.src.charCodeAt( pos ) == 79 ) state = 12;
else if( info.src.charCodeAt( pos ) == 32 ) state = 13;
else if( info.src.charCodeAt( pos ) == 61 ) state = 14;
else if( info.src.charCodeAt( pos ) == 65 ) state = 18;
else if( info.src.charCodeAt( pos ) == 78 ) state = 19;
else state = -1;
break;
case 1:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else state = -1;
match = 10;
match_pos = pos;
break;
case 2:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else state = -1;
match = 1;
match_pos = pos;
break;
case 3:
state = -1;
match = 3;
match_pos = pos;
break;
case 4:
state = -1;
match = 4;
match_pos = pos;
break;
case 5:
if( info.src.charCodeAt( pos ) == 61 ) state = 14;
else state = -1;
match = 11;
match_pos = pos;
break;
case 6:
state = -1;
match = 8;
match_pos = pos;
break;
case 7:
state = -1;
match = 9;
match_pos = pos;
break;
case 8:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else state = -1;
match = 6;
match_pos = pos;
break;
case 9:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else state = -1;
match = 5;
match_pos = pos;
break;
case 10:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else state = -1;
match = 7;
match_pos = pos;
break;
case 11:
if( info.src.charCodeAt( pos ) == 34 ) state = 7;
else if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 33 ) || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 91 ) || ( info.src.charCodeAt( pos ) >= 93 && info.src.charCodeAt( pos ) <= 254 ) ) state = 11;
else if( info.src.charCodeAt( pos ) == 92 ) state = 15;
else state = -1;
break;
case 12:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 81 ) || ( info.src.charCodeAt( pos ) >= 83 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else if( info.src.charCodeAt( pos ) == 82 ) state = 8;
else state = -1;
match = 10;
match_pos = pos;
break;
case 13:
state = -1;
match = 1;
match_pos = pos;
break;
case 14:
state = -1;
match = 11;
match_pos = pos;
break;
case 15:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 254 ) ) state = 11;
else state = -1;
break;
case 16:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 67 ) || ( info.src.charCodeAt( pos ) >= 69 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else if( info.src.charCodeAt( pos ) == 68 ) state = 9;
else state = -1;
match = 10;
match_pos = pos;
break;
case 17:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 83 ) || ( info.src.charCodeAt( pos ) >= 85 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else if( info.src.charCodeAt( pos ) == 84 ) state = 10;
else state = -1;
match = 10;
match_pos = pos;
break;
case 18:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 77 ) || ( info.src.charCodeAt( pos ) >= 79 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else if( info.src.charCodeAt( pos ) == 78 ) state = 16;
else state = -1;
match = 10;
match_pos = pos;
break;
case 19:
if( ( info.src.charCodeAt( pos ) >= 0 && info.src.charCodeAt( pos ) <= 31 ) || info.src.charCodeAt( pos ) == 33 || ( info.src.charCodeAt( pos ) >= 35 && info.src.charCodeAt( pos ) <= 39 ) || ( info.src.charCodeAt( pos ) >= 42 && info.src.charCodeAt( pos ) <= 57 ) || ( info.src.charCodeAt( pos ) >= 59 && info.src.charCodeAt( pos ) <= 78 ) || ( info.src.charCodeAt( pos ) >= 80 && info.src.charCodeAt( pos ) <= 254 ) ) state = 1;
else if( info.src.charCodeAt( pos ) == 58 ) state = 6;
else if( info.src.charCodeAt( pos ) == 79 ) state = 17;
else state = -1;
match = 10;
match_pos = pos;
break;
}
pos++;
}
while( state > -1 );
}
while( 1 > -1 && match == 1 );
if( match > -1 )
{
info.att = info.src.substr( start, match_pos - start );
info.offset = match_pos;
}
else
{
info.att = new String();
match = -1;
}
return match;
}
function __NODEJS_parse( src, err_off, err_la )
{
var sstack = new Array();
var vstack = new Array();
var err_cnt = 0;
var act;
var go;
var la;
var rval;
var parseinfo = new Function( "", "var offset; var src; var att;" );
var info = new parseinfo();
/* Pop-Table */
var pop_tab = new Array(
new Array( 0/* begin' */, 1 ),
new Array( 13/* begin */, 1 ),
new Array( 12/* search_text */, 1 ),
new Array( 12/* search_text */, 2 ),
new Array( 12/* search_text */, 3 ),
new Array( 14/* and_expression */, 1 ),
new Array( 14/* and_expression */, 3 ),
new Array( 15/* boolean_expression */, 2 ),
new Array( 15/* boolean_expression */, 1 ),
new Array( 16/* expression */, 3 ),
new Array( 16/* expression */, 2 ),
new Array( 16/* expression */, 1 ),
new Array( 17/* value */, 2 ),
new Array( 17/* value */, 1 ),
new Array( 18/* string */, 1 ),
new Array( 18/* string */, 1 )
);
/* Action-Table */
var act_tab = new Array(
/* State 0 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 1 */ new Array( 19/* "$" */,0 ),
/* State 2 */ new Array( 19/* "$" */,-1 ),
/* State 3 */ new Array( 6/* "OR" */,14 , 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 , 19/* "$" */,-2 , 4/* "RIGHT_PARENTHESE" */,-2 ),
/* State 4 */ new Array( 5/* "AND" */,16 , 19/* "$" */,-5 , 7/* "NOT" */,-5 , 3/* "LEFT_PARENTHESE" */,-5 , 8/* "COLUMN" */,-5 , 11/* "OPERATOR" */,-5 , 10/* "WORD" */,-5 , 9/* "STRING" */,-5 , 6/* "OR" */,-5 , 4/* "RIGHT_PARENTHESE" */,-5 ),
/* State 5 */ new Array( 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 6 */ new Array( 19/* "$" */,-8 , 7/* "NOT" */,-8 , 3/* "LEFT_PARENTHESE" */,-8 , 8/* "COLUMN" */,-8 , 11/* "OPERATOR" */,-8 , 10/* "WORD" */,-8 , 9/* "STRING" */,-8 , 6/* "OR" */,-8 , 5/* "AND" */,-8 , 4/* "RIGHT_PARENTHESE" */,-8 ),
/* State 7 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 8 */ new Array( 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 9 */ new Array( 19/* "$" */,-11 , 7/* "NOT" */,-11 , 3/* "LEFT_PARENTHESE" */,-11 , 8/* "COLUMN" */,-11 , 11/* "OPERATOR" */,-11 , 10/* "WORD" */,-11 , 9/* "STRING" */,-11 , 6/* "OR" */,-11 , 5/* "AND" */,-11 , 4/* "RIGHT_PARENTHESE" */,-11 ),
/* State 10 */ new Array( 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 11 */ new Array( 19/* "$" */,-13 , 7/* "NOT" */,-13 , 3/* "LEFT_PARENTHESE" */,-13 , 8/* "COLUMN" */,-13 , 11/* "OPERATOR" */,-13 , 10/* "WORD" */,-13 , 9/* "STRING" */,-13 , 6/* "OR" */,-13 , 5/* "AND" */,-13 , 4/* "RIGHT_PARENTHESE" */,-13 ),
/* State 12 */ new Array( 19/* "$" */,-14 , 7/* "NOT" */,-14 , 3/* "LEFT_PARENTHESE" */,-14 , 8/* "COLUMN" */,-14 , 11/* "OPERATOR" */,-14 , 10/* "WORD" */,-14 , 9/* "STRING" */,-14 , 6/* "OR" */,-14 , 5/* "AND" */,-14 , 4/* "RIGHT_PARENTHESE" */,-14 ),
/* State 13 */ new Array( 19/* "$" */,-15 , 7/* "NOT" */,-15 , 3/* "LEFT_PARENTHESE" */,-15 , 8/* "COLUMN" */,-15 , 11/* "OPERATOR" */,-15 , 10/* "WORD" */,-15 , 9/* "STRING" */,-15 , 6/* "OR" */,-15 , 5/* "AND" */,-15 , 4/* "RIGHT_PARENTHESE" */,-15 ),
/* State 14 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 15 */ new Array( 19/* "$" */,-3 , 4/* "RIGHT_PARENTHESE" */,-3 ),
/* State 16 */ new Array( 7/* "NOT" */,5 , 3/* "LEFT_PARENTHESE" */,7 , 8/* "COLUMN" */,8 , 11/* "OPERATOR" */,10 , 10/* "WORD" */,12 , 9/* "STRING" */,13 ),
/* State 17 */ new Array( 19/* "$" */,-7 , 7/* "NOT" */,-7 , 3/* "LEFT_PARENTHESE" */,-7 , 8/* "COLUMN" */,-7 , 11/* "OPERATOR" */,-7 , 10/* "WORD" */,-7 , 9/* "STRING" */,-7 , 6/* "OR" */,-7 , 5/* "AND" */,-7 , 4/* "RIGHT_PARENTHESE" */,-7 ),
/* State 18 */ new Array( 4/* "RIGHT_PARENTHESE" */,23 ),
/* State 19 */ new Array( 19/* "$" */,-10 , 7/* "NOT" */,-10 , 3/* "LEFT_PARENTHESE" */,-10 , 8/* "COLUMN" */,-10 , 11/* "OPERATOR" */,-10 , 10/* "WORD" */,-10 , 9/* "STRING" */,-10 , 6/* "OR" */,-10 , 5/* "AND" */,-10 , 4/* "RIGHT_PARENTHESE" */,-10 ),
/* State 20 */ new Array( 19/* "$" */,-12 , 7/* "NOT" */,-12 , 3/* "LEFT_PARENTHESE" */,-12 , 8/* "COLUMN" */,-12 , 11/* "OPERATOR" */,-12 , 10/* "WORD" */,-12 , 9/* "STRING" */,-12 , 6/* "OR" */,-12 , 5/* "AND" */,-12 , 4/* "RIGHT_PARENTHESE" */,-12 ),
/* State 21 */ new Array( 19/* "$" */,-4 , 4/* "RIGHT_PARENTHESE" */,-4 ),
/* State 22 */ new Array( 19/* "$" */,-6 , 7/* "NOT" */,-6 , 3/* "LEFT_PARENTHESE" */,-6 , 8/* "COLUMN" */,-6 , 11/* "OPERATOR" */,-6 , 10/* "WORD" */,-6 , 9/* "STRING" */,-6 , 6/* "OR" */,-6 , 4/* "RIGHT_PARENTHESE" */,-6 ),
/* State 23 */ new Array( 19/* "$" */,-9 , 7/* "NOT" */,-9 , 3/* "LEFT_PARENTHESE" */,-9 , 8/* "COLUMN" */,-9 , 11/* "OPERATOR" */,-9 , 10/* "WORD" */,-9 , 9/* "STRING" */,-9 , 6/* "OR" */,-9 , 5/* "AND" */,-9 , 4/* "RIGHT_PARENTHESE" */,-9 )
);
/* Goto-Table */
var goto_tab = new Array(
/* State 0 */ new Array( 13/* begin */,1 , 12/* search_text */,2 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),
/* State 1 */ new Array( ),
/* State 2 */ new Array( ),
/* State 3 */ new Array( 12/* search_text */,15 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),
/* State 4 */ new Array( ),
/* State 5 */ new Array( 16/* expression */,17 , 17/* value */,9 , 18/* string */,11 ),
/* State 6 */ new Array( ),
/* State 7 */ new Array( 12/* search_text */,18 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),
/* State 8 */ new Array( 16/* expression */,19 , 17/* value */,9 , 18/* string */,11 ),
/* State 9 */ new Array( ),
/* State 10 */ new Array( 18/* string */,20 ),
/* State 11 */ new Array( ),
/* State 12 */ new Array( ),
/* State 13 */ new Array( ),
/* State 14 */ new Array( 12/* search_text */,21 , 14/* and_expression */,3 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),
/* State 15 */ new Array( ),
/* State 16 */ new Array( 14/* and_expression */,22 , 15/* boolean_expression */,4 , 16/* expression */,6 , 17/* value */,9 , 18/* string */,11 ),
/* State 17 */ new Array( ),
/* State 18 */ new Array( ),
/* State 19 */ new Array( ),
/* State 20 */ new Array( ),
/* State 21 */ new Array( ),
/* State 22 */ new Array( ),
/* State 23 */ new Array( )
);
/* Symbol labels */
var labels = new Array(
"begin'" /* Non-terminal symbol */,
"WHITESPACE" /* Terminal symbol */,
"WHITESPACE" /* Terminal symbol */,
"LEFT_PARENTHESE" /* Terminal symbol */,
"RIGHT_PARENTHESE" /* Terminal symbol */,
"AND" /* Terminal symbol */,
"OR" /* Terminal symbol */,
"NOT" /* Terminal symbol */,
"COLUMN" /* Terminal symbol */,
"STRING" /* Terminal symbol */,
"WORD" /* Terminal symbol */,
"OPERATOR" /* Terminal symbol */,
"search_text" /* Non-terminal symbol */,
"begin" /* Non-terminal symbol */,
"and_expression" /* Non-terminal symbol */,
"boolean_expression" /* Non-terminal symbol */,
"expression" /* Non-terminal symbol */,
"value" /* Non-terminal symbol */,
"string" /* Non-terminal symbol */,
"$" /* Terminal symbol */
);
info.offset = 0;
info.src = src;
info.att = new String();
if( !err_off )
err_off = new Array();
if( !err_la )
err_la = new Array();
sstack.push( 0 );
vstack.push( 0 );
la = __NODEJS_lex( info );
while( true )
{
act = 25;
for( var i = 0; i < act_tab[sstack[sstack.length-1]].length; i+=2 )
{
if( act_tab[sstack[sstack.length-1]][i] == la )
{
act = act_tab[sstack[sstack.length-1]][i+1];
break;
}
}
if( NODEJS__dbg_withtrace && sstack.length > 0 )
{
__NODEJS_dbg_print( "\nState " + sstack[sstack.length-1] + "\n" +
"\tLookahead: " + labels[la] + " (\"" + info.att + "\")\n" +
"\tAction: " + act + "\n" +
"\tSource: \"" + info.src.substr( info.offset, 30 ) + ( ( info.offset + 30 < info.src.length ) ?
"..." : "" ) + "\"\n" +
"\tStack: " + sstack.join() + "\n" +
"\tValue stack: " + vstack.join() + "\n" );
}
//Panic-mode: Try recovery when parse-error occurs!
if( act == 25 )
{
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "Error detected: There is no reduce or shift on the symbol " + labels[la] );
err_cnt++;
err_off.push( info.offset - info.att.length );
err_la.push( new Array() );
for( var i = 0; i < act_tab[sstack[sstack.length-1]].length; i+=2 )
err_la[err_la.length-1].push( labels[act_tab[sstack[sstack.length-1]][i]] );
//Remember the original stack!
var rsstack = new Array();
var rvstack = new Array();
for( var i = 0; i < sstack.length; i++ )
{
rsstack[i] = sstack[i];
rvstack[i] = vstack[i];
}
while( act == 25 && la != 19 )
{
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tError recovery\n" +
"Current lookahead: " + labels[la] + " (" + info.att + ")\n" +
"Action: " + act + "\n\n" );
if( la == -1 )
info.offset++;
while( act == 25 && sstack.length > 0 )
{
sstack.pop();
vstack.pop();
if( sstack.length == 0 )
break;
act = 25;
for( var i = 0; i < act_tab[sstack[sstack.length-1]].length; i+=2 )
{
if( act_tab[sstack[sstack.length-1]][i] == la )
{
act = act_tab[sstack[sstack.length-1]][i+1];
break;
}
}
}
if( act != 25 )
break;
for( var i = 0; i < rsstack.length; i++ )
{
sstack.push( rsstack[i] );
vstack.push( rvstack[i] );
}
la = __NODEJS_lex( info );
}
if( act == 25 )
{
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tError recovery failed, terminating parse process..." );
break;
}
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tError recovery succeeded, continuing" );
}
/*
if( act == 25 )
break;
*/
//Shift
if( act > 0 )
{
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "Shifting symbol: " + labels[la] + " (" + info.att + ")" );
sstack.push( act );
vstack.push( info.att );
la = __NODEJS_lex( info );
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tNew lookahead symbol: " + labels[la] + " (" + info.att + ")" );
}
//Reduce
else
{
act *= -1;
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "Reducing by producution: " + act );
rval = void(0);
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tPerforming semantic action..." );
switch( act )
{
case 0:
{
rval = vstack[ vstack.length - 1 ];
}
break;
case 1:
{
result = vstack[ vstack.length - 1 ];
}
break;
case 2:
{
rval = vstack[ vstack.length - 1 ];
}
break;
case 3:
{
rval = mkComplexQuery('OR',[vstack[ vstack.length - 2 ],vstack[ vstack.length - 1 ]]);
}
break;
case 4:
{
rval = mkComplexQuery('OR',[vstack[ vstack.length - 3 ],vstack[ vstack.length - 1 ]]);
}
break;
case 5:
{
rval = vstack[ vstack.length - 1 ] ;
}
break;
case 6:
{
rval = mkComplexQuery('AND',[vstack[ vstack.length - 3 ],vstack[ vstack.length - 1 ]]);
}
break;
case 7:
{
rval = mkNotQuery(vstack[ vstack.length - 1 ]);
}
break;
case 8:
{
rval = vstack[ vstack.length - 1 ];
}
break;
case 9:
{
rval = vstack[ vstack.length - 2 ];
}
break;
case 10:
{
simpleQuerySetKey(vstack[ vstack.length - 1 ],vstack[ vstack.length - 2 ].split(':').slice(0,-1).join(':')); rval = vstack[ vstack.length - 1 ];
}
break;
case 11:
{
rval = vstack[ vstack.length - 1 ];
}
break;
case 12:
{
vstack[ vstack.length - 1 ].operator = vstack[ vstack.length - 2 ] ; rval = vstack[ vstack.length - 1 ];
}
break;
case 13:
{
rval = vstack[ vstack.length - 1 ];
}
break;
case 14:
{
rval = mkSimpleQuery('',vstack[ vstack.length - 1 ]);
}
break;
case 15:
{
rval = mkSimpleQuery('',vstack[ vstack.length - 1 ].split('"').slice(1,-1).join('"'));
}
break;
}
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tPopping " + pop_tab[act][1] + " off the stack..." );
for( var i = 0; i < pop_tab[act][1]; i++ )
{
sstack.pop();
vstack.pop();
}
go = -1;
for( var i = 0; i < goto_tab[sstack[sstack.length-1]].length; i+=2 )
{
if( goto_tab[sstack[sstack.length-1]][i] == pop_tab[act][0] )
{
go = goto_tab[sstack[sstack.length-1]][i+1];
break;
}
}
if( act == 0 )
break;
if( NODEJS__dbg_withtrace )
__NODEJS_dbg_print( "\tPushing non-terminal " + labels[ pop_tab[act][0] ] );
sstack.push( go );
vstack.push( rval );
}
if( NODEJS__dbg_withtrace )
{
alert( NODEJS__dbg_string );
NODEJS__dbg_string = new String();
}
}
if( NODEJS__dbg_withtrace )
{
__NODEJS_dbg_print( "\nParse complete." );
alert( NODEJS__dbg_string );
}
return err_cnt;
}
var arrayExtend = function () {
var j, i, newlist = [], list_list = arguments;
for (j = 0; j < list_list.length; j += 1) {
for (i = 0; i < list_list[j].length; i += 1) {
newlist.push(list_list[j][i]);
}
}
return newlist;
}, mkSimpleQuery = function (key, value, operator) {
return {"type": "simple", "operator": "=", "key": key, "value": value};
}, mkNotQuery = function (query) {
if (query.operator === "NOT") {
return query.query_list[0];
}
return {"type": "complex", "operator": "NOT", "query_list": [query]};
}, mkComplexQuery = function (operator, query_list) {
var i, query_list2 = [];
for (i = 0; i < query_list.length; i += 1) {
if (query_list[i].operator === operator) {
query_list2 = arrayExtend(query_list2, query_list[i].query_list);
} else {
query_list2.push(query_list[i]);
}
}
return {type:"complex",operator:operator,query_list:query_list2};
}, simpleQuerySetKey = function (query, key) {
var i;
if (query.type === "complex") {
for (i = 0; i < query.query_list.length; ++i) {
simpleQuerySetKey (query.query_list[i],key);
}
return true;
}
if (query.type === "simple" && !query.key) {
query.key = key;
return true;
}
return false;
},
error_offsets = [],
error_lookaheads = [],
error_count = 0,
result;
if ((error_count = __NODEJS_parse(string, error_offsets, error_lookaheads)) > 0) {
var i;
for (i = 0; i < error_count; i += 1) {
throw new Error("Parse error near \"" +
string.substr(error_offsets[i]) +
"\", expecting \"" +
error_lookaheads[i].join() + "\"");
}
}
return result;
} // parseStringToObject
_export('parseStringToObject', parseStringToObject);
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global _export: true */
/**
* Escapes regexp special chars from a string.
*
* @param {String} string The string to escape
* @return {String} The escaped string
*/
function stringEscapeRegexpCharacters(string) {
if (typeof string === "string") {
return string.replace(/([\\\.\$\[\]\(\)\{\}\^\?\*\+\-])/g, "\\$1");
}
throw new TypeError("complex_queries.stringEscapeRegexpCharacters(): " +
"Argument no 1 is not of type 'string'");
}
_export("stringEscapeRegexpCharacters", stringEscapeRegexpCharacters);
/**
* Convert metadata values to array of strings. ex:
*
* "a" -> ["a"],
* {"content": "a"} -> ["a"]
*
* @param {Any} value The metadata value
* @return {Array} The value in string array format
*/
function metadataValueToStringArray(value) {
var i, new_value = [];
if (value === undefined) {
return undefined;
}
if (!Array.isArray(value)) {
value = [value];
}
for (i = 0; i < value.length; i += 1) {
if (typeof value[i] === 'object') {
new_value[i] = value[i].content;
} else {
new_value[i] = value[i];
}
}
return new_value;
}
/**
* A sort function to sort items by key
*
* @param {String} key The key to sort on
* @param {String} [way="ascending"] 'ascending' or 'descending'
* @return {Function} The sort function
*/
function sortFunction(key, way) {
if (way === 'descending') {
return function (a, b) {
// this comparison is 5 times faster than json comparison
var i, l;
a = metadataValueToStringArray(a[key]) || [];
b = metadataValueToStringArray(b[key]) || [];
l = a.length > b.length ? a.length : b.length;
for (i = 0; i < l; i += 1) {
if (a[i] === undefined) {
return 1;
}
if (b[i] === undefined) {
return -1;
}
if (a[i] > b[i]) {
return -1;
}
if (a[i] < b[i]) {
return 1;
}
}
return 0;
};
}
if (way === 'ascending') {
return function (a, b) {
// this comparison is 5 times faster than json comparison
var i, l;
a = metadataValueToStringArray(a[key]) || [];
b = metadataValueToStringArray(b[key]) || [];
l = a.length > b.length ? a.length : b.length;
for (i = 0; i < l; i += 1) {
if (a[i] === undefined) {
return -1;
}
if (b[i] === undefined) {
return 1;
}
if (a[i] > b[i]) {
return 1;
}
if (a[i] < b[i]) {
return -1;
}
}
return 0;
};
}
throw new TypeError("complex_queries.sortFunction(): " +
"Argument 2 must be 'ascending' or 'descending'");
}
/**
* Clones all native object in deep. Managed types: Object, Array, String,
* Number, Boolean, null.
*
* @param {A} object The object to clone
* @return {A} The cloned object
*/
function deepClone(object) {
var i, cloned;
if (Array.isArray(object)) {
cloned = [];
for (i = 0; i < object.length; i += 1) {
cloned[i] = deepClone(object[i]);
}
return cloned;
}
if (typeof object === "object") {
cloned = {};
for (i in object) {
if (object.hasOwnProperty(i)) {
cloned[i] = deepClone(object[i]);
}
}
return cloned;
}
return object;
}
/**
* Inherits the prototype methods from one constructor into another. The
* prototype of `constructor` will be set to a new object created from
* `superConstructor`.
*
* @param {Function} constructor The constructor which inherits the super one
* @param {Function} superConstructor The super constructor
*/
function inherits(constructor, superConstructor) {
constructor.super_ = superConstructor;
constructor.prototype = Object.create(superConstructor.prototype, {
"constructor": {
"configurable": true,
"enumerable": false,
"writable": true,
"value": constructor
}
});
}
/**
* Does nothing
*/
function emptyFunction() {}
/**
* Filter a list of items, modifying them to select only wanted keys. If
* `clone` is true, then the method will act on a cloned list.
*
* @param {Array} select_option Key list to keep
* @param {Array} list The item list to filter
* @param {Boolean} [clone=false] If true, modifies a clone of the list
* @return {Array} The filtered list
*/
function select(select_option, list, clone) {
var i, j, new_item;
if (!Array.isArray(select_option)) {
throw new TypeError("complex_queries.select(): " +
"Argument 1 is not of type Array");
}
if (!Array.isArray(list)) {
throw new TypeError("complex_queries.select(): " +
"Argument 2 is not of type Array");
}
if (clone === true) {
list = deepClone(list);
}
for (i = 0; i < list.length; i += 1) {
new_item = {};
for (j = 0; j < select_option.length; j += 1) {
new_item[select_option[j]] = list[i][select_option[j]];
}
for (j in new_item) {
if (new_item.hasOwnProperty(j)) {
list[i] = new_item;
break;
}
}
}
return list;
}
_export('select', select);
/**
* Sort a list of items, according to keys and directions. If `clone` is true,
* then the method will act on a cloned list.
*
* @param {Array} sort_on_option List of couples [key, direction]
* @param {Array} list The item list to sort
* @param {Boolean} [clone=false] If true, modifies a clone of the list
* @return {Array} The filtered list
*/
function sortOn(sort_on_option, list, clone) {
var sort_index;
if (!Array.isArray(sort_on_option)) {
throw new TypeError("complex_queries.sortOn(): " +
"Argument 1 is not of type 'array'");
}
if (clone) {
list = deepClone(list);
}
for (sort_index = sort_on_option.length - 1; sort_index >= 0;
sort_index -= 1) {
list.sort(sortFunction(
sort_on_option[sort_index][0],
sort_on_option[sort_index][1]
));
}
return list;
}
_export('sortOn', sortOn);
/**
* Limit a list of items, according to index and length. If `clone` is true,
* then the method will act on a cloned list.
*
* @param {Array} limit_option A couple [from, length]
* @param {Array} list The item list to limit
* @param {Boolean} [clone=false] If true, modifies a clone of the list
* @return {Array} The filtered list
*/
function limit(limit_option, list, clone) {
if (!Array.isArray(limit_option)) {
throw new TypeError("complex_queries.limit(): " +
"Argument 1 is not of type 'array'");
}
if (!Array.isArray(list)) {
throw new TypeError("complex_queries.limit(): " +
"Argument 2 is not of type 'array'");
}
if (clone) {
list = deepClone(list);
}
list.splice(0, limit_option[0]);
if (limit_option[1]) {
list.splice(limit_option[1]);
}
return list;
}
_export('limit', limit);
/**
* Convert a search text to a regexp.
*
* @param {String} string The string to convert
* @param {String} [wildcard_character=undefined] The wildcard chararter
* @return {RegExp} The search text regexp
*/
function convertStringToRegExp(string, wildcard_character) {
if (typeof string !== 'string') {
throw new TypeError("complex_queries.convertStringToRegExp(): " +
"Argument 1 is not of type 'string'");
}
if (wildcard_character === undefined ||
wildcard_character === null || wildcard_character === '') {
return new RegExp("^" + stringEscapeRegexpCharacters(string) + "$");
}
if (typeof wildcard_character !== 'string' || wildcard_character.length > 1) {
throw new TypeError("complex_queries.convertStringToRegExp(): " +
"Optional argument 2 must be a string of length <= 1");
}
return new RegExp("^" + stringEscapeRegexpCharacters(string).replace(
new RegExp(stringEscapeRegexpCharacters(wildcard_character), 'g'),
'.*'
) + "$");
}
_export('convertStringToRegExp', convertStringToRegExp);
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global _export: true, ComplexQuery: true, SimpleQuery: true, Query: true,
parseStringToObject: true */
var query_class_dict = {};
/**
* Provides static methods to create Query object
*
* @class QueryFactory
*/
function QueryFactory() {}
/**
* Creates Query object from a search text string or a serialized version
* of a Query.
*
* @method create
* @static
* @param {Object,String} object The search text or the serialized version
* of a Query
* @return {Query} A Query object
*/
QueryFactory.create = function (object) {
if (object === "") {
return new Query();
}
if (typeof object === "string") {
object = parseStringToObject(object);
}
if (typeof (object || {}).type === "string" &&
query_class_dict[object.type]) {
return new query_class_dict[object.type](object);
}
throw new TypeError("QueryFactory.create(): " +
"Argument 1 is not a search text or a parsable object");
};
_export("QueryFactory", QueryFactory);
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global parseStringToObject: true, emptyFunction: true, sortOn: true, limit:
true, select: true, _export: true, stringEscapeRegexpCharacters: true,
deepClone: true */
/**
* The query to use to filter a list of objects.
* This is an abstract class.
*
* @class Query
* @constructor
*/
function Query() {
/**
* Called before parsing the query. Must be overridden!
*
* @method onParseStart
* @param {Object} object The object shared in the parse process
* @param {Object} option Some option gave in parse()
*/
this.onParseStart = emptyFunction;
/**
* Called when parsing a simple query. Must be overridden!
*
* @method onParseSimpleQuery
* @param {Object} object The object shared in the parse process
* @param {Object} option Some option gave in parse()
*/
this.onParseSimpleQuery = emptyFunction;
/**
* Called when parsing a complex query. Must be overridden!
*
* @method onParseComplexQuery
* @param {Object} object The object shared in the parse process
* @param {Object} option Some option gave in parse()
*/
this.onParseComplexQuery = emptyFunction;
/**
* Called after parsing the query. Must be overridden!
*
* @method onParseEnd
* @param {Object} object The object shared in the parse process
* @param {Object} option Some option gave in parse()
*/
this.onParseEnd = emptyFunction;
}
/**
* Filter the item list with matching item only
*
* @method exec
* @param {Array} item_list The list of object
* @param {Object} [option] Some operation option
* @param {String} [option.wildcard_character="%"] The wildcard character
* @param {Array} [option.select_list] A object keys to retrieve
* @param {Array} [option.sort_on] Couples of object keys and "ascending"
* or "descending"
* @param {Array} [option.limit] Couple of integer, first is an index and
* second is the length.
*/
Query.prototype.exec = function (item_list, option) {
var i = 0;
if (!Array.isArray(item_list)) {
throw new TypeError("Query().exec(): Argument 1 is not of type 'array'");
}
if (option === undefined) {
option = {};
}
if (typeof option !== 'object') {
throw new TypeError("Query().exec(): " +
"Optional argument 2 is not of type 'object'");
}
if (option.wildcard_character === undefined) {
option.wildcard_character = '%';
}
while (i < item_list.length) {
if (!this.match(item_list[i], option.wildcard_character)) {
item_list.splice(i, 1);
} else {
i += 1;
}
}
if (option.sort_on) {
sortOn(option.sort_on, item_list);
}
if (option.limit) {
limit(option.limit, item_list);
}
select(option.select_list || [], item_list);
};
/**
* Test if an item matches this query
*
* @method match
* @param {Object} item The object to test
* @return {Boolean} true if match, false otherwise
*/
Query.prototype.match = function (item, wildcard_character) {
return true;
};
/**
* Browse the Query in deep calling parser method in each step.
*
* `onParseStart` is called first, on end `onParseEnd` is called.
* It starts from the simple queries at the bottom of the tree calling the
* parser method `onParseSimpleQuery`, and go up calling the
* `onParseComplexQuery` method.
*
* @method parse
* @param {Object} option Any options you want (except 'parsed')
* @return {Any} The parse result
*/
Query.prototype.parse = function (option) {
var that = this, object;
/**
* The recursive parser.
*
* @param {Object} object The object shared in the parse process
* @param {Object} options Some options usable in the parseMethods
* @return {Any} The parser result
*/
function recParse(object, option) {
var i, query = object.parsed;
if (query.type === "complex") {
for (i = 0; i < query.query_list.length; i += 1) {
object.parsed = query.query_list[i];
recParse(object, option);
query.query_list[i] = object.parsed;
}
object.parsed = query;
that.onParseComplexQuery(object, option);
} else if (query.type === "simple") {
that.onParseSimpleQuery(object, option);
}
}
object = {"parsed": JSON.parse(JSON.stringify(that.serialized()))};
that.onParseStart(object, option);
recParse(object, option);
that.onParseEnd(object, option);
return object.parsed;
};
/**
* Convert this query to a parsable string.
*
* @method toString
* @return {String} The string version of this query
*/
Query.prototype.toString = function () {
return "";
};
/**
* Convert this query to an jsonable object in order to be remake thanks to
* QueryFactory class.
*
* @method serialized
* @return {Object} The jsonable object
*/
Query.prototype.serialized = function () {
return undefined;
};
_export("Query", Query);
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global Query: true, inherits: true, query_class_dict: true, _export: true,
convertStringToRegExp: true */
/**
* The SimpleQuery inherits from Query, and compares one metadata value
*
* @class SimpleQuery
* @extends Query
* @param {Object} [spec={}] The specifications
* @param {String} [spec.operator="="] The compare method to use
* @param {String} spec.key The metadata key
* @param {String} spec.value The value of the metadata to compare
*/
function SimpleQuery(spec) {
Query.call(this);
/**
* Operator to use to compare object values
*
* @attribute operator
* @type String
* @default "="
* @optional
*/
this.operator = spec.operator || "=";
/**
* Key of the object which refers to the value to compare
*
* @attribute key
* @type String
*/
this.key = spec.key;
/**
* Value is used to do the comparison with the object value
*
* @attribute value
* @type String
*/
this.value = spec.value;
}
inherits(SimpleQuery, Query);
/**
* #crossLink "Query/match:method"
*/
SimpleQuery.prototype.match = function (item, wildcard_character) {
return this[this.operator](item[this.key], this.value, wildcard_character);
};
/**
* #crossLink "Query/toString:method"
*/
SimpleQuery.prototype.toString = function () {
return (this.key ? this.key + ": " : "") + (this.operator || "=") + ' "' +
this.value + '"';
};
/**
* #crossLink "Query/serialized:method"
*/
SimpleQuery.prototype.serialized = function () {
return {
"type": "simple",
"operator": this.operator,
"key": this.key,
"value": this.value
};
};
/**
* Comparison operator, test if this query value matches the item value
*
* @method =
* @param {String} object_value The value to compare
* @param {String} comparison_value The comparison value
* @param {String} wildcard_character The wildcard_character
* @return {Boolean} true if match, false otherwise
*/
SimpleQuery.prototype["="] = function (object_value, comparison_value,
wildcard_character) {
var value, i;
if (!Array.isArray(object_value)) {
object_value = [object_value];
}
for (i = 0; i < object_value.length; i += 1) {
value = object_value[i];
if (typeof value === 'object') {
value = value.content;
}
if (comparison_value === undefined) {
if (value === undefined) {
return true;
}
return false;
}
if (value === undefined) {
return false;
}
if (
convertStringToRegExp(
comparison_value.toString(),
wildcard_character
).test(value.toString())
) {
return true;
}
}
return false;
};
/**
* Comparison operator, test if this query value does not match the item value
*
* @method !=
* @param {String} object_value The value to compare
* @param {String} comparison_value The comparison value
* @param {String} wildcard_character The wildcard_character
* @return {Boolean} true if not match, false otherwise
*/
SimpleQuery.prototype["!="] = function (object_value, comparison_value,
wildcard_character) {
var value, i;
if (!Array.isArray(object_value)) {
object_value = [object_value];
}
for (i = 0; i < object_value.length; i += 1) {
value = object_value[i];
if (typeof value === 'object') {
value = value.content;
}
if (comparison_value === undefined) {
if (value === undefined) {
return false;
}
return true;
}
if (value === undefined) {
return true;
}
if (
convertStringToRegExp(
comparison_value.toString(),
wildcard_character
).test(value.toString())
) {
return false;
}
}
return true;
};
/**
* Comparison operator, test if this query value is lower than the item value
*
* @method <
* @param {Number, String} object_value The value to compare
* @param {Number, String} comparison_value The comparison value
* @return {Boolean} true if lower, false otherwise
*/
SimpleQuery.prototype["<"] = function (object_value, comparison_value) {
var value;
if (!Array.isArray(object_value)) {
object_value = [object_value];
}
value = object_value[0];
if (typeof value === 'object') {
value = value.content;
}
return value < comparison_value;
};
/**
* Comparison operator, test if this query value is equal or lower than the
* item value
*
* @method <=
* @param {Number, String} object_value The value to compare
* @param {Number, String} comparison_value The comparison value
* @return {Boolean} true if equal or lower, false otherwise
*/
SimpleQuery.prototype["<="] = function (object_value, comparison_value) {
var value;
if (!Array.isArray(object_value)) {
object_value = [object_value];
}
value = object_value[0];
if (typeof value === 'object') {
value = value.content;
}
return value <= comparison_value;
};
/**
* Comparison operator, test if this query value is greater than the item
* value
*
* @method >
* @param {Number, String} object_value The value to compare
* @param {Number, String} comparison_value The comparison value
* @return {Boolean} true if greater, false otherwise
*/
SimpleQuery.prototype[">"] = function (object_value, comparison_value) {
var value;
if (!Array.isArray(object_value)) {
object_value = [object_value];
}
value = object_value[0];
if (typeof value === 'object') {
value = value.content;
}
return value > comparison_value;
};
/**
* Comparison operator, test if this query value is equal or greater than the
* item value
*
* @method >=
* @param {Number, String} object_value The value to compare
* @param {Number, String} comparison_value The comparison value
* @return {Boolean} true if equal or greater, false otherwise
*/
SimpleQuery.prototype[">="] = function (object_value, comparison_value) {
var value;
if (!Array.isArray(object_value)) {
object_value = [object_value];
}
value = object_value[0];
if (typeof value === 'object') {
value = value.content;
}
return value >= comparison_value;
};
query_class_dict.simple = SimpleQuery;
_export("SimpleQuery", SimpleQuery);
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global Query: true, query_class_dict: true, inherits: true,
_export: true, QueryFactory: true */
/**
* The ComplexQuery inherits from Query, and compares one or several metadata
* values.
*
* @class ComplexQuery
* @extends Query
* @param {Object} [spec={}] The specifications
* @param {String} [spec.operator="AND"] The compare method to use
* @param {String} spec.key The metadata key
* @param {String} spec.value The value of the metadata to compare
*/
function ComplexQuery(spec) {
Query.call(this);
/**
* Logical operator to use to compare object values
*
* @attribute operator
* @type String
* @default "AND"
* @optional
*/
this.operator = spec.operator || "AND";
/**
* The sub Query list which are used to query an item.
*
* @attribute query_list
* @type Array
* @default []
* @optional
*/
this.query_list = spec.query_list || [];
this.query_list = this.query_list.map(QueryFactory.create);
}
inherits(ComplexQuery, Query);
/**
* #crossLink "Query/match:method"
*/
ComplexQuery.prototype.match = function (item, wildcard_character) {
return this[this.operator](item, wildcard_character);
};
/**
* #crossLink "Query/toString:method"
*/
ComplexQuery.prototype.toString = function () {
var str_list = ["("], this_operator = this.operator;
this.query_list.forEach(function (query) {
str_list.push(query.toString());
str_list.push(this_operator);
});
str_list.pop(); // remove last operator
str_list.push(")");
return str_list.join(" ");
};
/**
* #crossLink "Query/serialized:method"
*/
ComplexQuery.prototype.serialized = function () {
var s = {
"type": "complex",
"operator": this.operator,
"query_list": []
};
this.query_list.forEach(function (query) {
s.query_list.push(query.serialized());
});
return s;
};
/**
* Comparison operator, test if all sub queries match the
* item value
*
* @method AND
* @param {Object} item The item to match
* @param {String} wildcard_character The wildcard character
* @return {Boolean} true if all match, false otherwise
*/
ComplexQuery.prototype.AND = function (item, wildcard_character) {
var i;
for (i = 0; i < this.query_list.length; i += 1) {
if (!this.query_list[i].match(item, wildcard_character)) {
return false;
}
}
return true;
};
/**
* Comparison operator, test if one of the sub queries matches the
* item value
*
* @method OR
* @param {Object} item The item to match
* @param {String} wildcard_character The wildcard character
* @return {Boolean} true if one match, false otherwise
*/
ComplexQuery.prototype.OR = function (item, wildcard_character) {
var i;
for (i = 0; i < this.query_list.length; i += 1) {
if (this.query_list[i].match(item, wildcard_character)) {
return true;
}
}
return false;
};
/**
* Comparison operator, test if the sub query does not match the
* item value
*
* @method NOT
* @param {Object} item The item to match
* @param {String} wildcard_character The wildcard character
* @return {Boolean} true if one match, false otherwise
*/
ComplexQuery.prototype.NOT = function (item, wildcard_character) {
return !this.query_list[0].match(item, wildcard_character);
};
query_class_dict.complex = ComplexQuery;
_export("ComplexQuery", ComplexQuery);
return to_export;
}));
/* ========================= GALLERY WIDGET ========================= */
(function ($) {
$.widget("mobile.carousel", {
options: {
bullets: null,
bulletsPos: null,
inset: null,
captions: null,
captionpos: null,
captiontheme: null,
carouseltransition: null,
heading: "h1,h2,h3,h4,h5,h6,legend"
},
_transitionEndEvents : "webkitTransitionEnd oTransitionEnd " +
"otransitionend transitionend msTransitionEnd",
_create: function () {
var el = this.element[0],
o = this.options,
getAttrFixed = $.mobile.getAttribute;
// only time we read the DOM config
o.inset = getAttrFixed(el, "inset", true) || false;
o.carouseltransition = getAttrFixed(el, "transition", true) || "slide";
o.bullets = getAttrFixed(el, "bullets", true) || true;
o.captions = getAttrFixed(el, "captions", true) || false;
if (o.captions) {
o.captionspos = getAttrFixed(el, "captions-pos", true) || "bottom";
o.captionstheme = getAttrFixed(el, "captions-theme", true) || "a";
}
if (o.bullets) {
o.bulletsPos = getAttrFixed(el, "bulletsPos", true) || "bottom";
}
this.refresh(true);
},
refresh: function (create) {
var o = this.options,
el = this.element,
items = el.children(),
fragment = document.createDocumentFragment(),
classes = "ui-carousel",
barrel,
label,
radio,
item,
i,
containsLinks,
captionsHeading,
captionsContent;
// loop over images
for (i = 0; i < items.length; i += 1) {
item = items[i];
// create captions
if (o.captions) {
containsLinks = item.children.length === 1
&& item.children[0].tagName === "A";
captionsContent = $(item)
.find(containsLinks ? "a *" : "*")
.not("img")
.wrap("<div class='ui-carousel-captions-content ui-bar-" +
o.captionstheme + " ui-carousel-captions-" + o.captionspos +
"'></div>")
.parent();
captionsHeading = captionsContent.find(o.heading).addClass(
"ui-carousel-captions-heading"
);
}
// create radios
if (o.bullets) {
// TODO: do this in jQuery...
radio = document.createElement("input");
radio.setAttribute("type", 'radio');
radio.setAttribute("name", 'radio-' + this.uuid);
radio.setAttribute("value", 'radio-' + this.uuid + '-' + i);
if (i === 0) {
radio.checked = true;
$(item).addClass("ui-carousel-active");
}
// and use data()
radio.reference = $(item);
label = document.createElement("label");
label.setAttribute("data-" + $.mobile.ns + "iconpos", "notext");
label.appendChild(radio);
fragment.appendChild(label);
}
}
if (o.inset) {
classes += " ui-carousel-inset";
}
if (o.captions) {
classes += " ui-carousel-captions";
}
if (o.bullets) {
classes += " ui-carousel-bullets";
barrel = $("<div id='ui-carousel-barrel-" + this.uuid +
"' class='ui-carousel-controls ui-carousel-controls-" +
o.bulletsPos + "' />");
while (fragment.firstChild) {
// browser hangs up if calling this inside append()
$(fragment.firstChild).children().checkboxradio();
barrel.append(
fragment.firstChild
);
}
// remove existing barrel
if (create === undefined) {
$("#ui-carousel-barrel-" + this.uuid).remove();
}
// this always needs to go before the slider
el[o.bulletsPos === "top" ? "before" : "after"](barrel);
this._on(barrel.find("input"), { change: "_onChange"});
}
// all set, add classes
el.addClass(classes);
},
// _handleKeydown: function( event ) {
// var index = this._value();
// if ( this.options.disabled ) {
// return;
// }
//
// // In all cases prevent the default and mark the handle as active
// switch ( event.keyCode ) {
// case $.mobile.keyCode.RIGHT:
// case $.mobile.keyCode.LEFT:
// event.preventDefault();
//
// if ( !this._keySliding ) {
// this._keySliding = true;
// this.handle.addClass( "ui-state-active" );
// }
//
// break;
// }
//
// // move the slider according to the keypress
// switch ( event.keyCode ) {
// case $.mobile.keyCode.RIGHT:
// this.refresh( index + this.step );
// break;
// case $.mobile.keyCode.LEFT:
// this.refresh( index - this.step );
// break;
// }
// }, // remove active mark
//
// _handleKeyup: function(/* event */) {
// if ( this._keySliding ) {
// this._keySliding = false;
// }
// },
// _bindSwipeEvents: function() {
// var self = this,
// area = self.element;
//
// // on swipe, change to the next/previous image
// if( !!self.options.swipeClose ) {
// if ( self.options.position === "left" ) {
// area.on( "swipeleft.carousel", function(/* e */) {
// // self.close();
// });
// } else {
// area.on( "swiperight.carousel", function(/* e */) {
// // self.close();
// });
// }
// }
// },
_completeTransition: function (current, next, events) {
var self = this,
o = self.options;
next.removeClass("in out " + o.carouseltransition)
.off(events);
current
.on(events, self._cleanupTransition(current, events));
},
_cleanupTransition: function (current, events) {
var self = this,
o = self.options,
classes = o.carouseltransition + " out in";
current.removeClass(classes);
current.removeClass("ui-carousel-active").off(events);
},
_onChange: function (e) {
var self = this,
events = self._transitionEndEvents,
el = self.element,
o = self.options,
currentActive = el.children().filter(".ui-carousel-active"),
nextActive = e.target.reference,
//classes = o.carouseltransition + " out in",
transition = $.mobile._maybeDegradeTransition(o.carouseltransition);
// click on active radio
if (nextActive.hasClass("ui-carousel-active")) {
return;
}
// initialize
nextActive
.on(events, self._completeTransition(
currentActive,
nextActive,
events
));
nextActive
.addClass(transition + " ui-carousel-active in ");
}
});
}(jQuery));
/* tranistion workflow
// first slide
if (init) {
current.removeClass("ui-carousel-active in out reverse slide")
next.css('z-index','-10')
.addClass("ui-carousel-active ui-carousel-opaque")
.css('z-index','')
if (transition !== "none") {
// > once animation is complete!
// current.removeClass("ui-carousel-active in out reverse slide")
// next.removeClass("out in reverse slide")
next.removeClass("ui-carousel-opaque")
.addClass("slide in reverse")
} else {
current.removeClass("ui-carousel-active in out reverse slide")
next.removeClass("out in reverse slide")
}
} else {
// > once animation is complete
current.removeClass("ui-carousel-active in out reverse slide")
next.css('z-index','-10')
.addClass("ui-carousel-active ui-carousel-opaque")
.css('z-index','')
if (transition !== "none") {
// > once animation is complete!
// current.removeClass("ui-carousel-active in out reverse slide")
// next.removeClass("out in reverse slide")
next.removeClass("ui-carousel-opaque")
.addClass("slide in reverse")
} else {
current.removeClass("ui-carousel-active in out reverse slide")
next.removeClass("out in reverse slide")
}
current.addClass("slide out reverse");
}
*/
/* ========================= ACTION BUTTON EXTENSION ==================== */
(function () {
$.widget("mobile.textinput", $.mobile.textinput, {
options: {
actionBtn: false,
actionBtnText: "Search",
actionBtnIcon: "search"
},
_create: function () {
this._super();
if (!!this.options.actionBtn || this.isSearch) {
this._addActionBtn();
}
},
actionButton: function () {
return $("<a href='#' class='ui-input-action ui-btn ui-icon-" +
this.options.actionBtnIcon + " ui-btn-icon-notext ui-corner-all" +
"' title='" + this.options.actionBtnText + "'>" +
this.options.actionBtnText + "</a>");
},
_addActionBtn: function () {
if (!this.options.enhanced) {
this._enhanceAction();
}
$.extend(this, {
_actionBtn: this.widget().find("a.ui-input-action")
});
},
_enhanceAction: function () {
this.actionButton().appendTo(this.widget());
this.widget().addClass(
"ui-input-has-action ui-input-search-no-pseudo"
);
},
_setOptions: function (options) {
this._super(options);
if (options.actionBtn !== undefined &&
!this.element.is("textarea, :jqmData(type='range')")) {
if (options.actionBtn) {
this._addActionBtn();
} else {
this._destroyAction();
}
}
if (options.clearBtnText !== undefined &&
this._actionBtn !== undefined) {
this._actionBtn.text(options.clearBtnText);
}
},
_destroyAction: function () {
this.element.removeClass("ui-input-has-clear");
this._actionBtn.remove();
},
_destroy: function () {
this._super();
this._destroyAction();
}
});
}());
/* ============================= TABLE ====================================*/
(function( $, undefined ) {
$.widget( "mobile.table", {
options: {
classes: {
table: "ui-table"
},
enhanced: false
},
_create: function() {
if ( !this.options.enhanced ) {
this.element.addClass( this.options.classes.table );
}
// extend here, assign on refresh > _setHeaders
$.extend( this, {
// Expose headers and allHeaders properties on the widget
// headers references the THs within the first TR in the table
headers: undefined,
// allHeaders references headers, plus all THs in the thead, which may
// include several rows, or not
allHeaders: undefined
});
this._refresh( true );
},
_setHeaders: function() {
var trs = this.element.find( "thead tr" );
this.headers = this.element.find( "tr:eq(0)" ).children();
this.allHeaders = this.headers.add( trs.children() );
},
refresh: function() {
this._refresh();
},
rebuild: $.noop,
_refresh: function( /* create */ ) {
var table = this.element,
trs = table.find( "thead tr" );
// updating headers on refresh (fixes #5880)
this._setHeaders();
// Iterate over the trs
trs.each( function() {
var columnCount = 0;
// Iterate over the children of the tr
$( this ).children().each( function() {
var span = parseInt( $.mobile.getAttribute( this, "colspan" ), 10 ),
selector = ":nth-child(" + ( columnCount + 1 ) + ")",
j;
this.setAttribute( "data-" + $.mobile.ns + "colstart", columnCount + 1 );
if ( span ) {
for( j = 0; j < span - 1; j++ ) {
columnCount++;
selector += ", :nth-child(" + ( columnCount + 1 ) + ")";
}
}
// Store "cells" data on header as a reference to all cells in the
// same column as this TH
$( this ).jqmData( "cells", table.find( "tr" ).not( trs.eq( 0 ) ).not( this ).children( selector ) );
columnCount++;
});
});
}
});
})( jQuery );
(function( $, undefined ) {
$.widget( "mobile.table", $.mobile.table, {
options: {
mode: "columntoggle",
columnBtnTheme: null,
columnPopupTheme: null,
columnBtnText: "Columns...",
columnBtnIcon: "Search",
sort: null,
wrap: null,
topGrid: null,
bottomGrid: null,
classes: $.extend( $.mobile.table.prototype.options.classes, {
popup: "ui-table-columntoggle-popup",
columnBtn: "ui-table-columntoggle-btn",
priorityPrefix: "ui-table-priority-",
columnToggleTable: "ui-table-columntoggle"
})
},
_create: function() {
this._super();
if( this.options.mode !== "columntoggle" ) {
return;
}
$.extend( this, {
_menu: null
});
if( this.options.enhanced ) {
this._menu = this.document.find( this._id() + "-popup" ).children().first();
} else {
this._menu = this._enhanceColToggle();
this.element.addClass( this.options.classes.columnToggleTable );
}
this._setupEvents();
this._setToggleState();
},
_id: function() {
return ( this.element.attr( "id" ) || ( this.widgetName + this.uuid ) );
},
_setupEvents: function() {
//NOTE: inputs are bound in bindToggles,
// so it can be called on refresh, too
// update column toggles on resize
this._on( $.mobile.window, {
throttledresize: "_setToggleState"
});
},
_bindToggles: function( menu ) {
var inputs = menu.find( "input" );
this._on( inputs, {
change: "_menuInputChange"
});
},
_addToggles: function( menu, keep ) {
var opts = this.options;
// allow update of menu on refresh (fixes #5880)
if ( !keep ) {
menu.empty();
}
// create the hide/show toggles
this.headers.not( "td" ).each( function() {
var header = $( this ),
priority = $.mobile.getAttribute( this, "priority", true ),
cells = header.add( header.jqmData( "cells" ) );
if( priority ) {
cells.addClass( opts.classes.priorityPrefix + priority );
if ( !keep ) {
$("<label><input type='checkbox' checked />" + header.text() + "</label>" )
.appendTo( menu )
.children( 0 )
.jqmData( "cells", cells )
.checkboxradio( {
theme: opts.columnPopupTheme
});
}
}
});
// set bindings here
if ( !keep ) {
this._bindToggles( menu );
}
},
_menuInputChange: function( evt ) {
var input = $( evt.target ),
checked = input[ 0 ].checked;
input.jqmData( "cells" )
.toggleClass( "ui-table-cell-hidden", !checked )
.toggleClass( "ui-table-cell-visible", checked );
if ( input[ 0 ].getAttribute( "locked" ) ) {
input.removeAttr( "locked" );
this._unlockCells( input.jqmData( "cells" ) );
} else {
input.attr( "locked", true );
}
},
_unlockCells: function( cells ) {
// allow hide/show via CSS only = remove all toggle-locks
cells.removeClass( "ui-table-cell-hidden ui-table-cell-visible");
},
_toLetter: function (n) {
return n.toString(26).replace(/./g, function( c ) {
return String.fromCharCode( c.charCodeAt(0) + ( isNaN( +c ) ? 10 : 49 ));
});
},
_generateWrapper: function ( grids ) {
return $("<div/>", {
class: "ui-table-wrapper ui-table-wrapper-inset ui-corner-all"
}).append($.map(new Array( grids ), function(){
return $("<div/>");
})).grid({ grid: grids > 1 ? this._toLetter(grids-2) : "solo" });
},
_enhanceColToggle: function() {
var id , menuButton, popup, menu, front, back, slots, fill, i, sorts, btn, item,
table = this.element,
opts = this.options,
ns = $.mobile.ns,
fragment = $.mobile.document[ 0 ].createDocumentFragment();
id = this._id() + "-popup";
menuButton = $( "<a role='button' href='#" + id + "' " +
"class='" + opts.classes.columnBtn + " ui-btn ui-btn-" + ( opts.columnBtnTheme || "a" ) + " ui-corner-all ui-shadow ui-mini ui-icon ui-btn-icon-left ui-icon-"+ opts.columnBtnIcon +"' " +
"data-" + ns + "rel='popup' " +
"data-" + ns + "icon='" + opts.columnBtnIcon + "' " +
"data-" + ns + "mini='true'>" + opts.columnBtnText + "</a>" );
popup = $( "<div data-" + ns + "role='popup' data-" + ns + "role='fieldcontain' class='" + opts.classes.popup + "' id='" + id + "'></div>" );
menu = $( "<fieldset data-" + ns + "role='controlgroup'></fieldset>" );
// set extension here, send "false" to trigger build/rebuild
this._addToggles( menu, false );
menu.appendTo( popup );
// wrappers
// TODO: not nice, should be possible to wrap top with 3 elements
// and then where do you put the toggle button
// TODO: also not nice, because no way to latch on the filter
// TODO: also not nice, because data-slot-id is not used.
if (opts.wrap) {
fill = table.parent().find( "div[data-slot]" );
if (opts.wrap === "both") {
front = this._generateWrapper( opts.topGrid );
back = this._generateWrapper( opts.bottomGrid );
if (fill) {
slots = front.add( back ).children("div");
for (i = 0; i < fill.length; i += 1) {
item = parseFloat(fill.eq(i).jqmData("slot-id"))-1;
fill.eq(i)
.find("label")
.addClass("ui-hidden-accessible")
.end()
// skip slot 2
.appendTo( slots.eq( item || (i === 2 ? 3 : i)) );
}
}
front
.addClass("ui-table-wrapper-top")
.children("div").last().append( menuButton[ 0 ] );
back
.addClass("ui-table-wrapper-bottom");
fragment.appendChild( front[ 0 ] );
fragment.appendChild( popup[ 0 ] );
// not possible in one-go...
table.before(fragment)
table.after(back);
} else {
front = this._generateWrapper( opts.topGrid || opts.bottomGrid || 3);
if (fill.length) {
slots = front.children("div");
for (i = 0; i < fill.length; i += 1) {
fill.eq(i)
.find("label")
.addClass("ui-hidden-accessible")
.end()
// skip slot 2
.appendTo( slots.eq( i === 2 ? 3 : i ) );
}
}
front
.addClass("ui-table-wrapper-top")
.children("div").last().append( menuButton[ 0 ] );
fragment.appendChild( front[ 0 ] );
fragment.appendChild( popup[ 0 ] );
// not possible in one-go...
table[ opts.wrap === "top" ? "before" : "after"](fragment)
}
// no wrap
} else {
fragment.appendChild( popup[ 0 ] );
fragment.appendChild( menuButton[ 0 ] );
table.before( fragment );
}
if (opts.sort) {
sorts = table.find( "thead tr th[data-sortable]" );
btn = $("<a />", {
class: "ui-sortable ui-btn ui-icon-sort-down ui-icon ui-btn-icon-right",
});
sorts.each(function(i, el) {
var $el = $(el);
$el.html( btn.clone().text( $el.text() ) );
});
}
popup.popup().children( "fieldset" ).controlgroup();
// always return the menu
return menu;
},
rebuild: function() {
this._super();
if ( this.options.mode === "columntoggle" ) {
// NOTE: rebuild passes "false", while refresh passes "undefined"
// both refresh the table, but inside addToggles, !false will be true,
// so a rebuild call can be indentified
this._refresh( false );
}
},
_refresh: function( create ) {
this._super( create );
if ( !create && this.options.mode === "columntoggle" ) {
// columns not being replaced must be cleared from input toggle-locks
this._unlockCells( this.allHeaders );
// update columntoggles and cells
this._addToggles( this._menu, create );
// check/uncheck
this._setToggleState();
}
},
_setToggleState: function() {
this._menu.find( "input" ).each( function() {
var checkbox = $( this );
this.checked = checkbox.jqmData( "cells" ).eq( 0 ).css( "display" ) === "table-cell";
checkbox.checkboxradio( "refresh" );
});
},
_destroy: function() {
this._super();
}
});
})( jQuery );
(function( $, undefined ) {
$.widget( "mobile.table", $.mobile.table, {
options: {
mode: "reflow",
classes: $.extend( $.mobile.table.prototype.options.classes, {
reflowTable: "ui-table-reflow",
cellLabels: "ui-table-cell-label"
})
},
_create: function() {
this._super();
// If it's not reflow mode, return here.
if( this.options.mode !== "reflow" ) {
return;
}
if( !this.options.enhanced ) {
this.element.addClass( this.options.classes.reflowTable );
this._updateReflow();
}
},
rebuild: function() {
this._super();
if ( this.options.mode === "reflow" ) {
this._refresh( false );
}
},
_refresh: function( create ) {
this._super( create );
if ( !create && this.options.mode === "reflow" ) {
this._updateReflow( );
}
},
_updateReflow: function() {
var table = this,
opts = this.options;
// get headers in reverse order so that top-level headers are appended last
$( table.allHeaders.get().reverse() ).each( function() {
var cells = $( this ).jqmData( "cells" ),
colstart = $.mobile.getAttribute( this, "colstart", true ),
hierarchyClass = cells.not( this ).filter( "thead th" ).length && " ui-table-cell-label-top",
text = $( this ).text(),
iteration, filter;
if ( text !== "" ) {
if( hierarchyClass ) {
iteration = parseInt( this.getAttribute( "colspan" ), 10 );
filter = "";
if ( iteration ){
filter = "td:nth-child("+ iteration +"n + " + ( colstart ) +")";
}
table._addLabels( cells.filter( filter ), opts.classes.cellLabels + hierarchyClass, text );
} else {
table._addLabels( cells, opts.classes.cellLabels, text );
}
}
});
},
_addLabels: function( cells, label, text ) {
// .not fixes #6006
cells.not( ":has(b." + label + ")" ).prepend( "<b class='" + label + "'>" + text + "</b>" );
}
});
})( jQuery );
/* ====================================== COLLAPSIBLE =====================*/
(function( $, undefined ) {
var rInitialLetter = /([A-Z])/g;
$.widget( "mobile.collapsible", {
options: {
enhanced: false,
expandCueText: null,
collapseCueText: null,
collapsed: true,
heading: "h1,h2,h3,h4,h5,h6,legend",
icon: null,
collapsedIcon: null,
expandedIcon: null,
iconpos: null,
theme: null,
contentTheme: null,
inset: null,
corners: null,
mini: null
},
_create: function() {
var elem = this.element,
ui = {
accordion: elem
.closest( ":jqmData(role='collapsible-set')" +
( $.mobile.collapsibleset ? ", :mobile-collapsibleset" : "" ) )
.addClass( "ui-collapsible-set" )
};
$.extend( this, {
_ui: ui
});
if ( this.options.enhanced ) {
ui.heading = $( ".ui-collapsible-heading", this.element[ 0 ] );
ui.content = ui.heading.next();
ui.anchor = $( "a", ui.heading[ 0 ] ).first();
ui.status = ui.anchor.children( ".ui-collapsible-heading-status" );
} else {
this._enhance( elem, ui );
}
this._on( ui.heading, {
"tap": function() {
ui.heading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
},
"click": function( event ) {
this._handleExpandCollapse( !ui.heading.hasClass( "ui-collapsible-heading-collapsed" ) );
event.preventDefault();
event.stopPropagation();
}
});
},
// Adjust the keys inside options for inherited values
_getOptions: function( options ) {
var key,
accordion = this._ui.accordion,
accordionWidget = this._ui.accordionWidget;
// Copy options
options = $.extend( {}, options );
if ( accordion.length && !accordionWidget ) {
this._ui.accordionWidget =
accordionWidget = accordion.data( "mobile-collapsibleset" );
}
for ( key in options ) {
// Retrieve the option value first from the options object passed in and, if
// null, from the parent accordion or, if that's null too, or if there's no
// parent accordion, then from the defaults.
options[ key ] =
( options[ key ] != null ) ? options[ key ] :
( accordionWidget ) ? accordionWidget.options[ key ] :
accordion.length ? $.mobile.getAttribute( accordion[ 0 ],
key.replace( rInitialLetter, "-$1" ).toLowerCase(), true ):
null;
if ( null == options[ key ] ) {
options[ key ] = $.mobile.collapsible.defaults[ key ];
}
}
return options;
},
_themeClassFromOption: function( prefix, value ) {
return ( value ? ( value === "none" ? "" : prefix + value ) : "" );
},
_enhance: function( elem, ui ) {
var iconclass,
opts = this._getOptions( this.options ),
contentThemeClass = this._themeClassFromOption( "ui-body-", opts.contentTheme );
elem.addClass( "ui-collapsible " +
( opts.inset ? "ui-collapsible-inset " : "" ) +
( opts.inset && opts.corners ? "ui-corner-all " : "" ) +
( contentThemeClass ? "ui-collapsible-themed-content " : "" ) );
ui.originalHeading = elem.children( this.options.heading ).first(),
ui.content = elem
.wrapInner( "<div " +
"class='ui-collapsible-content " +
contentThemeClass + "'></div>" )
.children( ".ui-collapsible-content" ),
ui.heading = ui.originalHeading;
// Replace collapsibleHeading if it's a legend
if ( ui.heading.is( "legend" ) ) {
ui.heading = $( "<div role='heading'>"+ ui.heading.html() +"</div>" );
ui.placeholder = $( "<div><!-- placeholder for legend --></div>" ).insertBefore( ui.originalHeading );
ui.originalHeading.remove();
}
iconclass = ( opts.icon === false ? "ui-collapsible-hide-icon " : "" ) +
( opts.collapsed ? ( opts.collapsedIcon ? "ui-icon-" + opts.collapsedIcon : "" ) :
( opts.expandedIcon ? "ui-icon-" + opts.expandedIcon : "" ));
ui.status = $( "<span class='ui-collapsible-heading-status'></span>" );
ui.anchor = ui.heading
.detach()
//modify markup & attributes
.addClass( "ui-collapsible-heading" )
.append( ui.status )
.wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
.find( "a" )
.first()
.addClass( "ui-btn " +
( iconclass ? iconclass + " " : "" ) +
( iconclass ? ( "ui-btn-icon-" +
( opts.iconpos === "right" ? "right" : "left" ) ) +
" " : "" ) +
this._themeClassFromOption( "ui-btn-", opts.theme ) + " " +
( opts.mini ? "ui-mini " : "" ) );
//drop heading in before content
ui.heading.insertBefore( ui.content );
this._handleExpandCollapse( this.options.collapsed );
return ui;
},
refresh: function() {
var key, options = {};
for ( key in $.mobile.collapsible.defaults ) {
options[ key ] = this.options[ key ];
}
this._setOptions( options );
},
_setOptions: function( options ) {
var isCollapsed, newTheme, oldTheme,
elem = this.element,
currentOpts = this.options,
ui = this._ui,
anchor = ui.anchor,
status = ui.status,
opts = this._getOptions( options );
// First and foremost we need to make sure the collapsible is in the proper
// state, in case somebody decided to change the collapsed option at the
// same time as another option
if ( options.collapsed !== undefined ) {
this._handleExpandCollapse( options.collapsed );
}
isCollapsed = elem.hasClass( "ui-collapsible-collapsed" );
// Only options referring to the current state need to be applied right away
// It is enough to store options covering the alternate in this.options.
if ( isCollapsed ) {
if ( opts.expandCueText !== undefined ) {
status.text( opts.expandCueText );
}
if ( opts.collapsedIcon !== undefined ) {
if ( currentOpts.collapsedIcon ) {
anchor.removeClass( "ui-icon-" + currentOpts.collapsedIcon );
}
if ( opts.collapsedIcon ) {
anchor.addClass( "ui-icon-" + opts.collapsedIcon );
}
}
} else {
if ( opts.collapseCueText !== undefined ) {
status.text( opts.collapseCueText );
}
if ( opts.expandedIcon !== undefined ) {
if ( currentOpts.expandedIcon ) {
anchor.removeClass( "ui-icon-" + currentOpts.expandedIcon );
}
if ( opts.expandedIcon ) {
anchor.addClass( "ui-icon-" + opts.expandedIcon );
}
}
}
if ( opts.iconpos !== undefined ) {
anchor.removeClass( "ui-btn-icon-" + ( currentOpts.iconPos === "right" ? "right" : "left" ) );
anchor.addClass( "ui-btn-icon-" + ( opts.iconPos === "right" ? "right" : "left" ) );
}
if ( opts.theme !== undefined ) {
oldTheme = this._themeClassFromOption( "ui-btn-", currentOpts.theme );
newTheme = this._themeClassFromOption( "ui-btn-", opts.theme );
anchor.removeClass( oldTheme ).addClass( newTheme );
}
if ( opts.contentTheme !== undefined ) {
oldTheme = this._themeClassFromOption( "ui-body-", currentOpts.theme );
newTheme = this._themeClassFromOption( "ui-body-", opts.theme );
ui.content.removeClass( oldTheme ).addClass( newTheme );
}
// It is important to apply "inset" before corners, because the new value of
// "inset" can affect whether we display corners or not. Note that setting
// the "inset" option to false does not cause a change in the value of
// this.options.corners - it merely causes a change in the interpretation of
// the value of the "corners" option.
if ( opts.inset !== undefined ) {
elem.toggleClass( "ui-collapsible-inset", opts.inset );
currentOpts.inset = opts.inset;
if ( !opts.inset ) {
opts.corners = false;
}
}
if ( opts.corners !== undefined ) {
elem.toggleClass( "ui-corner-all", currentOpts.inset && opts.corners );
}
if ( opts.mini !== undefined ) {
anchor.toggleClass( "ui-mini", opts.mini );
}
this._super( options );
},
_handleExpandCollapse: function( isCollapse ) {
var opts = this._getOptions( this.options ),
ui = this._ui;
ui.status.text( isCollapse ? opts.expandCueText : opts.collapseCueText );
ui.heading
.toggleClass( "ui-collapsible-heading-collapsed", isCollapse )
.find( "a" ).first()
.toggleClass( "ui-icon-" + opts.expandedIcon, !isCollapse )
// logic or cause same icon for expanded/collapsed state would remove the ui-icon-class
.toggleClass( "ui-icon-" + opts.collapsedIcon, ( isCollapse || opts.expandedIcon === opts.collapsedIcon ) )
.removeClass( $.mobile.activeBtnClass );
this.element.toggleClass( "ui-collapsible-collapsed", isCollapse );
ui.content
.toggleClass( "ui-collapsible-content-collapsed", isCollapse )
.attr( "aria-hidden", isCollapse )
.trigger( "updatelayout" );
this.options.collapsed = isCollapse;
this._trigger( isCollapse ? "collapse" : "expand" );
},
expand: function() {
this._handleExpandCollapse( false );
},
collapse: function() {
this._handleExpandCollapse( true );
},
_destroy: function() {
var ui = this._ui,
opts = this.options;
if ( opts.enhanced ) {
return;
}
if ( ui.placeholder ) {
ui.originalHeading.insertBefore( ui.placeholder );
ui.placeholder.remove();
ui.heading.remove();
} else {
ui.status.remove();
ui.heading
.removeClass( "ui-collapsible-heading ui-collapsible-heading-collapsed" )
.children()
.contents()
.unwrap();
}
ui.anchor.contents().unwrap();
ui.content.contents().unwrap();
this.element
.removeClass( "ui-collapsible ui-collapsible-collapsed " +
"ui-collapsible-themed-content ui-collapsible-inset ui-corner-all" );
}
});
// Defaults to be used by all instances of collapsible if per-instance values
// are unset or if nothing is specified by way of inheritance from an accordion.
// Note that this hash does not contain options "collapsed" or "heading",
// because those are not inheritable.
$.mobile.collapsible.defaults = {
expandCueText: " click to expand contents",
collapseCueText: " click to collapse contents",
collapsedIcon: "plus",
expandedIcon: "minus",
iconpos: "left",
inset: true,
corners: true,
mini: false
};
})( jQuery );
/* ============================= COLLAPSIBLE_SET =========================*/
(function( $, undefined ) {
var childCollapsiblesSelector = ":mobile-collapsible, " + $.mobile.collapsible.initSelector;
$.widget( "mobile.collapsibleset", $.extend( {
// The initSelector is deprecated as of 1.4.0. In 1.5.0 we will use
// :jqmData(role='collapsibleset') which will allow us to get rid of the line
// below altogether, because the autoinit will generate such an initSelector
initSelector: ":jqmData(role='collapsible-set'),:jqmData(role='collapsibleset')",
options: $.extend( {
enhanced: false,
type: null
}, $.mobile.collapsible.defaults ),
_isSetAndClose: function ( parent, allClosed ) {
if (allClosed) {
return parent.children().length === parent.children(".ui-collapsible-collapsed").length;
}
return parent.is( ":mobile-collapsibleset, :jqmData(role='collapsible-set')" );
},
_handleCollapsibleExpand: function( event ) {
var closestCollapsible = $( event.target ).closest( ".ui-collapsible" ),
parentElement = closestCollapsible.parent();
if ( this._isSetAndClose( parentElement ) ) {
closestCollapsible
.siblings( ".ui-collapsible:not(.ui-collapsible-collapsed)" )
.collapsible( "collapse" );
parentElement.toggleClass("ui-collapsible-set-all-closed", this._isSetAndClose( parentElement, true) );
}
},
_handleCollapsibleCollapse: function ( event ) {
var closestCollapsible = $( event.target ).closest( ".ui-collapsible" ),
parentElement = closestCollapsible.parent();
if ( this._isSetAndClose( parentElement ) ) {
parentElement.toggleClass("ui-collapsible-set-all-closed", this._isSetAndClose( parentElement, true) );
}
},
_create: function() {
var elem = this.element,
opts = this.options;
$.extend( this, {
_classes: ""
});
if ( !opts.enhanced ) {
elem.addClass( "ui-collapsible-set " +
this._themeClassFromOption( "ui-group-theme-", opts.theme ) + " " +
( opts.corners && opts.inset ? "ui-corner-all " : "" ) );
// tabs
if (opts.type) {
elem.addClass( "ui-collapsible-tabs" );
}
this.element.find( $.mobile.collapsible.initSelector ).collapsible();
}
this._on( elem, {
collapsibleexpand: "_handleCollapsibleExpand",
collapsiblecollapse: "_handleCollapsibleCollapse"
} );
},
_themeClassFromOption: function( prefix, value ) {
return ( value ? ( value === "none" ? "" : prefix + value ) : "" );
},
_init: function() {
this._refresh( true );
// Because the corners are handled by the collapsible itself and the default state is collapsed
// That was causing https://github.com/jquery/jquery-mobile/issues/4116
this.element
.children( childCollapsiblesSelector )
.filter( ":jqmData(collapsed='false')" )
.collapsible( "expand" );
},
_setOptions: function( options ) {
var ret,
elem = this.element,
themeClass = this._themeClassFromOption( "ui-group-theme-", options.theme );
if ( themeClass ) {
elem
.removeClass( this._themeClassFromOption( "ui-group-theme-", this.options.theme ) )
.addClass( themeClass );
}
if ( options.corners !== undefined ) {
elem.toggleClass( "ui-corner-all", options.corners );
}
ret = this._super( options );
this.element.children( ":mobile-collapsible" ).collapsible( "refresh" );
return ret;
},
_destroy: function() {
var el = this.element;
this._removeFirstLastClasses( el.children( childCollapsiblesSelector ) );
el
.removeClass( "ui-collapsible-set ui-corner-all " +
this._themeClassFromOption( "ui-group-theme", this.options.theme ) )
.children( ":mobile-collapsible" )
.collapsible( "destroy" );
},
_refresh: function( create ) {
var collapsiblesInSet = this.element.children( childCollapsiblesSelector );
this.element.find( $.mobile.collapsible.initSelector ).not( ".ui-collapsible" ).collapsible();
this._addFirstLastClasses( collapsiblesInSet, this._getVisibles( collapsiblesInSet, create ), create );
},
refresh: function() {
this._refresh( false );
}
}, $.mobile.behaviors.addFirstLastClasses ) );
})( jQuery );
......@@ -4,9 +4,21 @@
* http://www.gnu.org/licenses/lgpl.html
*/
(function (scope, hex_md5) {
// define([module_name], [dependencies], module);
(function (dependencies, module) {
"use strict";
var localstorage;
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
if (typeof exports === 'object') {
return module(exports, require('md5'));
}
window.jIO = {};
module(window.jIO, {hex_md5: hex_md5});
}(['exports', 'md5'], function (exports, md5) {
"use strict";
var localstorage, hex_md5 = md5.hex_md5;
if (typeof localStorage !== "undefined") {
localstorage = {
getItem: function (item) {
......@@ -17,7 +29,7 @@
return localStorage.setItem(item, JSON.stringify(value));
},
removeItem: function (item) {
delete localStorage[item];
return localStorage.removeItem(item);
},
clone: function () {
return JSON.parse(JSON.stringify(localStorage));
......@@ -29,8 +41,7 @@
localstorage = {
getItem: function (item) {
var value = pseudo_localStorage[item];
return value === undefined ?
null : JSON.parse(pseudo_localStorage[item]);
return value === undefined ? null : JSON.parse(value);
},
setItem: function (item, value) {
pseudo_localStorage[item] = JSON.stringify(value);
......@@ -531,13 +542,13 @@ var command = function (spec, my) {
* @param {object} storage The storage.
*/
that.validate = function (storage) {
if (typeof priv.doc._id === "string" && priv.doc._id.match(" ")) {
if (typeof priv.doc._id === "string" && priv.doc._id === "") {
that.error({
"status": 21,
"statusText": "Invalid Document Id",
"error": "invalid_document_id",
"message": "The document id is invalid",
"reason": "The document id contains spaces"
"reason": "empty"
});
return false;
}
......@@ -2774,78 +2785,65 @@ Object.defineProperty(that, "repair", {
return that;
}; // End Class jio
/*jslint indent: 2, maxlen: 80, sloppy: true */
/*global jio: true, invalidStorageType: true */
/*global exports, jio, invalidStorageType */
var storage_type_object = { // -> 'key':constructorFunction
'base': function () {} // overriden by jio
'base': function () { // overriden by jio
return undefined;
}
};
var jioNamespace = (function (spec) {
var that = {};
spec = spec || {};
// Attributes //
// Methods //
/**
* Creates a new jio instance.
* @method newJio
* @param {object} spec The storage description
* @return {object} The new Jio instance.
*/
Object.defineProperty(that, "newJio", {
configurable: false,
enumerable: false,
writable: false,
value: function (spec) {
var storage = spec,
instance = null;
if (typeof storage === 'string') {
/**
* Creates a new jio instance.
* @method newJio
* @param {object} spec The storage description
* @return {object} The new Jio instance.
*/
Object.defineProperty(exports, "newJio", {
configurable: false,
enumerable: true,
writable: false,
value: function (spec) {
var storage = spec, instance = null;
if (typeof storage === 'string') {
storage = JSON.parse(storage);
} else {
storage = JSON.stringify(storage);
if (storage !== undefined) {
storage = JSON.parse(storage);
} else {
storage = JSON.stringify(storage);
if (storage !== undefined) {
storage = JSON.parse(storage);
}
}
storage = storage || {
type: 'base'
};
instance = jio(storage);
instance.start();
return instance;
}
});
/**
* Add a storage type to jio.
* @method addStorageType
* @param {string} type The storage type
* @param {function} constructor The associated constructor
*/
Object.defineProperty(that, "addStorageType", {
configurable: false,
enumerable: false,
writable: false,
value: function (type, constructor) {
constructor = constructor || function () {
return null;
};
if (storage_type_object[type]) {
throw invalidStorageType({
type: type,
message: 'Already known.'
});
}
storage_type_object[type] = constructor;
}
});
return that;
}());
storage = storage || {
type: 'base'
};
instance = jio(storage);
instance.start();
return instance;
}
});
Object.defineProperty(scope, "jIO", {
/**
* Add a storage type to jio.
* @method addStorageType
* @param {string} type The storage type
* @param {function} constructor The associated constructor
*/
Object.defineProperty(exports, "addStorageType", {
configurable: false,
enumerable: false,
enumerable: true,
writable: false,
value: jioNamespace
value: function (type, constructor) {
constructor = constructor || function () {
return null;
};
if (storage_type_object[type]) {
throw invalidStorageType({
type: type,
message: 'Already known.'
});
}
storage_type_object[type] = constructor;
}
});
}(window, hex_md5));
}));
This source diff could not be displayed because it is too large. You can view the blob instead.
// Simple yet flexible JSON editor plugin.
// Turns any element into a stylable interactive JSON editor.
// Copyright (c) 2013 David Durman
// Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
// Dependencies:
// * jQuery
// * JSON (use json2 library for browsers that do not support JSON natively)
// Example:
// var myjson = { any: { json: { value: 1 } } };
// var opt = { change: function() { /* called on every change */ } };
// /* opt.propertyElement = '<textarea>'; */ // element of the property field, <input> is default
// /* opt.valueElement = '<textarea>'; */ // element of the value field, <input> is default
// $('#mydiv').jsonEditor(myjson, opt);
(function( $ ) {
$.fn.jsonEditor = function(json, options) {
options = options || {};
// Make sure functions or other non-JSON data types are stripped down.
json = parse(stringify(json));
var K = function() {};
var onchange = options.change || K;
var onpropertyclick = options.propertyclick || K;
return this.each(function() {
JSONEditor($(this), json, onchange, onpropertyclick, options.propertyElement, options.valueElement);
});
};
function JSONEditor(target, json, onchange, onpropertyclick, propertyElement, valueElement) {
var opt = {
target: target,
onchange: onchange,
onpropertyclick: onpropertyclick,
original: json,
propertyElement: propertyElement,
valueElement: valueElement
};
construct(opt, json, opt.target);
$(opt.target).on('blur focus', '.property, .value', function() {
$(this).toggleClass('editing');
});
}
function isObject(o) { return Object.prototype.toString.call(o) == '[object Object]'; }
function isArray(o) { return Object.prototype.toString.call(o) == '[object Array]'; }
function isBoolean(o) { return Object.prototype.toString.call(o) == '[object Boolean]'; }
function isNumber(o) { return Object.prototype.toString.call(o) == '[object Number]'; }
function isString(o) { return Object.prototype.toString.call(o) == '[object String]'; }
var types = 'object array boolean number string null';
// Feeds object `o` with `value` at `path`. If value argument is omitted,
// object at `path` will be deleted from `o`.
// Example:
// feed({}, 'foo.bar.baz', 10); // returns { foo: { bar: { baz: 10 } } }
function feed(o, path, value) {
var del = arguments.length == 2;
if (path.indexOf('.') > -1) {
var diver = o,
i = 0,
parts = path.split('.');
for (var len = parts.length; i < len - 1; i++) {
diver = diver[parts[i]];
}
if (del) delete diver[parts[len - 1]];
else diver[parts[len - 1]] = value;
} else {
if (del) delete o[path];
else o[path] = value;
}
return o;
}
// Get a property by path from object o if it exists. If not, return defaultValue.
// Example:
// def({ foo: { bar: 5 } }, 'foo.bar', 100); // returns 5
// def({ foo: { bar: 5 } }, 'foo.baz', 100); // returns 100
function def(o, path, defaultValue) {
path = path.split('.');
var i = 0;
while (i < path.length) {
if ((o = o[path[i++]]) == undefined) return defaultValue;
}
return o;
}
function error(reason) { if (window.console) { console.error(reason); } }
function parse(str) {
var res;
try { res = JSON.parse(str); }
catch (e) { res = null; error('JSON parse failed.'); }
return res;
}
function stringify(obj) {
var res;
try { res = JSON.stringify(obj); }
catch (e) { res = 'null'; error('JSON stringify failed.'); }
return res;
}
function addExpander(item) {
if (item.children('.expander').length == 0) {
var expander = $('<span>', { 'class': 'expander' });
expander.bind('click', function() {
var item = $(this).parent();
item.toggleClass('expanded');
});
item.prepend(expander);
}
}
function addListAppender(item, handler) {
var appender = $('<div>', { 'class': 'item appender' }),
btn = $('<button></button>', { 'class': 'property' });
btn.text('Add New Value');
appender.append(btn);
item.append(appender);
btn.click(handler);
return appender;
}
function addNewValue(json) {
if (isArray(json)) {
json.push(null);
return true;
}
if (isObject(json)) {
var i = 1, newName = "newKey";
while (json.hasOwnProperty(newName)) {
newName = "newKey" + i;
i++;
}
json[newName] = null;
return true;
}
return false;
}
function construct(opt, json, root, path) {
path = path || '';
root.children('.item').remove();
for (var key in json) {
if (!json.hasOwnProperty(key)) continue;
var item = $('<div>', { 'class': 'item', 'data-path': path }),
property = $(opt.propertyElement || '<input>', { 'class': 'property' }),
value = $(opt.valueElement || '<input>', { 'class': 'value' });
if (isObject(json[key]) || isArray(json[key])) {
addExpander(item);
}
item.append(property).append(value);
root.append(item);
property.val(key).attr('title', key);
var val = stringify(json[key]);
value.val(val).attr('title', val);
assignType(item, json[key]);
property.change(propertyChanged(opt));
value.change(valueChanged(opt));
property.click(propertyClicked(opt));
if (isObject(json[key]) || isArray(json[key])) {
construct(opt, json[key], item, (path ? path + '.' : '') + key);
}
}
if (isObject(json) || isArray(json)) {
addListAppender(root, function () {
addNewValue(json);
construct(opt, json, root, path);
opt.onchange(parse(stringify(opt.original)));
})
}
}
function updateParents(el, opt) {
$(el).parentsUntil(opt.target).each(function() {
var path = $(this).data('path');
path = (path ? path + '.' : path) + $(this).children('.property').val();
var val = stringify(def(opt.original, path, null));
$(this).children('.value').val(val).attr('title', val);
});
}
function propertyClicked(opt) {
return function() {
var path = $(this).parent().data('path');
var key = $(this).attr('title');
var safePath = path ? path.split('.').concat([key]).join('\'][\'') : key;
opt.onpropertyclick('[\'' + safePath + '\']');
};
}
function propertyChanged(opt) {
return function() {
var path = $(this).parent().data('path'),
val = parse($(this).next().val()),
newKey = $(this).val(),
oldKey = $(this).attr('title');
$(this).attr('title', newKey);
feed(opt.original, (path ? path + '.' : '') + oldKey);
if (newKey) feed(opt.original, (path ? path + '.' : '') + newKey, val);
updateParents(this, opt);
if (!newKey) $(this).parent().remove();
opt.onchange(parse(stringify(opt.original)));
};
}
function valueChanged(opt) {
return function() {
var key = $(this).prev().val(),
val = parse($(this).val() || 'null'),
item = $(this).parent(),
path = item.data('path');
feed(opt.original, (path ? path + '.' : '') + key, val);
if ((isObject(val) || isArray(val)) && !$.isEmptyObject(val)) {
construct(opt, val, item, (path ? path + '.' : '') + key);
addExpander(item);
} else {
item.find('.expander, .item').remove();
}
assignType(item, val);
updateParents(this, opt);
opt.onchange(parse(stringify(opt.original)));
};
}
function assignType(item, val) {
var className = 'null';
if (isObject(val)) className = 'object';
else if (isArray(val)) className = 'array';
else if (isBoolean(val)) className = 'boolean';
else if (isString(val)) className = 'string';
else if (isNumber(val)) className = 'number';
item.removeClass(types);
item.addClass(className);
}
})( jQuery );
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* js_channel is a very lightweight abstraction on top of
* postMessage which defines message formats and semantics
* to support interactions more rich than just message passing
* js_channel supports:
* + query/response - traditional rpc
* + query/update/response - incremental async return of results
* to a query
* + notifications - fire and forget
* + error handling
*
* js_channel is based heavily on json-rpc, but is focused at the
* problem of inter-iframe RPC.
*
* Message types:
* There are 5 types of messages that can flow over this channel,
* and you may determine what type of message an object is by
* examining its parameters:
* 1. Requests
* + integer id
* + string method
* + (optional) any params
* 2. Callback Invocations (or just "Callbacks")
* + integer id
* + string callback
* + (optional) params
* 3. Error Responses (or just "Errors)
* + integer id
* + string error
* + (optional) string message
* 4. Responses
* + integer id
* + (optional) any result
* 5. Notifications
* + string method
* + (optional) any params
*/
;var Channel = (function() {
"use strict";
// current transaction id, start out at a random *odd* number between 1 and a million
// There is one current transaction counter id per page, and it's shared between
// channel instances. That means of all messages posted from a single javascript
// evaluation context, we'll never have two with the same id.
var s_curTranId = Math.floor(Math.random()*1000001);
// no two bound channels in the same javascript evaluation context may have the same origin, scope, and window.
// futher if two bound channels have the same window and scope, they may not have *overlapping* origins
// (either one or both support '*'). This restriction allows a single onMessage handler to efficiently
// route messages based on origin and scope. The s_boundChans maps origins to scopes, to message
// handlers. Request and Notification messages are routed using this table.
// Finally, channels are inserted into this table when built, and removed when destroyed.
var s_boundChans = { };
// add a channel to s_boundChans, throwing if a dup exists
function s_addBoundChan(win, origin, scope, handler) {
function hasWin(arr) {
for (var i = 0; i < arr.length; i++) if (arr[i].win === win) return true;
return false;
}
// does she exist?
var exists = false;
if (origin === '*') {
// we must check all other origins, sadly.
for (var k in s_boundChans) {
if (!s_boundChans.hasOwnProperty(k)) continue;
if (k === '*') continue;
if (typeof s_boundChans[k][scope] === 'object') {
exists = hasWin(s_boundChans[k][scope]);
if (exists) break;
}
}
} else {
// we must check only '*'
if ((s_boundChans['*'] && s_boundChans['*'][scope])) {
exists = hasWin(s_boundChans['*'][scope]);
}
if (!exists && s_boundChans[origin] && s_boundChans[origin][scope])
{
exists = hasWin(s_boundChans[origin][scope]);
}
}
if (exists) throw "A channel is already bound to the same window which overlaps with origin '"+ origin +"' and has scope '"+scope+"'";
if (typeof s_boundChans[origin] != 'object') s_boundChans[origin] = { };
if (typeof s_boundChans[origin][scope] != 'object') s_boundChans[origin][scope] = [ ];
s_boundChans[origin][scope].push({win: win, handler: handler});
}
function s_removeBoundChan(win, origin, scope) {
var arr = s_boundChans[origin][scope];
for (var i = 0; i < arr.length; i++) {
if (arr[i].win === win) {
arr.splice(i,1);
}
}
if (s_boundChans[origin][scope].length === 0) {
delete s_boundChans[origin][scope];
}
}
function s_isArray(obj) {
if (Array.isArray) return Array.isArray(obj);
else {
return (obj.constructor.toString().indexOf("Array") != -1);
}
}
// No two outstanding outbound messages may have the same id, period. Given that, a single table
// mapping "transaction ids" to message handlers, allows efficient routing of Callback, Error, and
// Response messages. Entries are added to this table when requests are sent, and removed when
// responses are received.
var s_transIds = { };
// class singleton onMessage handler
// this function is registered once and all incoming messages route through here. This
// arrangement allows certain efficiencies, message data is only parsed once and dispatch
// is more efficient, especially for large numbers of simultaneous channels.
var s_onMessage = function(e) {
try {
var m = JSON.parse(e.data);
if (typeof m !== 'object' || m === null) throw "malformed";
} catch(e) {
// just ignore any posted messages that do not consist of valid JSON
return;
}
var w = e.source;
var o = e.origin;
var s, i, meth;
if (typeof m.method === 'string') {
var ar = m.method.split('::');
if (ar.length == 2) {
s = ar[0];
meth = ar[1];
} else {
meth = m.method;
}
}
if (typeof m.id !== 'undefined') i = m.id;
// w is message source window
// o is message origin
// m is parsed message
// s is message scope
// i is message id (or undefined)
// meth is unscoped method name
// ^^ based on these factors we can route the message
// if it has a method it's either a notification or a request,
// route using s_boundChans
if (typeof meth === 'string') {
var delivered = false;
if (s_boundChans[o] && s_boundChans[o][s]) {
for (var j = 0; j < s_boundChans[o][s].length; j++) {
if (s_boundChans[o][s][j].win === w) {
s_boundChans[o][s][j].handler(o, meth, m);
delivered = true;
break;
}
}
}
if (!delivered && s_boundChans['*'] && s_boundChans['*'][s]) {
for (var j = 0; j < s_boundChans['*'][s].length; j++) {
if (s_boundChans['*'][s][j].win === w) {
s_boundChans['*'][s][j].handler(o, meth, m);
break;
}
}
}
}
// otherwise it must have an id (or be poorly formed
else if (typeof i != 'undefined') {
if (s_transIds[i]) s_transIds[i](o, meth, m);
}
};
// Setup postMessage event listeners
if (window.addEventListener) window.addEventListener('message', s_onMessage, false);
else if(window.attachEvent) window.attachEvent('onmessage', s_onMessage);
/* a messaging channel is constructed from a window and an origin.
* the channel will assert that all messages received over the
* channel match the origin
*
* Arguments to Channel.build(cfg):
*
* cfg.window - the remote window with which we'll communicate
* cfg.origin - the expected origin of the remote window, may be '*'
* which matches any origin
* cfg.scope - the 'scope' of messages. a scope string that is
* prepended to message names. local and remote endpoints
* of a single channel must agree upon scope. Scope may
* not contain double colons ('::').
* cfg.debugOutput - A boolean value. If true and window.console.log is
* a function, then debug strings will be emitted to that
* function.
* cfg.debugOutput - A boolean value. If true and window.console.log is
* a function, then debug strings will be emitted to that
* function.
* cfg.postMessageObserver - A function that will be passed two arguments,
* an origin and a message. It will be passed these immediately
* before messages are posted.
* cfg.gotMessageObserver - A function that will be passed two arguments,
* an origin and a message. It will be passed these arguments
* immediately after they pass scope and origin checks, but before
* they are processed.
* cfg.onReady - A function that will be invoked when a channel becomes "ready",
* this occurs once both sides of the channel have been
* instantiated and an application level handshake is exchanged.
* the onReady function will be passed a single argument which is
* the channel object that was returned from build().
*/
return {
build: function(cfg) {
var debug = function(m) {
if (cfg.debugOutput && window.console && window.console.log) {
// try to stringify, if it doesn't work we'll let javascript's built in toString do its magic
try { if (typeof m !== 'string') m = JSON.stringify(m); } catch(e) { }
console.log("["+chanId+"] " + m);
}
};
/* browser capabilities check */
if (!window.postMessage) throw("jschannel cannot run this browser, no postMessage");
if (!window.JSON || !window.JSON.stringify || ! window.JSON.parse) {
throw("jschannel cannot run this browser, no JSON parsing/serialization");
}
/* basic argument validation */
if (typeof cfg != 'object') throw("Channel build invoked without a proper object argument");
if (!cfg.window || !cfg.window.postMessage) throw("Channel.build() called without a valid window argument");
/* we'd have to do a little more work to be able to run multiple channels that intercommunicate the same
* window... Not sure if we care to support that */
if (window === cfg.window) throw("target window is same as present window -- not allowed");
// let's require that the client specify an origin. if we just assume '*' we'll be
// propagating unsafe practices. that would be lame.
var validOrigin = false;
if (typeof cfg.origin === 'string') {
var oMatch;
if (cfg.origin === "*") validOrigin = true;
// allow valid domains under http and https. Also, trim paths off otherwise valid origins.
else if (null !== (oMatch = cfg.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))) {
cfg.origin = oMatch[0].toLowerCase();
validOrigin = true;
}
}
if (!validOrigin) throw ("Channel.build() called with an invalid origin");
if (typeof cfg.scope !== 'undefined') {
if (typeof cfg.scope !== 'string') throw 'scope, when specified, must be a string';
if (cfg.scope.split('::').length > 1) throw "scope may not contain double colons: '::'";
}
/* private variables */
// generate a random and psuedo unique id for this channel
var chanId = (function () {
var text = "";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for(var i=0; i < 5; i++) text += alpha.charAt(Math.floor(Math.random() * alpha.length));
return text;
})();
// registrations: mapping method names to call objects
var regTbl = { };
// current oustanding sent requests
var outTbl = { };
// current oustanding received requests
var inTbl = { };
// are we ready yet? when false we will block outbound messages.
var ready = false;
var pendingQueue = [ ];
var createTransaction = function(id,origin,callbacks) {
var shouldDelayReturn = false;
var completed = false;
return {
origin: origin,
invoke: function(cbName, v) {
// verify in table
if (!inTbl[id]) throw "attempting to invoke a callback of a nonexistent transaction: " + id;
// verify that the callback name is valid
var valid = false;
for (var i = 0; i < callbacks.length; i++) if (cbName === callbacks[i]) { valid = true; break; }
if (!valid) throw "request supports no such callback '" + cbName + "'";
// send callback invocation
postMessage({ id: id, callback: cbName, params: v});
},
error: function(error, message) {
completed = true;
// verify in table
if (!inTbl[id]) throw "error called for nonexistent message: " + id;
// remove transaction from table
delete inTbl[id];
// send error
postMessage({ id: id, error: error, message: message });
},
complete: function(v) {
completed = true;
// verify in table
if (!inTbl[id]) throw "complete called for nonexistent message: " + id;
// remove transaction from table
delete inTbl[id];
// send complete
postMessage({ id: id, result: v });
},
delayReturn: function(delay) {
if (typeof delay === 'boolean') {
shouldDelayReturn = (delay === true);
}
return shouldDelayReturn;
},
completed: function() {
return completed;
}
};
};
var setTransactionTimeout = function(transId, timeout, method) {
return window.setTimeout(function() {
if (outTbl[transId]) {
// XXX: what if client code raises an exception here?
var msg = "timeout (" + timeout + "ms) exceeded on method '" + method + "'";
(1,outTbl[transId].error)("timeout_error", msg);
delete outTbl[transId];
delete s_transIds[transId];
}
}, timeout);
};
var onMessage = function(origin, method, m) {
// if an observer was specified at allocation time, invoke it
if (typeof cfg.gotMessageObserver === 'function') {
// pass observer a clone of the object so that our
// manipulations are not visible (i.e. method unscoping).
// This is not particularly efficient, but then we expect
// that message observers are primarily for debugging anyway.
try {
cfg.gotMessageObserver(origin, m);
} catch (e) {
debug("gotMessageObserver() raised an exception: " + e.toString());
}
}
// now, what type of message is this?
if (m.id && method) {
// a request! do we have a registered handler for this request?
if (regTbl[method]) {
var trans = createTransaction(m.id, origin, m.callbacks ? m.callbacks : [ ]);
inTbl[m.id] = { };
try {
// callback handling. we'll magically create functions inside the parameter list for each
// callback
if (m.callbacks && s_isArray(m.callbacks) && m.callbacks.length > 0) {
for (var i = 0; i < m.callbacks.length; i++) {
var path = m.callbacks[i];
var obj = m.params;
var pathItems = path.split('/');
for (var j = 0; j < pathItems.length - 1; j++) {
var cp = pathItems[j];
if (typeof obj[cp] !== 'object') obj[cp] = { };
obj = obj[cp];
}
obj[pathItems[pathItems.length - 1]] = (function() {
var cbName = path;
return function(params) {
return trans.invoke(cbName, params);
};
})();
}
}
var resp = regTbl[method](trans, m.params);
if (!trans.delayReturn() && !trans.completed()) trans.complete(resp);
} catch(e) {
// automagic handling of exceptions:
var error = "runtime_error";
var message = null;
// * if it's a string then it gets an error code of 'runtime_error' and string is the message
if (typeof e === 'string') {
message = e;
} else if (typeof e === 'object') {
// either an array or an object
// * if it's an array of length two, then array[0] is the code, array[1] is the error message
if (e && s_isArray(e) && e.length == 2) {
error = e[0];
message = e[1];
}
// * if it's an object then we'll look form error and message parameters
else if (typeof e.error === 'string') {
error = e.error;
if (!e.message) message = "";
else if (typeof e.message === 'string') message = e.message;
else e = e.message; // let the stringify/toString message give us a reasonable verbose error string
}
}
// message is *still* null, let's try harder
if (message === null) {
try {
message = JSON.stringify(e);
/* On MSIE8, this can result in 'out of memory', which
* leaves message undefined. */
if (typeof(message) == 'undefined')
message = e.toString();
} catch (e2) {
message = e.toString();
}
}
trans.error(error,message);
}
}
} else if (m.id && m.callback) {
if (!outTbl[m.id] ||!outTbl[m.id].callbacks || !outTbl[m.id].callbacks[m.callback])
{
debug("ignoring invalid callback, id:"+m.id+ " (" + m.callback +")");
} else {
// XXX: what if client code raises an exception here?
outTbl[m.id].callbacks[m.callback](m.params);
}
} else if (m.id) {
if (!outTbl[m.id]) {
debug("ignoring invalid response: " + m.id);
} else {
// XXX: what if client code raises an exception here?
if (m.error) {
(1,outTbl[m.id].error)(m.error, m.message);
} else {
if (m.result !== undefined) (1,outTbl[m.id].success)(m.result);
else (1,outTbl[m.id].success)();
}
delete outTbl[m.id];
delete s_transIds[m.id];
}
} else if (method) {
// tis a notification.
if (regTbl[method]) {
// yep, there's a handler for that.
// transaction has only origin for notifications.
regTbl[method]({ origin: origin }, m.params);
// if the client throws, we'll just let it bubble out
// what can we do? Also, here we'll ignore return values
}
}
};
// now register our bound channel for msg routing
s_addBoundChan(cfg.window, cfg.origin, ((typeof cfg.scope === 'string') ? cfg.scope : ''), onMessage);
// scope method names based on cfg.scope specified when the Channel was instantiated
var scopeMethod = function(m) {
if (typeof cfg.scope === 'string' && cfg.scope.length) m = [cfg.scope, m].join("::");
return m;
};
// a small wrapper around postmessage whose primary function is to handle the
// case that clients start sending messages before the other end is "ready"
var postMessage = function(msg, force) {
if (!msg) throw "postMessage called with null message";
// delay posting if we're not ready yet.
var verb = (ready ? "post " : "queue ");
debug(verb + " message: " + JSON.stringify(msg));
if (!force && !ready) {
pendingQueue.push(msg);
} else {
if (typeof cfg.postMessageObserver === 'function') {
try {
cfg.postMessageObserver(cfg.origin, msg);
} catch (e) {
debug("postMessageObserver() raised an exception: " + e.toString());
}
}
cfg.window.postMessage(JSON.stringify(msg), cfg.origin);
}
};
var onReady = function(trans, type) {
debug('ready msg received');
if (ready) throw "received ready message while in ready state. help!";
if (type === 'ping') {
chanId += '-R';
} else {
chanId += '-L';
}
obj.unbind('__ready'); // now this handler isn't needed any more.
ready = true;
debug('ready msg accepted.');
if (type === 'ping') {
obj.notify({ method: '__ready', params: 'pong' });
}
// flush queue
while (pendingQueue.length) {
postMessage(pendingQueue.pop());
}
// invoke onReady observer if provided
if (typeof cfg.onReady === 'function') cfg.onReady(obj);
};
var obj = {
// tries to unbind a bound message handler. returns false if not possible
unbind: function (method) {
if (regTbl[method]) {
if (!(delete regTbl[method])) throw ("can't delete method: " + method);
return true;
}
return false;
},
bind: function (method, cb) {
if (!method || typeof method !== 'string') throw "'method' argument to bind must be string";
if (!cb || typeof cb !== 'function') throw "callback missing from bind params";
if (regTbl[method]) throw "method '"+method+"' is already bound!";
regTbl[method] = cb;
return this;
},
call: function(m) {
if (!m) throw 'missing arguments to call function';
if (!m.method || typeof m.method !== 'string') throw "'method' argument to call must be string";
if (!m.success || typeof m.success !== 'function') throw "'success' callback missing from call";
// now it's time to support the 'callback' feature of jschannel. We'll traverse the argument
// object and pick out all of the functions that were passed as arguments.
var callbacks = { };
var callbackNames = [ ];
var pruneFunctions = function (path, obj) {
if (typeof obj === 'object') {
for (var k in obj) {
if (!obj.hasOwnProperty(k)) continue;
var np = path + (path.length ? '/' : '') + k;
if (typeof obj[k] === 'function') {
callbacks[np] = obj[k];
callbackNames.push(np);
delete obj[k];
} else if (typeof obj[k] === 'object') {
pruneFunctions(np, obj[k]);
}
}
}
};
pruneFunctions("", m.params);
// build a 'request' message and send it
var msg = { id: s_curTranId, method: scopeMethod(m.method), params: m.params };
if (callbackNames.length) msg.callbacks = callbackNames;
if (m.timeout)
// XXX: This function returns a timeout ID, but we don't do anything with it.
// We might want to keep track of it so we can cancel it using clearTimeout()
// when the transaction completes.
setTransactionTimeout(s_curTranId, m.timeout, scopeMethod(m.method));
// insert into the transaction table
outTbl[s_curTranId] = { callbacks: callbacks, error: m.error, success: m.success };
s_transIds[s_curTranId] = onMessage;
// increment current id
s_curTranId++;
postMessage(msg);
},
notify: function(m) {
if (!m) throw 'missing arguments to notify function';
if (!m.method || typeof m.method !== 'string') throw "'method' argument to notify must be string";
// no need to go into any transaction table
postMessage({ method: scopeMethod(m.method), params: m.params });
},
destroy: function () {
s_removeBoundChan(cfg.window, cfg.origin, ((typeof cfg.scope === 'string') ? cfg.scope : ''));
if (window.removeEventListener) window.removeEventListener('message', onMessage, false);
else if(window.detachEvent) window.detachEvent('onmessage', onMessage);
ready = false;
regTbl = { };
inTbl = { };
outTbl = { };
cfg.origin = null;
pendingQueue = [ ];
debug("channel destroyed");
chanId = "";
}
};
obj.bind('__ready', onReady);
setTimeout(function() {
postMessage({ method: scopeMethod('__ready'), params: "ping" }, true);
}, 0);
return obj;
}
};
})();
/*
* Copyright 2013, Nexedi SA
* Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html
*/
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global jIO, localStorage, setTimeout, complex_queries, define */
/**
* JIO Local Storage. Type = 'local'.
* Local browser "database" storage.
*
* Storage Description:
*
* {
* "type": "local",
* "mode": <string>,
* // - "localStorage" // default
* // - "memory"
* "username": <non empty string>, // to define user space
* "application_name": <string> // default 'untitled'
* }
*
* Document are stored in path
* 'jio/localstorage/username/application_name/document_id' like this:
*
* {
* "_id": "document_id",
* "_attachments": {
* "attachment_name": {
* "length": data_length,
* "digest": "md5-XXX",
* "content_type": "mime/type"
* },
* "attachment_name2": {..}, ...
* },
* "metadata_name": "metadata_value"
* "metadata_name2": ...
* ...
* }
*
* Only "_id" and "_attachments" are specific metadata keys, other one can be
* added without loss.
*
* @class LocalStorage
*/
// define([module_name], [dependencies], module);
(function (dependencies, module) {
"use strict";
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
module(jIO, complex_queries);
}(['jio', 'complex_queries'], function (jIO, complex_queries) {
"use strict";
/**
* Returns 4 hexadecimal random characters.
*
* @return {String} The characters
*/
function S4() {
return ('0000' + Math.floor(
Math.random() * 0x10000 /* 65536 */
).toString(16)).slice(-4);
}
/**
* An Universal Unique ID generator
*
* @return {String} The new UUID.
*/
function generateUuid() {
return S4() + S4() + "-" +
S4() + "-" +
S4() + "-" +
S4() + "-" +
S4() + S4() + S4();
}
/**
* Checks if an object has no enumerable keys
*
* @param {Object} obj The object
* @return {Boolean} true if empty, else false
*/
function objectIsEmpty(obj) {
var k;
for (k in obj) {
if (obj.hasOwnProperty(k)) {
return false;
}
}
return true;
}
var ram = {}, memorystorage, localstorage;
/*
* Wrapper for the localStorage used to simplify instion of any kind of
* values
*/
localstorage = {
getItem: function (item) {
var value = localStorage.getItem(item);
return value === null ? null : JSON.parse(value);
},
setItem: function (item, value) {
return localStorage.setItem(item, JSON.stringify(value));
},
removeItem: function (item) {
return localStorage.removeItem(item);
}
};
/*
* Wrapper for the localStorage used to simplify instion of any kind of
* values
*/
memorystorage = {
getItem: function (item) {
var value = ram[item];
return value === undefined ? null : JSON.parse(value);
},
setItem: function (item, value) {
ram[item] = JSON.stringify(value);
},
removeItem: function (item) {
delete ram[item];
}
};
jIO.addStorageType('local', function (spec, my) {
spec = spec || {};
var that, priv;
that = my.basicStorage(spec, my);
priv = {};
// attributes
priv.username = spec.username || '';
priv.application_name = spec.application_name || 'untitled';
priv.localpath = 'jio/localstorage/' + priv.username + '/' +
priv.application_name;
switch (spec.mode) {
case "memory":
priv.database = ram;
priv.storage = memorystorage;
priv.mode = "memory";
break;
default:
priv.database = localStorage;
priv.storage = localstorage;
priv.mode = "localStorage";
break;
}
// ===================== overrides ======================
that.specToStore = function () {
return {
"application_name": priv.application_name,
"username": priv.username,
"mode": priv.mode
};
};
that.validateState = function () {
if (typeof priv.username === "string" && priv.username !== '') {
return '';
}
return 'Need at least one parameter: "username".';
};
// ==================== commands ====================
/**
* Create a document in local storage.
* @method post
* @param {object} command The JIO command
*/
that.post = function (command) {
setTimeout(function () {
var doc, doc_id = command.getDocId();
if (!doc_id) {
doc_id = generateUuid();
}
doc = priv.storage.getItem(priv.localpath + "/" + doc_id);
if (doc === null) {
// the document does not exist
doc = command.cloneDoc();
doc._id = doc_id;
delete doc._attachments;
priv.storage.setItem(priv.localpath + "/" + doc_id, doc);
that.success({
"ok": true,
"id": doc_id
});
} else {
// the document already exists
that.error({
"status": 409,
"statusText": "Conflicts",
"error": "conflicts",
"message": "Cannot create a new document",
"reason": "Document already exists"
});
}
});
};
/**
* Create or update a document in local storage.
* @method put
* @param {object} command The JIO command
*/
that.put = function (command) {
setTimeout(function () {
var doc, tmp;
doc = priv.storage.getItem(priv.localpath + "/" + command.getDocId());
if (doc === null) {
// the document does not exist
doc = command.cloneDoc();
delete doc._attachments;
} else {
// the document already exists
tmp = command.cloneDoc();
tmp._attachments = doc._attachments;
doc = tmp;
}
// write
priv.storage.setItem(priv.localpath + "/" + command.getDocId(), doc);
that.success({
"ok": true,
"id": command.getDocId()
});
});
};
/**
* Add an attachment to a document
* @method putAttachment
* @param {object} command The JIO command
*/
that.putAttachment = function (command) {
setTimeout(function () {
var doc;
doc = priv.storage.getItem(priv.localpath + "/" + command.getDocId());
if (doc === null) {
// the document does not exist
that.error({
"status": 404,
"statusText": "Not Found",
"error": "not_found",
"message": "Impossible to add attachment",
"reason": "Document not found"
});
return;
}
// the document already exists
doc._attachments = doc._attachments || {};
doc._attachments[command.getAttachmentId()] = {
"content_type": command.getAttachmentMimeType(),
"digest": "md5-" + command.md5SumAttachmentData(),
"length": command.getAttachmentLength()
};
// upload data
priv.storage.setItem(priv.localpath + "/" + command.getDocId() + "/" +
command.getAttachmentId(),
command.getAttachmentData());
// write document
priv.storage.setItem(priv.localpath + "/" + command.getDocId(), doc);
that.success({
"ok": true,
"id": command.getDocId(),
"attachment": command.getAttachmentId()
});
});
};
/**
* Get a document
* @method get
* @param {object} command The JIO command
*/
that.get = function (command) {
setTimeout(function () {
var doc = priv.storage.getItem(
priv.localpath + "/" + command.getDocId()
);
if (doc !== null) {
that.success(doc);
} else {
that.error({
"status": 404,
"statusText": "Not Found",
"error": "not_found",
"message": "Cannot find the document",
"reason": "Document does not exist"
});
}
});
};
/**
* Get a attachment
* @method getAttachment
* @param {object} command The JIO command
*/
that.getAttachment = function (command) {
setTimeout(function () {
var doc = priv.storage.getItem(
priv.localpath + "/" + command.getDocId() +
"/" + command.getAttachmentId()
);
if (doc !== null) {
that.success(doc);
} else {
that.error({
"status": 404,
"statusText": "Not Found",
"error": "not_found",
"message": "Cannot find the attachment",
"reason": "Attachment does not exist"
});
}
});
};
/**
* Remove a document
* @method remove
* @param {object} command The JIO command
*/
that.remove = function (command) {
setTimeout(function () {
var doc, i, attachment_list;
doc = priv.storage.getItem(priv.localpath + "/" + command.getDocId());
attachment_list = [];
if (doc !== null && typeof doc === "object") {
if (typeof doc._attachments === "object") {
// prepare list of attachments
for (i in doc._attachments) {
if (doc._attachments.hasOwnProperty(i)) {
attachment_list.push(i);
}
}
}
} else {
return that.error({
"status": 404,
"statusText": "Not Found",
"error": "not_found",
"message": "Document not found",
"reason": "missing"
});
}
priv.storage.removeItem(priv.localpath + "/" + command.getDocId());
// delete all attachments
for (i = 0; i < attachment_list.length; i += 1) {
priv.storage.removeItem(priv.localpath + "/" + command.getDocId() +
"/" + attachment_list[i]);
}
that.success({
"ok": true,
"id": command.getDocId()
});
});
};
/**
* Remove an attachment
* @method removeAttachment
* @param {object} command The JIO command
*/
that.removeAttachment = function (command) {
setTimeout(function () {
var doc, error, i, attachment_list;
error = function (word) {
that.error({
"status": 404,
"statusText": "Not Found",
"error": "not_found",
"message": word + " not found",
"reason": "missing"
});
};
doc = priv.storage.getItem(priv.localpath + "/" + command.getDocId());
// remove attachment from document
if (doc !== null && typeof doc === "object" &&
typeof doc._attachments === "object") {
if (typeof doc._attachments[command.getAttachmentId()] ===
"object") {
delete doc._attachments[command.getAttachmentId()];
if (objectIsEmpty(doc._attachments)) {
delete doc._attachments;
}
priv.storage.setItem(priv.localpath + "/" + command.getDocId(),
doc);
priv.storage.removeItem(priv.localpath + "/" + command.getDocId() +
"/" + command.getAttachmentId());
that.success({
"ok": true,
"id": command.getDocId(),
"attachment": command.getAttachmentId()
});
} else {
error("Attachment");
}
} else {
error("Document");
}
});
};
/**
* Get all filenames belonging to a user from the document index
* @method allDocs
* @param {object} command The JIO command
*/
that.allDocs = function (command) {
var i, row, path_re, rows, document_list, option, document_object;
rows = [];
document_list = [];
path_re = new RegExp(
"^" + complex_queries.stringEscapeRegexpCharacters(priv.localpath) +
"/[^/]+$"
);
option = command.cloneOption();
if (typeof complex_queries !== "object" ||
(option.query === undefined && option.sort_on === undefined &&
option.select_list === undefined &&
option.include_docs === undefined)) {
rows = [];
for (i in priv.database) {
if (priv.database.hasOwnProperty(i)) {
// filter non-documents
if (path_re.test(i)) {
row = { value: {} };
row.id = i.split('/').slice(-1)[0];
row.key = row.id;
if (command.getOption('include_docs')) {
row.doc = JSON.parse(priv.storage.getItem(i));
}
rows.push(row);
}
}
}
that.success({"rows": rows, "total_rows": rows.length});
} else {
// create complex query object from returned results
for (i in priv.database) {
if (priv.database.hasOwnProperty(i)) {
if (path_re.test(i)) {
document_list.push(priv.storage.getItem(i));
}
}
}
option.select_list = option.select_list || [];
option.select_list.push("_id");
if (option.include_docs === true) {
document_object = {};
document_list.forEach(function (meta) {
document_object[meta._id] = meta;
});
}
complex_queries.QueryFactory.create(option.query || "").
exec(document_list, option);
document_list = document_list.map(function (value) {
var o = {
"id": value._id,
"key": value._id
};
if (option.include_docs === true) {
o.doc = document_object[value._id];
delete document_object[value._id];
}
delete value._id;
o.value = value;
return o;
});
that.success({"total_rows": document_list.length,
"rows": document_list});
}
};
return that;
});
}));
(function (dependencies, module) {
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
if (typeof exports === 'object') {
return module(exports);
}
module(window);
}(['exports'], function (exports) {
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
function b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
function hex_hmac_md5(k, d)
{ return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_md5(k, d)
{ return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_md5(k, d, e)
{ return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
}
/*
* Calculate the MD5 of a raw string
*/
function rstr_md5(s)
{
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstr_hmac_md5(key, data)
{
var bkey = rstr2binl(key);
if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input)
{
try { hexcase } catch(e) { hexcase=0; }
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for(var i = 0; i < input.length; i++)
{
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F)
+ hex_tab.charAt( x & 0x0F);
}
return output;
}
/*
* Convert a raw string to a base-64 string
*/
function rstr2b64(input)
{
try { b64pad } catch(e) { b64pad=''; }
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for(var i = 0; i < len; i += 3)
{
var triplet = (input.charCodeAt(i) << 16)
| (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
| (i + 2 < len ? input.charCodeAt(i+2) : 0);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > input.length * 8) output += b64pad;
else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
}
}
return output;
}
/*
* Convert a raw string to an arbitrary string encoding
*/
function rstr2any(input, encoding)
{
var divisor = encoding.length;
var i, j, q, x, quotient;
/* Convert to an array of 16-bit big-endian values, forming the dividend */
var dividend = Array(Math.ceil(input.length / 2));
for(i = 0; i < dividend.length; i++)
{
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
}
/*
* Repeatedly perform a long division. The binary array forms the dividend,
* the length of the encoding is the divisor. Once computed, the quotient
* forms the dividend for the next step. All remainders are stored for later
* use.
*/
var full_length = Math.ceil(input.length * 8 /
(Math.log(encoding.length) / Math.log(2)));
var remainders = Array(full_length);
for(j = 0; j < full_length; j++)
{
quotient = Array();
x = 0;
for(i = 0; i < dividend.length; i++)
{
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if(quotient.length > 0 || q > 0)
quotient[quotient.length] = q;
}
remainders[j] = x;
dividend = quotient;
}
/* Convert the remainders to the output string */
var output = "";
for(i = remainders.length - 1; i >= 0; i--)
output += encoding.charAt(remainders[i]);
return output;
}
/*
* Encode a string as utf-8.
* For efficiency, this assumes the input is valid utf-16.
*/
function str2rstr_utf8(input)
{
var output = "";
var i = -1;
var x, y;
while(++i < input.length)
{
/* Decode utf-16 surrogate pairs */
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
{
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++;
}
/* Encode output as utf-8 */
if(x <= 0x7F)
output += String.fromCharCode(x);
else if(x <= 0x7FF)
output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
0x80 | ( x & 0x3F));
else if(x <= 0xFFFF)
output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
else if(x <= 0x1FFFFF)
output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
0x80 | ((x >>> 12) & 0x3F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
}
return output;
}
/*
* Encode a string as utf-16
*/
function str2rstr_utf16le(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
(input.charCodeAt(i) >>> 8) & 0xFF);
return output;
}
function str2rstr_utf16be(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
input.charCodeAt(i) & 0xFF);
return output;
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl(input)
{
var output = Array(input.length >> 2);
for(var i = 0; i < output.length; i++)
output[i] = 0;
for(var i = 0; i < input.length * 8; i += 8)
output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
return output;
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr(input)
{
var output = "";
for(var i = 0; i < input.length * 32; i += 8)
output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
return output;
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binl_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
exports.hex_md5 = hex_md5;
exports.b64_md5 = b64_md5;
exports.any_md5 = any_md5;
exports.hex_hmac_md5 = hex_hmac_md5;
exports.b64_hmac_md5 = b64_hmac_md5;
exports.any_hmac_md5 = any_hmac_md5;
}));
/*! RenderJs v0.2 */
/*global jQuery, window, document, DOMParser, Channel */
"use strict";
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
(function (DOMParser) {
var DOMParser_proto = DOMParser.prototype,
real_parseFromString = DOMParser_proto.parseFromString;
// Firefox/Opera/IE throw errors on unsupported types
try {
// WebKit returns null on unsupported types
if ((new DOMParser()).parseFromString("", "text/html")) {
// text/html parsing is natively supported
return;
}
} catch (ex) {}
DOMParser_proto.parseFromString = function (markup, type) {
var result, doc, doc_elt, first_elt;
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
doc = document.implementation.createHTMLDocument("");
doc_elt = doc.documentElement;
doc_elt.innerHTML = markup;
first_elt = doc_elt.firstElementChild;
if (doc_elt.childElementCount === 1
&& first_elt.localName.toLowerCase() === "html") {
doc.replaceChild(first_elt, doc_elt);
}
result = doc;
} else {
result = real_parseFromString.apply(this, arguments);
}
return result;
};
}(DOMParser));
/*
* renderJs - Generic Gadget library renderer.
* http://www.renderjs.org/documentation
*/
(function (document, window, $, DOMParser, Channel, undefined) {
var gadget_model_dict = {},
javascript_registration_dict = {},
stylesheet_registration_dict = {},
gadget_loading_klass,
methods,
loading_gadget_promise,
renderJS;
function RenderJSGadget() {}
RenderJSGadget.prototype.title = "";
RenderJSGadget.prototype.interface_list = [];
RenderJSGadget.prototype.path = "";
RenderJSGadget.prototype.html = "";
RenderJSGadget.prototype.required_css_list = [];
RenderJSGadget.prototype.required_js_list = [];
RenderJSGadget.ready_list = [];
RenderJSGadget.ready = function (callback) {
this.ready_list.push(callback);
return this;
};
RenderJSGadget.declareMethod = function (name, callback) {
// // Register the potentially loading javascript
// var script_element = $('script').last(),
// src = script_element.attr('src');
// if (src !== undefined) {
// if (javascript_registration_dict[src] === undefined) {
// // First time loading the JS file.
// // Remember all declareMethod calls
// javascript_registration_dict[src] = {
// loaded: false,
// method_list: [[name, callback]],
// };
// script_element.load(function () {
// javascript_registration_dict[src].loaded = true;
// });
// } else if (!javascript_registration_dict[src].loaded) {
// javascript_registration_dict[src].method_list.push([name, callback]);
// }
// }
this.prototype[name] = function () {
var dfr = $.Deferred(),
gadget = this;
$.when(callback.apply(this, arguments))
.done(function () {
dfr.resolveWith(gadget, arguments);
})
.fail(function () {
dfr.rejectWith(gadget, arguments);
});
return dfr.promise();
};
// Allow chain
return this;
};
RenderJSGadget
.declareMethod('getInterfaceList', function () {
// Returns the list of gadget prototype
return this.interface_list;
})
.declareMethod('getRequiredCSSList', function () {
// Returns a list of CSS required by the gadget
return this.required_css_list;
})
.declareMethod('getRequiredJSList', function () {
// Returns a list of JS required by the gadget
return this.required_js_list;
})
.declareMethod('getPath', function () {
// Returns the path of the code of a gadget
return this.path;
})
.declareMethod('getTitle', function () {
// Returns the title of a gadget
return this.title;
})
.declareMethod('getHTML', function () {
// Returns the HTML of a gadget
return this.html;
});
// Class inheritance
function RenderJSEmbeddedGadget() {
var root_gadget = this,
declare_method_count = 0,
gadget_ready = false,
// Create the communication channel
embedded_channel = Channel.build({
window: window.parent,
origin: "*",
scope: "renderJS"
});
RenderJSGadget.call(this);
// Bind calls to renderJS method on the instance
embedded_channel.bind("methodCall", function (trans, v) {
root_gadget[v[0]].apply(root_gadget, v[1]).done(function (g) {
trans.complete(g);
}).fail(function () {
trans.error(Array.prototype.slice.call(arguments, 0));
});
trans.delayReturn(true);
});
// Notify parent about gadget instanciation
function notifyReady() {
if ((declare_method_count === 0) && (gadget_ready === true)) {
embedded_channel.notify({method: "ready"});
}
}
// Inform parent gadget about declareMethod calls here.
function notifyDeclareMethod(name) {
declare_method_count += 1;
embedded_channel.call({
method: "declareMethod",
params: name,
success: function () {
declare_method_count -= 1;
notifyReady();
},
error: function () {
declare_method_count -= 1;
// console.error(Array.prototype.slice.call(arguments, 0));
},
});
}
notifyDeclareMethod("getInterfaceList");
notifyDeclareMethod("getRequiredCSSList");
notifyDeclareMethod("getRequiredJSList");
notifyDeclareMethod("getPath");
notifyDeclareMethod("getTitle");
notifyDeclareMethod("getHTML");
// Surcharge declareMethod to inform parent window
this.constructor.declareMethod = function (name, callback) {
notifyDeclareMethod(name);
return RenderJSGadget.declareMethod.apply(this, [name, callback]);
};
// Inform parent window that gadget is correctly loaded
loading_gadget_promise.done(function () {
gadget_ready = true;
notifyReady();
}).fail(function () {
embedded_channel.notify({method: "failed"});
});
return root_gadget;
}
RenderJSEmbeddedGadget.ready_list = [];
RenderJSEmbeddedGadget.ready =
RenderJSGadget.ready;
RenderJSEmbeddedGadget.prototype = new RenderJSGadget();
RenderJSEmbeddedGadget.prototype.constructor = RenderJSEmbeddedGadget;
// Class inheritance
function RenderJSIframeGadget() {
RenderJSGadget.call(this);
}
RenderJSIframeGadget.ready_list = [];
RenderJSIframeGadget.declareMethod =
RenderJSGadget.declareMethod;
RenderJSIframeGadget.ready =
RenderJSGadget.ready;
RenderJSIframeGadget.prototype = new RenderJSGadget();
RenderJSIframeGadget.prototype.constructor = RenderJSIframeGadget;
RenderJSGadget.prototype.declareIframedGadget =
function (url, jquery_context) {
var previous_loading_gadget_promise = loading_gadget_promise,
next_loading_gadget_deferred = $.Deferred();
// Change the global variable to update the loading queue
loading_gadget_promise = next_loading_gadget_deferred.promise();
// Wait for previous gadget loading to finish first
previous_loading_gadget_promise.always(function () {
// Instanciate iframe
var gadget = new RenderJSIframeGadget();
gadget.context = jquery_context;
// XXX Do not set this info on the instance!
gadget.path = url;
// XXX onload onerror
// $('iframe').load(function() {
// RunAfterIFrameLoaded();
// });
// Create the iframe
if (gadget.context !== undefined) {
$(gadget.context).html(
// Use encodeURI to prevent XSS
'<iframe src="' + encodeURI(url) + '"></iframe>'
);
gadget.chan = Channel.build({
window: gadget.context.find('iframe').first()[0].contentWindow,
origin: "*",
scope: "renderJS"
});
// gadget.getTitle = function () {
// var dfr = $.Deferred();
// gadget.chan.call({
// method: "getTitle",
// success: function (v) {
// dfr.resolve(v);
// }
// });
// return dfr.promise();
// };
gadget.chan.bind("declareMethod", function (trans, method_name) {
gadget[method_name] = function () {
var dfr = $.Deferred();
gadget.chan.call({
method: "methodCall",
params: [
method_name,
Array.prototype.slice.call(arguments, 0)],
success: function () {
dfr.resolveWith(gadget, arguments);
},
error: function () {
dfr.rejectWith(gadget, arguments);
}
// XXX Error callback
});
return dfr.promise();
};
return "OK";
});
// Wait for the iframe to be loaded before continuing
gadget.chan.bind("ready", function (trans) {
next_loading_gadget_deferred.resolve(gadget);
return "OK";
});
gadget.chan.bind("failed", function (trans) {
next_loading_gadget_deferred.reject();
return "OK";
});
} else {
next_loading_gadget_deferred.reject();
}
});
loading_gadget_promise
// Drop the current loading klass info used by selector
.done(function () {
gadget_loading_klass = undefined;
})
.fail(function () {
gadget_loading_klass = undefined;
})
.done(function (created_gadget) {
$.each(created_gadget.constructor.ready_list,
function (i, callback) {
callback.apply(created_gadget);
});
});
return loading_gadget_promise;
};
RenderJSGadget.prototype.declareGadget = function (url, jquery_context) {
var previous_loading_gadget_promise = loading_gadget_promise,
next_loading_gadget_deferred = $.Deferred();
// Change the global variable to update the loading queue
loading_gadget_promise = next_loading_gadget_deferred.promise();
// Wait for previous gadget loading to finish first
previous_loading_gadget_promise.always(function () {
// Get the gadget class and instanciate it
renderJS.declareGadgetKlass(url).done(function (Klass) {
var gadget = new Klass();
gadget.context = jquery_context;
// Load dependencies if needed
$.when(gadget.getRequiredJSList(), gadget.getRequiredCSSList())
.done(function (js_list, css_list) {
var result_list = [],
first_deferred = $.Deferred(),
first_promise = first_deferred.promise();
gadget_loading_klass = Klass;
// Load JS and follow the dependency declaration defined in the
// head
function next(next_js_list) {
var next_js = next_js_list.shift();
if (next_js === undefined) {
first_deferred.resolve();
} else {
renderJS.declareJS(next_js)
.done(function () {
next(next_js_list);
})
.fail(function () {
first_deferred.reject.apply(
first_deferred,
arguments
);
});
}
}
next(js_list);
result_list.push(first_promise);
// Load CSS
$.each(css_list, function (i, required_url) {
result_list.push(renderJS.declareCSS(required_url));
});
$.when.apply(this, result_list)
.done(function () {
// Dependency correctly loaded. Fire instanciation success.
next_loading_gadget_deferred.resolve(gadget);
}).fail(function () {
// console.error(Array.prototype.slice.call(arguments, 0));
// One error during css/js loading
next_loading_gadget_deferred.reject.apply(
next_loading_gadget_deferred,
arguments
);
});
}).fail(function () {
// Failed to fetch dependencies information.
next_loading_gadget_deferred.reject.apply(
next_loading_gadget_deferred,
arguments
);
});
}).fail(function () {
// Klass not correctly loaded. Reject instanciation
next_loading_gadget_deferred.reject.apply(next_loading_gadget_deferred,
arguments);
});
});
loading_gadget_promise
// Drop the current loading klass info used by selector
.done(function () {
gadget_loading_klass = undefined;
})
.fail(function () {
gadget_loading_klass = undefined;
})
.done(function (created_gadget) {
// Set the content html and call the ready list if instance is
// correctly loaded
if (created_gadget.context !== undefined) {
$(created_gadget.context).html(
created_gadget.constructor.prototype.html
);
}
$.each(created_gadget.constructor.ready_list, function (i, callback) {
callback.apply(created_gadget);
});
});
return loading_gadget_promise;
};
methods = {
loadGadgetFromDom: function () {
$(this).find('[data-gadget-path]').each(function (index, value) {
$(this).renderJS('declareGadget', $(this).attr('data-gadget-path'), {
scope: $(this).attr('data-gadget-scope'),
})
.done(function (value) {
var parsed_xml;
// Check that context is still attached to the DOM
// XXX Usefull?
if ($(this).closest(document.body).length) {
parsed_xml = $($.parseXML(value));
// Inject the css
// XXX Manage relative URL
$.each(parsed_xml.find('link[rel=stylesheet]'),
function (i, link) {
$('head').append(
'<link rel="stylesheet" href="' +
$(link).attr('href') +
'" type="text/css" />'
);
});
// Inject the js
// XXX Manage relative URL
$.each(parsed_xml.find('script[type="text/javascript"]'),
function (i, script) {
// $('head').append(
// '<script type="text/javascript" href="' +
// $(script).attr('src') +
// '" />'
// );
// Prevent infinite recursion if loading render.js
// more than once
if ($('head').find('script[src="' + $(script).attr('src')
+ '"]').length === 0) {
var headID = document.getElementsByTagName("head")[0],
newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = $(script).attr('src');
headID.appendChild(newScript);
}
});
// Inject the html
// XXX parseXML does not support <div /> (without 2 tags)
$(this).html(parsed_xml.find('body').clone());
// XXX No idea why it is required to make it work
// Probably because of parseXML
$(this).html($(this).html())
.renderJS('loadGadgetFromDom');
}
});
});
},
};
// // Define a local copy of renderJS
// renderJS = function (selector) {
// // The renderJS object is actually just the init constructor 'enhanced'
// return new renderJS.fn.init(selector, rootrenderJS);
// };
// renderJS.fn = renderJS.prototype = {
// constructor: renderJS,
// init: function (selector, rootrenderJS) {
// var result;
// // HANDLE: $(""), $(null), $(undefined), $(false)
// if (!selector) {
// console.log("no selector");
// result = this;
// // // HANDLE: $(DOMElement)
// // } else if (selector.nodeType) {
// // this.context = this[0] = selector;
// // this.length = 1;
// // result = this;
// // } else if (selector === this) {
// // result = this.constructor();
// } else {
// // throw new Error("Not implemented selector " + selector);
// result = this.constructor();
// }
// return result;
// },
// };
// // Give the init function the renderJS prototype for later instantiation
// renderJS.fn.init.prototype = renderJS.fn;
//
// jQuery.fn.extend({
// attr: function (name, value) {
// return jQuery.access(this, jQuery.attr, name, value,
// arguments.length > 1);
// },
// });
renderJS = function (selector) {
var result;
// if (selector.nodeType) {
// console.log(selector);
// } else {
if (selector === window) {
// window is the this value when loading a javascript file
// In this case, use the current loading gadget constructor
result = gadget_loading_klass;
// } else if ($.isFunction(selector)) {
// console.log(selector);
} else if (selector instanceof RenderJSGadget) {
result = selector;
}
if (result === undefined) {
throw new Error("Unknown selector '" + selector + "'");
}
return result;
};
renderJS.declareJS = function (url) {
// // Prevent infinite recursion if loading render.js
// // more than once
// if ($('head').find('script[src="' + $(script).attr('src')
// + '"]').length === 0) {
// var headID = document.getElementsByTagName("head")[0],
// newScript = document.createElement('script');
// newScript.type = 'text/javascript';
// newScript.src = $(script).attr('src');
// headID.appendChild(newScript);
// }
var dfr,
origin_dfr = $.Deferred(),
head_element,
script_element;
if (javascript_registration_dict.hasOwnProperty(url)) {
setTimeout(function () {
origin_dfr.resolve();
});
dfr = origin_dfr.promise();
} else {
dfr = $.ajax({
url: url,
dataType: "script",
cache: true,
}).done(function (script, textStatus) {
javascript_registration_dict[url] = null;
// }).fail(function () {
// console.error(Array.prototype.slice.call(arguments, 0));
});
}
return dfr;
};
renderJS.declareCSS = function (url) {
// https://github.com/furf/jquery-getCSS/blob/master/jquery.getCSS.js
// No way to cleanly check if a css has been loaded
// So, always resolve the promise...
// http://requirejs.org/docs/faq-advanced.html#css
var origin_dfr = $.Deferred(),
origin_promise = origin_dfr.promise(),
head,
link;
if (stylesheet_registration_dict.hasOwnProperty(url)) {
setTimeout(function () {
origin_dfr.resolve();
});
} else {
head = document.getElementsByTagName('head')[0];
link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = url;
origin_promise.done(function () {
stylesheet_registration_dict[url] = null;
});
head.appendChild(link);
setTimeout(function () {
origin_dfr.resolve();
});
}
return origin_promise;
};
renderJS.declareGadgetKlass = function (url) {
var dfr = $.Deferred(),
parsed_html;
if (gadget_model_dict.hasOwnProperty(url)) {
dfr.resolve(gadget_model_dict[url]);
} else {
$.ajax(url)
.done(function (value, textStatus, jqXHR) {
var klass, tmp_constructor, key;
if (/^text\/html[;]?/.test(
jqXHR.getResponseHeader("Content-Type") || ""
)) {
try {
if (!gadget_model_dict.hasOwnProperty(url)) {
// Class inheritance
tmp_constructor = function () {
RenderJSGadget.call(this);
};
tmp_constructor.ready_list = [];
tmp_constructor.declareMethod =
RenderJSGadget.declareMethod;
tmp_constructor.ready =
RenderJSGadget.ready;
tmp_constructor.prototype = new RenderJSGadget();
tmp_constructor.prototype.constructor = tmp_constructor;
tmp_constructor.prototype.path = url;
parsed_html = renderJS.parseGadgetHTML(value);
for (key in parsed_html) {
if (parsed_html.hasOwnProperty(key)) {
tmp_constructor.prototype[key] = parsed_html[key];
}
}
gadget_model_dict[url] = tmp_constructor;
}
dfr.resolve(gadget_model_dict[url]);
} catch (e) {
dfr.reject(jqXHR, "HTML Parsing failed");
}
} else {
dfr.reject(jqXHR, "Unexpected content type");
}
})
.fail(function () {
dfr.reject.apply(dfr, arguments);
});
}
return dfr.promise();
};
// For test purpose only
renderJS.clearGadgetKlassList = function () {
gadget_model_dict = {};
javascript_registration_dict = {};
stylesheet_registration_dict = {};
};
renderJS.parseGadgetHTML = function (html) {
var parsed_xml,
result,
settings = {
title: "",
interface_list: [],
html: "",
required_css_list: [],
required_js_list: [],
};
if (html.constructor === String) {
// https://developer.mozilla.org/en-US/docs/HTML_in_XMLHttpRequest
// https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
// https://developer.mozilla.org/en-US/docs/Code_snippets/HTML_to_DOM
// parsed_xml = $($.parseXML(html));
// parsed_xml = $('<div/>').html(html);
parsed_xml = $((new DOMParser()).parseFromString(html, "text/html"));
settings.title = parsed_xml.find('head > title').first().text();
// XXX Manage relative URL during extraction of URLs
$.each(parsed_xml.find('head > link[rel=stylesheet]'),
function (i, link) {
settings.required_css_list.push($(link).attr('href'));
});
$.each(parsed_xml.find('head > script[type="text/javascript"]'),
function (i, script) {
settings.required_js_list.push($(script).attr('src'));
});
$.each(parsed_xml.find(
'head > link[rel="http://www.renderjs.org/rel/interface"]'
), function (i, link) {
settings.interface_list.push($(link).attr('href'));
});
settings.html = parsed_xml.find('html > body').first().html();
if (settings.html === undefined) {
settings.html = "";
}
result = settings;
} else {
throw new Error(html + " is not a string");
}
return result;
};
window.rJS = window.renderJS = renderJS;
window.RenderJSGadget = RenderJSGadget;
///////////////////////////////////////////////////
// Bootstrap process. Register the self gadget.
///////////////////////////////////////////////////
function bootstrap() {
var url = window.location.href,
tmp_constructor,
root_gadget,
loading_gadget_deferred = $.Deferred();
// Create the gadget class for the current url
if (gadget_model_dict.hasOwnProperty(url)) {
throw new Error("bootstrap should not be called twice");
}
loading_gadget_promise = loading_gadget_deferred.promise();
if (window.self === window.top) {
// XXX Copy/Paste from declareGadgetKlass
tmp_constructor = function () {
RenderJSGadget.call(this);
};
tmp_constructor.declareMethod = RenderJSGadget.declareMethod;
tmp_constructor.ready_list = [];
tmp_constructor.ready = RenderJSGadget.ready;
tmp_constructor.prototype = new RenderJSGadget();
tmp_constructor.prototype.constructor = tmp_constructor;
tmp_constructor.prototype.path = url;
gadget_model_dict[url] = tmp_constructor;
// Create the root gadget instance and put it in the loading stack
root_gadget = new gadget_model_dict[url]();
} else {
// Create the root gadget instance and put it in the loading stack
tmp_constructor = RenderJSEmbeddedGadget;
root_gadget = new RenderJSEmbeddedGadget();
}
gadget_loading_klass = tmp_constructor;
$(document).ready(function () {
// XXX HTML properties can only be set when the DOM is fully loaded
var settings = renderJS.parseGadgetHTML($('html')[0].outerHTML),
promise,
key;
for (key in settings) {
if (settings.hasOwnProperty(key)) {
tmp_constructor.prototype[key] = settings[key];
}
}
root_gadget.context = $('body');
promise = $.when(root_gadget.getRequiredJSList(),
root_gadget.getRequiredCSSList())
.done(function (js_list, css_list) {
$.each(js_list, function (i, required_url) {
javascript_registration_dict[required_url] = null;
});
$.each(css_list, function (i, required_url) {
stylesheet_registration_dict[url] = null;
});
$.each(tmp_constructor.ready_list, function (i, callback) {
callback.apply(root_gadget);
});
gadget_loading_klass = undefined;
loading_gadget_deferred.resolve();
}).fail(function () {
loading_gadget_deferred.reject.apply(loading_gadget_deferred,
arguments);
});
});
}
bootstrap();
}(document, window, jQuery, DOMParser, Channel));
/*global jQuery */
/*!
* route.js v1.0.0
*
* Copyright 2012, Romain Courteaud
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Date: Mon Jul 16 2012
*/
"use strict";
(function ($) {
$.extend({
StatelessDeferred: function () {
var doneList = $.Callbacks("memory"),
promise = {
done: doneList.add,
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function (obj) {
var i,
keys = ['done', 'promise'];
if (obj === undefined) {
obj = promise;
} else {
for (i = 0; i < keys.length; i += 1) {
obj[keys[i]] = promise[keys[i]];
}
}
return obj;
}
},
deferred = promise.promise({});
deferred.resolveWith = doneList.fireWith;
// All done!
return deferred;
}
});
var routes = [],
current_priority = 0,
methods = {
add: function (pattern, priority) {
var i = 0,
inserted = false,
length = routes.length,
dfr = $.StatelessDeferred(),
context = $(this),
escapepattern,
matchingpattern;
if (priority === undefined) {
priority = 0;
}
if (pattern !== undefined) {
// http://simonwillison.net/2006/Jan/20/escape/
escapepattern = pattern.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,
"\\$&");
matchingpattern = escapepattern
.replace(/<int:\w+>/g, "(\\d+)")
.replace(/<path:\w+>/g, "(.+)")
.replace(/<\w+>/g, "([^/]+)");
while (!inserted) {
if ((i === length) || (priority >= routes[i][2])) {
routes.splice(i, 0, [new RegExp('^' + matchingpattern + '$'),
dfr, priority, context]);
inserted = true;
} else {
i += 1;
}
}
}
return dfr.promise();
},
go: function (path, min_priority) {
var dfr = $.Deferred(),
context = $(this),
result;
if (min_priority === undefined) {
min_priority = 0;
}
setTimeout(function () {
var i = 0,
found = false,
slice_index = -1,
slice_priority = -1;
for (i = 0; i < routes.length; i += 1) {
if (slice_priority !== routes[i][2]) {
slice_priority = routes[i][2];
slice_index = i;
}
if (routes[i][2] < min_priority) {
break;
} else if (routes[i][0].test(path)) {
result = routes[i][0].exec(path);
dfr = routes[i][1];
context = routes[i][3];
current_priority = routes[i][2];
found = true;
break;
}
}
if (i === routes.length) {
slice_index = i;
}
if (slice_index > -1) {
routes = routes.slice(slice_index);
}
if (found) {
dfr.resolveWith(
context,
result.slice(1)
);
} else {
dfr.rejectWith(context);
}
});
return dfr.promise();
},
};
$.routereset = function () {
routes = [];
current_priority = 0;
};
$.routepriority = function () {
return current_priority;
};
$.fn.route = function (method) {
var result;
if (methods.hasOwnProperty(method)) {
result = methods[method].apply(
this,
Array.prototype.slice.call(arguments, 1)
);
} else {
$.error('Method ' + method +
' does not exist on jQuery.route');
}
return result;
};
}(jQuery));
/*global window, jQuery */
/*!
* url.js v1.0.0
*
* Copyright 2012, Romain Courteaud
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Date: Mon Jul 16 2012
*/
"use strict";
(function (window, $) {
var hashchangeinitialized = false,
previousurl,
currentcallback,
getRawHash = function () {
return window.location.toString().split('#')[1];
},
callbackwrapper = function () {
if (previousurl !== window.location.hash) {
previousurl = window.location.hash;
if (currentcallback !== undefined) {
currentcallback();
}
}
},
timeoutwrapper = function () {
callbackwrapper();
window.setTimeout(timeoutwrapper, 500);
};
function UrlHandler() {}
UrlHandler.prototype = {
'generateUrl': function (path, options) {
var pathhash,
hash = '#',
key;
if (path !== undefined) {
hash += encodeURIComponent(path);
}
hash = hash.replace(/%2F/g, '/');
pathhash = hash;
for (key in options) {
if (options.hasOwnProperty(key)) {
if (hash === pathhash) {
hash = hash + '?';
} else {
hash = hash + '&';
}
hash += encodeURIComponent(key) +
'=' + encodeURIComponent(options[key]);
}
}
return hash;
},
'go': function (path, options) {
window.location.hash = this.generateUrl(path, options);
},
'redirect': function (path, options) {
var host = window.location.protocol + '//' +
window.location.host +
window.location.pathname +
window.location.search;
window.location.replace(host + this.generateUrl(path, options));
// window.location.replace(window.location.href.replace(/#.*/, ""));
},
'getPath': function () {
var hash = getRawHash(),
result = '';
if (hash !== undefined) {
result = decodeURIComponent(hash.split('?')[0]);
}
return result;
},
'getOptions': function () {
var options = {},
hash = getRawHash(),
subhashes,
subhash,
index,
keyvalue;
if (hash !== undefined) {
hash = hash.split('?')[1];
if (hash !== undefined) {
subhashes = hash.split('&');
for (index in subhashes) {
if (subhashes.hasOwnProperty(index)) {
subhash = subhashes[index];
if (subhash !== '') {
keyvalue = subhash.split('=');
if (keyvalue.length === 2) {
options[decodeURIComponent(keyvalue[0])] =
decodeURIComponent(keyvalue[1]);
}
}
}
}
}
}
return options;
},
'onhashchange': function (callback) {
previousurl = undefined;
currentcallback = callback;
if (!hashchangeinitialized) {
if (window.onhashchange !== undefined) {
$(window).bind('hashchange', callbackwrapper);
window.setTimeout(callbackwrapper);
} else {
timeoutwrapper();
}
hashchangeinitialized = true;
}
},
};
// Expose to the global object
$.url = new UrlHandler();
}(window, jQuery));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment