first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,75 @@
/**
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
line-height: 1.3em;
color: #22262a;
background: #fff;
}
h1, h2, h3, h4 {
font-weight: bold;
}
h1 {
font-size: 1.857rem;
}
h2 {
font-size: 1.571rem;
}
h3 {
font-size: 1.286rem;
}
a:link, a:visited {
font-weight: normal;
color: #1b57b1;
text-decoration: none;
}
a:hover {
font-weight: normal;
color: #00c;
text-decoration: underline;
}
div.caption {
padding: 0 10px;
}
div.caption img {
border: 1px solid #ccc;
}
div.caption p {
font-size: 0.9em;
color: #666;
text-align: center;
}
/* STYLES FOR JOOMLA! EDITOR */
hr#system-readmore {
color: #f00;
border: #f00 dashed 1px;
}
hr.system-pagebreak {
color: #808080;
border: #808080 dashed 1px;
}
span[lang] {
padding: 2px;
border: 1px dashed #bbb;
}
span[lang]:after {
font-size: smaller;
color: #f00;
vertical-align: super;
content: attr(lang);
}

1
media/system/css/editor.min.css vendored Normal file
View File

@ -0,0 +1 @@
body{background:#fff;color:#22262a;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem;line-height:1.3em}h1,h2,h3,h4{font-weight:700}h1{font-size:1.857rem}h2{font-size:1.571rem}h3{font-size:1.286rem}a:link,a:visited{color:#1b57b1;font-weight:400;text-decoration:none}a:hover{color:#00c;font-weight:400;text-decoration:underline}div.caption{padding:0 10px}div.caption img{border:1px solid #ccc}div.caption p{color:#666;font-size:.9em;text-align:center}hr#system-readmore{border:1px dashed red;color:red}hr.system-pagebreak{border:1px dashed grey;color:grey}span[lang]{border:1px dashed #bbb;padding:2px}span[lang]:after{color:red;content:attr(lang);font-size:smaller;vertical-align:super}

Binary file not shown.

View File

@ -0,0 +1,227 @@
/**
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
.js-calendar {
box-shadow: 0 0 15px 4px rgba(0,0,0,.15) !important;
}
.calendar-container {
--fallback-url: url("../../images/select-bg-rtl.svg");
z-index: 1100 !important;
float: left;
min-width: 160px;
padding: 0;
list-style: none;
background-color: var(--calendar-bg, #fff);
border-radius: 5px;
}
.calendar-container .nav {
display: table-cell;
}
.calendar-container table {
z-index: 1100 !important;
max-width: 268px;
padding: 3px;
margin-top: 2px;
margin-right: auto;
margin-left: auto;
table-layout: fixed;
border-collapse: separate;
background-color: var(--calendar-bg, #fff);
border-radius: 5px;
}
/* The main calendar widget. DIV containing a table. */
div.calendar-container table th, .calendar-container table td {
padding: 8px 0;
line-height: 1.1em;
text-align: center;
box-shadow: none;
}
div.calendar-container table body td {
line-height: 2em;
}
div.calendar-container table td.title { /* This holds the current "month, year" */
text-align: center;
vertical-align: middle;
}
.calendar-container table thead td.headrow { /* Row <TR> containing navigation buttons */
color: #000;
background: #fff;
}
.calendar-container table thead td.name { /* Cells <TD> containing the day names */
color: #000;
text-align: center;
border-bottom: 1px solid #fff;
}
.calendar-container table thead td.weekend { /* How a weekend day name shows in header */
color: #999;
}
/* The body part -- contains all the days in month. */
.calendar-container table tbody td.day { /* Cells <TD> containing month days dates */
text-align: right;
}
.calendar-container table tbody td.wn {
background: #fff;
}
.calendar-container table tbody td.weekend { /* Cells showing weekend days */
color: #999;
}
.calendar-container table tbody td.hilite { /* Hovered cells <TD> */
color: #fff;
background: #999;
}
.calendar-container table tbody td.day {
min-width: 38px;
font-size: 12px;
cursor: pointer;
border: 0;
}
.calendar-container table tbody td.day.wn {
text-align: center;
background-color: var(--calendar-week-bg, #f4f4f4);
}
.calendar-container table tbody td.day.selected { /* Cell showing today date */
color: #fff;
background: #3071a9;
border: 0;
}
.calendar-container table tbody td.today {
position: relative;
width: auto;
height: 100%;
font-weight: bold;
}
.calendar-container table tbody td.today:after {
position: absolute;
right: 3px;
bottom: 3px;
left: 3px;
height: 3px;
content: "";
background-color: #46a546;
border-radius: 1.5px;
}
.calendar-container table tbody td.today.selected:after {
background-color: #fff;
}
.calendar-container table tbody td.day:hover {
color: #fff;
cursor: pointer;
background: #3d8fd7;
}
.calendar-container table tbody td.day:hover:after {
background-color: #fff;
}
.calendar-container table tbody .disabled {
color: #999;
background-color: #fafafa;
}
.calendar-container table tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar-container table tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
.calendar-container .calendar-head-row td {
padding: 4px 0 !important;
border-bottom: none;
}
.calendar-container .day-name {
padding-top: .5rem;
font-size: .7rem;
font-weight: bold;
border-bottom: none;
}
.calendar-container .time td {
padding: 15px 3px 10px 0;
border-bottom: none;
}
.calendar-container td.time-title {
display: block;
margin-top: 20px;
}
.calendar-container .time td select {
display: block;
width: 100%;
padding: 5px 9px 3px;
font-size: 16px;
font-weight: 400;
line-height: 1.5;
color: var(--calendar-select-color, #212529);
background-color: var(--calendar-select-bg-color, #f0f4fb);
background-image: var(--calendar-select-bg-url, var(--fallback-url));
background-repeat: no-repeat;
background-position: left center;
background-size: max(100%, 58rem);
border: 1px solid #cdcdcd;
border-radius: .25rem;
appearance: none;
}
.buttons-wrapper {
width: 100%;
padding: 5px;
margin-bottom: 0 !important;
}
.buttons-wrapper .btn {
min-width: 60px;
padding: 0 16px;
margin-left: 0;
line-height: 2.375rem;
color: var(--calendar-buttons-color, #495057);
border: 1px solid var(--calendar-buttons-color, #495057);
box-shadow: 1px 0 1px 1px rgba(0,0,0,.25);
}
.buttons-wrapper .btn:hover {
color: #fff;
background: #1a466b;
}
.buttons-wrapper .btn:last-child {
margin-left: 0;
}
.time .time-title {
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg width='24' height='24' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1024 544v448q0 14-9 23t-23 9h-320q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224v-352q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
}
/* Fix cursor on js-btn and time select */
.calendar-container select,
.calendar-container .js-btn {
cursor: pointer;
}

View File

@ -0,0 +1 @@
.js-calendar{-webkit-box-shadow:0 0 15px 4px rgba(0,0,0,.15)!important;box-shadow:0 0 15px 4px rgba(0,0,0,.15)!important}.calendar-container{--fallback-url:url(../../images/select-bg-rtl.svg);background-color:var(--calendar-bg,#fff);border-radius:5px;float:left;list-style:none;min-width:160px;padding:0;z-index:1100!important}.calendar-container .nav{display:table-cell}.calendar-container table{background-color:var(--calendar-bg,#fff);border-collapse:separate;border-radius:5px;margin-left:auto;margin-right:auto;margin-top:2px;max-width:268px;padding:3px;table-layout:fixed;z-index:1100!important}.calendar-container table td,div.calendar-container table th{-webkit-box-shadow:none;box-shadow:none;line-height:1.1em;padding:8px 0;text-align:center}div.calendar-container table body td{line-height:2em}div.calendar-container table td.title{text-align:center;vertical-align:middle}.calendar-container table thead td.headrow{background:#fff;color:#000}.calendar-container table thead td.name{border-bottom:1px solid #fff;color:#000;text-align:center}.calendar-container table thead td.weekend{color:#999}.calendar-container table tbody td.day{text-align:right}.calendar-container table tbody td.wn{background:#fff}.calendar-container table tbody td.weekend{color:#999}.calendar-container table tbody td.hilite{background:#999;color:#fff}.calendar-container table tbody td.day{border:0;cursor:pointer;font-size:12px;min-width:38px}.calendar-container table tbody td.day.wn{background-color:var(--calendar-week-bg,#f4f4f4);text-align:center}.calendar-container table tbody td.day.selected{background:#3071a9;border:0;color:#fff}.calendar-container table tbody td.today{font-weight:700;height:100%;position:relative;width:auto}.calendar-container table tbody td.today:after{background-color:#46a546;border-radius:1.5px;bottom:3px;content:"";height:3px;left:3px;position:absolute;right:3px}.calendar-container table tbody td.today.selected:after{background-color:#fff}.calendar-container table tbody td.day:hover{background:#3d8fd7;color:#fff;cursor:pointer}.calendar-container table tbody td.day:hover:after{background-color:#fff}.calendar-container table tbody .disabled{background-color:#fafafa;color:#999}.calendar-container table tbody .emptycell{visibility:hidden}.calendar-container table tbody .emptyrow{display:none}.calendar-container .calendar-head-row td{border-bottom:none;padding:4px 0!important}.calendar-container .day-name{border-bottom:none;font-size:.7rem;font-weight:700;padding-top:.5rem}.calendar-container .time td{border-bottom:none;padding:15px 3px 10px 0}.calendar-container td.time-title{display:block;margin-top:20px}.calendar-container .time td select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--calendar-select-bg-color,#f0f4fb);background-image:var(--calendar-select-bg-url,var(--fallback-url));background-position:0;background-repeat:no-repeat;background-size:max(100%,58rem);border:1px solid #cdcdcd;border-radius:.25rem;color:var(--calendar-select-color,#212529);display:block;font-size:16px;font-weight:400;line-height:1.5;padding:5px 9px 3px;width:100%}.buttons-wrapper{margin-bottom:0!important;padding:5px;width:100%}.buttons-wrapper .btn{border:1px solid var(--calendar-buttons-color,#495057);-webkit-box-shadow:1px 0 1px 1px rgba(0,0,0,.25);box-shadow:1px 0 1px 1px rgba(0,0,0,.25);color:var(--calendar-buttons-color,#495057);line-height:2.375rem;margin-left:0;min-width:60px;padding:0 16px}.buttons-wrapper .btn:hover{background:#1a466b;color:#fff}.buttons-wrapper .btn:last-child{margin-left:0}.time .time-title{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1024 544v448q0 14-9 23t-23 9H672q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224V544q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5T1281.5 1561 896 1664t-385.5-103T231 1281.5 128 896t103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat}.calendar-container .js-btn,.calendar-container select{cursor:pointer}

Binary file not shown.

View File

@ -0,0 +1,227 @@
/**
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
.js-calendar {
box-shadow: 0 0 15px 4px rgba(0,0,0,.15) !important;
}
.calendar-container {
--fallback-url: url("../../images/select-bg.svg");
z-index: 1100 !important;
float: left;
min-width: 160px;
padding: 0;
list-style: none;
background-color: var(--calendar-bg, #fff);
border-radius: 5px;
}
.calendar-container .nav {
display: table-cell;
}
.calendar-container table {
z-index: 1100 !important;
max-width: 268px;
padding: 3px;
margin-top: 2px;
margin-right: auto;
margin-left: auto;
table-layout: fixed;
border-collapse: separate;
background-color: var(--calendar-bg, #fff);
border-radius: 5px;
}
/* The main calendar widget. DIV containing a table. */
div.calendar-container table th, .calendar-container table td {
padding: 8px 0;
line-height: 1.1em;
text-align: center;
box-shadow: none;
}
div.calendar-container table body td {
line-height: 2em;
}
div.calendar-container table td.title { /* This holds the current "month, year" */
text-align: center;
vertical-align: middle;
}
.calendar-container table thead td.headrow { /* Row <TR> containing navigation buttons */
color: #000;
background: #fff;
}
.calendar-container table thead td.name { /* Cells <TD> containing the day names */
color: #000;
text-align: center;
border-bottom: 1px solid #fff;
}
.calendar-container table thead td.weekend { /* How a weekend day name shows in header */
color: #999;
}
/* The body part -- contains all the days in month. */
.calendar-container table tbody td.day { /* Cells <TD> containing month days dates */
text-align: right;
}
.calendar-container table tbody td.wn {
background: #fff;
}
.calendar-container table tbody td.weekend { /* Cells showing weekend days */
color: #999;
}
.calendar-container table tbody td.hilite { /* Hovered cells <TD> */
color: #fff;
background: #999;
}
.calendar-container table tbody td.day {
min-width: 38px;
font-size: 12px;
cursor: pointer;
border: 0;
}
.calendar-container table tbody td.day.wn {
text-align: center;
background-color: var(--calendar-week-bg, #f4f4f4);
}
.calendar-container table tbody td.day.selected { /* Cell showing today date */
color: #fff;
background: #3071a9;
border: 0;
}
.calendar-container table tbody td.today {
position: relative;
width: auto;
height: 100%;
font-weight: bold;
}
.calendar-container table tbody td.today:after {
position: absolute;
right: 3px;
bottom: 3px;
left: 3px;
height: 3px;
content: "";
background-color: #46a546;
border-radius: 1.5px;
}
.calendar-container table tbody td.today.selected:after {
background-color: #fff;
}
.calendar-container table tbody td.day:hover {
color: #fff;
cursor: pointer;
background: #3d8fd7;
}
.calendar-container table tbody td.day:hover:after {
background-color: #fff;
}
.calendar-container table tbody .disabled {
color: #999;
background-color: #fafafa;
}
.calendar-container table tbody .emptycell { /* Empty cells (the best is to hide them) */
visibility: hidden;
}
.calendar-container table tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}
.calendar-container .calendar-head-row td {
padding: 4px 0 !important;
border-bottom: none;
}
.calendar-container .day-name {
padding-top: .5rem;
font-size: .7rem;
font-weight: bold;
border-bottom: none;
}
.calendar-container .time td {
padding: 15px 3px 10px 0;
border-bottom: none;
}
.calendar-container td.time-title {
display: block;
margin-top: 20px;
}
.calendar-container .time td select {
display: block;
width: 100%;
padding: 5px 9px 3px;
font-size: 16px;
font-weight: 400;
line-height: 1.5;
color: var(--calendar-select-color, #212529);
background-color: var(--calendar-select-bg-color, #f0f4fb);
background-image: var(--calendar-select-bg-url, var(--fallback-url));
background-repeat: no-repeat;
background-position: right center;
background-size: max(100%, 58rem);
border: 1px solid #cdcdcd;
border-radius: .25rem;
appearance: none;
}
.buttons-wrapper {
width: 100%;
padding: 5px;
margin-bottom: 0 !important;
}
.buttons-wrapper .btn {
min-width: 60px;
padding: 0 16px;
margin-right: 0;
line-height: 2.375rem;
color: var(--calendar-buttons-color, #495057);
border: 1px solid var(--calendar-buttons-color, #495057);
box-shadow: 1px 1px 1px 0 rgba(0,0,0,.25);
}
.buttons-wrapper .btn:hover {
color: #fff;
background: #1a466b;
}
.buttons-wrapper .btn:last-child {
margin-right: 0;
}
.time .time-title {
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg width='24' height='24' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1024 544v448q0 14-9 23t-23 9h-320q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224v-352q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
}
/* Fix cursor on js-btn and time select */
.calendar-container select,
.calendar-container .js-btn {
cursor: pointer;
}

View File

@ -0,0 +1 @@
.js-calendar{-webkit-box-shadow:0 0 15px 4px rgba(0,0,0,.15)!important;box-shadow:0 0 15px 4px rgba(0,0,0,.15)!important}.calendar-container{--fallback-url:url(../../images/select-bg.svg);background-color:var(--calendar-bg,#fff);border-radius:5px;float:left;list-style:none;min-width:160px;padding:0;z-index:1100!important}.calendar-container .nav{display:table-cell}.calendar-container table{background-color:var(--calendar-bg,#fff);border-collapse:separate;border-radius:5px;margin-left:auto;margin-right:auto;margin-top:2px;max-width:268px;padding:3px;table-layout:fixed;z-index:1100!important}.calendar-container table td,div.calendar-container table th{-webkit-box-shadow:none;box-shadow:none;line-height:1.1em;padding:8px 0;text-align:center}div.calendar-container table body td{line-height:2em}div.calendar-container table td.title{text-align:center;vertical-align:middle}.calendar-container table thead td.headrow{background:#fff;color:#000}.calendar-container table thead td.name{border-bottom:1px solid #fff;color:#000;text-align:center}.calendar-container table thead td.weekend{color:#999}.calendar-container table tbody td.day{text-align:right}.calendar-container table tbody td.wn{background:#fff}.calendar-container table tbody td.weekend{color:#999}.calendar-container table tbody td.hilite{background:#999;color:#fff}.calendar-container table tbody td.day{border:0;cursor:pointer;font-size:12px;min-width:38px}.calendar-container table tbody td.day.wn{background-color:var(--calendar-week-bg,#f4f4f4);text-align:center}.calendar-container table tbody td.day.selected{background:#3071a9;border:0;color:#fff}.calendar-container table tbody td.today{font-weight:700;height:100%;position:relative;width:auto}.calendar-container table tbody td.today:after{background-color:#46a546;border-radius:1.5px;bottom:3px;content:"";height:3px;left:3px;position:absolute;right:3px}.calendar-container table tbody td.today.selected:after{background-color:#fff}.calendar-container table tbody td.day:hover{background:#3d8fd7;color:#fff;cursor:pointer}.calendar-container table tbody td.day:hover:after{background-color:#fff}.calendar-container table tbody .disabled{background-color:#fafafa;color:#999}.calendar-container table tbody .emptycell{visibility:hidden}.calendar-container table tbody .emptyrow{display:none}.calendar-container .calendar-head-row td{border-bottom:none;padding:4px 0!important}.calendar-container .day-name{border-bottom:none;font-size:.7rem;font-weight:700;padding-top:.5rem}.calendar-container .time td{border-bottom:none;padding:15px 3px 10px 0}.calendar-container td.time-title{display:block;margin-top:20px}.calendar-container .time td select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--calendar-select-bg-color,#f0f4fb);background-image:var(--calendar-select-bg-url,var(--fallback-url));background-position:100%;background-repeat:no-repeat;background-size:max(100%,58rem);border:1px solid #cdcdcd;border-radius:.25rem;color:var(--calendar-select-color,#212529);display:block;font-size:16px;font-weight:400;line-height:1.5;padding:5px 9px 3px;width:100%}.buttons-wrapper{margin-bottom:0!important;padding:5px;width:100%}.buttons-wrapper .btn{border:1px solid var(--calendar-buttons-color,#495057);-webkit-box-shadow:1px 1px 1px 0 rgba(0,0,0,.25);box-shadow:1px 1px 1px 0 rgba(0,0,0,.25);color:var(--calendar-buttons-color,#495057);line-height:2.375rem;margin-right:0;min-width:60px;padding:0 16px}.buttons-wrapper .btn:hover{background:#1a466b;color:#fff}.buttons-wrapper .btn:last-child{margin-right:0}.time .time-title{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1024 544v448q0 14-9 23t-23 9H672q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224V544q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5T1281.5 1561 896 1664t-385.5-103T231 1281.5 128 896t103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat}.calendar-container .js-btn,.calendar-container select{cursor:pointer}

Binary file not shown.

View File

@ -0,0 +1,39 @@
joomla-field-media .field-media-preview {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
max-width: 356px;
height: 180px;
padding: 10px;
overflow: hidden;
background-color: #f2f2f2;
border: 1px solid rgba(0, 0, 0, 0.15);
border-width: 1px 1px 0;
border-radius: 0.25rem 0.25rem 0 0;
}
joomla-field-media .field-media-preview-icon {
width: 7rem;
height: 7rem;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='rgba(0,0,0,.25)' d='M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z'/%3E%3C/svg%3E");
background-size: 7rem;
}
joomla-field-media .field-media-input {
border-top-left-radius: 0;
}
joomla-field-media .button-clear {
border-top-right-radius: 0;
}
joomla-field-media img {
max-width: 100%;
max-height: 100%;
}

View File

@ -0,0 +1 @@
joomla-field-media .field-media-preview{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#f2f2f2;border:solid rgba(0,0,0,.15);border-radius:.25rem .25rem 0 0;border-width:1px 1px 0;display:-webkit-box;display:-ms-flexbox;display:flex;height:180px;justify-content:center;max-width:356px;overflow:hidden;padding:10px}joomla-field-media .field-media-preview-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='rgba(0,0,0,.25)' d='M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z'/%3E%3C/svg%3E");background-size:7rem;height:7rem;width:7rem}joomla-field-media .field-media-input{border-top-left-radius:0}joomla-field-media .button-clear{border-top-right-radius:0}joomla-field-media img{max-height:100%;max-width:100%}

Binary file not shown.

View File

@ -0,0 +1,46 @@
joomla-field-permissions .joomla-icon::after {
display: inline-block;
width: 1rem;
height: 1rem;
line-height: 1.5;
content: "";
}
joomla-field-permissions .joomla-icon.joomla-field-permissions__allowed::after {
background: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111' d='M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z'/%3E%3C/svg%3E") no-repeat;
}
joomla-field-permissions .joomla-icon.joomla-field-permissions__denied::after {
background: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111' d='M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z'/%3E%3C/svg%3E") no-repeat;
}
joomla-field-permissions .joomla-icon.joomla-field-permissions__spinner {
-webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
joomla-field-permissions .joomla-icon.joomla-field-permissions__spinner::after {
background: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111' d='M526 1394q0 53-37.5 90.5t-90.5 37.5q-52 0-90-38t-38-90q0-53 37.5-90.5t90.5-37.5 90.5 37.5 37.5 90.5zm498 206q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-704-704q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm1202 498q0 52-38 90t-90 38q-53 0-90.5-37.5t-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-964-996q0 66-47 113t-113 47-113-47-47-113 47-113 113-47 113 47 47 113zm1170 498q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-640-704q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm530 206q0 93-66 158.5t-158 65.5q-93 0-158.5-65.5t-65.5-158.5q0-92 65.5-158t158.5-66q92 0 158 66t66 158z'/%3E%3C/svg%3E") no-repeat;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}

View File

@ -0,0 +1 @@
joomla-field-permissions .joomla-icon:after{content:"";display:inline-block;height:1rem;line-height:1.5;width:1rem}joomla-field-permissions .joomla-icon.joomla-field-permissions__allowed:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111' d='M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z'/%3E%3C/svg%3E") no-repeat}joomla-field-permissions .joomla-icon.joomla-field-permissions__denied:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111' d='M1490 1322q0 40-28 68l-136 136q-28 28-68 28t-68-28l-294-294-294 294q-28 28-68 28t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 294 294-294q28-28 68-28t68 28l136 136q28 28 28 68t-28 68l-294 294 294 294q28 28 28 68z'/%3E%3C/svg%3E") no-repeat}joomla-field-permissions .joomla-icon.joomla-field-permissions__spinner{-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}joomla-field-permissions .joomla-icon.joomla-field-permissions__spinner:after{background:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111' d='M526 1394q0 53-37.5 90.5T398 1522q-52 0-90-38t-38-90q0-53 37.5-90.5T398 1266t90.5 37.5T526 1394zm498 206q0 53-37.5 90.5T896 1728t-90.5-37.5T768 1600t37.5-90.5T896 1472t90.5 37.5 37.5 90.5zM320 896q0 53-37.5 90.5T192 1024t-90.5-37.5T64 896t37.5-90.5T192 768t90.5 37.5T320 896zm1202 498q0 52-38 90t-90 38q-53 0-90.5-37.5T1266 1394t37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zM558 398q0 66-47 113t-113 47-113-47-47-113 47-113 113-47 113 47 47 113zm1170 498q0 53-37.5 90.5T1600 1024t-90.5-37.5T1472 896t37.5-90.5T1600 768t90.5 37.5T1728 896zm-640-704q0 80-56 136t-136 56-136-56-56-136 56-136T896 0t136 56 56 136zm530 206q0 93-66 158.5T1394 622q-93 0-158.5-65.5T1170 398q0-92 65.5-158t158.5-66q92 0 158 66t66 158z'/%3E%3C/svg%3E") no-repeat}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}

View File

@ -0,0 +1,66 @@
joomla-field-simple-color {
display: block;
}
joomla-field-simple-color .hidden {
display: none;
}
joomla-field-simple-color .visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
joomla-field-simple-color button {
width: 20px;
height: 20px;
overflow: hidden;
vertical-align: middle;
background: none;
border: solid 1px #ccc;
border-radius: 3px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
joomla-field-simple-color .btn-close {
width: auto;
padding: 0 6px;
margin-top: -4px;
font-size: 1rem;
line-height: 1.5;
text-align: center;
vertical-align: middle;
}
joomla-field-simple-color .nocolor {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggRDQENU0dyawAAACZJREFUGNNjPHXqDAMSMDY2ROYyMeAFNJVm/Pv3LzL/7Nnzg8VpAKebCGpIIxHBAAAAAElFTkSuQmCC") !important;
}
joomla-field-simple-color .simplecolors-panel .swatch {
margin: 0 4px 4px 0;
}
joomla-field-simple-color .swatch:hover,
joomla-field-simple-color .swatch.active {
border-color: rgba(82, 168, 236, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
joomla-field-simple-color .simplecolors-panel[data-open=""] {
display: block;
}
joomla-field-simple-color .simplecolors-panel {
position: absolute;
z-index: 12;
display: none;
float: left;
padding: 6px 2px 2px 6px;
margin: 1px 0 0;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ddd;
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

View File

@ -0,0 +1 @@
joomla-field-simple-color{display:block}joomla-field-simple-color .hidden{display:none}joomla-field-simple-color .visually-hidden{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}joomla-field-simple-color button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:1px solid #ccc;border-radius:3px;height:20px;overflow:hidden;vertical-align:middle;width:20px}joomla-field-simple-color .btn-close{font-size:1rem;line-height:1.5;margin-top:-4px;padding:0 6px;text-align:center;vertical-align:middle;width:auto}joomla-field-simple-color .nocolor{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggRDQENU0dyawAAACZJREFUGNNjPHXqDAMSMDY2ROYyMeAFNJVm/Pv3LzL/7Nnzg8VpAKebCGpIIxHBAAAAAElFTkSuQmCC")!important}joomla-field-simple-color .simplecolors-panel .swatch{margin:0 4px 4px 0}joomla-field-simple-color .swatch.active,joomla-field-simple-color .swatch:hover{border-color:rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6)}joomla-field-simple-color .simplecolors-panel[data-open=""]{display:block}joomla-field-simple-color .simplecolors-panel{background-clip:padding-box;background-color:#fff;border:1px solid #ddd;border-radius:5px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);display:none;float:left;margin:1px 0 0;padding:6px 2px 2px 6px;position:absolute;z-index:12}

View File

@ -0,0 +1,23 @@
joomla-field-mediamore details {
position: absolute;
bottom: 0;
margin: 0 0 0 .5rem;
background: #f5f5f5;
border: 1px solid #c9c9c9;
border-radius: .25rem;
}
joomla-field-mediamore label.input-group-text {
width: auto;
}
joomla-field-mediamore summary {
padding: 1rem;
font-weight: 500;
background-color: #e3e3e3;
border-radius: .25rem;
}
joomla-field-mediamore details .form-group {
margin: 1rem !important;
}

View File

@ -0,0 +1 @@
joomla-field-mediamore details{background:#f5f5f5;border:1px solid #c9c9c9;border-radius:.25rem;bottom:0;margin:0 0 0 .5rem;position:absolute}joomla-field-mediamore label.input-group-text{width:auto}joomla-field-mediamore summary{background-color:#e3e3e3;border-radius:.25rem;font-weight:500;padding:1rem}joomla-field-mediamore details .form-group{margin:1rem!important}

Binary file not shown.

View File

@ -0,0 +1,88 @@
.switcher {
position: relative;
width: 18rem;
height: 28px;
margin: 0;
}
.switcher input {
position: absolute;
top: 0;
inset-inline-start: 0;
z-index: 2;
width: 62px;
height: 28px;
margin: 0;
cursor: pointer;
opacity: 0;
}
.switcher input:checked {
z-index: 1;
}
.switcher input:checked + label {
z-index: 0;
opacity: 1;
}
.switcher input:not(:checked) + label {
z-index: 3;
opacity: 0;
}
.switcher input:focus ~ .toggle-outside {
border-color: var(--focus);
-webkit-box-shadow: 0 0 0 0.2rem rgba(26, 70, 107, 0.25);
box-shadow: 0 0 0 0.2rem rgba(26, 70, 107, 0.25);
}
.switcher label {
position: absolute;
inset-inline-start: 0;
display: inline-block;
width: auto;
min-width: 6rem;
height: 100%;
margin-bottom: 0;
-webkit-margin-start: 70px;
margin-inline-start: 70px;
line-height: 28px;
text-align: start;
-webkit-transition: opacity 0.25s ease;
transition: opacity 0.25s ease;
}
.switcher .toggle-outside {
position: absolute;
inset-inline-start: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 58px;
height: 100%;
overflow: hidden;
background: #d3d3d3;
border: 1px solid rgba(0, 0, 0, 0.18);
-webkit-transition: 0.2s ease all;
transition: 0.2s ease all;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.switcher input ~ input:checked ~ .toggle-outside {
background: #2f7d32;
}
.switcher .toggle-inside {
position: absolute;
left: 0;
width: 28px;
height: 28px;
background: #fff;
-webkit-transition: 0.4s ease all;
transition: 0.4s ease all;
}
.switcher input ~ input:checked ~ .toggle-outside .toggle-inside {
left: 30px;
}

View File

@ -0,0 +1 @@
.switcher{height:28px;margin:0;position:relative;width:18rem}.switcher input{cursor:pointer;height:28px;inset-inline-start:0;margin:0;opacity:0;position:absolute;top:0;width:62px;z-index:2}.switcher input:checked{z-index:1}.switcher input:checked+label{opacity:1;z-index:0}.switcher input:not(:checked)+label{opacity:0;z-index:3}.switcher input:focus~.toggle-outside{border-color:var(--focus);-webkit-box-shadow:0 0 0 .2rem rgba(26,70,107,.25);box-shadow:0 0 0 .2rem rgba(26,70,107,.25)}.switcher label{-webkit-margin-start:70px;display:inline-block;line-height:28px;margin-bottom:0;margin-inline-start:70px;min-width:6rem;text-align:start;-webkit-transition:opacity .25s ease;transition:opacity .25s ease;width:auto}.switcher .toggle-outside,.switcher label{height:100%;inset-inline-start:0;position:absolute}.switcher .toggle-outside{background:#d3d3d3;border:1px solid rgba(0,0,0,.18);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:all .2s ease;transition:all .2s ease;width:58px}.switcher input~input:checked~.toggle-outside{background:#2f7d32}.switcher .toggle-inside{background:#fff;height:28px;left:0;position:absolute;-webkit-transition:all .4s ease;transition:all .4s ease;width:28px}.switcher input~input:checked~.toggle-outside .toggle-inside{left:30px}

Binary file not shown.

View File

@ -0,0 +1,224 @@
:host {
position: fixed;
top: 0;
left: 0;
z-index: 10000;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
overflow: hidden;
opacity: 0.8;
}
.box {
position: relative;
width: 345px;
height: 345px;
margin: 0 auto;
}
.box p {
float: right;
margin: 95px 0 0;
font: normal 1.25em/1em sans-serif;
color: #999;
}
.box > span {
-webkit-animation: jspinner 2s infinite ease-in-out;
animation: jspinner 2s infinite ease-in-out;
}
.box .red {
-webkit-animation-delay: -1.5s;
animation-delay: -1.5s;
}
.box .blue {
-webkit-animation-delay: -1s;
animation-delay: -1s;
}
.box .green {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s;
}
.yellow {
position: absolute;
top: 0;
left: 0;
width: 90px;
height: 90px;
content: "";
background: #f9a541;
border-radius: 90px;
}
.yellow::before, .yellow::after {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: content-box;
box-sizing: content-box;
width: 50px;
content: "";
background: transparent;
border: 50px solid #f9a541;
}
.yellow::before {
height: 35px;
margin: 60px 0 0 -30px;
border-width: 50px 50px 0;
border-radius: 75px 75px 0 0;
}
.yellow::after {
height: 105px;
margin: 140px 0 0 -30px;
border-width: 0 0 0 50px;
}
.red {
position: absolute;
top: 0;
left: 0;
width: 90px;
height: 90px;
content: "";
background: #f44321;
border-radius: 90px;
}
.red::before, .red::after {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: content-box;
box-sizing: content-box;
width: 50px;
content: "";
background: transparent;
border: 50px solid #f44321;
}
.red::before {
height: 35px;
margin: 60px 0 0 -30px;
border-width: 50px 50px 0;
border-radius: 75px 75px 0 0;
}
.red::after {
height: 105px;
margin: 140px 0 0 -30px;
border-width: 0 0 0 50px;
}
.blue {
position: absolute;
top: 0;
left: 0;
width: 90px;
height: 90px;
content: "";
background: #5091cd;
border-radius: 90px;
}
.blue::before, .blue::after {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: content-box;
box-sizing: content-box;
width: 50px;
content: "";
background: transparent;
border: 50px solid #5091cd;
}
.blue::before {
height: 35px;
margin: 60px 0 0 -30px;
border-width: 50px 50px 0;
border-radius: 75px 75px 0 0;
}
.blue::after {
height: 105px;
margin: 140px 0 0 -30px;
border-width: 0 0 0 50px;
}
.green {
position: absolute;
top: 0;
left: 0;
width: 90px;
height: 90px;
content: "";
background: #7ac143;
border-radius: 90px;
}
.green::before, .green::after {
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: content-box;
box-sizing: content-box;
width: 50px;
content: "";
background: transparent;
border: 50px solid #7ac143;
}
.green::before {
height: 35px;
margin: 60px 0 0 -30px;
border-width: 50px 50px 0;
border-radius: 75px 75px 0 0;
}
.green::after {
height: 105px;
margin: 140px 0 0 -30px;
border-width: 0 0 0 50px;
}
.yellow {
margin: 0 0 0 255px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.red {
margin: 255px 0 0 255px;
-webkit-transform: rotate(135deg);
transform: rotate(135deg);
}
.blue {
margin: 255px 0 0;
-webkit-transform: rotate(225deg);
transform: rotate(225deg);
}
.green {
-webkit-transform: rotate(315deg);
transform: rotate(315deg);
}
@-webkit-keyframes jspinner {
0%, 40%, 100% {
opacity: 0.3;
}
20% {
opacity: 1;
}
}
@keyframes jspinner {
0%, 40%, 100% {
opacity: 0.3;
}
20% {
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.box > span {
-webkit-animation: none;
animation: none;
}
}

View File

@ -0,0 +1 @@
:host{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;left:0;opacity:.8;overflow:hidden;position:fixed;top:0;width:100%;z-index:10000}.box{height:345px;margin:0 auto;position:relative;width:345px}.box p{color:#999;float:right;font:normal 1.25em/1em sans-serif;margin:95px 0 0}.box>span{-webkit-animation:jspinner 2s ease-in-out infinite;animation:jspinner 2s ease-in-out infinite}.box .red{-webkit-animation-delay:-1.5s;animation-delay:-1.5s}.box .blue{-webkit-animation-delay:-1s;animation-delay:-1s}.box .green{-webkit-animation-delay:-.5s;animation-delay:-.5s}.yellow{background:#f9a541;border-radius:90px;height:90px;width:90px}.yellow,.yellow:after,.yellow:before{content:"";left:0;position:absolute;top:0}.yellow:after,.yellow:before{background:transparent;border:50px solid #f9a541;-webkit-box-sizing:content-box;box-sizing:content-box;width:50px}.yellow:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.yellow:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.red{background:#f44321;border-radius:90px;height:90px;width:90px}.red,.red:after,.red:before{content:"";left:0;position:absolute;top:0}.red:after,.red:before{background:transparent;border:50px solid #f44321;-webkit-box-sizing:content-box;box-sizing:content-box;width:50px}.red:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.red:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.blue{background:#5091cd;border-radius:90px;height:90px;width:90px}.blue,.blue:after,.blue:before{content:"";left:0;position:absolute;top:0}.blue:after,.blue:before{background:transparent;border:50px solid #5091cd;-webkit-box-sizing:content-box;box-sizing:content-box;width:50px}.blue:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.blue:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.green{background:#7ac143;border-radius:90px;height:90px;width:90px}.green,.green:after,.green:before{content:"";left:0;position:absolute;top:0}.green:after,.green:before{background:transparent;border:50px solid #7ac143;-webkit-box-sizing:content-box;box-sizing:content-box;width:50px}.green:before{border-radius:75px 75px 0 0;border-width:50px 50px 0;height:35px;margin:60px 0 0 -30px}.green:after{border-width:0 0 0 50px;height:105px;margin:140px 0 0 -30px}.yellow{margin:0 0 0 255px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.red{margin:255px 0 0 255px;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.blue{margin:255px 0 0;-webkit-transform:rotate(225deg);transform:rotate(225deg)}.green{-webkit-transform:rotate(315deg);transform:rotate(315deg)}@-webkit-keyframes jspinner{0%,40%,to{opacity:.3}20%{opacity:1}}@keyframes jspinner{0%,40%,to{opacity:.3}20%{opacity:1}}@media (prefers-reduced-motion:reduce){.box>span{-webkit-animation:none;animation:none}}

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,4 @@
joomla-toolbar-button .dropdown-item:focus,
joomla-toolbar-button .dropdown-item:hover {
color: #fff;
}

View File

@ -0,0 +1 @@
joomla-toolbar-button .dropdown-item:focus,joomla-toolbar-button .dropdown-item:hover{color:#fff}

Binary file not shown.

View File

@ -0,0 +1,52 @@
/**
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
.outline {
width: 550px;
padding: 2px;
margin: 0 auto;
background: #fff;
border: 1px solid #ccc;
}
body {
height: 100%;
padding: 0;
margin: 15px;
font-family: Arial, Helvetica, Sans Serif;
font-size: 11px;
color: #333;
background: #fff;
}
.frame {
padding: 8px;
margin-top: 13px;
margin-bottom: 25px;
background-color: #fefcf3;
border: solid 1px #000;
}
h1 {
font-size: 18px;
color: #c33;
}
.table {
margin-top: 13px;
border-collapse: collapse;
}
td {
padding: 3px 5px;
font-size: 10px;
border: solid 1px #bbb;
}
.type {
padding: 3px;
font-weight: bold;
color: #fff;
background-color: #c00;
}

View File

@ -0,0 +1 @@
.outline{border:1px solid #ccc;margin:0 auto;padding:2px;width:550px}.outline,body{background:#fff}body{color:#333;font-family:Arial,Helvetica,Sans Serif;font-size:11px;height:100%;margin:15px;padding:0}.frame{background-color:#fefcf3;border:1px solid #000;margin-bottom:25px;margin-top:13px;padding:8px}h1{color:#c33;font-size:18px}.table{border-collapse:collapse;margin-top:13px}td{border:1px solid #bbb;font-size:10px;padding:3px 5px}.type{background-color:#c00;color:#fff;font-weight:700;padding:3px}

Binary file not shown.

View File

@ -0,0 +1,64 @@
/**
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* System Messages */
#system-message {
padding: 0;
margin-bottom: 10px;
}
#system-message > dt {
display: none;
font-weight: bold;
}
#system-message > dd {
margin: 0;
font-weight: bold;
text-indent: 30px;
}
#system-message > dd > ul {
padding: 10px;
margin-bottom: 10px;
color: #05b;
list-style: none;
background-repeat: no-repeat;
background-position: 4px top;
border-top: 3px solid #84a7db;
border-bottom: 3px solid #84a7db;
}
#system-message > dd > ul > li {
line-height: 1.5em;
}
/* System Standard Messages */
#system-message > .message > ul {
background-color: #c3d2e5;
}
/* System Error Messages */
#system-message > .error > ul,
#system-message > .warning > ul,
#system-message > .notice > ul {
color: #c00;
}
#system-message > .error > ul {
background-color: #e6c0c0;
border-color: #de7a7b;
}
/* System Warning Messages */
#system-message > .warning > ul {
background-color: #e6c8a6;
border-color: #fb0;
}
/* System Notice Messages */
#system-message > .notice > ul {
background-color: #efe7b8;
border-color: #f0dc7e;
}

View File

@ -0,0 +1 @@
#system-message{margin-bottom:10px;padding:0}#system-message>dt{display:none;font-weight:700}#system-message>dd{font-weight:700;margin:0;text-indent:30px}#system-message>dd>ul{background-position:4px top;background-repeat:no-repeat;border-bottom:3px solid #84a7db;border-top:3px solid #84a7db;color:#05b;list-style:none;margin-bottom:10px;padding:10px}#system-message>dd>ul>li{line-height:1.5em}#system-message>.message>ul{background-color:#c3d2e5}#system-message>.error>ul,#system-message>.notice>ul,#system-message>.warning>ul{color:#c00}#system-message>.error>ul{background-color:#e6c0c0;border-color:#de7a7b}#system-message>.warning>ul{background-color:#e6c8a6;border-color:#fb0}#system-message>.notice>ul{background-color:#efe7b8;border-color:#f0dc7e}

Binary file not shown.

View File

@ -0,0 +1,84 @@
/**
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* Start Common Styles */
* {
font-family: helvetica, arial, sans-serif;
font-size: 11px;
color: #5f6565;
}
html {
height: 100%;
margin-bottom: 1px;
}
body {
height: 100%;
padding: 0;
padding-top: 0;
margin: 0;
margin-top: 0;
margin-bottom: 1px;
font-family: helvetica, arial, sans-serif;
font-weight: normal;
background: #fff;
}
.error {
margin-right: auto;
margin-left: auto;
}
table, td, th, div, pre, blockquote, ul, ol, dl, address, .componentheading, .contentheading, .contentpagetitle, .sectiontableheader, .newsfeedheading {
font-family: helvetica, arial, sans-serif;
font-weight: normal;
}
#outline {
width: 900px;
padding: 0;
padding-top: 60px;
padding-bottom: 60px;
margin: 0 auto;
background: #fff;
}
#errorboxoutline {
width: 900px;
padding: 0;
margin: 0;
border: 1px solid #000;
}
#errorboxheader {
width: 900px;
padding: 0;
margin: 0;
font-size: 12px;
font-weight: bold;
line-height: 22px;
color: #fff;
text-align: center;
background: #e44249;
border-bottom: 1px solid #000;
}
#errorboxbody {
padding: 10px;
margin: 0;
text-align: left;
}
#techinfo {
padding: 10px;
margin: 10px;
color: #ccc;
text-align: left;
border: 1px solid #ccc;
}
#techinfo p {
color: #ccc;
}

View File

@ -0,0 +1 @@
*{color:#5f6565;font-family:helvetica,arial,sans-serif;font-size:11px}html{margin-bottom:1px}body,html{height:100%}body{background:#fff;font-family:helvetica,arial,sans-serif;font-weight:400;margin:0 0 1px;padding:0}.error{margin-left:auto;margin-right:auto}.componentheading,.contentheading,.contentpagetitle,.newsfeedheading,.sectiontableheader,address,blockquote,div,dl,ol,pre,table,td,th,ul{font-family:helvetica,arial,sans-serif;font-weight:400}#outline{background:#fff;margin:0 auto;padding:60px 0;width:900px}#errorboxoutline{border:1px solid #000;margin:0;padding:0;width:900px}#errorboxheader{background:#e44249;border-bottom:1px solid #000;color:#fff;font-size:12px;font-weight:700;line-height:22px;margin:0;padding:0;text-align:center;width:900px}#errorboxbody{margin:0}#errorboxbody,#techinfo{padding:10px;text-align:left}#techinfo{border:1px solid #ccc;margin:10px}#techinfo,#techinfo p{color:#ccc}

Binary file not shown.

View File

@ -0,0 +1,20 @@
/**
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* Start Common Styles */
body {
text-align: right;
}
.TD {
text-align: left;
}
#errorboxbody {
text-align: right;
}
#techinfo {
text-align: right;
}

View File

@ -0,0 +1 @@
body{text-align:right}.TD{text-align:left}#errorboxbody,#techinfo{text-align:right}

Binary file not shown.

View File

@ -0,0 +1,167 @@
/**
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* Form validation */
.invalid {
border-color: #f00;
}
label.invalid {
color: #f00;
}
/* Buttons */
#editor-xtd-buttons {
padding: 5px;
}
.button2-left,
.button2-right,
.button2-left div,
.button2-right div {
float: left;
}
.button2-left a,
.button2-right a,
.button2-left span,
.button2-right span {
display: block;
float: left;
height: 22px;
font-size: 11px;
line-height: 22px;
color: #666;
cursor: pointer;
}
.button2-left span,
.button2-right span {
color: #999;
cursor: default;
}
.button2-left .page a,
.button2-right .page a,
.button2-left .page span,
.button2-right .page span {
padding: 0 6px;
}
.page span {
font-weight: bold;
color: #000;
}
.button2-left a:hover,
.button2-right a:hover {
color: #0b55c4;
text-decoration: none;
}
.button2-left a,
.button2-left span {
padding: 0 24px 0 6px;
}
.button2-right a,
.button2-right span {
padding: 0 6px 0 24px;
}
.button2-left {
float: left;
margin-left: 5px;
background: url("../images/j_button2_left.png?v=1697404982690") no-repeat;
}
.button2-right {
float: left;
margin-left: 5px;
background: url("../images/j_button2_right.png?v=1697404982690") 100% 0 no-repeat;
}
.button2-left .image {
background: url("../images/j_button2_image.png?v=1697404982690") 100% 0 no-repeat;
}
.button2-left .readmore,
.button2-left .article {
background: url("../images/j_button2_readmore.png?v=1697404982690") 100% 0 no-repeat;
}
.button2-left .pagebreak {
background: url("../images/j_button2_pagebreak.png?v=1697404982690") 100% 0 no-repeat;
}
.button2-left .blank {
background: url("../images/j_button2_blank.png?v=1697404982690") 100% 0 no-repeat;
}
/* Tooltips */
div.tooltip {
z-index: 13000;
float: left;
max-width: 200px;
padding: 5px;
background: #ffc;
border: 1px solid #d4d5aa;
}
div.tooltip h4 {
padding: 0;
padding-top: 15px;
padding-bottom: 5px;
margin: 0;
margin-top: -15px;
font-size: 95%;
font-weight: bold;
background: url("../images/selector-arrow.png?v=1697404982690") no-repeat;
}
div.tooltip p {
margin: 0;
font-size: 90%;
}
/* Caption fixes */
/* Caption fixes */
.img_caption .left {
float: left;
margin-right: 1em;
}
.img_caption .right {
float: right;
margin-left: 1em;
}
.img_caption .left p {
clear: left;
text-align: center;
}
.img_caption .right p {
clear: right;
text-align: center;
}
.img_caption {
text-align: center !important;
}
.img_caption.none {
margin-right: auto;
margin-left: auto;
}
/* Calendar */
a img.calendar {
width: 16px;
height: 16px;
margin-left: 3px;
vertical-align: middle;
cursor: pointer;
background: url("../images/calendar.png?v=ad4756") no-repeat;
}

View File

@ -0,0 +1 @@
.invalid{border-color:red}label.invalid{color:red}#editor-xtd-buttons{padding:5px}.button2-left,.button2-left div,.button2-right,.button2-right div{float:left}.button2-left a,.button2-left span,.button2-right a,.button2-right span{color:#666;cursor:pointer;display:block;float:left;font-size:11px;height:22px;line-height:22px}.button2-left span,.button2-right span{color:#999;cursor:default}.button2-left .page a,.button2-left .page span,.button2-right .page a,.button2-right .page span{padding:0 6px}.page span{color:#000;font-weight:700}.button2-left a:hover,.button2-right a:hover{color:#0b55c4;text-decoration:none}.button2-left a,.button2-left span{padding:0 24px 0 6px}.button2-right a,.button2-right span{padding:0 6px 0 24px}.button2-left{background:url("../images/j_button2_left.png?v=1697404982690") no-repeat;float:left;margin-left:5px}.button2-right{background:url("../images/j_button2_right.png?v=1697404982690") 100% 0 no-repeat;float:left;margin-left:5px}.button2-left .image{background:url("../images/j_button2_image.png?v=1697404982690") 100% 0 no-repeat}.button2-left .article,.button2-left .readmore{background:url("../images/j_button2_readmore.png?v=1697404982690") 100% 0 no-repeat}.button2-left .pagebreak{background:url("../images/j_button2_pagebreak.png?v=1697404982690") 100% 0 no-repeat}.button2-left .blank{background:url("../images/j_button2_blank.png?v=1697404982690") 100% 0 no-repeat}div.tooltip{background:#ffc;border:1px solid #d4d5aa;float:left;max-width:200px;padding:5px;z-index:13000}div.tooltip h4{background:url("../images/selector-arrow.png?v=1697404982690") no-repeat;font-size:95%;font-weight:700;margin:-15px 0 0;padding:15px 0 5px}div.tooltip p{font-size:90%;margin:0}.img_caption .left{float:left;margin-right:1em}.img_caption .right{float:right;margin-left:1em}.img_caption .left p{clear:left;text-align:center}.img_caption .right p{clear:right;text-align:center}.img_caption{text-align:center!important}.img_caption.none{margin-left:auto;margin-right:auto}a img.calendar{background:url("../images/calendar.png?v=ad4756") no-repeat;cursor:pointer;height:16px;margin-left:3px;vertical-align:middle;width:16px}

Binary file not shown.

View File

@ -0,0 +1,135 @@
/**
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
body {
padding: 0;
margin: 0;
font-family: arial, helvetica, sans-serif;
font-size: 14px;
color: #333;
text-align: center;
}
img {
margin-right: auto;
margin-left: auto;
border: 0 none;
}
/* -- id styles ------------------------------------- */
#frame {
max-width: 400px;
padding: 20px;
margin: 20px auto;
}
#frame img {
max-width: 100%;
height: auto;
}
#frame form {
text-align: left;
}
/* -- class styles ---------------------------------- */
.outline {
padding: 2px;
background: #fff;
border: 1px solid #ccc;
}
/* -- form styles ----------------------------------- */
form {
margin: auto;
}
form br {
display: none;
}
form p {
padding: 0.5em 0;
margin: 0;
}
form fieldset {
padding: 0.2em;
margin: 0;
border: 0 none;
}
label {
display: block;
margin: 5px 0 2px;
}
input {
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
padding: 5px 10px;
font-family: inherit;
font-size: inherit;
border: 1px solid #0e67a1;
}
input.button {
width: auto;
color: #fff;
cursor: pointer;
background-color: #006dcc;
border-color: #04c;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
input.button:hover {
background-color: #04c;
}
fieldset.input p {
clear: left;
}
#frmlogin {
margin: 0 10px;
}
#frmlogin fieldset.button {
text-align: right;
}
/* -- message styles ----------------------------------- */
.alert {
padding: 8px 25px 8px 14px;
text-align: left;
background: none repeat scroll 0 0 #fff;
border: 1px solid #ccc;
}
.alert h4 {
margin: 5px 0;
color: #f00;
}
.alert p {
padding: 0;
margin: 0;
}
.alert .close {
position: relative;
top: -2px;
right: -20px;
float: right;
font-size: 24px;
line-height: 18px;
cursor: pointer;
}
.login {
margin-top: 5px;
}

View File

@ -0,0 +1 @@
body{color:#333;font-family:arial,helvetica,sans-serif;font-size:14px;margin:0;padding:0;text-align:center}img{border:0;margin-left:auto;margin-right:auto}#frame{margin:20px auto;max-width:400px;padding:20px}#frame img{height:auto;max-width:100%}#frame form{text-align:left}.outline{background:#fff;border:1px solid #ccc;padding:2px}form{margin:auto}form br{display:none}form p{margin:0;padding:.5em 0}form fieldset{border:0;margin:0;padding:.2em}label{display:block;margin:5px 0 2px}input{border:1px solid #0e67a1;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit;font-size:inherit;padding:5px 10px;width:100%}input.button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#006dcc;border-color:#04c;color:#fff;cursor:pointer;width:auto}input.button:hover{background-color:#04c}fieldset.input p{clear:left}#frmlogin{margin:0 10px}#frmlogin fieldset.button{text-align:right}.alert{background:none repeat scroll 0 0 #fff;border:1px solid #ccc;padding:8px 25px 8px 14px;text-align:left}.alert h4{color:red;margin:5px 0}.alert p{margin:0;padding:0}.alert .close{cursor:pointer;float:right;font-size:24px;line-height:18px;position:relative;right:-20px;top:-2px}.login{margin-top:5px}

Binary file not shown.

View File

@ -0,0 +1,34 @@
/**
* @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Joomla! 4.0 Offline RTL css file
*
* @package Joomla
* @since 1.5
* @version 1.0
*/
#frame form {
text-align: right;
}
label {
float: right;
}
fieldset.input p {
clear: right;
}
/* -- message styles ----------------------------------- */
.alert {
padding: 8px 8px 25px 14px;
text-align: right;
}
.alert .close {
right: 0;
left: -20px;
float: left;
}

View File

@ -0,0 +1 @@
#frame form{text-align:right}label{float:right}fieldset.input p{clear:right}.alert{padding:8px 8px 25px 14px;text-align:right}.alert .close{float:left;left:-20px;right:0}

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1854.539" height="295" preserveAspectRatio="xMinYMin meet">
<path d="M13.573 145.7l6.9 6.9c.1.1.2.1.3.1s.2 0 .3-.1l6.9-6.9c.1-.1.1-.2.1-.3s0-.2-.1-.3l-.7-.7c-.1-.1-.2-.1-.3-.1s-.2 0-.3.1l-5.8 5.8-5.8-5.8c-.1-.1-.2-.1-.3-.1s-.2 0-.3.1l-.7.7c-.1.1-.1.2-.1.3-.296.1-.195.2-.096.3h-.002z" fill="#fff"/>
<path d="M44.54 0h1810v295h-1810z" fill="transparent"/>
</svg>

After

Width:  |  Height:  |  Size: 411 B

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1854.54 295" preserveAspectRatio="xMinYMid" width="1854.54" height="295">
<path d="M1825.1,145.7l6.9,6.9c0.1,0.1,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l6.9-6.9c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1,0-0.2-0.1-0.3l-0.7-0.7c-0.1-0.1-0.2-0.1-0.3-0.1s-0.2,0-0.3,0.1l-5.8,5.8l-5.8-5.8c-0.1-0.1-0.2-0.1-0.3-0.1c-0.1,0-0.2,0-0.3,0.1l-0.7,0.7c-0.1,0.1-0.1,0.2-0.1,0.3C1824.9,145.5,1825,145.6,1825.1,145.7z" fill="#fff"/>
<rect width="1810" height="295" fill="transparent"/>
</svg>

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<path d="m14.14 4.2v.05h-.14v.35h-.05v-.35h-.13v-.05h.32zm.04 0h.08l.11.33l.11-.33h.08v.39h-.05v-.23v-.04v-.06l-.11.33h-.05l-.11-.33v.32h-.05v-.38zm-11.48 3.35l-.29-.29c-.89-.89-1.17-2.17-.83-3.3c-.89-.2-1.56-1-1.56-1.95c0-1.11.9-2 2-2c1 0 1.82.73 1.98 1.68c1.08-.25 2.26.04 3.11.88l.12.12l-1.49 1.47l-.11-.12c-.48-.48-1.26-.48-1.74 0c-.48.48-.48 1.26 0 1.74l.29.29l1.48 1.48l1.56 1.56l-1.48 1.48l-1.56-1.57l-1.48-1.47zm1.65-1.66l1.56-1.56l1.48-1.48l.29-.29c.89-.89 2.16-1.17 3.28-.84c.14-.97.98-1.72 1.99-1.72c1.11 0 2 .9 2 2c0 1.02-.76 1.86-1.74 1.99c.32 1.12.04 2.38-.84 3.27l-.12.12l-1.48-1.48l.11-.11c.48-.48.48-1.26 0-1.74c-.48-.48-1.25-.48-1.74 0l-.29.29l-1.46 1.47l-1.56 1.56l-1.48-1.48zm6.66 7.46c-1.14.35-2.42.07-3.32-.83l-.11-.11l1.48-1.48l.11.11c.48.48 1.26.48 1.74 0c.48-.48.48-1.25 0-1.74l-.29-.29l-1.49-1.46l-1.56-1.57l1.48-1.48l1.56 1.56l1.48 1.48l.29.29c.85.85 1.14 2.05.88 3.13c.97.14 1.72.97 1.72 1.98c0 1.11-.9 2-2 2c-.98.02-1.79-.67-1.97-1.59zm-.58-4.15l-1.56 1.56l-1.48 1.48l-.29.29c-.85.85-2.06 1.14-3.15.87c-.2.89-1 1.55-1.95 1.55c-1.11 0-2-.9-2-2c0-.95.66-1.74 1.54-1.95c-.28-1.1.01-2.31.87-3.17l.11-.11l1.48 1.48l-.11.11c-.48.48-.48 1.26 0 1.74c.48.48 1.26.48 1.74 0l.29-.29l1.48-1.48l1.56-1.56l1.47 1.48z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 149.7 149.6">
<style>
path {fill: #000;}
@media (prefers-color-scheme: dark) {
path {fill: #fff;}
}
</style>
<path d="M141.4 42v.5H140V46h-.5v-3.5h-1.3V42h3.2z"/>
<path d="M141.8 42h.8l1.1 3.3 1.1-3.3h.8v3.9h-.5v-2.3-.4-.6l-1.1 3.3h-.5l-1.1-3.3V45.8h-.5V42z"/>
<g>
<path d="M27 75.5l-2.9-2.9c-8.9-8.9-11.7-21.7-8.3-33C6.9 37.6.2 29.6.2 20.1c0-11.1 9-20 20-20 10 0 18.2 7.3 19.8 16.8 10.8-2.5 22.6.4 31.1 8.8l1.2 1.2-14.9 14.7-1.1-1.2c-4.8-4.8-12.6-4.8-17.4 0-4.8 4.8-4.8 12.6 0 17.4l2.9 2.9 14.8 14.8 15.6 15.6-14.8 14.8-15.6-15.7L27 75.5z" />
<path d="M43.5 58.9l15.6-15.6 14.8-14.8 2.9-2.9c8.9-8.9 21.6-11.7 32.8-8.4C111 7.5 119.4 0 129.5 0c11.1 0 20 9 20 20 0 10.2-7.6 18.6-17.4 19.9 3.2 11.2.4 23.8-8.4 32.7l-1.2 1.2L107.7 59l1.1-1.1c4.8-4.8 4.8-12.6 0-17.4-4.8-4.8-12.5-4.8-17.4 0l-2.9 2.9-14.6 14.7-15.6 15.6-14.8-14.8z" />
<path d="M110.1 133.5c-11.4 3.5-24.2.7-33.2-8.3l-1.1-1.1 14.8-14.8 1.1 1.1c4.8 4.8 12.6 4.8 17.4 0 4.8-4.8 4.8-12.5 0-17.4l-2.9-2.9-14.9-14.6-15.6-15.7L90.5 45l15.6 15.6 14.8 14.8 2.9 2.9c8.5 8.5 11.4 20.5 8.8 31.3 9.7 1.4 17.2 9.7 17.2 19.8 0 11.1-9 20-20 20-9.8.2-17.9-6.7-19.7-15.9z" />
<path d="M104.3 92l-15.6 15.6-14.8 14.8-2.9 2.9c-8.5 8.5-20.6 11.4-31.5 8.7-2 8.9-10 15.5-19.5 15.5-11.1 0-20-9-20-20 0-9.5 6.6-17.4 15.4-19.5-2.8-11 .1-23.1 8.7-31.7l1.1-1.1L40 92l-1.1 1.1c-4.8 4.8-4.8 12.6 0 17.4 4.8 4.8 12.6 4.8 17.4 0l2.9-2.9L74 92.8l15.6-15.6L104.3 92z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1854.539" height="295" preserveAspectRatio="xMinYMin meet"><path d="M13.573 145.7l6.9 6.9c.1.1.2.1.3.1s.2 0 .3-.1l6.9-6.9c.1-.1.1-.2.1-.3s0-.2-.1-.3l-.7-.7c-.1-.1-.2-.1-.3-.1s-.2 0-.3.1l-5.8 5.8-5.8-5.8c-.1-.1-.2-.1-.3-.1s-.2 0-.3.1l-.7.7c-.1.1-.1.2-.1.3-.296.1-.195.2-.096.3h-.002z"/><path fill="#fff" d="M44.54 0h1810v295h-1810z"/></svg>

After

Width:  |  Height:  |  Size: 387 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1854.54 295" preserveAspectRatio="xMinYMid" width="1854.54" height="295"><path d="M1825.1,145.7l6.9,6.9c0.1,0.1,0.2,0.1,0.3,0.1c0.1,0,0.2,0,0.3-0.1l6.9-6.9c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1,0-0.2-0.1-0.3l-0.7-0.7c-0.1-0.1-0.2-0.1-0.3-0.1s-0.2,0-0.3,0.1l-5.8,5.8l-5.8-5.8c-0.1-0.1-0.2-0.1-0.3-0.1c-0.1,0-0.2,0-0.3,0.1l-0.7,0.7c-0.1,0.1-0.1,0.2-0.1,0.3C1824.9,145.5,1825,145.6,1825.1,145.7z" fill="#000"/><rect width="1810" height="295" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 504 B

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="m20 4.8c.4-.2.6-.4.9-.4.5 0 .8.3.9.5.2.3.9.5 1.2.5.2 0 .5-.7.7-1.3s.2-1.3.1-1.4-.9-.3-1.1-.3c-.1.1-.3.2-.7.2s-.8-.3-1.1-.6c-.5-.5-1.1-.7-1.7-.9s-1.3-.2-1.9-.2c-.9-.1-1.9-.1-2.8.2-.4.1-.7.2-1.1.4-.1.1-.4.2-.5.2-.1.1-.1.2 0 .2s.5-.1.5-.1-.5.2-.5.4c0 .1.1.1.1.1s.3-.1.5-.1c.4 0 1-.2 1.5-.2.6 0 1.2.2 1.8.8.9 1.1.8 2.5.8 2.8-.2 2.1-4.9 14.9-5.1 15.8s-.2 1.4.9 1.7 1.5 0 1.7-.4c.1-.7 3.1-16.5 4.9-17.9zm-3.9-1-16.1 2.5 2.6 16.7 8.6-1.4c-.1-.7 2.2-6.7 2.6-7.8l-4.4.7.6-1.8 3.1-.5.8 1s.2-.5.2-.7l-4.3-5.3c-.2-.3-.2-.7.1-.9l.2-.2c.3-.2.7-.2.9.1l3.8 4.4c.8-2.4 1.5-4.5 1.5-5.2.1-.2.1-.9-.2-1.6zm-12 9.9 2.7-.5-.7 1.8-1.8.3zm5.8-5.1.3.1c.4.1.5.5.4.9l-3 8-1.8 2.4.2-3 3-8c.1-.4.5-.5.9-.4zm10.8-2.8c-.4.4-.9 1.7-1.9 5.5h.1l.3 1.6-.8.1c-.1.5-.2 1-.4 1.6 1.7.9.8 3.1.7 3.1s-.1 0-.1-.1.1-.4-.2-.5c-.2-.1-.6-.2-.9-.4-.3 1.2-.6 2.6-.9 4.1l6.3-1-2.1-14.1z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,716 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "joomla",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "messages-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"core"
]
},
{
"name": "editor-decorator",
"type": "script",
"uri": "system/editors/editor-decorator.min.js",
"importmap": true
},
{
"name": "editor-api",
"type": "script",
"uri": "system/editors/editor-api.min.js",
"importmap": true,
"dependencies": [
"editor-decorator"
]
},
{
"name": "editors",
"type": "script",
"uri": "system/editors/editors.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"core",
"editor-decorator",
"editor-api",
"joomla.dialog"
]
},
{
"name": "inlinehelp-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"core"
]
},
{
"name": "template.active",
"type": "style",
"uri": "",
"description": "A dummy asset to allow to extensions to use it as dependency to active template"
},
{
"name": "template.active",
"type": "script",
"uri": "",
"description": "A dummy asset to allow to extensions to use it as dependency to active template"
},
{
"name": "searchtools",
"type": "style",
"uri": ""
},
{
"name": "highlight-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"defer": true,
"nomodule": true
},
"dependencies": [
"core"
]
},
{
"name": "field.calendar.helper",
"type": "script",
"uri": ""
},
{
"name": "joomla.batch-copymove",
"type": "script",
"uri": "layouts/joomla/html/batch/batch-copymove.min.js",
"attributes": {
"defer": true
}
},
{
"name": "webcomponent.field-fancy-select-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill",
"choicesjs"
]
},
{
"name": "webcomponent.media-select-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-media-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-module-order-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-permissions-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-send-test-mail-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-simple-color-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-subform-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.field-user-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.core-loader-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.hidden-mail-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "webcomponent.toolbar-button-legacy",
"type": "script",
"deprecated": true,
"uri": "",
"attributes": {
"nomodule": true,
"defer": true
},
"dependencies": [
"wcpolyfill"
]
},
{
"name": "core",
"type": "script",
"class": "CoreAssetItem",
"uri": "system/core.min.js",
"version": "508d9d"
},
{
"name": "keepalive",
"type": "script",
"class": "KeepaliveAssetItem",
"dependencies": [
"core"
],
"uri": "system/keepalive.min.js",
"attributes": {
"type": "module"
},
"version": "e3b1cf"
},
{
"name": "inlinehelp",
"type": "script",
"uri": "system/inlinehelp.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"inlinehelp-legacy"
],
"version": "8442ef"
},
{
"name": "messages",
"type": "script",
"uri": "system/messages.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"messages-legacy"
],
"version": "29393d"
},
{
"name": "multiselect",
"type": "script",
"dependencies": [
"core"
],
"uri": "system/multiselect.min.js",
"attributes": {
"defer": true
},
"version": "c17970"
},
{
"name": "showon",
"type": "script",
"dependencies": [
"core"
],
"uri": "system/showon.min.js",
"attributes": {
"type": "module"
},
"version": "e5a409"
},
{
"name": "switcher",
"type": "style",
"uri": "system/fields/switcher.min.css",
"version": "3fb2c3"
},
{
"name": "searchtools",
"type": "script",
"dependencies": [
"core"
],
"uri": "system/searchtools.min.js",
"attributes": {
"defer": true
},
"version": "dfc09d"
},
{
"name": "field.color-adv",
"type": "script",
"uri": "system/fields/color-field-adv-init.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"minicolors"
],
"version": "443295"
},
{
"name": "highlight",
"type": "script",
"uri": "system/highlight.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"highlight-legacy"
],
"version": "a4ae97"
},
{
"name": "joomla.draggable",
"type": "script",
"uri": "system/draggable.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"dragula"
],
"version": "1abcf0"
},
{
"name": "field.passwordview",
"type": "script",
"uri": "system/fields/passwordview.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"core"
],
"version": "560d07"
},
{
"name": "field.passwordstrength",
"type": "script",
"uri": "system/fields/passwordstrength.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"core",
"form.validate"
],
"version": "0a4b6c"
},
{
"name": "field.calendar",
"type": "style",
"uri": "system/fields/calendar.css",
"version": "4bdacc"
},
{
"name": "field.calendar",
"type": "script",
"uri": "system/fields/calendar.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"field.calendar.helper"
],
"version": "5e46f6"
},
{
"name": "field.calendar-rtl",
"type": "style",
"uri": "system/fields/calendar-rtl.css",
"version": "aece2f"
},
{
"name": "field.color-slider",
"type": "script",
"uri": "system/fields/joomla-field-color-slider.min.js",
"attributes": {
"defer": true
},
"version": "566b39"
},
{
"name": "field.modal-fields",
"type": "script",
"uri": "system/fields/modal-fields.min.js",
"dependencies": [
"core"
],
"attributes": {
"defer": true
},
"deprecated": true,
"deprecatedMsg": "Use [modal-content-select-field] asset instead. To be removed in Joomla 6.",
"version": "b586e1"
},
{
"name": "webcomponent.field-fancy-select",
"type": "script",
"uri": "system/fields/joomla-field-fancy-select.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"choicesjs",
"webcomponent.field-fancy-select-legacy"
],
"version": "7bd4a0"
},
{
"name": "webcomponent.field-media",
"type": "style",
"uri": "system/fields/joomla-field-media.min.css",
"version": "3f94e4"
},
{
"name": "webcomponent.media-select",
"type": "style",
"uri": "system/fields/joomla-media-select.min.css",
"version": "d66304"
},
{
"name": "webcomponent.media-select",
"type": "script",
"uri": "system/fields/joomla-media-select.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.media-select-legacy"
],
"version": "ba797e"
},
{
"name": "webcomponent.field-media",
"type": "script",
"uri": "system/fields/joomla-field-media.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-media-legacy"
],
"version": "a05226"
},
{
"name": "webcomponent.field-module-order",
"type": "script",
"uri": "system/fields/joomla-field-module-order.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-module-order-legacy"
],
"version": "4e953c"
},
{
"name": "webcomponent.field-permissions",
"type": "style",
"uri": "system/fields/joomla-field-permissions.min.css",
"version": "f02305"
},
{
"name": "webcomponent.field-permissions",
"type": "script",
"uri": "system/fields/joomla-field-permissions.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-permissions-legacy"
],
"version": "475fc5"
},
{
"name": "webcomponent.field-send-test-mail",
"type": "script",
"uri": "system/fields/joomla-field-send-test-mail.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-send-test-mail-legacy"
],
"version": "126cf4"
},
{
"name": "webcomponent.field-simple-color",
"type": "style",
"uri": "system/fields/joomla-field-simple-color.min.css",
"version": "10916d"
},
{
"name": "form.validate",
"type": "script",
"class": "FormValidateAssetItem",
"attributes": {
"defer": true
},
"dependencies": [
"core"
],
"uri": "system/fields/validate.min.js",
"version": "4ccc1a"
},
{
"name": "webcomponent.field-simple-color",
"type": "script",
"uri": "system/fields/joomla-field-simple-color.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-simple-color-legacy"
],
"version": "4ad748"
},
{
"name": "webcomponent.field-subform",
"type": "script",
"uri": "system/fields/joomla-field-subform.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-subform-legacy"
],
"version": "3a9f9e"
},
{
"name": "webcomponent.field-user",
"type": "script",
"uri": "system/fields/joomla-field-user.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.field-user-legacy",
"joomla.dialog"
],
"version": "5d4dbf"
},
{
"name": "webcomponent.hidden-mail",
"type": "script",
"uri": "system/joomla-hidden-mail.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.hidden-mail-legacy"
],
"version": "82da35"
},
{
"name": "webcomponent.core-loader",
"type": "script",
"uri": "system/joomla-core-loader.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.core-loader-legacy"
],
"version": "3ac781"
},
{
"name": "webcomponent.toolbar-button",
"type": "script",
"uri": "system/joomla-toolbar-button.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"webcomponent.toolbar-button-legacy",
"joomla.dialog"
],
"version": "60530b"
},
{
"name": "joomla.dialog",
"type": "script",
"uri": "system/joomla-dialog.min.js",
"importmap": true,
"dependencies": [
"wcpolyfill",
"core"
],
"version": "aac472"
},
{
"name": "joomla.dialog-autocreate",
"type": "script",
"uri": "system/joomla-dialog-autocreate.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"joomla.dialog"
],
"version": "8544d0"
},
{
"name": "list-view",
"type": "script",
"uri": "system/list-view.min.js",
"attributes": {
"type": "module"
},
"dependencies": [
"core"
],
"version": "1c5fe7"
},
{
"type": "script",
"name": "modal-content-select",
"dependencies": [
"core"
],
"uri": "system/modal-content-select.min.js",
"attributes": {
"type": "module"
},
"version": "59ccb1"
},
{
"type": "script",
"name": "modal-content-select-field",
"dependencies": [
"core",
"joomla.dialog"
],
"uri": "system/fields/modal-content-select-field.min.js",
"attributes": {
"type": "module"
},
"version": "b6f2b3"
},
{
"name": "table.columns",
"type": "script",
"class": "TableColumnsAssetItem",
"uri": "system/table-columns.min.js",
"dependencies": [
"core"
],
"attributes": {
"defer": true,
"type": "module"
},
"version": "11ecef"
}
]
}

748
media/system/js/core.js Normal file
View File

@ -0,0 +1,748 @@
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
/**
* --------------------------------------------------------------------------
* Bootstrap util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
// js-docs-end allow-list
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
/**
* A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
* contexts.
*
* Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
*/
// eslint-disable-next-line unicorn/better-regex
const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
const allowedAttribute = (attribute, allowedAttributeList) => {
const attributeName = attribute.nodeName.toLowerCase();
if (allowedAttributeList.includes(attributeName)) {
if (uriAttributes.has(attributeName)) {
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
}
return true;
}
// Check if a regular expression validates the attribute.
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
};
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
if (!unsafeHtml.length) {
return unsafeHtml;
}
if (sanitizeFunction && typeof sanitizeFunction === 'function') {
return sanitizeFunction(unsafeHtml);
}
const domParser = new window.DOMParser();
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
for (const element of elements) {
const elementName = element.nodeName.toLowerCase();
if (!Object.keys(allowList).includes(elementName)) {
element.remove();
continue;
}
const attributeList = [].concat(...element.attributes);
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
for (const attribute of attributeList) {
if (!allowedAttribute(attribute, allowedAttributes)) {
element.removeAttribute(attribute.nodeName);
}
}
}
return createdDocument.body.innerHTML;
}
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
const DATA_ATTRIBUTE_PATTERN = /^data-[\w-]*$/i;
const DefaultAllowlist = {
// Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN, DATA_ATTRIBUTE_PATTERN],
a: ['target', 'href', 'title', 'rel'],
area: [],
b: [],
br: [],
col: [],
code: [],
div: [],
em: [],
hr: [],
h1: [],
h2: [],
h3: [],
h4: [],
h5: [],
h6: [],
i: [],
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
li: [],
ol: [],
p: [],
pre: [],
s: [],
small: [],
span: [],
sub: [],
sup: [],
strong: [],
u: [],
ul: [],
button: ['type'],
input: ['accept', 'alt', 'autocomplete', 'autofocus', 'capture', 'checked', 'dirname', 'disabled', 'height', 'list', 'max', 'maxlength', 'min', 'minlength', 'multiple', 'type', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'size', 'src', 'step', 'value', 'width', 'inputmode'],
select: ['name'],
textarea: ['name'],
option: ['value', 'selected']
};
// Only define the Joomla namespace if not defined.
window.Joomla = window.Joomla || {};
window.Joomla.Modal = window.Joomla.Modal || {
/**
* *****************************************************************
* Modals should implement
* *****************************************************************
*
* getCurrent Type Function Should return the modal element
* setCurrent Type Function Should set the modal element
* current Type {node} The modal element
*
* USAGE (assuming that exampleId is the modal id)
* To get the current modal element:
* Joomla.Modal.getCurrent(); // Returns node element, eg: document.getElementById('exampleId')
* To set the current modal element:
* Joomla.Modal.setCurrent(document.getElementById('exampleId'));
*
* *************************************************************
* Joomla's UI modal uses `element.close();` to close the modal
* and `element.open();` to open the modal
* If you are using another modal make sure the same
* functionality is bound to the modal element
* @see media/legacy/bootstrap.init.js
* *************************************************************
*/
current: '',
setCurrent: element => {
window.Joomla.Modal.current = element;
},
getCurrent: () => window.Joomla.Modal.current
};
(Joomla => {
/**
* Method to Extend Objects
*
* @param {Object} destination
* @param {Object} source
*
* @return Object
*/
Joomla.extend = (destination, source) => {
let newDestination = destination;
/**
* Technically null is an object, but trying to treat the destination as one in this
* context will error out.
* So emulate jQuery.extend(), and treat a destination null as an empty object.
*/
if (destination === null) {
newDestination = {};
}
[].slice.call(Object.keys(source)).forEach(key => {
newDestination[key] = source[key];
});
return destination;
};
/**
* Joomla options storage
*
* @type {{}}
*
* @since 3.7.0
*/
Joomla.optionsStorage = Joomla.optionsStorage || null;
/**
* Get script(s) options
*
* @param {String} key Name in Storage
* @param {mixed} def Default value if nothing found
*
* @return {mixed}
*
* @since 3.7.0
*/
Joomla.getOptions = (key, def) => {
// Load options if they not exists
if (!Joomla.optionsStorage) {
Joomla.loadOptions();
}
return Joomla.optionsStorage[key] !== undefined ? Joomla.optionsStorage[key] : def;
};
/**
* Load new options from given options object or from Element
*
* @param {Object|undefined} options The options object to load.
* Eg {"com_foobar" : {"option1": 1, "option2": 2}}
*
* @since 3.7.0
*/
Joomla.loadOptions = options => {
// Load form the script container
if (!options) {
const elements = [].slice.call(document.querySelectorAll('.joomla-script-options.new'));
let counter = 0;
elements.forEach(element => {
const str = element.text || element.textContent;
const option = JSON.parse(str);
if (option) {
Joomla.loadOptions(option);
counter += 1;
}
element.className = element.className.replace(' new', ' loaded');
});
if (counter) {
return;
}
}
// Initial loading
if (!Joomla.optionsStorage) {
Joomla.optionsStorage = options || {};
} else if (options) {
// Merge with existing
[].slice.call(Object.keys(options)).forEach(key => {
/**
* If both existing and new options are objects, merge them with Joomla.extend().
* But test for new option being null, as null is an object, but we want to allow
* clearing of options with ...
*
* Joomla.loadOptions({'joomla.jtext': null});
*/
if (options[key] !== null && typeof Joomla.optionsStorage[key] === 'object' && typeof options[key] === 'object') {
Joomla.optionsStorage[key] = Joomla.extend(Joomla.optionsStorage[key], options[key]);
} else {
Joomla.optionsStorage[key] = options[key];
}
});
}
};
/**
* Custom behavior for JavaScript I18N in Joomla! 1.6
*
* @type {{}}
*
* Allows you to call Joomla.Text._() to get a translated JavaScript string
* pushed in with Text::script() in Joomla.
*/
Joomla.Text = {
strings: {},
/**
* Translates a string into the current language.
*
* @param {String} key The string to translate
* @param {String} def Default string
*
* @returns {String}
*/
_: (key, def) => {
let newKey = key;
let newDef = def;
// Check for new strings in the optionsStorage, and load them
const newStrings = Joomla.getOptions('joomla.jtext');
if (newStrings) {
Joomla.Text.load(newStrings);
// Clean up the optionsStorage from useless data
Joomla.loadOptions({
'joomla.jtext': null
});
}
newDef = newDef === undefined ? newKey : newDef;
newKey = newKey.toUpperCase();
return Joomla.Text.strings[newKey] !== undefined ? Joomla.Text.strings[newKey] : newDef;
},
/**
* Load new strings in to Joomla.Text
*
* @param {Object} object Object with new strings
* @returns {Joomla.Text}
*/
load: object => {
[].slice.call(Object.keys(object)).forEach(key => {
Joomla.Text.strings[key.toUpperCase()] = object[key];
});
return Joomla.Text;
}
};
/**
* For B/C we still support Joomla.JText
*
* @type {{}}
*
* @deprecated 4.0 will be removed in 6.0
* Example: Joomla.Text._('...');
* Joomla.Text.load(...);
*/
Joomla.JText = Joomla.Text;
/**
* Generic submit form
*
* @param {String} task The given task
* @param {node} form The form element
* @param {bool} validate The form element
*
* @returns {void}
*/
Joomla.submitform = (task, form, validate) => {
let newForm = form;
const newTask = task;
if (!newForm) {
newForm = document.getElementById('adminForm');
}
if (newTask) {
newForm.task.value = newTask;
}
// Toggle HTML5 validation
newForm.noValidate = !validate;
if (!validate) {
newForm.setAttribute('novalidate', '');
} else if (newForm.hasAttribute('novalidate')) {
newForm.removeAttribute('novalidate');
}
// Submit the form.
// Create the input type="submit"
const button = document.createElement('input');
button.classList.add('hidden');
button.type = 'submit';
// Append it and click it
newForm.appendChild(button).click();
// If "submit" was prevented, make sure we don't get a build up of buttons
newForm.removeChild(button);
};
/**
* Default function. Can be overridden by the component to add custom logic
*
* @param {String} task The given task
* @param {String} formSelector The form selector eg '#adminForm'
* @param {bool} validate The form element
*
* @returns {void}
*/
Joomla.submitbutton = (task, formSelector, validate) => {
let form = document.querySelector(formSelector || 'form.form-validate');
let newValidate = validate;
if (typeof formSelector === 'string' && form === null) {
form = document.querySelector(`#${formSelector}`);
}
if (form) {
if (newValidate === undefined || newValidate === null) {
const pressbutton = task.split('.');
let cancelTask = form.getAttribute('data-cancel-task');
if (!cancelTask) {
cancelTask = `${pressbutton[0]}.cancel`;
}
newValidate = task !== cancelTask;
}
if (!newValidate || document.formvalidator.isValid(form)) {
Joomla.submitform(task, form);
}
} else {
Joomla.submitform(task);
}
};
/**
* USED IN: all list forms.
*
* Toggles the check state of a group of boxes
*
* Checkboxes must have an id attribute in the form cb0, cb1...
*
* @param {mixed} checkbox The number of box to 'check', for a checkbox element
* @param {string} stub An alternative field name
*
* @return {boolean}
*/
Joomla.checkAll = (checkbox, stub) => {
if (!checkbox.form) {
return false;
}
const currentStab = stub || 'cb';
const elements = [].slice.call(checkbox.form.elements);
let state = 0;
elements.forEach(element => {
if (element.type === checkbox.type && element.id.indexOf(currentStab) === 0) {
element.checked = checkbox.checked;
state += element.checked ? 1 : 0;
}
});
if (checkbox.form.boxchecked) {
checkbox.form.boxchecked.value = state;
checkbox.form.boxchecked.dispatchEvent(new CustomEvent('change', {
bubbles: true,
cancelable: true
}));
}
return true;
};
/**
* USED IN: administrator/components/com_cache/views/cache/tmpl/default.php
* administrator/components/com_installer/views/discover/tmpl/default_item.php
* administrator/components/com_installer/views/update/tmpl/default_item.php
* administrator/components/com_languages/helpers/html/languages.php
* libraries/joomla/html/html/grid.php
*
* @param {boolean} isitchecked Flag for checked
* @param {node} form The form
*
* @return {void}
*/
Joomla.isChecked = (isitchecked, form) => {
let newForm = form;
if (typeof newForm === 'undefined') {
newForm = document.getElementById('adminForm');
} else if (typeof form === 'string') {
newForm = document.getElementById(form);
}
newForm.boxchecked.value = isitchecked ? parseInt(newForm.boxchecked.value, 10) + 1 : parseInt(newForm.boxchecked.value, 10) - 1;
newForm.boxchecked.dispatchEvent(new CustomEvent('change', {
bubbles: true,
cancelable: true
}));
// If we don't have a checkall-toggle, done.
if (!newForm.elements['checkall-toggle']) {
return;
}
// Toggle main toggle checkbox depending on checkbox selection
let c = true;
let i;
let e;
let n;
// eslint-disable-next-line no-plusplus
for (i = 0, n = newForm.elements.length; i < n; i++) {
e = newForm.elements[i];
if (e.type === 'checkbox' && e.name !== 'checkall-toggle' && !e.checked) {
c = false;
break;
}
}
newForm.elements['checkall-toggle'].checked = c;
};
/**
* USED IN: libraries/joomla/html/html/grid.php
* In other words, on any reorderable table
*
* @param {string} order The order value
* @param {string} dir The direction
* @param {string} task The task
* @param {node} form The form
*
* return {void}
*/
Joomla.tableOrdering = (order, dir, task, form) => {
let newForm = form;
if (typeof newForm === 'undefined') {
newForm = document.getElementById('adminForm');
} else if (typeof form === 'string') {
newForm = document.getElementById(form);
}
newForm.filter_order.value = order;
newForm.filter_order_Dir.value = dir;
Joomla.submitform(task, newForm);
};
/**
* USED IN: all over :)
*
* @param {string} id The id
* @param {string} task The task
* @param {string} form The optional form
*
* @return {boolean}
*/
Joomla.listItemTask = (id, task, form = null) => {
let newForm = form;
if (form !== null) {
newForm = document.getElementById(form);
} else {
newForm = document.adminForm;
}
const cb = newForm[id];
let i = 0;
let cbx;
if (!cb) {
return false;
}
// eslint-disable-next-line no-constant-condition
while (true) {
cbx = newForm[`cb${i}`];
if (!cbx) {
break;
}
cbx.checked = false;
i += 1;
}
cb.checked = true;
newForm.boxchecked.value = 1;
Joomla.submitform(task, newForm);
return false;
};
/**
* Method to replace all request tokens on the page with a new one.
*
* @param {String} newToken The token
*
* Used in Joomla Installation
*/
Joomla.replaceTokens = newToken => {
if (!/^[0-9A-F]{32}$/i.test(newToken)) {
return;
}
const elements = [].slice.call(document.getElementsByTagName('input'));
elements.forEach(element => {
if (element.type === 'hidden' && element.value === '1' && element.name.length === 32) {
element.name = newToken;
}
});
};
/**
* Method to perform AJAX request
*
* @param {Object} options Request options:
* {
* url: 'index.php', Request URL
* method: 'GET', Request method GET (default), POST
* data: null, Data to be sent, see
* https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/send
* perform: true, Perform the request immediately
* or return XMLHttpRequest instance and perform it later
* headers: null, Object of custom headers, eg {'X-Foo': 'Bar', 'X-Bar': 'Foo'}
* promise: false Whether return a Promise instance.
* When true then next options is ignored: perform, onSuccess, onError, onComplete
*
* onBefore: (xhr) => {} // Callback on before the request
* onSuccess: (response, xhr) => {}, // Callback on the request success
* onError: (xhr) => {}, // Callback on the request error
* onComplete: (xhr) => {}, // Callback on the request completed, with/without error
* }
*
* @return XMLHttpRequest|Boolean
*
* @example
*
* Joomla.request({
* url: 'index.php?option=com_example&view=example',
* onSuccess: (response, xhr) => {
* JSON.parse(response);
* }
* })
*
* @see https://developer.mozilla.org/docs/Web/API/XMLHttpRequest
*/
Joomla.request = options => {
// Prepare the options
const newOptions = Joomla.extend({
url: '',
method: 'GET',
data: null,
perform: true,
promise: false
}, options);
// Setup XMLHttpRequest instance
const createRequest = (onSuccess, onError) => {
const xhr = new XMLHttpRequest();
xhr.open(newOptions.method, newOptions.url, true);
// Set the headers
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('X-Ajax-Engine', 'Joomla!');
if (newOptions.method !== 'GET') {
const token = Joomla.getOptions('csrf.token', '');
// Use the CSRF only on the site's domain
if (token && (!newOptions.url.startsWith('http:') && !newOptions.url.startsWith('https:') || newOptions.url.startsWith(window.location.origin))) {
xhr.setRequestHeader('X-CSRF-Token', token);
}
if (typeof newOptions.data === 'string' && (!newOptions.headers || !newOptions.headers['Content-Type'])) {
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
}
}
// Custom headers
if (newOptions.headers) {
[].slice.call(Object.keys(newOptions.headers)).forEach(key => {
// Allow request without Content-Type
// eslint-disable-next-line no-empty
if (key === 'Content-Type' && newOptions.headers['Content-Type'] === 'false') ; else {
xhr.setRequestHeader(key, newOptions.headers[key]);
}
});
}
xhr.onreadystatechange = () => {
// Request not finished
if (xhr.readyState !== 4) {
return;
}
// Request finished and response is ready
if (xhr.status === 200) {
if (newOptions.promise) {
// A Promise accepts only one argument
onSuccess.call(window, xhr);
} else {
onSuccess.call(window, xhr.responseText, xhr);
}
} else {
onError.call(window, xhr);
}
if (newOptions.onComplete && !newOptions.promise) {
newOptions.onComplete.call(window, xhr);
}
};
// Do request
if (newOptions.perform) {
if (newOptions.onBefore && newOptions.onBefore.call(window, xhr) === false) {
// Request interrupted
if (newOptions.promise) {
onSuccess.call(window, xhr);
}
return xhr;
}
xhr.send(newOptions.data);
}
return xhr;
};
// Return a Promise
if (newOptions.promise) {
return new Promise((resolve, reject) => {
newOptions.perform = true;
createRequest(resolve, reject);
});
}
// Return a Request
try {
return createRequest(newOptions.onSuccess || (() => {}), newOptions.onError || (() => {}));
} catch (error) {
// eslint-disable-next-line no-unused-expressions,no-console
console.error(error);
return false;
}
};
let lastRequestPromise;
/**
* Joomla Request queue.
*
* A FIFO queue of requests to execute serially. Used to prevent simultaneous execution of
* multiple requests against the server which could trigger its Denial of Service protection.
*
* @param {object} options Options for Joomla.request()
* @returns {Promise}
*/
Joomla.enqueueRequest = options => {
if (!options.promise) {
throw new Error('Joomla.enqueueRequest supports only Joomla.request as Promise');
}
if (!lastRequestPromise) {
lastRequestPromise = Joomla.request(options);
} else {
lastRequestPromise = lastRequestPromise.then(() => Joomla.request(options));
}
return lastRequestPromise;
};
/**
*
* @param {string} unsafeHtml The html for sanitization
* @param {object} allowList The list of HTMLElements with an array of allowed attributes
* @param {function} sanitizeFn A custom sanitization function
*
* @return string
*/
Joomla.sanitizeHtml = (unsafeHtml, allowList, sanitizeFn) => {
const allowed = allowList === undefined || allowList === null ? DefaultAllowlist : _extends({}, DefaultAllowlist, allowList);
return sanitizeHtml(unsafeHtml, allowed, sanitizeFn);
};
/**
* Treat AJAX errors.
* Used by some javascripts such as sendtestmail.js and permissions.js
*
* @param {object} xhr XHR object.
* @param {string} textStatus Type of error that occurred.
* @param {string} error Textual portion of the HTTP status.
*
* @return {object} JavaScript object containing the system error message.
*
* @since 3.6.0
*/
Joomla.ajaxErrorsMessages = (xhr, textStatus) => {
const msg = {};
if (textStatus === 'parsererror') {
// For jQuery jqXHR
const buf = [];
// Html entity encode.
let encodedJson = xhr.responseText.trim();
// eslint-disable-next-line no-plusplus
for (let i = encodedJson.length - 1; i >= 0; i--) {
buf.unshift(['&#', encodedJson[i].charCodeAt(), ';'].join(''));
}
encodedJson = buf.join('');
msg.error = [Joomla.Text._('JLIB_JS_AJAX_ERROR_PARSE').replace('%s', encodedJson)];
} else if (textStatus === 'nocontent') {
msg.error = [Joomla.Text._('JLIB_JS_AJAX_ERROR_NO_CONTENT')];
} else if (textStatus === 'timeout') {
msg.error = [Joomla.Text._('JLIB_JS_AJAX_ERROR_TIMEOUT')];
} else if (textStatus === 'abort') {
msg.error = [Joomla.Text._('JLIB_JS_AJAX_ERROR_CONNECTION_ABORT')];
} else if (xhr.responseJSON && xhr.responseJSON.message) {
// For vanilla XHR
msg.error = [`${Joomla.Text._('JLIB_JS_AJAX_ERROR_OTHER').replace('%s', xhr.status)} <em>${xhr.responseJSON.message}</em>`];
} else if (xhr.statusText) {
msg.error = [`${Joomla.Text._('JLIB_JS_AJAX_ERROR_OTHER').replace('%s', xhr.status)} <em>${xhr.statusText}</em>`];
} else {
msg.error = [Joomla.Text._('JLIB_JS_AJAX_ERROR_OTHER').replace('%s', xhr.status)];
}
return msg;
};
})(Joomla);

1
media/system/js/core.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,175 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// The container where the draggable will be enabled
let url;
let direction;
let isNested;
let dragElementIndex;
let dropElementIndex;
let container = document.querySelector('.js-draggable');
let form;
let formData;
if (container) {
/** The script expects a form with a class js-form
* A table with the tbody with a class js-draggable
* with a data-url with the ajax request end point and
* with a data-direction for asc/desc
*/
url = container.dataset.url;
direction = container.dataset.direction;
isNested = container.dataset.nested;
} else if (Joomla.getOptions('draggable-list')) {
const options = Joomla.getOptions('draggable-list');
container = document.querySelector(options.id);
/**
* This is here to make the transition to new forms easier.
*/
if (!container.classList.contains('js-draggable')) {
container.classList.add('js-draggable');
}
({
url
} = options);
({
direction
} = options);
isNested = options.nested;
}
if (container) {
// Get the form
form = container.closest('form');
// Get the form data
formData = new FormData(form);
formData.delete('task');
formData.delete('order[]');
// IOS 10 BUG
document.addEventListener('touchstart', () => {}, false);
const getOrderData = (rows, inputRows, dragIndex, dropIndex) => {
let i;
const result = [];
// Element is moved down
if (dragIndex < dropIndex) {
rows[dropIndex].value = rows[dropIndex - 1].value;
for (i = dragIndex; i < dropIndex; i += 1) {
if (direction === 'asc') {
rows[i].value = parseInt(rows[i].value, 10) - 1;
} else {
rows[i].value = parseInt(rows[i].value, 10) + 1;
}
}
} else {
// Element is moved up
rows[dropIndex].value = rows[dropIndex + 1].value;
for (i = dropIndex + 1; i <= dragIndex; i += 1) {
if (direction === 'asc') {
rows[i].value = parseInt(rows[i].value, 10) + 1;
} else {
rows[i].value = parseInt(rows[i].value, 10) - 1;
}
}
}
for (i = 0; i < rows.length - 1; i += 1) {
result.push(`order[]=${encodeURIComponent(rows[i].value)}`);
result.push(`cid[]=${encodeURIComponent(inputRows[i].value)}`);
}
return result;
};
const rearrangeChildren = $parent => {
if (!$parent.dataset.itemId) {
return;
}
const parentId = $parent.dataset.itemId;
// Get children list. Each child row should have
// an attribute data-parents=" 1 2 3" where the number is id of parent
const $children = container.querySelectorAll(`tr[data-parents~="${parentId}"]`);
if ($children.length) {
$parent.after(...$children);
}
};
const saveTheOrder = el => {
let orderSelector;
let inputSelector;
let rowSelector;
const groupId = el.dataset.draggableGroup;
if (groupId) {
rowSelector = `tr[data-draggable-group="${groupId}"]`;
orderSelector = `[data-draggable-group="${groupId}"] [name="order[]"]`;
inputSelector = `[data-draggable-group="${groupId}"] [name="cid[]"]`;
} else {
rowSelector = 'tr';
orderSelector = '[name="order[]"]';
inputSelector = '[name="cid[]"]';
}
const rowElements = [].slice.call(container.querySelectorAll(rowSelector));
const rows = [].slice.call(container.querySelectorAll(orderSelector));
const inputRows = [].slice.call(container.querySelectorAll(inputSelector));
dropElementIndex = rowElements.indexOf(el);
if (url) {
// Detach task field if exists
const task = document.querySelector('[name="task"]');
// Detach task field if exists
if (task) {
task.setAttribute('name', 'some__Temporary__Name__');
}
// Prepare the options
const ajaxOptions = {
url,
method: 'POST',
data: `${new URLSearchParams(formData).toString()}&${getOrderData(rows, inputRows, dragElementIndex, dropElementIndex).join('&')}`,
perform: true
};
Joomla.request(ajaxOptions);
// Re-Append original task field
if (task) {
task.setAttribute('name', 'task');
}
}
// Update positions for a children of the moved item
rearrangeChildren(el);
};
// eslint-disable-next-line no-undef
dragula([container], {
// Y axis is considered when determining where an element would be dropped
direction: 'vertical',
// elements are moved by default, not copied
copy: false,
// elements in copy-source containers can be reordered
// copySortSource: true,
// spilling will put the element back where it was dragged from, if this is true
revertOnSpill: true,
// spilling will `.remove` the element, if this is true
// removeOnSpill: false,
accepts(el, target, source, sibling) {
if (isNested) {
if (sibling !== null) {
return sibling.dataset.draggableGroup && sibling.dataset.draggableGroup === el.dataset.draggableGroup;
}
return sibling === null || sibling && sibling.tagName.toLowerCase() === 'tr';
}
return sibling === null || sibling && sibling.tagName.toLowerCase() === 'tr';
},
mirrorContainer: container
}).on('drag', el => {
let rowSelector;
const groupId = el.dataset.draggableGroup;
if (groupId) {
rowSelector = `tr[data-draggable-group="${groupId}"]`;
} else {
rowSelector = 'tr';
}
const rowElements = [].slice.call(container.querySelectorAll(rowSelector));
dragElementIndex = rowElements.indexOf(el);
}).on('drop', el => {
saveTheOrder(el);
});
}

1
media/system/js/draggable.min.js vendored Normal file
View File

@ -0,0 +1 @@
let url,direction,isNested,dragElementIndex,dropElementIndex,form,formData,container=document.querySelector(".js-draggable");if(container)url=container.dataset.url,direction=container.dataset.direction,isNested=container.dataset.nested;else if(Joomla.getOptions("draggable-list")){const e=Joomla.getOptions("draggable-list");container=document.querySelector(e.id),container.classList.contains("js-draggable")||container.classList.add("js-draggable"),({url:url}=e),({direction:direction}=e),isNested=e.nested}if(container){form=container.closest("form"),formData=new FormData(form),formData.delete("task"),formData.delete("order[]"),document.addEventListener("touchstart",(()=>{}),!1);const e=(e,t,a,r)=>{let n;const o=[];if(a<r)for(e[r].value=e[r-1].value,n=a;n<r;n+=1)e[n].value="asc"===direction?parseInt(e[n].value,10)-1:parseInt(e[n].value,10)+1;else for(e[r].value=e[r+1].value,n=r+1;n<=a;n+=1)e[n].value="asc"===direction?parseInt(e[n].value,10)+1:parseInt(e[n].value,10)-1;for(n=0;n<e.length-1;n+=1)o.push(`order[]=${encodeURIComponent(e[n].value)}`),o.push(`cid[]=${encodeURIComponent(t[n].value)}`);return o},t=e=>{if(!e.dataset.itemId)return;const t=e.dataset.itemId,a=container.querySelectorAll(`tr[data-parents~="${t}"]`);a.length&&e.after(...a)},a=a=>{let r,n,o;const l=a.dataset.draggableGroup;l?(o=`tr[data-draggable-group="${l}"]`,r=`[data-draggable-group="${l}"] [name="order[]"]`,n=`[data-draggable-group="${l}"] [name="cid[]"]`):(o="tr",r='[name="order[]"]',n='[name="cid[]"]');const d=[].slice.call(container.querySelectorAll(o)),s=[].slice.call(container.querySelectorAll(r)),c=[].slice.call(container.querySelectorAll(n));if(dropElementIndex=d.indexOf(a),url){const t=document.querySelector('[name="task"]');t&&t.setAttribute("name","some__Temporary__Name__");const a={url:url,method:"POST",data:`${new URLSearchParams(formData).toString()}&${e(s,c,dragElementIndex,dropElementIndex).join("&")}`,perform:!0};Joomla.request(a),t&&t.setAttribute("name","task")}t(a)};dragula([container],{direction:"vertical",copy:!1,revertOnSpill:!0,accepts:(e,t,a,r)=>isNested&&null!==r?r.dataset.draggableGroup&&r.dataset.draggableGroup===e.dataset.draggableGroup:null===r||r&&"tr"===r.tagName.toLowerCase(),mirrorContainer:container}).on("drag",(e=>{let t;const a=e.dataset.draggableGroup;t=a?`tr[data-draggable-group="${a}"]`:"tr";const r=[].slice.call(container.querySelectorAll(t));dragElementIndex=r.indexOf(e)})).on("drop",(e=>{a(e)}))}

Binary file not shown.

View File

@ -0,0 +1,175 @@
import JoomlaEditorDecorator from 'editor-decorator';
export { default as JoomlaEditorDecorator } from 'editor-decorator';
/**
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Editor API.
*/
const JoomlaEditor = {
/**
* Internal! The property should not be accessed directly.
*
* List of registered editors.
*/
instances: {},
/**
* Internal! The property should not be accessed directly.
*
* An active editor instance.
*/
active: null,
/**
* Register editor instance.
*
* @param {JoomlaEditorDecorator} editor The editor instance.
*
* @returns {JoomlaEditor}
*/
register(editor) {
if (!(editor instanceof JoomlaEditorDecorator)) {
throw new Error('Unexpected editor instance');
}
this.instances[editor.getId()] = editor;
// For backward compatibility
Joomla.editors.instances[editor.getId()] = editor;
return this;
},
/**
* Unregister editor instance.
*
* @param {JoomlaEditorDecorator|string} editor The editor instance or ID.
*
* @returns {JoomlaEditor}
*/
unregister(editor) {
let id;
if (editor instanceof JoomlaEditorDecorator) {
id = editor.getId();
} else if (typeof editor === 'string') {
id = editor;
} else {
throw new Error('Unexpected editor instance or identifier');
}
if (this.active && this.active === this.instances[id]) {
this.active = null;
}
delete this.instances[id];
// For backward compatibility
delete Joomla.editors.instances[id];
return this;
},
/**
* Return editor instance by ID.
*
* @param {String} id
*
* @returns {JoomlaEditorDecorator|boolean}
*/
get(id) {
return this.instances[id] || false;
},
/**
* Set currently active editor, the editor that in focus.
*
* @param {JoomlaEditorDecorator|string} editor The editor instance or ID.
*
* @returns {JoomlaEditor}
*/
setActive(editor) {
if (editor instanceof JoomlaEditorDecorator) {
this.active = editor;
} else if (this.instances[editor]) {
this.active = this.instances[editor];
} else {
throw new Error('The editor instance not found or it is incorrect');
}
return this;
},
/**
* Return active editor, if there exist eny.
*
* @returns {JoomlaEditorDecorator}
*/
getActive() {
return this.active;
}
};
/**
* Editor Buttons API.
*/
const JoomlaEditorButton = {
/**
* Internal! The property should not be accessed directly.
*
* A collection of button actions.
*/
actions: {},
/**
* Register new button action, or override existing.
*
* @param {String} name Action name
* @param {Function} handler Callback that will be executed.
*
* @returns {JoomlaEditorButton}
*/
registerAction(name, handler) {
if (!name || !handler) {
throw new Error('Missed values for Action registration');
}
if (!(handler instanceof Function)) {
throw new Error(`Unexpected handler for action "${name}", expecting Function`);
}
this.actions[name] = handler;
return this;
},
/**
* Get registered handler by action name.
*
* @param {String} name Action name
*
* @returns {Function|false}
*/
getActionHandler(name) {
return this.actions[name] || false;
},
/**
* Execute action.
*
* @param {String} name Action name
* @param {Object} options An options object
* @param {HTMLElement} button An optional element, that triggers the action
*
* @returns {*}
*/
runAction(name, options, button) {
const handler = this.getActionHandler(name);
let editor = JoomlaEditor.getActive();
if (!handler) {
throw new Error(`Handler for "${name}" action not found`);
}
// Try to find a legacy editor
// @TODO: Remove this section in Joomla 6
if (!editor && button) {
const parent = button.closest('fieldset, div:not(.editor-xtd-buttons)');
const textarea = parent ? parent.querySelector('textarea[id]') : false;
editor = textarea && Joomla.editors.instances[textarea.id] ? Joomla.editors.instances[textarea.id] : false;
if (editor) {
// eslint-disable-next-line no-console
console.warn('Legacy editors is deprecated. Set active editor instance with JoomlaEditor.setActive().');
}
}
if (!editor) {
throw new Error('An active editor are not available');
}
return handler(editor, options);
}
};
export { JoomlaEditor, JoomlaEditorButton };

View File

@ -0,0 +1 @@
import JoomlaEditorDecorator from"editor-decorator";export{default as JoomlaEditorDecorator}from"editor-decorator";const JoomlaEditor={instances:{},active:null,register(t){if(!(t instanceof JoomlaEditorDecorator))throw new Error("Unexpected editor instance");return this.instances[t.getId()]=t,Joomla.editors.instances[t.getId()]=t,this},unregister(t){let e;if(t instanceof JoomlaEditorDecorator)e=t.getId();else{if("string"!=typeof t)throw new Error("Unexpected editor instance or identifier");e=t}return this.active&&this.active===this.instances[e]&&(this.active=null),delete this.instances[e],delete Joomla.editors.instances[e],this},get(t){return this.instances[t]||!1},setActive(t){if(t instanceof JoomlaEditorDecorator)this.active=t;else{if(!this.instances[t])throw new Error("The editor instance not found or it is incorrect");this.active=this.instances[t]}return this},getActive(){return this.active}},JoomlaEditorButton={actions:{},registerAction(t,e){if(!t||!e)throw new Error("Missed values for Action registration");if(!(e instanceof Function))throw new Error(`Unexpected handler for action "${t}", expecting Function`);return this.actions[t]=e,this},getActionHandler(t){return this.actions[t]||!1},runAction(t,e,o){const i=this.getActionHandler(t);let r=JoomlaEditor.getActive();if(!i)throw new Error(`Handler for "${t}" action not found`);if(!r&&o){const t=o.closest("fieldset, div:not(.editor-xtd-buttons)"),e=!!t&&t.querySelector("textarea[id]");r=!(!e||!Joomla.editors.instances[e.id])&&Joomla.editors.instances[e.id],r&&console.warn("Legacy editors is deprecated. Set active editor instance with JoomlaEditor.setActive().")}if(!r)throw new Error("An active editor are not available");return i(r,e)}};export{JoomlaEditor,JoomlaEditorButton};

Binary file not shown.

View File

@ -0,0 +1,137 @@
/**
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* A decorator for Editor instance.
*/
class JoomlaEditorDecorator {
/**
* Internal! The property should not be accessed directly.
* The editor instance.
* @type {Object}
*/
// instance = null;
/**
* Internal! The property should not be accessed directly.
* The editor type/name, eg: tinymce, codemirror, none etc.
* @type {string}
*/
// type = '';
/**
* Internal! The property should not be accessed directly.
* HTML ID of the editor.
* @type {string}
*/
// id = '';
/**
* Class constructor.
*
* @param {Object} instance The editor instance
* @param {string} type The editor type/name
* @param {string} id The editor ID
*/
constructor(instance, type, id) {
if (!instance || !type || !id) {
throw new Error('Missed values for class constructor');
}
this.instance = instance;
this.type = type;
this.id = id;
}
/**
* Returns the editor instance object.
*
* @returns {Object}
*/
getRawInstance() {
return this.instance;
}
/**
* Returns the editor type/name.
*
* @returns {string}
*/
getType() {
return this.type;
}
/**
* Returns the editor id.
*
* @returns {string}
*/
getId() {
return this.id;
}
/**
* Return the complete data from the editor.
* Should be implemented by editor provider.
*
* @returns {string}
*/
// eslint-disable-next-line class-methods-use-this
getValue() {
throw new Error('Not implemented');
}
/**
* Replace the complete data of the editor
* Should be implemented by editor provider.
*
* @param {string} value Value to set.
*
* @returns {JoomlaEditorDecorator}
*/
// eslint-disable-next-line class-methods-use-this, no-unused-vars
setValue(value) {
throw new Error('Not implemented');
}
/**
* Return the selected text from the editor.
* Should be implemented by editor provider.
*
* @returns {string}
*/
// eslint-disable-next-line class-methods-use-this
getSelection() {
throw new Error('Not implemented');
}
/**
* Replace the selected text. If nothing selected, will insert the data at the cursor.
* Should be implemented by editor provider.
*
* @param {string} value
*
* @returns {JoomlaEditorDecorator}
*/
// eslint-disable-next-line class-methods-use-this, no-unused-vars
replaceSelection(value) {
throw new Error('Not implemented');
}
/**
* Toggles the editor disabled mode. When the editor is active then everything should be usable.
* When inactive the editor should be unusable AND disabled for form validation.
* Should be implemented by editor provider.
*
* @param {boolean} enable True to enable, false or undefined to disable.
*
* @returns {JoomlaEditorDecorator}
*/
// eslint-disable-next-line class-methods-use-this, no-unused-vars
disable(enable) {
throw new Error('Not implemented');
}
}
export { JoomlaEditorDecorator as default };

View File

@ -0,0 +1 @@
class JoomlaEditorDecorator{constructor(e,t,r){if(!e||!t||!r)throw new Error("Missed values for class constructor");this.instance=e,this.type=t,this.id=r}getRawInstance(){return this.instance}getType(){return this.type}getId(){return this.id}getValue(){throw new Error("Not implemented")}setValue(e){throw new Error("Not implemented")}getSelection(){throw new Error("Not implemented")}replaceSelection(e){throw new Error("Not implemented")}disable(e){throw new Error("Not implemented")}}export{JoomlaEditorDecorator as default};

Binary file not shown.

View File

@ -0,0 +1,102 @@
import { JoomlaEditorDecorator, JoomlaEditorButton } from 'editor-api';
import JoomlaDialog from 'joomla.dialog';
/**
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
if (!window.Joomla) {
throw new Error('JoomlaEditors API require Joomla to be loaded.');
}
// === The code for keep backward compatibility ===
// Joomla.editors is deprecated use Joomla.Editor instead.
// @TODO: Remove this section in Joomla 6.
// Only define editors if not defined
Joomla.editors = Joomla.editors || {};
// An object to hold each editor instance on page, only define if not defined.
Joomla.editors.instances = new Proxy({}, {
set(target, p, editor) {
// eslint-disable-next-line no-use-before-define
if (!(editor instanceof JoomlaEditorDecorator)) {
// Add missed method in Legacy editor
editor.getId = () => p;
// eslint-disable-next-line no-console
console.warn('Legacy editors is deprecated. Register the editor instance with JoomlaEditor.register().', p, editor);
}
target[p] = editor;
return true;
},
get(target, p) {
// eslint-disable-next-line no-console
console.warn('Direct access to Joomla.editors.instances is deprecated. Use JoomlaEditor.getActive() or JoomlaEditor.get(id) to retrieve the editor instance.');
return target[p];
}
});
// === End of code for keep backward compatibility ===
// Register couple default actions for Editor Buttons
// Insert static content on cursor
JoomlaEditorButton.registerAction('insert', (editor, options) => {
const content = options.content || '';
editor.replaceSelection(content);
});
// Display modal dialog
JoomlaEditorButton.registerAction('modal', (editor, options) => {
if (options.src && options.src[0] !== '#' && options.src[0] !== '.') {
// Replace editor parameter to actual editor ID
const url = options.src.indexOf('http') === 0 ? new URL(options.src) : new URL(options.src, window.location.origin);
url.searchParams.set('editor', editor.getId());
if (url.searchParams.has('e_name')) {
url.searchParams.set('e_name', editor.getId());
}
options.src = url.toString();
}
// Create a dialog popup
const dialog = new JoomlaDialog(options);
// Listener for postMessage
const msgListener = event => {
// Avoid cross origins
if (event.origin !== window.location.origin) return;
// Check message type
if (event.data.messageType === 'joomla:content-select') {
editor.replaceSelection(event.data.html || event.data.text);
dialog.close();
} else if (event.data.messageType === 'joomla:cancel') {
dialog.close();
}
};
// Use a JoomlaExpectingPostMessage flag to be able to distinct legacy methods
// @TODO: This should be removed after full transition to postMessage()
window.JoomlaExpectingPostMessage = true;
window.addEventListener('message', msgListener);
// Clean up on close
dialog.addEventListener('joomla-dialog:close', () => {
delete window.JoomlaExpectingPostMessage;
window.removeEventListener('message', msgListener);
Joomla.Modal.setCurrent(null);
dialog.destroy();
});
Joomla.Modal.setCurrent(dialog);
// Show the popup
dialog.show();
});
// Listen to click on Editor button, and run action.
const btnDelegateSelector = '[data-joomla-editor-button-action]';
const btnActionDataAttr = 'joomlaEditorButtonAction';
const btnConfigDataAttr = 'joomlaEditorButtonOptions';
document.addEventListener('click', event => {
const btn = event.target.closest(btnDelegateSelector);
if (!btn) return;
const action = btn.dataset[btnActionDataAttr];
const options = btn.dataset[btnConfigDataAttr] ? JSON.parse(btn.dataset[btnConfigDataAttr]) : {};
if (action) {
JoomlaEditorButton.runAction(action, options, btn);
}
});

View File

@ -0,0 +1 @@
import{JoomlaEditorDecorator,JoomlaEditorButton}from"editor-api";import JoomlaDialog from"joomla.dialog";if(!window.Joomla)throw new Error("JoomlaEditors API require Joomla to be loaded.");Joomla.editors=Joomla.editors||{},Joomla.editors.instances=new Proxy({},{set:(o,t,e)=>(e instanceof JoomlaEditorDecorator||(e.getId=()=>t,console.warn("Legacy editors is deprecated. Register the editor instance with JoomlaEditor.register().",t,e)),o[t]=e,!0),get:(o,t)=>(console.warn("Direct access to Joomla.editors.instances is deprecated. Use JoomlaEditor.getActive() or JoomlaEditor.get(id) to retrieve the editor instance."),o[t])}),JoomlaEditorButton.registerAction("insert",((o,t)=>{const e=t.content||"";o.replaceSelection(e)})),JoomlaEditorButton.registerAction("modal",((o,t)=>{if(t.src&&"#"!==t.src[0]&&"."!==t.src[0]){const e=0===t.src.indexOf("http")?new URL(t.src):new URL(t.src,window.location.origin);e.searchParams.set("editor",o.getId()),e.searchParams.has("e_name")&&e.searchParams.set("e_name",o.getId()),t.src=e.toString()}const e=new JoomlaDialog(t),a=t=>{t.origin===window.location.origin&&("joomla:content-select"===t.data.messageType?(o.replaceSelection(t.data.html||t.data.text),e.close()):"joomla:cancel"===t.data.messageType&&e.close())};window.JoomlaExpectingPostMessage=!0,window.addEventListener("message",a),e.addEventListener("joomla-dialog:close",(()=>{delete window.JoomlaExpectingPostMessage,window.removeEventListener("message",a),Joomla.Modal.setCurrent(null),e.destroy()})),Joomla.Modal.setCurrent(e),e.show()}));const btnDelegateSelector="[data-joomla-editor-button-action]",btnActionDataAttr="joomlaEditorButtonAction",btnConfigDataAttr="joomlaEditorButtonOptions";document.addEventListener("click",(o=>{const t=o.target.closest(btnDelegateSelector);if(!t)return;const e=t.dataset[btnActionDataAttr],a=t.dataset[btnConfigDataAttr]?JSON.parse(t.dataset[btnConfigDataAttr]):{};e&&JoomlaEditorButton.runAction(e,a,t)}));

Binary file not shown.

View File

@ -0,0 +1,418 @@
!(function(Date){
'use strict';
var localNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
/****************** Gregorian dates ********************/
/** Constants used for time computations */
Date.SECOND = 1000 /* milliseconds */;
Date.MINUTE = 60 * Date.SECOND;
Date.HOUR = 60 * Date.MINUTE;
Date.DAY = 24 * Date.HOUR;
Date.WEEK = 7 * Date.DAY;
/** MODIFY ONLY THE MARKED PARTS OF THE METHODS **/
/************ START *************/
/** INTERFACE METHODS FOR THE CALENDAR PICKER **/
/********************** *************************/
/**************** SETTERS ***********************/
/********************** *************************/
/** Sets the date for the current date without h/m/s. */
Date.prototype.setLocalDateOnly = function (dateType, date) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
var tmp = new Date(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
}
};
/** Sets the full date for the current date. */
Date.prototype.setLocalDate = function (dateType, d) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
return this.setDate(d);
}
};
/** Sets the month for the current date. */
Date.prototype.setLocalMonth = function (dateType, m, d) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
if (d == undefined) this.getDate();
return this.setMonth(m);
}
};
/** Sets the year for the current date. */
Date.prototype.setOtherFullYear = function(dateType, y) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
var date = new Date(this);
date.setFullYear(y);
if (date.getMonth() != this.getMonth()) this.setDate(28);
return this.setUTCFullYear(y);
}
};
/** Sets the year for the current date. */
Date.prototype.setLocalFullYear = function (dateType, y) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
var date = new Date(this);
date.setFullYear(y);
if (date.getMonth() != this.getMonth()) this.setDate(28);
return this.setFullYear(y);
}
};
/********************** *************************/
/**************** GETTERS ***********************/
/********************** *************************/
/** The number of days per week **/
Date.prototype.getLocalWeekDays = function (dateType, y) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return 6;
} else {
return 6; // 7 days per week
}
};
/** Returns the year for the current date. */
Date.prototype.getOtherFullYear = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
return this.getFullYear();
}
};
/** Returns the year for the current date. */
Date.prototype.getLocalFullYear = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
return this.getFullYear();
}
};
/** Returns the month the date. */
Date.prototype.getLocalMonth = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
return this.getMonth();
}
};
/** Returns the date. */
Date.prototype.getLocalDate = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
return this.getDate();
}
};
/** Returns the number of day in the year. */
Date.prototype.getLocalDay = function(dateType) {
if (dateType != 'gregorian') {
return '';
} else {
return this.getDay();
}
};
/** Returns the number of days in the current month */
Date.prototype.getLocalMonthDays = function(dateType, month) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
var year = this.getFullYear();
if (typeof month == "undefined") {
month = this.getMonth();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return [31,28,31,30,31,30,31,31,30,31,30,31][month];
}
}
};
/** Returns the week number for the current date. */
Date.prototype.getLocalWeekNumber = function(dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var DoW = d.getDay();
d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
var ms = d.valueOf(); // GMT
d.setMonth(0);
d.setDate(4); // Thu in Week 1
return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1;
}
};
/** Returns the number of day in the year. */
Date.prototype.getLocalDayOfYear = function(dateType) {
if (dateType != 'gregorian') {
return '';
} else {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
}
};
/** Checks date and time equality */
Date.prototype.equalsTo = function(date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()));
};
/** Converts foreign date to gregorian date. */
Date.localCalToGregorian = function(y, m, d) {
/** Modify to match the current calendar when overriding **/
return'';
};
/** Converts gregorian date to foreign date. */
Date.gregorianToLocalCal = function(y, m, d) {
/** Modify to match the current calendar when overriding **/
return '';
};
/** Method to convert numbers to local symbols. */
Date.convertNumbers = function(str) {
str = str.toString();
for (var i = 0, l = localNumbers.length; i < l; i++) {
str = str.replace(new RegExp(i, 'g'), localNumbers[i]);
}
return str;
};
/** Translates to english numbers a string. */
Date.toEnglish = function(str) {
str = this.toString();
var nums = [0,1,2,3,4,5,6,7,8,9];
for (var i = 0; i < 10; i++) {
str = str.replace(new RegExp(nums[i], 'g'), i);
}
return str;
};
/** Order the months from Gergorian to the calendar order */
Date.monthsToLocalOrder = function(months) {
return months;
};
/** INTERFACE METHODS FOR THE CALENDAR PICKER **/
/************* END **************/
/** Method to parse a string and return a date. **/
Date.parseFieldDate = function(str, fmt, dateType, localStrings) {
if (dateType != 'gregorian')
str = Date.toEnglish(str);
var today = new Date();
var y = 0;
var m = -1;
var d = 0;
var a = str.split(/\W+/);
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
if (!a[i])
continue;
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%m":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (localStrings.months[j].substr(0, a[i].length).toLowerCase() === a[i].toLowerCase()) {
m = j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12)
hr += 12;
else if (/am/i.test(a[i]) && hr >= 12)
hr -= 12;
break;
case "%M":
min = parseInt(a[i], 10);
break;
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
if (isNaN(y)) y = today.getFullYear();
if (isNaN(m)) m = today.getMonth();
if (isNaN(d)) d = today.getDate();
if (isNaN(hr)) hr = today.getHours();
if (isNaN(min)) min = today.getMinutes();
if (isNaN(sec)) sec = today.getSeconds();
if (y != 0 && m != -1 && d != 0)
return new Date(y, m, d, hr, min, sec);
y = 0; m = -1; d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (localStrings.months[j].substr(0, a[i].length).toLowerCase() === a[i].toLowerCase()) {
t = j;
break;
}
}
if (t != -1) {
if (m != -1) {
d = m+1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i]-1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0)
y = today.getFullYear();
if (m != -1 && d != 0)
return new Date(y, m, d, hr, min, sec);
return today;
};
/** Prints the date in a string according to the given format. */
Date.prototype.print = function (str, dateType, translate, localStrings) {
/** Handle calendar type **/
if (typeof dateType !== 'string') str = '';
if (!dateType) dateType = 'gregorian';
/** Handle wrong format **/
if (typeof str !== 'string') str = '';
if (!str) return '';
if (this.getLocalDate(dateType) == 'NaN' || !this.getLocalDate(dateType)) return '';
var m = this.getLocalMonth(dateType);
var d = this.getLocalDate(dateType);
var y = this.getLocalFullYear(dateType);
var wn = this.getLocalWeekNumber(dateType);
var w = this.getDay();
var s = {};
var hr = this.getHours();
var pm = (hr >= 12);
var ir = (pm) ? (hr - 12) : hr;
var dy = this.getLocalDayOfYear(dateType);
if (ir == 0)
ir = 12;
var min = this.getMinutes();
var sec = this.getSeconds();
s["%a"] = localStrings.shortDays[w]; // abbreviated weekday name
s["%A"] = localStrings.days[w]; // full weekday name
s["%b"] = localStrings.shortMonths[m]; // abbreviated month name
s["%B"] = localStrings.months[m]; // full month name
// FIXME: %c : preferred date and time representation for the current locale
s["%C"] = 1 + Math.floor(y / 100); // the century number
s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
s["%e"] = d; // the day of the month (range 1 to 31)
// FIXME: %D : american date style: %m/%d/%y
// FIXME: %E, %F, %G, %g, %h (man strftime)
s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
s["%k"] = hr; // hour, range 0 to 23 (24h format)
s["%l"] = ir; // hour, range 1 to 12 (12h format)
s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
s["%n"] = "\n"; // a newline character
s["%p"] = pm ? localStrings.pm.toUpperCase() : localStrings.am.toUpperCase();
s["%P"] = pm ? localStrings.pm : localStrings.am;
// FIXME: %r : the time in am/pm notation %I:%M:%S %p
// FIXME: %R : the time in 24-hour notation %H:%M
s["%s"] = Math.floor(this.getTime() / 1000);
s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
s["%t"] = "\t"; // a tab character
// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON)
s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN)
// FIXME: %x : preferred date representation for the current locale without the time
// FIXME: %X : preferred time representation for the current locale without the date
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
var re = /%./g;
var tmpDate = str.replace(re, function (par) { return s[par] || par; });
if (dateType != 'gregorian' && translate) {
tmpDate = Date.convertNumbers(tmpDate);
}
return tmpDate;
};
})(Date);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,658 @@
!(function(Date){
'use strict';
var localNumbers = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
/** BEGIN: DATE OBJECT PATCHES **/
/** Adds the number of days array to the Date object. */
Date.gregorian_MD = [31,28,31,30,31,30,31,31,30,31,30,31];
Date.local_MD = [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29];
/** Constants used for time computations */
Date.SECOND = 1000 /* milliseconds */;
Date.MINUTE = 60 * Date.SECOND;
Date.HOUR = 60 * Date.MINUTE;
Date.DAY = 24 * Date.HOUR;
Date.WEEK = 7 * Date.DAY;
/** MODIFY ONLY THE MARKED PARTS OF THE METHODS **/
/************ START *************/
/** INTERFACE METHODS FOR THE CALENDAR PICKER **/
/********************** *************************/
/**************** SETTERS ***********************/
/********************** *************************/
/** Sets the date for the current date without h/m/s. */
Date.prototype.setLocalDateOnly = function (dateType, date) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return '';
} else {
var tmp = new Date(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
this.setDate(tmp.getDate());
}
};
/** Sets the full date for the current date. */
Date.prototype.setLocalDate = function (dateType, d) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.setJalaliDate(d);
} else {
return this.setDate(d);
}
};
/** Sets the month for the current date. */
Date.prototype.setLocalMonth = function (dateType, m, d) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.setJalaliMonth(m, d);
} else {
if (d == undefined) this.getDate();
return this.setMonth(m);
}
};
/** Sets the year for the current date. */
Date.prototype.setOtherFullYear = function(dateType, y) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
var date = new Date(this);
date.setLocalFullYear(y);
if (date.getLocalMonth('jalali') != this.getLocalMonth('jalali')) this.setLocalDate('jalali', 29);
return this.setLocalFullYear('jalali', y);
} else {
var date = new Date(this);
date.setFullYear(y);
if (date.getMonth() != this.getMonth()) this.setDate(28);
return this.setUTCFullYear(y);
}
};
/** Sets the year for the current date. */
Date.prototype.setLocalFullYear = function (dateType, y) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.setJalaliFullYear(y);
} else {
var date = new Date(this);
date.setFullYear(y);
if (date.getMonth() != this.getMonth()) this.setDate(28);
return this.setFullYear(y);
}
};
/********************** *************************/
/**************** GETTERS ***********************/
/********************** *************************/
/** The number of days per week **/
Date.prototype.getLocalWeekDays = function (dateType, y) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return 6;
} else {
return 6; // 7 days per week
}
};
/** Returns the year for the current date. */
Date.prototype.getOtherFullYear = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.getJalaliFullYear();
} else {
return this.getFullYear();
}
};
/** Returns the year for the current date. */
Date.prototype.getLocalFullYear = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.getJalaliFullYear();
} else {
return this.getFullYear();
}
};
/** Returns the month the date. */
Date.prototype.getLocalMonth = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.getJalaliMonth();
} else {
return this.getMonth();
}
};
/** Returns the date. */
Date.prototype.getLocalDate = function (dateType) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
return this.getJalaliDate();
} else {
return this.getDate();
}
};
/** Returns the number of day in the year. */
Date.prototype.getLocalDay = function(dateType) {
if (dateType != 'gregorian') {
return this.getJalaliDay();
} else {
return this.getDay();
}
};
/** Returns the number of days in the current month */
Date.prototype.getLocalMonthDays = function(dateType, month) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
var year = this.getLocalFullYear('jalali');
if (typeof month == "undefined") {
month = this.getLocalMonth('jalali');
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return Date.local_MD[month];
}
} else {
var year = this.getFullYear();
if (typeof month == "undefined") {
month = this.getMonth();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return Date.gregorian_MD[month];
}
}
};
/** Returns the week number for the current date. */
Date.prototype.getLocalWeekNumber = function(dateType) {
if (dateType != 'gregorian') {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var DoW = d.getDay();
d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
var ms = d.valueOf(); // GMT
d.setMonth(0);
d.setDate(4); // Thu in Week 1
return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1;
} else {
var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var DoW = d.getDay();
d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
var ms = d.valueOf(); // GMT
d.setMonth(0);
d.setDate(4); // Thu in Week 1
return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1;
}
};
/** Returns the number of day in the year. */
Date.prototype.getLocalDayOfYear = function(dateType) {
if (dateType != 'gregorian') {
var now = new Date(this.getOtherFullYear(dateType), this.getLocalMonth(dateType), this.getLocalDate(dateType), 0, 0, 0);
var then = new Date(this.getOtherFullYear(dateType), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
} else {
var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
}
};
/** Returns the number of days in the current month */
Date.prototype.getMonthDays = function(month) {
var year = this.getFullYear();
if (typeof month == "undefined") {
month = this.getMonth();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
if (Date.dateType != 'gregorian') {
return Date.local_MD[month];
} else {
return Date.gregorian_MD[month];
}
}
};
/** Checks date and time equality */
Date.prototype.equalsTo = function(date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()));
};
/** Converts foreign date to gregorian date. */
Date.localCalToGregorian = function(y, m, d) {
/** Modify to match the current calendar when overriding **/
return JalaliDate.jalaliToGregorian(y, m, d);
};
/** Converts gregorian date to foreign date. */
Date.gregorianToLocalCal = function(y, m, d) {
/** Modify to match the current calendar when overriding **/
return JalaliDate.gregorianToJalali(y, m, d);
};
/** Method to convert numbers from local symbols to English numbers. */
Date.numbersToIso = function(str) {
var i, nums = [0,1,2,3,4,5,6,7,8,9];
str = str.toString();
for (i = 0; i < nums.length; i++) {
str = str.replace(new RegExp(localNumbers[i], 'g'), nums[i]);
}
return str;
};
/** Method to convert numbers to local symbols. */
Date.convertNumbers = function(str) {
str = str.toString();
for (var i = 0, l = localNumbers.length; i < l; i++) {
str = str.replace(new RegExp(i, 'g'), localNumbers[i]);
}
return str;
};
/** Translates to english numbers a string. */
Date.toEnglish = function(str) {
str = this.toString();
var nums = [0,1,2,3,4,5,6,7,8,9];
for (var i = 0; i < 10; i++) {
str = str.replace(new RegExp(nums[i], 'g'), i);
}
return str;
};
/** Order the days from Gergorian to calendar order */
Date.monthsToLocalOrder = function(months, dateType) {
if (dateType === 'jalali'){
months.push(months.shift()); // January to the end
months.push(months.shift()); // February to the end
return months;
} else {
return months;
}
};
/** INTERFACE METHODS FOR THE CALENDAR PICKER **/
/************* END **************/
/** Prints the date in a string according to the given format. */
Date.prototype.print = function (str, dateType, translate, localStrings) {
/** Handle calendar type **/
if (typeof dateType !== 'string') str = '';
if (!dateType) dateType = 'gregorian';
/** Handle wrong format **/
if (typeof str !== 'string') str = '';
if (!str) return '';
if (this.getLocalDate(dateType) == 'NaN' || !this.getLocalDate(dateType)) return '';
var m = this.getLocalMonth(dateType);
var d = this.getLocalDate(dateType);
var y = this.getLocalFullYear(dateType);
var wn = this.getLocalWeekNumber(dateType);
var w = this.getLocalDay(dateType);
var s = {};
var hr = this.getHours();
var pm = (hr >= 12);
var ir = (pm) ? (hr - 12) : hr;
var dy = this.getLocalDayOfYear(dateType);
if (ir == 0)
ir = 12;
var min = this.getMinutes();
var sec = this.getSeconds();
s["%a"] = localStrings.shortDays[w]; // abbreviated weekday name
s["%A"] = localStrings.days[w]; // full weekday name
s["%b"] = localStrings.shortMonths[m]; // abbreviated month name
s["%B"] = localStrings.months[m]; // full month name
// FIXME: %c : preferred date and time representation for the current locale
s["%C"] = 1 + Math.floor(y / 100); // the century number
s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
s["%e"] = d; // the day of the month (range 1 to 31)
// FIXME: %D : american date style: %m/%d/%y
// FIXME: %E, %F, %G, %g, %h (man strftime)
s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
s["%k"] = hr; // hour, range 0 to 23 (24h format)
s["%l"] = ir; // hour, range 1 to 12 (12h format)
s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
s["%n"] = "\n"; // a newline character
s["%p"] = pm ? localStrings.pm.toUpperCase() : localStrings.am.toUpperCase();
s["%P"] = pm ? localStrings.pm : localStrings.am;
// FIXME: %r : the time in am/pm notation %I:%M:%S %p
// FIXME: %R : the time in 24-hour notation %H:%M
s["%s"] = Math.floor(this.getTime() / 1000);
s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
s["%t"] = "\t"; // a tab character
// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON)
s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN)
// FIXME: %x : preferred date representation for the current locale without the time
// FIXME: %X : preferred time representation for the current locale without the date
s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = y; // year with the century
s["%%"] = "%"; // a literal '%' character
var re = /%./g;
var tmpDate = str.replace(re, function (par) { return s[par] || par; });
if (translate) {
tmpDate = Date.convertNumbers(tmpDate);
}
return tmpDate;
};
Date.parseFieldDate = function(str, fmt, dateType, localStrings) {
str = Date.numbersToIso(str);
var today = new Date();
var y = 0;
var m = -1;
var d = 0;
var a = str.split(/\W+/);
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
if (!a[i])
continue;
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%m":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (localStrings.months[j].substr(0, a[i].length).toLowerCase() === a[i].toLowerCase()) { m = j; break; }
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12)
hr += 12;
else if (/am/i.test(a[i]) && hr >= 12)
hr -= 12;
break;
case "%M":
min = parseInt(a[i], 10);
break;
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
if (isNaN(y)) y = today.getFullYear();
if (isNaN(m)) m = today.getMonth();
if (isNaN(d)) d = today.getDate();
if (isNaN(hr)) hr = today.getHours();
if (isNaN(min)) min = today.getMinutes();
if (y != 0 && m != -1 && d != 0)
return new Date(y, m, d, hr, min, 0);
y = 0; m = -1; d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (localStrings.months[j].substr(0, a[i].length).toLowerCase() === a[i].toLowerCase()) { t = j; break; }
}
if (t != -1) {
if (m != -1) {
d = m+1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i]-1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0)
y = today.getFullYear();
if (m != -1 && d != 0)
return new Date(y, m, d, hr, min, 0);
return today;
};
/*
* JalaliJSCalendar - Jalali Extension for Date Object
* Copyright (c) 2008 Ali Farhadi (http://farhadi.ir/)
* Released under the terms of the GNU General Public License.
* See the GPL for details (http://www.gnu.org/licenses/gpl.html).
*
* Based on code from http://farsiweb.info
*/
var JalaliDate = {
g_days_in_month: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
j_days_in_month: [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29]
};
JalaliDate.jalaliToGregorian = function(j_y, j_m, j_d)
{
j_y = parseInt(j_y);
j_m = parseInt(j_m);
j_d = parseInt(j_d);
var jy = j_y-979;
var jm = j_m-1;
var jd = j_d-1;
var j_day_no = 365*jy + parseInt(jy / 33)*8 + parseInt((jy%33+3) / 4);
for (var i=0; i < jm; ++i) j_day_no += JalaliDate.j_days_in_month[i];
j_day_no += jd;
var g_day_no = j_day_no+79;
var gy = 1600 + 400 * parseInt(g_day_no / 146097); /* 146097 = 365*400 + 400/4 - 400/100 + 400/400 */
g_day_no = g_day_no % 146097;
var leap = true;
if (g_day_no >= 36525) /* 36525 = 365*100 + 100/4 */
{
g_day_no--;
gy += 100*parseInt(g_day_no/ 36524); /* 36524 = 365*100 + 100/4 - 100/100 */
g_day_no = g_day_no % 36524;
if (g_day_no >= 365)
g_day_no++;
else
leap = false;
}
gy += 4*parseInt(g_day_no/ 1461); /* 1461 = 365*4 + 4/4 */
g_day_no %= 1461;
if (g_day_no >= 366) {
leap = false;
g_day_no--;
gy += parseInt(g_day_no/ 365);
g_day_no = g_day_no % 365;
}
for (var i = 0; g_day_no >= JalaliDate.g_days_in_month[i] + (i == 1 && leap); i++)
g_day_no -= JalaliDate.g_days_in_month[i] + (i == 1 && leap);
var gm = i+1;
var gd = g_day_no+1;
return [gy, gm, gd];
};
JalaliDate.checkDate = function(j_y, j_m, j_d)
{
return !(j_y < 0 || j_y > 32767 || j_m < 1 || j_m > 12 || j_d < 1 || j_d >
(JalaliDate.j_days_in_month[j_m-1] + (j_m == 12 && !((j_y-979)%33%4))));
};
JalaliDate.gregorianToJalali = function(g_y, g_m, g_d)
{
g_y = parseInt(g_y);
g_m = parseInt(g_m);
g_d = parseInt(g_d);
var gy = g_y-1600;
var gm = g_m-1;
var gd = g_d-1;
var g_day_no = 365*gy+parseInt((gy+3) / 4)-parseInt((gy+99)/100)+parseInt((gy+399)/400);
for (var i=0; i < gm; ++i)
g_day_no += JalaliDate.g_days_in_month[i];
if (gm>1 && ((gy%4==0 && gy%100!=0) || (gy%400==0)))
/* leap and after Feb */
++g_day_no;
g_day_no += gd;
var j_day_no = g_day_no-79;
var j_np = parseInt(j_day_no/ 12053);
j_day_no %= 12053;
var jy = 979+33*j_np+4*parseInt(j_day_no/1461);
j_day_no %= 1461;
if (j_day_no >= 366) {
jy += parseInt((j_day_no-1)/ 365);
j_day_no = (j_day_no-1)%365;
}
for (var i = 0; i < 11 && j_day_no >= JalaliDate.j_days_in_month[i]; ++i) {
j_day_no -= JalaliDate.j_days_in_month[i];
}
var jm = i+1;
var jd = j_day_no+1;
return [jy, jm, jd];
};
Date.prototype.setJalaliFullYear = function(y, m, d) {
var gd = this.getDate();
var gm = this.getMonth();
var gy = this.getFullYear();
var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
if (y < 100) y += 1300;
j[0] = y;
if (m != undefined) {
if (m > 11) {
j[0] += Math.floor(m / 12);
m = m % 12;
}
j[1] = m + 1;
}
if (d != undefined) j[2] = d;
var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
return this.setFullYear(g[0], g[1]-1, g[2]);
};
Date.prototype.setJalaliMonth = function(m, d) {
var gd = this.getDate();
var gm = this.getMonth();
var gy = this.getFullYear();
var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
if (m > 11) {
j[0] += Math.floor(m / 12);
m = m % 12;
}
j[1] = m+1;
if (d != undefined) j[2] = d;
var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
return this.setFullYear(g[0], g[1]-1, g[2]);
};
Date.prototype.setJalaliDate = function(d) {
var gd = this.getDate();
var gm = this.getMonth();
var gy = this.getFullYear();
var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
j[2] = d;
var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
return this.setFullYear(g[0], g[1]-1, g[2]);
};
Date.prototype.getJalaliFullYear = function() {
var gd = this.getDate();
var gm = this.getMonth();
var gy = this.getFullYear();
var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
return j[0];
};
Date.prototype.getJalaliMonth = function() {
var gd = this.getDate();
var gm = this.getMonth();
var gy = this.getFullYear();
var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
return j[1]-1;
};
Date.prototype.getJalaliDate = function() {
var gd = this.getDate();
var gm = this.getMonth();
var gy = this.getFullYear();
var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
return j[2];
};
Date.prototype.getJalaliDay = function() {
var day = this.getDay();
day = (day) % 7;
return day;
};
})(Date);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,38 @@
/**
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
!(function(document, $) {
"use strict";
function initMinicolorsField (event) {
$(event.target).find('.minicolors').each(function() {
$(this).minicolors({
control: $(this).attr('data-control') || 'hue',
format: $(this).attr('data-validate') === 'color'
? 'hex'
: ($(this).attr('data-format') === 'rgba'
? 'rgb'
: $(this).attr('data-format'))
|| 'hex',
keywords: $(this).attr('data-keywords') || '',
opacity: $(this).attr('data-format') === 'rgba',
position: $(this).attr('data-position') || 'default',
swatches: $(this).attr('data-colors') ? $(this).attr('data-colors').split(",") : [],
theme: 'bootstrap'
});
});
}
/**
* Initialize at an initial page load
*/
document.addEventListener("DOMContentLoaded", initMinicolorsField);
/**
* Initialize when a part of the page was updated
*/
document.addEventListener("joomla:updated", initMinicolorsField);
})(document, jQuery);

View File

@ -0,0 +1 @@
!function(t,a){"use strict";function o(t){a(t.target).find(".minicolors").each((function(){a(this).minicolors({control:a(this).attr("data-control")||"hue",format:"color"===a(this).attr("data-validate")?"hex":("rgba"===a(this).attr("data-format")?"rgb":a(this).attr("data-format"))||"hex",keywords:a(this).attr("data-keywords")||"",opacity:"rgba"===a(this).attr("data-format"),position:a(this).attr("data-position")||"default",swatches:a(this).attr("data-colors")?a(this).attr("data-colors").split(","):[],theme:"bootstrap"})}))}t.addEventListener("DOMContentLoaded",o),t.addEventListener("joomla:updated",o)}(document,jQuery);

Binary file not shown.

View File

@ -0,0 +1,599 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/* eslint class-methods-use-this: ["error", { "exceptMethods": ["rgbToHex", "hslToRgb"] }] */
(document => {
/**
* Regex for hex values e.g. #FF3929
* @type {RegExp}
*/
const hexRegex = /^#([a-z0-9]{1,2})([a-z0-9]{1,2})([a-z0-9]{1,2})$/i;
/**
* Regex for rgb values e.g. rgba(255, 0, 24, 0.5);
* @type {RegExp}
*/
const rgbRegex = /^rgba?\(([0-9]+)[\D]+([0-9]+)[\D]+([0-9]+)(?:[\D]+([0-9](?:.\d+)?))?\)$/i;
/**
* Regex for hsl values e.g. hsl(255,0,24);
* @type {RegExp}
*/
const hslRegex = /^hsla?\(([0-9]+)[\D]+([0-9]+)[\D]+([0-9]+)[\D]+([0-9](?:.\d+)?)?\)$/i;
/**
* Regex for saturation and lightness of hsl - only accepts 1 or 0 or 0.4 or 40
* @type {RegExp}
*/
const hslNumberRegex = /^(([0-1])|(0\\.[0-9]+)|([0-9]{1,2})|(100))$/;
/**
* Regex for hue values - one to three numbers
* @type {RegExp}
*/
const hueRegex = /^[0-9]{1,3}$/;
/**
* Creates a slider for the color values hue, saturation and light.
*
* @since 4.0.0
*/
class JoomlaFieldColorSlider {
/**
* @param {HTMLElement} element
*/
constructor(element) {
// Elements
this.messageSpan = element.querySelector('.form-control-feedback');
this.mainInput = element.querySelector('.color-input');
this.input = element.querySelector('#slider-input');
this.sliders = element.querySelectorAll('.color-slider');
this.hueSlider = element.querySelector('#hue-slider');
this.saturationSlider = element.querySelector('#saturation-slider');
this.lightSlider = element.querySelector('#light-slider');
this.alphaSlider = element.querySelector('#alpha-slider');
// Attributes
this.color = element.dataset.color || '';
this.default = element.dataset.default || '';
this.format = this.input.dataset.format || 'hex';
this.saveFormat = this.mainInput.dataset.format || 'hex';
this.preview = element.dataset.preview === 'true';
this.setAlpha = this.format === 'hsla' || this.format === 'rgba';
this.hue = 360;
this.saturation = 1;
this.light = 1;
this.alpha = 1;
this.defaultHsl = [this.hue, this.saturation, this.light, this.alpha];
this.setInitValue();
this.setBackground();
// Hide preview field, when selected value should not be visible
if (!this.preview) {
this.input.classList.add('hidden');
} else {
this.setInputPattern();
}
// Always hide main input field (value saved in database)
this.mainInput.classList.add('hidden');
Array.prototype.forEach.call(this.sliders, slider => {
slider.addEventListener('change', () => this.updateValue(slider));
});
this.input.addEventListener('change', () => this.changeInput(this.input));
}
/**
* Set selected value into input field and set it as its background-color.
*/
updateValue(slider) {
this.showError('');
const hsl = this.getSliderValueAsHsl(slider.value, slider.dataset.type);
const rgb = this.hslToRgb(hsl);
[this.hue, this.saturation, this.light, this.alpha] = hsl;
this.input.style.border = `2px solid ${this.getRgbString(rgb)}`;
this.setSliderValues(hsl, slider.dataset.type);
this.setInputValue(hsl);
this.setBackground(slider);
}
/**
* React on user changing input value
*
* @param {HTMLElement} inputField
*/
changeInput(inputField) {
let hsl = [this.hue, this.saturation, this.light, this.alpha];
if (!inputField.value) {
this.mainInput.value = '';
this.showError('');
return;
}
if (!this.checkValue(inputField.value)) {
this.showError('JFIELD_COLOR_ERROR_WRONG_FORMAT');
this.setInputValue(this.defaultHsl);
} else {
this.showError('');
switch (this.format) {
case 'hue':
hsl[0] = inputField.value;
this.hue = inputField.value;
break;
case 'saturation':
hsl[1] = inputField.value;
this.saturation = inputField.value;
break;
case 'light':
hsl[2] = inputField.value;
this.light = inputField.value;
break;
case 'alpha':
hsl[3] = inputField.value;
this.alpha = inputField.value;
break;
default:
hsl = this.getHsl(inputField.value);
}
this.setSliderValues(hsl);
this.setInputValue(hsl, true);
}
}
/**
* Check validity of value
*
* @param {number|string} value to check
* @param {string=false} format for which the value gets tested
* @returns {boolean}
*/
checkValue(value, format) {
const test = format || this.format;
switch (test) {
case 'hue':
return value <= 360 && hueRegex.test(value);
case 'saturation':
case 'light':
case 'alpha':
return hslNumberRegex.test(value);
case 'hsl':
case 'hsla':
return hslRegex.test(value);
case 'hex':
return hexRegex.test(value);
case 'rgb':
case 'rgba':
return rgbRegex.test(value);
default:
return false;
}
}
/**
* Set validation pattern on input field
*/
setInputPattern() {
let pattern;
// RegExp has '/' at start and end
switch (this.format) {
case 'hue':
pattern = hueRegex.source.slice(1, -1);
break;
case 'saturation':
case 'light':
case 'alpha':
pattern = hslNumberRegex.source.slice(1, -1);
break;
case 'hsl':
case 'hsla':
pattern = hslRegex.source.slice(1, -1);
break;
case 'rgb':
pattern = rgbRegex.source.slice(1, -1);
break;
case 'hex':
default:
pattern = hexRegex.source.slice(1, -1);
}
this.input.setAttribute('pattern', pattern);
}
/**
* Set linear gradient for slider background
* @param {HTMLInputElement} [exceptSlider]
*/
setBackground(exceptSlider) {
Array.prototype.forEach.call(this.sliders, slider => {
// Jump over changed slider
if (exceptSlider === slider) {
return;
}
let colors = [];
let endValue = 100;
// Longer start color so slider selection matches displayed colors
colors.push(this.getSliderValueAsRgb(0, slider.dataset.type));
if (slider.dataset.type === 'hue') {
const steps = Math.floor(360 / 20);
endValue = 360;
for (let i = 0; i <= 360; i += steps) {
colors.push(this.getSliderValueAsRgb(i, slider.dataset.type));
}
} else {
for (let i = 0; i <= 100; i += 10) {
colors.push(this.getSliderValueAsRgb(i, slider.dataset.type));
}
}
// Longer end color so slider selection matches displayed colors
colors.push(this.getSliderValueAsRgb(endValue, slider.dataset.type));
colors = colors.map(value => this.getRgbString(value));
slider.style.background = `linear-gradient(90deg, ${colors.join(',')})`;
slider.style.webkitAppearance = 'none';
});
}
/**
* Convert given color into hue, saturation and light
*/
setInitValue() {
// The initial value can be also a color defined in css
const cssValue = window.getComputedStyle(this.input).getPropertyValue(this.default);
this.default = cssValue || this.default;
if (this.color === '' || typeof this.color === 'undefined') {
// Unable to get hsl with empty value
this.input.value = '';
this.mainInput.value = '';
return;
}
const value = this.checkValue(this.color, this.saveFormat) ? this.color : this.default;
if (!value) {
this.showError('JFIELD_COLOR_ERROR_NO_COLOUR');
return;
}
let hsl = [];
// When given value is a number, use it as defined format and get rest from default value
if (/^[0-9]+$/.test(value)) {
hsl = this.default && this.getHsl(this.default);
if (this.format === 'hue') {
hsl[0] = value;
}
if (this.format === 'saturation') {
hsl[1] = value > 1 ? value / 100 : value;
}
if (this.format === 'light') {
hsl[2] = value > 1 ? value / 100 : value;
}
if (this.format === 'alpha') {
hsl[3] = value > 1 ? value / 100 : value;
}
} else {
hsl = this.getHsl(value);
}
[this.hue, this.saturation, this.light] = hsl;
this.alpha = hsl[4] || this.alpha;
this.defaultHsl = this.default ? this.getHsl(this.default) : hsl;
this.setSliderValues(hsl);
this.setInputValue(hsl);
this.input.style.border = `2px solid ${this.getRgbString(this.hslToRgb(hsl))}`;
}
/**
* Insert message into error message span
* Message gets handled with Joomla.Text or as empty string
*
* @param {string} msg
*/
showError(msg) {
this.messageSpan.innerText = msg ? Joomla.Text._(msg) : '';
}
/**
* Convert value into HSLa e.g. #003E7C => [210, 100, 24]
* @param {array|number|string} value
* @returns {array}
*/
getHsl(value) {
let hsl = [];
if (Array.isArray(value)) {
hsl = value;
} else if (hexRegex.test(value)) {
hsl = this.hexToHsl(value);
} else if (rgbRegex.test(value)) {
hsl = this.rgbToHsl(value);
} else if (hslRegex.test(value)) {
const matches = value.match(hslRegex);
hsl = [matches[1], matches[2], matches[3], matches[4]];
} else {
this.showError('JFIELD_COLOR_ERROR_CONVERT_HSL');
return this.defaultHsl;
}
// Convert saturation etc. values from e.g. 40 to 0.4
let i;
for (i = 1; i < hsl.length; i += 1) {
hsl[i] = hsl[i] > 1 ? hsl[i] / 100 : hsl[i];
}
return hsl;
}
/**
* Returns HSL value from color slider value
* @params {int} value convert this value
* @params {string} type type of value: hue, saturation, light or alpha
* @returns array
*/
getSliderValueAsHsl(value, type) {
let h = this.hue;
let s = this.saturation;
let l = this.light;
let a = this.alpha;
switch (type) {
case 'alpha':
a = value;
break;
case 'saturation':
s = value;
break;
case 'light':
l = value;
break;
case 'hue':
default:
h = value;
}
// Percentage light and saturation
if (l > 1) {
l /= 100;
}
if (s > 1) {
s /= 100;
}
if (a > 1) {
a /= 100;
}
return [h, s, l, a];
}
/**
* Calculates RGB value from color slider value
* @params {int} value convert this value
* @params {string} type type of value: hue, saturation, light or alpha
* @returns array
*/
getSliderValueAsRgb(value, type) {
return this.hslToRgb(this.getSliderValueAsHsl(value, type));
}
/**
* Set value in all sliders
* @param {array} [hsla]
* @param {string} [except]
*/
setSliderValues([h, s, l, a], except) {
if (this.hueSlider && except !== 'hue') {
this.hueSlider.value = Math.round(h);
}
if (this.saturationSlider && except !== 'saturation') {
this.saturationSlider.value = Math.round(s * 100);
}
if (this.lightSlider && except !== 'light') {
this.lightSlider.value = Math.round(l * 100);
}
if (a && this.alphaSlider && except !== 'alpha') {
this.alphaSlider.value = Math.round(a * 100);
}
}
/**
* Set value in text input fields depending on their format
* @param {array} hsl
* @param {boolean=false} onlyMain indicates to change mainInput only
*/
setInputValue(hsl, onlyMain) {
const inputs = [this.mainInput];
if (!onlyMain) {
inputs.push(this.input);
}
inputs.forEach(input => {
let value;
switch (input.dataset.format) {
case 'hsl':
value = this.getHslString(hsl);
break;
case 'hsla':
value = this.getHslString(hsl, true);
break;
case 'rgb':
value = this.getRgbString(this.hslToRgb(hsl));
break;
case 'rgba':
value = this.getRgbString(this.hslToRgb(hsl), true);
break;
case 'hex':
value = this.rgbToHex(this.hslToRgb(hsl));
break;
case 'alpha':
value = Math.round(hsl[3] * 100);
break;
case 'saturation':
value = Math.round(hsl[1] * 100);
break;
case 'light':
value = Math.round(hsl[2] * 100);
break;
case 'hue':
default:
value = Math.round(hsl[0]);
break;
}
input.value = value;
});
}
/**
* Put RGB values into a string like 'rgb(<R>, <G>, <B>)'
* @params {array} rgba
* @params {boolean=false} withAlpha
* @return {string}
*/
getRgbString([r, g, b, a], withAlpha) {
if (withAlpha || this.setAlpha) {
const alpha = typeof a === 'undefined' ? this.alpha : a;
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
}
return `rgb(${r}, ${g}, ${b})`;
}
/**
* Put HSL values into a string like 'hsl(<H>, <S>%, <L>%, <a>)'
* @params {array} values
* @params {boolean=false} withAlpha
* @return {string}
*/
getHslString(values, withAlpha) {
let [h, s, l, a] = values;
s *= 100;
l *= 100;
[h, s, l] = [h, s, l].map(value => Math.round(value));
if (withAlpha || this.setAlpha) {
a = a || this.alpha;
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
}
return `hsl(${h}, ${s}%, ${l}%)`;
}
/**
* Returns hsl values out of hex
* @param {array} rgb
* @return {string}
*/
rgbToHex(rgb) {
let r = rgb[0].toString(16).toUpperCase();
let g = rgb[1].toString(16).toUpperCase();
let b = rgb[2].toString(16).toUpperCase();
// Double value for hex with '#' and 6 chars
r = r.length === 1 ? `${r}${r}` : r;
g = g.length === 1 ? `${g}${g}` : g;
b = b.length === 1 ? `${b}${b}` : b;
return `#${r}${g}${b}`;
}
/**
* Returns hsl values out of rgb
* @param {string|array} values
* @return {array}
*/
rgbToHsl(values) {
let rgb = values;
if (typeof values === 'string') {
const parts = values.match(rgbRegex);
rgb = [parts[1], parts[2], parts[3], parts[4]];
}
const [r, g, b] = rgb.map(value => value > 1 ? value / 255 : value);
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);
const l = (max + min) / 2;
const d = max - min;
let h = 0;
let s = 0;
let a = rgb[3] || values[3] || this.alpha;
if (max !== min) {
if (max === 0) {
s = max;
} else if (min === 1) {
s = min;
} else {
s = (max - l) / Math.min(l, 1 - l);
}
switch (max) {
case r:
h = 60 * (g - b) / d;
break;
case g:
h = 60 * (2 + (b - r) / d);
break;
case b:
default:
h = 60 * (4 + (r - g) / d);
break;
}
}
h = h < 0 ? h + 360 : h;
a = a > 1 ? a / 100 : a;
return [h, s, l, a];
}
/**
* Returns hsl values out of hex
* @param {string} hex
* @return {array}
*/
hexToHsl(hex) {
const parts = hex.match(hexRegex);
const r = parts[1];
const g = parts[2];
const b = parts[3];
const rgb = [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)];
return this.rgbToHsl(rgb);
}
/**
* Convert HSLa values into RGBa
* @param {array} hsla
* @returns {number[]}
*/
hslToRgb([h, sat, light, alpha]) {
let r = 1;
let g = 1;
let b = 1;
// Saturation and light were calculated as 0.24 instead of 24%
const s = sat > 1 ? sat / 100 : sat;
const l = light > 1 ? light / 100 : light;
const a = alpha > 1 ? alpha / 100 : alpha;
if (h < 0 || h > 360 || s < 0 || s > 1 || l < 0 || l > 1) {
this.showError('JFIELD_COLOR_ERROR_CONVERT_HSL');
return this.hslToRgb(this.defaultHsl);
}
const c = (1 - Math.abs(2 * l - 1)) * s;
const hi = h / 60;
const x = c * (1 - Math.abs(hi % 2 - 1));
const m = l - c / 2;
if (h >= 0 && h < 60) {
[r, g, b] = [c, x, 0];
} else if (h >= 60 && h < 120) {
[r, g, b] = [x, c, 0];
} else if (h >= 120 && h < 180) {
[r, g, b] = [0, c, x];
} else if (h >= 180 && h < 240) {
[r, g, b] = [0, x, c];
} else if (h >= 240 && h < 300) {
[r, g, b] = [x, 0, c];
} else if (h >= 300 && h <= 360) {
[r, g, b] = [c, 0, x];
} else {
this.showError('JFIELD_COLOR_ERROR_CONVERT_HUE');
return this.hslToRgb(this.defaultHsl);
}
const rgb = [r, g, b].map(value => Math.round((value + m) * 255));
rgb.push(a);
return rgb;
}
}
document.addEventListener('DOMContentLoaded', () => {
const fields = document.querySelectorAll('.color-slider-wrapper');
if (fields) {
Array.prototype.forEach.call(fields, slider => {
// eslint-disable-next-line no-new
new JoomlaFieldColorSlider(slider);
});
}
});
})(document);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,393 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Fancy select field, which use Choices.js
*
* Example:
* <joomla-field-fancy-select ...attributes>
* <select>...</select>
* </joomla-field-fancy-select>
*
* Possible attributes:
*
* allow-custom Whether allow User to dynamically add a new value.
* new-item-prefix="" Prefix for a dynamically added value.
*
* remote-search Enable remote search.
* url="" Url for remote search.
* term-key="term" Variable key name for searched term, will be appended to Url.
*
* min-term-length="1" The minimum length a search value should be before choices are searched.
* placeholder="" The value of the inputs placeholder.
* search-placeholder="" The value of the search inputs placeholder.
*
* data-max-results="30" The maximum amount of search results to be displayed.
* data-max-render="30" The maximum amount of items to be rendered, critical for large lists.
*/
window.customElements.define('joomla-field-fancy-select', class extends HTMLElement {
// Attributes to monitor
get allowCustom() {
return this.hasAttribute('allow-custom');
}
get remoteSearch() {
return this.hasAttribute('remote-search');
}
get url() {
return this.getAttribute('url');
}
get termKey() {
return this.getAttribute('term-key') || 'term';
}
get minTermLength() {
return parseInt(this.getAttribute('min-term-length'), 10) || 1;
}
get newItemPrefix() {
return this.getAttribute('new-item-prefix') || '';
}
get placeholder() {
return this.getAttribute('placeholder');
}
get searchPlaceholder() {
return this.getAttribute('search-placeholder');
}
get value() {
return this.choicesInstance.getValue(true);
}
set value($val) {
this.choicesInstance.setChoiceByValue($val);
}
/**
* Lifecycle
*/
constructor() {
super();
// Keycodes
this.keyCode = {
ENTER: 13
};
if (!Joomla) {
throw new Error('Joomla API is not properly initiated');
}
if (!window.Choices) {
throw new Error('JoomlaFieldFancySelect requires Choices.js to work');
}
this.choicesCache = {};
this.activeXHR = null;
this.choicesInstance = null;
this.isDisconnected = false;
}
/**
* Lifecycle
*/
connectedCallback() {
// Make sure Choices are loaded
if (window.Choices || document.readyState === 'complete') {
this.doConnect();
} else {
const callback = () => {
this.doConnect();
window.removeEventListener('load', callback);
};
window.addEventListener('load', callback);
}
}
doConnect() {
// Get a <select> element
this.select = this.querySelector('select');
if (!this.select) {
throw new Error('JoomlaFieldFancySelect requires <select> element to work');
}
// The element was already initialised previously and perhaps was detached from DOM
if (this.choicesInstance) {
if (this.isDisconnected) {
// Re init previous instance
this.choicesInstance.init();
this.isDisconnected = false;
}
return;
}
this.isDisconnected = false;
// Add placeholder option for multiple mode,
// Because it not supported as parameter by Choices for <select> https://github.com/jshjohnson/Choices#placeholder
if (this.select.multiple && this.placeholder) {
const option = document.createElement('option');
option.setAttribute('placeholder', '');
option.textContent = this.placeholder;
this.select.appendChild(option);
}
// Init Choices
// eslint-disable-next-line no-undef
this.choicesInstance = new Choices(this.select, {
placeholderValue: this.placeholder,
searchPlaceholderValue: this.searchPlaceholder,
removeItemButton: true,
searchFloor: this.minTermLength,
searchResultLimit: parseInt(this.select.dataset.maxResults, 10) || 10,
renderChoiceLimit: parseInt(this.select.dataset.maxRender, 10) || -1,
shouldSort: false,
fuseOptions: {
threshold: 0.3 // Strict search
},
noResultsText: Joomla.Text._('JGLOBAL_SELECT_NO_RESULTS_MATCH', 'No results found'),
noChoicesText: Joomla.Text._('JGLOBAL_SELECT_NO_RESULTS_MATCH', 'No results found'),
itemSelectText: Joomla.Text._('JGLOBAL_SELECT_PRESS_TO_SELECT', 'Press to select'),
// Redefine some classes
classNames: {
button: 'choices__button_joomla' // It is need because an original styling use unavailable Icon.svg file
}
});
// Handle typing of custom Term
if (this.allowCustom) {
// START Work around for issue https://github.com/joomla/joomla-cms/issues/29459
// The choices.js always auto-highlights the first element
// in the dropdown that not allow to add a custom Term.
//
// This workaround can be removed when choices.js
// will have an option that allow to disable it.
// eslint-disable-next-line no-underscore-dangle, prefer-destructuring
const _highlightChoice = this.choicesInstance._highlightChoice;
// eslint-disable-next-line no-underscore-dangle
this.choicesInstance._highlightChoice = el => {
// Prevent auto-highlight of first element, if nothing actually highlighted
if (!el) return;
// Call original highlighter
_highlightChoice.call(this.choicesInstance, el);
};
// Unhighlight any highlighted items, when mouse leave the dropdown
this.addEventListener('mouseleave', () => {
if (!this.choicesInstance.dropdown.isActive) {
return;
}
const highlighted = Array.from(this.choicesInstance.dropdown.element.querySelectorAll(`.${this.choicesInstance.config.classNames.highlightedState}`));
highlighted.forEach(choice => {
choice.classList.remove(this.choicesInstance.config.classNames.highlightedState);
choice.setAttribute('aria-selected', 'false');
});
// eslint-disable-next-line no-underscore-dangle
this.choicesInstance._highlightPosition = 0;
});
// END workaround for issue #29459
// Add custom term on ENTER keydown
this.addEventListener('keydown', event => {
if (event.keyCode !== this.keyCode.ENTER || event.target !== this.choicesInstance.input.element) {
return;
}
event.preventDefault();
// eslint-disable-next-line no-underscore-dangle
if (this.choicesInstance._highlightPosition || !event.target.value) {
return;
}
// Make sure nothing is highlighted
const highlighted = this.choicesInstance.dropdown.element.querySelector(`.${this.choicesInstance.config.classNames.highlightedState}`);
if (highlighted) {
return;
}
// Check if value already exist
const lowerValue = event.target.value.toLowerCase();
let valueInCache = false;
// Check if value in existing choices
this.choicesInstance.config.choices.some(choiceItem => {
if (choiceItem.value.toLowerCase() === lowerValue || choiceItem.label.toLowerCase() === lowerValue) {
valueInCache = choiceItem.value;
return true;
}
return false;
});
if (valueInCache === false) {
// Check if value in cache
Object.keys(this.choicesCache).some(key => {
if (key.toLowerCase() === lowerValue || this.choicesCache[key].toLowerCase() === lowerValue) {
valueInCache = key;
return true;
}
return false;
});
}
// Make choice based on existing value
if (valueInCache !== false) {
this.choicesInstance.setChoiceByValue(valueInCache);
event.target.value = null;
this.choicesInstance.hideDropdown();
return;
}
// Create and add new
this.choicesInstance.setChoices([{
value: this.newItemPrefix + event.target.value,
label: event.target.value,
selected: true,
customProperties: {
value: event.target.value // Store real value, just in case
}
}], 'value', 'label', false);
this.choicesCache[event.target.value] = event.target.value;
event.target.value = null;
this.choicesInstance.hideDropdown();
});
}
// Handle remote search
if (this.remoteSearch && this.url) {
// Cache existing
this.choicesInstance.config.choices.forEach(choiceItem => {
this.choicesCache[choiceItem.value] = choiceItem.label;
});
const lookupDelay = 300;
let lookupTimeout = null;
this.select.addEventListener('search', () => {
clearTimeout(lookupTimeout);
lookupTimeout = setTimeout(this.requestLookup.bind(this), lookupDelay);
});
}
}
/**
* Lifecycle
*/
disconnectedCallback() {
// Destroy Choices instance, to unbind event listeners
if (this.choicesInstance) {
this.choicesInstance.destroy();
this.isDisconnected = true;
}
if (this.activeXHR) {
this.activeXHR.abort();
this.activeXHR = null;
}
}
requestLookup() {
let {
url
} = this;
url += url.indexOf('?') === -1 ? '?' : '&';
url += `${encodeURIComponent(this.termKey)}=${encodeURIComponent(this.choicesInstance.input.value)}`;
// Stop previous request if any
if (this.activeXHR) {
this.activeXHR.abort();
}
this.activeXHR = Joomla.request({
url,
onSuccess: response => {
this.activeXHR = null;
const items = response ? JSON.parse(response) : [];
if (!items.length) {
return;
}
// Remove duplications
let item;
// eslint-disable-next-line no-plusplus
for (let i = items.length - 1; i >= 0; i--) {
// The loop must be form the end !!!
item = items[i];
// eslint-disable-next-line prefer-template
item.value = '' + item.value; // Make sure the value is a string, choices.js expect a string.
if (this.choicesCache[item.value]) {
items.splice(i, 1);
} else {
this.choicesCache[item.value] = item.text;
}
}
// Add new options to field, assume that each item is object, eg {value: "foo", text: "bar"}
if (items.length) {
this.choicesInstance.setChoices(items, 'value', 'text', false);
}
},
onError: () => {
this.activeXHR = null;
}
});
}
disableAllOptions() {
// Choices.js does not offer a public API for accessing the choices
// So we have to access the private store => don't eslint
// eslint-disable-next-line no-underscore-dangle
const {
choices
} = this.choicesInstance._store;
choices.forEach((elem, index) => {
choices[index].disabled = true;
choices[index].selected = false;
});
this.choicesInstance.clearStore();
this.choicesInstance.setChoices(choices, 'value', 'label', true);
}
enableAllOptions() {
// Choices.js does not offer a public API for accessing the choices
// So we have to access the private store => don't eslint
// eslint-disable-next-line no-underscore-dangle
const {
choices
} = this.choicesInstance._store;
const values = this.choicesInstance.getValue(true);
choices.forEach((elem, index) => {
choices[index].disabled = false;
});
this.choicesInstance.clearStore();
this.choicesInstance.setChoices(choices, 'value', 'label', true);
this.value = values;
}
disableByValue($val) {
// Choices.js does not offer a public API for accessing the choices
// So we have to access the private store => don't eslint
// eslint-disable-next-line no-underscore-dangle
const {
choices
} = this.choicesInstance._store;
const values = this.choicesInstance.getValue(true);
choices.forEach((elem, index) => {
if (elem.value === $val) {
choices[index].disabled = true;
choices[index].selected = false;
}
});
const index = values.indexOf($val);
if (index > -1) {
values.slice(index, 1);
}
this.choicesInstance.clearStore();
this.choicesInstance.setChoices(choices, 'value', 'label', true);
this.value = values;
}
enableByValue($val) {
// Choices.js does not offer a public API for accessing the choices
// So we have to access the private store => don't eslint
// eslint-disable-next-line no-underscore-dangle
const {
choices
} = this.choicesInstance._store;
const values = this.choicesInstance.getValue(true);
choices.forEach((elem, index) => {
if (elem.value === $val) {
choices[index].disabled = false;
}
});
this.choicesInstance.clearStore();
this.choicesInstance.setChoices(choices, 'value', 'label', true);
this.value = values;
}
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,369 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
if (!Joomla) {
throw new Error('Joomla API is not properly initiated');
}
/**
* Extract the extensions
*
* @param {*} path
* @returns {string}
*/
const getExtension = path => {
const parts = path.split(/[#]/);
if (parts.length > 1) {
return parts[1].split(/[?]/)[0].split('.').pop().trim();
}
return path.split(/[#?]/)[0].split('.').pop().trim();
};
class JoomlaFieldMedia extends HTMLElement {
constructor() {
super();
this.onSelected = this.onSelected.bind(this);
this.show = this.show.bind(this);
this.clearValue = this.clearValue.bind(this);
this.modalClose = this.modalClose.bind(this);
this.setValue = this.setValue.bind(this);
this.updatePreview = this.updatePreview.bind(this);
this.validateValue = this.validateValue.bind(this);
this.markValid = this.markValid.bind(this);
this.markInvalid = this.markInvalid.bind(this);
this.mimeType = '';
}
static get observedAttributes() {
return ['type', 'base-path', 'root-folder', 'url', 'modal-container', 'modal-width', 'modal-height', 'input', 'button-select', 'button-clear', 'button-save-selected', 'preview', 'preview-width', 'preview-height'];
}
get type() {
return this.getAttribute('type');
}
set type(value) {
this.setAttribute('type', value);
}
get basePath() {
return this.getAttribute('base-path');
}
set basePath(value) {
this.setAttribute('base-path', value);
}
get rootFolder() {
return this.getAttribute('root-folder');
}
set rootFolder(value) {
this.setAttribute('root-folder', value);
}
get url() {
return this.getAttribute('url');
}
set url(value) {
this.setAttribute('url', value);
}
get modalContainer() {
return this.getAttribute('modal-container');
}
set modalContainer(value) {
this.setAttribute('modal-container', value);
}
get input() {
return this.getAttribute('input');
}
set input(value) {
this.setAttribute('input', value);
}
get buttonSelect() {
return this.getAttribute('button-select');
}
set buttonSelect(value) {
this.setAttribute('button-select', value);
}
get buttonClear() {
return this.getAttribute('button-clear');
}
set buttonClear(value) {
this.setAttribute('button-clear', value);
}
get buttonSaveSelected() {
return this.getAttribute('button-save-selected');
}
set buttonSaveSelected(value) {
this.setAttribute('button-save-selected', value);
}
get modalWidth() {
return parseInt(this.getAttribute('modal-width'), 10);
}
set modalWidth(value) {
this.setAttribute('modal-width', value);
}
get modalHeight() {
return parseInt(this.getAttribute('modal-height'), 10);
}
set modalHeight(value) {
this.setAttribute('modal-height', value);
}
get previewWidth() {
return parseInt(this.getAttribute('preview-width'), 10);
}
set previewWidth(value) {
this.setAttribute('preview-width', value);
}
get previewHeight() {
return parseInt(this.getAttribute('preview-height'), 10);
}
set previewHeight(value) {
this.setAttribute('preview-height', value);
}
get preview() {
return this.getAttribute('preview');
}
set preview(value) {
this.setAttribute('preview', value);
}
get previewContainer() {
return this.getAttribute('preview-container');
}
// attributeChangedCallback(attr, oldValue, newValue) {}
connectedCallback() {
this.button = this.querySelector(this.buttonSelect);
this.inputElement = this.querySelector(this.input);
this.buttonClearEl = this.querySelector(this.buttonClear);
this.modalElement = this.querySelector('.joomla-modal');
this.buttonSaveSelectedElement = this.querySelector(this.buttonSaveSelected);
this.previewElement = this.querySelector('.field-media-preview');
if (!this.button || !this.inputElement || !this.buttonClearEl || !this.modalElement || !this.buttonSaveSelectedElement) {
throw new Error('Misconfiguaration...');
}
this.button.addEventListener('click', this.show);
// Bootstrap modal init
if (this.modalElement && window.bootstrap && window.bootstrap.Modal && !window.bootstrap.Modal.getInstance(this.modalElement)) {
Joomla.initialiseModal(this.modalElement, {
isJoomla: true
});
}
if (this.buttonClearEl) {
this.buttonClearEl.addEventListener('click', this.clearValue);
}
this.supportedExtensions = Joomla.getOptions('media-picker', {});
if (!Object.keys(this.supportedExtensions).length) {
throw new Error('Joomla API is not properly initiated');
}
this.inputElement.removeAttribute('readonly');
this.inputElement.addEventListener('change', this.validateValue);
this.updatePreview();
}
disconnectedCallback() {
if (this.button) {
this.button.removeEventListener('click', this.show);
}
if (this.buttonClearEl) {
this.buttonClearEl.removeEventListener('click', this.clearValue);
}
if (this.inputElement) {
this.inputElement.removeEventListener('change', this.validateValue);
}
}
onSelected(event) {
event.preventDefault();
event.stopPropagation();
this.modalClose();
return false;
}
show() {
this.modalElement.open();
Joomla.selectedMediaFile = {};
this.buttonSaveSelectedElement.addEventListener('click', this.onSelected);
}
async modalClose() {
try {
await Joomla.getMedia(Joomla.selectedMediaFile, this.inputElement, this);
} catch (err) {
Joomla.renderMessages({
error: [Joomla.Text._('JLIB_APPLICATION_ERROR_SERVER')]
});
}
Joomla.selectedMediaFile = {};
Joomla.Modal.getCurrent().close();
}
setValue(value) {
this.inputElement.value = value;
this.validatedUrl = value;
this.mimeType = Joomla.selectedMediaFile.fileType;
this.updatePreview();
// trigger change event both on the input and on the custom element
this.inputElement.dispatchEvent(new Event('change'));
this.dispatchEvent(new CustomEvent('change', {
detail: {
value
},
bubbles: true
}));
}
async validateValue(event) {
let {
value
} = event.target;
if (this.validatedUrl === value || value === '') return;
if (/^(http(s)?:\/\/).+$/.test(value)) {
try {
fetch(value).then(response => {
if (response.status === 200) {
this.validatedUrl = value;
this.markValid();
} else {
this.validatedUrl = value;
this.markInvalid();
}
});
} catch (err) {
this.validatedUrl = value;
this.markInvalid();
}
} else {
if (/^\//.test(value)) {
value = value.substring(1);
}
const hashedUrl = value.split('#');
const urlParts = hashedUrl[0].split('/');
const rest = urlParts.slice(1);
fetch(`${Joomla.getOptions('system.paths').rootFull}/${value}`).then(response => response.blob()).then(blob => {
if (blob.type.includes('image')) {
const img = new Image();
img.src = URL.createObjectURL(blob);
img.onload = () => {
this.inputElement.value = `${urlParts[0]}/${rest.join('/')}#joomlaImage://local-${urlParts[0]}/${rest.join('/')}?width=${img.width}&height=${img.height}`;
this.validatedUrl = `${urlParts[0]}/${rest.join('/')}#joomlaImage://local-${urlParts[0]}/${rest.join('/')}?width=${img.width}&height=${img.height}`;
this.markValid();
};
} else if (blob.type.includes('audio')) {
this.mimeType = blob.type;
this.inputElement.value = value;
this.validatedUrl = value;
this.markValid();
} else if (blob.type.includes('video')) {
this.mimeType = blob.type;
this.inputElement.value = value;
this.validatedUrl = value;
this.markValid();
} else if (blob.type.includes('application/pdf')) {
this.mimeType = blob.type;
this.inputElement.value = value;
this.validatedUrl = value;
this.markValid();
} else {
this.validatedUrl = value;
this.markInvalid();
}
}).catch(() => {
this.setValue(value);
this.validatedUrl = value;
this.markInvalid();
});
}
}
markValid() {
this.inputElement.removeAttribute('required');
this.inputElement.removeAttribute('pattern');
if (document.formvalidator) {
document.formvalidator.validate(this.inputElement);
}
}
markInvalid() {
this.inputElement.setAttribute('required', '');
this.inputElement.setAttribute('pattern', '/^(http://INVALID/).+$/');
if (document.formvalidator) {
document.formvalidator.validate(this.inputElement);
}
}
clearValue() {
this.setValue('');
this.validatedUrl = '';
this.inputElement.removeAttribute('required');
this.inputElement.removeAttribute('pattern');
if (document.formvalidator) {
document.formvalidator.validate(this.inputElement);
}
}
updatePreview() {
if (['true', 'static'].indexOf(this.preview) === -1 || this.preview === 'false' || !this.previewElement) {
return;
}
// Reset preview
if (this.preview) {
const {
value
} = this.inputElement;
const {
supportedExtensions
} = this;
if (!value) {
this.buttonClearEl.style.display = 'none';
this.previewElement.innerHTML = Joomla.sanitizeHtml('<span class="field-media-preview-icon"></span>');
} else {
let type;
this.buttonClearEl.style.display = '';
this.previewElement.innerHTML = '';
const ext = getExtension(value).toLowerCase();
if (supportedExtensions.images.includes(ext)) type = 'images';
if (supportedExtensions.audios.includes(ext)) type = 'audios';
if (supportedExtensions.videos.includes(ext)) type = 'videos';
if (supportedExtensions.documents.includes(ext)) type = 'documents';
let previewElement;
const mediaType = {
images: () => {
if (supportedExtensions.images.includes(ext)) {
previewElement = new Image();
previewElement.src = /http/.test(value) ? value : Joomla.getOptions('system.paths').rootFull + value;
previewElement.setAttribute('alt', '');
}
},
audios: () => {
if (supportedExtensions.audios.includes(ext)) {
previewElement = document.createElement('audio');
previewElement.src = /http/.test(value) ? value : Joomla.getOptions('system.paths').rootFull + value;
previewElement.setAttribute('controls', '');
}
},
videos: () => {
if (supportedExtensions.videos.includes(ext)) {
previewElement = document.createElement('video');
const previewElementSource = document.createElement('source');
previewElementSource.src = /http/.test(value) ? value : Joomla.getOptions('system.paths').rootFull + value;
previewElementSource.type = this.mimeType;
previewElement.setAttribute('controls', '');
previewElement.setAttribute('width', this.previewWidth);
previewElement.setAttribute('height', this.previewHeight);
previewElement.appendChild(previewElementSource);
}
},
documents: () => {
if (supportedExtensions.documents.includes(ext)) {
previewElement = document.createElement('object');
previewElement.data = /http/.test(value) ? value : Joomla.getOptions('system.paths').rootFull + value;
previewElement.type = this.mimeType;
previewElement.setAttribute('width', this.previewWidth);
previewElement.setAttribute('height', this.previewHeight);
}
}
};
// @todo more checks
if (this.givenType && ['images', 'audios', 'videos', 'documents'].includes(this.givenType)) {
mediaType[this.givenType]();
} else if (type && ['images', 'audios', 'videos', 'documents'].includes(type)) {
mediaType[type]();
} else {
return;
}
this.previewElement.style.width = this.previewWidth;
this.previewElement.appendChild(previewElement);
}
}
}
}
customElements.define('joomla-field-media', JoomlaFieldMedia);

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