Initial commit

This commit is contained in:
Michael Becker 2024-06-04 14:36:13 -04:00
parent 54fc731b43
commit a26261a295
131 changed files with 10457 additions and 0 deletions

3
.gitignore vendored
View File

@ -12,3 +12,6 @@
# Built Visual Studio Code Extensions # Built Visual Studio Code Extensions
*.vsix *.vsix
# Output of ./build.sh
output/

46
build.sh Executable file
View File

@ -0,0 +1,46 @@
if [ ! -d output ]; then
mkdir output
fi
echo " *** Building Themes *** "
if [ -d src/uwt-web/common ]; then
pushd src/uwt-web/common
# first compile common CSS
# since lessc doesn't support multiple files, we have to cat =(^.^)= them first :(
cat *.less > ../common.less
lessc --verbose --plugin=less-plugin-clean-css ../common.less ../../../output/common.css
rm ../common.less
popd
fi
if [ -d src/uwt-web/themes ]; then
if [ ! -d output/themes ]; then
mkdir output/themes
fi
# for each dir in themes dir, compile its own .css file
for theme in $(ls src/uwt-web/themes); do
cat src/uwt-web/themes/$theme/*.less > src/uwt-web/themes/$theme.less
lessc --verbose --plugin=less-plugin-clean-css src/uwt-web/themes/$theme.less output/themes/$theme.css
rm src/uwt-web/themes/$theme.less
done
fi
echo " *** Building Scripts *** "
if [ -d src/uwt-web/scripts ]; then
cat src/uwt-web/scripts/*.js src/uwt-web/scripts/controls/*.js > src/uwt-web/scripts.js
jsmin src/uwt-web/scripts.js > output/uwt.min.js
rm src/uwt-web/scripts.js
fi
echo " *** Build Completed ***"

View File

@ -0,0 +1,22 @@
@font-face
{
font-family:"Font Awesome 6 Pro";font-style:normal;font-weight:300;font-display:block;src:url(../webfonts/fa-light-300.woff2) format("woff2"),url(../webfonts/fa-light-300.ttf) format("truetype")}.fa-light,.fal{font-weight:300}:host,:root{--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Pro"}@font-face{font-family:"Font Awesome 6 Pro";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}.fa-regular,.far{font-weight:400}:host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Pro"}@font-face{font-family:"Font Awesome 6 Pro";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-weight:900}:host,:root{--fa-style-family-classic:"Font Awesome 6 Pro";--fa-font-thin:normal 100 1em/1 "Font Awesome 6 Pro"}@font-face{font-family:"Font Awesome 6 Pro";font-style:normal;font-weight:100;font-display:block;src:url(../webfonts/fa-thin-100.woff2) format("woff2"),url(../webfonts/fa-thin-100.ttf) format("truetype")}.fa-thin,.fat{font-weight:100}@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Pro";font-display:block;font-weight:900;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Pro";font-display:block;font-weight:400;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Pro";font-display:block;font-weight:300;src:url(../webfonts/fa-light-300.woff2) format("woff2"),url(../webfonts/fa-light-300.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Duotone";font-display:block;font-weight:900;src:url(../webfonts/fa-duotone-900.woff2) format("woff2"),url(../webfonts/fa-duotone-900.ttf) format("truetype")
}
@font-face
{
font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")
}
@font-face
{
font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")
}
@font-face
{
font-family:"FontAwesome";
font-display: block;
src: url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype");
}
@font-face
{
font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-v4compatibility.woff2) format("woff2"),url(../webfonts/fa-v4compatibility.ttf) format("truetype");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,50 @@
@media (max-width: 1000px)
{
div.uwt-actionpreviewbutton
{
&> a.apb-button
{
opacity: 1;
visibility: visible;
}
div.apb-preview
{
position: fixed !important;
left: 0px !important;
top: 0px !important;
right: 0px !important;
bottom: 0px !important;
display: flex;
justify-content: start;
flex-direction: column-reverse;
margin: 0px;
width: 100%;
&> div.apb-actions
{
&> ul.uwt-menu
{
width: 100%;
&> li.uwt-menu-item-command
{
&> ul.uwt-menu
{
margin-top: 32px; // 16px;
left: 0px;
right: 0px;
position: relative;
width: 100%;
}
}
}
}
&> div.apb-actions, &> div.apb-preview-content
{
}
}
}
}

View File

@ -0,0 +1,23 @@
@media (max-width: 1000px)
{
div.uwt-alert
{
&.uwt-collapsible
{
&:not(.uwt-collapsed)
{
position: fixed;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
width: inherit;
z-index: 10;
}
}
&> div.uwt-content
{
max-height: inherit;
}
}
}

View File

@ -0,0 +1,13 @@
@media screen and (max-width: 1000px)
{
div.uwt-formview
{
&> div.uwt-formview-item
{
&> div.uwt-formview-item-label, &> div.uwt-formview-item-content
{
display: block;
}
}
}
}

View File

@ -0,0 +1,13 @@
@media (max-width: 1000px)
{
ul.uwt-menu > li
{
padding: 24px 20px;
&> a
{
padding: 24px 20px;
margin: -24px -20px;
}
}
}

View File

@ -0,0 +1,10 @@
@media (max-width: 1000px)
{
div.uwt-window
{
left: 0px !important;
top: 0px !important;
right: 0px !important;
bottom: 0px !important;
}
}

View File

@ -0,0 +1,5 @@
@import "uwt-actionpreviewbutton.less";
@import "uwt-alert.less";
@import "uwt-formview.less";
@import "uwt-menu.less";
@import "uwt-window.less";

View File

@ -0,0 +1,10 @@
@media print
{
div.uwt-actionpreviewbutton
{
&> a.apb-button
{
display: none;
}
}
}

View File

@ -0,0 +1,10 @@
@media print
{
.uwt-listview-caption, .uwt-listview > caption
{
&> .uwt-listview-controlbox
{
display: none;
}
}
}

View File

@ -0,0 +1,21 @@
@import "uwt-actionpreviewbutton.less";
@import "uwt-listview.less";
@media print
{
body.uwt-header-visible > div.uwt-header + *
{
margin-top: 0px;
}
body > div.uwt-page-header, body > form > div.uwt-page-header
{
padding: 0px;
position: static;
&+ div.uwt-page-content
{
padding: 0px;
padding-top: 16px;
}
}
}

View File

@ -0,0 +1,219 @@
@ActionPreviewButton_ActionMenu_Width: 200px;
div.uwt-actionpreviewbutton
{
display: inline-block;
position: relative;
// white-space: nowrap; // this actually looks better this way
img.apb-icon
{
width: 1.2em;
margin-right: 8px;
}
img.apb-icon, a.apb-text, a.apb-button
{
vertical-align: middle;
}
&> a.apb-button
{
opacity: 0;
visibility: hidden;
display: inline-block;
padding: 0px 2px 0px 6px;
border-radius: 4px;
margin-left: 8px;
padding-right: 6px;
&::before
{
content: "...";
font-family: inherit;
font-weight: bold;
display: block;
margin-top: -3px;
height: 0px;
}
}
&:hover, &:focus-within
{
&> a.apb-button
{
&:hover
{
text-decoration: none;
}
}
}
&.apb-selected > div.apb-preview
{
visibility: visible;
opacity: 1;
}
&> a.apb-text.apb-empty
{
color: inherit;
cursor: inherit;
&:hover
{
text-decoration: inherit;
}
}
&> div.apb-preview
{
display: flex;
visibility: hidden;
opacity: 0;
float: right;
padding: 8px;
margin-left: 8px;
position: absolute;
transition: all 0.3s;
width: max-content;
&> a.uwt-button.uwt-button-close
{
display: none;
position: absolute;
right: 8px;
top: 8px;
width: 8px;
height: 8px;
padding: 8px;
min-width: unset;
min-height: unset;
&::after
{
content: "\f00d";
font-family: "FontAwesome";
position: absolute;
top: 2px;
left: 6px;
}
}
&.uwt-detached
{
&> a.uwt-button.uwt-button-close
{
display: inline-block;
}
visibility: visible;
opacity: 1;
position: fixed;
}
&> div.uwt-gripper
{
position: absolute;
top: 0px;
width: 64px;
height: 16px;
left: 50%;
}
&.uwt-loading > div.apb-content, &.uwt-loading > div.apb-preview-content, &.uwt-loading > div.apb-actions
{
display: none;
}
&:not(.uwt-loading) > div.uwt-spinner
{
display: none;
}
&> div.apb-actions
{
&.uwt-empty
{
display: none;
}
margin: -8px;
margin-right: 16px;
&> h2
{
cursor: default;
}
&> ul.uwt-menu
{
width: @ActionPreviewButton_ActionMenu_Width;
&> li.uwt-menu-item-command
{
position: relative;
&> ul.uwt-menu
{
display: none;
position: absolute;
//margin-left: 20px;
left: @ActionPreviewButton_ActionMenu_Width;
top: 0px;
width: max-content;
z-index: 1;
}
&:hover > ul.uwt-menu
{
display: block;
}
}
}
/*
&> div.apb-preview
{
visibility: hidden;
opacity: 0;
float: right;
padding: 8px;
margin-left: 8px;
position: absolute;
}
*/
}
&> div.apb-preview-content
{
//!FIXME: determine what the best max-width is based on the location of the popup and the user's screen size
max-width: 600px;
&.uwt-empty
{
display: none;
}
&> div.apb-header
{
&> h2
{
&> span.apb-class-title
{
padding-right: 16px;
}
}
}
}
}
}
body:not(.uwt-javascript-disabled) div.uwt-actionpreviewbutton
{
&.apb-selected > a.apb-button
{
visibility: visible;
opacity: 1;
}
&:hover, &:focus-within
{
&> a.apb-button
{
opacity: 1;
visibility: visible;
&:hover
{
text-decoration: none;
}
}
}
}

View File

@ -0,0 +1,87 @@
body > div.uwt-alert-container
{
position: fixed;
right: 32px;
top: 32px;
min-width: 320px;
z-index: 100;
}
div.uwt-alert
{
&.uwt-popup
{
margin-left: auto;
margin-bottom: 8px;
position: relative;
transition: all 0.5s, scale 0.3s;
right: 0px;
width: 600px;
}
&.uwt-collapsible
{
scale: 0.8;
&:not(.uwt-collapsed), &:hover
{
scale: 1.0;
}
&> div.uwt-icon
{
cursor: pointer;
}
&> div.uwt-title
{
padding: 16px;
}
}
&:not(.uwt-collapsed)
{
&> div.uwt-icon
{
float: left;
}
&> div.uwt-badge
{
display: none;
}
}
&.uwt-collapsed
{
&> div.uwt-badge
{
color: #000;
position: absolute;
margin-left: 8px;
padding: 8px;
font-size: 14pt;
right: 8px;
bottom: 8px;
}
width: 64px;
&> div.uwt-content, &> div.uwt-title
{
display: none;
}
}
&> div.uwt-title
{
font-weight: bold;
padding-bottom: 16px;
}
&> div.uwt-content
{
max-height: 200px;
overflow: clip;
overflow-y: scroll;
}
&.uwt-disabled
{
&> div.uwt-badge
{
display: none;
}
}
}

View File

@ -0,0 +1,32 @@
div.uwt-applicationmenu
{
&> div.uwt-button
{
border: none;
padding: 0px;
min-width: auto;
&> button.uwt-button-dropdownbutton
{
border: none;
background: none;
padding: 13px 20px;
display: inline-block;
font-size: 18pt;
color: #fff;
&::before
{
content: "\f0c9";
font-family: FontAwesome;
}
}
&> div.uwt-popup
{
/* for some reason there's a weird gap between the button and the dropdown */
/* margin-top: -4px; */
margin-top: -10px;
}
}
}

View File

@ -0,0 +1,14 @@
div.uwt-badge
{
cursor: default;
-moz-user-select: none;
border-radius: 8px;
display: inline-block;
margin: -8px;
padding: 8px;
padding-left: 24px;
padding-right: 24px;
}

View File

@ -0,0 +1,91 @@
div.uwt-binaryswitch
{
&> div.uwt-binaryswitch-switches
{
background: #ffffff;
display: flex;
flex-direction: row;
justify-content: center;
&> div.uwt-switch
{
border: solid 1px #aaaaaa;
cursor: pointer;
user-select: none;
margin: 16px 8px 8px 8px;
&> label.uwt-switch-label
{
font-size: 8pt;
position: absolute;
top: -16px;
text-align: center;
display: block;
width: 100%;
box-sizing: border-box;
}
height: 48px;
position: relative;
width: 16px;
&> div.uwt-switch-indicator
{
padding: 8px;
background: #cccccc;
height: 4px;
position: absolute;
top: 28px;
width: 0px;
transition: all 0.3s;
}
&.uwt-selected
{
background-color: #fff7cc;
&> div.uwt-switch-indicator
{
top: 0px;
}
}
}
}
&> input.uwt-binaryswitch-input, &> label.uwt-binaryswitch-label
{
width: 100%;
box-sizing: border-box;
border: none;
text-align: center;
}
&> label.uwt-binaryswitch-label
{
display: none;
cursor: text;
padding: 8px;
user-select: revert;
}
&[disabled]
{
&> div.uwt-binaryswitch-switches
{
background-color: var(--uwt-color-gray-300);
&> div.uwt-switch
{
background-color: var(--uwt-color-gray-500);
cursor: default;
pointer-events: none;
&> div.uwt-switch-indicator
{
background: #ffffff;
}
}
}
&> input.uwt-binaryswitch-input
{
display: none;
}
&> label.uwt-binaryswitch-label
{
display: block;
}
}
}

View File

@ -0,0 +1,42 @@
div.uwt-button-group
{
&> div.uwt-button
{
cursor: default;
&> a
{
display: block;
padding: 16px;
&> span
{
display: block;
&.uwt-title
{
padding-bottom: 8px;
}
}
}
}
&.uwt-orientation-horizontal
{
&> div.uwt-button
{
display: inline-block;
margin-right: 16px;
}
}
&.uwt-orientation-vertical
{
display: flex;
flex-direction: column;
&> a.uwt-button, input[type=submit], input[type=reset], input[type=button], button, div.uwt-button > a,
{
text-align: left;
margin-bottom: 8px;
}
}
}

View File

@ -0,0 +1,77 @@
// @ButtonSelector: 'a.uwt-button, button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a';
// (~'@{ButtonSelector}')
.uwt-button /* , button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a */
{
display: inline-block;
font-weight: 400;
text-align: center;
vertical-align: middle;
.user-select(none);
background-color: transparent;
border: 1px solid transparent;
padding: .438rem 1.125rem;
font-size: .894rem;
line-height: 1.54;
min-width: 80px;
&+ .uwt-button
{
margin-right: 6px;
}
}
div.uwt-button-group
{
//(~'@{ButtonSelector}')
.uwt-button /*, button, input[type=button], input[type=submit], input[type=reset], div.uwt-button > a */
{
margin-right: 0px;
}
}
div.uwt-button
{
display: inline-block;
&> button.uwt-button-dropdownbutton
{
display: none;
}
&.uwt-button-hasdropdown
{
&> button.uwt-button-dropdownbutton
{
padding-left: 8px;
padding-right: 8px;
display: inline-block;
&::before
{
content: "⏷";
display: block;
}
}
&.uwt-button-requiredropdown > input:nth-child(1), &.uwt-button-requiredropdown > a:nth-child(1)
{
display: none;
}
&:not(.uwt-button-requiredropdown)
{
/* split dropdown button styles */
&> input:first-child
{
border-right: none;
}
&> input.uwt-button-dropdownbutton
{
border-left: none;
}
}
}
}

View File

@ -0,0 +1,27 @@
div.uwt-calendar
{
&> table
{
&> thead
{
}
&> tbody
{
&> tr
{
&> td
{
&> a
{
display: inline-block;
text-align: center;
line-height: 2rem;
width: 2rem;
height: 2rem;
}
}
}
}
}
}

View File

@ -0,0 +1,37 @@
div.uwt-checkbox
{
transition: all 0.3s;
&> i.fa-check
{
margin-left: 4px;
transition: all 0.3s;
opacity: 0;
}
&.uwt-checked, &.uwt-indeterminate
{
&> i.fa-check
{
opacity: 1;
}
}
&.uwt-indeterminate > i.fa-check::before
{
content: "\f0c8";
}
border: solid 1px #24abf2;
display: inline-block;
width: 22px;
height: 22px;
border-radius: 4px;
color: #ffffff;
&:focus-within
{
box-shadow: 0px 0px 4px #24abf2;
}
&.uwt-checked, &.uwt-indeterminate
{
background-color: #24abf2;
color: #ffffff;
}
}

View File

@ -0,0 +1,72 @@
div.uwt-columns
{
display: flex;
box-sizing: border-box;
margin-bottom: 20px;
min-height: 1px;
position: relative;
width: 100%;
}
div.uwt-columns > div.uwt-column-row
{
box-sizing: border-box;
}
div.uwt-columns > div.uwt-column-row
{
display: flex;
}
div.uwt-columns > div.uwt-column-section
{
display: flex;
flex-grow: 1;
&> div.uwt-column
{
flex-grow: 1;
}
}
@media (max-width: 1000px)
{
div.uwt-columns
{
flex-direction: column;
}
}
@media (min-width: 768px)
{
div.uwt-columns > div.uwt-column-row > div.uwt-column.uwt-column-4
{
width: 50%;
}
}
@media (min-width: 992px)
{
div.uwt-columns > div.uwt-column-row > div.uwt-column.uwt-column-4
{
flex: 0 1 25%;
max-width: 25%;
}
}
.uwt-column.uwt-column-1
{
flex: 0 1 100%;
max-width: 100%;
}
.uwt-column.uwt-column-2
{
flex: 0 1 50%;
max-width: 50%;
}
.uwt-column.uwt-column-3
{
flex: 0 1 33.333333%;
max-width: 33.333333%;
}
.uwt-column.uwt-column-8
{
flex: 0 1 66.666667%;
max-width: 66.666667%;
}

View File

@ -0,0 +1,90 @@
div.uwt-dialog-background
{
position: fixed;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.8);
transition: all 0.3s;
&:not(.uwt-visible)
{
opacity: 0;
visibility: hidden;
}
z-index: 10000;
}
div.uwt-dialog
{
max-width: 35rem;
margin: 1.75rem auto;
z-index: 10001;
position: relative;
top: 0px;
transition: all 0.3s;
&:not(.uwt-visible)
{
opacity: 0;
visibility: hidden;
}
&> div.uwt-header
{
padding: 1.25rem 1.5625rem;
&> div.uwt-dialog-title, &> div.uwt-dialog-controlbox
{
}
&> div.uwt-dialog-title
{
font-size: 1rem;
}
&> div.uwt-dialog-controlbox
{
position: absolute;
right: 24px;
top: 15px;
&> a.uwt-dialog-controlbox-close
{
font-size: 1.341rem;
font-weight: 300;
}
}
}
&> div.uwt-content
{
padding: 1.5625rem;
}
&> div.uwt-footer
{
display: flex;
justify-content: flex-end;
padding: 1.25rem 1.5625rem;
&> :not(:first-child)
{
margin-left: .25rem;
}
&> :not(:last-child)
{
margin-right: .25rem;
}
}
}
@media (max-width: 600px)
{
div.uwt-dialog
{
position: fixed;
top: 0px;
right: 0px;
left: 0px;
bottom: 0px;
margin: 0px;
max-width: none;
}
}

View File

@ -0,0 +1,31 @@
div.uwt-disclosure
{
&> div.uwt-title
{
&::after
{
content: "\f078";
font-family: "Font Awesome 6 Pro";
font-weight: 100;
float: right;
}
}
&.uwt-expanded > div.uwt-title::after
{
content: "\f077";
}
&:not(.uwt-expanded) > div.uwt-content
{
display: none;
}
}
div.uwt-alert > div.uwt-content > div.uwt-disclosure
{
border-bottom: 1px dotted;
&> div.uwt-title:hover
{
background: rgba(255,255,255, 0.3);
cursor: pointer;
}
}

View File

@ -0,0 +1,5 @@
.uwt-expand
{
box-sizing: border-box;
width: 100%;
}

View File

@ -0,0 +1,18 @@
body > div.uwt-footer, body > form > div.uwt-footer
{
padding: 16px;
z-index: 100;
}
@media (max-width: 999px)
{
/* TABLET styles */
body > div.uwt-footer, body > form > div.uwt-footer
{
left: 0px;
/*
background-color: #111111;
padding: 16px;
*/
}
}

View File

@ -0,0 +1,124 @@
table.uwt-formview
{
border-collapse: collapse;
// &:not(.uwt-expand)
// {
// display: inline-block;
// }
&> tr > td, &> thead > tr > td, &> tbody > tr > td
{
//padding: 8px;
padding-left: 0px;
vertical-align: top;
&:first-child
{
&> label
{
font-weight: bold;
padding-right: 24px;
}
}
}
&.uwt-formview-stacked
{
&> tr, &> td, &> thead > tr, &> thead > tr > td, &> tbody > tr, &> tbody > tr > td
{
display: block;
}
}
input
{
width: 100%;
box-sizing: border-box;
}
tr.uwt-required > td:first-child
{
position: relative;
&::before
{
content: "*";
color: #f00;
font-size: 18pt;
position: absolute;
right: 4px;
}
}
}
/* V2 FormView - now more FLEXible! */
div.uwt-formview
{
// display: grid;
display: table;
/*
display: flex;
flex-direction: column;
*/
&> div.uwt-formview-item
{
/*
display: flex;
align-items: center;
align-content: center;
*/
display: table-row;
&> div.uwt-formview-item-label, &> div.uwt-formview-item-content
{
padding-top: 8px;
padding-bottom: 8px;
display: table-cell;
vertical-align: top;
}
&> div.uwt-formview-item-label
{
padding-top: 8pt;
padding-right: 32px;
&> label
{
font-weight: bold;
}
&> div.uwt-formview-item-description
{
color: #aaaaaa;
}
}
&.uwt-hide-label
{
display: block;
&> div.uwt-formview-item-label
{
display: none;
}
&> div.uwt-formview-item-content
{
display: block;
}
}
}
}
@media (max-width: 800px)
{
div.uwt-formview
{
&> div.uwt-formview-item
{
/*
flex-direction: column;
flex-grow: 1;
*/
display: block;
&> div.uwt-formview-item-label
{
display: block;
}
}
}
}

View File

@ -0,0 +1,4 @@
div.uwt-gripper
{
cursor: move;
}

View File

@ -0,0 +1,33 @@
body, body > form
{
&> div.uwt-header
{
position: fixed;
left: 0px;
top: 0px;
height: 60px;
right: 0px;
z-index: 100;
&> div.uwt-header-item
{
display: inline-block;
}
ul.uwt-menu
{
padding-bottom: 32px;
height: 300px;
overflow-y: auto;
}
}
}
@media print
{
body, body > form
{
&> div.uwt-header
{
display: none;
}
}
}

View File

@ -0,0 +1,5 @@
div.uwt-image
{
background-repeat: no-repeat;
background-size: 100% 100%;
}

View File

@ -0,0 +1,5 @@
label, span.uwt-label
{
cursor: default;
-moz-user-select: none;
}

View File

@ -0,0 +1,36 @@
div.uwt-layout.uwt-layout-box
{
display: flex;
&.uwt-orientation-horizontal
{
flex-direction: row;
}
&.uwt-orientation-vertical
{
flex-direction: column;
}
&> div.uwt-layout-item
{
flex-grow: 1;
}
justify-content: center;
&.uwt-pack-start
{
justify-content: flex-start;
}
&.uwt-pack-end
{
justify-content: flex-end;
}
&.uwt-homogenous
{
justify-content: space-evenly;
}
&.uwt-layout-box-expand
{
}
}

View File

@ -0,0 +1,21 @@
div.uwt-listbox
{
&> div.uwt-listitem
{
cursor: pointer;
&> div.uwt-title, &> div.uwt-detail
{
padding: 8px;
}
&> div.uwt-title
{
padding-bottom: 0px;
font-size: 1.2em;
}
&> div.uwt-detail
{
color: #aaaaaa;
}
}
}

View File

@ -0,0 +1,209 @@
div.uwt-listview-caption
{
display: flex;
flex-direction: row;
align-items: center;
}
table.uwt-listview
{
border-collapse: collapse;
width: 100%;
&> tr, &> thead > tr
{
&> th
{
&> a.uwt-listview-row-add, &> a.uwt-listview-row-remove
{
&::before
{
font-size: 28px;
font-weight: 600;
}
color: var(--uwt-color-gray);
&:hover
{
color: var(--uwt-color-black);
text-decoration: none;
}
}
}
}
&> tr, &> tbody > tr
{
&> td
{
&> a.uwt-listview-row-add, &> a.uwt-listview-row-remove
{
&::before
{
font-size: 28px;
font-weight: 300;
}
color: var(--uwt-color-gray);
&:hover
{
color: var(--uwt-color-black);
text-decoration: none;
}
}
&> input
{
width: 100%;
box-sizing: border-box;
}
&> div.uwt-checkbox
{
display: block;
margin-left: auto;
margin-right: auto;
}
}
}
}
.uwt-listview-caption, .uwt-listview > caption
{
text-align: left;
padding-top: 8px;
&> span.uwt-listview-title
{
font-weight: bold;
&:not(:empty)
{
padding-right: 8px;
}
}
&> span.uwt-listview-item-count, &> span.uwt-listview-item-count-label
{
color: var(--uwt-color-secondary);
}
&> .uwt-listview-controlbox
{
float: right;
margin-left: auto;
padding-right: 8px;
}
}
.uwt-listview
{
&> .uwt-content
{
border-collapse: collapse;
margin-top: 10px;
&> .uwt-listview-items
{
&> .uwt-listview-item
{
&> .uwt-listview-item-column
{
word-wrap: break-word;
}
}
}
}
&.uwt-expand
{
box-sizing: border-box;
width: 100%;
}
tr
{
&> th, &> td
{
padding: 10px;
}
&> th:not([colspan])
{
text-align: left;
}
}
&> thead
{
&> tr > th
{
vertical-align: bottom;
&> a
{
display: block;
/* remove the padding from the surrounding td */
margin: -10px;
/* and apply it back for this block-level a element */
padding: 10px;
}
}
}
&> tbody
{
&> tr
{
&> td
{
vertical-align: top;
}
&.uwt-selected
{
&> td
{
background-color: #08c;
color: #fff;
}
&:hover > td
{
background-color: #0075b0;
}
}
}
}
&> tr > th, &> thead > tr > th, &> tr > td, &> tbody > tr > td
{
&.uwt-listview-row-buttons
{
text-align: center;
width: 96px;
}
&> a.uwt-listview-row-add
{
&::before
{
content: "\f055";
}
}
&> a.uwt-listview-row-remove
{
&::before
{
content: "\f056";
}
}
&> a.uwt-listview-row-add, &> a.uwt-listview-row-remove
{
display: inline-block;
font-family: "Font Awesome 6 Pro";
padding: 4px;
margin: 0px;
}
}
}
ul.uwt-listview
{
&> li
{
padding: 8px;
}
}
div.uwt-listview.uwt-view-thumbnails
{
&> div.uwt-listview-item
{
display: inline-block;
padding: 8px;
text-align: center;
}
}

View File

@ -0,0 +1,32 @@
div.uwt-menu-large
{
&> div.uwt-menu-section
{
display: inline-block;
vertical-align: top;
padding: 16px;
&> div.uwt-title
{
color: #aaaaaa;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 12px;
padding-bottom: 24px;
}
&> div.uwt-content
{
&> ul.uwt-menu
{
&> li
{
&> a
{
cursor: pointer;
display: block;
padding: .438rem 1.25rem;
}
}
}
}
}
}

View File

@ -0,0 +1,112 @@
ul.uwt-menu
{
list-style-type: none;
padding-left: 0px;
margin: 0px;
user-select: none;
&> li
{
padding: .438rem 1.25rem;
position: relative;
&:not(.uwt-visible)
{
display: none;
}
&> a
{
color: var(--uwt-control-text);
display: block;
font-size: initial;
padding: .438rem 1.25rem;
margin: -.438rem -1.25rem;
text-align: initial;
text-decoration: none;
&> span
{
/* not required, but if used, block-level elements */
display: block;
&.uwt-title
{
//font-weight: bold;
}
}
}
&.uwt-menu-item-command
{
&:hover, &.uwt-highlight
{
background-color: rgba(0, 0, 0, 0.03); // var(--uwt-dropdown-menu-highlight-background);
color: var(--uwt-dropdown-menu-highlight-foreground);
&> a
{
background-color: inherit;
color: inherit;
}
}
}
&.uwt-separator
{
border-bottom: solid 1px #eee;
margin-left: 8px;
margin-right: 8px;
margin-top: 4px;
margin-bottom: 4px;
}
&> ul.uwt-menu
{
position: absolute;
top: 0px;
}
&:hover > ul.uwt-menu
{
visibility: visible;
opacity: 1;
}
}
&.uwt-multiselect
{
&> li:not(.uwt-section)
{
&> a
{
padding: 10px;
padding-left: 40px;
&::before
{
content: " ";
color: #fff;
font-family: "Font Awesome 6 Pro";
font-weight: bold;
border: 1px solid var(--uwt-color-gray);
width: 16px;
height: 16px;
border-radius: 4px;
display: inline-block;
position: absolute;
left: 8px;
top: 8px;
padding: 4px;
}
}
&.uwt-selected
{
&> a
{
&::before
{
background-color: var(--uwt-color-accent);
border-color: var(--uwt-color-accent);
content: "\f00c";
}
}
}
}
}
}
div.uwt-popup.uwt-contextmenu
{
position: fixed;
}

View File

@ -0,0 +1,11 @@
div.uwt-meter
{
&> div.uwt-meter-wrapper
{
&> canvas.uwt-meter-canvas
{
width: 48px;
height: 48px;
}
}
}

View File

@ -0,0 +1,6 @@
div.uwt-page-footer
{
display: flex;
flex-direction: row;
justify-content: end;
}

View File

@ -0,0 +1,49 @@
body
{
&> div.uwt-page-header, &> form > div.uwt-page-header
{
display: flex;
flex-direction: column;
position: fixed;
left: 0px;
right: 0px;
z-index: 5;
&> div.uwt-title
{
flex: auto;
}
&> input.uwt-searchbox
{
width: 20%;
margin: 6px;
}
&+ div.uwt-page-content
{
padding-top: 230px;
}
}
&> div.uwt-page-content, &> form > div.uwt-page-content
{
padding-bottom: 64px;
}
&> div.uwt-page-footer, &> form > div.uwt-page-footer
{
position: fixed;
left: 0px;
right: 0px;
bottom: 0px;
}
}
body:not(.uwt-header-visible)
{
&> div.uwt-page-header, &> form > div.uwt-page-header
{
display: none;
}
}

View File

@ -0,0 +1,150 @@
body
{
margin: 0px;
&.uwt-header-visible
{
&> div.uwt-header + *
{
margin-top: 64px;
}
}
}
@media (min-width: 1000px)
{
body
{
&:not(.uwt-hide-sidebar)
{
&> div.uwt-page, &> form > div.uwt-page
{
margin-left: 260px;
}
}
}
}
body
{
&:not(.uwt-hide-header)
{
&> div.uwt-page, &> form > div.uwt-page
{
/* margin-top: 60px; */
}
}
&.uwt-hide-sidebar
{
margin-left: 0px;
&> div.uwt-sidebar, &> form > div.uwt-sidebar
{
display: none;
}
}
}
body, body > form
{
&> div.uwt-page
{
margin-right: 0px;
margin-bottom: 0px;
&> div.uwt-header, &> div.uwt-footer
{
padding: 32px;
}
&> div.uwt-header
{
position: relative;
&> div.uwt-title
{
font-size: 18pt;
font-weight: 300;
margin: 0px;
}
&> div.uwt-subtitle
{
font-size: 12pt;
font-weight: 300;
margin-top: 16px;
color: rgba(0,0,0,0.6);
}
&> div.uwt-controlbox
{
position: absolute;
top: 48px;
right: 32px;
&> ul
{
list-style-type: none;
margin: 0px;
padding: 0px;
&> li
{
&> a > i
{
font-size: 18pt;
}
display: inline-block;
&+ li
{
margin-left: 16px;
}
}
}
}
}
&> div.uwt-content
{
padding: 40px;
}
}
&> div.uwt-footer
{
position: fixed;
left: 260px; /* get this from uwt-sidebar.less */
bottom: 0px;
right: 0px;
border-top: 1px solid #d2d3d6;
background-color: #edeef0;
padding: 16px;
}
}
body:not(.uwt-loading) div#uwt-page-loading
{
display: none;
}
@media (max-width: 999px)
{
body
{
&> div.uwt-page, &> form > div.uwt-page
{
margin-left: 0px;
}
&> form > div.uwt-sidebar, body > div.uwt-sidebar
{
display: none;
}
}
}
@media print
{
body, body > form
{
&> div.uwt-page
{
margin-left: 0px;
}
margin: 0px;
&> div.uwt-footer
{
left: 0px;
}
}
}
div.uwt-page-content
{
padding: 16px;
}

View File

@ -0,0 +1,35 @@
div.uwt-panel
{
background-color: #FFFFFF;
border: solid 1px #aeaeae;
box-shadow: 0px 0px 24px #aeaeae;
&> div.uwt-header
{
font-size: 18pt;
font-weight: 300;
padding: 24px;
}
&> div.uwt-content
{
padding: 24px;
}
&> div.uwt-footer
{
background-color: #eeeeee;
border-top: solid 1px #cccccc;
padding: 24px;
text-align: right;
}
&.uwt-loading > div.uwt-content::after
{
position: absolute;
content: "";
background-image: url('data:image/gif;base64,R0lGODlhIAAgAPMAAP///wAAAMbGxoSEhLa2tpqamjY2NlZWVtjY2OTk5Ly8vB4eHgQEBAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ/V/nmOM82XiHRLYKhKP1oZmADdEAAAh+QQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY/CZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB+A4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6+Ho7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq+B6QDtuetcaBPnW6+O7wDHpIiK9SaVK5GgV543tzjgGcghAgAh+QQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK++G+w48edZPK+M6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE+G+cD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm+FNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk+aV+oJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0/VNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc+XiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30/iI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE/jiuL04RGEBgwWhShRgQExHBAAh+QQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR+ipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq+E71SRQeyqUToLA7VxF0JDyIQh/MVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY+Yip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd+MFCN6HAAIKgNggY0KtEBAAh+QQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1+vsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d+jYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg+ygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0+bm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h+Kr0SJ8MFihpNbx+4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX+BP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA==');
display: block;
width: 32px;
height: 32px;
margin-left: auto;
margin-right: auto;
position: relative;
}
}

View File

@ -0,0 +1,33 @@
.uwt-popup
{
opacity: 0;
visibility: hidden;
position: fixed;
z-index: 150;
font-size: initial;
font-weight: initial;
&.uwt-visible
{
opacity: 1;
visibility: visible;
}
min-width: 10rem;
/* padding: .3125rem 0; */
margin: .125rem 0 0;
box-shadow: 0 1px 6px rgba(0,0,0,0.09);
transition: opacity .3s, visibility .3s;
&> div.uwt-spinner
{
margin-left: auto;
margin-right: auto;
margin-top: 48px;
margin-bottom: 48px;
}
}

View File

@ -0,0 +1,31 @@
div.uwt-progressbar
{
background-color: rgba(24,28,33,0.03);
border-radius: 10rem;
margin-top: .25rem !important;
margin-bottom: 1.5rem !important;
height: 4px;
overflow: hidden;
position: relative;
}
div.uwt-progressbar > div.uwt-progressbar-value
{
transition: width 0.6s ease;
width: 0%;
}
@keyframes progress-marquee
{
from { left: -25%; }
to { left: 125%; }
}
div.uwt-progressbar.uwt-progressbar-marquee > div.uwt-progressbar-value
{
position: absolute;
width: 25% !important;
animation: progress-marquee;
animation-duration: 1s;
animation-timing-function: ease-in;
animation-iteration-count: infinite;
}

View File

@ -0,0 +1,113 @@
div.uwt-ribbon-listview
{
border: solid 1px #cccccc;
background-color: #ffffff;
display: flex;
&> div.uwt-scrollbar
{
display: flex;
flex-direction: column;
&> a
{
display: block;
width: 10px;
text-decoration: none;
border: solid 1px transparent;
margin: -1px;
padding: 1px;
flex-grow: 1;
&:hover
{
border-color: #eeeeee;
background-color: #eeeeee;
}
&.uwt-scrollbar-button
{
cursor: default;
&::before
{
content: " ";
display: block;
margin-top: 10px;
margin-left: 3px;
position: absolute;
width: 5px;
height: 3px;
}
&.uwt-disabled
{
cursor: default;
&::before
{
opacity: 0.3;
}
}
}
&.uwt-scrollbar-button-up
{
&::before
{
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAYAAABbNsX4AAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+2SlUqgnYQcchQdbEgWsRRq1CECqFWaNXB5NI/aNKQpLg4Cq4FB38Wqw4uzro6uAqC4A+Im5uToouU+F1SaBHjHcc9vPe9L3ffAf56malmxwSgapaRSsSFTHZVCL6iG/00xxCTmKnPiWISnuPrHj6+30V5lnfdn6NXyZkM8AnEs0w3LOIN4ulNS+e8TxxmRUkhPiceN+iCxI9cl11+41xw2M8zw0Y6NU8cJhYKbSy3MSsaKnGMOKKoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5rGAksYgkiBMioooQyLERp10gxkaLzuId/yPGL5JLJVQIjxwIqUCE5fvA/+N1bMz816SaF4kDni21/jADBXaBRs+3vY9tunACBZ+BKa/krdWDmk/RaS4scAX3bwMV1S5P3gMsdYPBJlwzJkQK0/Pk88H5G35QFBm6BnjW3b81znD4AaepV8gY4OARGC5S97vHurva+/VvT7N8PwFhyxlX78fMAAAAGYktHRAD/AAAA/x4lk34AAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQflCRIUExeEThINAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAB1JREFUCNdjYICCurq6/zA2I7pAU1MTIyOyAAwAACpFCPXLR2gjAAAAAElFTkSuQmCC');
}
}
&.uwt-scrollbar-button-down
{
&::before
{
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAYAAABbNsX4AAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+2SlUqgnYQcchQdbEgWsRRq1CECqFWaNXB5NI/aNKQpLg4Cq4FB38Wqw4uzro6uAqC4A+Im5uToouU+F1SaBHjHcc9vPe9L3ffAf56malmxwSgapaRSsSFTHZVCL6iG/00xxCTmKnPiWISnuPrHj6+30V5lnfdn6NXyZkM8AnEs0w3LOIN4ulNS+e8TxxmRUkhPiceN+iCxI9cl11+41xw2M8zw0Y6NU8cJhYKbSy3MSsaKnGMOKKoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5rGAksYgkiBMioooQyLERp10gxkaLzuId/yPGL5JLJVQIjxwIqUCE5fvA/+N1bMz816SaF4kDni21/jADBXaBRs+3vY9tunACBZ+BKa/krdWDmk/RaS4scAX3bwMV1S5P3gMsdYPBJlwzJkQK0/Pk88H5G35QFBm6BnjW3b81znD4AaepV8gY4OARGC5S97vHurva+/VvT7N8PwFhyxlX78fMAAAAGYktHRAD/AAAA/x4lk34AAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQflCRIUExAaKoeuAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAB5JREFUCNdjrKur+8+ABhgZGBgYkCWampoY4bLIEgAqbwj1ABBIfwAAAABJRU5ErkJggg==');
}
}
&.uwt-scrollbar-button-expand
{
&::before
{
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAGCAYAAAAPDoR2AAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+2SlUqgnYQcchQdbEgWsRRq1CECqFWaNXB5NI/aNKQpLg4Cq4FB38Wqw4uzro6uAqC4A+Im5uToouU+F1SaBHjHcc9vPe9L3ffAf56malmxwSgapaRSsSFTHZVCL6iG/00xxCTmKnPiWISnuPrHj6+30V5lnfdn6NXyZkM8AnEs0w3LOIN4ulNS+e8TxxmRUkhPiceN+iCxI9cl11+41xw2M8zw0Y6NU8cJhYKbSy3MSsaKnGMOKKoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5rGAksYgkiBMioooQyLERp10gxkaLzuId/yPGL5JLJVQIjxwIqUCE5fvA/+N1bMz816SaF4kDni21/jADBXaBRs+3vY9tunACBZ+BKa/krdWDmk/RaS4scAX3bwMV1S5P3gMsdYPBJlwzJkQK0/Pk88H5G35QFBm6BnjW3b81znD4AaepV8gY4OARGC5S97vHurva+/VvT7N8PwFhyxlX78fMAAAAGYktHRAD/AAAA/x4lk34AAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQflCRIUEie7jBPgAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAClJREFUCNdjrKur+89AdcDIwMDAgM3opqYmRkYYB1lBU1MTI4Yx6CYAAJuhDPakghFwAAAAAElFTkSuQmCC');
width: 7px;
height: 6px;
margin-left: 1px;
}
}
}
}
&> div.uwt-content
{
height: 80px;
overflow: hidden;
flex-grow: 1;
transition: all 0.3s;
&> div.uwt-listview-item
{
border: solid 1px transparent;
display: inline-block;
padding: 11px 16px;
&:hover
{
background-color: #eeeeee;
border-color: #eeeeee;
}
&> img
{
display: block;
margin-left: auto;
margin-right: auto;
width: 32px;
height: 32px;
}
&> span.uwt-title
{
display: block;
text-align: center;
font-size: smaller;
}
}
}
}
div.uwt-ribbon > div.uwt-ribbon-tab-contents > div.uwt-ribbon-tab-content > div.uwt-ribbon-tab-group > div.uwt-content > div.uwt-ribbon-literal > div.uwt-ribbon-listview
{
margin-top: 20px;
}

View File

@ -0,0 +1,203 @@
.mso-radial-gradient(@start, @end)
{
background: radial-gradient(ellipse at top, @start, transparent), radial-gradient(ellipse at bottom, @end, transparent);
}
@RibbonExpandedHeight: 168px;
@RibbonCollapsedHeight: 48px;
body.uwt-ribbon-visible
{
div.uwt-ribbon
{
position: fixed;
top: 0px;
left: 0px;
height: @RibbonExpandedHeight;
right: 0px;
}
div.uwt-sidebar
{
top: @RibbonExpandedHeight;
}
&> form > div.uwt-page > div.uwt-content, &> div.uwt-page > div.uwt-content
{
margin-top: @RibbonExpandedHeight;
}
}
div.uwt-ribbon
{
visibility: hidden;
opacity: 0;
height: 0px;
transition: all 0.3s;
overflow: hidden;
&.uwt-visible
{
visibility: visible;
opacity: 1;
height: @RibbonExpandedHeight;
&.uwt-ribbon-collapsed
{
height: @RibbonCollapsedHeight;
&> div.uwt-ribbon-tab-contents
{
position: absolute;
height: 94px;
left: 0px;
right: 0px;
margin-top: 1px;
}
}
}
-moz-user-select: none;
&> div.uwt-ribbon-application-button
{
padding: 10px 0px;
position: absolute;
left: 0px;
&> a
{
text-align: center;
padding: 10px 30px;
}
}
&> ul.uwt-ribbon-tab-buttons
{
list-style-type: none;
padding: 0px;
padding-left: 96px;
margin: 0px;
margin-top: 2px;
display: block;
&> li
{
display: inline-block;
border: solid 1px transparent;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
padding: 10px 20px;
margin-bottom: -1px;
&:hover
{
.mso-radial-gradient(#c4ddfe, #e3d198);
border-color: #99bbe8;
}
}
}
&> div.uwt-ribbon-tab-contents
{
&> div.uwt-ribbon-tab-content
{
&:not(.uwt-visible)
{
display: none;
}
&> div.uwt-ribbon-tab-group
{
border-radius: 3px;
display: inline-block;
height: 120px;
margin-bottom: 4px;
vertical-align: top;
position: relative;
&> div.uwt-content
{
.uwt-ribbon-command, .uwt-ribbon-command-container
{
display: inline-block;
}
.uwt-ribbon-command
{
margin: 2px;
vertical-align: top;
div.uwt-title
{
padding: 2px 4px;
text-align: center;
}
img
{
display: block;
margin-left: auto;
margin-right: auto;
width: 32px;
padding: 4px;
}
&.uwt-button
{
border: solid 1px transparent;
border-radius: 3px;
}
&.uwt-ribbon-hide-title > div.uwt-title
{
display: none;
}
&> div.uwt-title
{
min-width: 40px;
max-width: 70px;
font-size: 10pt;
}
&.uwt-splitbutton
{
&> div.uwt-button
{
padding: 10px 4px;
}
&> div.uwt-dropdown-button
{
padding: 2px 0px;
}
}
}
.uwt-ribbon-command-container
{
&> .uwt-ribbon-command
{
display: block;
img
{
width: 16px;
}
}
&.uwt-orientation-vertical > .uwt-ribbon-command
{
&> img { display: inline-block; }
&> div.uwt-title { display: inline-block; text-align: left; }
}
}
}
&> div.uwt-title
{
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
text-align: center;
}
}
}
}
}

View File

@ -0,0 +1,76 @@
@RotarySwitchSize: 128px;
@RotarySwitchButtonSize: 16px;
div.uwt-rotaryswitch
{
position: relative;
width: @RotarySwitchSize;
&> div.uwt-rotaryswitch-indicator
{
left: 75%;
top: 50%;
height: 3px;
width: 50%;
position: absolute;
transform-origin: 0px 0px;
transition: all 0.3s;
margin: -4px 0px;
}
&> ul
{
background-color: #fff;
list-style-type: none;
padding: 0px;
margin: 0px;
padding: 32px;
position: relative;
width: @RotarySwitchSize;
height: @RotarySwitchSize;
&> li
{
position: absolute;
width: @RotarySwitchSize;
height: @RotarySwitchSize;
pointer-events: none;
&> a
{
pointer-events: all;
position: absolute;
width: @RotarySwitchButtonSize;
height: @RotarySwitchButtonSize;
}
}
}
}
body:not(.uwt-javascript-disabled)
{
div.uwt-rotaryswitch
{
&> select
{
display: none;
}
}
}
body.uwt-javascript-disabled
{
div.uwt-rotaryswitch
{
&> ul
{
display: none;
}
&> div.uwt-rotaryswitch-indicator
{
display: none;
}
}
}

View File

@ -0,0 +1,14 @@
body, body > form
{
&> div.uwt-header > div.uwt-header-item.uwt-searchbar div.uwt-popup
{
&:not(.uwt-loading) > div.uwt-spinner
{
display: none;
}
&.uwt-loading > div.uwt-dropdown-content
{
display: none;
}
}
}

View File

@ -0,0 +1,9 @@
div.uwt-sidebar > div.uwt-sidebar-panel > div.uwt-profile-image
{
padding-right: 5px;
display: inline-block;
}
div.uwt-sidebar > div.uwt-sidebar-panel > div.uwt-profile-image, div.uwt-sidebar > div.uwt-sidebar-panel > div.uwt-profile-details
{
display: inline-block;
}

View File

@ -0,0 +1,46 @@
div.uwt-sidebar
{
position: fixed;
top: 60px;
left: 0px;
width: 260px;
bottom: 0px;
ul
{
list-style-type: none;
margin: 0px;
padding: 0px;
&> li
{
&> ul
{
background-color: rgba(0, 0, 0, 0.1);
}
&> a
{
display: block;
padding-left: 5px;
line-height: 42px;
&:hover
{
text-decoration: none;
}
}
&> i.fa
{
display: inline-block;
width: 45px;
text-align: center;
}
}
}
}
@media print
{
div.uwt-sidebar
{
display: none;
}
}

View File

@ -0,0 +1,67 @@
@uwt-slider-padding: 8px;
div.uwt-slider
{
position: relative;
user-select: none;
padding-top: @uwt-slider-padding;
padding-bottom: @uwt-slider-padding;
&:not(.uwt-disable-animation)
{
&> div.uwt-slider-bar
{
&> div.uwt-slider-selection
{
transition: width 0.2s ease-in;
}
&> div.uwt-slider-button
{
transition: left 0.2s ease-in;
}
}
}
&> div.uwt-slider-bar
{
height: 2px;
&> div.uwt-slider-selection
{
position: absolute;
left: 0px;
width: 0px;
height: 2px;
}
&> div.uwt-slider-button
{
border-radius: .75rem;
width: .75rem;
height: .75rem;
position: absolute;
left: 0px;
top: @uwt-slider-padding - 5px;
}
}
&.uwt-large
{
padding-top: @uwt-slider-padding + 8px;
padding-bottom: @uwt-slider-padding + 8px;
&> div.uwt-slider-bar
{
height: 4px;
&> div.uwt-slider-selection
{
height: 4px;
}
&> div.uwt-slider-button
{
border-radius: 30px;
width: 30px;
height: 30px;
top: (@uwt-slider-padding + 8px) - 15px;
}
}
}
}

View File

@ -0,0 +1,16 @@
div.uwt-spinbutton
{
&> a.uwt-button-up, &> a.uwt-button-down, &> label
{
display: block;
}
&> label
{
padding-top: 16px;
padding-bottom: 16px;
}
&> input
{
display: none;
}
}

View File

@ -0,0 +1,21 @@
div.uwt-spinner
{
animation: rotation .6s infinite linear;
}
div#uwt-page-loading > div.uwt-spinner
{
position: absolute;
top: 50%;
left: 50%;
}
@keyframes rotation
{
0%
{
transform: rotate(0deg);
}
100%
{
transform: rotate(359deg);
}
}

View File

@ -0,0 +1,32 @@
div.uwt-splashscreen
{
opacity: 0;
visibility: hidden;
transition: all 0.3s;
position: fixed;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
z-index: 5000;
&.uwt-visible
{
opacity: 1;
visibility: visible;
}
}
body.uwt-loading
{
cursor: wait;
overflow: hidden;
&> div.uwt-splashscreen
{
opacity: 1;
visibility: visible;
}
}

View File

@ -0,0 +1,23 @@
div.uwt-stack-container
{
position: relative;
&> div.uwt-stack-page
{
position: absolute;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
visibility: hidden;
opacity: 0;
transition: visibility 0.3s, opacity 0.3s;
&.uwt-visible
{
visibility: visible;
opacity: 1;
}
}
}

View File

@ -0,0 +1,75 @@
label.uwt-switch
{
position: relative;
display: inline-block;
margin-right: .75rem;
margin-bottom: 0;
border-radius: 60rem;
vertical-align: middle;
font-weight: normal;
cursor: default;
padding-left: 2.375rem;
min-height: 1.375rem;
font-size: .894rem;
line-height: 1.4;
input.uwt-switch-input
{
display: none;
}
.uwt-switch-indicator::after
{
top: 0;
margin: .25rem 0 0 .25rem;
width: .875rem;
height: .875rem;
}
.uwt-switch-unchecked
{
padding-right: .25rem;
padding-left: 1.125rem;
left: 100%;
color: transparent;
}
.uwt-switch-checked
{
left: 0;
}
input.uwt-switch-input:checked ~ .uwt-switch-indicator
{
background: #26B4FF;
color: #FFFFFF;
.uwt-switch-unchecked
{
left: 100%;
color: transparent;
}
.uwt-switch-checked
{
left: 0;
}
}
.uwt-switch-unchecked, .uwt-switch-checked
{
position: absolute;
top: 0;
width: 100%;
height: 100%;
text-align: center;
transition-duration: .2s;
transition-property: left, right;
}
}
.uwt-switch-indicator::after
{
content: "";
position: absolute;
left: 0;
display: block;
border-radius: 999px;
background: #fff;
box-shadow: 0 0 0 1px rgba(24,28,33,0.04),0 1px 6px rgba(24,28,33,0.09);
transition-duration: .2s;
transition-property: left, right, background;
}

View File

@ -0,0 +1,89 @@
div.uwt-tabcontainer
{
box-sizing: border-box;
/* display: table; */
&.uwt-expand
{
width: 100%;
}
&> ul.uwt-tabcontainer-tabs
{
&> li
{
display: none;
margin-bottom: -1px;
&.uwt-visible
{
display: inline-block;
}
&> a
{
text-decoration: none;
padding: 10px 15px;
}
&.uwt-visible > a
{
display: block;
}
}
list-style-type: none;
margin: 0px;
padding: 0px;
}
&> div.uwt-tabcontainer-tabpages
{
position: relative;
&> div.uwt-tabpage
{
/*display: none;*/
/*
position: absolute;
left: 0px;
top: 0px;
right: 0px;
*/
/*
opacity: 0;
visibility: hidden;
*/
display: none;
opacity: 0;
visibility: hidden;
padding: 10px 15px;
&.uwt-selected
{
display: block;
/*
opacity: 1;
visibility: visible;
*/
/*display: block;*/
opacity: 1;
visibility: visible;
}
}
}
&.uwt-position-bottom
{
position: relative;
&> ul.uwt-tabcontainer-tabs
{
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
}
&> ul.uwt-tabcontainer-tabpages
{
left: 0px;
right: 0px;
}
}
}

View File

@ -0,0 +1,32 @@
input[type=text], input[type=password], input[type=number], input[type=search], textarea
{
padding: 10px;
}
div.uwt-textbox
{
&.uwt-selection-required
{
&> div > input
{
cursor: default;
&:focus
{
cursor: text;
}
}
}
&> select
{
display: none;
}
}
div.uwt-popup.uwt-textbox-popup
{
background: #ffff;
&> div.uwt-dropdown-content > ul.uwt-menu
{
max-height: 186px;
overflow-y: scroll;
}
}

View File

@ -0,0 +1,63 @@
div.uwt-tile-container
{
display: flex;
&> div.uwt-tile
{
display: flex;
flex-direction: column;
flex-grow: 1;
&:first-child
{
margin-right: 8px;
}
&+ div.uwt-tile
{
margin-left: 8px;
}
&> div.uwt-header
{
letter-spacing: 0.1em;
padding: 6px 10px;
border-top-right-radius: 1px;
border-top-left-radius: 1px;
text-transform: uppercase;
text-align: center;
font-size: 11px;
}
&> div.uwt-content
{
flex-grow: 1;
padding: 10px 20px;
font-weight: 300;
font-size: 48px;
text-align: center;
&> small
{
display: block;
font-size: 14px;
}
}
&> div.uwt-footer
{
padding: 5px 10px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
&> a + a
{
margin-left: 8px;
}
}
}
}
@media (max-width: 1000px)
{
div.uwt-tile-container
{
&> div.uwt-tile
{
}
}
}

View File

@ -0,0 +1,42 @@
div.uwt-toolbar
{
&> a
{
margin: 4px;
&.uwt-button
{
min-width: initial;
background: transparent;
border-color: transparent;
padding: 4px 8px;
}
}
&> span.uwt-separator
{
width: 0px;
display: inline-block;
-moz-user-select: none;
height: 30px;
top: -4px;
position: relative;
}
}
@media (max-width: 600px)
{
div.uwt-toolbar
{
&> div.uwt-button
{
display: block;
margin-bottom: 8px;
&> a
{
display: block;
}
}
}
}

View File

@ -0,0 +1,29 @@
div.uwt-tooltip
{
max-width: 400px;
padding: .25rem .5rem;
text-align: left;
border-radius: .25rem;
position: fixed;
opacity: 0;
transition: opacity 0.3s;
z-index: 1000;
&.uwt-visible
{
opacity: 1;
}
&> div.uwt-title
{
font-weight: bold;
padding: 8px;
padding-bottom: 4px;
}
&> div.uwt-content
{
padding: 8px;
padding-top: 4px;
}
}

View File

@ -0,0 +1,31 @@
ul.uwt-treeview, ul.uwt-treeview ul
{
list-style-type: none;
margin: 0px;
padding: 0px;
padding-left: 32px;
li
{
position: relative;
&:not(.uwt-expanded) ul
{
display: none;
}
&> span.uwt-treeview-item
{
&> span.uwt-treeview-toggler
{
display: inline-block;
position: absolute;
top: 8px;
left: 16px;
}
display: block;
padding: 8px;
padding-left: 32px;
}
}
}

View File

@ -0,0 +1,21 @@
div.uwt-uml-diagram
{
&> div.uwt-uml-class
{
background-color: #ffffff;
border: solid 1px #cccccc;
box-shadow: 4px 4px 8px #aaaaaa;
display: inline-block;
&> div.uwt-title, &> div.uwt-content
{
padding: 16px;
}
&> div.uwt-title
{
border-bottom: solid 1px #cccccc;
font-weight: bold;
}
}
}

View File

@ -0,0 +1,33 @@
div.uwt-window
{
position: fixed;
&> div.uwt-header
{
-moz-user-select: none;
&> div.uwt-controlbox
{
float: right;
}
}
&> div.uwt-footer
{
text-align: right;
}
&.uwt-footer-hidden > div.uwt-footer
{
display: none;
}
}
div.uwt-modal-background
{
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
left: 0px;
right: 0px;
bottom: 0px;
top: 0px;
z-index: -1;
}

View File

@ -0,0 +1,75 @@
div.uwt-wunderbar
{
position: absolute;
bottom: 0px;
top: 0px;
left: 0px;
right: 0px;
&> div.uwt-content
{
position: relative;
height: 100%;
&> div.uwt-wunderbar-content
{
position: absolute;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
&:not(.uwt-visible)
{
opacity: 0;
visibility: hidden;
}
}
}
&> div.uwt-wunderbar-buttons
{
position: absolute;
bottom: 0px;
right: 0px;
left: 0px;
&> div.uwt-wunderbar-gripper
{
height: 18px;
display: block;
cursor: ns-resize;
-moz-user-select: none;
&> div.uwt-gripper
{
margin-left: auto;
margin-right: auto;
display: block;
width: 38px;
}
}
&> div.uwt-wunderbar-overflow
{
height: 28px;
}
&> ul
{
list-style-type: none;
margin: 0px;
padding: 0px;
&> li
{
&> a
{
display: block;
margin-top: -1px;
margin-bottom: -1px;
padding: 8px;
text-decoration: none;
}
}
}
}
}
div.uwt-sidebar > div.uwt-wunderbar ul li a
{
line-height: initial;
}

198
src/uwt-web/common/uwt.less Normal file
View File

@ -0,0 +1,198 @@
@import "uwt-actionpreviewbutton.less";
@import "uwt-alert.less";
@import "uwt-applicationmenu.less";
@import "uwt-badge.less";
@import "uwt-binaryswitch.less";
@import "uwt-button.less";
@import "uwt-button-group.less";
@import "uwt-calendar.less";
@import "uwt-checkbox.less";
@import "uwt-column.less";
@import "uwt-dialog.less";
@import "uwt-disclosure.less";
@import "uwt-expand.less";
@import "uwt-footer.less";
@import "uwt-formview.less";
@import "uwt-gripper.less";
@import "uwt-header.less";
@import "uwt-image.less";
@import "uwt-label.less";
@import "uwt-layout-box.less";
@import "uwt-listbox.less";
@import "uwt-listview.less";
@import "uwt-megamenu.less";
@import "uwt-menu.less";
@import "uwt-meter.less";
@import "uwt-page-header.less";
@import "uwt-page.less";
@import "uwt-page-footer.less";
@import "uwt-panel.less";
@import "uwt-popup.less";
@import "uwt-progressbar.less";
@import "uwt-ribbon.less";
@import "uwt-ribbon-listview.less";
@import "uwt-rotaryswitch.less";
@import "uwt-searchbar.less";
@import "uwt-sidebar.less";
@import "uwt-sidebar-profile.less";
@import "uwt-slider.less";
@import "uwt-spinbutton.less";
@import "uwt-spinner.less";
@import "uwt-splashscreen.less";
@import "uwt-stack.less";
@import "uwt-tabcontainer.less";
@import "uwt-textbox.less";
@import "uwt-tile.less";
@import "uwt-toolbar.less";
@import "uwt-tooltip.less";
@import "uwt-treeview.less";
@import "uwt-uml-diagram.less";
@import "uwt-window.less";
@import "uwt-wunderbar.less";
@import "mobile/uwt.less";
@import "print/uwt.less";
@import "../fonts/awesome/css/all.less";
html
{
height: 100%;
}
body
{
height: 100%;
overflow: hidden;
}
h1
{
font-size: 42px;
font-weight: 300;
}
h1, h2, h3
{
font-weight: 300;
}
h4
{
font-size: 18px;
}
h4, h5, h6
{
font-weight: 400;
}
div.uwt-container.uwt-layout-box-horizontal
{
&> *
{
display: inline-block;
}
}
div.uwt-center
{
margin-left: auto;
margin-right: auto;
}
.linear-gradient-twostop(@start, @end)
{
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#dcfcff+0,7cc2ec+50,5bacdc+51,bcf8ff+100 */
background: @start; /* Old browsers */
background: -moz-linear-gradient(top, @start 0%, @end 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, @start 0%,@end 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, @start 0%,@end 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@{start}', endColorstr='@{end}',GradientType=0 ); /* IE6-9 */
}
.linear-gradient-fourstop(@start, @startmid, @endmid, @end)
{
/* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#dcfcff+0,7cc2ec+50,5bacdc+51,bcf8ff+100 */
background: @start; /* Old browsers */
background: -moz-linear-gradient(top, @start 0%, @startmid 50%, @endmid 51%, @end 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, @start 0%,@startmid 50%,@endmid 51%,@end 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, @start 0%,@startmid 50%,@endmid 51%,@end 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@{start}', endColorstr='@{end}',GradientType=0 ); /* IE6-9 */
}
.user-select(@param)
{
-webkit-user-select: @param;
-moz-user-select: @param;
-ms-user-select: @param;
user-select: @param;
}
.UwtColors()
{
&.uwt-color-primary
{
background-color: @ThemeColorPrimaryLight;
border-color: @ThemeColorPrimary;
}
&.uwt-color-info
{
background-color: @ThemeColorInfoLight;
border-color: @ThemeColorInfo;
}
&.uwt-color-purple
{
background-color: @ThemeColorPurpleLight;
border-color: @ThemeColorPurple;
}
&.uwt-color-indigo
{
background-color: @ThemeColorIndigoLight;
border-color: @ThemeColorIndigo;
}
&.uwt-color-success
{
background-color: @ThemeColorSuccessLight;
border-color: @ThemeColorSuccess;
}
&.uwt-color-green
{
background-color: @ThemeColorGreenLight;
border-color: @ThemeColorGreen;
}
&.uwt-color-lime
{
background-color: @ThemeColorLimeLight;
border-color: @ThemeColorLime;
}
&.uwt-color-warning
{
background-color: @ThemeColorWarningLight;
border-color: @ThemeColorWarning;
}
&.uwt-color-yellow
{
background-color: @ThemeColorYellowLight;
border-color: @ThemeColorYellow;
}
&.uwt-color-danger
{
background-color: @ThemeColorDangerLight;
border-color: @ThemeColorDanger;
}
&.uwt-color-pink
{
background-color: @ThemeColorPinkLight;
border-color: @ThemeColorPink;
}
}
.uwt-nonexistent
{
display: none;
}
body.uwt-prevent-scrolling
{
overflow: hidden !important;
}
body > div.uwt-page-content
{
padding: 16px;
}

View File

@ -0,0 +1,194 @@
/*
* $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
*
* Licensed under the BSD 3-Clause License.
* http://opensource.org/licenses/BSD-3-Clause
*
* References:
* http://en.wikipedia.org/wiki/Base64
*/
(function(global) {
'use strict';
// existing version for noConflict()
var _Base64 = global.Base64;
var version = "2.1.9";
// if node.js, we use Buffer
var buffer;
if (typeof module !== 'undefined' && module.exports) {
try {
buffer = require('buffer').Buffer;
} catch (err) {}
}
// constants
var b64chars
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var b64tab = function(bin) {
var t = {};
for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
return t;
}(b64chars);
var fromCharCode = String.fromCharCode;
// encoder stuff
var cb_utob = function(c) {
if (c.length < 2) {
var cc = c.charCodeAt(0);
return cc < 0x80 ? c
: cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
+ fromCharCode(0x80 | (cc & 0x3f)))
: (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ fromCharCode(0x80 | ( cc & 0x3f)));
} else {
var cc = 0x10000
+ (c.charCodeAt(0) - 0xD800) * 0x400
+ (c.charCodeAt(1) - 0xDC00);
return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
+ fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ fromCharCode(0x80 | ( cc & 0x3f)));
}
};
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
var utob = function(u) {
return u.replace(re_utob, cb_utob);
};
var cb_encode = function(ccc) {
var padlen = [0, 2, 1][ccc.length % 3],
ord = ccc.charCodeAt(0) << 16
| ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
| ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
chars = [
b64chars.charAt( ord >>> 18),
b64chars.charAt((ord >>> 12) & 63),
padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
];
return chars.join('');
};
var btoa = global.btoa ? function(b) {
return global.btoa(b);
} : function(b) {
return b.replace(/[\s\S]{1,3}/g, cb_encode);
};
var _encode = buffer ? function (u) {
return (u.constructor === buffer.constructor ? u : new buffer(u))
.toString('base64')
}
: function (u) { return btoa(utob(u)) }
;
var encode = function(u, urisafe) {
return !urisafe
? _encode(String(u))
: _encode(String(u)).replace(/[+\/]/g, function(m0) {
return m0 == '+' ? '-' : '_';
}).replace(/=/g, '');
};
var encodeURI = function(u) { return encode(u, true) };
// decoder stuff
var re_btou = new RegExp([
'[\xC0-\xDF][\x80-\xBF]',
'[\xE0-\xEF][\x80-\xBF]{2}',
'[\xF0-\xF7][\x80-\xBF]{3}'
].join('|'), 'g');
var cb_btou = function(cccc) {
switch(cccc.length) {
case 4:
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
| ((0x3f & cccc.charCodeAt(1)) << 12)
| ((0x3f & cccc.charCodeAt(2)) << 6)
| (0x3f & cccc.charCodeAt(3)),
offset = cp - 0x10000;
return (fromCharCode((offset >>> 10) + 0xD800)
+ fromCharCode((offset & 0x3FF) + 0xDC00));
case 3:
return fromCharCode(
((0x0f & cccc.charCodeAt(0)) << 12)
| ((0x3f & cccc.charCodeAt(1)) << 6)
| (0x3f & cccc.charCodeAt(2))
);
default:
return fromCharCode(
((0x1f & cccc.charCodeAt(0)) << 6)
| (0x3f & cccc.charCodeAt(1))
);
}
};
var btou = function(b) {
return b.replace(re_btou, cb_btou);
};
var cb_decode = function(cccc) {
var len = cccc.length,
padlen = len % 4,
n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
| (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
| (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
| (len > 3 ? b64tab[cccc.charAt(3)] : 0),
chars = [
fromCharCode( n >>> 16),
fromCharCode((n >>> 8) & 0xff),
fromCharCode( n & 0xff)
];
chars.length -= [0, 0, 2, 1][padlen];
return chars.join('');
};
var atob = global.atob ? function(a) {
return global.atob(a);
} : function(a){
return a.replace(/[\s\S]{1,4}/g, cb_decode);
};
var _decode = buffer ? function(a) {
return (a.constructor === buffer.constructor
? a : new buffer(a, 'base64')).toString();
}
: function(a) { return btou(atob(a)) };
var decode = function(a){
return _decode(
String(a).replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' })
.replace(/[^A-Za-z0-9\+\/]/g, '')
);
};
var noConflict = function() {
var Base64 = global.Base64;
global.Base64 = _Base64;
return Base64;
};
// export Base64
global.Base64 = {
VERSION: version,
atob: atob,
btoa: btoa,
fromBase64: decode,
toBase64: encode,
utob: utob,
encode: encode,
encodeURI: encodeURI,
btou: btou,
decode: decode,
noConflict: noConflict
};
// if ES5 is available, make Base64.extendString() available
if (typeof Object.defineProperty === 'function') {
var noEnum = function(v){
return {value:v,enumerable:false,writable:true,configurable:true};
};
global.Base64.extendString = function () {
Object.defineProperty(
String.prototype, 'fromBase64', noEnum(function () {
return decode(this)
}));
Object.defineProperty(
String.prototype, 'toBase64', noEnum(function (urisafe) {
return encode(this, urisafe)
}));
Object.defineProperty(
String.prototype, 'toBase64URI', noEnum(function () {
return encode(this, true)
}));
};
}
// that's it!
if (global['Meteor']) {
Base64 = global.Base64; // for normal export in Meteor.js
}
})(this);

View File

@ -0,0 +1,11 @@
function MousePosition()
{
}
MousePosition.X = 0;
MousePosition.Y = 0;
document.addEventListener("mousemove", function(e)
{
MousePosition.X = e.clientX;
MousePosition.Y = e.clientY;
});

View File

@ -0,0 +1,13 @@
Function.prototype.PrependArgument = function(arg)
{
var func = this;
return function()
{
var newargs = [arg];
for (var i = 0; i < arguments.length; i++)
{
newargs.push(arguments[i]);
}
return func.apply(this, newargs);
};
};

View File

@ -0,0 +1,895 @@
function Clipboard()
{
}
Clipboard.setText = function(value)
{
if ('clipboard' in navigator)
{
navigator.clipboard.writeText(value).then(() =>
{
}).catch((err) => console.error(err.name, err.message));
}
else
{
const textArea = document.createElement('textarea');
textArea.value = value;
textArea.style.opacity = 0;
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
const success = document.execCommand('copy');
//console.log(`Text copy was ${success ? 'successful' : 'unsuccessful'}.`);
} catch (err) {
console.error(err.name, err.message);
}
document.body.removeChild(textArea);
}
};
function StringPadDirection(value)
{
this._value = value;
}
StringPadDirection.Left = new StringPadDirection(1);
StringPadDirection.Right = new StringPadDirection(2);
StringPadDirection.Both = new StringPadDirection(3);
function StringPad(str, len, pad, dir)
{
if (typeof(len) == "undefined") len = 0;
if (typeof(pad) == "undefined") pad = ' ';
if (typeof(dir) == "undefined") dir = StringPadDirection.Right;
if (len + 1 >= str.length)
{
if (dir == StringPadDirection.Left)
{
str = Array(len + 1 - str.length).join(pad) + str;
}
else if (dir == StringPadDirection.Both)
{
var right = Math.ceil((padlen = len - str.length) / 2);
var left = padlen - right;
str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
}
else
{
str = str + Array(len + 1 - str.length).join(pad);
}
}
return str;
}
String.prototype.padLeft = function(length, value)
{
return StringPad(this, length, value, StringPadDirection.Left);
}
String.prototype.padRight = function(length, value)
{
return StringPad(this, length, value, StringPadDirection.Right);
}
String.prototype.pad = function(length, value)
{
return StringPad(this, length, value, StringPadDirection.Both);
}
/**
* Event arguments for an event that can be canceled.
*/
function CancelEventArgs()
{
this.Cancel = false;
}
function EventArgs()
{
}
EventArgs.Empty = new EventArgs();
/**
* Enumeration for mouse button values
*/
function MouseButtons()
{
}
/**
* No mouse buttons are being pressed.
*/
MouseButtons.None = 0;
/**
* The primary (usually left) button is being pressed.
*/
MouseButtons.Primary = 1;
/**
* The secondary (usually right) button is being pressed.
*/
MouseButtons.Secondary = 2;
/**
* The tertiary (usually wheel) button is being pressed.
*/
MouseButtons.Tertiary = 4;
/**
* The additional primary button is being pressed.
*/
MouseButtons.XButton1 = 8;
/**
* The additional secondary button is being pressed.
*/
MouseButtons.XButton2 = 16;
function MouseEventArgs(button, x, y)
{
this.Button = button;
this.X = x;
this.Y = y;
this.NativeEventArgs = null;
this.Control = false;
this.Alt = false;
this.Shift = false;
}
MouseEventArgs.FromNativeEventArgs = function(e)
{
var ee = new MouseEventArgs(0);
ee.X = e.clientX;
ee.Y = e.clientY;
ee.Control = e.ctrlKey;
ee.Alt = e.altKey;
ee.Shift = e.shiftKey;
ee.NativeEventArgs = e;
if (e.which)
{
switch (e.which)
{
case 1:
{
ee.Button |= MouseButtons.Primary;
break;
}
case 2:
{
ee.Button |= MouseButtons.Tertiary;
break;
}
case 3:
{
ee.Button |= MouseButtons.Secondary;
break;
}
}
}
else if (e.button)
{
if ((e.button & 1) == 1) ee.Button |= MouseButtons.Primary;
if ((e.button & 4) == 4) ee.Button |= MouseButtons.Tertiary;
if ((e.button & 2) == 2) ee.Button |= MouseButtons.Secondary;
}
return ee;
};
function KeyboardKeys()
{
};
/**
* The TAB key.
*/
KeyboardKeys.Tab = 9;
/**
* The ENTER key.
*/
KeyboardKeys.Enter = 13;
/**
* The ESC key.
*/
KeyboardKeys.Escape = 27;
/**
* The spacebar key.
*/
KeyboardKeys.Space = 32;
/**
* The F1 function key.
*/
KeyboardKeys.F1 = 112;
KeyboardKeys.Control = 17;
KeyboardKeys.Alt = 18;
KeyboardKeys.ArrowLeft = 37;
KeyboardKeys.ArrowUp = 38;
KeyboardKeys.ArrowRight = 39;
KeyboardKeys.ArrowDown = 40;
KeyboardKeys.Meta = 91;
KeyboardKeys.ContextMenu = 93;
/**
* Enumeration for horizontal alignment values
*/
function HorizontalAlignment(value)
{
this._value = value;
}
/**
* Specifies that content is aligned to the left.
*/
HorizontalAlignment.Left = new HorizontalAlignment(0);
/**
* Specifies that content is aligned in the center of the screen.
*/
HorizontalAlignment.Center = new HorizontalAlignment(1);
/**
* Specifies that content is aligned to the right.
*/
HorizontalAlignment.Right = new HorizontalAlignment(2);
/**
* Enumeration for vertical alignment values
*/
function VerticalAlignment(value)
{
this._value = value;
}
/**
* Specifies that content is aligned to the top.
*/
VerticalAlignment.Top = new VerticalAlignment(0);
/**
* Specifies that content is aligned in the middle of the screen.
*/
VerticalAlignment.Middle = new VerticalAlignment(1);
/**
* Specifies that content is aligned to the bottom.
*/
VerticalAlignment.Bottom = new VerticalAlignment(2);
function Callback(sender)
{
this._items = [];
this._sender = sender;
this.Add = function(func)
{
this._items.push(func);
};
this.Execute = function(e)
{
for (var i = 0; i < this._items.length; i++)
{
this._items[i](this._sender, e);
}
};
}
function CallbackArgument()
{
}
CallbackArgument.Empty = new CallbackArgument();
function Page()
{
}
Page.Cookies = new Object();
/**
* Gets the cookie with the specified name.
*/
Page.Cookies.Get = function(name)
{
var cookie = document.cookie.split(';');
for (var i = 0; i < cookie.length; i++)
{
var cookie1 = cookie[i].split(';', 2);
if (cookie1[0] == name) return cookie1[1];
}
return null;
};
/**
* Sets the cookie with the given name to the given value, and optionally sets an expiration date.
* @param name string The name of the cookie to set or update.
* @param value string The value of the cookie.
* @param expires string The date and time at which the cookie should expire.
*/
Page.Cookies.Set = function(name, value, expires)
{
var cookie = name + "=" + value;
if (expires)
{
cookie += ";expires=" + expires;
}
document.cookie = cookie;
};
Page.Path = new Object();
Page.Path.GetParts = function()
{
var p = window.location.href.substring(System.ExpandRelativePath("~/").length + 5);
return p.split('/');
};
/**
* The Phast static members
*/
function System()
{
}
/**
* Redirects the browser to the given page.
*/
System.Redirect = function(path)
{
window.location.href = System.ExpandRelativePath(path);
};
/**
* Expands the given path using the tilde (~) character and variable replacement.
*/
System.ExpandRelativePath = function(path)
{
var replpath = System.BasePath;
if (System.IsTenantedHostingEnabled())
{
replpath = replpath + "/" + System.GetTenantName();
}
return path.replace(/~\//, replpath + "/");
};
/**
* Raises a custom DOM event on the given element.
* @param element string The element on which to raise the event.
* @param eventName string The name of the Event to raise.
* @param args any Arguments passed into the event handler.
*/
System.RaiseEvent = function(element, eventName, args)
{
var event; // The custom event that will be created
if (document.createEvent)
{
event = document.createEvent("HTMLEvents");
event.initEvent(eventName, true, true);
}
else
{
event = document.createEventObject();
event.eventType = eventName;
}
event.eventName = eventName;
if (document.createEvent)
{
return element.dispatchEvent(event);
}
else
{
element.fireEvent("on" + eventName, event);
}
};
/**
* Provides an event handler for custom-handled events.
* @deprecated Use DOM events and System.RaiseEvent() instead.
*/
System.EventHandler = function()
{
this._functions = new Array();
this.Add = function (func)
{
this._functions.push(func);
};
this.Execute = function(sender, e)
{
for (var i = 0; i < this._functions.length; i++)
{
var retval = this._functions[i](sender, e);
if (!retval) return false;
}
return true;
};
};
System.Navigation = new Object();
/**
* Retrieves partial content from a URL and loads it into the specified element's innerHTML property.
*
* @param url string The URL to fetch.
* @param targetFrame string The DOM element in which to load the data.
* @param throbber DOMElement The DOM element used as the waiting indicator (optional).
* @param throbberClassDefault string The CSS class for the waiting indicator (optional).
* @param throbberClassHidden string The CSS class for the hidden waiting indicator (optional).
* @param throbberClassVisible string The CSS class for the visible waiting indicator (optional).
*/
System.Navigation.LoadPartialContent = function(url, targetFrame, async, throbber, throbberClassDefault, throbberClassHidden, throbberClassVisible)
{
if (typeof(async) === "undefined") async = false;
if (!throbberClassDefault) throbberClassDefault = "";
if (!throbberClassHidden) throbberClassHidden = "Hidden";
if (!throbberClassVisible) throbberClassHidden = "Visible";
// fetch the data from the URL, should be a same-origin URL
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function()
{
if (this.readyState == 4)
{
targetFrame.innerHTML = xhr.responseText;
if (throbber)
{
var cssclass = "";
if (throbberClassDefault) cssclass += throbberClassDefault + " ";
if (throbberClassVisible) cssclass += throbberClassHidden;
throbber.className = cssclass;
}
}
};
xhr.open('GET', url, async);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.send(null);
if (throbber)
{
var cssclass = "";
if (throbberClassDefault) cssclass += throbberClassDefault + " ";
if (throbberClassVisible) cssclass += throbberClassVisible;
throbber.className = cssclass;
}
};
System.TerminateIfSenderIs = function(sender, compareTo)
{
while (sender != null)
{
if (sender.classList)
{
for (var i = 0; i < compareTo.length; i++)
{
if (System.ClassList.Contains(sender, compareTo[i]))
{
// do not close the popup when we click inside itself
// e.preventDefault();
// e.stopPropagation();
// alert(compareTo[i] + " = " + sender.className + " ? true ");
return true;
}
}
}
sender = sender.parentNode;
if (sender == null) break;
}
return false;
};
System.CheckIfSenderIsInside = function(sender, compareTo)
{
while (sender != null)
{
if (sender === compareTo)
{
return true;
}
sender = sender.parentNode;
if (sender == null) break;
}
return false;
};
/**
* Enters full screen mode on the specified element. If no element is specified, the entire page becomes full screen.
* @param element DOMElement The element with which to fill the screen. If not specified, document.body will be used.
*/
System.EnterFullScreen = function(element)
{
if (!element) element = document.body;
if (element.requestFullscreen)
{
// The HTML5 way
element.requestFullscreen();
}
else if (element.webkitRequestFullscreen)
{
// The WebKit (safari/chrome) way
element.webkitRequestFullscreen();
}
else if (element.mozRequestFullScreen)
{
// The Firefox way
element.mozRequestFullScreen();
}
else if (element.msRequestFullscreen)
{
// The Internet Explorer way
element.msRequestFullscreen();
}
};
/**
* Exits full screen mode.
*/
System.ExitFullScreen = function()
{
if (document.exitFullscreen)
{
document.exitFullscreen();
}
else if (document.webkitExitFullscreen)
{
document.webkitExitFullscreen();
}
else if (document.mozCancelFullScreen)
{
document.mozCancelFullScreen();
}
else if (document.msExitFullscreen)
{
document.msExitFullscreen();
}
};
/**
* Gets the predefined Phast events that are passed into event handlers.
*/
System.Events = new Object();
System.Events.MouseClick = new Object();
System.Events.MouseClick.Name = "click";
/**
* The event that is raised when the mouse wheel is scrolled over an element.
*/
System.Events.MouseWheel = new Object();
//FF doesn't recognize mousewheel as of FF3.x
/**
* Gets the name of this event.
*/
System.Events.MouseWheel.Name = ((/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel");
/**
* Gets the event arguments for this event.
*/
System.Events.GetEventArgs = function(e)
{
var delta = e.detail ? e.detail * (-120) : e.wheelDelta;
// delta returns +120 when wheel is scrolled up, -120 when scrolled down
var evt =
{
"Cancel": false,
"Delta": delta
};
return evt;
};
/**
* Gets the value of the ClientProperty with the given propertyName for the control with the given controlName.
* @param controlName string The name of the control for which to retrieve a ClientProperty.
* @param propertyName string The name of the property to search for.
*/
System.GetClientProperty = function(controlName, propertyName)
{
return Page.Cookies.Get(controlName + "__ClientProperty_" + propertyName);
};
/**
* Sets the value of the ClientProperty with the given propertyName for the control with the given controlName to the given propertyValue.
* @param controlName string The name of the control for which to update a ClientProperty.
* @param propertyName string The name of the property to search for.
* @param propertyValue string The new value of the property.
*/
System.SetClientProperty = function(controlName, propertyName, propertyValue)
{
Page.Cookies.Set(controlName + "__ClientProperty_" + propertyName, propertyValue);
};
/**
* Adds an event listener with the given eventTypeOrName to the parent element.
* @param parent DOMElement The element on which to add an event listener.
* @param eventTypeOrName string The name of the event for which to add a listener, minus the "on" prefix.
* @param callback EventListener The event listener that will be called when this event is raised.
*/
System.AddEventListener = function(parent, eventTypeOrName, callback)
{
function CustomCallback(evt)
{
if (typeof eventTypeOrName.GetEventArgs !== 'undefined')
{
var eas = eventTypeOrName.GetEventArgs(evt);
eas.Cancel = false;
callback(eas);
if (eas.Cancel)
{
evt.preventDefault();
evt.stopPropagation();
return false;
}
}
else
{
var eas = evt;
eas.Cancel = false;
callback(eas);
if (eas.Cancel)
{
evt.preventDefault();
evt.stopPropagation();
return false;
}
}
return true;
}
if (typeof eventTypeOrName !== "object")
{
if (parent.attachEvent)
{
//if IE (and Opera depending on user setting)
parent.attachEvent("on" + eventTypeOrName, callback);
}
else if (parent.addEventListener) //WC3 browsers
{
parent.addEventListener(eventTypeOrName, callback, false);
}
}
else
{
if (parent.attachEvent)
{
//if IE (and Opera depending on user setting)
parent.attachEvent("on" + eventTypeOrName.Name, CustomCallback);
}
else if (parent.addEventListener) //WC3 browsers
{
parent.addEventListener(eventTypeOrName.Name, CustomCallback, false);
}
}
};
System.ClassList =
{
"Add": function (object, className)
{
if (object.classList && object.classList.add)
{
object.classList.add(className);
return true;
}
var splits = object.className.split(" ");
for (var i = 0; i < splits.length; i++)
{
if (splits[i] == className) return true;
}
splits.push(className);
object.className = splits.join(" ");
return false;
},
"Remove": function (object, className)
{
if (object.classList && object.classList.remove)
{
object.classList.remove(className);
return true;
}
var splits = object.className.split(" ");
var newsplits = new Array();
for (var i = 0; i < splits.length; i++)
{
if (splits[i] == className) continue;
newsplits.push(splits[i]);
}
object.className = newsplits.join(" ");
return false;
},
"Contains": function (object, className)
{
if (object.classList && object.classList.contains)
{
return object.classList.contains(className);
}
if (!object.className) return false;
var splits = object.className.split(" ");
for (var i = 0; i < splits.length; i++)
{
if (splits[i] == className) return true;
}
return false;
},
"Toggle": function (object, className)
{
if (System.ClassList.Contains(object, className))
{
System.ClassList.Remove(object, className);
}
else
{
System.ClassList.Add(object, className);
}
}
};
System.StringMethods =
{
"Contains": function(string, value)
{
if (string.includes) return string.includes(value);
if (string.contains) return string.contains(value);
console.error("Neither String.includes nor String.contains were found");
return false;
}
};
var WebPage =
{
"Postback": function(url)
{
var WebPageForm = document.getElementById("WebPageForm");
if (url)
{
// Set the action of the WebPageForm to the specified PostBackURL before submitting
WebPageForm.action = url;
}
if (!WebPageForm)
{
console.warn("WebPage.Postback: could not find WebPageForm, postbacks are not enabled");
return;
}
WebPageForm.submit();
},
"IsVariableDefined": function(name)
{
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
if (!txtWebPageVariable) return false;
return true;
},
"IsVariableSet": function(name)
{
var txtWebPageVariable_IsSet = document.getElementById("WebPageVariable_" + name + "_IsSet");
if (!txtWebPageVariable_IsSet)
{
console.warn("WebPage.IsVariableSet: undefined variable '" + name + "'");
return false;
}
return true;
},
"ClearVariableValue": function(name, value)
{
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
var txtWebPageVariable_IsSet = document.getElementById("WebPageVariable_" + name + "_IsSet");
if (!txtWebPageVariable || !txtWebPageVariable_IsSet)
{
console.error("WebPage.ClearVariableValue: undefined variable '" + name + "'");
return false;
}
txtWebPageVariable_IsSet.value = "false";
txtWebPageVariable.value = "";
WebPage.Postback();
return true;
},
"GetVariableValue": function(name)
{
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
if (!txtWebPageVariable)
{
console.error("WebPage.GetVariableValue: undefined variable '" + name + "'");
return null;
}
return txtWebPageVariable.value;
},
"SetVariableValue": function(name, value, autoPostback)
{
var txtWebPageVariable = document.getElementById("WebPageVariable_" + name + "_Value");
var txtWebPageVariable_IsSet = document.getElementById("WebPageVariable_" + name + "_IsSet");
if (!txtWebPageVariable || !txtWebPageVariable_IsSet)
{
console.error("WebPage.GetVariableValue: undefined variable '" + name + "'");
return false;
}
txtWebPageVariable_IsSet.value = "true";
txtWebPageVariable.value = value;
if (autoPostback !== false)
{
WebPage.Postback();
}
return true;
}
};
/*
Provide the XMLHttpRequest constructor for Internet Explorer 5.x-6.x:
Other browsers (including Internet Explorer 7.x-9.x) do not redefine
XMLHttpRequest if it already exists.
This example is based on findings at:
http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
*/
if (typeof XMLHttpRequest === "undefined")
{
XMLHttpRequest = function ()
{
try
{
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
}
catch (e) {}
try
{
return new ActiveXObject("Msxml2.XMLHTTP.3.0");
}
catch (e) {}
try
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {}
console.log("This browser does not support XMLHttpRequest.");
};
}
if (!String.format)
{
String.format = function() {
var args = arguments;
return args[0].replace(/{(\d+)}/g, function(match, number) {
return typeof args[parseInt(number) + 1] != 'undefined'
? args[parseInt(number) + 1]
: match
;
});
};
}
System.AddEventListener(window, "load", function()
{
System.ClassList.Remove(document.body, "uwt-javascript-disabled");
});
System.EnsureElementVisible = function(element, relativeToElement)
{
var buttonRect = null;
if (relativeToElement !== null)
{
buttonRect = relativeToElement.getBoundingClientRect();
console.log ("button rect: ");
console.log(buttonRect);
var previewRect = element.getBoundingClientRect();
console.log ("preview rect: ");
console.log(previewRect);
element.style.top = buttonRect.bottom + "px";
element.style.left = buttonRect.right + "px";
var offsetBottom = element.offsetTop + previewRect.height;
console.log ("popup bottom: " + offsetBottom);
console.log ("document height: " + document.body.clientHeight);
element.style.left = buttonRect.right + "px";
if (offsetBottom > document.body.clientHeight)
{
element.style.top = "";
element.style.bottom = (document.body.clientHeight - buttonRect.top) + "px";
}
else
{
element.style.top = buttonRect.bottom + "px";
element.style.bottom = "";
}
}
else
{
var previewRect = element.getBoundingClientRect();
console.log ("preview rect: ");
console.log(previewRect);
var offsetTop = element.offsetTop;
var offsetBottom = element.offsetTop + previewRect.height;
console.log ("popup bottom: " + offsetBottom);
console.log ("document height: " + document.body.clientHeight);
if (offsetBottom > document.body.clientHeight)
{
var newBottom = document.body.clientHeight - offsetTop; // (offsetBottom - document.body.clientHeight);
console.log("new bottom: " + newBottom + "px")
element.style.top = "";
element.style.bottom = newBottom + "px";
}
else
{
}
}
};

View File

@ -0,0 +1,34 @@
window.GetWidth = function()
{
var x = 0;
if (self.innerHeight)
{
x = self.innerWidth;
}
else if (document.documentElement && document.documentElement.clientHeight)
{
x = document.documentElement.clientWidth;
}
else if (document.body)
{
x = document.body.clientWidth;
}
return x;
};
window.GetHeight = function()
{
var y = 0;
if (self.innerHeight)
{
y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
{
y = document.documentElement.clientHeight;
}
else if (document.body)
{
y = document.body.clientHeight;
}
return y;
}

View File

@ -0,0 +1,173 @@
function AdditionalDetailWidget(parent)
{
this.Parent = parent;
this.Parent.addEventListener("transitionend", function(e)
{
if (!System.ClassList.Contains(this, "apb-selected"))
{
System.ClassList.Remove(document.body, "uwt-prevent-scrolling");
}
});
this.InitializePopupLocation = function()
{
this.PreviewElement.style.top = "";
this.PreviewElement.style.left = "";
this.PreviewElement.style.position = "fixed";
};
this.UpdatePopupLocation = function()
{
this.InitializePopupLocation();
if (System.ClassList.Contains(this.PreviewElement, "uwt-loading"))
{
return;
}
System.EnsureElementVisible(this.PreviewElement, this.ButtonLink);
};
this.Show = function ()
{
System.ClassList.Add(document.body, "uwt-prevent-scrolling");
this.UpdatePopupLocation();
this.OnOpening();
System.ClassList.Add(this.Parent, "apb-selected");
};
this.Hide = function ()
{
System.ClassList.Remove(document.body, "uwt-prevent-scrolling");
System.ClassList.Remove(this.Parent, "apb-selected");
};
this.Toggle = function ()
{
if (!System.ClassList.Contains(this.Parent, "apb-selected"))
{
this.OnOpening();
}
System.ClassList.Toggle(this.Parent, "apb-selected");
};
this.OnOpening = function()
{
};
if (parent.children[0].tagName === "IMG")
{
this.IconElement = parent.children[0];
this.TextLink = parent.children[1];
this.ButtonLink = parent.children[2];
this.PreviewElement = parent.children[3];
}
else
{
this.IconElement = null;
this.TextLink = parent.children[0];
this.ButtonLink = parent.children[1];
this.PreviewElement = parent.children[2];
}
// aria
this.TextLink.NativeObject = this;
this.TextLink.addEventListener("keydown", function(e)
{
if (e.keyCode == 9)
{
if (!e.shiftKey)
{
this.focusIndex = 1;
// tab
this.NativeObject.ButtonLink.tabIndex = -1;
this.NativeObject.ButtonLink.focus();
console.log("focused");
console.log(this.NativeObject.ButtonLink);
// just.. eat it!
e.preventDefault();
e.stopPropagation();
return false;
}
}
});
this.TextLink.NativeObject = this;
this.TextLink.addEventListener("focus", function(e)
{
if (e.relatedTarget !== null)
{
var pos = this.compareDocumentPosition(e.relatedTarget);
if (pos == Node.DOCUMENT_POSITION_FOLLOWING && e.relatedTarget !== this.NativeObject.ButtonLink)
{
this.NativeObject.ButtonLink.focus();
}
}
});
this.ButtonLink.NativeObject = this;
this.ButtonLink.addEventListener("click", function (e)
{
if (e.which == MouseButtons.Primary)
{
this.NativeObject.Show();
e.preventDefault();
e.stopPropagation();
return false;
}
});
this.ButtonLink.addEventListener("keydown", function (e)
{
if (e.keyCode == 13 || e.keyCode == 32) // enter or space
{
this.NativeObject.Toggle();
e.preventDefault();
e.stopPropagation();
return false;
}
// console.log("keydown on button"); console.log(e);
});
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("uwt-actionpreviewbutton");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new AdditionalDetailWidget(items[i]);
}
});
window.addEventListener("mousedown", function (e)
{
var sender = null;
if (!e) e = window.event;
if (e.target)
{
sender = e.target;
}
else if (e.srcElement)
{
sender = e.srcElement;
}
if (!System.TerminateIfSenderIs(sender, ["uwt-actionpreviewbutton"]))
{
var items = document.getElementsByClassName("uwt-actionpreviewbutton");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject.Hide();
}
}
});
window.addEventListener("keydown", function (e)
{
if (e.keyCode == 27)
{
// cancel all APBs if they are open
var items = document.getElementsByClassName("uwt-actionpreviewbutton");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject.Hide();
}
}
});

View File

@ -0,0 +1,210 @@
function Alert(parentElement)
{
if (parentElement)
{
this.ParentElement = parentElement;
this.IconElement = this.ParentElement.children[0];
System.ClassList.Remove(this.ParentElement, "uwt-disabled");
if (this.IconElement != null)
{
this.IconElement.NativeObject = this;
this.IconElement.addEventListener("click", function()
{
if (System.ClassList.Contains(this.NativeObject.ParentElement, "uwt-collapsible"))
{
System.ClassList.Toggle(this.NativeObject.ParentElement, "uwt-collapsed");
}
});
}
}
this.mvarID = "";
this.setID = function(value)
{
this.mvarID = value;
};
this.getID = function()
{
return this.mvarID;
};
this.mvarTitle = "";
this.setTitle = function(value)
{
this.mvarTitle = value;
};
this.getTitle = function()
{
return this.mvarTitle;
}
this.mvarContent = "";
this.setContent = function(value)
{
this.mvarContent = value;
};
this.getContent = function()
{
return this.mvarContent;
};
this.mvarCssClass = "";
this.setCssClass = function(value)
{
this.mvarCssClass = value;
};
this.getCssClass = function()
{
return this.mvarCssClass;
};
this.mvarTimeout = -1;
this.setTimeout = function(value)
{
this.mvarTimeout = value;
}
this.getTimeout = function()
{
return this.mvarTimeout;
};
this.mvarParentElement = null;
this.show = function(timeoutInMilliseconds)
{
//!FIXME: this needs to track which alerts have timeouts, and cancel them if they are re-shown
var element = null;
if (this.mvarID != "")
{
var existing = document.getElementById("uwt_alert__" + this.mvarID);
if (typeof(existing) !== "undefined")
{
element = existing;
}
}
if (element === null)
{
element = document.createElement("div");
}
element.innerHTML = "";
if (this.mvarID != "")
{
element.id = "uwt_alert__" + this.mvarID;
}
var cssClass = "uwt-alert";
if (this.getCssClass() != "") cssClass += " " + this.getCssClass();
element.className = cssClass;
element.ObjectReference = this;
element.addEventListener("click", function(e)
{
this.ObjectReference.hide();
});
this.mvarParentElement = element;
var elemTitle = document.createElement("div");
elemTitle.className = "uwt-title";
elemTitle.innerHTML = this.getTitle();
element.appendChild(elemTitle);
var elemContent = document.createElement("div");
elemContent.className = "uwt-content";
elemContent.innerHTML = this.getContent();
element.appendChild(elemContent);
if (Alert.AlertContainer === null)
{
Alert.AlertContainer = document.createElement("div");
Alert.AlertContainer.className = "uwt-alert-container";
document.body.appendChild(Alert.AlertContainer);
}
Alert.AlertContainer.appendChild(element);
cssClass += " uwt-visible";
// timeout required to see the transition when first adding the element to the page
window.setTimeout(function()
{
element.className = cssClass;
}, 50);
if (typeof(timeoutInMilliseconds) !== "undefined")
{
window.setTimeout(function(sender)
{
sender.hide();
}, timeoutInMilliseconds, this);
}
else if (typeof(this.mvarTimeout) !== "undefined")
{
window.setTimeout(function(sender)
{
sender.hide();
}, this.mvarTimeout, this);
}
};
this.hide = function()
{
System.ClassList.Remove(this.mvarParentElement, "uwt-visible");
};
}
Alert.AlertContainer = null;
Alert.show = function(content, title, cssClass, timeoutInMilliseconds, id)
{
var n = new Alert();
if (typeof(id) !== "undefined")
{
n.setID(id);
}
if (typeof(content) === "undefined")
{
console.warn("showing notification with empty content");
content = "";
}
n.setContent(content);
if (typeof(title) === "undefined")
{
console.warn("showing notification with empty title");
title = "";
}
n.setTitle(title);
if (typeof(cssClass) === "undefined") cssClass = "";
n.setCssClass(cssClass);
if (typeof(timeoutInMilliseconds) !== "undefined")
{
n.setTimeout(timeoutInMilliseconds);
}
n.show();
};
window.addEventListener("load", function()
{
var items = document.getElementsByClassName("uwt-alert");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new Alert(items[i]);
}
window.setTimeout(function()
{
var items = document.getElementsByClassName("uwt-alert");
for (var i = 0; i < items.length; i++)
{
if (!System.ClassList.Contains(items[i], "uwt-alert-sticky"))
{
items[i].style.right = "-2000px";
}
}
}, 5000);
});

View File

@ -0,0 +1,47 @@
function BinarySwitch(parentElement)
{
this.ParentElement = parentElement;
this.SwitchesElement = this.ParentElement.children[0];
this.InputElement = this.ParentElement.children[1];
var switches = this.SwitchesElement.children;
for (var i = 0; i < switches.length; i++)
{
switches[i].__BinarySwitch = this;
switches[i].addEventListener("change", function(e)
{
this.__BinarySwitch.update();
}, true);
}
this.update = function()
{
var value = 0;
var switches = this.SwitchesElement.children;
for (var i = 0; i < switches.length; i++)
{
if (System.ClassList.Contains(switches[i], "uwt-selected"))
{
if (this.ParentElement.getAttribute("data-endianness") == "little")
{
value += (2 ** (switches.length - i - 1));
}
else
{
value += (2 ** i);
}
}
}
this.InputElement.value = value;
};
}
window.addEventListener("load", function()
{
var items = document.getElementsByClassName("uwt-binaryswitch");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new BinarySwitch(items[i]);
}
});

View File

@ -0,0 +1,86 @@
function Button(parentElement)
{
this.ParentElement = parentElement;
if (this.ParentElement.tagName == "A")
{
console.log(parentElement);
this.ParentElement.addEventListener("click", function(e)
{
if (System.ClassList.Contains(this, "uwt-toggle"))
{
System.ClassList.Toggle(this, "uwt-selected");
e.preventDefault();
e.stopPropagation();
return false;
}
});
}
/*
this.ButtonElement = this.ParentElement.children[0];
this.ButtonElement.NativeObject = this;
this.DropDownButtonElement = this.ParentElement.children[1];
this.DropDownButtonElement.NativeObject = this;
this.DropDownContentElement = this.ParentElement.children[2];
this.getDropDownOpened = function()
{
return System.ClassList.Contains(this.DropDownContentElement, "Visible");
};
this.setDropDownOpened = function(value)
{
if (value)
{
System.ClassList.Add(this.DropDownContentElement, "Visible");
if (this.ParentElement.getAttribute("data-pwt-dropdown-direction") == "right")
{
this.DropDownContentElement.style.left = (this.ParentElement.offsetLeft - this.ParentElement.offsetWidth) + "px";
}
}
else
{
System.ClassList.Remove(this.DropDownContentElement, "Visible");
}
};
this.toggleDropDownOpened = function()
{
this.setDropDownOpened(!this.getDropDownOpened());
};
this.isDropDownRequired = function()
{
return System.ClassList.Contains(this.ParentElement, "pwt-DropDownRequired");
}
this.ButtonElement.addEventListener("click", function(e)
{
if (this.NativeObject.isDropDownRequired())
{
this.NativeObject.setDropDownOpened(true);
e.preventDefault();
e.stopPropagation();
return false;
}
});
this.DropDownButtonElement.addEventListener("click", function(e)
{
this.NativeObject.setDropDownOpened(true);
e.preventDefault();
e.stopPropagation();
return false;
});
*/
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("uwt-button");
for (var i = 0; i < items.length; i++)
{
// if (items[i].tagName.toLowerCase() != "div") continue;
items[i].NativeObject = new Button(items[i]);
}
});

View File

@ -0,0 +1,113 @@
function CheckBox(parentElement)
{
this.ParentElement = parentElement;
this.mvarChecked = parentElement.hasAttribute("checked");
this.SetChecked = function(value)
{
var changed = (this.GetChecked() != value);
this.mvarChecked = value;
this.ParentElement.checked = this.mvarChecked;
if (this.mvarChecked)
{
this.NewParentElement.className = "uwt-checkbox uwt-checked";
}
else
{
this.NewParentElement.className = "uwt-checkbox";
}
if (!changed) return;
if (!this.__inhibit_update)
{
System.RaiseEvent(this.ParentElement, "change", null);
}
}
this.GetChecked = function()
{
return this.mvarChecked;
}
this.ToggleChecked = function()
{
this.SetChecked(!this.GetChecked());
}
var child = document.createElement("div");
child.className = "uwt-checkbox";
child.tabIndex = 0;
child.NativeObject = this;
child.addEventListener("click", function(e)
{
this.NativeObject.ToggleChecked();
});
child.addEventListener("keydown", function(e)
{
if (e.keyCode === KeyboardKeys.Space)
{
this.NativeObject.ToggleChecked();
e.preventDefault();
e.stopPropagation();
return false;
}
});
var fa = document.createElement("i");
fa.className = "fa fa-check";
child.appendChild(fa);
parentElement.style.display = "none";
parentElement.parentNode.insertBefore(child, parentElement);
this.NewParentElement = child;
parentElement.NativeObject = this;
parentElement.NativeObject.__inhibit_update = false;
parentElement.addEventListener("change", function(e)
{
if (!this.NativeObject.__inhibit_update)
{
this.NativeObject.__inhibit_update = true;
this.NativeObject.SetChecked(this.checked);
this.NativeObject.__inhibit_update = false;
}
/*
if (this.hasAttribute("checked"))
{
System.ClassList.Add(this.NativeObject.ParentElement, "uwt-checked");
}
else
{
System.ClassList.Remove(this.NativeObject.ParentElement, "uwt-checked");
}
*/
});
this.SetChecked(parentElement.checked);
}
function RadioButton(parentElement)
{
this.ParentElement = parentElement;
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByTagName("input");
for (var i = 0; i < items.length; i++)
{
if (items[i].attributes["type"] != null)
{
switch (items[i].attributes["type"].value)
{
case "checkbox":
{
items[i].NativeObject = new CheckBox(items[i]);
break;
}
case "radio":
{
items[i].NativeObject = new RadioButton(items[i]);
break;
}
}
}
}
});

View File

@ -0,0 +1,14 @@
window.addEventListener("load", function(e)
{
var CodeEditors = document.getElementsByTagName("textarea");
for(var i = 0; i < CodeEditors.length; i++)
{
if (CodeEditors[i].className == "CodeEditor")
{
CodeEditors[i].NativeEditor = CodeMirror.fromTextArea(CodeEditors[i],
{
mode: CodeEditors[i].attributes["data-mode"].value
});
}
}
});

View File

@ -0,0 +1,82 @@
function CommandBarItem(parentElement)
{
this.ParentElement = parentElement;
parentElement.addEventListener("click", function(e)
{
parentElement.className = "CommandBarItem Selected";
e.preventDefault();
e.stopPropagation();
return false;
});
parentElement.addEventListener("mousemove", function(e)
{
var selected = false;
for (var i = 0; i < parentElement.parentNode.childNodes.length; i++)
{
if (parentElement.parentNode.childNodes[i].className == "CommandBarItem Selected")
{
selected = true;
break;
}
}
if (selected)
{
for (var i = 0; i < parentElement.parentNode.childNodes.length; i++)
{
parentElement.parentNode.childNodes[i].className = "CommandBarItem";
}
parentElement.className = "CommandBarItem Selected";
}
});
}
function CommandBar(parentElement)
{
this.ParentElement = parentElement;
var items = parentElement.childNodes;
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new CommandBarItem(items[i]);
}
}
function CommandBarContainer(parentElement)
{
this.ParentElement = parentElement;
var items = parentElement.childNodes;
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new CommandBar(items[i]);
}
parentElement.addEventListener("contextmenu", function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
});
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("CommandBarContainer");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new CommandBarContainer(items[i]);
}
});
window.addEventListener("click", function(e)
{
var items = document.getElementsByClassName("CommandBarContainer");
for (var i = 0; i < items.length; i++)
{
var items1 = items[i].childNodes;
for (var j = 0; j < items1.length; j++)
{
var items2 = items1[j].childNodes;
for (var k = 0; k < items2.length; k++)
{
items2[k].className = "CommandBarItem";
}
}
}
});

View File

@ -0,0 +1,171 @@
function Countdown(parentElement)
{
this.ParentElement = parentElement;
this.ParentElement.addEventListener("contextmenu", function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
});
this.mvarTargetYear = parentElement.getAttribute("data-target-year");
this.get_TargetYear = function() { return this.mvarTargetYear; };
this.set_TargetYear = function(value) { this.mvarTargetYear = value; };
this.mvarTargetMonth = parentElement.getAttribute("data-target-month");
this.get_TargetMonth = function() { return this.mvarTargetMonth; };
this.set_TargetMonth = function(value) { this.mvarTargetMonth = value; };
this.mvarTargetDay = parentElement.getAttribute("data-target-day");
this.get_TargetDay = function() { return this.mvarTargetDay; };
this.set_TargetDay = function(value) { this.mvarTargetDay = value; };
this.mvarTargetHour = parentElement.getAttribute("data-target-hour");
this.get_TargetHour = function() { return this.mvarTargetHour; };
this.set_TargetHour = function(value) { this.mvarTargetHour = value; };
this.mvarTargetMinute = parentElement.getAttribute("data-target-minute");
this.get_TargetMinute = function() { return this.mvarTargetMinute; };
this.set_TargetMinute = function(value) { this.mvarTargetMinute = value; };
this.mvarTargetSecond = parentElement.getAttribute("data-target-second");
this.get_TargetSecond = function() { return this.mvarTargetSecond; };
this.set_TargetSecond = function(value) { this.mvarTargetSecond = value; };
this.get_Year = function()
{
return parseInt(this.ParentElement.children[0].children[0].innerHTML);
};
this.set_Year = function(value)
{
this.ParentElement.children[0].children[0].innerHTML = value.toString();
};
this.get_Month = function()
{
return parseInt(this.ParentElement.children[1].children[0].innerHTML);
};
this.set_Month = function(value)
{
this.ParentElement.children[1].children[0].innerHTML = value.toString();
};
this.get_Day = function()
{
return parseInt(this.ParentElement.children[2].children[0].innerHTML);
};
this.set_Day = function(value)
{
this.ParentElement.children[2].children[0].innerHTML = value.toString();
};
this.get_Hour = function()
{
return parseInt(this.ParentElement.children[3].children[0].innerHTML);
};
this.set_Hour = function(value)
{
this.ParentElement.children[3].children[0].innerHTML = value.toString();
};
this.get_Minute = function()
{
return parseInt(this.ParentElement.children[4].children[0].innerHTML);
};
this.set_Minute = function(value)
{
this.ParentElement.children[4].children[0].innerHTML = value.toString();
};
this.get_Second = function()
{
return parseInt(this.ParentElement.children[5].children[0].innerHTML);
};
this.set_Second = function(value)
{
this.ParentElement.children[5].children[0].innerHTML = value.toString();
};
var thiss = this;
this._timer = null;
this._timer_Tick = function()
{
if (thiss.get_Second() == 0)
{
if (thiss.get_Minute() == 0)
{
if (thiss.get_Hour() == 0)
{
if (thiss.get_Day() == 0)
{
if (thiss.get_Month() == 0)
{
if (thiss.get_Year() == 0)
{
// everything is 0 so we can stop
thiss.Stop();
return;
}
else
{
thiss.set_Year(thiss.get_Year() - 1);
}
}
else
{
thiss.set_Month(thiss.get_Month() - 1);
}
// TODO: figure out how many days are left for this month... probably using target date
thiss.set_Day(31);
}
else
{
thiss.set_Day(thiss.get_Day() - 1);
}
thiss.set_Hour(23);
}
else
{
thiss.set_Hour(thiss.get_Hour() - 1);
}
thiss.set_Minute(59);
}
else
{
thiss.set_Minute(thiss.get_Minute() - 1);
}
thiss.set_Second(59);
}
else
{
thiss.set_Second(thiss.get_Second() - 1);
}
thiss._timer = window.setTimeout(thiss._timer_Tick, 1000);
};
this.Stop = function()
{
if (this._timer == null) return;
window.clearTimeout(this._timer);
};
this.Start = function()
{
this._timer = window.setTimeout(this._timer_Tick, 1000);
};
var date = new Date();
var targetDate = new Date(this.get_TargetYear(), this.get_TargetMonth(), this.get_TargetDay(), this.get_TargetHour(), this.get_TargetMinute(), this.get_TargetSecond());
this.set_Year(targetDate.getFullYear() - date.getFullYear());
this.set_Month((targetDate.getMonth() - date.getMonth()) + 1);
this.set_Day(targetDate.getDate() - date.getDate());
this.set_Hour(date.getHours() - targetDate.getHours());
this.set_Minute(date.getMinutes() - targetDate.getMinutes());
this.set_Second(date.getSeconds() - targetDate.getSeconds());
this.Start();
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("Countdown");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new Countdown(items[i]);
}
});

View File

@ -0,0 +1,41 @@
function Disclosure(parentElement)
{
this.ParentElement = parentElement;
this.TitleElement = this.ParentElement.children[0];
this.TitleElement.NativeObject = this;
this.TitleElement.addEventListener("click", function(e)
{
this.NativeObject.toggleExpanded();
e.preventDefault();
e.stopPropagation();
return false;
});
this.getExpanded = function()
{
return System.ClassList.Contains(this.ParentElement, "uwt-expanded");
};
this.setExpanded = function(value)
{
if (value)
{
System.ClassList.Add(this.ParentElement, "uwt-expanded");
}
else
{
System.ClassList.Remove(this.ParentElement, "uwt-expanded");
}
};
this.toggleExpanded = function()
{
this.setExpanded(!this.getExpanded());
};
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("uwt-disclosure");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new Disclosure(items[i]);
}
});

View File

@ -0,0 +1,440 @@
function DropDownWrapper(parentElement)
{
this.ParentElement = parentElement;
this.ParentContainer = this.ParentElement.parentElement;
this.SelectElement = this.ParentElement;
this.ShowPopupMenu = function()
{
for (var i = 0; i < this.SelectElement.options.length; i++)
{
if (this.InputElement.value == "" || this.SelectElement.options[i].label.toLowerCase().indexOf(this.InputElement.value.toLowerCase()) != -1)
{
System.ClassList.Add(this.SelectElement.options[i].li, "uwt-visible");
}
else
{
System.ClassList.Remove(this.SelectElement.options[i].li, "uwt-visible");
}
}
System.ClassList.Add(this.MenuElement, "uwt-visible");
};
this.HidePopupMenu = function()
{
System.ClassList.Remove(this.MenuElement, "uwt-visible");
};
var div = document.createElement("div");
div.className = "uwt-combobox";
div.ni = this;
div.tabIndex = 0;
this.ParentElement.replaceWith(div);
div.appendChild(this.SelectElement);
var input = document.createElement("input");
input.id = this.SelectElement.id + "_input";
input.ni = this;
input.type = "text";
input.addEventListener("focus", function()
{
this.ni.InputElement._prev_value = this.ni.InputElement.value;
this.ni.InputElement.value = "";
this.ni.ShowPopupMenu();
});
input.addEventListener("blur", function()
{
this.ni.InputElement.value = this.ni.InputElement._prev_value;
if (!this.ni.SelectElement.hasAttribute("multiple"))
{
this.ni.HidePopupMenu();
}
});
input.addEventListener("keydown", function(e)
{
if (e.keyCode == KeyboardKeys.Enter)
{
this.__accepted = true;
//this.ni.SetValue(this.ni.GetHighlightedOption().value);
this.ni.HidePopupMenu();
this.parentElement.focus();
e.preventDefault();
e.stopPropagation();
return false;
}
});
input.addEventListener("keyup", function(e)
{
if (this.__accepted == true)
{
this.__accepted = false;
e.preventDefault();
e.stopPropagation();
return false;
}
if (e.keyCode == KeyboardKeys.Escape)
{
this.ni.HidePopupMenu();
}
else
{
this.ni.ShowPopupMenu();
}
});
div.appendChild(input);
this.InputElement = input;
var ul = document.createElement("ul");
this.MenuElement = ul;
ul.className = "uwt-menu uwt-popup";
for (var i = 0; i < this.SelectElement.options.length; i++)
{
var li = document.createElement("li");
li.className = "uwt-menu-item uwt-menu-item-command uwt-visible";
this.SelectElement.options[i].li = li;
var a = document.createElement("a");
a.href = "#";
var spanTitle = document.createElement("span");
spanTitle.className = "uwt-title";
spanTitle.innerHTML = this.SelectElement.options[i].label;
a.appendChild(spanTitle);
var spanDescription = document.createElement("span");
spanDescription.className = "uwt-description";
spanDescription.innerHTML = "";
a.appendChild(spanDescription);
if (this.SelectElement.options[i].hasAttribute("data-description"))
{
spanDescription.innerHTML = this.SelectElement.options[i].getAttribute("data-description");
}
a.option = this.SelectElement.options[i];
a.ni = this;
a.addEventListener("click", function()
{
this.ni.InputElement.value = this.option.label;
if (this.ni.SelectElement.hasAttribute("multiple"))
{
}
else
{
this.ni.SelectElement.value = this.option.value;
for (var j = 0; j < this.ni.MenuElement.children.length; j++)
{
if (this.ni.MenuElement.children[j].children[0] == this)
{
System.ClassList.Add(this.ni.MenuElement.children[j], "uwt-selected");
}
else
{
System.ClassList.Remove(this.ni.MenuElement.children[j], "uwt-selected");
}
}
System.ClassList.Remove(this.ni.MenuElement, "uwt-visible");
}
});
li.appendChild(a);
if (i == this.SelectElement.selectedIndex)
{
this.InputElement.value = a.option.label;
System.ClassList.Add(li, "uwt-selected");
}
ul.appendChild(li);
}
div.appendChild(ul);
this.ParentElement.style.display = "none";
}
function DropDown(id)
{
this.ID = id;
this.IsOpen = false;
var Container = document.getElementById("DropDown_" + id);
Container.Parent = this;
if (Container.className == "DropDown SelectionRequired")
{
Container.onmousedown = function(e)
{
if (e.button == 0)
{
// open the dropdown
if (this.Parent.IsOpen)
{
this.Parent.Close();
}
else
{
this.Parent.Open();
}
}
e.preventDefault();
e.stopPropagation();
};
Container.onmouseup = function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
};
Container.oncontextmenu = function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
};
}
var Button = document.getElementById("DropDown_" + id + "_Button");
Button.Parent = this;
Button.onmousedown = function(e)
{
if (e.button == 0)
{
// open the dropdown
if (this.Parent.IsOpen)
{
this.Parent.Close();
}
else
{
this.Parent.Open();
}
}
e.preventDefault();
e.stopPropagation();
};
Button.onmouseup = function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
};
var ItemList_Items = document.getElementById("DropDown_" + id + "_ItemList_Items");
ItemList_Items.Parent = this;
ItemList_Items.onmousedown = function(e)
{
e.preventDefault();
e.stopPropagation();
};
ItemList_Items.oncontextmenu = function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
};
var Search = document.getElementById("DropDown_" + id + "_ItemList_Search");
Search.onmousedown = function(e)
{
// e.preventDefault();
e.stopPropagation();
};
this.Select = function(index)
{
// Selects the item with the specified index.
var dd_Text = document.getElementById("DropDown_" + this.ID + "_Text");
var dd_Input = document.getElementById("DropDown_" + this.ID + "_Input");
var menuItemsContainer = document.getElementById("DropDown_" + this.ID + "_ItemList_Items");
var menuItems = menuItemsContainer.getElementsByTagName("A");
var menuItem = menuItems[index];
if (dd_Text)
{
dd_Text.innerHTML = menuItem.innerHTML;
}
else if (dd_Input)
{
dd_Input.value = menuItem.innerHTML;
dd_Input.focus();
dd_Input.select();
}
};
this.Open = function()
{
DropDown.CloseAll();
var dd = document.getElementById("DropDown_" + this.ID);
var dd_Button = document.getElementById("DropDown_" + this.ID + "_Button");
var dd_DropDown = document.getElementById("DropDown_" + this.ID + "_ItemList");
var dd_ItemList_Search = document.getElementById("DropDown_" + this.ID + "_ItemList_Search");
var dd_Text = document.getElementById("DropDown_" + this.ID + "_Text");
var dd_Input = document.getElementById("DropDown_" + this.ID + "_Input");
if (dd.className == "DropDown SelectionRequired")
{
dd.className = "DropDown SelectionRequired Opened";
}
else if (dd.className == "DropDown")
{
dd.className = "DropDown Opened";
}
dd_DropDown.style.width = dd.offsetWidth + "px";
dd_Button.className = "Button Pressed";
dd_ItemList_Search.focus();
dd_ItemList_Search.value = "";
this.UpdateFilter();
dd_DropDown.style.display = "block";
this.IsOpen = true;
if (dd_Input) dd_Input.select();
/*
if (dd_Input)
{
dd_ItemList_Search.value = dd_Input.value;
}
else if (dd_Text)
{
dd_ItemList_Search.value = dd_Text.innerHTML;
}
dd_ItemList_Search.select();
*/
};
this.Close = function()
{
var dd = document.getElementById("DropDown_" + this.ID);
var dd_Button = document.getElementById("DropDown_" + this.ID + "_Button");
var dd_DropDown = document.getElementById("DropDown_" + this.ID + "_ItemList");
if (dd.className == "DropDown SelectionRequired Opened")
{
dd.className = "DropDown SelectionRequired";
}
else if (dd.className == "DropDown Opened")
{
dd.className = "DropDown";
}
dd_DropDown.style.width = dd.offsetWidth;
dd_Button.className = "Button";
dd_DropDown.style.display = "none";
this.IsOpen = false;
};
// go through and initialize all of the links in the menu items, for menu items that are already created
var menuItemsContainer = document.getElementById("DropDown_" + this.ID + "_ItemList_Items");
var menuItems = menuItemsContainer.getElementsByTagName("A");
for (var i = 0; i < menuItems.length; i++)
{
menuItems[i].Index = i;
menuItems[i].Parent = this;
menuItems[i].onmousedown = function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
};
menuItems[i].onmouseup = function(e)
{
if (e.button == 0)
{
this.Parent.Select(this.Index);
this.Parent.Close();
}
e.preventDefault();
e.stopPropagation();
return false;
};
menuItems[i].oncontextmenu = function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
};
}
this.UpdateFilter = function()
{
var dd_Search = document.getElementById("DropDown_" + this.ID + "_ItemList_Search");
// filter the text in the text box
var menuItemsContainer = document.getElementById("DropDown_" + this.ID + "_ItemList_Items");
var menuItems = menuItemsContainer.getElementsByTagName("A");
for (var i = 0; i < menuItems.length; i++)
{
if (dd_Search.value == "" || menuItems[i].innerHTML.toLowerCase().indexOf(dd_Search.value.toLowerCase()) != -1)
{
menuItems[i].style.display = "block";
}
else
{
menuItems[i].style.display = "none";
}
}
};
// set up the search text box
var dd_Search = document.getElementById("DropDown_" + this.ID + "_ItemList_Search");
dd_Search.Parent = this;
dd_Search.onkeyup = function()
{
this.Parent.UpdateFilter();
};
}
DropDown.CloseAll = function()
{
var dropdowns = document.getElementsByClassName("DropDown");
for (var i = 0; i < dropdowns.length; i++)
{
dropdowns[i].Parent.Close();
}
};
// add a global hook to close all the dropdown lists when the mouse button is pressed
document.addEventListener("mousedown", function(e)
{
DropDown.CloseAll();
});
window.addEventListener("load", function(e)
{
/*
// find DropDownButtons to trigger
var dropdowns = document.getElementsByClassName("DropDownButton");
for (var i = 0; i < dropdowns.length; i++)
{
(function(index)
{
dropdowns[index].addEventListener("mousedown", function(ee)
{
if (dropdowns[index].className == "DropDownButton")
{
dropdowns[index].className = "DropDownButton Opened";
}
else if (dropdowns[index].className == "DropDownButton Opened")
{
dropdowns[index].className = "DropDownButton";
}
});
})(i);
}
*/
// retrofit SELECT elements
var selects = document.getElementsByTagName("SELECT");
for (var i = 0; i < selects.length; i++)
{
selects[i].NativeObject = new DropDownWrapper(selects[i]);
}
});

View File

@ -0,0 +1,54 @@
function FlyoutTabContainer(id)
{
this.ID = id;
this.ToggleItem = function(itemID)
{
var tab = document.getElementById("FlyoutTabContainer_" + this.ID + "_" + itemID + "_Tab");
var content = document.getElementById("FlyoutTabContainer_" + this.ID + "_" + itemID + "_Content");
if (tab == null)
{
console.log("FlyoutTabContainer: nonexistent tab '" + itemID + "' on container '" + this.ID + "'");
return;
}
if (content == null)
{
console.log("FlyoutTabContainer: nonexistent content '" + itemID + "' on container '" + this.ID + "'");
return;
}
var parent = tab.parentNode;
if (tab.className == "FlyoutTab Active")
{
tab.className = "FlyoutTab";
}
else
{
for (var i = 0; i < parent.childNodes.length; i++)
{
if (parent.childNodes[i].className == "FlyoutTab Active" && parent.childNodes[i] != tab);
{
parent.childNodes[i].className = "FlyoutTab";
}
}
tab.className = "FlyoutTab Active";
}
parent = content.parentNode;
if (content.className == "FlyoutTabContent Active")
{
content.className = "FlyoutTabContent";
}
else
{
for (var i = 0; i < parent.childNodes.length; i++)
{
if (parent.childNodes[i].className == "FlyoutTabContent Active" && parent.childNodes[i] != content);
{
parent.childNodes[i].className = "FlyoutTabContent";
}
}
content.className = "FlyoutTabContent Active";
}
};
}

View File

@ -0,0 +1,5 @@
function LinkButton(id)
{
this.ID = id;
this.PopupMenu = new Popup(id + "_menu");
}

View File

@ -0,0 +1,643 @@
var ListViewMode =
{
"Detail": 1,
"Tile": 2
};
function ListViewItemActivationMode(value)
{
this._value = value;
}
ListViewItemActivationMode.SingleClick = new ListViewItemActivationMode(1);
ListViewItemActivationMode.DoubleClick = new ListViewItemActivationMode(2);
function ListViewColumnResizer(parentElement)
{
this.ParentElement = parentElement;
for (var i = 0; i < this.ParentElement.parentNode.children.length; i++)
{
if (this.ParentElement.parentNode.children[i] == this.ParentElement)
{
this.ParentElement.parentNode.children[i].index = i;
break;
}
}
this.ParentElement.addEventListener("mousedown", function(e)
{
ListViewColumnResizer._moving = true;
this._prevX = e.clientX;
this._prevWidth = this.parentNode.children[this.index - 1].clientWidth;
ListViewColumnResizer._current = this;
// document.body.style.cursor = "ew-resize";
e.preventDefault();
});
}
ListViewColumnResizer._moving = false;
ListViewColumnResizer._current = null;
window.addEventListener("mousemove", function(e)
{
if (ListViewColumnResizer._moving)
{
var lvcr = ListViewColumnResizer._current;
var w = lvcr._prevWidth + (e.clientX - lvcr._prevX);
lvcr.parentNode.children[lvcr.index - 1].style.width = w.toString() + "px";
}
});
window.addEventListener("mouseup", function(e)
{
ListViewColumnResizer._moving = false;
});
function ListViewItemColumn(parentItem)
{
this.mvarParentItem = parentItem;
this.get_ParentItem = function()
{
return this.mvarParentItem;
};
this.get_Value = function()
{
};
}
function ListViewItem(parentListView, index)
{
this.mvarParentListView = parentListView;
this.get_ParentListView = function()
{
return this.mvarParentListView;
};
this.mvarParentElement = parentListView.ItemsElement.children[index];
this.mvarParentElement.addEventListener("mousedown", function(e)
{
if (e.buttons == 1 || !System.ClassList.Contains(this, "uwt-selected"))
{
if (!e.ctrlKey)
{
for (var i = 0; i < this.parentElement.children.length; i++)
{
System.ClassList.Remove(this.parentElement.children[i], "uwt-selected");
}
}
System.ClassList.Add(this, "uwt-selected");
}
});
this.mvarIndex = index;
this.get_Index = function()
{
return this.mvarIndex;
};
this.get_ParentElement = function()
{
return this.get_ParentListView().ItemsElement.children[this.get_Index()];
};
this.get_Value = function()
{
return this.get_ParentElement().getAttribute("data-value");
};
}
function ListViewColumn()
{
this.Title = null;
this.ItemTemplate = null;
}
function ListView(parentElement)
{
this.ParentElement = parentElement;
this.ContentElement = this.ParentElement.children[1];
this.ColumnHeaderElement = this.ContentElement.children[0];
//this.EmptyMessageElement = this.ContentElement.children[1];
this.ItemsElement = this.ContentElement.children[1];
for (var i = 0; i < this.ItemsElement.children.length; i++)
{
this.ItemsElement.children[i].NativeObject = new ListViewItem(this, i);
}
/*
this.AddRemoveColumnHeaderElement = this.ColumnHeaderElement.children[0];
this.AddRemoveColumnHeaderAddColumnButton = this.AddRemoveColumnHeaderElement.children[0];
this.AddRemoveColumnHeaderAddColumnButton.NativeObject = this;
this.AddRemoveColumnHeaderAddColumnButton.addEventListener("click", function(e)
{
this.NativeObject.InsertRowAfter(-1);
});
*/
/**
* Inserts a row after the row at the specified index.
*/
this.InsertRowAfter = function(index)
{
var rw = document.createElement("div");
rw.className = "ListViewItem";
var col = document.createElement("div");
col.className = "ListViewItemColumn AddRemoveRowItemColumn";
var aAdd = document.createElement("a");
aAdd.className = "Add";
col.appendChild(aAdd);
var aRemove = document.createElement("a");
aRemove.className = "Remove";
col.appendChild(aRemove);
rw.appendChild(col);
for (var i = 0; i < this.Columns.Count(); i++)
{
var column = this.Columns.GetByIndex(i);
var col = document.createElement("div");
col.className = "ListViewItemColumn";
col.innerHTML = column.ItemTemplate;
if (col.children.length > 0)
{
col.children[0].id = "ListView_" + this.ParentElement.id + "_Rows_" + this.ItemsElement.children.length + "_Columns_" + column.ID + "_Value";
}
rw.appendChild(col);
}
if ((index + 1) > this.ItemsElement.children.length)
{
this.ItemsElement.appendChild(rw);
}
else
{
this.ItemsElement.insertBefore(rw, this.ItemsElement.children[index + 1]);
}
this.Refresh();
};
this.Refresh = function()
{
if (this.Rows.Count() > 0)
{
System.ClassList.Remove(this.ParentElement, "Empty");
}
else
{
System.ClassList.Add(this.ParentElement, "Empty");
}
for (var i = 0; i < this.ColumnHeaderElement.children.length; i++)
{
if (this.ColumnHeaderElement.children[i].className == "ColumnResizer")
{
this.ColumnHeaderElement.children[i].NativeObject = new ListViewColumnResizer(this.ColumnHeaderElement.children[i]);
}
}
for (var i = 0; i < this.ItemsElement.children.length; i++)
{
var row = this.ItemsElement.children[i];
row.m_Index = i;
/*
var AddRemoveRowItemColumnElement = row.children[0];
var AddRowButton = AddRemoveRowItemColumnElement.children[0];
if (AddRowButton)
{
AddRowButton.m_Index = i;
}
var RemoveRowButton = AddRemoveRowItemColumnElement.children[1];
if (RemoveRowButton)
{
RemoveRowButton.m_Index = i;
}
*/
// if it has already been processed, skip it
if (row.NativeObject) continue;
row.NativeObject = this;
/*
if (AddRowButton)
{
AddRowButton.NativeObject = this;
AddRowButton.addEventListener("click", function(e)
{
this.NativeObject.InsertRowAfter(this.m_Index);
});
}
if (RemoveRowButton)
{
RemoveRowButton.NativeObject = this;
RemoveRowButton.addEventListener("click", function(e)
{
this.NativeObject.Rows.RemoveAt(this.m_Index);
});
}
*/
row.addEventListener("mousedown", function(e)
{
if (e.ctrlKey && System.ClassList.Contains(this.NativeObject.ParentElement, "MultiSelect"))
{
this.NativeObject.SelectedRows.Toggle(this.m_Index);
}
else if (e.shiftKey && System.ClassList.Contains(this.NativeObject.ParentElement, "MultiSelect"))
{
}
else
{
if (!(this.NativeObject.SelectedRows.Count() == 1 && this.NativeObject.SelectedRows.ContainsIndex(this.m_Index)))
{
this.NativeObject.SelectedRows.Clear();
this.NativeObject.SelectedRows.Add(this.m_Index);
}
}
// WARNING: this messes with input elements and other controls - don't uncomment unless you KNOW WHAT YOU'RE DOING
// e.preventDefault();
e.stopPropagation();
return false;
});
row.addEventListener("dblclick", function(e)
{
if (this.NativeObject.get_ItemActivationMode() == ListViewItemActivationMode.DoubleClick)
{
this.NativeObject.EventHandlers.ItemActivated.Execute();
}
});
row.addEventListener("contextmenu", function(e)
{
this.NativeObject.SelectedRows.Clear();
this.NativeObject.SelectedRows.Add(this.m_Index);
// e.preventDefault();
e.stopPropagation();
return false;
});
}
};
this.mvarItemActivationMode = ListViewItemActivationMode.DoubleClick;
this.get_ItemActivationMode = function()
{
return this.mvarItemActivationMode;
};
this.set_ItemActivationMode = function(value)
{
this.mvarItemActivationMode = value;
};
if (this.ParentElement.hasAttribute("data-item-activation-mode"))
{
switch (this.ParentElement.getAttribute("data-item-activation-mode").toLowerCase())
{
case "singleclick":
{
this.set_ItemActivationMode(ListViewItemActivationMode.SingleClick);
break;
}
case "doubleclick":
{
this.set_ItemActivationMode(ListViewItemActivationMode.DoubleClick);
break;
}
}
}
this.EventHandlers =
{
"ItemActivated": new System.EventHandler(),
"SelectionChanging": new System.EventHandler(),
"SelectionChanged": new System.EventHandler()
};
this.Columns =
{
"NativeObject": null,
// # of predefined columns; e.g. add/remove column, row ordering column, etc.
"_predefinedColumnsCount": 1,
"Count": function()
{
return this.NativeObject.ColumnHeaderElement.children.length - this._predefinedColumnsCount;
},
"GetByIndex": function(index)
{
var col = this.NativeObject.ColumnHeaderElement.children[index + this._predefinedColumnsCount];
var column = new ListViewColumn();
column.ID = col.getAttribute("data-id");
column.Title = col.children[0].innerHTML;
column.ItemTemplate = col.children[1].innerHTML;
return column;
}
};
this.Columns.NativeObject = this;
this.Rows =
{
"NativeObject": null,
"Count": function()
{
return this.NativeObject.ItemsElement.children.length;
},
"Remove": function(row)
{
this.NativeObject.ItemsElement.removeChild(row.ParentElement);
},
"RemoveAt": function(index)
{
this.NativeObject.ItemsElement.removeChild(this.NativeObject.ItemsElement.children[index]);
this.NativeObject.Refresh();
}
};
this.Rows.NativeObject = this;
this.SelectedRows =
{
"NativeObject": null,
"Clear": function()
{
var changed = false;
for (var i = 0; i < this.NativeObject.ItemsElement.children.length; i++)
{
if (System.ClassList.Contains(this.NativeObject.ItemsElement.children[i], "Selected"))
{
changed = true;
break;
}
}
if (!changed) return;
this.NativeObject.EventHandlers.SelectionChanging.Execute();
for (var i = 0; i < this.NativeObject.ItemsElement.children.length; i++)
{
System.ClassList.Remove(this.NativeObject.ItemsElement.children[i], "Selected");
}
this.NativeObject.EventHandlers.SelectionChanged.Execute();
},
"AddRange": function(indices)
{
var changed = false;
for (var i = 0; i < indices.length; i++)
{
if (!System.ClassList.Contains(this.NativeObject.ItemsElement.children[indices[i]], "Selected"))
{
changed = true;
break;
}
}
if (!changed) return;
this.NativeObject.EventHandlers.SelectionChanging.Execute();
for (var i = 0; i < indices.length; i++)
{
System.ClassList.Add(this.NativeObject.ItemsElement.children[indices[i]], "Selected");
}
this.NativeObject.EventHandlers.SelectionChanged.Execute();
},
"RemoveRange": function(indices)
{
var changed = false;
for (var i = 0; i < indices.length; i++)
{
if (System.ClassList.Contains(this.NativeObject.ItemsElement.children[indices[i]], "Selected"))
{
changed = true;
break;
}
}
if (!changed) return;
this.NativeObject.EventHandlers.SelectionChanging.Execute();
for (var i = 0; i < indices.length; i++)
{
System.ClassList.Remove(this.NativeObject.ItemsElement.children[indices[i]], "Selected");
}
this.NativeObject.EventHandlers.SelectionChanged.Execute();
},
"Add": function(index)
{
this.AddRange([index]);
},
"Remove": function(index)
{
this.RemoveRange([index]);
},
"Count": function()
{
return this.Get().length;
},
"Get": function()
{
var items = new Array();
for (var i = 0; i < this.NativeObject.ItemsElement.children.length; i++)
{
if (System.ClassList.Contains(this.NativeObject.ItemsElement.children[i], "Selected"))
{
items.push(new ListViewItem(this, i));
}
}
return items;
},
"ContainsIndex": function(index)
{
return System.ClassList.Contains(this.NativeObject.ItemsElement.children[index], "Selected");
},
"Toggle": function(index)
{
if (this.ContainsIndex(index))
{
this.Remove(index);
}
else
{
this.Add(index);
}
},
"ToggleRange": function(indices)
{
for (var i = 0; i < indices.length; i++)
{
this.Toggle(indices[i]);
}
}
};
this.SelectedRows.NativeObject = this;
/*
if (parentElement.tHead != null && parentElement.tHead.rows[0] != null)
{
// begin : magic - do not even begin to attempt to understand this logic
for (var i = 0; i < parentElement.tHead.rows[0].cells.length; i++)
{
if (parentElement.tHead.rows[0].cells[i].childNodes[0].className == "uwt-checkbox")
{
(function(i)
{
parentElement.tHead.rows[0].cells[i].childNodes[1].addEventListener("change", function(e)
{
for (var j = 0; j < parentElement.tBodies[0].rows.length; j++)
{
parentElement.tBodies[0].rows[j].cells[i].childNodes[0].NativeObject.SetChecked(parentElement.tHead.rows[0].cells[i].childNodes[0].NativeObject.GetChecked());
}
});
})(i);
}
}
// end : magic
}
*/
this.ParentElement.addEventListener("mousedown", function(e)
{
this.NativeObject.SelectedRows.Clear();
// e.preventDefault();
// e.stopPropagation();
return false;
});
this.Refresh();
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("uwt-listview");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new ListView(items[i]);
}
});
ListView.create = function(container, createParms)
{
/*
var table = document.createElement("table");
table.className = "uwt-listview";
if (createParms.columns)
{
var thead = document.createElement("thead");
var tr = document.createElement("tr");
for (var i = 0; i < createParms.columns.length; i++)
{
var td = document.createElement("td");
var a = document.createElement("a");
a.href = "#";
a.innerHTML = createParms.columns[i].title;
td.appendChild(a);
// createParms.columns[i].id;
tr.appendChild(td);
}
thead.appendChild(tr);
table.appendChild(thead);
}
if (createParms.items)
{
var tbody = document.createElement("tbody");
for (var i = 0; i < createParms.items.length; i++)
{
var tr = document.createElement("tr");
for (var j = 0; j < createParms.items[i].columns.length; j++)
{
var td = document.createElement("td");
var value = createParms.items[i].columns[j].value;
if (typeof(value) === "function")
{
value = value();
}
else
{
td.innerHTML = value;
}
tr.appendChild(td);
}
tbody.appendChild(tr);
}
table.appendChild(tbody);
}
container.appendChild(table);
*/
var table = document.createElement("div");
table.className = "uwt-listview";
var caption = document.createElement("div");
caption.className = "uwt-listview-caption";
table.appendChild(caption);
var content = document.createElement("div");
content.className = "uwt-content";
var columnHeaders = document.createElement("div");
columnHeaders.className = "uwt-listview-column-headers";
if (createParms.columns)
{
for (var i = 0; i < createParms.columns.length; i++)
{
var td = document.createElement("div");
td.className = "uwt-listview-column-header";
var a = document.createElement("a");
a.href = "#";
a.innerHTML = createParms.columns[i].title;
td.appendChild(a);
// createParms.columns[i].id;
columnHeaders.appendChild(td);
}
}
content.appendChild(columnHeaders);
var columnItems = document.createElement("div");
columnItems.className = "uwt-listview-items";
if (createParms.items)
{
for (var i = 0; i < createParms.items.length; i++)
{
var tr = document.createElement("div");
tr.className = "uwt-listview-item";
for (var j = 0; j < createParms.items[i].columns.length; j++)
{
var td = document.createElement("div");
td.className = "uwt-listview-item-column";
var value = createParms.items[i].columns[j].value;
if (typeof(value) === "function")
{
value = value();
}
else
{
td.innerHTML = value;
}
tr.appendChild(td);
}
// createParms.columns[i].id;
columnItems.appendChild(tr);
}
}
content.appendChild(columnItems);
table.appendChild(content);
var listview = new ListView(table);
return listview;
};

View File

@ -0,0 +1,222 @@
function Menu(parentElement)
{
this.ParentElement = parentElement;
this.set_Expanded = function(value)
{
switch (value)
{
case true:
{
System.ClassList.Add(this.ParentElement.parentNode, "Opened");
break;
}
case false:
{
System.ClassList.Remove(this.ParentElement.parentNode, "Opened");
break;
}
}
};
for (var i = 0; i < this.ParentElement.children.length; i++)
{
this.ParentElement.children[i].children[0].addEventListener("click", function(e)
{
if (this.parentNode.children.length > 1)
{
System.ClassList.Toggle(this.parentNode, "Opened");
}
this.blur();
if (this.href == "" || this.href == window.location.href + "#")
{
e.preventDefault();
e.stopPropagation();
return false;
}
});
}
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("uwt-menu");
for (var i = 0; i < items.length; i++)
{
if (items[i].NativeObject) continue;
items[i].NativeObject = new Menu(items[i]);
}
});
function ContextMenu()
{
this.Items = [];
this.ParentElement = null;
this.Show = function(x, y, parent)
{
ContextMenu.HideAll();
if (this.ParentElement == null)
{
var elem = document.createElement("ul");
elem.className = "uwt-menu uwt-popup";
elem.addEventListener("contextmenu", function(e)
{
e.preventDefault();
e.stopPropagation();
return false;
});
elem.addEventListener("transitionend", function(e)
{
if (!System.ClassList.Contains(this, "uwt-visible"))
{
System.ClassList.Remove(document.body, "uwt-prevent-scrolling");
this.remove();
}
});
for (var i = 0; i < this.Items.length; i++)
{
this.Items[i].Menu = this;
var li = document.createElement("li");
System.ClassList.Add(li, "uwt-menu-item");
var visible = false;
if (typeof(this.Items[i].Visible) === "function")
{
visible = this.Items[i].Visible();
}
else if (typeof(this.Items[i].Visible) === "undefined")
{
visible = false;
}
else
{
visible = this.Items[i].Visible;
}
if (visible)
{
System.ClassList.Add(li, "uwt-visible");
}
else
{
System.ClassList.Remove(li, "uwt-visible");
}
if (this.Items[i].ClassName == "MenuItemCommand")
{
var elem1 = document.createElement("a");
if (this.Items[i].TargetURL)
{
var targetUrl = this.Items[i].TargetURL;
if (typeof(targetUrl) === 'function')
{
targetUrl = targetUrl();
}
elem1.setAttribute("href", targetUrl);
}
else
{
elem1.setAttribute("href", "#");
elem1.addEventListener("click", function(e)
{
this.NativeObject.Hide();
this.MenuItem.Execute();
e.preventDefault();
e.stopPropagation();
return false;
});
}
elem1.innerHTML = this.Items[i].Title;
elem1.NativeObject = this;
elem1.MenuItem = this.Items[i];
li.appendChild(elem1);
System.ClassList.Add(li, "uwt-menu-item-command");
}
else if (this.Items[i].ClassName == "MenuItemSeparator")
{
System.ClassList.Add(li, "uwt-separator");
}
else if (this.Items[i].ClassName == "MenuItemHeader")
{
System.ClassList.Add(li, "uwt-menu-item-header");
li.innerHTML = this.Items[i].Title;
}
elem.appendChild(li);
}
elem.style.left = x + "px";
elem.style.top = y + "px";
if (parent == null) parent = document.body;
parent.appendChild(elem);
this.ParentElement = elem;
System.ClassList.Add(document.body, "uwt-prevent-scrolling");
}
this.ParentElement.className = "uwt-menu uwt-popup";
this.ParentElement.offsetWidth = this.ParentElement.offsetWidth; // thanks https://stackoverflow.com/a/24195559
System.ClassList.Add(this.ParentElement, "uwt-visible");
System.EnsureElementVisible(this.ParentElement, null);
};
this.Hide = function()
{
if (this.ParentElement == null) return;
this.ParentElement.className = "uwt-menu uwt-popup";
};
}
ContextMenu.HideAll = function()
{
var items = document.getElementsByClassName("uwt-menu");
for (var i = 0; i < items.length; i++)
{
if (System.ClassList.Contains(items[i], "uwt-popup"))
{
if (!System.ClassList.Contains(items[i], "uwt-visible-always"))
{
System.ClassList.Remove(items[i], "uwt-visible");
}
}
}
};
function MenuItemHeader(id, title)
{
this.ClassName = "MenuItemHeader";
this.ID = id;
this.Title = title;
this.Visible = true;
}
function MenuItemSeparator(id)
{
this.ClassName = "MenuItemSeparator";
this.ID = id;
this.Visible = true;
}
function MenuItemCommand(id, title, onclick)
{
this.ClassName = "MenuItemCommand";
this.ID = id;
this.Title = title;
this.OnClientClick = onclick;
this.Visible = true;
this.Execute = function()
{
if (this.OnClientClick != null) this.OnClientClick();
};
}
window.addEventListener("contextmenu", function()
{
ContextMenu.HideAll();
});
window.addEventListener("mousedown", function()
{
ContextMenu.HideAll();
});

View File

@ -0,0 +1,219 @@
function MeterDisplayStyle(value)
{
this._value = value;
}
MeterDisplayStyle.None = new MeterDisplayStyle(0);
MeterDisplayStyle.Percent = new MeterDisplayStyle(1);
MeterDisplayStyle.Decimal = new MeterDisplayStyle(2);
function Meter(parentElement)
{
this.ParentElement = parentElement;
this.ContentWrapperElement = this.ParentElement.childNodes[0];
this.ContentElement = this.ContentWrapperElement.childNodes[0];
this.CanvasElement = this.ContentWrapperElement.childNodes[1];
this.LabelElement = this.ParentElement.childNodes[1];
this.get_Title = function()
{
return this.LabelElement.innerHTML;
};
this.set_Title = function(value)
{
this.LabelElement.innerHTML = value;
};
this.get_MinimumValue = function()
{
return this.ParentElement.getAttribute("data-minimum-value");
};
this.set_MinimumValue = function(value)
{
this.ParentElement.setAttribute("data-minimum-value", value);
};
this.get_MaximumValue = function()
{
return this.ParentElement.getAttribute("data-maximum-value");
};
this.set_MaximumValue = function(value)
{
this.ParentElement.setAttribute("data-maximum-value", value);
};
this.get_CurrentValue = function()
{
return this.ParentElement.getAttribute("data-current-value");
};
this.set_CurrentValue = function(value)
{
if (value < this.get_MinimumValue() || value > this.get_MaximumValue()) return false;
this.ParentElement.setAttribute("data-current-value", value);
this.Refresh();
return true;
};
this.get_DisplayStyle = function()
{
var displayStyle = this.ParentElement.getAttribute("data-display-style");
switch (displayStyle.toLowerCase())
{
case "none":
{
return MeterDisplayStyle.None;
}
case "decimal":
{
return MeterDisplayStyle.Decimal;
}
case "percent":
default:
{
return MeterDisplayStyle.Percent;
}
}
};
this.set_DisplayStyle = function(value)
{
switch (value)
{
case MeterDisplayStyle.None:
{
this.ParentElement.setAttribute("data-display-style", "none");
break;
}
case MeterDisplayStyle.Decimal:
{
this.ParentElement.setAttribute("data-display-style", "decimal");
break;
}
case MeterDisplayStyle.Percent:
{
this.ParentElement.setAttribute("data-display-style", "percent");
break;
}
}
this.Refresh();
};
this.ParentElement.addEventListener("contextmenu", function(e)
{
var contextMenu = new ContextMenu();
contextMenu.Items =
[
new MenuItemHeader(null, "Meter - " + this.NativeObject.get_Title()),
new MenuItemCommand(null, "Decimal", null),
new MenuItemCommand(null, "Percent", null)
];
if (this.NativeObject.ParentElement.hasAttribute("data-enable-default-contextmenu") && this.NativeObject.ParentElement.getAttribute("data-enable-default-contextmenu") == "true")
{
contextMenu.Show(e.clientX, e.clientY);
}
e.preventDefault();
e.stopPropagation();
return false;
});
this.Refresh = function()
{
var canvas = this.CanvasElement;
canvas.height = canvas.width;
var scaleBy = 1;
var context = canvas.getContext('2d');
// support retina devices
if (window.devicePixelRatio > 1)
{
scaleBy = window.devicePixelRatio;
// canvas.style.width = canvas.style.height = [options.size, 'px'].join('');
// canvas.width = canvas.height = options.size * scaleBy;
context.scale(scaleBy, scaleBy);
}
// canvas center point
var centerX = canvas.width / 2;
var centerY = canvas.height / 2;
// radius of arc
var lineWidth = 16;
var radius = (canvas.width - lineWidth) / 2;
radius -= 2;
// 0% = 0.0, 100% = 2.0
var minimumValue = this.ParentElement.getAttribute("data-minimum-value");
var maximumValue = this.ParentElement.getAttribute("data-maximum-value");
var currentValue = this.ParentElement.getAttribute("data-current-value");
var decimalValue = ((minimumValue + currentValue) / (maximumValue - minimumValue));
if ((maximumValue - minimumValue) <= 0) decimalValue = 0;
var percentValue = (decimalValue * 100).toString() + "%";
switch (this.get_DisplayStyle())
{
case MeterDisplayStyle.None:
{
this.ContentElement.innerHTML = "";
break;
}
case MeterDisplayStyle.Decimal:
{
this.ContentElement.innerHTML = decimalValue * (maximumValue - minimumValue);
break;
}
case MeterDisplayStyle.Percent:
default:
{
this.ContentElement.innerHTML = percentValue;
break;
}
}
context.translate(centerX, centerY);
context.rotate((-1 / 2 + 0 / 180) * Math.PI);
context.beginPath();
context.lineWidth = lineWidth;
context.arc(0, 0, radius, 0, Math.PI * 2 * decimalValue, false);
if (this.ParentElement.hasAttribute("data-foreground-color"))
{
context.strokeStyle = this.ParentElement.getAttribute("data-foreground-color");
}
else
{
context.strokeStyle = '#000000';
}
context.stroke();
context.closePath();
// rest of meter
context.beginPath();
context.arc(0, 0, radius, Math.PI * 2 * decimalValue, Math.PI * 2, false);
// line color
if (this.ParentElement.hasAttribute("data-background-color"))
{
context.strokeStyle = this.ParentElement.getAttribute("data-background-color");
}
else
{
context.strokeStyle = '#CCCCCC';
}
context.stroke();
context.closePath();
};
this.Refresh();
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("Meter");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new Meter(items[i]);
}
});

View File

@ -0,0 +1,21 @@
function Panel(id)
{
this._iframe = document.getElementById("Panel_" + id + "_IFrame");
this._iframe.onload = function(sender)
{
sender._throbber.style.display = "none";
sender._content.style.display = "block";
}.PrependArgument(this);
this._content = document.getElementById("Panel_" + id + "_Content");
this._throbber = document.getElementById("Panel_" + id + "_Throbber");
this.ID = id;
this.NavigateTo = function(url)
{
this._throbber.style.display = "block";
// this._content.style.display = "none";
this._iframe.src = url;
};
}

View File

@ -0,0 +1,92 @@
function Popup(idOrParentElement)
{
if (typeof(idOrParentElement) === "string")
{
this.ID = id;
}
else
{
this.ParentElement = idOrParentElement;
}
this.Show = function()
{
Popup.HideAll();
if (this.ParentElement)
{
System.ClassList.Add(this.ParentElement, "uwt-visible");
}
else
{
var obj = document.getElementById("Popup_" + this.ID);
obj.classList.add("Visible");
}
};
this.Hide = function()
{
if (this.ParentElement)
{
System.ClassList.Remove(this.ParentElement, "uwt-visible");
}
else
{
var obj = document.getElementById("Popup_" + this.ID);
obj.classList.remove("Visible");
}
};
}
Popup.HideAll = function()
{
var elems = document.getElementsByClassName("uwt-popup");
for (var i = 0; i < elems.length; i++)
{
if (!System.ClassList.Contains(elems[i], "uwt-visible-always"))
{
System.ClassList.Remove(elems[i], "uwt-visible");
}
}
};
Popup.create = function(container)
{
console.log(container);
var parentElement = document.createElement("div");
parentElement.className = "uwt-popup";
container.appendChild(parentElement);
var popup = new Popup(parentElement);
return popup;
};
window.addEventListener("mousedown", function(e)
{
var sender;
if (!e)
{
e = window.event;
}
if (e.target)
{
sender = e.target;
}
else if (e.srcElement)
{
sender = e.srcElement;
}
while (sender != null)
{
if (System.ClassList.Contains(sender, "Popup"))
{
// do not close the popup when we click inside itself
e.preventDefault();
e.stopPropagation();
return;
}
sender = sender.parentNode;
if (sender == null) break;
}
Popup.HideAll();
});

View File

@ -0,0 +1,28 @@
function ProgressBar(parentElement)
{
this.ParentElement = parentElement;
this.MinimumValue = 0;
this.MaximumValue = 100;
this.CurrentValue = 0;
this.SetCurrentValue = function(value)
{
this.CurrentValue = value;
this.Update();
};
this.Update = function()
{
var pb_fill = document.getElementById("ProgressBar_" + this.ID + "_ValueFill");
var pb_label = document.getElementById("ProgressBar_" + this.ID + "_ValueLabel");
pb_fill.style.width = ((this.CurrentValue / (this.MaximumValue - this.MinimumValue)) * 100).toFixed(0).toString() + "%";
pb_label.innerHTML = ((this.CurrentValue / (this.MaximumValue - this.MinimumValue)) * 100).toFixed(0).toString() + "%";
};
}
window.addEventListener("load", function(e)
{
var items = document.getElementsByClassName("ProgressBar");
for (var i = 0; i < items.length; i++)
{
items[i].NativeObject = new ProgressBar(items[i]);
}
});

Some files were not shown because too many files have changed in this diff Show More