primo commit
This commit is contained in:
72
media/system/css/editor.css
Normal file
72
media/system/css/editor.css
Normal file
@ -0,0 +1,72 @@
|
||||
@charset "UTF-8";
|
||||
body {
|
||||
color: #22262a;
|
||||
background: #fff;
|
||||
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: bold;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.857rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.571rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.286rem;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #1b57b1;
|
||||
font-weight: normal;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #00c;
|
||||
font-weight: normal;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.caption {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
div.caption img {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
div.caption p {
|
||||
color: #666;
|
||||
text-align: center;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
hr#system-readmore {
|
||||
color: red;
|
||||
border: 1px dashed red;
|
||||
}
|
||||
|
||||
hr.system-pagebreak {
|
||||
color: gray;
|
||||
border: 1px dashed gray;
|
||||
}
|
||||
|
||||
span[lang] {
|
||||
border: 1px dashed #bbb;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
span[lang]:after {
|
||||
color: red;
|
||||
vertical-align: super;
|
||||
content: attr(lang);
|
||||
font-size: smaller;
|
||||
}
|
||||
1
media/system/css/editor.min.css
vendored
Normal file
1
media/system/css/editor.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";body{color:#22262a;background:#fff;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;text-align:center;font-size:.9em}hr#system-readmore{color:red;border:1px dashed red}hr.system-pagebreak{color:gray;border:1px dashed gray}span[lang]{border:1px dashed #bbb;padding:2px}span[lang]:after{color:red;vertical-align:super;content:attr(lang);font-size:smaller}
|
||||
BIN
media/system/css/editor.min.css.gz
Normal file
BIN
media/system/css/editor.min.css.gz
Normal file
Binary file not shown.
218
media/system/css/fields/calendar-rtl.css
Normal file
218
media/system/css/fields/calendar-rtl.css
Normal file
@ -0,0 +1,218 @@
|
||||
@charset "UTF-8";
|
||||
.js-calendar {
|
||||
box-shadow: 0 0 15px 4px #00000026 !important;
|
||||
}
|
||||
|
||||
.calendar-container {
|
||||
--fallback-url: url("../../images/select-bg-rtl.svg?v=e50af2");
|
||||
float: left;
|
||||
background-color: var(--calendar-bg, #fff);
|
||||
border-radius: 5px;
|
||||
min-width: 160px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
z-index: 1100 !important;
|
||||
}
|
||||
|
||||
.calendar-container .nav {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.calendar-container table {
|
||||
table-layout: fixed;
|
||||
border-collapse: separate;
|
||||
background-color: var(--calendar-bg, #fff);
|
||||
border-radius: 5px;
|
||||
max-width: 268px;
|
||||
margin-top: 2px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 3px;
|
||||
z-index: 1100 !important;
|
||||
}
|
||||
|
||||
div.calendar-container table th, .calendar-container table td {
|
||||
text-align: center;
|
||||
box-shadow: none;
|
||||
padding: 8px 0;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
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 {
|
||||
color: #000;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.calendar-container table thead td.name {
|
||||
color: #000;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
.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 {
|
||||
color: #fff;
|
||||
background: #999;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day {
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
min-width: 38px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day.wn {
|
||||
text-align: center;
|
||||
background-color: var(--calendar-week-bg, #f4f4f4);
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day.selected {
|
||||
color: #fff;
|
||||
background: #3071a9;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.today {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.today:after {
|
||||
content: "";
|
||||
background-color: #46a546;
|
||||
border-radius: 1.5px;
|
||||
height: 3px;
|
||||
position: absolute;
|
||||
bottom: 3px;
|
||||
left: 3px;
|
||||
right: 3px;
|
||||
}
|
||||
|
||||
.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 {
|
||||
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;
|
||||
padding-top: .5rem;
|
||||
font-size: .7rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar-container .time td {
|
||||
border-bottom: none;
|
||||
padding: 15px 3px 10px 0;
|
||||
}
|
||||
|
||||
.calendar-container td.time-title {
|
||||
margin-top: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.calendar-container .time td select {
|
||||
color: var(--calendar-select-color, #212529);
|
||||
background-color: var(--calendar-select-bg-color, #f0f4fb);
|
||||
background-image: var(--calendar-select-bg-url, var(--fallback-url));
|
||||
appearance: none;
|
||||
background-position: 0;
|
||||
background-repeat: no-repeat;
|
||||
background-size: max(100%, 58rem);
|
||||
border: 1px solid #cdcdcd;
|
||||
border-radius: .25rem;
|
||||
width: 100%;
|
||||
padding: 5px 9px 3px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.buttons-wrapper {
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.buttons-wrapper .btn {
|
||||
color: var(--calendar-buttons-color, #495057);
|
||||
border: 1px solid var(--calendar-buttons-color, #495057);
|
||||
min-width: 60px;
|
||||
margin-left: 0;
|
||||
padding: 0 16px;
|
||||
line-height: 2.375rem;
|
||||
box-shadow: 1px 0 1px 1px #00000040;
|
||||
}
|
||||
|
||||
.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-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.calendar-container select, .calendar-container .js-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
1
media/system/css/fields/calendar-rtl.min.css
vendored
Normal file
1
media/system/css/fields/calendar-rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";.js-calendar{box-shadow:0 0 15px 4px #00000026!important}.calendar-container{--fallback-url:url(../../images/select-bg-rtl.svg?v=e50af2);float:left;background-color:var(--calendar-bg,#fff);border-radius:5px;min-width:160px;padding:0;list-style:none;z-index:1100!important}.calendar-container .nav{display:table-cell}.calendar-container table{table-layout:fixed;border-collapse:separate;background-color:var(--calendar-bg,#fff);border-radius:5px;max-width:268px;margin-top:2px;margin-left:auto;margin-right:auto;padding:3px;z-index:1100!important}div.calendar-container table th,.calendar-container table td{text-align:center;box-shadow:none;padding:8px 0;line-height:1.1em}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{color:#000;background:#fff}.calendar-container table thead td.name{color:#000;text-align:center;border-bottom:1px solid #fff}.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{color:#fff;background:#999}.calendar-container table tbody td.day{cursor:pointer;border:0;min-width:38px;font-size:12px}.calendar-container table tbody td.day.wn{text-align:center;background-color:var(--calendar-week-bg,#f4f4f4)}.calendar-container table tbody td.day.selected{color:#fff;background:#3071a9;border:0}.calendar-container table tbody td.today{width:auto;height:100%;font-weight:700;position:relative}.calendar-container table tbody td.today:after{content:"";background-color:#46a546;border-radius:1.5px;height:3px;position:absolute;bottom:3px;left:3px;right:3px}.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{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;padding-top:.5rem;font-size:.7rem;font-weight:700}.calendar-container .time td{border-bottom:none;padding:15px 3px 10px 0}.calendar-container td.time-title{margin-top:20px;display:block}.calendar-container .time td select{color:var(--calendar-select-color,#212529);background-color:var(--calendar-select-bg-color,#f0f4fb);background-image:var(--calendar-select-bg-url,var(--fallback-url));appearance:none;background-position:0;background-repeat:no-repeat;background-size:max(100%,58rem);border:1px solid #cdcdcd;border-radius:.25rem;width:100%;padding:5px 9px 3px;font-size:16px;font-weight:400;line-height:1.5;display:block}.buttons-wrapper{width:100%;padding:5px;margin-bottom:0!important}.buttons-wrapper .btn{color:var(--calendar-buttons-color,#495057);border:1px solid var(--calendar-buttons-color,#495057);min-width:60px;margin-left:0;padding:0 16px;line-height:2.375rem;box-shadow:1px 0 1px 1px #00000040}.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-position:50%;background-repeat:no-repeat}.calendar-container select,.calendar-container .js-btn{cursor:pointer}
|
||||
BIN
media/system/css/fields/calendar-rtl.min.css.gz
Normal file
BIN
media/system/css/fields/calendar-rtl.min.css.gz
Normal file
Binary file not shown.
222
media/system/css/fields/calendar.css
Normal file
222
media/system/css/fields/calendar.css
Normal file
@ -0,0 +1,222 @@
|
||||
@charset "UTF-8";
|
||||
.js-calendar {
|
||||
box-shadow: 0 0 15px 4px #00000026 !important;
|
||||
}
|
||||
|
||||
.calendar-container {
|
||||
--fallback-url: url("../../images/select-bg.svg?v=5ebba0");
|
||||
float: left;
|
||||
background-color: var(--calendar-bg, #fff);
|
||||
border-radius: 5px;
|
||||
min-width: 160px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
z-index: 1100 !important;
|
||||
}
|
||||
|
||||
.calendar-container .nav {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.calendar-container table {
|
||||
table-layout: fixed;
|
||||
border-collapse: separate;
|
||||
background-color: var(--calendar-bg, #fff);
|
||||
border-radius: 5px;
|
||||
max-width: 268px;
|
||||
margin-top: 2px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 3px;
|
||||
z-index: 1100 !important;
|
||||
}
|
||||
|
||||
div.calendar-container table th, .calendar-container table td {
|
||||
text-align: center;
|
||||
box-shadow: none;
|
||||
padding: 8px 0;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
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 {
|
||||
color: #000;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.calendar-container table thead td.name {
|
||||
color: #000;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
.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 {
|
||||
color: #fff;
|
||||
background: #999;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day {
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
min-width: 38px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day.wn {
|
||||
text-align: center;
|
||||
background-color: var(--calendar-week-bg, #f4f4f4);
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day.selected {
|
||||
color: var(--btn-primary-color);
|
||||
background: var(--btn-primary-bg);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.today {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.today:after {
|
||||
content: "";
|
||||
background-color: #46a546;
|
||||
border-radius: 1.5px;
|
||||
height: 3px;
|
||||
position: absolute;
|
||||
bottom: 3px;
|
||||
left: 3px;
|
||||
right: 3px;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.today.selected:after {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day:hover {
|
||||
color: var(--btn-primary-color);
|
||||
cursor: pointer;
|
||||
background: var(--btn-primary-bg);
|
||||
}
|
||||
|
||||
.calendar-container table tbody td.day:hover:after {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar-container table tbody .disabled {
|
||||
color: var(--calendar-disabled-color);
|
||||
background-color: var(--calendar-disabled-bg);
|
||||
}
|
||||
|
||||
.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;
|
||||
padding-top: .5rem;
|
||||
font-size: .7rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar-container .time td {
|
||||
border-bottom: none;
|
||||
padding: 15px 3px 10px 0;
|
||||
}
|
||||
|
||||
.calendar-container td.time-title {
|
||||
margin-top: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.calendar-container .time td select {
|
||||
color: var(--calendar-select-color, #212529);
|
||||
background-color: var(--calendar-select-bg-color, #f0f4fb);
|
||||
appearance: none;
|
||||
background-repeat: no-repeat;
|
||||
background-size: max(100%, 58rem);
|
||||
border: 1px solid #cdcdcd;
|
||||
border-radius: .25rem;
|
||||
width: 100%;
|
||||
padding: 5px 9px 3px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
display: block;
|
||||
}
|
||||
|
||||
html:not([dir="rtl"]) .calendar-container .time td select {
|
||||
background-image: var(--calendar-select-bg-url, var(--fallback-url));
|
||||
background-position: 100%;
|
||||
}
|
||||
|
||||
.buttons-wrapper {
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.buttons-wrapper .btn {
|
||||
color: var(--btn-primary-color);
|
||||
background: var(--btn-primary-bg);
|
||||
border: 1px solid var(--body-bg);
|
||||
min-width: 60px;
|
||||
margin-right: 0;
|
||||
padding: 0 16px;
|
||||
line-height: 2.375rem;
|
||||
box-shadow: 1px 1px 1px #00000040;
|
||||
}
|
||||
|
||||
.buttons-wrapper .btn:hover {
|
||||
color: var(--btn-primary-color);
|
||||
background: var(--btn-primary-bg);
|
||||
}
|
||||
|
||||
.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-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.calendar-container select, .calendar-container .js-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
1
media/system/css/fields/calendar.min.css
vendored
Normal file
1
media/system/css/fields/calendar.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";.js-calendar{box-shadow:0 0 15px 4px #00000026!important}.calendar-container{--fallback-url:url(../../images/select-bg.svg?v=5ebba0);float:left;background-color:var(--calendar-bg,#fff);border-radius:5px;min-width:160px;padding:0;list-style:none;z-index:1100!important}.calendar-container .nav{display:table-cell}.calendar-container table{table-layout:fixed;border-collapse:separate;background-color:var(--calendar-bg,#fff);border-radius:5px;max-width:268px;margin-top:2px;margin-left:auto;margin-right:auto;padding:3px;z-index:1100!important}div.calendar-container table th,.calendar-container table td{text-align:center;box-shadow:none;padding:8px 0;line-height:1.1em}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{color:#000;background:#fff}.calendar-container table thead td.name{color:#000;text-align:center;border-bottom:1px solid #fff}.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{color:#fff;background:#999}.calendar-container table tbody td.day{cursor:pointer;border:0;min-width:38px;font-size:12px}.calendar-container table tbody td.day.wn{text-align:center;background-color:var(--calendar-week-bg,#f4f4f4)}.calendar-container table tbody td.day.selected{color:var(--btn-primary-color);background:var(--btn-primary-bg);border:0}.calendar-container table tbody td.today{width:auto;height:100%;font-weight:700;position:relative}.calendar-container table tbody td.today:after{content:"";background-color:#46a546;border-radius:1.5px;height:3px;position:absolute;bottom:3px;left:3px;right:3px}.calendar-container table tbody td.today.selected:after{background-color:#fff}.calendar-container table tbody td.day:hover{color:var(--btn-primary-color);cursor:pointer;background:var(--btn-primary-bg)}.calendar-container table tbody td.day:hover:after{background-color:#fff}.calendar-container table tbody .disabled{color:var(--calendar-disabled-color);background-color:var(--calendar-disabled-bg)}.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;padding-top:.5rem;font-size:.7rem;font-weight:700}.calendar-container .time td{border-bottom:none;padding:15px 3px 10px 0}.calendar-container td.time-title{margin-top:20px;display:block}.calendar-container .time td select{color:var(--calendar-select-color,#212529);background-color:var(--calendar-select-bg-color,#f0f4fb);appearance:none;background-repeat:no-repeat;background-size:max(100%,58rem);border:1px solid #cdcdcd;border-radius:.25rem;width:100%;padding:5px 9px 3px;font-size:16px;font-weight:400;line-height:1.5;display:block}html:not([dir=rtl]) .calendar-container .time td select{background-image:var(--calendar-select-bg-url,var(--fallback-url));background-position:100%}.buttons-wrapper{width:100%;padding:5px;margin-bottom:0!important}.buttons-wrapper .btn{color:var(--btn-primary-color);background:var(--btn-primary-bg);border:1px solid var(--body-bg);min-width:60px;margin-right:0;padding:0 16px;line-height:2.375rem;box-shadow:1px 1px 1px #00000040}.buttons-wrapper .btn:hover{color:var(--btn-primary-color);background:var(--btn-primary-bg)}.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-position:50%;background-repeat:no-repeat}.calendar-container select,.calendar-container .js-btn{cursor:pointer}
|
||||
BIN
media/system/css/fields/calendar.min.css.gz
Normal file
BIN
media/system/css/fields/calendar.min.css.gz
Normal file
Binary file not shown.
34
media/system/css/fields/joomla-field-media.css
Normal file
34
media/system/css/fields/joomla-field-media.css
Normal file
@ -0,0 +1,34 @@
|
||||
@charset "UTF-8";
|
||||
joomla-field-media .field-media-preview {
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid #00000026;
|
||||
border-bottom-width: 0;
|
||||
border-radius: .25rem .25rem 0 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
max-width: 356px;
|
||||
height: 180px;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
joomla-field-media .field-media-preview-icon {
|
||||
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;
|
||||
width: 7rem;
|
||||
height: 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%;
|
||||
}
|
||||
1
media/system/css/fields/joomla-field-media.min.css
vendored
Normal file
1
media/system/css/fields/joomla-field-media.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";joomla-field-media .field-media-preview{background-color:#f2f2f2;border:1px solid #00000026;border-bottom-width:0;border-radius:.25rem .25rem 0 0;justify-content:center;align-items:center;max-width:356px;height:180px;padding:10px;display:flex;overflow:hidden}joomla-field-media .field-media-preview-icon{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;width:7rem;height: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%}
|
||||
BIN
media/system/css/fields/joomla-field-media.min.css.gz
Normal file
BIN
media/system/css/fields/joomla-field-media.min.css.gz
Normal file
Binary file not shown.
34
media/system/css/fields/joomla-field-permissions.css
Normal file
34
media/system/css/fields/joomla-field-permissions.css
Normal file
@ -0,0 +1,34 @@
|
||||
@charset "UTF-8";
|
||||
joomla-field-permissions .joomla-icon:after {
|
||||
content: "";
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
line-height: 1.5;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
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 {
|
||||
animation: 2s linear infinite spin;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
1
media/system/css/fields/joomla-field-permissions.min.css
vendored
Normal file
1
media/system/css/fields/joomla-field-permissions.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";joomla-field-permissions .joomla-icon:after{content:"";width:1rem;height:1rem;line-height:1.5;display:inline-block}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{animation:2s linear infinite spin}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}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(359deg)}}
|
||||
BIN
media/system/css/fields/joomla-field-permissions.min.css.gz
Normal file
BIN
media/system/css/fields/joomla-field-permissions.min.css.gz
Normal file
Binary file not shown.
71
media/system/css/fields/joomla-field-simple-color.css
Normal file
71
media/system/css/fields/joomla-field-simple-color.css
Normal file
@ -0,0 +1,71 @@
|
||||
@charset "UTF-8";
|
||||
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;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
joomla-field-simple-color button {
|
||||
vertical-align: middle;
|
||||
appearance: none;
|
||||
background: none;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
joomla-field-simple-color .btn-close {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: auto;
|
||||
margin-top: -4px;
|
||||
padding: 0 6px;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
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: #52a8eccc;
|
||||
box-shadow: inset 0 1px 1px #00000013, 0 0 8px #52a8ec99;
|
||||
}
|
||||
|
||||
joomla-field-simple-color .simplecolors-panel[data-open=""] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
joomla-field-simple-color .simplecolors-panel {
|
||||
z-index: 12;
|
||||
float: left;
|
||||
background-color: #fff;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
margin: 1px 0 0;
|
||||
padding: 6px 2px 2px 6px;
|
||||
display: none;
|
||||
position: absolute;
|
||||
box-shadow: 0 5px 10px #0003;
|
||||
}
|
||||
1
media/system/css/fields/joomla-field-simple-color.min.css
vendored
Normal file
1
media/system/css/fields/joomla-field-simple-color.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";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;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}joomla-field-simple-color button{vertical-align:middle;appearance:none;background:0 0;border:1px solid #ccc;border-radius:3px;width:20px;height:20px;overflow:hidden}joomla-field-simple-color .btn-close{text-align:center;vertical-align:middle;width:auto;margin-top:-4px;padding:0 6px;font-size:1rem;line-height:1.5}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:#52a8eccc;box-shadow:inset 0 1px 1px #00000013,0 0 8px #52a8ec99}joomla-field-simple-color .simplecolors-panel[data-open=""]{display:block}joomla-field-simple-color .simplecolors-panel{z-index:12;float:left;background-color:#fff;background-clip:padding-box;border:1px solid #ddd;border-radius:5px;margin:1px 0 0;padding:6px 2px 2px 6px;display:none;position:absolute;box-shadow:0 5px 10px #0003}
|
||||
BIN
media/system/css/fields/joomla-field-simple-color.min.css.gz
Normal file
BIN
media/system/css/fields/joomla-field-simple-color.min.css.gz
Normal file
Binary file not shown.
24
media/system/css/fields/joomla-media-select.css
Normal file
24
media/system/css/fields/joomla-media-select.css
Normal file
@ -0,0 +1,24 @@
|
||||
@charset "UTF-8";
|
||||
joomla-field-mediamore details {
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #c9c9c9;
|
||||
border-radius: .25rem;
|
||||
margin: 0 0 0 .5rem;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
joomla-field-mediamore label.input-group-text {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
joomla-field-mediamore summary {
|
||||
background-color: #e3e3e3;
|
||||
border-radius: .25rem;
|
||||
padding: 1rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
joomla-field-mediamore details .form-group {
|
||||
margin: 1rem !important;
|
||||
}
|
||||
1
media/system/css/fields/joomla-media-select.min.css
vendored
Normal file
1
media/system/css/fields/joomla-media-select.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";joomla-field-mediamore details{background:#f5f5f5;border:1px solid #c9c9c9;border-radius:.25rem;margin:0 0 0 .5rem;position:absolute;bottom:0}joomla-field-mediamore label.input-group-text{width:auto}joomla-field-mediamore summary{background-color:#e3e3e3;border-radius:.25rem;padding:1rem;font-weight:500}joomla-field-mediamore details .form-group{margin:1rem!important}
|
||||
BIN
media/system/css/fields/joomla-media-select.min.css.gz
Normal file
BIN
media/system/css/fields/joomla-media-select.min.css.gz
Normal file
Binary file not shown.
82
media/system/css/fields/switcher.css
Normal file
82
media/system/css/fields/switcher.css
Normal file
@ -0,0 +1,82 @@
|
||||
@charset "UTF-8";
|
||||
.switcher {
|
||||
width: 18rem;
|
||||
height: 28px;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.switcher input {
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
top: 0;
|
||||
width: 62px;
|
||||
height: 28px;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
inset-inline-start: 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);
|
||||
box-shadow: 0 0 0 .2rem #1a466b40;
|
||||
}
|
||||
|
||||
.switcher label {
|
||||
text-align: start;
|
||||
margin-bottom: 0;
|
||||
width: auto;
|
||||
min-width: 6rem;
|
||||
height: 100%;
|
||||
margin-inline-start: 70px;
|
||||
line-height: 28px;
|
||||
transition: opacity .25s;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
inset-inline-start: 0;
|
||||
}
|
||||
|
||||
.switcher .toggle-outside {
|
||||
box-sizing: border-box;
|
||||
background: #d3d3d3;
|
||||
border: 1px solid #0000002e;
|
||||
width: 58px;
|
||||
height: 100%;
|
||||
transition: all .2s;
|
||||
position: absolute;
|
||||
inset-inline-start: 0;
|
||||
overflow: hidden;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.switcher input ~ input:checked ~ .toggle-outside {
|
||||
background: #2f7d32;
|
||||
}
|
||||
|
||||
.switcher .toggle-inside {
|
||||
background: #fff;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
transition: all .4s;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.switcher input ~ input:checked ~ .toggle-outside .toggle-inside {
|
||||
left: 30px;
|
||||
}
|
||||
1
media/system/css/fields/switcher.min.css
vendored
Normal file
1
media/system/css/fields/switcher.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";.switcher{width:18rem;height:28px;margin:0;position:relative}.switcher input{z-index:2;cursor:pointer;opacity:0;top:0;width:62px;height:28px;margin:0;position:absolute;inset-inline-start: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);box-shadow:0 0 0 .2rem #1a466b40}.switcher label{text-align:start;margin-bottom:0;width:auto;min-width:6rem;height:100%;margin-inline-start:70px;line-height:28px;transition:opacity .25s;display:inline-block;position:absolute;inset-inline-start:0}.switcher .toggle-outside{box-sizing:border-box;background:#d3d3d3;border:1px solid #0000002e;width:58px;height:100%;transition:all .2s;position:absolute;inset-inline-start:0;overflow:hidden;transform:translate(0)}.switcher input~input:checked~.toggle-outside{background:#2f7d32}.switcher .toggle-inside{background:#fff;width:28px;height:28px;transition:all .4s;position:absolute;left:0}.switcher input~input:checked~.toggle-outside .toggle-inside{left:30px}
|
||||
BIN
media/system/css/fields/switcher.min.css.gz
Normal file
BIN
media/system/css/fields/switcher.min.css.gz
Normal file
Binary file not shown.
27
media/system/css/joomla-core-loader.css
Normal file
27
media/system/css/joomla-core-loader.css
Normal file
@ -0,0 +1,27 @@
|
||||
@charset "UTF-8";
|
||||
:host {
|
||||
z-index: 10000;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
:host(.fullscreen) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
:host(.fullscreen) svg {
|
||||
width: 345px;
|
||||
height: 345px;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.joomla-spinner {
|
||||
animation: none !important;
|
||||
}
|
||||
}
|
||||
1
media/system/css/joomla-core-loader.min.css
vendored
Normal file
1
media/system/css/joomla-core-loader.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";:host{z-index:10000;justify-content:center;align-items:center;display:flex;overflow:hidden}:host(.fullscreen){width:100%;height:100%;position:fixed;top:0;left:0}:host(.fullscreen) svg{width:345px;height:345px}@media (prefers-reduced-motion:reduce){.joomla-spinner{animation:none!important}}
|
||||
BIN
media/system/css/joomla-core-loader.min.css.gz
Normal file
BIN
media/system/css/joomla-core-loader.min.css.gz
Normal file
Binary file not shown.
11408
media/system/css/joomla-fontawesome.css
Normal file
11408
media/system/css/joomla-fontawesome.css
Normal file
File diff suppressed because it is too large
Load Diff
1
media/system/css/joomla-fontawesome.min.css
vendored
Normal file
1
media/system/css/joomla-fontawesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/system/css/joomla-fontawesome.min.css.gz
Normal file
BIN
media/system/css/joomla-fontawesome.min.css.gz
Normal file
Binary file not shown.
4
media/system/css/joomla-toolbar-button.css
Normal file
4
media/system/css/joomla-toolbar-button.css
Normal file
@ -0,0 +1,4 @@
|
||||
@charset "UTF-8";
|
||||
joomla-toolbar-button .dropdown-item:focus, joomla-toolbar-button .dropdown-item:hover {
|
||||
color: #fff;
|
||||
}
|
||||
1
media/system/css/joomla-toolbar-button.min.css
vendored
Normal file
1
media/system/css/joomla-toolbar-button.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";joomla-toolbar-button .dropdown-item:focus,joomla-toolbar-button .dropdown-item:hover{color:#fff}
|
||||
BIN
media/system/css/joomla-toolbar-button.min.css.gz
Normal file
BIN
media/system/css/joomla-toolbar-button.min.css.gz
Normal file
Binary file not shown.
49
media/system/css/system-admin-error.css
Normal file
49
media/system/css/system-admin-error.css
Normal file
@ -0,0 +1,49 @@
|
||||
@charset "UTF-8";
|
||||
.outline {
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
width: 550px;
|
||||
margin: 0 auto;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
body {
|
||||
color: #333;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
margin: 15px;
|
||||
padding: 0;
|
||||
font-family: Arial, Helvetica, Sans Serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.frame {
|
||||
background-color: #fefcf3;
|
||||
border: 1px solid #000;
|
||||
margin-top: 13px;
|
||||
margin-bottom: 25px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #c33;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 1px solid #bbb;
|
||||
padding: 3px 5px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.type {
|
||||
color: #fff;
|
||||
background-color: #c00;
|
||||
padding: 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
1
media/system/css/system-admin-error.min.css
vendored
Normal file
1
media/system/css/system-admin-error.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";.outline{background:#fff;border:1px solid #ccc;width:550px;margin:0 auto;padding:2px}body{color:#333;background:#fff;height:100%;margin:15px;padding:0;font-family:Arial,Helvetica,Sans Serif;font-size:11px}.frame{background-color:#fefcf3;border:1px solid #000;margin-top:13px;margin-bottom:25px;padding:8px}h1{color:#c33;font-size:18px}.table{border-collapse:collapse;margin-top:13px}td{border:1px solid #bbb;padding:3px 5px;font-size:10px}.type{color:#fff;background-color:#c00;padding:3px;font-weight:700}
|
||||
BIN
media/system/css/system-admin-error.min.css.gz
Normal file
BIN
media/system/css/system-admin-error.min.css.gz
Normal file
Binary file not shown.
54
media/system/css/system-admin-system.css
Normal file
54
media/system/css/system-admin-system.css
Normal file
@ -0,0 +1,54 @@
|
||||
@charset "UTF-8";
|
||||
#system-message {
|
||||
margin-bottom: 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#system-message > dt {
|
||||
font-weight: bold;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#system-message > dd {
|
||||
text-indent: 30px;
|
||||
margin: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#system-message > dd > ul {
|
||||
color: #05b;
|
||||
background-position: 4px 0;
|
||||
background-repeat: no-repeat;
|
||||
border-top: 3px solid #84a7db;
|
||||
border-bottom: 3px solid #84a7db;
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#system-message > dd > ul > li {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
#system-message > .message > ul {
|
||||
background-color: #c3d2e5;
|
||||
}
|
||||
|
||||
#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-message > .warning > ul {
|
||||
background-color: #e6c8a6;
|
||||
border-color: #fb0;
|
||||
}
|
||||
|
||||
#system-message > .notice > ul {
|
||||
background-color: #efe7b8;
|
||||
border-color: #f0dc7e;
|
||||
}
|
||||
1
media/system/css/system-admin-system.min.css
vendored
Normal file
1
media/system/css/system-admin-system.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";#system-message{margin-bottom:10px;padding:0}#system-message>dt{font-weight:700;display:none}#system-message>dd{text-indent:30px;margin:0;font-weight:700}#system-message>dd>ul{color:#05b;background-position:4px 0;background-repeat:no-repeat;border-top:3px solid #84a7db;border-bottom:3px solid #84a7db;margin-bottom:10px;padding:10px;list-style:none}#system-message>dd>ul>li{line-height:1.5em}#system-message>.message>ul{background-color:#c3d2e5}#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-message>.warning>ul{background-color:#e6c8a6;border-color:#fb0}#system-message>.notice>ul{background-color:#efe7b8;border-color:#f0dc7e}
|
||||
BIN
media/system/css/system-admin-system.min.css.gz
Normal file
BIN
media/system/css/system-admin-system.min.css.gz
Normal file
Binary file not shown.
75
media/system/css/system-site-error.css
Normal file
75
media/system/css/system-site-error.css
Normal file
@ -0,0 +1,75 @@
|
||||
@charset "UTF-8";
|
||||
* {
|
||||
color: #5f6565;
|
||||
font-family: helvetica, arial, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
margin: 0 0 1px;
|
||||
padding: 0;
|
||||
font-family: helvetica, arial, sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.error {
|
||||
margin-left: auto;
|
||||
margin-right: 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 {
|
||||
background: #fff;
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
padding: 60px 0;
|
||||
}
|
||||
|
||||
#errorboxoutline {
|
||||
border: 1px solid #000;
|
||||
width: 900px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#errorboxheader {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: #e44249;
|
||||
border-bottom: 1px solid #000;
|
||||
width: 900px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
#errorboxbody {
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#techinfo {
|
||||
color: #ccc;
|
||||
text-align: left;
|
||||
border: 1px solid #ccc;
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#techinfo p {
|
||||
color: #ccc;
|
||||
}
|
||||
1
media/system/css/system-site-error.min.css
vendored
Normal file
1
media/system/css/system-site-error.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";*{color:#5f6565;font-family:helvetica,arial,sans-serif;font-size:11px}html{height:100%;margin-bottom:1px}body{background:#fff;height:100%;margin:0 0 1px;padding:0;font-family:helvetica,arial,sans-serif;font-weight:400}.error{margin-left:auto;margin-right:auto}table,td,th,div,pre,blockquote,ul,ol,dl,address,.componentheading,.contentheading,.contentpagetitle,.sectiontableheader,.newsfeedheading{font-family:helvetica,arial,sans-serif;font-weight:400}#outline{background:#fff;width:900px;margin:0 auto;padding:60px 0}#errorboxoutline{border:1px solid #000;width:900px;margin:0;padding:0}#errorboxheader{color:#fff;text-align:center;background:#e44249;border-bottom:1px solid #000;width:900px;margin:0;padding:0;font-size:12px;font-weight:700;line-height:22px}#errorboxbody{text-align:left;margin:0;padding:10px}#techinfo{color:#ccc;text-align:left;border:1px solid #ccc;margin:10px;padding:10px}#techinfo p{color:#ccc}
|
||||
BIN
media/system/css/system-site-error.min.css.gz
Normal file
BIN
media/system/css/system-site-error.min.css.gz
Normal file
Binary file not shown.
12
media/system/css/system-site-error_rtl.css
Normal file
12
media/system/css/system-site-error_rtl.css
Normal file
@ -0,0 +1,12 @@
|
||||
@charset "UTF-8";
|
||||
body {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.TD {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#errorboxbody, #techinfo {
|
||||
text-align: right;
|
||||
}
|
||||
1
media/system/css/system-site-error_rtl.min.css
vendored
Normal file
1
media/system/css/system-site-error_rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";body{text-align:right}.TD{text-align:left}#errorboxbody,#techinfo{text-align:right}
|
||||
BIN
media/system/css/system-site-error_rtl.min.css.gz
Normal file
BIN
media/system/css/system-site-error_rtl.min.css.gz
Normal file
Binary file not shown.
141
media/system/css/system-site-general.css
Normal file
141
media/system/css/system-site-general.css
Normal file
@ -0,0 +1,141 @@
|
||||
@charset "UTF-8";
|
||||
.invalid {
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
label.invalid {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#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 {
|
||||
float: left;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
height: 22px;
|
||||
font-size: 11px;
|
||||
line-height: 22px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.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 {
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.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;
|
||||
background: url("../images/j_button2_left.png?v=173204") no-repeat;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.button2-right {
|
||||
float: left;
|
||||
background: url("../images/j_button2_right.png?v=173204") 100% 0 no-repeat;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.button2-left .image {
|
||||
background: url("../images/j_button2_image.png?v=173204") 100% 0 no-repeat;
|
||||
}
|
||||
|
||||
.button2-left .readmore, .button2-left .article {
|
||||
background: url("../images/j_button2_readmore.png?v=173204") 100% 0 no-repeat;
|
||||
}
|
||||
|
||||
.button2-left .pagebreak {
|
||||
background: url("../images/j_button2_pagebreak.png?v=173204") 100% 0 no-repeat;
|
||||
}
|
||||
|
||||
.button2-left .blank {
|
||||
background: url("../images/j_button2_blank.png?v=173204") 100% 0 no-repeat;
|
||||
}
|
||||
|
||||
div.tooltip {
|
||||
z-index: 13000;
|
||||
float: left;
|
||||
background: #ffc;
|
||||
border: 1px solid #d4d5aa;
|
||||
max-width: 200px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
div.tooltip h4 {
|
||||
background: url("../images/selector-arrow.png?v=173204") no-repeat;
|
||||
margin: -15px 0 0;
|
||||
padding: 15px 0 5px;
|
||||
font-size: 95%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.tooltip p {
|
||||
margin: 0;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.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 {
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
background: url("../images/calendar.png?v=ad4756") no-repeat;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
1
media/system/css/system-site-general.min.css
vendored
Normal file
1
media/system/css/system-site-general.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";.invalid{border-color:red}label.invalid{color:red}#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{float:left;color:#666;cursor:pointer;height:22px;font-size:11px;line-height:22px;display:block}.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{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{float:left;background:url(../images/j_button2_left.png?v=173204) no-repeat;margin-left:5px}.button2-right{float:left;background:url(../images/j_button2_right.png?v=173204) 100% 0 no-repeat;margin-left:5px}.button2-left .image{background:url(../images/j_button2_image.png?v=173204) 100% 0 no-repeat}.button2-left .readmore,.button2-left .article{background:url(../images/j_button2_readmore.png?v=173204) 100% 0 no-repeat}.button2-left .pagebreak{background:url(../images/j_button2_pagebreak.png?v=173204) 100% 0 no-repeat}.button2-left .blank{background:url(../images/j_button2_blank.png?v=173204) 100% 0 no-repeat}div.tooltip{z-index:13000;float:left;background:#ffc;border:1px solid #d4d5aa;max-width:200px;padding:5px}div.tooltip h4{background:url(../images/selector-arrow.png?v=173204) no-repeat;margin:-15px 0 0;padding:15px 0 5px;font-size:95%;font-weight:700}div.tooltip p{margin:0;font-size:90%}.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{vertical-align:middle;cursor:pointer;background:url(../images/calendar.png?v=ad4756) no-repeat;width:16px;height:16px;margin-left:3px}
|
||||
BIN
media/system/css/system-site-general.min.css.gz
Normal file
BIN
media/system/css/system-site-general.min.css.gz
Normal file
Binary file not shown.
125
media/system/css/system-site-offline.css
Normal file
125
media/system/css/system-site-offline.css
Normal file
@ -0,0 +1,125 @@
|
||||
@charset "UTF-8";
|
||||
body {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#frame {
|
||||
max-width: 400px;
|
||||
margin: 20px auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
#frame img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#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 {
|
||||
margin: 5px 0 2px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
input {
|
||||
box-sizing: border-box;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
border: 1px solid #0e67a1;
|
||||
width: 100%;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
input.button {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
background-color: #006dcc;
|
||||
border-color: #04c;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
input.button:hover {
|
||||
background-color: #04c;
|
||||
}
|
||||
|
||||
fieldset.input p {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
#frmlogin {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
#frmlogin fieldset.button {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.alert {
|
||||
text-align: left;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 8px 25px 8px 14px;
|
||||
}
|
||||
|
||||
.alert h4 {
|
||||
color: red;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.alert p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.alert .close {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
font-size: 24px;
|
||||
line-height: 18px;
|
||||
position: relative;
|
||||
top: -2px;
|
||||
right: -20px;
|
||||
}
|
||||
|
||||
.login {
|
||||
margin-top: 5px;
|
||||
}
|
||||
1
media/system/css/system-site-offline.min.css
vendored
Normal file
1
media/system/css/system-site-offline.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";body{color:#333;text-align:center;margin:0;padding:0;font-family:arial,helvetica,sans-serif;font-size:14px}img{border:0;margin-left:auto;margin-right:auto}#frame{max-width:400px;margin:20px auto;padding:20px}#frame img{max-width:100%;height:auto}#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{margin:5px 0 2px;display:block}input{box-sizing:border-box;font-family:inherit;font-size:inherit;border:1px solid #0e67a1;width:100%;padding:5px 10px}input.button{color:#fff;cursor:pointer;appearance:none;background-color:#006dcc;border-color:#04c;width:auto}input.button:hover{background-color:#04c}fieldset.input p{clear:left}#frmlogin{margin:0 10px}#frmlogin fieldset.button{text-align:right}.alert{text-align:left;background:#fff;border:1px solid #ccc;padding:8px 25px 8px 14px}.alert h4{color:red;margin:5px 0}.alert p{margin:0;padding:0}.alert .close{float:right;cursor:pointer;font-size:24px;line-height:18px;position:relative;top:-2px;right:-20px}.login{margin-top:5px}
|
||||
BIN
media/system/css/system-site-offline.min.css.gz
Normal file
BIN
media/system/css/system-site-offline.min.css.gz
Normal file
Binary file not shown.
23
media/system/css/system-site-offline_rtl.css
Normal file
23
media/system/css/system-site-offline_rtl.css
Normal file
@ -0,0 +1,23 @@
|
||||
@charset "UTF-8";
|
||||
#frame form {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
label {
|
||||
float: right;
|
||||
}
|
||||
|
||||
fieldset.input p {
|
||||
clear: right;
|
||||
}
|
||||
|
||||
.alert {
|
||||
text-align: right;
|
||||
padding: 8px 8px 25px 14px;
|
||||
}
|
||||
|
||||
.alert .close {
|
||||
float: left;
|
||||
left: -20px;
|
||||
right: 0;
|
||||
}
|
||||
1
media/system/css/system-site-offline_rtl.min.css
vendored
Normal file
1
media/system/css/system-site-offline_rtl.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";#frame form{text-align:right}label{float:right}fieldset.input p{clear:right}.alert{text-align:right;padding:8px 8px 25px 14px}.alert .close{float:left;left:-20px;right:0}
|
||||
BIN
media/system/css/system-site-offline_rtl.min.css.gz
Normal file
BIN
media/system/css/system-site-offline_rtl.min.css.gz
Normal file
Binary file not shown.
39
media/system/html/noxml.html
Normal file
39
media/system/html/noxml.html
Normal file
File diff suppressed because one or more lines are too long
726
media/system/joomla.asset.json
Normal file
726
media/system/joomla.asset.json
Normal file
@ -0,0 +1,726 @@
|
||||
{
|
||||
"$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": "keepalive",
|
||||
"type": "script",
|
||||
"class": "KeepaliveAssetItem",
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"uri": "system/keepalive.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"version": "08e025"
|
||||
},
|
||||
{
|
||||
"name": "inlinehelp",
|
||||
"type": "script",
|
||||
"uri": "system/inlinehelp.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"inlinehelp-legacy"
|
||||
],
|
||||
"version": "c1a01d"
|
||||
},
|
||||
{
|
||||
"name": "core",
|
||||
"type": "script",
|
||||
"class": "CoreAssetItem",
|
||||
"uri": "system/core.min.js",
|
||||
"version": "2cb912"
|
||||
},
|
||||
{
|
||||
"name": "multiselect",
|
||||
"type": "script",
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"uri": "system/multiselect.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"version": "a0a457"
|
||||
},
|
||||
{
|
||||
"name": "showon",
|
||||
"type": "script",
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"uri": "system/showon.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"version": "e51227"
|
||||
},
|
||||
{
|
||||
"name": "messages",
|
||||
"type": "script",
|
||||
"uri": "system/messages.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"messages-legacy"
|
||||
],
|
||||
"version": "9a4811"
|
||||
},
|
||||
{
|
||||
"name": "table.columns",
|
||||
"type": "script",
|
||||
"class": "TableColumnsAssetItem",
|
||||
"uri": "system/table-columns.min.js",
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"attributes": {
|
||||
"defer": true,
|
||||
"type": "module"
|
||||
},
|
||||
"version": "4bcb00"
|
||||
},
|
||||
{
|
||||
"name": "switcher",
|
||||
"type": "style",
|
||||
"uri": "system/fields/switcher.min.css",
|
||||
"version": "8d9e2a"
|
||||
},
|
||||
{
|
||||
"name": "searchtools",
|
||||
"type": "script",
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"uri": "system/searchtools.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"version": "abfb14"
|
||||
},
|
||||
{
|
||||
"name": "field.color-adv",
|
||||
"type": "script",
|
||||
"uri": "system/fields/color-field-adv-init.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"minicolors"
|
||||
],
|
||||
"version": "4c7560"
|
||||
},
|
||||
{
|
||||
"name": "form.validate",
|
||||
"type": "script",
|
||||
"class": "FormValidateAssetItem",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"uri": "system/fields/validate.min.js",
|
||||
"version": "9c4b9d"
|
||||
},
|
||||
{
|
||||
"name": "field.passwordview",
|
||||
"type": "script",
|
||||
"uri": "system/fields/passwordview.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"version": "a335da"
|
||||
},
|
||||
{
|
||||
"name": "joomla.draggable",
|
||||
"type": "script",
|
||||
"uri": "system/draggable.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"dragula"
|
||||
],
|
||||
"version": "ffd540"
|
||||
},
|
||||
{
|
||||
"name": "highlight",
|
||||
"type": "script",
|
||||
"uri": "system/highlight.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"highlight-legacy"
|
||||
],
|
||||
"version": "3f8d16"
|
||||
},
|
||||
{
|
||||
"name": "field.calendar",
|
||||
"type": "script",
|
||||
"uri": "system/fields/calendar.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"field.calendar.helper"
|
||||
],
|
||||
"version": "1903da"
|
||||
},
|
||||
{
|
||||
"name": "field.calendar",
|
||||
"type": "style",
|
||||
"uri": "system/fields/calendar.css",
|
||||
"version": "087670"
|
||||
},
|
||||
{
|
||||
"name": "field.color-slider",
|
||||
"type": "script",
|
||||
"uri": "system/fields/joomla-field-color-slider.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"version": "01c1ec"
|
||||
},
|
||||
{
|
||||
"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": "21a476"
|
||||
},
|
||||
{
|
||||
"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": "8fe001"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-media",
|
||||
"type": "style",
|
||||
"uri": "system/fields/joomla-field-media.min.css",
|
||||
"version": "29a289"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.media-select",
|
||||
"type": "style",
|
||||
"uri": "system/fields/joomla-media-select.min.css",
|
||||
"version": "08a456"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.media-select",
|
||||
"type": "script",
|
||||
"uri": "system/fields/joomla-media-select.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.media-select-legacy",
|
||||
"joomla.dialog"
|
||||
],
|
||||
"version": "13ff7d"
|
||||
},
|
||||
{
|
||||
"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": "1f3de3"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-media",
|
||||
"type": "script",
|
||||
"uri": "system/fields/joomla-field-media.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.field-media-legacy"
|
||||
],
|
||||
"version": "03e20d"
|
||||
},
|
||||
{
|
||||
"name": "field.passwordstrength",
|
||||
"type": "script",
|
||||
"uri": "system/fields/passwordstrength.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"core",
|
||||
"form.validate"
|
||||
],
|
||||
"version": "868594"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-permissions",
|
||||
"type": "script",
|
||||
"uri": "system/fields/joomla-field-permissions.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.field-permissions-legacy"
|
||||
],
|
||||
"version": "ff46de"
|
||||
},
|
||||
{
|
||||
"name": "field.calendar-rtl",
|
||||
"type": "style",
|
||||
"uri": "system/fields/calendar-rtl.css",
|
||||
"version": "64282a"
|
||||
},
|
||||
{
|
||||
"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": "f8992f"
|
||||
},
|
||||
{
|
||||
"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": "48efe4"
|
||||
},
|
||||
{
|
||||
"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": "aa73f7"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-simple-color",
|
||||
"type": "style",
|
||||
"uri": "system/fields/joomla-field-simple-color.min.css",
|
||||
"version": "08bfd7"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.core-loader",
|
||||
"type": "script",
|
||||
"uri": "system/joomla-core-loader.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.core-loader-legacy"
|
||||
],
|
||||
"version": "5c9938"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-subform",
|
||||
"type": "script",
|
||||
"uri": "system/fields/joomla-field-subform.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.field-subform-legacy"
|
||||
],
|
||||
"version": "4fead1"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.hidden-mail",
|
||||
"type": "script",
|
||||
"uri": "system/joomla-hidden-mail.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.hidden-mail-legacy"
|
||||
],
|
||||
"version": "80d9c7"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.toolbar-button",
|
||||
"type": "script",
|
||||
"uri": "system/joomla-toolbar-button.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"webcomponent.toolbar-button-legacy",
|
||||
"joomla.dialog"
|
||||
],
|
||||
"version": "623aee"
|
||||
},
|
||||
{
|
||||
"name": "joomla.dialog",
|
||||
"type": "script",
|
||||
"uri": "system/joomla-dialog.min.js",
|
||||
"importmap": true,
|
||||
"dependencies": [
|
||||
"wcpolyfill",
|
||||
"core"
|
||||
],
|
||||
"version": "608bd1"
|
||||
},
|
||||
{
|
||||
"name": "joomla.dialog-autocreate",
|
||||
"type": "script",
|
||||
"uri": "system/joomla-dialog-autocreate.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"joomla.dialog"
|
||||
],
|
||||
"version": "44fd47"
|
||||
},
|
||||
{
|
||||
"name": "list-view",
|
||||
"type": "script",
|
||||
"uri": "system/list-view.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"version": "bb814f"
|
||||
},
|
||||
{
|
||||
"type": "script",
|
||||
"name": "modal-content-select",
|
||||
"dependencies": [
|
||||
"core"
|
||||
],
|
||||
"uri": "system/modal-content-select.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"version": "feb637"
|
||||
},
|
||||
{
|
||||
"type": "script",
|
||||
"name": "modal-content-select-field",
|
||||
"dependencies": [
|
||||
"core",
|
||||
"joomla.dialog"
|
||||
],
|
||||
"uri": "system/fields/modal-content-select-field.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"version": "7a6bf1"
|
||||
},
|
||||
{
|
||||
"name": "joomla.treeselectmenu",
|
||||
"type": "script",
|
||||
"uri": "system/treeselectmenu.min.js",
|
||||
"attributes": {
|
||||
"type": "module"
|
||||
},
|
||||
"version": "c1bf6e"
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-permissions",
|
||||
"type": "style",
|
||||
"uri": "system/fields/joomla-field-permissions.min.css",
|
||||
"version": "e39396"
|
||||
}
|
||||
]
|
||||
}
|
||||
793
media/system/js/core.js
Normal file
793
media/system/js/core.js
Normal file
@ -0,0 +1,793 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function _extends() {
|
||||
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
||||
for (var e = 1; e < arguments.length; e++) {
|
||||
var t = arguments[e];
|
||||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
||||
}
|
||||
return n;
|
||||
}, _extends.apply(null, 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
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 || {};
|
||||
|
||||
// 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 = Joomla.editors.instances || {
|
||||
/**
|
||||
* *****************************************************************
|
||||
* All Editors MUST register, per instance, the following callbacks:
|
||||
* *****************************************************************
|
||||
*
|
||||
* getValue Type Function Should return the complete data from the editor
|
||||
* Example: () => { return this.element.value; }
|
||||
* setValue Type Function Should replace the complete data of the editor
|
||||
* Example: (text) => { return this.element.value = text; }
|
||||
* getSelection Type Function Should return the selected text from the editor
|
||||
* Example: function () { return this.selectedText; }
|
||||
* disable Type Function Toggles the editor into disabled mode. When the editor is
|
||||
* active then everything should be usable. When inactive the
|
||||
* editor should be unusable AND disabled for form validation
|
||||
* Example: (bool) => { return this.disable = value; }
|
||||
* replaceSelection Type Function Should replace the selected text of the editor
|
||||
* If nothing selected, will insert the data at the cursor
|
||||
* Example:
|
||||
* (text) => {
|
||||
* return insertAtCursor(this.element, text);
|
||||
* }
|
||||
*
|
||||
* USAGE (assuming that jform_articletext is the textarea id)
|
||||
* {
|
||||
* To get the current editor value:
|
||||
* Joomla.editors.instances['jform_articletext'].getValue();
|
||||
* To set the current editor value:
|
||||
* Joomla.editors.instances['jform_articletext'].setValue('Joomla! rocks');
|
||||
* To replace(selection) or insert a value at the current editor cursor (replaces the J3
|
||||
* jInsertEditorText API):
|
||||
* replaceSelection:
|
||||
* Joomla.editors.instances['jform_articletext'].replaceSelection('Joomla! rocks')
|
||||
* }
|
||||
*
|
||||
* *********************************************************
|
||||
* ANY INTERACTION WITH THE EDITORS SHOULD USE THE ABOVE API
|
||||
* *********************************************************
|
||||
*/
|
||||
};
|
||||
Joomla.Modal = 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 => {
|
||||
Joomla.Modal.current = element;
|
||||
},
|
||||
getCurrent: () => Joomla.Modal.current
|
||||
};
|
||||
|
||||
/**
|
||||
* 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 = {};
|
||||
}
|
||||
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) {
|
||||
let counter = 0;
|
||||
document.querySelectorAll('.joomla-script-options.new').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
|
||||
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 => {
|
||||
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;
|
||||
}
|
||||
document.querySelectorAll('input[type="hidden"]').forEach(element => {
|
||||
if (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) {
|
||||
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;
|
||||
};
|
||||
|
||||
})();
|
||||
4
media/system/js/core.min.js
vendored
Normal file
4
media/system/js/core.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/system/js/core.min.js.gz
Normal file
BIN
media/system/js/core.min.js.gz
Normal file
Binary file not shown.
175
media/system/js/draggable.js
Normal file
175
media/system/js/draggable.js
Normal 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);
|
||||
});
|
||||
}
|
||||
4
media/system/js/draggable.min.js
vendored
Normal file
4
media/system/js/draggable.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/let url,direction,isNested,dragElementIndex,dropElementIndex,container=document.querySelector(".js-draggable"),form,formData;if(container)url=container.dataset.url,direction=container.dataset.direction,isNested=container.dataset.nested;else if(Joomla.getOptions("draggable-list")){const o=Joomla.getOptions("draggable-list");container=document.querySelector(o.id),container.classList.contains("js-draggable")||container.classList.add("js-draggable"),{url}=o,{direction}=o,isNested=o.nested}if(container){form=container.closest("form"),formData=new FormData(form),formData.delete("task"),formData.delete("order[]"),document.addEventListener("touchstart",()=>{},!1);const o=(e,l,r,a)=>{let t;const s=[];if(r<a)for(e[a].value=e[a-1].value,t=r;t<a;t+=1)direction==="asc"?e[t].value=parseInt(e[t].value,10)-1:e[t].value=parseInt(e[t].value,10)+1;else for(e[a].value=e[a+1].value,t=a+1;t<=r;t+=1)direction==="asc"?e[t].value=parseInt(e[t].value,10)+1:e[t].value=parseInt(e[t].value,10)-1;for(t=0;t<e.length-1;t+=1)s.push(`order[]=${encodeURIComponent(e[t].value)}`),s.push(`cid[]=${encodeURIComponent(l[t].value)}`);return s},c=e=>{if(!e.dataset.itemId)return;const l=e.dataset.itemId,r=container.querySelectorAll(`tr[data-parents~="${l}"]`);r.length&&e.after(...r)},d=e=>{let l,r,a;const t=e.dataset.draggableGroup;t?(a=`tr[data-draggable-group="${t}"]`,l=`[data-draggable-group="${t}"] [name="order[]"]`,r=`[data-draggable-group="${t}"] [name="cid[]"]`):(a="tr",l='[name="order[]"]',r='[name="cid[]"]');const s=[].slice.call(container.querySelectorAll(a)),u=[].slice.call(container.querySelectorAll(l)),i=[].slice.call(container.querySelectorAll(r));if(dropElementIndex=s.indexOf(e),url){const n=document.querySelector('[name="task"]');n&&n.setAttribute("name","some__Temporary__Name__");const g={url,method:"POST",data:`${new URLSearchParams(formData).toString()}&${o(u,i,dragElementIndex,dropElementIndex).join("&")}`,perform:!0};Joomla.request(g),n&&n.setAttribute("name","task")}c(e)};dragula([container],{direction:"vertical",copy:!1,revertOnSpill:!0,accepts(e,l,r,a){return isNested&&a!==null?a.dataset.draggableGroup&&a.dataset.draggableGroup===e.dataset.draggableGroup:a===null||a&&a.tagName.toLowerCase()==="tr"},mirrorContainer:container}).on("drag",e=>{let l;const r=e.dataset.draggableGroup;r?l=`tr[data-draggable-group="${r}"]`:l="tr",dragElementIndex=[].slice.call(container.querySelectorAll(l)).indexOf(e)}).on("drop",e=>{d(e)})}
|
||||
BIN
media/system/js/draggable.min.js.gz
Normal file
BIN
media/system/js/draggable.min.js.gz
Normal file
Binary file not shown.
175
media/system/js/editors/editor-api.js
Normal file
175
media/system/js/editors/editor-api.js
Normal 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 };
|
||||
4
media/system/js/editors/editor-api.min.js
vendored
Normal file
4
media/system/js/editors/editor-api.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import r 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
|
||||
*/const c={instances:{},active:null,register(t){if(!(t instanceof r))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 r)e=t.getId();else if(typeof t=="string")e=t;else throw new Error("Unexpected editor instance or identifier");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 r)this.active=t;else if(this.instances[t])this.active=this.instances[t];else throw new Error("The editor instance not found or it is incorrect");return this},getActive(){return this.active}},l={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 s=this.getActionHandler(t);let i=c.getActive();if(!s)throw new Error(`Handler for "${t}" action not found`);if(!i&&o){const a=o.closest("fieldset, div:not(.editor-xtd-buttons)"),n=a?a.querySelector("textarea[id]"):!1;i=n&&Joomla.editors.instances[n.id]?Joomla.editors.instances[n.id]:!1,i&&console.warn("Legacy editors is deprecated. Set active editor instance with JoomlaEditor.setActive().")}if(!i)throw new Error("An active editor are not available");return s(i,e)}};export{c as JoomlaEditor,l as JoomlaEditorButton};
|
||||
BIN
media/system/js/editors/editor-api.min.js.gz
Normal file
BIN
media/system/js/editors/editor-api.min.js.gz
Normal file
Binary file not shown.
137
media/system/js/editors/editor-decorator.js
Normal file
137
media/system/js/editors/editor-decorator.js
Normal 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 };
|
||||
4
media/system/js/editors/editor-decorator.min.js
vendored
Normal file
4
media/system/js/editors/editor-decorator.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/class o{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{o as default};
|
||||
BIN
media/system/js/editors/editor-decorator.min.js.gz
Normal file
BIN
media/system/js/editors/editor-decorator.min.js.gz
Normal file
Binary file not shown.
102
media/system/js/editors/editors.js
Normal file
102
media/system/js/editors/editors.js
Normal 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);
|
||||
}
|
||||
});
|
||||
4
media/system/js/editors/editors.min.js
vendored
Normal file
4
media/system/js/editors/editors.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import{JoomlaEditorDecorator as i,JoomlaEditorButton as n}from"editor-api";import c 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.");Joomla.editors=Joomla.editors||{},Joomla.editors.instances=new Proxy({},{set(o,e,t){return t instanceof i||(t.getId=()=>e,console.warn("Legacy editors is deprecated. Register the editor instance with JoomlaEditor.register().",e,t)),o[e]=t,!0},get(o,e){return console.warn("Direct access to Joomla.editors.instances is deprecated. Use JoomlaEditor.getActive() or JoomlaEditor.get(id) to retrieve the editor instance."),o[e]}}),n.registerAction("insert",(o,e)=>{const t=e.content||"";o.replaceSelection(t)}),n.registerAction("modal",(o,e)=>{if(e.src&&e.src[0]!=="#"&&e.src[0]!=="."){const a=e.src.indexOf("http")===0?new URL(e.src):new URL(e.src,window.location.origin);a.searchParams.set("editor",o.getId()),a.searchParams.has("e_name")&&a.searchParams.set("e_name",o.getId()),e.src=a.toString()}const t=new c(e),r=a=>{a.origin===window.location.origin&&(a.data.messageType==="joomla:content-select"?(o.replaceSelection(a.data.html||a.data.text),t.close()):a.data.messageType==="joomla:cancel"&&t.close())};window.JoomlaExpectingPostMessage=!0,window.addEventListener("message",r),t.addEventListener("joomla-dialog:close",()=>{delete window.JoomlaExpectingPostMessage,window.removeEventListener("message",r),Joomla.Modal.setCurrent(null),t.destroy()}),Joomla.Modal.setCurrent(t),t.show()});const l="[data-joomla-editor-button-action]",d="joomlaEditorButtonAction",s="joomlaEditorButtonOptions";document.addEventListener("click",o=>{const e=o.target.closest(l);if(!e)return;const t=e.dataset[d],r=e.dataset[s]?JSON.parse(e.dataset[s]):{};t&&n.runAction(t,r,e)});
|
||||
BIN
media/system/js/editors/editors.min.js.gz
Normal file
BIN
media/system/js/editors/editors.min.js.gz
Normal file
Binary file not shown.
@ -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].substring(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].substring(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).substring(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);
|
||||
2
media/system/js/fields/calendar-locales/date/gregorian/date-helper.min.js
vendored
Normal file
2
media/system/js/fields/calendar-locales/date/gregorian/date-helper.min.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
(function(r){"use strict";var y=[0,1,2,3,4,5,6,7,8,9];r.SECOND=1e3,r.MINUTE=60*r.SECOND,r.HOUR=60*r.MINUTE,r.DAY=24*r.HOUR,r.WEEK=7*r.DAY,r.prototype.setLocalDateOnly=function(e,t){if(e!="gregorian")return"";var i=new r(t);this.setDate(1),this.setFullYear(i.getFullYear()),this.setMonth(i.getMonth()),this.setDate(i.getDate())},r.prototype.setLocalDate=function(e,t){return e!="gregorian"?"":this.setDate(t)},r.prototype.setLocalMonth=function(e,t,i){return e!="gregorian"?"":(i==null&&this.getDate(),this.setMonth(t))},r.prototype.setOtherFullYear=function(e,t){if(e!="gregorian")return"";var i=new r(this);return i.setFullYear(t),i.getMonth()!=this.getMonth()&&this.setDate(28),this.setUTCFullYear(t)},r.prototype.setLocalFullYear=function(e,t){if(e!="gregorian")return"";var i=new r(this);return i.setFullYear(t),i.getMonth()!=this.getMonth()&&this.setDate(28),this.setFullYear(t)},r.prototype.getLocalWeekDays=function(e,t){return e!="gregorian",6},r.prototype.getOtherFullYear=function(e){return e!="gregorian"?"":this.getFullYear()},r.prototype.getLocalFullYear=function(e){return e!="gregorian"?"":this.getFullYear()},r.prototype.getLocalMonth=function(e){return e!="gregorian"?"":this.getMonth()},r.prototype.getLocalDate=function(e){return e!="gregorian"?"":this.getDate()},r.prototype.getLocalDay=function(e){return e!="gregorian"?"":this.getDay()},r.prototype.getLocalMonthDays=function(e,t){if(e!="gregorian")return"";var i=this.getFullYear();return typeof t>"u"&&(t=this.getMonth()),i%4==0&&(i%100!=0||i%400==0)&&t==1?29:[31,28,31,30,31,30,31,31,30,31,30,31][t]},r.prototype.getLocalWeekNumber=function(e){if(e!="gregorian")return"";var t=new r(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),i=t.getDay();t.setDate(t.getDate()-(i+6)%7+3);var l=t.valueOf();return t.setMonth(0),t.setDate(4),Math.round((l-t.valueOf())/(7*864e5))+1},r.prototype.getLocalDayOfYear=function(e){if(e!="gregorian")return"";var t=new r(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),i=new r(this.getFullYear(),0,0,0,0,0),l=t-i;return Math.floor(l/r.DAY)},r.prototype.equalsTo=function(e){return this.getFullYear()==e.getFullYear()&&this.getMonth()==e.getMonth()&&this.getDate()==e.getDate()&&this.getHours()==e.getHours()&&this.getMinutes()==e.getMinutes()},r.localCalToGregorian=function(e,t,i){return""},r.gregorianToLocalCal=function(e,t,i){return""},r.convertNumbers=function(e){e=e.toString();for(var t=0,i=y.length;t<i;t++)e=e.replace(new RegExp(t,"g"),y[t]);return e},r.toEnglish=function(e){e=this.toString();for(var t=[0,1,2,3,4,5,6,7,8,9],i=0;i<10;i++)e=e.replace(new RegExp(t[i],"g"),i);return e},r.monthsToLocalOrder=function(e){return e},r.parseFieldDate=function(e,t,i,l){i!="gregorian"&&(e=r.toEnglish(e));var h=new r,a=0,u=-1,f=0,s=e.split(/\W+/),o=t.match(/%./g),n=0,c=0,g=0,p=0,v=0;for(n=0;n<s.length;++n)if(s[n])switch(o[n]){case"%d":case"%e":f=parseInt(s[n],10);break;case"%m":u=parseInt(s[n],10)-1;break;case"%Y":case"%y":a=parseInt(s[n],10),a<100&&(a+=a>29?1900:2e3);break;case"%b":case"%B":for(c=0;c<12;++c)if(l.months[c].substring(0,s[n].length).toLowerCase()===s[n].toLowerCase()){u=c;break}break;case"%H":case"%I":case"%k":case"%l":g=parseInt(s[n],10);break;case"%P":case"%p":/pm/i.test(s[n])&&g<12?g+=12:/am/i.test(s[n])&&g>=12&&(g-=12);break;case"%M":p=parseInt(s[n],10);break;case"%S":v=parseInt(s[n],10);break}if(isNaN(a)&&(a=h.getFullYear()),isNaN(u)&&(u=h.getMonth()),isNaN(f)&&(f=h.getDate()),isNaN(g)&&(g=h.getHours()),isNaN(p)&&(p=h.getMinutes()),isNaN(v)&&(v=h.getSeconds()),a!=0&&u!=-1&&f!=0)return new r(a,u,f,g,p,v);for(a=0,u=-1,f=0,n=0;n<s.length;++n)if(s[n].search(/[a-zA-Z]+/)!=-1){var M=-1;for(c=0;c<12;++c)if(l.months[c].substring(0,s[n].length).toLowerCase()===s[n].toLowerCase()){M=c;break}M!=-1&&(u!=-1&&(f=u+1),u=M)}else parseInt(s[n],10)<=12&&u==-1?u=s[n]-1:parseInt(s[n],10)>31&&a==0?(a=parseInt(s[n],10),a<100&&(a+=a>29?1900:2e3)):f==0&&(f=s[n]);return a==0&&(a=h.getFullYear()),u!=-1&&f!=0?new r(a,u,f,g,p,v):h},r.prototype.print=function(e,t,i,l){if(typeof t!="string"&&(e=""),t||(t="gregorian"),typeof e!="string"&&(e=""),!e||this.getLocalDate(t)=="NaN"||!this.getLocalDate(t))return"";var h=this.getLocalMonth(t),a=this.getLocalDate(t),u=this.getLocalFullYear(t),f=this.getLocalWeekNumber(t),s=this.getDay(),o={},n=this.getHours(),c=n>=12,g=c?n-12:n,p=this.getLocalDayOfYear(t);g==0&&(g=12);var v=this.getMinutes(),M=this.getSeconds();o["%a"]=l.shortDays[s],o["%A"]=l.days[s],o["%b"]=l.shortMonths[h],o["%B"]=l.months[h],o["%C"]=1+Math.floor(u/100),o["%d"]=a<10?"0"+a:a,o["%e"]=a,o["%H"]=n<10?"0"+n:n,o["%I"]=g<10?"0"+g:g,o["%j"]=p<100?p<10?"00"+p:"0"+p:p,o["%k"]=n,o["%l"]=g,o["%m"]=h<9?"0"+(1+h):1+h,o["%M"]=v<10?"0"+v:v,o["%n"]=`
|
||||
`,o["%p"]=c?l.pm.toUpperCase():l.am.toUpperCase(),o["%P"]=c?l.pm:l.am,o["%s"]=Math.floor(this.getTime()/1e3),o["%S"]=M<10?"0"+M:M,o["%t"]=" ",o["%U"]=o["%W"]=o["%V"]=f<10?"0"+f:f,o["%u"]=s+1,o["%w"]=s,o["%y"]=(""+u).substring(2),o["%Y"]=u,o["%%"]="%";var m=/%./g,Y=e.replace(m,function(L){return o[L]||L});return t!="gregorian"&&i&&(Y=r.convertNumbers(Y)),Y}})(Date);
|
||||
Binary file not shown.
@ -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).substring(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].substring(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].substring(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);
|
||||
2
media/system/js/fields/calendar-locales/date/jalali/date-helper.min.js
vendored
Normal file
2
media/system/js/fields/calendar-locales/date/jalali/date-helper.min.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
(function(a){"use strict";var Y=["\u06F0","\u06F1","\u06F2","\u06F3","\u06F4","\u06F5","\u06F6","\u06F7","\u06F8","\u06F9"];a.gregorian_MD=[31,28,31,30,31,30,31,31,30,31,30,31],a.local_MD=[31,31,31,31,31,31,30,30,30,30,30,29],a.SECOND=1e3,a.MINUTE=60*a.SECOND,a.HOUR=60*a.MINUTE,a.DAY=24*a.HOUR,a.WEEK=7*a.DAY,a.prototype.setLocalDateOnly=function(e,t){if(e!="gregorian")return"";var r=new a(t);this.setDate(1),this.setFullYear(r.getFullYear()),this.setMonth(r.getMonth()),this.setDate(r.getDate())},a.prototype.setLocalDate=function(e,t){return e!="gregorian"?this.setJalaliDate(t):this.setDate(t)},a.prototype.setLocalMonth=function(e,t,r){return e!="gregorian"?this.setJalaliMonth(t,r):(r==null&&this.getDate(),this.setMonth(t))},a.prototype.setOtherFullYear=function(e,t){if(e!="gregorian"){var r=new a(this);return r.setLocalFullYear(t),r.getLocalMonth("jalali")!=this.getLocalMonth("jalali")&&this.setLocalDate("jalali",29),this.setLocalFullYear("jalali",t)}else{var r=new a(this);return r.setFullYear(t),r.getMonth()!=this.getMonth()&&this.setDate(28),this.setUTCFullYear(t)}},a.prototype.setLocalFullYear=function(e,t){if(e!="gregorian")return this.setJalaliFullYear(t);var r=new a(this);return r.setFullYear(t),r.getMonth()!=this.getMonth()&&this.setDate(28),this.setFullYear(t)},a.prototype.getLocalWeekDays=function(e,t){return e!="gregorian",6},a.prototype.getOtherFullYear=function(e){return e!="gregorian"?this.getJalaliFullYear():this.getFullYear()},a.prototype.getLocalFullYear=function(e){return e!="gregorian"?this.getJalaliFullYear():this.getFullYear()},a.prototype.getLocalMonth=function(e){return e!="gregorian"?this.getJalaliMonth():this.getMonth()},a.prototype.getLocalDate=function(e){return e!="gregorian"?this.getJalaliDate():this.getDate()},a.prototype.getLocalDay=function(e){return e!="gregorian"?this.getJalaliDay():this.getDay()},a.prototype.getLocalMonthDays=function(e,t){if(e!="gregorian"){var r=this.getLocalFullYear("jalali");return typeof t>"u"&&(t=this.getLocalMonth("jalali")),r%4==0&&(r%100!=0||r%400==0)&&t==1?29:a.local_MD[t]}else{var r=this.getFullYear();return typeof t>"u"&&(t=this.getMonth()),r%4==0&&(r%100!=0||r%400==0)&&t==1?29:a.gregorian_MD[t]}},a.prototype.getLocalWeekNumber=function(e){if(e!="gregorian"){var t=new a(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),r=t.getDay();t.setDate(t.getDate()-(r+6)%7+3);var i=t.valueOf();return t.setMonth(0),t.setDate(4),Math.round((i-t.valueOf())/(7*864e5))+1}else{var t=new a(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),r=t.getDay();t.setDate(t.getDate()-(r+6)%7+3);var i=t.valueOf();return t.setMonth(0),t.setDate(4),Math.round((i-t.valueOf())/(7*864e5))+1}},a.prototype.getLocalDayOfYear=function(e){if(e!="gregorian"){var t=new a(this.getOtherFullYear(e),this.getLocalMonth(e),this.getLocalDate(e),0,0,0),r=new a(this.getOtherFullYear(e),0,0,0,0,0),i=t-r;return Math.floor(i/a.DAY)}else{var t=new a(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),r=new a(this.getFullYear(),0,0,0,0,0),i=t-r;return Math.floor(i/a.DAY)}},a.prototype.getMonthDays=function(e){var t=this.getFullYear();return typeof e>"u"&&(e=this.getMonth()),t%4==0&&(t%100!=0||t%400==0)&&e==1?29:a.dateType!="gregorian"?a.local_MD[e]:a.gregorian_MD[e]},a.prototype.equalsTo=function(e){return this.getFullYear()==e.getFullYear()&&this.getMonth()==e.getMonth()&&this.getDate()==e.getDate()&&this.getHours()==e.getHours()&&this.getMinutes()==e.getMinutes()},a.localCalToGregorian=function(e,t,r){return f.jalaliToGregorian(e,t,r)},a.gregorianToLocalCal=function(e,t,r){return f.gregorianToJalali(e,t,r)},a.numbersToIso=function(e){var t,r=[0,1,2,3,4,5,6,7,8,9];for(e=e.toString(),t=0;t<r.length;t++)e=e.replace(new RegExp(Y[t],"g"),r[t]);return e},a.convertNumbers=function(e){e=e.toString();for(var t=0,r=Y.length;t<r;t++)e=e.replace(new RegExp(t,"g"),Y[t]);return e},a.toEnglish=function(e){e=this.toString();for(var t=[0,1,2,3,4,5,6,7,8,9],r=0;r<10;r++)e=e.replace(new RegExp(t[r],"g"),r);return e},a.monthsToLocalOrder=function(e,t){return t==="jalali"&&(e.push(e.shift()),e.push(e.shift())),e},a.prototype.print=function(e,t,r,i){if(typeof t!="string"&&(e=""),t||(t="gregorian"),typeof e!="string"&&(e=""),!e||this.getLocalDate(t)=="NaN"||!this.getLocalDate(t))return"";var h=this.getLocalMonth(t),l=this.getLocalDate(t),g=this.getLocalFullYear(t),s=this.getLocalWeekNumber(t),n=this.getLocalDay(t),u={},o=this.getHours(),c=o>=12,v=c?o-12:o,p=this.getLocalDayOfYear(t);v==0&&(v=12);var y=this.getMinutes(),M=this.getSeconds();u["%a"]=i.shortDays[n],u["%A"]=i.days[n],u["%b"]=i.shortMonths[h],u["%B"]=i.months[h],u["%C"]=1+Math.floor(g/100),u["%d"]=l<10?"0"+l:l,u["%e"]=l,u["%H"]=o<10?"0"+o:o,u["%I"]=v<10?"0"+v:v,u["%j"]=p<100?p<10?"00"+p:"0"+p:p,u["%k"]=o,u["%l"]=v,u["%m"]=h<9?"0"+(1+h):1+h,u["%M"]=y<10?"0"+y:y,u["%n"]=`
|
||||
`,u["%p"]=c?i.pm.toUpperCase():i.am.toUpperCase(),u["%P"]=c?i.pm:i.am,u["%s"]=Math.floor(this.getTime()/1e3),u["%S"]=M<10?"0"+M:M,u["%t"]=" ",u["%U"]=u["%W"]=u["%V"]=s<10?"0"+s:s,u["%u"]=n+1,u["%w"]=n,u["%y"]=(""+g).substring(2),u["%Y"]=g,u["%%"]="%";var I=/%./g,F=e.replace(I,function(L){return u[L]||L});return r&&(F=a.convertNumbers(F)),F},a.parseFieldDate=function(e,t,r,i){e=a.numbersToIso(e);var h=new a,l=0,g=-1,s=0,n=e.split(/\W+/),u=t.match(/%./g),o=0,c=0,v=0,p=0,y=0;for(o=0;o<n.length;++o)if(n[o])switch(u[o]){case"%d":case"%e":s=parseInt(n[o],10);break;case"%m":g=parseInt(n[o],10)-1;break;case"%Y":case"%y":l=parseInt(n[o],10),l<100&&(l+=l>29?1900:2e3);break;case"%b":case"%B":for(c=0;c<12;++c)if(i.months[c].substring(0,n[o].length).toLowerCase()===n[o].toLowerCase()){g=c;break}break;case"%H":case"%I":case"%k":case"%l":v=parseInt(n[o],10);break;case"%P":case"%p":/pm/i.test(n[o])&&v<12?v+=12:/am/i.test(n[o])&&v>=12&&(v-=12);break;case"%M":p=parseInt(n[o],10);break;case"%S":y=parseInt(n[o],10);break}if(isNaN(l)&&(l=h.getFullYear()),isNaN(g)&&(g=h.getMonth()),isNaN(s)&&(s=h.getDate()),isNaN(v)&&(v=h.getHours()),isNaN(p)&&(p=h.getMinutes()),l!=0&&g!=-1&&s!=0)return new a(l,g,s,v,p,0);for(l=0,g=-1,s=0,o=0;o<n.length;++o)if(n[o].search(/[a-zA-Z]+/)!=-1){var M=-1;for(c=0;c<12;++c)if(i.months[c].substring(0,n[o].length).toLowerCase()===n[o].toLowerCase()){M=c;break}M!=-1&&(g!=-1&&(s=g+1),g=M)}else parseInt(n[o],10)<=12&&g==-1?g=n[o]-1:parseInt(n[o],10)>31&&l==0?(l=parseInt(n[o],10),l<100&&(l+=l>29?1900:2e3)):s==0&&(s=n[o]);return l==0&&(l=h.getFullYear()),g!=-1&&s!=0?new a(l,g,s,v,p,0):h};var f={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]};f.jalaliToGregorian=function(e,t,r){e=parseInt(e),t=parseInt(t),r=parseInt(r);for(var i=e-979,h=t-1,l=r-1,g=365*i+parseInt(i/33)*8+parseInt((i%33+3)/4),s=0;s<h;++s)g+=f.j_days_in_month[s];g+=l;var n=g+79,u=1600+400*parseInt(n/146097);n=n%146097;var o=!0;n>=36525&&(n--,u+=100*parseInt(n/36524),n=n%36524,n>=365?n++:o=!1),u+=4*parseInt(n/1461),n%=1461,n>=366&&(o=!1,n--,u+=parseInt(n/365),n=n%365);for(var s=0;n>=f.g_days_in_month[s]+(s==1&&o);s++)n-=f.g_days_in_month[s]+(s==1&&o);var c=s+1,v=n+1;return[u,c,v]},f.checkDate=function(e,t,r){return!(e<0||e>32767||t<1||t>12||r<1||r>f.j_days_in_month[t-1]+(t==12&&!((e-979)%33%4)))},f.gregorianToJalali=function(e,t,r){e=parseInt(e),t=parseInt(t),r=parseInt(r);for(var i=e-1600,h=t-1,l=r-1,g=365*i+parseInt((i+3)/4)-parseInt((i+99)/100)+parseInt((i+399)/400),s=0;s<h;++s)g+=f.g_days_in_month[s];h>1&&(i%4==0&&i%100!=0||i%400==0)&&++g,g+=l;var n=g-79,u=parseInt(n/12053);n%=12053;var o=979+33*u+4*parseInt(n/1461);n%=1461,n>=366&&(o+=parseInt((n-1)/365),n=(n-1)%365);for(var s=0;s<11&&n>=f.j_days_in_month[s];++s)n-=f.j_days_in_month[s];var c=s+1,v=n+1;return[o,c,v]},a.prototype.setJalaliFullYear=function(e,t,r){var i=this.getDate(),h=this.getMonth(),l=this.getFullYear(),g=f.gregorianToJalali(l,h+1,i);e<100&&(e+=1300),g[0]=e,t!=null&&(t>11&&(g[0]+=Math.floor(t/12),t=t%12),g[1]=t+1),r!=null&&(g[2]=r);var s=f.jalaliToGregorian(g[0],g[1],g[2]);return this.setFullYear(s[0],s[1]-1,s[2])},a.prototype.setJalaliMonth=function(e,t){var r=this.getDate(),i=this.getMonth(),h=this.getFullYear(),l=f.gregorianToJalali(h,i+1,r);e>11&&(l[0]+=Math.floor(e/12),e=e%12),l[1]=e+1,t!=null&&(l[2]=t);var g=f.jalaliToGregorian(l[0],l[1],l[2]);return this.setFullYear(g[0],g[1]-1,g[2])},a.prototype.setJalaliDate=function(e){var t=this.getDate(),r=this.getMonth(),i=this.getFullYear(),h=f.gregorianToJalali(i,r+1,t);h[2]=e;var l=f.jalaliToGregorian(h[0],h[1],h[2]);return this.setFullYear(l[0],l[1]-1,l[2])},a.prototype.getJalaliFullYear=function(){var e=this.getDate(),t=this.getMonth(),r=this.getFullYear(),i=f.gregorianToJalali(r,t+1,e);return i[0]},a.prototype.getJalaliMonth=function(){var e=this.getDate(),t=this.getMonth(),r=this.getFullYear(),i=f.gregorianToJalali(r,t+1,e);return i[1]-1},a.prototype.getJalaliDate=function(){var e=this.getDate(),t=this.getMonth(),r=this.getFullYear(),i=f.gregorianToJalali(r,t+1,e);return i[2]},a.prototype.getJalaliDay=function(){var e=this.getDay();return e=e%7,e}})(Date);
|
||||
Binary file not shown.
1224
media/system/js/fields/calendar.js
Normal file
1224
media/system/js/fields/calendar.js
Normal file
File diff suppressed because it is too large
Load Diff
7
media/system/js/fields/calendar.min.js
vendored
Normal file
7
media/system/js/fields/calendar.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/system/js/fields/calendar.min.js.gz
Normal file
BIN
media/system/js/fields/calendar.min.js.gz
Normal file
Binary file not shown.
38
media/system/js/fields/color-field-adv-init.js
Normal file
38
media/system/js/fields/color-field-adv-init.js
Normal 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);
|
||||
4
media/system/js/fields/color-field-adv-init.min.js
vendored
Normal file
4
media/system/js/fields/color-field-adv-init.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/(function(a,t){"use strict";function o(i){t(i.target).find(".minicolors").each(function(){t(this).minicolors({control:t(this).attr("data-control")||"hue",format:t(this).attr("data-validate")==="color"?"hex":(t(this).attr("data-format")==="rgba"?"rgb":t(this).attr("data-format"))||"hex",keywords:t(this).attr("data-keywords")||"",opacity:t(this).attr("data-format")==="rgba",position:t(this).attr("data-position")||"default",swatches:t(this).attr("data-colors")?t(this).attr("data-colors").split(","):[],theme:"bootstrap"})})}a.addEventListener("DOMContentLoaded",o),a.addEventListener("joomla:updated",o)})(document,jQuery);
|
||||
BIN
media/system/js/fields/color-field-adv-init.min.js.gz
Normal file
BIN
media/system/js/fields/color-field-adv-init.min.js.gz
Normal file
Binary file not shown.
599
media/system/js/fields/joomla-field-color-slider.js
Normal file
599
media/system/js/fields/joomla-field-color-slider.js
Normal 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);
|
||||
4
media/system/js/fields/joomla-field-color-slider.min.js
vendored
Normal file
4
media/system/js/fields/joomla-field-color-slider.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/system/js/fields/joomla-field-color-slider.min.js.gz
Normal file
BIN
media/system/js/fields/joomla-field-color-slider.min.js.gz
Normal file
Binary file not shown.
395
media/system/js/fields/joomla-field-fancy-select.js
Normal file
395
media/system/js/fields/joomla-field-fancy-select.js
Normal file
@ -0,0 +1,395 @@
|
||||
/**
|
||||
* @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.choicesInstance.setChoiceByValue(this.disconnectValues);
|
||||
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: new DOMParser().parseFromString(this.newItemPrefix + event.target.value, 'text/html').body.textContent,
|
||||
label: new DOMParser().parseFromString(event.target.value, 'text/html').body.textContent,
|
||||
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) {
|
||||
// Keep selected values, because choices will reset them on re-init
|
||||
this.disconnectValues = this.choicesInstance.getValue(true);
|
||||
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;
|
||||
}
|
||||
});
|
||||
4
media/system/js/fields/joomla-field-fancy-select.min.js
vendored
Normal file
4
media/system/js/fields/joomla-field-fancy-select.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/system/js/fields/joomla-field-fancy-select.min.js.gz
Normal file
BIN
media/system/js/fields/joomla-field-fancy-select.min.js.gz
Normal file
Binary file not shown.
381
media/system/js/fields/joomla-field-media.js
Normal file
381
media/system/js/fields/joomla-field-media.js
Normal file
@ -0,0 +1,381 @@
|
||||
import JoomlaDialog from 'joomla.dialog';
|
||||
|
||||
/**
|
||||
* @copyright (C) 2018 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('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.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 ['base-path', 'root-folder', 'url', 'modal-title', 'modal-width', 'modal-height', 'input', 'button-select', 'button-clear', 'preview', 'preview-width', 'preview-height'];
|
||||
}
|
||||
get types() {
|
||||
return this.getAttribute('types') || '';
|
||||
}
|
||||
set types(value) {
|
||||
this.setAttribute('types', value);
|
||||
}
|
||||
get basePath() {
|
||||
return this.getAttribute('base-path');
|
||||
}
|
||||
set basePath(value) {
|
||||
this.setAttribute('base-path', value);
|
||||
}
|
||||
get url() {
|
||||
return this.getAttribute('url');
|
||||
}
|
||||
set url(value) {
|
||||
this.setAttribute('url', 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 modalWidth() {
|
||||
return this.getAttribute('modal-width');
|
||||
}
|
||||
set modalWidth(value) {
|
||||
this.setAttribute('modal-width', value);
|
||||
}
|
||||
get modalHeight() {
|
||||
return this.getAttribute('modal-height');
|
||||
}
|
||||
set modalHeight(value) {
|
||||
this.setAttribute('modal-height', value);
|
||||
}
|
||||
get modalTitle() {
|
||||
return this.getAttribute('modal-title');
|
||||
}
|
||||
set modalTitle(value) {
|
||||
this.setAttribute('modal-title', 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');
|
||||
}
|
||||
connectedCallback() {
|
||||
this.button = this.querySelector(this.buttonSelect);
|
||||
this.inputElement = this.querySelector(this.input);
|
||||
this.buttonClearEl = this.querySelector(this.buttonClear);
|
||||
this.previewElement = this.querySelector('.field-media-preview');
|
||||
if (!this.button || !this.inputElement || !this.buttonClearEl) {
|
||||
throw new Error('Misconfiguaration...');
|
||||
}
|
||||
this.button.addEventListener('click', this.show);
|
||||
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);
|
||||
}
|
||||
if (this.dialog) {
|
||||
this.dialog.close();
|
||||
}
|
||||
}
|
||||
show() {
|
||||
// Create and show the dialog
|
||||
const dialog = new JoomlaDialog({
|
||||
popupType: 'iframe',
|
||||
src: this.url,
|
||||
textHeader: this.modalTitle,
|
||||
width: this.modalWidth,
|
||||
height: this.modalHeight,
|
||||
popupButtons: [{
|
||||
label: Joomla.Text._('JSELECT'),
|
||||
className: 'button button-success btn btn-success',
|
||||
location: 'header',
|
||||
onClick: () => {
|
||||
this.modalClose();
|
||||
}
|
||||
}, {
|
||||
label: '',
|
||||
ariaLabel: Joomla.Text._('JCLOSE'),
|
||||
className: 'button-close btn-close',
|
||||
data: {
|
||||
buttonClose: '',
|
||||
dialogClose: ''
|
||||
},
|
||||
location: 'header'
|
||||
}]
|
||||
});
|
||||
dialog.classList.add('joomla-dialog-media-field');
|
||||
dialog.show();
|
||||
Joomla.Modal.setCurrent(dialog);
|
||||
dialog.addEventListener('joomla-dialog:close', () => {
|
||||
Joomla.Modal.setCurrent(null);
|
||||
dialog.destroy();
|
||||
this.dialog = null;
|
||||
Joomla.selectedMediaFile = {};
|
||||
});
|
||||
this.dialog = dialog;
|
||||
}
|
||||
async modalClose() {
|
||||
try {
|
||||
const item = Joomla.selectedMediaFile;
|
||||
if (item && item.type === 'dir') {
|
||||
// Set directory path as value only when the field is configured to support of directories
|
||||
this.setValue(this.types.includes('directories') ? item.path : '');
|
||||
} else {
|
||||
await Joomla.getMedia(item, this.inputElement, this);
|
||||
}
|
||||
} catch (err) {
|
||||
Joomla.renderMessages({
|
||||
error: [Joomla.Text._('JLIB_APPLICATION_ERROR_SERVER')]
|
||||
});
|
||||
}
|
||||
Joomla.selectedMediaFile = {};
|
||||
this.dialog.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);
|
||||
4
media/system/js/fields/joomla-field-media.min.js
vendored
Normal file
4
media/system/js/fields/joomla-field-media.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/system/js/fields/joomla-field-media.min.js.gz
Normal file
BIN
media/system/js/fields/joomla-field-media.min.js.gz
Normal file
Binary file not shown.
122
media/system/js/fields/joomla-field-module-order.js
Normal file
122
media/system/js/fields/joomla-field-module-order.js
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @package Joomla.JavaScript
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
customElements.define('joomla-field-module-order', class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.linkedFieldSelector = '';
|
||||
this.linkedFieldElement = '';
|
||||
this.originalPosition = '';
|
||||
this.writeDynaList.bind(this);
|
||||
this.getNewOrder.bind(this);
|
||||
}
|
||||
connectedCallback() {
|
||||
this.linkedFieldSelector = this.getAttribute('data-linked-field') || 'jform_position';
|
||||
if (!this.linkedFieldSelector) {
|
||||
throw new Error('No linked field defined!');
|
||||
}
|
||||
this.linkedFieldElement = document.getElementById(this.linkedFieldSelector);
|
||||
if (!this.linkedFieldElement) {
|
||||
throw new Error('No linked field defined!');
|
||||
}
|
||||
const that = this;
|
||||
this.originalPosition = this.linkedFieldElement.value;
|
||||
|
||||
/** Initialize the field * */
|
||||
this.getNewOrder(this.originalPosition);
|
||||
|
||||
/** Watch for changes on the linked field * */
|
||||
this.linkedFieldElement.addEventListener('change', () => {
|
||||
that.originalPosition = that.linkedFieldElement.value;
|
||||
that.getNewOrder(that.linkedFieldElement.value);
|
||||
});
|
||||
}
|
||||
writeDynaList(selectProperties, source, originalPositionName, originalPositionValue) {
|
||||
let i = 0;
|
||||
const selectNode = document.createElement('select');
|
||||
if (this.hasAttribute('disabled')) {
|
||||
selectNode.setAttribute('disabled', '');
|
||||
}
|
||||
if (this.getAttribute('onchange')) {
|
||||
selectNode.setAttribute('onchange', this.getAttribute('onchange'));
|
||||
}
|
||||
if (this.getAttribute('size')) {
|
||||
selectNode.setAttribute('size', this.getAttribute('size'));
|
||||
}
|
||||
selectNode.classList.add(selectProperties.itemClass);
|
||||
selectNode.setAttribute('name', selectProperties.name);
|
||||
selectNode.id = selectProperties.id;
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const x in source) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (!source.hasOwnProperty(x)) {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
const node = document.createElement('option');
|
||||
const item = source[x];
|
||||
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
node.value = item[1];
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
node.innerHTML = Joomla.sanitizeHtml(item[2]);
|
||||
if (originalPositionName && originalPositionValue === item[1] || !originalPositionName && i === 0) {
|
||||
node.setAttribute('selected', 'selected');
|
||||
}
|
||||
selectNode.appendChild(node);
|
||||
i += 1;
|
||||
}
|
||||
this.innerHTML = '';
|
||||
this.appendChild(selectNode);
|
||||
}
|
||||
getNewOrder(originalPosition) {
|
||||
const url = this.getAttribute('data-url');
|
||||
const clientId = this.getAttribute('data-client-id');
|
||||
const originalOrder = this.getAttribute('data-ordering');
|
||||
const name = this.getAttribute('data-name');
|
||||
const attr = this.getAttribute('data-client-attr') ? this.getAttribute('data-client-attr') : 'form-select';
|
||||
const id = `${this.getAttribute('data-id')}`;
|
||||
const moduleId = `${this.getAttribute('data-module-id')}`;
|
||||
const orders = [];
|
||||
const that = this;
|
||||
Joomla.request({
|
||||
url: `${url}&client_id=${clientId}&position=${originalPosition}&module_id=${moduleId}`,
|
||||
method: 'GET',
|
||||
perform: true,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
onSuccess(resp) {
|
||||
if (resp) {
|
||||
let response;
|
||||
try {
|
||||
response = JSON.parse(resp);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
/** Check if everything is OK * */
|
||||
if (response.data.length > 0) {
|
||||
for (let i = 0; i < response.data.length; i += 1) {
|
||||
orders[i] = response.data[i].split(',');
|
||||
}
|
||||
that.writeDynaList({
|
||||
name,
|
||||
id,
|
||||
itemClass: attr
|
||||
}, orders, that.originalPosition, originalOrder);
|
||||
}
|
||||
}
|
||||
|
||||
/** Render messages, if any. There are only message in case of errors. * */
|
||||
if (typeof resp.messages === 'object' && resp.messages !== null) {
|
||||
Joomla.renderMessages(resp.messages);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
5
media/system/js/fields/joomla-field-module-order.min.js
vendored
Normal file
5
media/system/js/fields/joomla-field-module-order.min.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @package Joomla.JavaScript
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/customElements.define("joomla-field-module-order",class extends HTMLElement{constructor(){super(),this.linkedFieldSelector="",this.linkedFieldElement="",this.originalPosition="",this.writeDynaList.bind(this),this.getNewOrder.bind(this)}connectedCallback(){if(this.linkedFieldSelector=this.getAttribute("data-linked-field")||"jform_position",!this.linkedFieldSelector)throw new Error("No linked field defined!");if(this.linkedFieldElement=document.getElementById(this.linkedFieldSelector),!this.linkedFieldElement)throw new Error("No linked field defined!");const t=this;this.originalPosition=this.linkedFieldElement.value,this.getNewOrder(this.originalPosition),this.linkedFieldElement.addEventListener("change",()=>{t.originalPosition=t.linkedFieldElement.value,t.getNewOrder(t.linkedFieldElement.value)})}writeDynaList(t,d,o,c){let r=0;const e=document.createElement("select");this.hasAttribute("disabled")&&e.setAttribute("disabled",""),this.getAttribute("onchange")&&e.setAttribute("onchange",this.getAttribute("onchange")),this.getAttribute("size")&&e.setAttribute("size",this.getAttribute("size")),e.classList.add(t.itemClass),e.setAttribute("name",t.name),e.id=t.id;for(const a in d){if(!d.hasOwnProperty(a))continue;const i=document.createElement("option"),n=d[a];i.value=n[1],i.innerHTML=Joomla.sanitizeHtml(n[2]),(o&&c===n[1]||!o&&r===0)&&i.setAttribute("selected","selected"),e.appendChild(i),r+=1}this.innerHTML="",this.appendChild(e)}getNewOrder(t){const d=this.getAttribute("data-url"),o=this.getAttribute("data-client-id"),c=this.getAttribute("data-ordering"),r=this.getAttribute("data-name"),e=this.getAttribute("data-client-attr")?this.getAttribute("data-client-attr"):"form-select",a=`${this.getAttribute("data-id")}`,i=`${this.getAttribute("data-module-id")}`,n=[],u=this;Joomla.request({url:`${d}&client_id=${o}&position=${t}&module_id=${i}`,method:"GET",perform:!0,headers:{"Content-Type":"application/x-www-form-urlencoded"},onSuccess(l){if(l){let h;try{h=JSON.parse(l)}catch(s){console.error(s)}if(h.data.length>0){for(let s=0;s<h.data.length;s+=1)n[s]=h.data[s].split(",");u.writeDynaList({name:r,id:a,itemClass:e},n,u.originalPosition,c)}}typeof l.messages=="object"&&l.messages!==null&&Joomla.renderMessages(l.messages)}})}});
|
||||
BIN
media/system/js/fields/joomla-field-module-order.min.js.gz
Normal file
BIN
media/system/js/fields/joomla-field-module-order.min.js.gz
Normal file
Binary file not shown.
166
media/system/js/fields/joomla-field-permissions.js
Normal file
166
media/system/js/fields/joomla-field-permissions.js
Normal file
@ -0,0 +1,166 @@
|
||||
/**
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
window.customElements.define('joomla-field-permissions', class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
if (!Joomla) {
|
||||
throw new Error('Joomla API is not properly initiated');
|
||||
}
|
||||
if (!this.getAttribute('data-uri')) {
|
||||
throw new Error('No valid url for validation');
|
||||
}
|
||||
this.query = window.location.search.substring(1);
|
||||
this.buttons = '';
|
||||
this.buttonDataSelector = 'data-onchange-task';
|
||||
this.onDropdownChange = this.onDropdownChange.bind(this);
|
||||
this.getUrlParam = this.getUrlParam.bind(this);
|
||||
this.component = this.getUrlParam('component');
|
||||
this.extension = this.getUrlParam('extension');
|
||||
this.option = this.getUrlParam('option');
|
||||
this.view = this.getUrlParam('view');
|
||||
this.asset = 'not';
|
||||
this.context = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Lifecycle
|
||||
*/
|
||||
connectedCallback() {
|
||||
this.buttons = document.querySelectorAll(`[${this.buttonDataSelector}]`);
|
||||
if (this.buttons) {
|
||||
this.buttons.forEach(button => {
|
||||
button.addEventListener('change', this.onDropdownChange);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lifecycle
|
||||
*/
|
||||
disconnectedCallback() {
|
||||
if (this.buttons) {
|
||||
this.buttons.forEach(button => {
|
||||
button.removeEventListener('change', this.onDropdownChange);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lifecycle
|
||||
*/
|
||||
onDropdownChange(event) {
|
||||
event.preventDefault();
|
||||
const task = event.target.getAttribute(this.buttonDataSelector);
|
||||
if (task === 'permissions.apply') {
|
||||
this.sendPermissions(event);
|
||||
}
|
||||
}
|
||||
sendPermissions(event) {
|
||||
const {
|
||||
target
|
||||
} = event;
|
||||
|
||||
// Set the icon while storing the values
|
||||
const icon = document.getElementById(`icon_${target.id}`);
|
||||
icon.removeAttribute('class');
|
||||
icon.setAttribute('class', 'joomla-icon joomla-field-permissions__spinner');
|
||||
|
||||
// Get values add prepare GET-Parameter
|
||||
const {
|
||||
value
|
||||
} = target;
|
||||
if (document.getElementById('jform_context')) {
|
||||
this.context = document.getElementById('jform_context').value;
|
||||
[this.context] = this.context.split('.');
|
||||
}
|
||||
if (this.option === 'com_config' && !this.component && !this.extension) {
|
||||
this.asset = 'root.1';
|
||||
} else if (!this.extension && this.view === 'component') {
|
||||
this.asset = this.component;
|
||||
} else if (this.context) {
|
||||
if (this.view === 'group') {
|
||||
this.asset = `${this.context}.fieldgroup.${this.getUrlParam('id')}`;
|
||||
} else {
|
||||
this.asset = `${this.context}.field.{this.getUrlParam('id')}`;
|
||||
}
|
||||
this.title = document.getElementById('jform_title').value;
|
||||
} else if (this.extension && this.view) {
|
||||
this.asset = `${this.extension}.${this.view}.${this.getUrlParam('id')}`;
|
||||
this.title = document.getElementById('jform_title').value;
|
||||
} else if (!this.extension && this.view) {
|
||||
this.asset = `${this.option}.${this.view}.${this.getUrlParam('id')}`;
|
||||
this.title = document.getElementById('jform_title').value;
|
||||
}
|
||||
const id = target.id.replace('jform_rules_', '');
|
||||
const lastUnderscoreIndex = id.lastIndexOf('_');
|
||||
const permissionData = {
|
||||
comp: this.asset,
|
||||
action: id.substring(0, lastUnderscoreIndex),
|
||||
rule: id.substring(lastUnderscoreIndex + 1),
|
||||
value,
|
||||
title: this.title
|
||||
};
|
||||
|
||||
// Remove JS messages, if they exist.
|
||||
Joomla.removeMessages();
|
||||
|
||||
// Ajax request
|
||||
Joomla.request({
|
||||
url: this.getAttribute('data-uri'),
|
||||
method: 'POST',
|
||||
data: JSON.stringify(permissionData),
|
||||
perform: true,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
onSuccess: data => {
|
||||
let response;
|
||||
try {
|
||||
response = JSON.parse(data);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(e);
|
||||
}
|
||||
icon.removeAttribute('class');
|
||||
|
||||
// Check if everything is OK
|
||||
if (response.data && response.data.result) {
|
||||
icon.setAttribute('class', 'joomla-icon joomla-field-permissions__allowed');
|
||||
const badgeSpan = target.parentNode.parentNode.nextElementSibling.querySelector('span');
|
||||
badgeSpan.removeAttribute('class');
|
||||
badgeSpan.setAttribute('class', response.data.class);
|
||||
badgeSpan.innerHTML = Joomla.sanitizeHtml(response.data.text);
|
||||
}
|
||||
|
||||
// Render messages, if any. There are only message in case of errors.
|
||||
if (typeof response.messages === 'object' && response.messages !== null) {
|
||||
Joomla.renderMessages(response.messages);
|
||||
if (response.data && response.data.result) {
|
||||
icon.setAttribute('class', 'joomla-icon joomla-field-permissions__allowed');
|
||||
} else {
|
||||
icon.setAttribute('class', 'joomla-icon joomla-field-permissions__denied');
|
||||
}
|
||||
}
|
||||
},
|
||||
onError: xhr => {
|
||||
// Remove the spinning icon.
|
||||
icon.removeAttribute('style');
|
||||
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr, xhr.statusText));
|
||||
icon.setAttribute('class', 'joomla-icon joomla-field-permissions__denied');
|
||||
}
|
||||
});
|
||||
}
|
||||
getUrlParam(variable) {
|
||||
const vars = this.query.split('&');
|
||||
let i = 0;
|
||||
for (i; i < vars.length; i += 1) {
|
||||
const pair = vars[i].split('=');
|
||||
if (pair[0] === variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
4
media/system/js/fields/joomla-field-permissions.min.js
vendored
Normal file
4
media/system/js/fields/joomla-field-permissions.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/window.customElements.define("joomla-field-permissions",class extends HTMLElement{constructor(){if(super(),!Joomla)throw new Error("Joomla API is not properly initiated");if(!this.getAttribute("data-uri"))throw new Error("No valid url for validation");this.query=window.location.search.substring(1),this.buttons="",this.buttonDataSelector="data-onchange-task",this.onDropdownChange=this.onDropdownChange.bind(this),this.getUrlParam=this.getUrlParam.bind(this),this.component=this.getUrlParam("component"),this.extension=this.getUrlParam("extension"),this.option=this.getUrlParam("option"),this.view=this.getUrlParam("view"),this.asset="not",this.context=""}connectedCallback(){this.buttons=document.querySelectorAll(`[${this.buttonDataSelector}]`),this.buttons&&this.buttons.forEach(e=>{e.addEventListener("change",this.onDropdownChange)})}disconnectedCallback(){this.buttons&&this.buttons.forEach(e=>{e.removeEventListener("change",this.onDropdownChange)})}onDropdownChange(e){e.preventDefault(),e.target.getAttribute(this.buttonDataSelector)==="permissions.apply"&&this.sendPermissions(e)}sendPermissions(e){const{target:i}=e,t=document.getElementById(`icon_${i.id}`);t.removeAttribute("class"),t.setAttribute("class","joomla-icon joomla-field-permissions__spinner");const{value:n}=i;document.getElementById("jform_context")&&(this.context=document.getElementById("jform_context").value,[this.context]=this.context.split(".")),this.option==="com_config"&&!this.component&&!this.extension?this.asset="root.1":!this.extension&&this.view==="component"?this.asset=this.component:this.context?(this.view==="group"?this.asset=`${this.context}.fieldgroup.${this.getUrlParam("id")}`:this.asset=`${this.context}.field.{this.getUrlParam('id')}`,this.title=document.getElementById("jform_title").value):this.extension&&this.view?(this.asset=`${this.extension}.${this.view}.${this.getUrlParam("id")}`,this.title=document.getElementById("jform_title").value):!this.extension&&this.view&&(this.asset=`${this.option}.${this.view}.${this.getUrlParam("id")}`,this.title=document.getElementById("jform_title").value);const r=i.id.replace("jform_rules_",""),l=r.lastIndexOf("_"),h={comp:this.asset,action:r.substring(0,l),rule:r.substring(l+1),value:n,title:this.title};Joomla.removeMessages(),Joomla.request({url:this.getAttribute("data-uri"),method:"POST",data:JSON.stringify(h),perform:!0,headers:{"Content-Type":"application/json"},onSuccess:a=>{let s;try{s=JSON.parse(a)}catch(o){console.error(o)}if(t.removeAttribute("class"),s.data&&s.data.result){t.setAttribute("class","joomla-icon joomla-field-permissions__allowed");const o=i.parentNode.parentNode.nextElementSibling.querySelector("span");o.removeAttribute("class"),o.setAttribute("class",s.data.class),o.innerHTML=Joomla.sanitizeHtml(s.data.text)}typeof s.messages=="object"&&s.messages!==null&&(Joomla.renderMessages(s.messages),s.data&&s.data.result?t.setAttribute("class","joomla-icon joomla-field-permissions__allowed"):t.setAttribute("class","joomla-icon joomla-field-permissions__denied"))},onError:a=>{t.removeAttribute("style"),Joomla.renderMessages(Joomla.ajaxErrorsMessages(a,a.statusText)),t.setAttribute("class","joomla-icon joomla-field-permissions__denied")}})}getUrlParam(e){const i=this.query.split("&");let t=0;for(t;t<i.length;t+=1){const n=i[t].split("=");if(n[0]===e)return n[1]}return!1}});
|
||||
BIN
media/system/js/fields/joomla-field-permissions.min.js.gz
Normal file
BIN
media/system/js/fields/joomla-field-permissions.min.js.gz
Normal file
Binary file not shown.
74
media/system/js/fields/joomla-field-send-test-mail.js
Normal file
74
media/system/js/fields/joomla-field-send-test-mail.js
Normal file
@ -0,0 +1,74 @@
|
||||
((customElements, Joomla) => {
|
||||
class JoomlaFieldSendTestMail extends HTMLElement {
|
||||
// attributeChangedCallback(attr, oldValue, newValue) {}
|
||||
constructor() {
|
||||
super();
|
||||
if (!Joomla) {
|
||||
throw new Error('Joomla API is not properly initiated');
|
||||
}
|
||||
if (!this.getAttribute('uri')) {
|
||||
throw new Error('No valid url for validation');
|
||||
}
|
||||
}
|
||||
connectedCallback() {
|
||||
const self = this;
|
||||
const button = document.getElementById('sendtestmail');
|
||||
if (button) {
|
||||
button.addEventListener('click', () => {
|
||||
self.sendTestMail(self);
|
||||
});
|
||||
}
|
||||
}
|
||||
sendTestMail() {
|
||||
const emailData = {
|
||||
smtpauth: document.getElementById('jform_smtpauth1').checked ? 1 : 0,
|
||||
smtpuser: this.querySelector('[name="jform[smtpuser]"]').value,
|
||||
smtphost: this.querySelector('[name="jform[smtphost]"]').value,
|
||||
smtpsecure: this.querySelector('[name="jform[smtpsecure]"]').value,
|
||||
smtpport: this.querySelector('[name="jform[smtpport]"]').value,
|
||||
mailfrom: this.querySelector('[name="jform[mailfrom]"]').value,
|
||||
fromname: this.querySelector('[name="jform[fromname]"]').value,
|
||||
mailer: this.querySelector('[name="jform[mailer]"]').value,
|
||||
mailonline: document.getElementById('jform_mailonline1').checked ? 1 : 0
|
||||
};
|
||||
const smtppass = this.querySelector('[name="jform[smtppass]"]');
|
||||
if (smtppass.disabled === false) {
|
||||
emailData.smtppass = smtppass.value;
|
||||
}
|
||||
|
||||
// Remove js messages, if they exist.
|
||||
Joomla.removeMessages();
|
||||
Joomla.request({
|
||||
url: this.getAttribute('uri'),
|
||||
method: 'POST',
|
||||
data: JSON.stringify(emailData),
|
||||
perform: true,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
onSuccess: resp => {
|
||||
let response;
|
||||
try {
|
||||
response = JSON.parse(resp);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(e);
|
||||
}
|
||||
if (typeof response.messages === 'object' && response.messages !== null) {
|
||||
Joomla.renderMessages(response.messages);
|
||||
}
|
||||
document.body.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
},
|
||||
onError: xhr => {
|
||||
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr));
|
||||
document.body.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
customElements.define('joomla-field-send-test-mail', JoomlaFieldSendTestMail);
|
||||
})(customElements, Joomla);
|
||||
1
media/system/js/fields/joomla-field-send-test-mail.min.js
vendored
Normal file
1
media/system/js/fields/joomla-field-send-test-mail.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
((a,e)=>{class m extends HTMLElement{constructor(){if(super(),!e)throw new Error("Joomla API is not properly initiated");if(!this.getAttribute("uri"))throw new Error("No valid url for validation")}connectedCallback(){const t=this,s=document.getElementById("sendtestmail");s&&s.addEventListener("click",()=>{t.sendTestMail(t)})}sendTestMail(){const t={smtpauth:document.getElementById("jform_smtpauth1").checked?1:0,smtpuser:this.querySelector('[name="jform[smtpuser]"]').value,smtphost:this.querySelector('[name="jform[smtphost]"]').value,smtpsecure:this.querySelector('[name="jform[smtpsecure]"]').value,smtpport:this.querySelector('[name="jform[smtpport]"]').value,mailfrom:this.querySelector('[name="jform[mailfrom]"]').value,fromname:this.querySelector('[name="jform[fromname]"]').value,mailer:this.querySelector('[name="jform[mailer]"]').value,mailonline:document.getElementById("jform_mailonline1").checked?1:0},s=this.querySelector('[name="jform[smtppass]"]');s.disabled===!1&&(t.smtppass=s.value),e.removeMessages(),e.request({url:this.getAttribute("uri"),method:"POST",data:JSON.stringify(t),perform:!0,headers:{"Content-Type":"application/json"},onSuccess:o=>{let r;try{r=JSON.parse(o)}catch(n){console.error(n)}typeof r.messages=="object"&&r.messages!==null&&e.renderMessages(r.messages),document.body.scrollIntoView({behavior:"smooth"})},onError:o=>{e.renderMessages(e.ajaxErrorsMessages(o)),document.body.scrollIntoView({behavior:"smooth"})}})}}a.define("joomla-field-send-test-mail",m)})(customElements,Joomla);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user