??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 178
admin/assets/css/select2.css000064400000042267151231536700012017 0ustar00.select2-container { box-sizing: border-box; display: inline-block; margin: 0; position: relative; vertical-align: middle; } .select2-container .select2-selection--single { box-sizing: border-box; cursor: pointer; display: block; height: 28px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--single .select2-selection__rendered { display: block; padding-left: 8px; padding-right: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .select2-container .select2-selection--single .select2-selection__clear { position: relative; } .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 8px; padding-left: 20px; } .select2-container .select2-selection--multiple { box-sizing: border-box; cursor: pointer; display: block; min-height: 32px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--multiple .select2-selection__rendered { display: inline-block; overflow: hidden; padding-left: 8px; text-overflow: ellipsis; white-space: nowrap; } .select2-container .select2-search--inline { float: left; } .select2-container .select2-search--inline .select2-search__field { box-sizing: border-box; border: none; font-size: 100%; margin-top: 5px; padding: 0; } .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; } .select2-dropdown { background-color: white; border: 1px solid #aaa; border-radius: 4px; box-sizing: border-box; display: block; position: absolute; left: -100000px; width: 100%; z-index: 1051; } .select2-results { display: block; } .select2-results__options { list-style: none; margin: 0; padding: 0; } .select2-results__option { padding: 6px; user-select: none; -webkit-user-select: none; } .select2-results__option[aria-selected] { cursor: pointer; } .select2-container--open .select2-dropdown { left: 0; } .select2-container--open .select2-dropdown--above { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--open .select2-dropdown--below { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-search--dropdown { display: block; padding: 4px; } .select2-search--dropdown .select2-search__field { padding: 4px; width: 100%; box-sizing: border-box; } .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; } .select2-search--dropdown.select2-search--hide { display: none; } .select2-close-mask { border: 0; margin: 0; padding: 0; display: block; position: fixed; left: 0; top: 0; min-height: 100%; min-width: 100%; height: auto; width: auto; opacity: 0; z-index: 99; background-color: #fff; filter: alpha(opacity=0); } .select2-hidden-accessible { border: 0 !important; clip: rect(0 0 0 0) !important; -webkit-clip-path: inset(50%) !important; clip-path: inset(50%) !important; height: 1px !important; overflow: hidden !important; padding: 0 !important; position: absolute !important; width: 1px !important; white-space: nowrap !important; } .select2-container--default .select2-selection--single { background-color: #fff; border: 1px solid #aaa; border-radius: 4px; } .select2-container--default .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--default .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; } .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; } .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 1px; right: auto; } .select2-container--default.select2-container--disabled .select2-selection--single { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { display: none; } .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--default .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; } .select2-container--default .select2-selection--multiple .select2-selection__rendered { box-sizing: border-box; list-style: none; margin: 0; padding: 0 5px; width: 100%; } .select2-container--default .select2-selection--multiple .select2-selection__rendered li { list-style: none; } .select2-container--default .select2-selection--multiple .select2-selection__placeholder { color: #999; margin-top: 5px; float: left; } .select2-container--default .select2-selection--multiple .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-top: 5px; margin-right: 10px; } .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #999; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #333; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--default.select2-container--focus .select2-selection--multiple { border: solid black 1px; outline: 0; } .select2-container--default.select2-container--disabled .select2-selection--multiple { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection__choice__remove { display: none; } .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; } .select2-container--default .select2-search--inline .select2-search__field { background: transparent; border: none; outline: 0; box-shadow: none; -webkit-appearance: textfield; } .select2-container--default .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--default .select2-results__option[role=group] { padding: 0; } .select2-container--default .select2-results__option[aria-disabled=true] { color: #999; } .select2-container--default .select2-results__option[aria-selected=true] { background-color: #ddd; } .select2-container--default .select2-results__option .select2-results__option { padding-left: 1em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option { margin-left: -1em; padding-left: 2em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -2em; padding-left: 3em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -3em; padding-left: 4em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -4em; padding-left: 5em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -5em; padding-left: 6em; } .select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: #5897fb; color: white; } .select2-container--default .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic .select2-selection--single { background-color: #f7f7f7; border: 1px solid #aaa; border-radius: 4px; outline: 0; background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%); background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } .select2-container--classic .select2-selection--single:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--classic .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-right: 10px; } .select2-container--classic .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--classic .select2-selection--single .select2-selection__arrow { background-color: #ddd; border: none; border-left: 1px solid #aaa; border-top-right-radius: 4px; border-bottom-right-radius: 4px; height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); } .select2-container--classic .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { border: none; border-right: 1px solid #aaa; border-radius: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; left: 1px; right: auto; } .select2-container--classic.select2-container--open .select2-selection--single { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { background: transparent; border: none; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%); background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); } .select2-container--classic .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; outline: 0; } .select2-container--classic .select2-selection--multiple:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--multiple .select2-selection__rendered { list-style: none; margin: 0; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__clear { display: none; } .select2-container--classic .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { color: #888; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { color: #555; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { float: right; margin-left: 5px; margin-right: auto; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--classic.select2-container--open .select2-selection--multiple { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--classic .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; outline: 0; } .select2-container--classic .select2-search--inline .select2-search__field { outline: 0; box-shadow: none; } .select2-container--classic .select2-dropdown { background-color: white; border: 1px solid transparent; } .select2-container--classic .select2-dropdown--above { border-bottom: none; } .select2-container--classic .select2-dropdown--below { border-top: none; } .select2-container--classic .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--classic .select2-results__option[role=group] { padding: 0; } .select2-container--classic .select2-results__option[aria-disabled=true] { color: grey; } .select2-container--classic .select2-results__option--highlighted[aria-selected] { background-color: #3875d7; color: white; } .select2-container--classic .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic.select2-container--open .select2-dropdown { border-color: #5897fb; } admin/assets/css/select2.min.css000064400000035514151231536700012576 0ustar00.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} admin/assets/css/sinatra-admin.css000064400000061041151231536700013174 0ustar00/* ========================================================================== * Sinatra admin page related styles. * ========================================================================== */ /** * Import configuration file with variables. */ /** * Import base admin page styles. */ /*****************************************/ /* Admin page base styles /*****************************************/ .sinatra-toggle { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-sizing: border-box; box-sizing: border-box; } .sinatra-toggle *, .sinatra-toggle *:before, .sinatra-toggle *:after { -webkit-box-sizing: inherit; box-sizing: inherit; } .sinatra-toggle input[type="checkbox"] { display: none; } .sinatra-toggle input[type="checkbox"]:checked + label .sinatra-toggle-switch { background-color: #3857f1 !important; } .sinatra-toggle input[type="checkbox"]:checked + label .sinatra-toggle-switch:after { -webkit-transform: translateX(11px); -ms-transform: translateX(11px); transform: translateX(11px); } .sinatra-toggle .sinatra-toggle-switch { background-color: #c7d5df; border-radius: 8px; padding: 2px; -webkit-transition: all .2s; transition: all .2s; outline: 0; display: block; width: 27px; height: 16px; position: relative; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; margin: 0 10px 0 0; } .sinatra-toggle .sinatra-toggle-switch:after { position: relative; display: block; content: ''; width: 12px; height: 12px; left: 0; border-radius: 50%; background: #ffffff; -webkit-transition: all .15s ease; transition: all .15s ease; -webkit-transform: translateX(0px); -ms-transform: translateX(0px); transform: translateX(0px); } .sinatra-toggle label { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; color: #23282d; } .sinatra-toggle label:hover .sinatra-toggle-switch { background-color: #86a4ba; } .sinatra-toggle.large-toggle .sinatra-toggle-switch { border-radius: 20px; width: 36px; height: 20px; } .sinatra-toggle.large-toggle .sinatra-toggle-switch:after { width: 16px; height: 16px; } .sinatra-toggle.large-toggle input[type="checkbox"]:checked + label .sinatra-toggle-switch:after { -webkit-transform: translateX(16px); -ms-transform: translateX(16px); transform: translateX(16px); } #wpcontent { padding: 0; -webkit-box-sizing: border-box; box-sizing: border-box; font-size: 14px; line-height: 1.8; color: #23282d; min-height: calc(100vh - 190px); } #wpbody-content { padding: 0 35px; } #wpbody-content h2 { -js-display: inline-flex; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin-top: 0; margin-bottom: 0; font-size: 18px; font-weight: 400; color: #23282d; line-height: 1.2; } #wpbody-content h2 svg { width: 22px; height: 22px; margin-left: 7px; } #wpcontent *, #wp-content *, #wp-content *:before, #wp-content *:after { -webkit-box-sizing: inherit; box-sizing: inherit; } #wpbody { padding: 0; } #wpfooter { position: relative; padding: 0 35px 10px 35px; } body { background-color: #f1f3f5; color: #23282d; } .spinner { display: none; } .spinner.activated, .spinner.visible { display: inline-block; visibility: visible; } .si-container { width: 100%; max-width: 940px; margin: 0 auto; } .notice, .update-nag, div.error, div.updated { margin: 5px auto !important; border-top: solid 1px #d6e1e8; border-right: solid 1px #d6e1e8; border-bottom: solid 1px #d6e1e8; border-radius: 3px; -webkit-box-shadow: none; box-shadow: none; max-width: 940px; display: none; } .notice.notice-info, .update-nag.notice-info, div.error.notice-info, div.updated.notice-info { border-left-color: #3857f1; } .notice.notice-warning, .update-nag.notice-warning, div.error.notice-warning, div.updated.notice-warning { border-left-color: #f0b849; } .notice.sinatra-notice, .update-nag.sinatra-notice, div.error.sinatra-notice, div.updated.sinatra-notice { display: block; } .notice p a, .update-nag p a, div.error p a, div.updated p a { color: #3857f1; } .notice p a:hover, .update-nag p a:hover, div.error p a:hover, div.updated p a:hover { color: #506bf3; } .sinatra-info-icon { cursor: default; } .sinatra-info-icon:hover svg { fill: #95b1c3; } .sinatra-warning-icon svg { fill: #f0b849; -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .sinatra-buttons { margin-top: 18px; } .si-btn, body.wp-core-ui .si-btn { text-decoration: none; font-weight: 500; border-radius: 2px; font-size: 13px; padding: 3px 12px; border: 1px solid rgba(0, 0, 0, 0.15); -js-display: inline-flex; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -ms-flex-wrap: wrap; flex-wrap: wrap; line-height: 1.8; height: auto; -webkit-box-shadow: none; box-shadow: none; text-shadow: none; } .si-btn.large-button, body.wp-core-ui .si-btn.large-button { padding: 8px 18px; font-size: 14px; } .si-btn.primary, body.wp-core-ui .si-btn.primary { background-color: #3857f1; color: #FFF; margin-right: 5px; } .si-btn.secondary, body.wp-core-ui .si-btn.secondary { color: #66717f; border-color: #c7d5df; background-color: rgba(0, 0, 0, 0); font-weight: 400; } .si-btn.secondary:hover, .si-btn.secondary:focus, body.wp-core-ui .si-btn.secondary:hover, body.wp-core-ui .si-btn.secondary:focus { border-color: #728191; color: #23282d; background-color: rgba(0, 0, 0, 0); } .si-btn:hover, .si-btn:focus, body.wp-core-ui .si-btn:hover, body.wp-core-ui .si-btn:focus { background-color: #506bf3; -webkit-box-shadow: none !important; box-shadow: none !important; border-color: rgba(0, 0, 0, 0.15); } .si-btn:active, body.wp-core-ui .si-btn:active { -webkit-transform: none; -ms-transform: none; transform: none; } .si-btn[disabled="disabled"], body.wp-core-ui .si-btn[disabled="disabled"] { opacity: 0.25; pointer-events: none; } .si-btn svg, body.wp-core-ui .si-btn svg { width: 16px; height: 16px; margin-right: 7px; } .sinatra-filters { margin-left: auto; padding-left: 18px; } .sinatra-dropdown-filter { text-decoration: none; color: #66717f; position: relative; padding: 7px 0; -webkit-box-shadow: none; box-shadow: none; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .sinatra-dropdown-filter:hover, .sinatra-dropdown-filter:focus { color: #23282d; -webkit-box-shadow: none; box-shadow: none; } .sinatra-dropdown-filter.open > ul { display: block; } .sinatra-dropdown-filter > ul { display: none; margin: 0; padding: 10px 0; position: absolute; top: 100%; right: -6px; background-color: #ffffff; border-radius: 4px; width: 180px; z-index: 99; -webkit-box-shadow: 0 0 40px rgba(51, 59, 72, 0.2); box-shadow: 0 0 40px rgba(51, 59, 72, 0.2); } .sinatra-dropdown-filter > ul > li { display: block; padding: 5px 25px; margin-bottom: 5px; color: #66717f; line-height: 1.4; } .sinatra-dropdown-filter > ul > li:last-child { margin-bottom: 0; } .sinatra-dropdown-filter > ul > li:hover, .sinatra-dropdown-filter > ul > li:focus { color: #ffffff; background-color: #3857f1; } .sinatra-dropdown-filter > ul > li.current { background-color: rgba(0, 0, 0, 0.05); color: #23282d; } .sinatra-section-title { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .sinatra-modal { position: fixed; display: none; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(44, 46, 58, 0.75); z-index: 99999; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow-y: scroll; opacity: 0; -webkit-transition: all .2s ease-out .2s; transition: all .2s ease-out .2s; } .sinatra-modal .sinatra-modal-container { opacity: 0; -webkit-transition: all .2s ease-out 0s; transition: all .2s ease-out 0s; -webkit-transform: scale(1.2); -ms-transform: scale(1.2); transform: scale(1.2); } .sinatra-modal.sinatra-block { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; } .sinatra-modal.sinatra-visible { opacity: 1; -webkit-transition-delay: 0s; transition-delay: 0s; } .sinatra-modal.sinatra-visible .sinatra-modal-container { opacity: 1; -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); -webkit-transition-delay: .2s; transition-delay: .2s; } /** * Import tooltips and info icon. */ /*****************************************/ /* Sinatra tooltip and info icon. /*****************************************/ .sinatra-info-icon, .sinatra-warning-icon { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin-left: 5px; position: relative; } .sinatra-info-icon svg, .sinatra-warning-icon svg { fill: #b5c9d6; } .sinatra-info-icon:hover svg, .sinatra-info-icon:focus svg, .sinatra-warning-icon:hover svg, .sinatra-warning-icon:focus svg { fill: #648da8; } .sinatra-info-icon:hover .sinatra-tooltip, .sinatra-info-icon:focus .sinatra-tooltip, .sinatra-warning-icon:hover .sinatra-tooltip, .sinatra-warning-icon:focus .sinatra-tooltip { display: block; } .sinatra-tooltip { display: none; position: absolute; background-color: #23282d; color: #d6e1e8; font-size: 13px; font-style: normal; width: 300px; padding: 16px 18px; z-index: 991; border-radius: 3px; line-height: 1.6; bottom: 100%; -webkit-transform: translate(0, -13px); -ms-transform: translate(0, -13px); transform: translate(0, -13px); } .sinatra-tooltip:after { content: ''; width: 10px; height: 10px; background-color: #23282d; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); position: absolute; top: calc(100% - 5px); left: var(--tooltip-left); margin-left: 14px; } .sinatra-tooltip.right-tooltip { left: 100%; top: 50%; -webkit-transform: translate(13px, -50%); -ms-transform: translate(13px, -50%); transform: translate(13px, -50%); } .sinatra-tooltip.top-right-tooltip { right: 0; bottom: 100%; -webkit-transform: translate(0, 13px); -ms-transform: translate(0, 13px); transform: translate(0, 13px); } .sinatra-tooltip.top-right-tooltip:after { top: calc(100% - 6px); left: calc(100% - 25px); margin-left: 0; } .sinatra-tooltip.small-tooltip { top: 5px; bottom: auto; left: 50%; width: auto; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); padding: 6px 10px; font-size: 11px; line-height: 1.5; white-space: nowrap; font-weight: 400; } .sinatra-tooltip.small-tooltip:after { display: none; } /** * Import admin page header styles. */ /* ========================================================================== * Sinatra admin page header styles. * ========================================================================== */ #sinatra-header { padding: 12px 35px; background-color: #ffffff; position: relative; border-bottom: 1px solid #d6e1e8; margin-bottom: 9px; } #sinatra-header > .si-container { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; } #sinatra-header .sinatra-logo img { height: 26px; width: auto; display: block; } #sinatra-header .sinatra-logo:focus { -webkit-box-shadow: none; box-shadow: none; outline: thin dotted #7f8a99; outline-offset: 6px; } #sinatra-header .sinatra-header-action { margin-left: auto; -js-display: inline-flex; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; font-size: 13px; } #sinatra-header .sinatra-header-action > a { padding: 5px 13px; text-decoration: none; font-weight: 500; } #sinatra-header .sinatra-header-action > a:focus { -webkit-box-shadow: none; box-shadow: none; } #sinatra-header .sinatra-header-action > a:first-child { border-radius: 2px; background-color: #3857f1; color: #ffffff; border: 1px solid rgba(0, 0, 0, 0.15); } #sinatra-header .sinatra-header-action > a:first-child:hover, #sinatra-header .sinatra-header-action > a:first-child:focus { background-color: #506bf3; } #sinatra-header .sinatra-header-action > a:first-child.secondary { background-color: rgba(0, 0, 0, 0); } #sinatra-header .sinatra-header-action > a:last-child { margin-left: 12px; border-radius: 2px; border: 1px solid #d6e1e8; color: #66717f; } #sinatra-header .sinatra-header-action > a:last-child:hover, #sinatra-header .sinatra-header-action > a:last-child:focus { border-color: #728191; color: #23282d; background-color: rgba(0, 0, 0, 0); } /** * Import admin tabs styles. */ /* ========================================================================== * Sinatra admin page tabs styles. * ========================================================================== */ .sinatra-tabs { position: relative; width: 100%; padding: 0; margin: 9px 0 18px 0; background-color: #ffffff; border: 1px solid #d6e1e8; border-radius: 3px; } .sinatra-tabs > ul { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; width: 100%; overflow: hidden; margin: 0; padding: 0 20px; } .sinatra-tabs > ul > li { width: auto; -webkit-box-flex: 0; -ms-flex: none; flex: none; border-bottom: 2px solid transparent; border-top: 2px solid transparent; text-align: center; margin: 0 10px; } .sinatra-tabs > ul > li:first-child { margin-left: 0; } .sinatra-tabs > ul > li:last-child { margin-right: 0; } .sinatra-tabs > ul > li:hover > a { color: #23282d; } .sinatra-tabs > ul > li.current-item { border-bottom-color: #3857f1; } .sinatra-tabs > ul > li.current-item > a { color: #3857f1; font-weight: 500; } .sinatra-tabs > ul > li > a { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; text-decoration: none; width: auto; padding: 10px 0; color: #66717f; font-weight: 400; } .sinatra-tabs > ul > li > a:focus { -webkit-box-shadow: none; box-shadow: none; outline: thin dotted #7f8a99; } /** * Import about page styles. */ #wpbody-content .sinatra-section-title { margin: 19px 0 8px; } #wpbody-content h2.sinatra-section-title { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } #wpbody-content .sinatra-section { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; padding: 15px 35px; margin-bottom: 50px !important; } #wpbody-content .sinatra-section.large-section { padding: 40px 35px; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; border-radius: 3px; border: 1px solid #d6e1e8; background-color: #ffffff; margin: 38px 0; } #wpbody-content .sinatra-section.large-section h2 { padding-top: 18px; text-align: center; line-height: 1.4; } #wpbody-content .sinatra-section.large-section p { max-width: 480px; font-size: 15px; line-height: 1.7; text-align: center; color: #79879a; } #wpbody-content .sinatra-section .sinatra-hero img { height: 140px; } #wpbody-content .sinatra-columns { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; padding: 0; margin: -12px -12px 50px -12px; -webkit-box-align: stretch; -ms-flex-align: stretch; align-items: stretch; } #wpbody-content .sinatra-columns .sinatra-column { width: 33.33%; padding: 12px; } #wpbody-content .sinatra-columns .sinatra-column.column-6 { width: 50%; } #wpbody-content .sinatra-columns .sinatra-column.column-12 { width: 100%; } #wpbody-content .sinatra-columns .sinatra-changelog { max-height: 500px; overflow: scroll; } #wpbody-content .sinatra-columns.plugins .sinatra-box { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } #wpbody-content .sinatra-columns.plugins .sinatra-box > div { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } #wpbody-content .sinatra-columns.plugins .plugin-image { position: absolute; top: 5%; left: -10%; height: 90%; opacity: .05; z-index: 1; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } #wpbody-content .sinatra-columns.plugins .plugin-image img { height: 100%; pointer-events: none; border-radius: 16px; } #wpbody-content .sinatra-columns.plugins p { margin: 5px 0 0 0; } #wpbody-content .sinatra-columns.plugins .plugin-info { position: relative; z-index: 2; } #wpbody-content .sinatra-columns.plugins .si-active-plugin { -js-display: inline-flex; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin-right: auto; font-weight: 400; color: #79ba49; } #wpbody-content .sinatra-columns.plugins .sinatra-buttons { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; padding-top: 0; margin-top: 1.2em; } #wpbody-content .sinatra-columns.plugins .dashicons { height: 18px; margin-right: 5px; } #wpbody-content .sinatra-box { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -ms-flex-wrap: wrap; flex-wrap: wrap; border-radius: 3px; border: 1px solid #d6e1e8; background-color: #ffffff; padding: 20px 30px; height: 100%; overflow: hidden; position: relative; } #wpbody-content .sinatra-box p { color: #66717f; line-height: 1.7; } #wpbody-content .sinatra-box p:last-child { margin-bottom: 0; } #wpbody-content .sinatra-box h4 { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; font-size: 15px; font-weight: 600; margin: 0; color: #23282d; } #wpbody-content .sinatra-box h4 i { width: auto; height: auto; color: #66717f; font-size: 24px; line-height: 16px; vertical-align: middle; opacity: 0.5; display: inline-block; padding-right: 12px; } #wpbody-content .sinatra-box .sinatra-buttons { margin: auto 0 0 0; padding-top: 9px; } #wpbody-content .changelog-version { font-size: 11px; font-weight: 500; line-height: 1; text-align: center; white-space: nowrap; vertical-align: middle; border-radius: 16px; color: #55718c; background-color: #d6e1ec; margin: 0 12px; padding: 5px 7px; margin-top: 1px; } #wpbody-content .sinatra-core-changelog { margin-top: -30px !important; } /** * Import admin page footer styles. */ #wpfooter { -webkit-backface-visibility: hidden; backface-visibility: hidden; } #sinatra-footer { border-top: 1px #d6e1e8 solid; border-bottom: 1px #d6e1e8 solid; margin-top: 0; margin-bottom: 18px; margin-left: -35px; margin-right: -35px; text-align: center; font-size: 13px; color: #66717f; } #sinatra-footer ul { margin: 0 35px; padding: 0; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; } #sinatra-footer ul li { margin: 0; } #sinatra-footer ul li a { text-decoration: none; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; padding: 15px 10px; color: inherit; } #sinatra-footer ul li a:hover { color: #23282d; } #sinatra-footer ul li a:hover > span { text-decoration: underline; } #sinatra-footer ul li a:focus { -webkit-box-shadow: none; box-shadow: none; outline: thin dotted #7f8a99; } #sinatra-footer ul li a .dashicons { font-size: 18px !important; height: 18px; line-height: 18px; margin-right: 3px; text-decoration: none !important; } #sinatra-footer ul li a .dashicons-heart { color: #e04b43; } p#footer-upgrade { -webkit-backface-visibility: hidden; backface-visibility: hidden; float: none; text-align: center; font-size: 11px; color: #8d98a7; text-transform: uppercase; letter-spacing: .1em; padding-bottom: 1rem; } p#footer-upgrade a { display: inline-block; text-decoration: none; padding: 7px 5px; color: #66717f; } p#footer-upgrade a:hover { color: #3857f1; } p#footer-upgrade .dashicons { font-size: 16px !important; height: 16px; line-height: 16px; } /** * Import admin page responsive styles. */ /*****************************************/ /* Admin page responsive styles /*****************************************/ @media screen and (max-width: 782px) { .auto-fold #wpcontent { padding-left: 0; } #filter-container .theme, #wpbody-content .sinatra-columns .sinatra-column { width: 50%; } .plugin-image { display: none; } } @media screen and (max-width: 600px) { #wpbody-content .sinatra-section.large-section p { max-width: 100%; } .admin-bar #wpcontent { padding-top: 46px; } .sinatra-tabs > ul { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; padding: 0; } .sinatra-tabs > ul > li { padding-left: 20px; padding-right: 20px; margin: 0; border-bottom: 1px solid #d6e1e8 !important; } .sinatra-tabs > ul > li:last-child { border-bottom: none !important; } #wpbody-content .sinatra-section-title { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; width: 100%; } #wpbody-content .sinatra-section-title .sinatra-filters { margin-left: 0; padding-left: 0; } #wpbody-content .sinatra-section-title .sinatra-dropdown-filter > ul { right: auto; left: 0; } #wpbody-content .sinatra-section-title .sinatra-info-icon { display: none; } #filter-container .theme, #wpbody-content .sinatra-columns .sinatra-column { width: 100% !important; } #wpbody { padding-top: 0; } #sinatra-header .sinatra-header-action > a:last-child { display: none; } } admin/assets/css/sinatra-admin.min.css000064400000040017151231536700013756 0ustar00.sinatra-toggle{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;box-sizing:border-box}.sinatra-toggle *,.sinatra-toggle :after,.sinatra-toggle :before{box-sizing:inherit}.sinatra-toggle input[type=checkbox]{display:none}.sinatra-toggle input[type=checkbox]:checked+label .sinatra-toggle-switch{background-color:#3857f1!important}.sinatra-toggle input[type=checkbox]:checked+label .sinatra-toggle-switch:after{transform:translateX(11px)}.sinatra-toggle .sinatra-toggle-switch{background-color:#c7d5df;border-radius:8px;padding:2px;transition:all .2s;outline:0;display:block;width:27px;height:16px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:0 10px 0 0}.sinatra-toggle .sinatra-toggle-switch:after{position:relative;display:block;content:"";width:12px;height:12px;left:0;border-radius:50%;background:#fff;transition:all .15s ease;transform:translateX(0)}.sinatra-toggle label{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;color:#23282d}.sinatra-toggle label:hover .sinatra-toggle-switch{background-color:#86a4ba}.sinatra-toggle.large-toggle .sinatra-toggle-switch{border-radius:20px;width:36px;height:20px}.sinatra-toggle.large-toggle .sinatra-toggle-switch:after{width:16px;height:16px}.sinatra-toggle.large-toggle input[type=checkbox]:checked+label .sinatra-toggle-switch:after{transform:translateX(16px)}#wpcontent{padding:0;box-sizing:border-box;font-size:14px;line-height:1.8;color:#23282d;min-height:calc(100vh - 190px)}#wpbody-content{padding:0 35px}#wpbody-content h2{-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;margin-top:0;margin-bottom:0;font-size:18px;font-weight:400;color:#23282d;line-height:1.2}#wpbody-content h2 svg{width:22px;height:22px;margin-left:7px}#wp-content *,#wp-content :after,#wp-content :before,#wpcontent *{box-sizing:inherit}#wpbody{padding:0}#wpfooter{position:relative;padding:0 35px 10px}body{background-color:#f1f3f5;color:#23282d}.spinner{display:none}.spinner.activated,.spinner.visible{display:inline-block;visibility:visible}.si-container{width:100%;max-width:940px;margin:0 auto}.notice,.update-nag,div.error,div.updated{margin:5px auto!important;border-top:1px solid #d6e1e8;border-right:1px solid #d6e1e8;border-bottom:1px solid #d6e1e8;border-radius:3px;box-shadow:none;max-width:940px;display:none}.notice.notice-info,.update-nag.notice-info,div.error.notice-info,div.updated.notice-info{border-left-color:#3857f1}.notice.notice-warning,.update-nag.notice-warning,div.error.notice-warning,div.updated.notice-warning{border-left-color:#f0b849}.notice.sinatra-notice,.update-nag.sinatra-notice,div.error.sinatra-notice,div.updated.sinatra-notice{display:block}.notice p a,.update-nag p a,div.error p a,div.updated p a{color:#3857f1}.notice p a:hover,.update-nag p a:hover,div.error p a:hover,div.updated p a:hover{color:#506bf3}.sinatra-info-icon{cursor:default}.sinatra-info-icon:hover svg{fill:#95b1c3}.sinatra-warning-icon svg{fill:#f0b849;transform:rotate(180deg)}.sinatra-buttons{margin-top:18px}.si-btn,body.wp-core-ui .si-btn{text-decoration:none;font-weight:500;border-radius:2px;font-size:13px;padding:3px 12px;border:1px solid rgba(0,0,0,.15);-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:1.8;height:auto;box-shadow:none;text-shadow:none}.si-btn.large-button,body.wp-core-ui .si-btn.large-button{padding:8px 18px;font-size:14px}.si-btn.primary,body.wp-core-ui .si-btn.primary{background-color:#3857f1;color:#fff;margin-right:5px}.si-btn.secondary,body.wp-core-ui .si-btn.secondary{color:#66717f;border-color:#c7d5df;background-color:transparent;font-weight:400}.si-btn.secondary:focus,.si-btn.secondary:hover,body.wp-core-ui .si-btn.secondary:focus,body.wp-core-ui .si-btn.secondary:hover{border-color:#728191;color:#23282d;background-color:transparent}.si-btn:focus,.si-btn:hover,body.wp-core-ui .si-btn:focus,body.wp-core-ui .si-btn:hover{background-color:#506bf3;box-shadow:none!important;border-color:rgba(0,0,0,.15)}.si-btn:active,body.wp-core-ui .si-btn:active{transform:none}.si-btn[disabled=disabled],body.wp-core-ui .si-btn[disabled=disabled]{opacity:.25;pointer-events:none}.si-btn svg,body.wp-core-ui .si-btn svg{width:16px;height:16px;margin-right:7px}.sinatra-filters{margin-left:auto;padding-left:18px}.sinatra-dropdown-filter{text-decoration:none;color:#66717f;position:relative;padding:7px 0;box-shadow:none;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sinatra-dropdown-filter:focus,.sinatra-dropdown-filter:hover{color:#23282d;box-shadow:none}.sinatra-dropdown-filter.open>ul{display:block}.sinatra-dropdown-filter>ul{display:none;margin:0;padding:10px 0;position:absolute;top:100%;right:-6px;background-color:#fff;border-radius:4px;width:180px;z-index:99;box-shadow:0 0 40px rgba(51,59,72,.2)}.sinatra-dropdown-filter>ul>li{display:block;padding:5px 25px;margin-bottom:5px;color:#66717f;line-height:1.4}.sinatra-dropdown-filter>ul>li:last-child{margin-bottom:0}.sinatra-dropdown-filter>ul>li:focus,.sinatra-dropdown-filter>ul>li:hover{color:#fff;background-color:#3857f1}.sinatra-dropdown-filter>ul>li.current{background-color:rgba(0,0,0,.05);color:#23282d}.sinatra-section-title{-js-display:flex;display:-ms-flexbox;display:flex}.sinatra-modal,.sinatra-section-title{-ms-flex-align:center;align-items:center}.sinatra-modal{position:fixed;display:none;top:0;left:0;right:0;bottom:0;background-color:rgba(44,46,58,.75);z-index:99999;-ms-flex-pack:center;justify-content:center;overflow-y:scroll;opacity:0;transition:all .2s ease-out .2s}.sinatra-modal .sinatra-modal-container{opacity:0;transition:all .2s ease-out 0s;transform:scale(1.2)}.sinatra-modal.sinatra-block{-js-display:flex;display:-ms-flexbox;display:flex}.sinatra-modal.sinatra-visible{opacity:1;transition-delay:0s}.sinatra-modal.sinatra-visible .sinatra-modal-container{opacity:1;transform:scale(1);transition-delay:.2s}.sinatra-info-icon,.sinatra-warning-icon{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-left:5px;position:relative}.sinatra-info-icon svg,.sinatra-warning-icon svg{fill:#b5c9d6}.sinatra-info-icon:focus svg,.sinatra-info-icon:hover svg,.sinatra-warning-icon:focus svg,.sinatra-warning-icon:hover svg{fill:#648da8}.sinatra-info-icon:focus .sinatra-tooltip,.sinatra-info-icon:hover .sinatra-tooltip,.sinatra-warning-icon:focus .sinatra-tooltip,.sinatra-warning-icon:hover .sinatra-tooltip{display:block}.sinatra-tooltip{display:none;color:#d6e1e8;font-size:13px;font-style:normal;width:300px;padding:16px 18px;z-index:991;border-radius:3px;line-height:1.6;bottom:100%;transform:translateY(-13px)}.sinatra-tooltip,.sinatra-tooltip:after{position:absolute;background-color:#23282d}.sinatra-tooltip:after{content:"";width:10px;height:10px;transform:rotate(45deg);top:calc(100% - 5px);left:var(--tooltip-left);margin-left:14px}.sinatra-tooltip.right-tooltip{left:100%;top:50%;transform:translate(13px,-50%)}.sinatra-tooltip.top-right-tooltip{right:0;bottom:100%;transform:translateY(13px)}.sinatra-tooltip.top-right-tooltip:after{top:calc(100% - 6px);left:calc(100% - 25px);margin-left:0}.sinatra-tooltip.small-tooltip{top:5px;bottom:auto;left:50%;width:auto;transform:translateX(-50%);padding:6px 10px;font-size:11px;line-height:1.5;white-space:nowrap;font-weight:400}.sinatra-tooltip.small-tooltip:after{display:none}#sinatra-header{padding:12px 35px;background-color:#fff;position:relative;border-bottom:1px solid #d6e1e8;margin-bottom:9px}#sinatra-header>.si-container{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}#sinatra-header .sinatra-logo img{height:26px;width:auto;display:block}#sinatra-header .sinatra-logo:focus{box-shadow:none;outline:thin dotted #7f8a99;outline-offset:6px}#sinatra-header .sinatra-header-action{margin-left:auto;-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;font-size:13px}#sinatra-header .sinatra-header-action>a{padding:5px 13px;text-decoration:none;font-weight:500}#sinatra-header .sinatra-header-action>a:focus{box-shadow:none}#sinatra-header .sinatra-header-action>a:first-child{border-radius:2px;background-color:#3857f1;color:#fff;border:1px solid rgba(0,0,0,.15)}#sinatra-header .sinatra-header-action>a:first-child:focus,#sinatra-header .sinatra-header-action>a:first-child:hover{background-color:#506bf3}#sinatra-header .sinatra-header-action>a:first-child.secondary{background-color:transparent}#sinatra-header .sinatra-header-action>a:last-child{margin-left:12px;border-radius:2px;border:1px solid #d6e1e8;color:#66717f}#sinatra-header .sinatra-header-action>a:last-child:focus,#sinatra-header .sinatra-header-action>a:last-child:hover{border-color:#728191;color:#23282d;background-color:transparent}.sinatra-tabs{position:relative;width:100%;padding:0;margin:9px 0 18px;background-color:#fff;border:1px solid #d6e1e8;border-radius:3px}.sinatra-tabs>ul{-js-display:flex;display:-ms-flexbox;display:flex;width:100%;overflow:hidden;margin:0;padding:0 20px}.sinatra-tabs>ul>li{width:auto;-ms-flex:none;flex:none;border-bottom:2px solid transparent;border-top:2px solid transparent;text-align:center;margin:0 10px}.sinatra-tabs>ul>li:first-child{margin-left:0}.sinatra-tabs>ul>li:last-child{margin-right:0}.sinatra-tabs>ul>li:hover>a{color:#23282d}.sinatra-tabs>ul>li.current-item{border-bottom-color:#3857f1}.sinatra-tabs>ul>li.current-item>a{color:#3857f1;font-weight:500}.sinatra-tabs>ul>li>a{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;text-decoration:none;width:auto;padding:10px 0;color:#66717f;font-weight:400}.sinatra-tabs>ul>li>a:focus{box-shadow:none;outline:thin dotted #7f8a99}#wpbody-content .sinatra-section-title{margin:19px 0 8px}#wpbody-content h2.sinatra-section-title{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}#wpbody-content .sinatra-section{-js-display:flex;display:-ms-flexbox;display:flex;padding:15px 35px;margin-bottom:50px!important}#wpbody-content .sinatra-section.large-section{padding:40px 35px;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:3px;border:1px solid #d6e1e8;background-color:#fff;margin:38px 0}#wpbody-content .sinatra-section.large-section h2{padding-top:18px;text-align:center;line-height:1.4}#wpbody-content .sinatra-section.large-section p{max-width:480px;font-size:15px;line-height:1.7;text-align:center;color:#79879a}#wpbody-content .sinatra-section .sinatra-hero img{height:140px}#wpbody-content .sinatra-columns{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:-12px -12px 50px;-ms-flex-align:stretch;align-items:stretch}#wpbody-content .sinatra-columns .sinatra-column{width:33.33%;padding:12px}#wpbody-content .sinatra-columns .sinatra-column.column-6{width:50%}#wpbody-content .sinatra-columns .sinatra-column.column-12{width:100%}#wpbody-content .sinatra-columns .sinatra-changelog{max-height:500px;overflow:scroll}#wpbody-content .sinatra-columns.plugins .sinatra-box{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}#wpbody-content .sinatra-columns.plugins .sinatra-box>div{-ms-flex:1;flex:1}#wpbody-content .sinatra-columns.plugins .plugin-image{position:absolute;top:5%;left:-10%;height:90%;opacity:.05;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#wpbody-content .sinatra-columns.plugins .plugin-image img{height:100%;pointer-events:none;border-radius:16px}#wpbody-content .sinatra-columns.plugins p{margin:5px 0 0}#wpbody-content .sinatra-columns.plugins .plugin-info{position:relative;z-index:2}#wpbody-content .sinatra-columns.plugins .si-active-plugin{-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;margin-right:auto;font-weight:400;color:#79ba49}#wpbody-content .sinatra-columns.plugins .sinatra-buttons{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-top:0;margin-top:1.2em}#wpbody-content .sinatra-columns.plugins .dashicons{height:18px;margin-right:5px}#wpbody-content .sinatra-box{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:wrap;flex-wrap:wrap;border-radius:3px;border:1px solid #d6e1e8;background-color:#fff;padding:20px 30px;height:100%;overflow:hidden;position:relative}#wpbody-content .sinatra-box p{color:#66717f;line-height:1.7}#wpbody-content .sinatra-box p:last-child{margin-bottom:0}#wpbody-content .sinatra-box h4{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:15px;font-weight:600;margin:0;color:#23282d}#wpbody-content .sinatra-box h4 i{width:auto;height:auto;color:#66717f;font-size:24px;line-height:16px;vertical-align:middle;opacity:.5;display:inline-block;padding-right:12px}#wpbody-content .sinatra-box .sinatra-buttons{margin:auto 0 0;padding-top:9px}#wpbody-content .changelog-version{font-size:11px;font-weight:500;line-height:1;text-align:center;white-space:nowrap;vertical-align:middle;border-radius:16px;color:#55718c;background-color:#d6e1ec;margin:0 12px;padding:5px 7px;margin-top:1px}#wpbody-content .sinatra-core-changelog{margin-top:-30px!important}#wpfooter{-webkit-backface-visibility:hidden;backface-visibility:hidden}#sinatra-footer{border-top:1px solid #d6e1e8;border-bottom:1px solid #d6e1e8;margin:0 -35px 18px;text-align:center;font-size:13px;color:#66717f}#sinatra-footer ul{margin:0 35px;padding:0;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}#sinatra-footer ul li{margin:0}#sinatra-footer ul li a{text-decoration:none;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:15px 10px;color:inherit}#sinatra-footer ul li a:hover{color:#23282d}#sinatra-footer ul li a:hover>span{text-decoration:underline}#sinatra-footer ul li a:focus{box-shadow:none;outline:thin dotted #7f8a99}#sinatra-footer ul li a .dashicons{font-size:18px!important;height:18px;line-height:18px;margin-right:3px;text-decoration:none!important}#sinatra-footer ul li a .dashicons-heart{color:#e04b43}p#footer-upgrade{-webkit-backface-visibility:hidden;backface-visibility:hidden;float:none;text-align:center;font-size:11px;color:#8d98a7;text-transform:uppercase;letter-spacing:.1em;padding-bottom:1rem}p#footer-upgrade a{display:inline-block;text-decoration:none;padding:7px 5px;color:#66717f}p#footer-upgrade a:hover{color:#3857f1}p#footer-upgrade .dashicons{font-size:16px!important;height:16px;line-height:16px}@media screen and (max-width:782px){.auto-fold #wpcontent{padding-left:0}#filter-container .theme,#wpbody-content .sinatra-columns .sinatra-column{width:50%}.plugin-image{display:none}}@media screen and (max-width:600px){#wpbody-content .sinatra-section.large-section p{max-width:100%}.admin-bar #wpcontent{padding-top:46px}.sinatra-tabs>ul{-ms-flex-direction:column;flex-direction:column;padding:0}.sinatra-tabs>ul>li{padding-left:20px;padding-right:20px;margin:0;border-bottom:1px solid #d6e1e8!important}.sinatra-tabs>ul>li:last-child{border-bottom:none!important}#wpbody-content .sinatra-section-title{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;width:100%}#wpbody-content .sinatra-section-title .sinatra-filters{margin-left:0;padding-left:0}#wpbody-content .sinatra-section-title .sinatra-dropdown-filter>ul{right:auto;left:0}#wpbody-content .sinatra-section-title .sinatra-info-icon{display:none}#filter-container .theme,#wpbody-content .sinatra-columns .sinatra-column{width:100%!important}#wpbody{padding-top:0}#sinatra-header .sinatra-header-action>a:last-child{display:none}}admin/assets/css/sinatra-block-editor-styles.css000064400000033044151231536700016005 0ustar00@charset "UTF-8"; /*****************************************/ /* Gutenberg specific styles /*****************************************/ /* Columns */ .wp-block-columns { margin-bottom: 0; } .wp-block-columns .wp-block-column { margin-bottom: 2em; } .wp-block-columns .wp-block-column:empty { margin-bottom: 0; } /* 781 and up */ /* Buttons */ #main .wp-block-buttons { margin-bottom: -8px; } .wp-block-button__link { line-height: 1.4; font-size: inherit; padding: .5em 2em; min-height: 45px; -js-display: inline-flex; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .alignwide { margin-right: -30px; margin-left: -30px; max-width: unset; width: unset; } .alignfull, .alignwide { margin-top: 2em; margin-bottom: 2em; max-width: unset; width: unset; } .wp-block-cover { margin-top: 2em; margin-bottom: 2em; } .has-medium-font-size { line-height: 1.5; } .has-huge-font-size, .has-large-font-size { line-height: 1.25; } .wp-block-button.is-style-squared .wp-block-button__link { border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.12); } .wp-block-media-text { margin-top: 1.25em; margin-bottom: 1.25em; } .wp-block-media-text__content p:first-child { margin-top: 0; } .wp-block-media-text__content p:last-child { margin-bottom: 0; } .wp-block-media-text__content p.has-large-font-size { margin-bottom: 1rem; } /* Social links */ #page .wp-block-social-links { margin-top: 2em; margin-bottom: 2em; margin-left: 0; } #page .wp-block-social-links .wp-social-link a, #page .wp-block-social-links .wp-social-link a:hover { color: inherit; } /* Button block appender position fix */ .wp-block-buttons .block-editor-block-list__layout > div:last-child { position: relative; top: 8px; } .editor-post-title__block .editor-post-title__input { font-family: inherit; } .editor-styles-wrapper { width: 100%; } .editor-styles-wrapper .wp-block[data-align=full] .wp-block { max-width: unset !important; } :root .editor-styles-wrapper .has-small-font-size { font-size: 13px; } :root .editor-styles-wrapper .has-regular-font-size, :root .editor-styles-wrapper .has-normal-font-size { font-size: 16px; } :root .editor-styles-wrapper .has-medium-font-size { font-size: 20px; } :root .editor-styles-wrapper .has-large-font-size { font-size: 36px; } :root .editor-styles-wrapper .has-larger-font-size, :root .editor-styles-wrapper .has-huge-font-size { font-size: 42px; } .editor-styles-wrapper .wp-block { width: 100%; } .editor-styles-wrapper .wp-block.block-editor-block-list__block[data-type="core/paragraph"] p { line-height: inherit; } .editor-styles-wrapper .wp-block h1, .editor-styles-wrapper .wp-block h2, .editor-styles-wrapper .wp-block h3, .editor-styles-wrapper .wp-block h4, .editor-styles-wrapper .wp-block h5, .editor-styles-wrapper .wp-block h6 { text-rendering: optimizeLegibility; } .editor-styles-wrapper .wp-block h1, .editor-styles-wrapper .wp-block h2, .editor-styles-wrapper .wp-block h3 { margin-top: 1.25em; margin-bottom: .75em; } .editor-styles-wrapper .wp-block h4, .editor-styles-wrapper .wp-block h5, .editor-styles-wrapper .wp-block h6 { margin-top: 1.5rem; margin-bottom: 1rem; } .editor-styles-wrapper .wp-block p.has-background { padding: 30px 35px; } .editor-styles-wrapper .wp-block .wp-block-column > div > *:first-child, .editor-styles-wrapper .wp-block .wp-block-cover > div > *:first-child, .editor-styles-wrapper .wp-block .wp-block-cover__inner-container > div > *:first-child, .editor-styles-wrapper .wp-block .wp-block-group__inner-container > div > *:first-child { margin-top: 0; } .editor-styles-wrapper .wp-block .wp-block-column > div > *:last-child, .editor-styles-wrapper .wp-block .wp-block-cover > div > *:last-child, .editor-styles-wrapper .wp-block .wp-block-cover__inner-container > div > *:last-child, .editor-styles-wrapper .wp-block .wp-block-group__inner-container > div > *:last-child { margin-bottom: 0; } .editor-styles-wrapper .wp-block .has-medium-font-size { line-height: 1.5 !important; } .editor-styles-wrapper .wp-block .has-huge-font-size, .editor-styles-wrapper .wp-block .has-large-font-size { line-height: 1.25 !important; } .editor-styles-wrapper .wp-block .alignwide, .editor-styles-wrapper .wp-block.alignwide { margin-right: -30px; margin-left: -30px; max-width: unset; width: unset; } .editor-styles-wrapper .wp-block .wp-block-embed figcaption, .editor-styles-wrapper .wp-block .wp-block-image figcaption { margin-top: .75em; margin-bottom: 0; font-size: 0.8125rem; } .editor-styles-wrapper .wp-block .block-library-list ul { list-style: disc; list-style-position: outside; } .editor-styles-wrapper .wp-block .block-library-list ul ul { list-style: circle; } .editor-styles-wrapper .wp-block .block-library-list ul, .editor-styles-wrapper .wp-block .block-library-list ol { margin-left: 2.5em; padding-left: 0; } .editor-styles-wrapper .wp-block .block-library-list ul li, .editor-styles-wrapper .wp-block .block-library-list ol li { margin-bottom: .35rem; } .editor-styles-wrapper .wp-block .block-library-list ul li:last-child, .editor-styles-wrapper .wp-block .block-library-list ol li:last-child { margin-bottom: 0; } .editor-styles-wrapper .wp-block .block-library-list ul ul, .editor-styles-wrapper .wp-block .block-library-list ul ol, .editor-styles-wrapper .wp-block .block-library-list ol ul, .editor-styles-wrapper .wp-block .block-library-list ol ol { margin-top: .35rem; margin-bottom: 0; } .editor-styles-wrapper .wp-block [data-block], .editor-styles-wrapper .wp-block p, .editor-styles-wrapper .wp-block ul, .editor-styles-wrapper .wp-block ol, .editor-styles-wrapper .wp-block blockquote { margin-bottom: 1.25em; margin-top: 1.25em; } .editor-styles-wrapper .wp-block blockquote, .editor-styles-wrapper .wp-block .wp-block-quote { margin: 1.25em 0; padding: .5em 1.5em; border-style: none; border-left-style: solid; border-width: 4px; font-size: 1em; line-height: inherit; position: relative; border-radius: 3px; } .editor-styles-wrapper .wp-block blockquote > p, .editor-styles-wrapper .wp-block blockquote > div > p, .editor-styles-wrapper .wp-block .wp-block-quote > p, .editor-styles-wrapper .wp-block .wp-block-quote > div > p { font-size: inherit; line-height: inherit; font-style: normal; } .editor-styles-wrapper .wp-block blockquote > p:first-child, .editor-styles-wrapper .wp-block blockquote > div > p:first-child, .editor-styles-wrapper .wp-block .wp-block-quote > p:first-child, .editor-styles-wrapper .wp-block .wp-block-quote > div > p:first-child { margin-top: 0; margin-bottom: 1em; } .editor-styles-wrapper .wp-block blockquote > p:last-child, .editor-styles-wrapper .wp-block blockquote > div > p:last-child, .editor-styles-wrapper .wp-block .wp-block-quote > p:last-child, .editor-styles-wrapper .wp-block .wp-block-quote > div > p:last-child { margin-bottom: 0; } .editor-styles-wrapper .wp-block blockquote.has-text-align-center, .editor-styles-wrapper .wp-block .wp-block-quote.has-text-align-center { border: none; } .editor-styles-wrapper .wp-block blockquote.has-text-align-right, .editor-styles-wrapper .wp-block .wp-block-quote.has-text-align-right { border-left-style: none; border-right-style: solid; } .editor-styles-wrapper .wp-block blockquote cite, .editor-styles-wrapper .wp-block blockquote .wp-block-quote__citation, .editor-styles-wrapper .wp-block .wp-block-quote cite, .editor-styles-wrapper .wp-block .wp-block-quote .wp-block-quote__citation { display: block; margin-top: 1em; text-align: inherit; font-size: .875em; } .editor-styles-wrapper .wp-block blockquote.is-style-large, .editor-styles-wrapper .wp-block blockquote.is-large, .editor-styles-wrapper .wp-block .wp-block-quote.is-style-large, .editor-styles-wrapper .wp-block .wp-block-quote.is-large { font-size: 1.125em; line-height: 1.5; position: relative; background-color: rgba(35, 35, 35, 0.04); padding: 1.875rem 2.5rem; } .editor-styles-wrapper .wp-block blockquote.is-style-large cite, .editor-styles-wrapper .wp-block blockquote.is-style-large .wp-block-quote__citation, .editor-styles-wrapper .wp-block blockquote.is-large cite, .editor-styles-wrapper .wp-block blockquote.is-large .wp-block-quote__citation, .editor-styles-wrapper .wp-block .wp-block-quote.is-style-large cite, .editor-styles-wrapper .wp-block .wp-block-quote.is-style-large .wp-block-quote__citation, .editor-styles-wrapper .wp-block .wp-block-quote.is-large cite, .editor-styles-wrapper .wp-block .wp-block-quote.is-large .wp-block-quote__citation { font-size: .833em; } .editor-styles-wrapper .wp-block blockquote.is-style-large:before, .editor-styles-wrapper .wp-block blockquote.is-large:before, .editor-styles-wrapper .wp-block .wp-block-quote.is-style-large:before, .editor-styles-wrapper .wp-block .wp-block-quote.is-large:before { content: ''; position: absolute; width: 32px; height: 32px; top: 12px; left: 20px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 123.961 123.961'%3E%3Cpath d='M49.8,29.032c3.1-1.3,4.4-5,3-8l-4.9-10.3c-1.4-2.899-4.8-4.2-7.8-2.899c-8.5,3.6-15.8,8.3-21.6,14 C11.4,28.532,6.6,36.232,4,44.732c-2.6,8.601-4,20.3-4,35.2v30.7c0,3.3,2.7,6,6,6h39.3c3.3,0,6-2.7,6-6v-39.3c0-3.301-2.7-6-6-6 H26.5c0.2-10.101,2.6-18.2,7-24.301C37.1,36.133,42.5,32.133,49.8,29.032z'/%3E%3Cpath d='M120.4,29.032c3.1-1.3,4.399-5,3-8l-4.9-10.199c-1.4-2.9-4.8-4.2-7.8-2.9c-8.4,3.6-15.601,8.3-21.5,13.9 c-7.101,6.8-12,14.5-14.601,23c-2.6,8.399-3.899,20.1-3.899,35.1v30.7c0,3.3,2.7,6,6,6H116c3.3,0,6-2.7,6-6v-39.3 c0-3.301-2.7-6-6-6H97.1c0.2-10.101,2.601-18.2,7-24.301C107.7,36.133,113.1,32.133,120.4,29.032z'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; background-size: 32px; pointer-events: none; opacity: .1; } .editor-styles-wrapper .wp-block cite:before, .editor-styles-wrapper .wp-block .wp-block-quote__citation:before { content: "—"; display: inline-block; margin-right: 0.375rem; color: inherit; } .editor-styles-wrapper .wp-block .block-editor-rich-text__editable a { text-decoration: none; } .editor-styles-wrapper .wp-block .wp-block-preformatted pre { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } .editor-styles-wrapper .wp-block mark, .editor-styles-wrapper .wp-block span.highlight { color: inherit; position: relative; padding: 2px 5px 2px 3px; border-radius: 2px; } .editor-styles-wrapper .wp-block code, .editor-styles-wrapper .wp-block kbd, .editor-styles-wrapper .wp-block var, .editor-styles-wrapper .wp-block samp, .editor-styles-wrapper .wp-block tt { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; word-wrap: break-word; padding: .1rem .3rem; font-size: 90%; border-radius: 3px; overflow-wrap: break-word; word-wrap: break-word; } .editor-styles-wrapper .wp-block code.block { margin: 1.25em 0; display: block; padding: 1.5625rem 2.5rem; border-radius: 3px; } .editor-styles-wrapper .wp-block hr { margin-top: 2em; margin-bottom: 2em; } .editor-styles-wrapper .wp-block[data-align="full"] { max-width: none; width: auto; min-width: 100%; } .editor-styles-wrapper .wp-block .uppercase-text { text-transform: uppercase; } .editor-styles-wrapper .wp-block .center-text { text-align: center; } .editor-styles-wrapper .wp-block .mr-20 { margin-right: 20px; } .editor-styles-wrapper .wp-block .mt--30 { margin-top: -30px; } .editor-styles-wrapper .wp-block .mb--30 { margin-bottom: -30px; } .editor-styles-wrapper .wp-block .si-clear-p { padding: 0; } .editor-styles-wrapper .wp-block .si-clear-m { margin: 0; } .editor-styles-wrapper .wp-block .si-clear-bm { margin-bottom: 0; } .editor-styles-wrapper .wp-block .si-z-index-99 { position: relative; z-index: 99; } .editor-styles-wrapper .wp-block .si-br-0, .editor-styles-wrapper .wp-block .si-br-0 img { border-radius: 0; } .editor-styles-wrapper .wp-block .si-br-3, .editor-styles-wrapper .wp-block .si-br-3 img { border-radius: 3px; } .editor-styles-wrapper .wp-block .si-br-6, .editor-styles-wrapper .wp-block .si-br-6 img { border-radius: 6px; } .editor-styles-wrapper .wp-block .si-br-12, .editor-styles-wrapper .wp-block .si-br-12 img { border-radius: 12px; } .editor-styles-wrapper .wp-block .si-bs { -webkit-box-shadow: 0 10px 35px -3px rgba(0, 0, 0, 0.12); box-shadow: 0 10px 35px -3px rgba(0, 0, 0, 0.12); } @media (max-width: 782px) and (min-width: 600px) { .wp-block-column:nth-child(even) { margin-left: 30px; -ms-flex-preferred-size: calc(50% - 15px) !important; flex-basis: calc(50% - 15px) !important; } } @media (min-width: 600px) { [data-type="core/columns"][data-align="full"] .wp-block-columns { padding-left: 0; padding-right: 0; } [data-type="core/columns"][data-align="full"] .wp-block-columns.has-background { padding: 20px 30px; } #editor .editor-styles-wrapper .wp-block[data-align="wide"] > div { margin-left: -30px; margin-right: -30px; } } @media (min-width: 782px) { .wp-block-columns { margin-bottom: 2em; -ms-flex-wrap: nowrap !important; flex-wrap: nowrap !important; } .wp-block-columns .wp-block-column { margin-bottom: 0; } .wp-block-columns .wp-block-column:not(:first-child) { margin-left: 30px; } } @media (max-width: 782px) { .wp-block-columns .wp-block-column:empty { display: none; } .wp-block-columns .wp-block-column:empty + .wp-block-column { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; margin-left: 0; } } admin/assets/css/sinatra-block-editor-styles.min.css000064400000027316151231536700016574 0ustar00@charset "UTF-8";.wp-block-columns{margin-bottom:0}.wp-block-columns .wp-block-column{margin-bottom:2em}.wp-block-columns .wp-block-column:empty{margin-bottom:0}#main .wp-block-buttons{margin-bottom:-8px}.wp-block-button__link{line-height:1.4;font-size:inherit;padding:.5em 2em;min-height:45px;-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}.alignwide{margin-right:-30px;margin-left:-30px;max-width:unset;width:unset}.alignfull,.alignwide{max-width:unset;width:unset}.alignfull,.alignwide,.wp-block-cover{margin-top:2em;margin-bottom:2em}.has-medium-font-size{line-height:1.5}.has-huge-font-size,.has-large-font-size{line-height:1.25}.wp-block-button.is-style-squared .wp-block-button__link{border-radius:2px;border:1px solid rgba(0,0,0,.12)}.wp-block-media-text{margin-top:1.25em;margin-bottom:1.25em}.wp-block-media-text__content p:first-child{margin-top:0}.wp-block-media-text__content p:last-child{margin-bottom:0}.wp-block-media-text__content p.has-large-font-size{margin-bottom:1rem}#page .wp-block-social-links{margin-top:2em;margin-bottom:2em;margin-left:0}#page .wp-block-social-links .wp-social-link a,#page .wp-block-social-links .wp-social-link a:hover{color:inherit}.wp-block-buttons .block-editor-block-list__layout>div:last-child{position:relative;top:8px}.editor-post-title__block .editor-post-title__input{font-family:inherit}.editor-styles-wrapper{width:100%}.editor-styles-wrapper .wp-block[data-align=full] .wp-block{max-width:unset!important}:root .editor-styles-wrapper .has-small-font-size{font-size:13px}:root .editor-styles-wrapper .has-normal-font-size,:root .editor-styles-wrapper .has-regular-font-size{font-size:16px}:root .editor-styles-wrapper .has-medium-font-size{font-size:20px}:root .editor-styles-wrapper .has-large-font-size{font-size:36px}:root .editor-styles-wrapper .has-huge-font-size,:root .editor-styles-wrapper .has-larger-font-size{font-size:42px}.editor-styles-wrapper .wp-block{width:100%}.editor-styles-wrapper .wp-block.block-editor-block-list__block[data-type="core/paragraph"] p{line-height:inherit}.editor-styles-wrapper .wp-block h1,.editor-styles-wrapper .wp-block h2,.editor-styles-wrapper .wp-block h3,.editor-styles-wrapper .wp-block h4,.editor-styles-wrapper .wp-block h5,.editor-styles-wrapper .wp-block h6{text-rendering:optimizeLegibility}.editor-styles-wrapper .wp-block h1,.editor-styles-wrapper .wp-block h2,.editor-styles-wrapper .wp-block h3{margin-top:1.25em;margin-bottom:.75em}.editor-styles-wrapper .wp-block h4,.editor-styles-wrapper .wp-block h5,.editor-styles-wrapper .wp-block h6{margin-top:1.5rem;margin-bottom:1rem}.editor-styles-wrapper .wp-block p.has-background{padding:30px 35px}.editor-styles-wrapper .wp-block .wp-block-column>div>:first-child,.editor-styles-wrapper .wp-block .wp-block-cover>div>:first-child,.editor-styles-wrapper .wp-block .wp-block-cover__inner-container>div>:first-child,.editor-styles-wrapper .wp-block .wp-block-group__inner-container>div>:first-child{margin-top:0}.editor-styles-wrapper .wp-block .wp-block-column>div>:last-child,.editor-styles-wrapper .wp-block .wp-block-cover>div>:last-child,.editor-styles-wrapper .wp-block .wp-block-cover__inner-container>div>:last-child,.editor-styles-wrapper .wp-block .wp-block-group__inner-container>div>:last-child{margin-bottom:0}.editor-styles-wrapper .wp-block .has-medium-font-size{line-height:1.5!important}.editor-styles-wrapper .wp-block .has-huge-font-size,.editor-styles-wrapper .wp-block .has-large-font-size{line-height:1.25!important}.editor-styles-wrapper .wp-block.alignwide,.editor-styles-wrapper .wp-block .alignwide{margin-right:-30px;margin-left:-30px;max-width:unset;width:unset}.editor-styles-wrapper .wp-block .wp-block-embed figcaption,.editor-styles-wrapper .wp-block .wp-block-image figcaption{margin-top:.75em;margin-bottom:0;font-size:.8125rem}.editor-styles-wrapper .wp-block .block-library-list ul{list-style:disc;list-style-position:outside}.editor-styles-wrapper .wp-block .block-library-list ul ul{list-style:circle}.editor-styles-wrapper .wp-block .block-library-list ol,.editor-styles-wrapper .wp-block .block-library-list ul{margin-left:2.5em;padding-left:0}.editor-styles-wrapper .wp-block .block-library-list ol li,.editor-styles-wrapper .wp-block .block-library-list ul li{margin-bottom:.35rem}.editor-styles-wrapper .wp-block .block-library-list ol li:last-child,.editor-styles-wrapper .wp-block .block-library-list ul li:last-child{margin-bottom:0}.editor-styles-wrapper .wp-block .block-library-list ol ol,.editor-styles-wrapper .wp-block .block-library-list ol ul,.editor-styles-wrapper .wp-block .block-library-list ul ol,.editor-styles-wrapper .wp-block .block-library-list ul ul{margin-top:.35rem;margin-bottom:0}.editor-styles-wrapper .wp-block [data-block],.editor-styles-wrapper .wp-block blockquote,.editor-styles-wrapper .wp-block ol,.editor-styles-wrapper .wp-block p,.editor-styles-wrapper .wp-block ul{margin-bottom:1.25em;margin-top:1.25em}.editor-styles-wrapper .wp-block .wp-block-quote,.editor-styles-wrapper .wp-block blockquote{margin:1.25em 0;padding:.5em 1.5em;border-style:none;border-left-style:solid;border-width:4px;font-size:1em;line-height:inherit;position:relative;border-radius:3px}.editor-styles-wrapper .wp-block .wp-block-quote>div>p,.editor-styles-wrapper .wp-block .wp-block-quote>p,.editor-styles-wrapper .wp-block blockquote>div>p,.editor-styles-wrapper .wp-block blockquote>p{font-size:inherit;line-height:inherit;font-style:normal}.editor-styles-wrapper .wp-block .wp-block-quote>div>p:first-child,.editor-styles-wrapper .wp-block .wp-block-quote>p:first-child,.editor-styles-wrapper .wp-block blockquote>div>p:first-child,.editor-styles-wrapper .wp-block blockquote>p:first-child{margin-top:0;margin-bottom:1em}.editor-styles-wrapper .wp-block .wp-block-quote>div>p:last-child,.editor-styles-wrapper .wp-block .wp-block-quote>p:last-child,.editor-styles-wrapper .wp-block blockquote>div>p:last-child,.editor-styles-wrapper .wp-block blockquote>p:last-child{margin-bottom:0}.editor-styles-wrapper .wp-block .wp-block-quote.has-text-align-center,.editor-styles-wrapper .wp-block blockquote.has-text-align-center{border:none}.editor-styles-wrapper .wp-block .wp-block-quote.has-text-align-right,.editor-styles-wrapper .wp-block blockquote.has-text-align-right{border-left-style:none;border-right-style:solid}.editor-styles-wrapper .wp-block .wp-block-quote .wp-block-quote__citation,.editor-styles-wrapper .wp-block .wp-block-quote cite,.editor-styles-wrapper .wp-block blockquote .wp-block-quote__citation,.editor-styles-wrapper .wp-block blockquote cite{display:block;margin-top:1em;text-align:inherit;font-size:.875em}.editor-styles-wrapper .wp-block .wp-block-quote.is-large,.editor-styles-wrapper .wp-block .wp-block-quote.is-style-large,.editor-styles-wrapper .wp-block blockquote.is-large,.editor-styles-wrapper .wp-block blockquote.is-style-large{font-size:1.125em;line-height:1.5;position:relative;background-color:rgba(35,35,35,.04);padding:1.875rem 2.5rem}.editor-styles-wrapper .wp-block .wp-block-quote.is-large .wp-block-quote__citation,.editor-styles-wrapper .wp-block .wp-block-quote.is-large cite,.editor-styles-wrapper .wp-block .wp-block-quote.is-style-large .wp-block-quote__citation,.editor-styles-wrapper .wp-block .wp-block-quote.is-style-large cite,.editor-styles-wrapper .wp-block blockquote.is-large .wp-block-quote__citation,.editor-styles-wrapper .wp-block blockquote.is-large cite,.editor-styles-wrapper .wp-block blockquote.is-style-large .wp-block-quote__citation,.editor-styles-wrapper .wp-block blockquote.is-style-large cite{font-size:.833em}.editor-styles-wrapper .wp-block .wp-block-quote.is-large:before,.editor-styles-wrapper .wp-block .wp-block-quote.is-style-large:before,.editor-styles-wrapper .wp-block blockquote.is-large:before,.editor-styles-wrapper .wp-block blockquote.is-style-large:before{content:"";position:absolute;width:32px;height:32px;top:12px;left:20px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 123.961 123.961'%3E%3Cpath d='M49.8 29.032c3.1-1.3 4.4-5 3-8l-4.9-10.3c-1.4-2.899-4.8-4.2-7.8-2.899-8.5 3.6-15.8 8.3-21.6 14C11.4 28.532 6.6 36.232 4 44.732c-2.6 8.601-4 20.3-4 35.2v30.7c0 3.3 2.7 6 6 6h39.3c3.3 0 6-2.7 6-6v-39.3c0-3.301-2.7-6-6-6H26.5c.2-10.101 2.6-18.2 7-24.301 3.6-4.898 9-8.898 16.3-11.999zM120.4 29.032c3.1-1.3 4.399-5 3-8l-4.9-10.199c-1.4-2.9-4.8-4.2-7.8-2.9-8.4 3.6-15.601 8.3-21.5 13.9-7.101 6.8-12 14.5-14.601 23-2.6 8.399-3.899 20.1-3.899 35.1v30.7c0 3.3 2.7 6 6 6H116c3.3 0 6-2.7 6-6v-39.3c0-3.301-2.7-6-6-6H97.1c.2-10.101 2.601-18.2 7-24.301 3.6-4.899 9-8.899 16.3-12z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:32px;pointer-events:none;opacity:.1}.editor-styles-wrapper .wp-block .wp-block-quote__citation:before,.editor-styles-wrapper .wp-block cite:before{content:"—";display:inline-block;margin-right:.375rem;color:inherit}.editor-styles-wrapper .wp-block .block-editor-rich-text__editable a{text-decoration:none}.editor-styles-wrapper .wp-block .wp-block-preformatted pre{font-family:Menlo,Monaco,Consolas,Courier New,monospace}.editor-styles-wrapper .wp-block mark,.editor-styles-wrapper .wp-block span.highlight{color:inherit;position:relative;padding:2px 5px 2px 3px;border-radius:2px}.editor-styles-wrapper .wp-block code,.editor-styles-wrapper .wp-block kbd,.editor-styles-wrapper .wp-block samp,.editor-styles-wrapper .wp-block tt,.editor-styles-wrapper .wp-block var{font-family:Menlo,Monaco,Consolas,Courier New,monospace;font-style:normal;padding:.1rem .3rem;font-size:90%;border-radius:3px;overflow-wrap:break-word;word-wrap:break-word}.editor-styles-wrapper .wp-block code.block{margin:1.25em 0;display:block;padding:1.5625rem 2.5rem;border-radius:3px}.editor-styles-wrapper .wp-block hr{margin-top:2em;margin-bottom:2em}.editor-styles-wrapper .wp-block[data-align=full]{max-width:none;width:auto;min-width:100%}.editor-styles-wrapper .wp-block .uppercase-text{text-transform:uppercase}.editor-styles-wrapper .wp-block .center-text{text-align:center}.editor-styles-wrapper .wp-block .mr-20{margin-right:20px}.editor-styles-wrapper .wp-block .mt--30{margin-top:-30px}.editor-styles-wrapper .wp-block .mb--30{margin-bottom:-30px}.editor-styles-wrapper .wp-block .si-clear-p{padding:0}.editor-styles-wrapper .wp-block .si-clear-m{margin:0}.editor-styles-wrapper .wp-block .si-clear-bm{margin-bottom:0}.editor-styles-wrapper .wp-block .si-z-index-99{position:relative;z-index:99}.editor-styles-wrapper .wp-block .si-br-0,.editor-styles-wrapper .wp-block .si-br-0 img{border-radius:0}.editor-styles-wrapper .wp-block .si-br-3,.editor-styles-wrapper .wp-block .si-br-3 img{border-radius:3px}.editor-styles-wrapper .wp-block .si-br-6,.editor-styles-wrapper .wp-block .si-br-6 img{border-radius:6px}.editor-styles-wrapper .wp-block .si-br-12,.editor-styles-wrapper .wp-block .si-br-12 img{border-radius:12px}.editor-styles-wrapper .wp-block .si-bs{box-shadow:0 10px 35px -3px rgba(0,0,0,.12)}@media (max-width:782px) and (min-width:600px){.wp-block-column:nth-child(2n){margin-left:30px;-ms-flex-preferred-size:calc(50% - 15px)!important;flex-basis:calc(50% - 15px)!important}}@media (min-width:600px){[data-type="core/columns"][data-align=full] .wp-block-columns{padding-left:0;padding-right:0}[data-type="core/columns"][data-align=full] .wp-block-columns.has-background{padding:20px 30px}#editor .editor-styles-wrapper .wp-block[data-align=wide]>div{margin-left:-30px;margin-right:-30px}}@media (min-width:782px){.wp-block-columns{margin-bottom:2em;-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.wp-block-columns .wp-block-column{margin-bottom:0}.wp-block-columns .wp-block-column:not(:first-child){margin-left:30px}}@media (max-width:782px){.wp-block-columns .wp-block-column:empty{display:none}.wp-block-columns .wp-block-column:empty+.wp-block-column{-ms-flex-positive:1;flex-grow:1;margin-left:0}}admin/assets/css/sinatra-meta-boxes.css000064400000004405151231536700014151 0ustar00/* ========================================================================== * Sinatra Meta Box Styles. * ========================================================================== */ #side-sortables .sinatra-meta-box-field { margin: 15px 0; } #side-sortables .sinatra-meta-box-field select { min-width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; } #side-sortables .sinatra-meta-box-field:last-child { margin-bottom: 0; } #side-sortables .sinatra-checkbox-row { margin-top: 0; } #side-sortables .sinatra-checkbox-row .si-checkbox-wrapper .si-checked-icon { display: none; left: -2px; top: -2px; fill: #FFF; cursor: pointer; position: absolute; width: 24px; height: 24px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; pointer-events: none; } #side-sortables .sinatra-checkbox-row input[type='checkbox'] { border: 1px solid #1e1e1e; border-radius: 2px; -webkit-appearance: none; -moz-appearance: none; appearance: none; } #side-sortables .sinatra-checkbox-row input[type='checkbox']:checked { background: #007cba; background: var(--wp-admin-theme-color); border-color: #007cba; border-color: var(--wp-admin-theme-color); } #side-sortables .sinatra-checkbox-row input[type='checkbox']:checked + .si-checked-icon { display: none; } .block-editor-page #side-sortables .sinatra-meta-box-field input[type='checkbox'] + .si-checked-icon { display: block; } .block-editor-page #side-sortables .sinatra-meta-box-field .sinatra-checkbox-row { min-height: 30px; } body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field .components-base-control__label { display: block; font-weight: 600; } body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field input[type='checkbox'] { margin-right: 10px; } body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field .sinatra-checkbox-row { min-height: 26px; } body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field .sinatra-checkbox-row .components-base-control__field { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } admin/assets/css/sinatra-meta-boxes.min.css000064400000003326151231536700014734 0ustar00#side-sortables .sinatra-meta-box-field{margin:15px 0}#side-sortables .sinatra-meta-box-field select{min-width:100%;box-sizing:border-box}#side-sortables .sinatra-meta-box-field:last-child{margin-bottom:0}#side-sortables .sinatra-checkbox-row{margin-top:0}#side-sortables .sinatra-checkbox-row .si-checkbox-wrapper .si-checked-icon{display:none;left:-2px;top:-2px;fill:#fff;cursor:pointer;position:absolute;width:24px;height:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}#side-sortables .sinatra-checkbox-row input[type=checkbox]{border:1px solid #1e1e1e;border-radius:2px;-webkit-appearance:none;-moz-appearance:none;appearance:none}#side-sortables .sinatra-checkbox-row input[type=checkbox]:checked{background:#007cba;background:var(--wp-admin-theme-color);border-color:#007cba;border-color:var(--wp-admin-theme-color)}#side-sortables .sinatra-checkbox-row input[type=checkbox]:checked+.si-checked-icon{display:none}.block-editor-page #side-sortables .sinatra-meta-box-field input[type=checkbox]+.si-checked-icon{display:block}.block-editor-page #side-sortables .sinatra-meta-box-field .sinatra-checkbox-row{min-height:30px}body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field .components-base-control__label{display:block;font-weight:600}body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field input[type=checkbox]{margin-right:10px}body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field .sinatra-checkbox-row{min-height:26px}body:not(.block-editor-page) #side-sortables .sinatra-meta-box-field .sinatra-checkbox-row .components-base-control__field{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}admin/assets/js/dev/sinatra-admin.js000064400000010472151231536700013424 0ustar00//--------------------------------------------------------------------// // Sinatra script that handles our admin functionality. //--------------------------------------------------------------------// ;(function($) { "use strict"; /** * Holds most important methods that bootstrap the whole admin area. * * @type {Object} */ var SinatraAdmin = { /** * Start the engine. * * @since 1.0.0 */ init: function() { // Document ready $(document).ready( SinatraAdmin.ready ); // Window load $(window).on( 'load', SinatraAdmin.load ); // Bind UI actions SinatraAdmin.bindUIActions(); // Trigger event when Sinatra fully loaded $(document).trigger( 'sinatraReady' ); }, //--------------------------------------------------------------------// // Events //--------------------------------------------------------------------// /** * Document ready. * * @since 1.0.0 */ ready: function() { }, /** * Window load. * * @since 1.0.0 */ load: function() { // Trigger resize once everything loaded. window.dispatchEvent( new Event( 'resize' ) ); }, /** * Window resize. * * @since 1.0.0 */ resize: function() { }, //--------------------------------------------------------------------// // Functions //--------------------------------------------------------------------// /** * Bind UI actions. * * @since 1.0.0 */ bindUIActions: function() { var $wrap = $( '#wpwrap' ); var $body = $( 'body' ); var $this; $wrap.on( 'click', '.plugins .si-btn:not(.active)', function(e){ e.preventDefault(); if ( $wrap.find( '.plugins .si-btn.in-progress' ).length ) { return; } $this = $(this); SinatraAdmin.pluginAction( $this ); }); $( document ).on('wp-plugin-install-success', SinatraAdmin.pluginInstallSuccess ); $( document ).on('wp-plugin-install-error', SinatraAdmin.pluginInstallError); }, pluginAction: function( $button ) { $button.addClass( 'in-progress' ).attr( 'disabled', 'disabled' ).html( sinatra_strings.texts[ $button.data('action') + '-inprogress' ] ); if ( 'install' === $button.data( 'action' ) ) { if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) { wp.updates.requestFilesystemCredentials( event ); $( document ).on( 'credential-modal-cancel', function() { $button.removeAttr('disabled').removeClass( 'in-progress' ).html( sinatra_strings.texts.install ); wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); } ); } wp.updates.installPlugin( { slug: $button.data('plugin') }); } else { var data = { _ajax_nonce: sinatra_strings.wpnonce, plugin: $button.data('plugin'), action: 'sinatra-plugin-' + $button.data('action'), }; $.post( sinatra_strings.ajaxurl, data, function( response ){ if ( response.success ) { if ( $button.data('redirect') ) { window.location.href = $button.data('redirect'); } else { location.reload(); } } else { $( '.plugins .si-btn.in-progress' ).removeAttr('disabled').removeClass( 'in-progress primary' ).addClass('secondary' ).html( sinatra_strings.texts.retry ); } }); } }, pluginInstallSuccess: function( event, response ) { event.preventDefault(); var $message = jQuery(event.target); var $init = $message.data('init'); var activatedSlug; if ( typeof $init === 'undefined' ) { activatedSlug = response.slug; } else { activatedSlug = $init; } var $button = $( '.plugins a[data-plugin="' + activatedSlug + '"]' ); $button.data( 'action', 'activate' ); SinatraAdmin.pluginAction( $button ); }, pluginInstallError: function( event, response ) { event.preventDefault(); var $message = jQuery(event.target); var $init = $message.data('init'); var activatedSlug; if ( typeof $init === 'undefined' ) { activatedSlug = response.slug; } else { activatedSlug = $init; } var $button = $( '.plugins a[data-plugin="' + activatedSlug + '"]' ); $button.attr( 'disabled', 'disabled' ).removeClass( 'in-progress primary' ).addClass('secondary' ).html( wp.updates.l10n.installFailedShort ); }, }; // END var SinatraAdmin SinatraAdmin.init(); window.sinatraadmin = SinatraAdmin; })(jQuery);;admin/assets/js/libs/select2.js000064400000504412151231536700012413 0ustar00/*! * Select2 4.0.6-rc.1 * https://select2.github.io * * Released under the MIT license * https://github.com/select2/select2/blob/master/LICENSE.md */ ;(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function (root, jQuery) { if (jQuery === undefined) { // require('jQuery') returns a factory that requires window to // build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop // if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } } (function (jQuery) { // This is needed so we can catch the AMD loader configuration and use it // The inner file should be wrapped (by `banner.start.js`) in a function that // returns the AMD loader references. var S2 =(function () { // Restore the Select2 AMD loader so it can be used // Needed mostly in the language files, where the loader is not inserted if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { var S2 = jQuery.fn.select2.amd; } var S2;(function () { if (!S2 || !S2.requirejs) { if (!S2) { S2 = {}; } else { require = S2; } /** * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, handlers, defined = {}, waiting = {}, config = {}, defining = {}, hasOwn = Object.prototype.hasOwnProperty, aps = [].slice, jsSuffixRegExp = /\.js$/; function hasProp(obj, prop) { return hasOwn.call(obj, prop); } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, normalizedBaseParts, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name) { name = name.split('/'); lastIndex = name.length - 1; // If wanting node ID compatibility, strip .js from end // of IDs. Have to do this here, and not in nameToUrl // because node allows either .js or non .js to map // to same file. if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } // Starts with a '.' so need the baseName if (name[0].charAt(0) === '.' && baseParts) { //Convert baseName to array, and lop off the last part, //so that . matches that 'directory' and not name of the baseName's //module. For instance, baseName of 'one/two/three', maps to //'one/two/three.js', but we want the directory, 'one/two' for //this normalization. normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); name = normalizedBaseParts.concat(name); } //start trimDots for (i = 0; i < name.length; i++) { part = name[i]; if (part === '.') { name.splice(i, 1); i -= 1; } else if (part === '..') { // If at the start, or previous value is still .., // keep them so that when converted to a path it may // still work when converted to a path, even though // as an ID it is less than ideal. In larger point // releases, may be better to just kick out an error. if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') { continue; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join('/'); } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only //one arg, it is the array form without a callback. Insert //a null so that the following concat is correct. if (typeof args[0] !== 'string' && args.length === 1) { args.push(null); } return req.apply(undef, args.concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (hasProp(waiting, name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!hasProp(defined, name) && !hasProp(defining, name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } //Creates a parts array for a relName where first part is plugin ID, //second part is resource ID. Assumes relName has already been normalized. function makeRelParts(relName) { return relName ? splitPrefix(relName) : []; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relParts) { var plugin, parts = splitPrefix(name), prefix = parts[0], relResourceName = relParts[1]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relResourceName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relResourceName)); } else { name = normalize(name, relResourceName); } } else { name = normalize(name, relResourceName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } handlers = { require: function (name) { return makeRequire(name); }, exports: function (name) { var e = defined[name]; if (typeof e !== 'undefined') { return e; } else { return (defined[name] = {}); } }, module: function (name) { return { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } }; main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, relParts, args = [], callbackType = typeof callback, usingExports; //Use name if no relName relName = relName || name; relParts = makeRelParts(relName); //Call the callback to define the module, if necessary. if (callbackType === 'undefined' || callbackType === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relParts); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = handlers.require(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = handlers.exports(name); usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = handlers.module(name); } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else { throw new Error(name + ' missing ' + depName); } } ret = callback ? callback.apply(defined[name], args) : undefined; if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { if (handlers[deps]) { //callback in this case is really relName return handlers[deps](callback); } //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, makeRelParts(callback)).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (config.deps) { req(config.deps, config.callback); } if (!callback) { return; } if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { //Using a non-zero value because of concern for what old browsers //do, and latest browsers "upgrade" to 4 if lower value is used: //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: //If want a value immediately, use require('id') instead -- something //that works in almond on the global level, but not guaranteed and //unlikely to work in other AMD implementations. setTimeout(function () { main(undef, deps, callback, relName); }, 4); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { return req(cfg); }; /** * Expose module registry for debugging and tooling */ requirejs._defined = defined; define = function (name, deps, callback) { if (typeof name !== 'string') { throw new Error('See almond README: incorrect module build, no module name'); } //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } if (!hasProp(defined, name) && !hasProp(waiting, name)) { waiting[name] = [name, deps, callback]; } }; define.amd = { jQuery: true }; }()); S2.requirejs = requirejs;S2.require = require;S2.define = define; } }()); S2.define("almond", function(){}); /* global jQuery:false, $:false */ S2.define('jquery',[],function () { var _$ = jQuery || $; if (_$ == null && console && console.error) { console.error( 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.' ); } return _$; }); S2.define('select2/utils',[ 'jquery' ], function ($) { var Utils = {}; Utils.Extend = function (ChildClass, SuperClass) { var __hasProp = {}.hasOwnProperty; function BaseConstructor () { this.constructor = ChildClass; } for (var key in SuperClass) { if (__hasProp.call(SuperClass, key)) { ChildClass[key] = SuperClass[key]; } } BaseConstructor.prototype = SuperClass.prototype; ChildClass.prototype = new BaseConstructor(); ChildClass.__super__ = SuperClass.prototype; return ChildClass; }; function getMethods (theClass) { var proto = theClass.prototype; var methods = []; for (var methodName in proto) { var m = proto[methodName]; if (typeof m !== 'function') { continue; } if (methodName === 'constructor') { continue; } methods.push(methodName); } return methods; } Utils.Decorate = function (SuperClass, DecoratorClass) { var decoratedMethods = getMethods(DecoratorClass); var superMethods = getMethods(SuperClass); function DecoratedClass () { var unshift = Array.prototype.unshift; var argCount = DecoratorClass.prototype.constructor.length; var calledConstructor = SuperClass.prototype.constructor; if (argCount > 0) { unshift.call(arguments, SuperClass.prototype.constructor); calledConstructor = DecoratorClass.prototype.constructor; } calledConstructor.apply(this, arguments); } DecoratorClass.displayName = SuperClass.displayName; function ctr () { this.constructor = DecoratedClass; } DecoratedClass.prototype = new ctr(); for (var m = 0; m < superMethods.length; m++) { var superMethod = superMethods[m]; DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod]; } var calledMethod = function (methodName) { // Stub out the original method if it's not decorating an actual method var originalMethod = function () {}; if (methodName in DecoratedClass.prototype) { originalMethod = DecoratedClass.prototype[methodName]; } var decoratedMethod = DecoratorClass.prototype[methodName]; return function () { var unshift = Array.prototype.unshift; unshift.call(arguments, originalMethod); return decoratedMethod.apply(this, arguments); }; }; for (var d = 0; d < decoratedMethods.length; d++) { var decoratedMethod = decoratedMethods[d]; DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); } return DecoratedClass; }; var Observable = function () { this.listeners = {}; }; Observable.prototype.on = function (event, callback) { this.listeners = this.listeners || {}; if (event in this.listeners) { this.listeners[event].push(callback); } else { this.listeners[event] = [callback]; } }; Observable.prototype.trigger = function (event) { var slice = Array.prototype.slice; var params = slice.call(arguments, 1); this.listeners = this.listeners || {}; // Params should always come in as an array if (params == null) { params = []; } // If there are no arguments to the event, use a temporary object if (params.length === 0) { params.push({}); } // Set the `_type` of the first object to the event params[0]._type = event; if (event in this.listeners) { this.invoke(this.listeners[event], slice.call(arguments, 1)); } if ('*' in this.listeners) { this.invoke(this.listeners['*'], arguments); } }; Observable.prototype.invoke = function (listeners, params) { for (var i = 0, len = listeners.length; i < len; i++) { listeners[i].apply(this, params); } }; Utils.Observable = Observable; Utils.generateChars = function (length) { var chars = ''; for (var i = 0; i < length; i++) { var randomChar = Math.floor(Math.random() * 36); chars += randomChar.toString(36); } return chars; }; Utils.bind = function (func, context) { return function () { func.apply(context, arguments); }; }; Utils._convertData = function (data) { for (var originalKey in data) { var keys = originalKey.split('-'); var dataLevel = data; if (keys.length === 1) { continue; } for (var k = 0; k < keys.length; k++) { var key = keys[k]; // Lowercase the first letter // By default, dash-separated becomes camelCase key = key.substring(0, 1).toLowerCase() + key.substring(1); if (!(key in dataLevel)) { dataLevel[key] = {}; } if (k == keys.length - 1) { dataLevel[key] = data[originalKey]; } dataLevel = dataLevel[key]; } delete data[originalKey]; } return data; }; Utils.hasScroll = function (index, el) { // Adapted from the function created by @ShadowScripter // and adapted by @BillBarry on the Stack Exchange Code Review website. // The original code can be found at // http://codereview.stackexchange.com/q/13338 // and was designed to be used with the Sizzle selector engine. var $el = $(el); var overflowX = el.style.overflowX; var overflowY = el.style.overflowY; //Check both x and y declarations if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) { return false; } if (overflowX === 'scroll' || overflowY === 'scroll') { return true; } return ($el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth); }; Utils.escapeMarkup = function (markup) { var replaceMap = { '\\': '\', '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''', '/': '/' }; // Do not try to escape the markup if it's not a string if (typeof markup !== 'string') { return markup; } return String(markup).replace(/[&<>"'\/\\]/g, function (match) { return replaceMap[match]; }); }; // Append an array of jQuery nodes to a given element. Utils.appendMany = function ($element, $nodes) { // jQuery 1.7.x does not support $.fn.append() with an array // Fall back to a jQuery object collection using $.fn.add() if ($.fn.jquery.substr(0, 3) === '1.7') { var $jqNodes = $(); $.map($nodes, function (node) { $jqNodes = $jqNodes.add(node); }); $nodes = $jqNodes; } $element.append($nodes); }; // Cache objects in Utils.__cache instead of $.data (see #4346) Utils.__cache = {}; var id = 0; Utils.GetUniqueElementId = function (element) { // Get a unique element Id. If element has no id, // creates a new unique number, stores it in the id // attribute and returns the new id. // If an id already exists, it simply returns it. var select2Id = element.getAttribute('data-select2-id'); if (select2Id == null) { // If element has id, use it. if (element.id) { select2Id = element.id; element.setAttribute('data-select2-id', select2Id); } else { element.setAttribute('data-select2-id', ++id); select2Id = id.toString(); } } return select2Id; }; Utils.StoreData = function (element, name, value) { // Stores an item in the cache for a specified element. // name is the cache key. var id = Utils.GetUniqueElementId(element); if (!Utils.__cache[id]) { Utils.__cache[id] = {}; } Utils.__cache[id][name] = value; }; Utils.GetData = function (element, name) { // Retrieves a value from the cache by its key (name) // name is optional. If no name specified, return // all cache items for the specified element. // and for a specified element. var id = Utils.GetUniqueElementId(element); if (name) { if (Utils.__cache[id]) { return Utils.__cache[id][name] != null ? Utils.__cache[id][name]: $(element).data(name); // Fallback to HTML5 data attribs. } return $(element).data(name); // Fallback to HTML5 data attribs. } else { return Utils.__cache[id]; } }; Utils.RemoveData = function (element) { // Removes all cached items for a specified element. var id = Utils.GetUniqueElementId(element); if (Utils.__cache[id] != null) { delete Utils.__cache[id]; } }; return Utils; }); S2.define('select2/results',[ 'jquery', './utils' ], function ($, Utils) { function Results ($element, options, dataAdapter) { this.$element = $element; this.data = dataAdapter; this.options = options; Results.__super__.constructor.call(this); } Utils.Extend(Results, Utils.Observable); Results.prototype.render = function () { var $results = $( '
    ' ); if (this.options.get('multiple')) { $results.attr('aria-multiselectable', 'true'); } this.$results = $results; return $results; }; Results.prototype.clear = function () { this.$results.empty(); }; Results.prototype.displayMessage = function (params) { var escapeMarkup = this.options.get('escapeMarkup'); this.clear(); this.hideLoading(); var $message = $( '
  • ' ); var message = this.options.get('translations').get(params.message); $message.append( escapeMarkup( message(params.args) ) ); $message[0].className += ' select2-results__message'; this.$results.append($message); }; Results.prototype.hideMessages = function () { this.$results.find('.select2-results__message').remove(); }; Results.prototype.append = function (data) { this.hideLoading(); var $options = []; if (data.results == null || data.results.length === 0) { if (this.$results.children().length === 0) { this.trigger('results:message', { message: 'noResults' }); } return; } data.results = this.sort(data.results); for (var d = 0; d < data.results.length; d++) { var item = data.results[d]; var $option = this.option(item); $options.push($option); } this.$results.append($options); }; Results.prototype.position = function ($results, $dropdown) { var $resultsContainer = $dropdown.find('.select2-results'); $resultsContainer.append($results); }; Results.prototype.sort = function (data) { var sorter = this.options.get('sorter'); return sorter(data); }; Results.prototype.highlightFirstItem = function () { var $options = this.$results .find('.select2-results__option[aria-selected]'); var $selected = $options.filter('[aria-selected=true]'); // Check if there are any selected options if ($selected.length > 0) { // If there are selected options, highlight the first $selected.first().trigger('mouseenter'); } else { // If there are no selected options, highlight the first option // in the dropdown $options.first().trigger('mouseenter'); } this.ensureHighlightVisible(); }; Results.prototype.setClasses = function () { var self = this; this.data.current(function (selected) { var selectedIds = $.map(selected, function (s) { return s.id.toString(); }); var $options = self.$results .find('.select2-results__option[aria-selected]'); $options.each(function () { var $option = $(this); var item = Utils.GetData(this, 'data'); // id needs to be converted to a string when comparing var id = '' + item.id; if ((item.element != null && item.element.selected) || (item.element == null && $.inArray(id, selectedIds) > -1)) { $option.attr('aria-selected', 'true'); } else { $option.attr('aria-selected', 'false'); } }); }); }; Results.prototype.showLoading = function (params) { this.hideLoading(); var loadingMore = this.options.get('translations').get('searching'); var loading = { disabled: true, loading: true, text: loadingMore(params) }; var $loading = this.option(loading); $loading.className += ' loading-results'; this.$results.prepend($loading); }; Results.prototype.hideLoading = function () { this.$results.find('.loading-results').remove(); }; Results.prototype.option = function (data) { var option = document.createElement('li'); option.className = 'select2-results__option'; var attrs = { 'role': 'treeitem', 'aria-selected': 'false' }; if (data.disabled) { delete attrs['aria-selected']; attrs['aria-disabled'] = 'true'; } if (data.id == null) { delete attrs['aria-selected']; } if (data._resultId != null) { option.id = data._resultId; } if (data.title) { option.title = data.title; } if (data.children) { attrs.role = 'group'; attrs['aria-label'] = data.text; delete attrs['aria-selected']; } for (var attr in attrs) { var val = attrs[attr]; option.setAttribute(attr, val); } if (data.children) { var $option = $(option); var label = document.createElement('strong'); label.className = 'select2-results__group'; var $label = $(label); this.template(data, label); var $children = []; for (var c = 0; c < data.children.length; c++) { var child = data.children[c]; var $child = this.option(child); $children.push($child); } var $childrenContainer = $('
      ', { 'class': 'select2-results__options select2-results__options--nested' }); $childrenContainer.append($children); $option.append(label); $option.append($childrenContainer); } else { this.template(data, option); } Utils.StoreData(option, 'data', data); return option; }; Results.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-results'; this.$results.attr('id', id); container.on('results:all', function (params) { self.clear(); self.append(params.data); if (container.isOpen()) { self.setClasses(); self.highlightFirstItem(); } }); container.on('results:append', function (params) { self.append(params.data); if (container.isOpen()) { self.setClasses(); } }); container.on('query', function (params) { self.hideMessages(); self.showLoading(params); }); container.on('select', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('unselect', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('open', function () { // When the dropdown is open, aria-expended="true" self.$results.attr('aria-expanded', 'true'); self.$results.attr('aria-hidden', 'false'); self.setClasses(); self.ensureHighlightVisible(); }); container.on('close', function () { // When the dropdown is closed, aria-expended="false" self.$results.attr('aria-expanded', 'false'); self.$results.attr('aria-hidden', 'true'); self.$results.removeAttr('aria-activedescendant'); }); container.on('results:toggle', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } $highlighted.trigger('mouseup'); }); container.on('results:select', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } var data = Utils.GetData($highlighted[0], 'data'); if ($highlighted.attr('aria-selected') == 'true') { self.trigger('close', {}); } else { self.trigger('select', { data: data }); } }); container.on('results:previous', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); // If we are already at te top, don't move further // If no options, currentIndex will be -1 if (currentIndex <= 0) { return; } var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first if ($highlighted.length === 0) { nextIndex = 0; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top; var nextTop = $next.offset().top; var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextTop - currentOffset < 0) { self.$results.scrollTop(nextOffset); } }); container.on('results:next', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); var nextIndex = currentIndex + 1; // If we are at the last option, stay there if (nextIndex >= $options.length) { return; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var nextBottom = $next.offset().top + $next.outerHeight(false); var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextBottom > currentOffset) { self.$results.scrollTop(nextOffset); } }); container.on('results:focus', function (params) { params.element.addClass('select2-results__option--highlighted'); }); container.on('results:message', function (params) { self.displayMessage(params); }); if ($.fn.mousewheel) { this.$results.on('mousewheel', function (e) { var top = self.$results.scrollTop(); var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); if (isAtTop) { self.$results.scrollTop(0); e.preventDefault(); e.stopPropagation(); } else if (isAtBottom) { self.$results.scrollTop( self.$results.get(0).scrollHeight - self.$results.height() ); e.preventDefault(); e.stopPropagation(); } }); } this.$results.on('mouseup', '.select2-results__option[aria-selected]', function (evt) { var $this = $(this); var data = Utils.GetData(this, 'data'); if ($this.attr('aria-selected') === 'true') { if (self.options.get('multiple')) { self.trigger('unselect', { originalEvent: evt, data: data }); } else { self.trigger('close', {}); } return; } self.trigger('select', { originalEvent: evt, data: data }); }); this.$results.on('mouseenter', '.select2-results__option[aria-selected]', function (evt) { var data = Utils.GetData(this, 'data'); self.getHighlightedResults() .removeClass('select2-results__option--highlighted'); self.trigger('results:focus', { data: data, element: $(this) }); }); }; Results.prototype.getHighlightedResults = function () { var $highlighted = this.$results .find('.select2-results__option--highlighted'); return $highlighted; }; Results.prototype.destroy = function () { this.$results.remove(); }; Results.prototype.ensureHighlightVisible = function () { var $highlighted = this.getHighlightedResults(); if ($highlighted.length === 0) { return; } var $options = this.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); var currentOffset = this.$results.offset().top; var nextTop = $highlighted.offset().top; var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); var offsetDelta = nextTop - currentOffset; nextOffset -= $highlighted.outerHeight(false) * 2; if (currentIndex <= 2) { this.$results.scrollTop(0); } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { this.$results.scrollTop(nextOffset); } }; Results.prototype.template = function (result, container) { var template = this.options.get('templateResult'); var escapeMarkup = this.options.get('escapeMarkup'); var content = template(result, container); if (content == null) { container.style.display = 'none'; } else if (typeof content === 'string') { container.innerHTML = escapeMarkup(content); } else { $(container).append(content); } }; return Results; }); S2.define('select2/keys',[ ], function () { var KEYS = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }; return KEYS; }); S2.define('select2/selection/base',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function BaseSelection ($element, options) { this.$element = $element; this.options = options; BaseSelection.__super__.constructor.call(this); } Utils.Extend(BaseSelection, Utils.Observable); BaseSelection.prototype.render = function () { var $selection = $( '' + '' ); this._tabindex = 0; if (Utils.GetData(this.$element[0], 'old-tabindex') != null) { this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex'); } else if (this.$element.attr('tabindex') != null) { this._tabindex = this.$element.attr('tabindex'); } $selection.attr('title', this.$element.attr('title')); $selection.attr('tabindex', this._tabindex); this.$selection = $selection; return $selection; }; BaseSelection.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-container'; var resultsId = container.id + '-results'; this.container = container; this.$selection.on('focus', function (evt) { self.trigger('focus', evt); }); this.$selection.on('blur', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', function (evt) { self.trigger('keypress', evt); if (evt.which === KEYS.SPACE) { evt.preventDefault(); } }); container.on('results:focus', function (params) { self.$selection.attr('aria-activedescendant', params.data._resultId); }); container.on('selection:update', function (params) { self.update(params.data); }); container.on('open', function () { // When the dropdown is open, aria-expanded="true" self.$selection.attr('aria-expanded', 'true'); self.$selection.attr('aria-owns', resultsId); self._attachCloseHandler(container); }); container.on('close', function () { // When the dropdown is closed, aria-expanded="false" self.$selection.attr('aria-expanded', 'false'); self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-owns'); self.$selection.focus(); window.setTimeout(function () { self.$selection.focus(); }, 0); self._detachCloseHandler(container); }); container.on('enable', function () { self.$selection.attr('tabindex', self._tabindex); }); container.on('disable', function () { self.$selection.attr('tabindex', '-1'); }); }; BaseSelection.prototype._handleBlur = function (evt) { var self = this; // This needs to be delayed as the active element is the body when the tab // key is pressed, possibly along with others. window.setTimeout(function () { // Don't trigger `blur` if the focus is still in the selection if ( (document.activeElement == self.$selection[0]) || ($.contains(self.$selection[0], document.activeElement)) ) { return; } self.trigger('blur', evt); }, 1); }; BaseSelection.prototype._attachCloseHandler = function (container) { var self = this; $(document.body).on('mousedown.select2.' + container.id, function (e) { var $target = $(e.target); var $select = $target.closest('.select2'); var $all = $('.select2.select2-container--open'); $all.each(function () { var $this = $(this); if (this == $select[0]) { return; } var $element = Utils.GetData(this, 'element'); $element.select2('close'); }); }); }; BaseSelection.prototype._detachCloseHandler = function (container) { $(document.body).off('mousedown.select2.' + container.id); }; BaseSelection.prototype.position = function ($selection, $container) { var $selectionContainer = $container.find('.selection'); $selectionContainer.append($selection); }; BaseSelection.prototype.destroy = function () { this._detachCloseHandler(this.container); }; BaseSelection.prototype.update = function (data) { throw new Error('The `update` method must be defined in child classes.'); }; return BaseSelection; }); S2.define('select2/selection/single',[ 'jquery', './base', '../utils', '../keys' ], function ($, BaseSelection, Utils, KEYS) { function SingleSelection () { SingleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(SingleSelection, BaseSelection); SingleSelection.prototype.render = function () { var $selection = SingleSelection.__super__.render.call(this); $selection.addClass('select2-selection--single'); $selection.html( '' + '' + '' + '' ); return $selection; }; SingleSelection.prototype.bind = function (container, $container) { var self = this; SingleSelection.__super__.bind.apply(this, arguments); var id = container.id + '-container'; this.$selection.find('.select2-selection__rendered') .attr('id', id) .attr('role', 'textbox') .attr('aria-readonly', 'true'); this.$selection.attr('aria-labelledby', id); this.$selection.on('mousedown', function (evt) { // Only respond to left clicks if (evt.which !== 1) { return; } self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on('focus', function (evt) { // User focuses on the container }); this.$selection.on('blur', function (evt) { // User exits the container }); container.on('focus', function (evt) { if (!container.isOpen()) { self.$selection.focus(); } }); }; SingleSelection.prototype.clear = function () { var $rendered = this.$selection.find('.select2-selection__rendered'); $rendered.empty(); $rendered.removeAttr('title'); // clear tooltip on empty }; SingleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; SingleSelection.prototype.selectionContainer = function () { return $(''); }; SingleSelection.prototype.update = function (data) { if (data.length === 0) { this.clear(); return; } var selection = data[0]; var $rendered = this.$selection.find('.select2-selection__rendered'); var formatted = this.display(selection, $rendered); $rendered.empty().append(formatted); $rendered.attr('title', selection.title || selection.text); }; return SingleSelection; }); S2.define('select2/selection/multiple',[ 'jquery', './base', '../utils' ], function ($, BaseSelection, Utils) { function MultipleSelection ($element, options) { MultipleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(MultipleSelection, BaseSelection); MultipleSelection.prototype.render = function () { var $selection = MultipleSelection.__super__.render.call(this); $selection.addClass('select2-selection--multiple'); $selection.html( '
        ' ); return $selection; }; MultipleSelection.prototype.bind = function (container, $container) { var self = this; MultipleSelection.__super__.bind.apply(this, arguments); this.$selection.on('click', function (evt) { self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on( 'click', '.select2-selection__choice__remove', function (evt) { // Ignore the event if it is disabled if (self.options.get('disabled')) { return; } var $remove = $(this); var $selection = $remove.parent(); var data = Utils.GetData($selection[0], 'data'); self.trigger('unselect', { originalEvent: evt, data: data }); } ); }; MultipleSelection.prototype.clear = function () { var $rendered = this.$selection.find('.select2-selection__rendered'); $rendered.empty(); $rendered.removeAttr('title'); }; MultipleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; MultipleSelection.prototype.selectionContainer = function () { var $container = $( '
      • ' + '' + '×' + '' + '
      • ' ); return $container; }; MultipleSelection.prototype.update = function (data) { this.clear(); if (data.length === 0) { return; } var $selections = []; for (var d = 0; d < data.length; d++) { var selection = data[d]; var $selection = this.selectionContainer(); var formatted = this.display(selection, $selection); $selection.append(formatted); $selection.attr('title', selection.title || selection.text); Utils.StoreData($selection[0], 'data', selection); $selections.push($selection); } var $rendered = this.$selection.find('.select2-selection__rendered'); Utils.appendMany($rendered, $selections); }; return MultipleSelection; }); S2.define('select2/selection/placeholder',[ '../utils' ], function (Utils) { function Placeholder (decorated, $element, options) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options); } Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { var $placeholder = this.selectionContainer(); $placeholder.html(this.display(placeholder)); $placeholder.addClass('select2-selection__placeholder') .removeClass('select2-selection__choice'); return $placeholder; }; Placeholder.prototype.update = function (decorated, data) { var singlePlaceholder = ( data.length == 1 && data[0].id != this.placeholder.id ); var multipleSelections = data.length > 1; if (multipleSelections || singlePlaceholder) { return decorated.call(this, data); } this.clear(); var $placeholder = this.createPlaceholder(this.placeholder); this.$selection.find('.select2-selection__rendered').append($placeholder); }; return Placeholder; }); S2.define('select2/selection/allowClear',[ 'jquery', '../keys', '../utils' ], function ($, KEYS, Utils) { function AllowClear () { } AllowClear.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); if (this.placeholder == null) { if (this.options.get('debug') && window.console && console.error) { console.error( 'Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.' ); } } this.$selection.on('mousedown', '.select2-selection__clear', function (evt) { self._handleClear(evt); }); container.on('keypress', function (evt) { self._handleKeyboardClear(evt, container); }); }; AllowClear.prototype._handleClear = function (_, evt) { // Ignore the event if it is disabled if (this.options.get('disabled')) { return; } var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected if ($clear.length === 0) { return; } evt.stopPropagation(); var data = Utils.GetData($clear[0], 'data'); var previousVal = this.$element.val(); this.$element.val(this.placeholder.id); var unselectData = { data: data }; this.trigger('clear', unselectData); if (unselectData.prevented) { this.$element.val(previousVal); return; } for (var d = 0; d < data.length; d++) { unselectData = { data: data[d] }; // Trigger the `unselect` event, so people can prevent it from being // cleared. this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out. if (unselectData.prevented) { this.$element.val(previousVal); return; } } this.$element.trigger('change'); this.trigger('toggle', {}); }; AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { if (container.isOpen()) { return; } if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { this._handleClear(evt); } }; AllowClear.prototype.update = function (decorated, data) { decorated.call(this, data); if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) { return; } var $remove = $( '' + '×' + '' ); Utils.StoreData($remove[0], 'data', data); this.$selection.find('.select2-selection__rendered').prepend($remove); }; return AllowClear; }); S2.define('select2/selection/search',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function Search (decorated, $element, options) { decorated.call(this, $element, options); } Search.prototype.render = function (decorated) { var $search = $( '
      • ' + '' + '
      • ' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('open', function () { self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.id); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = Utils.GetData($previousChoice[0], 'data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { var isTagInput = this.$element.find('[data-select2-tag]').length; if (isTagInput) { // fix IE11 bug where tag input lost focus this.$element.focus(); } else { this.$search.focus(); } } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting', 'clear', 'clearing' ]; var preventableEvents = [ 'opening', 'closing', 'selecting', 'unselecting', 'clearing' ]; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = container.id + '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 Utils.RemoveData(this); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id !== undefined) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data Utils.StoreData(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = Utils.GetData($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; Utils.StoreData($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (item !== Object(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id && this.container != null) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ('status' in $request && ($request.status === 0 || $request.status === '0')) { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var optionText = (option.text || '').toUpperCase(); var paramsTerm = (params.term || '').toUpperCase(); var checkText = optionText === paramsTerm; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '' + '' + '' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '' + '' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.val(''); self.$search.blur(); }); container.on('focus', function () { if (!container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '
      • ' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $(''); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { Utils.StoreData(this, 'select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = Utils.GetData(this, 'select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ '../utils' ], function (Utils) { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = Utils.GetData($highlightedResults[0], 'data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(true, this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if (Utils.GetData($e[0], 'select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); Utils.StoreData($e[0], 'tags', true); } if (Utils.GetData($e[0], 'ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl')); Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, Utils.GetData($e[0])); } else { dataset = Utils.GetData($e[0]); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if (Utils.GetData($element[0], 'select2') != null) { Utils.GetData($element[0], 'select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; Utils.StoreData($element[0], 'old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); Utils.StoreData($element[0], 'select2', this); // Ensure backwards compatibility with $element.data('select2'). $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('keypress', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } } else { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting', 'clear': 'clearing' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', Utils.GetData(this.$element[0], 'old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); Utils.RemoveData(this.$element[0]); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '' + '' + '' + '' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); Utils.StoreData($container[0], 'element', this.$element); return $container; }; return Select2; }); S2.define('select2/compat/utils',[ 'jquery' ], function ($) { function syncCssClasses ($dest, $src, adapter) { var classes, replacements = [], adapted; classes = $.trim($dest.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Save all Select2 classes if (this.indexOf('select2-') === 0) { replacements.push(this); } }); } classes = $.trim($src.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Only adapt non-Select2 classes if (this.indexOf('select2-') !== 0) { adapted = adapter(this); if (adapted != null) { replacements.push(adapted); } } }); } $dest.attr('class', replacements.join(' ')); } return { syncCssClasses: syncCssClasses }; }); S2.define('select2/compat/containerCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _containerAdapter (clazz) { return null; } function ContainerCSS () { } ContainerCSS.prototype.render = function (decorated) { var $container = decorated.call(this); var containerCssClass = this.options.get('containerCssClass') || ''; if ($.isFunction(containerCssClass)) { containerCssClass = containerCssClass(this.$element); } var containerCssAdapter = this.options.get('adaptContainerCssClass'); containerCssAdapter = containerCssAdapter || _containerAdapter; if (containerCssClass.indexOf(':all:') !== -1) { containerCssClass = containerCssClass.replace(':all:', ''); var _cssAdapter = containerCssAdapter; containerCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var containerCss = this.options.get('containerCss') || {}; if ($.isFunction(containerCss)) { containerCss = containerCss(this.$element); } CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); $container.css(containerCss); $container.addClass(containerCssClass); return $container; }; return ContainerCSS; }); S2.define('select2/compat/dropdownCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _dropdownAdapter (clazz) { return null; } function DropdownCSS () { } DropdownCSS.prototype.render = function (decorated) { var $dropdown = decorated.call(this); var dropdownCssClass = this.options.get('dropdownCssClass') || ''; if ($.isFunction(dropdownCssClass)) { dropdownCssClass = dropdownCssClass(this.$element); } var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; if (dropdownCssClass.indexOf(':all:') !== -1) { dropdownCssClass = dropdownCssClass.replace(':all:', ''); var _cssAdapter = dropdownCssAdapter; dropdownCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var dropdownCss = this.options.get('dropdownCss') || {}; if ($.isFunction(dropdownCss)) { dropdownCss = dropdownCss(this.$element); } CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); $dropdown.css(dropdownCss); $dropdown.addClass(dropdownCssClass); return $dropdown; }; return DropdownCSS; }); S2.define('select2/compat/initSelection',[ 'jquery' ], function ($) { function InitSelection (decorated, $element, options) { if (options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `initSelection` option has been deprecated in favor' + ' of a custom data adapter that overrides the `current` method. ' + 'This method is now called multiple times instead of a single ' + 'time when the instance is initialized. Support will be removed ' + 'for the `initSelection` option in future versions of Select2' ); } this.initSelection = options.get('initSelection'); this._isInitialized = false; decorated.call(this, $element, options); } InitSelection.prototype.current = function (decorated, callback) { var self = this; if (this._isInitialized) { decorated.call(this, callback); return; } this.initSelection.call(null, this.$element, function (data) { self._isInitialized = true; if (!$.isArray(data)) { data = [data]; } callback(data); }); }; return InitSelection; }); S2.define('select2/compat/inputData',[ 'jquery', '../utils' ], function ($, Utils) { function InputData (decorated, $element, options) { this._currentData = []; this._valueSeparator = options.get('valueSeparator') || ','; if ($element.prop('type') === 'hidden') { if (options.get('debug') && console && console.warn) { console.warn( 'Select2: Using a hidden input with Select2 is no longer ' + 'supported and may stop working in the future. It is recommended ' + 'to use a `');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;if(this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c){this.$element.find("[data-select2-tag]").length?this.$element.focus():this.$search.focus()}},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"â’¶":"A","A":"A","À":"A","Ã":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä€":"A","Ä‚":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ä":"A","Çž":"A","Ả":"A","Ã…":"A","Ǻ":"A","Ç":"A","È€":"A","È‚":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ä„":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ç¢":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","â’·":"B","ï¼¢":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Æ‚":"B","Æ":"B","â’¸":"C","ï¼£":"C","Ć":"C","Ĉ":"C","ÄŠ":"C","ÄŒ":"C","Ç":"C","Ḉ":"C","Ƈ":"C","È»":"C","Ꜿ":"C","â’¹":"D","D":"D","Ḋ":"D","ÄŽ":"D","Ḍ":"D","á¸":"D","Ḓ":"D","Ḏ":"D","Ä":"D","Æ‹":"D","ÆŠ":"D","Ɖ":"D","ê¹":"D","DZ":"DZ","Ç„":"DZ","Dz":"Dz","Ç…":"Dz","â’º":"E","ï¼¥":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ä’":"E","Ḕ":"E","Ḗ":"E","Ä”":"E","Ä–":"E","Ë":"E","Ẻ":"E","Äš":"E","È„":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Æ":"E","ÆŽ":"E","â’»":"F","F":"F","Ḟ":"F","Æ‘":"F","ê»":"F","â’¼":"G","ï¼§":"G","Ç´":"G","Äœ":"G","Ḡ":"G","Äž":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ“":"G","êž ":"G","ê½":"G","ê¾":"G","â’½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Èž":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","êž":"H","â’¾":"I","I":"I","ÃŒ":"I","Ã":"I","ÃŽ":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","Ỉ":"I","Ç":"I","Ȉ":"I","ÈŠ":"I","Ị":"I","Ä®":"I","Ḭ":"I","Æ—":"I","â’¿":"J","J":"J","Ä´":"J","Ɉ":"J","â“€":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","ê€":"K","ê‚":"K","ê„":"K","Ꞣ":"K","â“":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","êˆ":"L","ê†":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","â“‚":"M","ï¼­":"M","Ḿ":"M","á¹€":"M","Ṃ":"M","â±®":"M","Æœ":"M","Ⓝ":"N","ï¼®":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Å…":"N","Ṋ":"N","Ṉ":"N","È ":"N","Æ":"N","êž":"N","Ꞥ":"N","ÇŠ":"NJ","Ç‹":"Nj","â“„":"O","O":"O","Ã’":"O","Ó":"O","Ô":"O","á»’":"O","á»":"O","á»–":"O","á»”":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","ÅŒ":"O","á¹":"O","á¹’":"O","ÅŽ":"O","È®":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Å":"O","Ç‘":"O","ÈŒ":"O","ÈŽ":"O","Æ ":"O","Ờ":"O","Ớ":"O","á» ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","ÆŸ":"O","êŠ":"O","êŒ":"O","Æ¢":"OI","êŽ":"OO","È¢":"OU","â“…":"P","ï¼°":"P","á¹”":"P","á¹–":"P","Ƥ":"P","â±£":"P","ê":"P","ê’":"P","ê”":"P","Ⓠ":"Q","ï¼±":"Q","ê–":"Q","ê˜":"Q","ÉŠ":"Q","Ⓡ":"R","ï¼²":"R","Å”":"R","Ṙ":"R","Ř":"R","È":"R","È’":"R","Ṛ":"R","Ṝ":"R","Å–":"R","Ṟ":"R","ÉŒ":"R","Ɽ":"R","êš":"R","Ꞧ":"R","êž‚":"R","Ⓢ":"S","ï¼³":"S","ẞ":"S","Åš":"S","Ṥ":"S","Åœ":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","Ș":"S","Åž":"S","â±¾":"S","Ꞩ":"S","êž„":"S","Ⓣ":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Èš":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","ï¼µ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ç›":"U","Ç—":"U","Ç•":"U","Ç™":"U","Ủ":"U","Å®":"U","Ű":"U","Ç“":"U","È”":"U","È–":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É„":"U","â“‹":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","êž":"V","É…":"V","ê ":"VY","Ⓦ":"W","ï¼·":"W","Ẁ":"W","Ẃ":"W","Å´":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","â±²":"W","â“":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","ÉŽ":"Y","Ỿ":"Y","â“":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â“":"a","ï½":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","ÇŸ":"a","ả":"a","Ã¥":"a","Ç»":"a","ÇŽ":"a","È":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","á¸":"a","Ä…":"a","â±¥":"a","É":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","â“‘":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","Æ€":"b","ƃ":"b","É“":"b","â“’":"c","c":"c","ć":"c","ĉ":"c","Ä‹":"c","Ä":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","â““":"d","d":"d","ḋ":"d","Ä":"d","á¸":"d","ḑ":"d","ḓ":"d","á¸":"d","Ä‘":"d","ÆŒ":"d","É–":"d","É—":"d","êº":"d","dz":"dz","dž":"dz","â“”":"e","ï½…":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»…":"e","ể":"e","ẽ":"e","Ä“":"e","ḕ":"e","ḗ":"e","Ä•":"e","Ä—":"e","ë":"e","ẻ":"e","Ä›":"e","È…":"e","ȇ":"e","ẹ":"e","ệ":"e","È©":"e","á¸":"e","Ä™":"e","ḙ":"e","ḛ":"e","ɇ":"e","É›":"e","Ç":"e","â“•":"f","f":"f","ḟ":"f","Æ’":"f","ê¼":"f","â“–":"g","g":"g","ǵ":"g","Ä":"g","ḡ":"g","ÄŸ":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","êž¡":"g","áµ¹":"g","ê¿":"g","â“—":"h","h":"h","Ä¥":"h","ḣ":"h","ḧ":"h","ÈŸ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ•":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","Ä©":"i","Ä«":"i","Ä­":"i","ï":"i","ḯ":"i","ỉ":"i","Ç":"i","ȉ":"i","È‹":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","â“™":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ™":"k","ⱪ":"k","ê":"k","êƒ":"k","ê…":"k","ꞣ":"k","â“›":"l","l":"l","Å€":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å‚":"l","Æš":"l","É«":"l","ⱡ":"l","ê‰":"l","êž":"l","ê‡":"l","lj":"lj","ⓜ":"m","ï½":"m","ḿ":"m","á¹":"m","ṃ":"m","ɱ":"m","ɯ":"m","â“":"n","n":"n","ǹ":"n","Å„":"n","ñ":"n","á¹…":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","Æž":"n","ɲ":"n","ʼn":"n","êž‘":"n","ꞥ":"n","ÇŒ":"nj","ⓞ":"o","ï½":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","á»—":"o","ổ":"o","õ":"o","á¹":"o","È­":"o","á¹":"o","Å":"o","ṑ":"o","ṓ":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å‘":"o","Ç’":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»›":"o","ỡ":"o","ở":"o","ợ":"o","á»":"o","á»™":"o","Ç«":"o","Ç­":"o","ø":"o","Ç¿":"o","É”":"o","ê‹":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","ⓟ":"p","ï½":"p","ṕ":"p","á¹—":"p","Æ¥":"p","áµ½":"p","ê‘":"p","ê“":"p","ê•":"p","â“ ":"q","q":"q","É‹":"q","ê—":"q","ê™":"q","â“¡":"r","ï½’":"r","Å•":"r","á¹™":"r","Å™":"r","È‘":"r","È“":"r","á¹›":"r","á¹":"r","Å—":"r","ṟ":"r","É":"r","ɽ":"r","ê›":"r","êž§":"r","ꞃ":"r","â“¢":"s","s":"s","ß":"s","Å›":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È™":"s","ÅŸ":"s","È¿":"s","êž©":"s","êž…":"s","ẛ":"s","â“£":"t","ï½”":"t","ṫ":"t","ẗ":"t","Å¥":"t","á¹­":"t","È›":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ­":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å­":"u","ü":"u","Çœ":"u","ǘ":"u","Ç–":"u","Çš":"u","á»§":"u","ů":"u","ű":"u","Ç”":"u","È•":"u","È—":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»­":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","ʉ":"u","â“¥":"v","ï½–":"v","á¹½":"v","ṿ":"v","Ê‹":"v","êŸ":"v","ÊŒ":"v","ê¡":"vy","ⓦ":"w","ï½—":"w","áº":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","â±³":"w","â“§":"x","x":"x","ẋ":"x","áº":"x","ⓨ":"y","ï½™":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","ẙ":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â“©":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","È¥":"z","É€":"z","ⱬ":"z","ê£":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","ÎŒ":"Ο","ÎŽ":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ÏŠ":"ι","Î":"ι","ÏŒ":"ο","Ï":"Ï…","Ï‹":"Ï…","ΰ":"Ï…","ω":"ω","Ï‚":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
      • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery","../utils"],function(a,b){function c(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a ` $value ) { ?>

        $value ) { if ( method_exists( $this, 'render_field_' . $value['type'] ) ) { call_user_func( array( $this, 'render_field_' . $value['type'] ), $post, $value ); } } } /** * Render checkbox group field. * * @since 1.0.0 * @param object $post Current post object. * @param array $setting Array of field settings. */ public function render_field_checkbox( $post, $setting ) { $saved = $this->get_value( $post->ID, $setting ); ?>
        >
        get_value( $post->ID, $setting ); ?>

        get_value( $post->ID, $setting ); ?>

        post_type; $post_types = array(); foreach ( $this->metabox as $mb ) { $post_types = array_merge( $post_types, (array) $mb['post_type'] ); } $post_types = array_unique( $post_types ); if ( in_array( $post_type, $post_types, true ) ) { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Enqueue editor style. wp_enqueue_style( 'sinatra-metabox-style', SINATRA_THEME_URI . '/inc/admin/assets/css/sinatra-meta-boxes' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION ); } } } /** * Gets the value of the setting. * * @since 1.0.0 * @param int $post_id Post ID. * @param array $setting Array of setting data. */ public function get_value( $post_id, $setting ) { $value = get_post_meta( $post_id, $setting['id'], true ); return ! $value && $this->is_new_post ? $setting['default'] : $value; } /** * Gets the posted value of the setting. * * @since 1.0.0 * @param array $setting Setting config array. */ public function get_posted_value( $setting ) { $value = ''; if ( isset( $_POST[ $setting['id'] ] ) ) { // phpcs:ignore $value = wp_unslash( $_POST[ $setting['id'] ] ); // phpcs:ignore } return $this->sanitize( $value, $setting ); } /** * Return array of post types for metabox. * * @since 1.0.0 * @param array $args Args for get_post_types function. */ public function get_post_types( $args = false ) { if ( ! $args ) { $args = array( 'public' => true, ); } $return = get_post_types( $args ); return $return; } /** * Sanitizes the value of the setting. * * @since 1.0.0 * @param mixed $value Value of the field to be sanitized. * @param arary $setting Setting config array. */ public function sanitize( $value, $setting ) { $filter = isset( $setting['type'] ) ? $setting['type'] : ''; switch ( $filter ) { case 'select': // Ensure input is a slug. $value = sanitize_key( $value ); // Get list of choices from the setting. $choices = $setting['choices']; // If the input is a valid key, return it; otherwise, return the default. $value = array_key_exists( $value, $choices ) ? $value : $setting['default']; break; case 'checkbox': // Ensure boolean value for $value. $value = (bool) $value; break; case 'text': $value = sanitize_text_field( $value ); break; case 'textarea': $value = wp_kses_post( $value ); break; case 'no_sanitize': default: break; } return $value; } /** * Checks if the control should be allowed at all. * * @since 1.0.0 * @param string $cap Capability. */ public function check_capability( $cap ) { if ( ! current_user_can( $cap ) ) { return false; } return true; } } endif; /** * The function which returns the one Sinatra Meta Boxes instance. * * Use this function like you would a global variable, except without needing * to declare the global. * * @since 1.0.0 * @access public * @return object */ function sinatra_meta_boxes() { return Sinatra_Meta_Boxes::get_instance(); } sinatra_meta_boxes(); breadcrumbs.php000064400000121614151231536700007556 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! function_exists( 'sinatra_breadcrumb_trail' ) ) { /** * Show a breadcrumb. * * @since 1.0.0 * @param array $args Arguments to pass. */ function sinatra_breadcrumb_trail( $args = array() ) { // Check if breadcrumb is turned on from WPSEO option. $breadcrumb_enable = is_callable( 'WPSEO_Options::get' ) ? WPSEO_Options::get( 'breadcrumbs-enable' ) : false; $wpseo_option = get_option( 'wpseo_internallinks' ) ? get_option( 'wpseo_internallinks' ) : $breadcrumb_enable; if ( ! is_array( $wpseo_option ) ) { unset( $wpseo_option ); $wpseo_option = array( 'breadcrumbs-enable' => $breadcrumb_enable, ); } if ( function_exists( 'yoast_breadcrumb' ) && $wpseo_option && true === $wpseo_option['breadcrumbs-enable'] ) { // Yoast breadcrumb. return yoast_breadcrumb(); } elseif ( function_exists( 'seopress_display_breadcrumbs' ) ) { // SEOPress breadcrumb. return seopress_display_breadcrumbs(); } elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) { // Rank Math breadcrumbs. return rank_math_the_breadcrumbs(); } // Sinatra breadcrumb trail. $breadcrumb = apply_filters( 'sinatra_breadcrumb_trail_object', null, $args ); if ( ! is_object( $breadcrumb ) ) { $breadcrumb = new Sinatra_Breadcrumb_Trail( $args ); } return $breadcrumb->trail(); } /** * Before HTML for SEOPress breadcrumbs. * * @since 1.0.0 */ function sinatra_seopress_breadcrumbs_before_html() { echo '
        '; } add_action( 'seopress_breadcrumbs_before_html', 'sinatra_seopress_breadcrumbs_before_html' ); /** * After HTML for SEOPress breadcrumbs. * * @since 1.0.0 */ function sinatra_seopress_breadcrumbs_after_html() { echo '
        '; } add_action( 'seopress_breadcrumbs_after_html', 'sinatra_seopress_breadcrumbs_after_html' ); /** * Overwrite the items for the breadcrumb trail. * * @since 1.0.0 * * @param array $items Array of items belonging to the current breadcrumb trail. * @param array $args Arguments used to build the breadcrumb trail. */ function sinatra_breadcrumb_trail_items( $items, $args ) { // Add link to the Blog page. if ( is_single() ) { $page_for_posts = get_option( 'page_for_posts' ); $front_page = get_option( 'page_on_front' ); if ( $page_for_posts && $front_page ) { $posts_page_url = sprintf( '%s', esc_url( get_permalink( $page_for_posts ) ), esc_html( get_the_title( $page_for_posts ) ) ); array_splice( $items, 1, 0, $posts_page_url ); } } return $items; } add_filter( 'sinatra_breadcrumb_trail_items', 'sinatra_breadcrumb_trail_items', 10, 2 ); } /** * Creates a breadcrumbs menu for the site based on the current page that's being viewed by the user. * * @since 1.0.0 * @access public */ class Sinatra_Breadcrumb_Trail { /** * Array of items belonging to the current breadcrumb trail. * * @since 0.1.0 * @access public * @var array */ public $items = array(); /** * Arguments used to build the breadcrumb trail. * * @since 0.1.0 * @access public * @var array */ public $args = array(); /** * Array of text labels. * * @since 1.0.0 * @access public * @var array */ public $labels = array(); /** * Array of post types (key) and taxonomies (value) to use for single post views. * * @since 1.0.0 * @access public * @var array */ public $post_taxonomy = array(); /* ====== Magic Methods ====== */ /** * Magic method to use in case someone tries to output the layout object as a string. * We'll just return the trail HTML. * * @since 1.0.0 * @access public * @return string */ public function __toString() { return $this->trail(); } /** * Sets up the breadcrumb trail properties. Calls the `Breadcrumb_Trail::add_items()` method * to creat the array of breadcrumb items. * * @since 0.6.0 * @access public * @param array $args Optional. * @type string $container Container HTML element. nav|div. * @type string $before String to output before breadcrumb menu. * @type string $after String to output after breadcrumb menu. * @type string $browse_tag The HTML tag to use to wrap the "Browse" header text. * @type string $list_tag The HTML tag to use for the list wrapper. * @type string $item_tag The HTML tag to use for the item wrapper. * @type bool $show_on_front Whether to show when `is_front_page()`. * @type bool $network Whether to link to the network main site (multisite only). * @type bool $show_title Whether to show the title (last item) in the trail. * @type bool $show_browse Whether to show the breadcrumb menu header. * @type array $labels Text labels. @see Breadcrumb_Trail::set_labels() * @type array $post_taxonomy Taxonomies to use for post types. @see Breadcrumb_Trail::set_post_taxonomy() * @type bool $echo Whether to print or return the breadcrumbs. * @return void */ public function __construct( $args = array() ) { $defaults = array( 'container' => 'nav', 'before' => '', 'after' => '', 'browse_tag' => 'h2', 'list_tag' => 'ul', 'item_tag' => 'li', 'show_on_front' => true, 'network' => false, 'show_title' => true, 'show_browse' => true, 'labels' => array(), 'post_taxonomy' => array(), 'echo' => true, ); // Parse the arguments with the deaults. $this->args = apply_filters( 'sinatra_breadcrumb_trail_args', wp_parse_args( $args, $defaults ) ); // Set the labels and post taxonomy properties. $this->set_labels(); $this->set_post_taxonomy(); // Let's find some items to add to the trail! $this->add_items(); } /* ====== Public Methods ====== */ /** * Formats the HTML output for the breadcrumb trail. * * @since 0.6.0 * @access public * @return string */ public function trail() { // Set up variables that we'll need. $breadcrumb = ''; $item_count = count( $this->items ); $item_position = 0; // Connect the breadcrumb trail if there are items in the trail. if ( 0 < $item_count ) { // Add 'browse' label if it should be shown. if ( true === $this->args['show_browse'] ) { $breadcrumb .= sprintf( '<%1$s class="trail-browse">%2$s', tag_escape( $this->args['browse_tag'] ), $this->labels['browse'] ); } // Open the unordered list. $breadcrumb .= sprintf( '<%s class="trail-items" itemscope itemtype="http://schema.org/BreadcrumbList">', tag_escape( $this->args['list_tag'] ) ); // Add the number of items and item list order schema. $breadcrumb .= sprintf( '', absint( $item_count ) ); $breadcrumb .= ''; // Loop through the items and add them to the list. foreach ( $this->items as $item ) { // Iterate the item position. ++$item_position; // Check if the item is linked. preg_match( '/()(.*?)(<\/a>)/i', $item, $matches ); // Wrap the item text with appropriate itemprop. $item = ! empty( $matches ) ? sprintf( '%s%s%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '%s', $item ); // Wrap the item with its itemprop. $item = ! empty( $matches ) ? preg_replace( '/(/i', '$1$2 itemprop=$2item$2>', $item ) : sprintf( '%s', $item ); // Add list item classes. $item_class = 'trail-item'; if ( 1 === $item_position && 1 < $item_count ) { $item_class .= ' trail-begin'; } elseif ( $item_count === $item_position ) { $item_class .= ' trail-end'; } // Create list item attributes. $attributes = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="' . $item_class . '"'; // Build the meta position HTML. $meta = sprintf( '', absint( $item_position ) ); // Build the list item. $breadcrumb .= sprintf( '<%1$s %2$s>%3$s%4$s', tag_escape( $this->args['item_tag'] ), $attributes, $item, $meta ); } // Close the unordered list. $breadcrumb .= sprintf( '', tag_escape( $this->args['list_tag'] ) ); // Wrap the breadcrumb trail. $breadcrumb = sprintf( '<%1$s role="navigation" aria-label="%2$s" class="breadcrumb-trail breadcrumbs" itemprop="breadcrumb">%3$s%4$s%5$s', tag_escape( $this->args['container'] ), esc_attr( $this->labels['aria_label'] ), $this->args['before'], $breadcrumb, $this->args['after'] ); } // Allow developers to filter the breadcrumb trail HTML. $breadcrumb = apply_filters( 'sinatra_breadcrumb_trail', $breadcrumb, $this->args ); if ( false === $this->args['echo'] ) { return $breadcrumb; } echo $breadcrumb; // phpcs:ignore } /* ====== Protected Methods ====== */ /** * Sets the labels property. Parses the inputted labels array with the defaults. * * @since 1.0.0 * @access protected * @return void */ protected function set_labels() { $defaults = array( 'browse' => esc_html__( 'Browse:', 'sinatra' ), 'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'sinatra' ), 'home' => esc_html__( 'Home', 'sinatra' ), 'error_404' => esc_html__( '404 Not Found', 'sinatra' ), 'archives' => esc_html__( 'Archives', 'sinatra' ), // Translators: %s is the search query. 'search' => esc_html__( 'Search results for: %s', 'sinatra' ), // Translators: %s is the page number. 'paged' => esc_html__( 'Page %s', 'sinatra' ), // Translators: %s is the page number. 'paged_comments' => esc_html__( 'Comment Page %s', 'sinatra' ), // Translators: Minute archive title. %s is the minute time format. 'archive_minute' => esc_html__( 'Minute %s', 'sinatra' ), // Translators: Weekly archive title. %s is the week date format. 'archive_week' => esc_html__( 'Week %s', 'sinatra' ), // "%s" is replaced with the translated date/time format. 'archive_minute_hour' => '%s', 'archive_hour' => '%s', 'archive_day' => '%s', 'archive_month' => '%s', 'archive_year' => '%s', ); $this->labels = apply_filters( 'sinatra_breadcrumb_trail_labels', wp_parse_args( $this->args['labels'], $defaults ) ); } /** * Sets the `$post_taxonomy` property. This is an array of post types (key) and taxonomies (value). * The taxonomy's terms are shown on the singular post view if set. * * @since 1.0.0 * @access protected * @return void */ protected function set_post_taxonomy() { $defaults = array(); // If post permalink is set to `%postname%`, use the `category` taxonomy. if ( '%postname%' === trim( get_option( 'permalink_structure' ), '/' ) ) { $defaults['post'] = 'category'; } $this->post_taxonomy = apply_filters( 'sinatra_breadcrumb_trail_post_taxonomy', wp_parse_args( $this->args['post_taxonomy'], $defaults ) ); } /** * Runs through the various WordPress conditional tags to check the current page being viewed. Once * a condition is met, a specific method is launched to add items to the `$items` array. * * @since 1.0.0 * @access protected * @return void */ protected function add_items() { if ( is_front_page() ) { $this->add_front_page_items(); } else { // Add the network and site home links. $this->add_network_home_link(); $this->add_site_home_link(); if ( is_home() ) { $this->add_blog_items(); } elseif ( is_singular() ) { $this->add_singular_items(); } elseif ( is_archive() ) { if ( is_post_type_archive() ) { $this->add_post_type_archive_items(); } elseif ( is_category() || is_tag() || is_tax() ) { $this->add_term_archive_items(); } elseif ( is_author() ) { $this->add_user_archive_items(); } elseif ( get_query_var( 'minute' ) && get_query_var( 'hour' ) ) { $this->add_minute_hour_archive_items(); } elseif ( get_query_var( 'minute' ) ) { $this->add_minute_archive_items(); } elseif ( get_query_var( 'hour' ) ) { $this->add_hour_archive_items(); } elseif ( is_day() ) { $this->add_day_archive_items(); } elseif ( get_query_var( 'w' ) ) { $this->add_week_archive_items(); } elseif ( is_month() ) { $this->add_month_archive_items(); } elseif ( is_year() ) { $this->add_year_archive_items(); } else { $this->add_default_archive_items(); } } elseif ( is_search() ) { $this->add_search_items(); } elseif ( is_404() ) { $this->add_404_items(); } } // Add paged items if they exist. $this->add_paged_items(); // Allow developers to overwrite the items for the breadcrumb trail. $this->items = array_unique( apply_filters( 'sinatra_breadcrumb_trail_items', $this->items, $this->args ) ); } /** * Gets front items based on $wp_rewrite->front. * * @since 1.0.0 * @access protected * @return void */ protected function add_rewrite_front_items() { global $wp_rewrite; if ( $wp_rewrite->front ) { $this->add_path_parents( $wp_rewrite->front ); } } /** * Adds the page/paged number to the items array. * * @since 1.0.0 * @access protected * @return void */ protected function add_paged_items() { if ( is_singular() && 1 < get_query_var( 'page' ) && true === $this->args['show_title'] ) { // If viewing a paged singular post. $this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'page' ) ) ) ); } elseif ( is_singular() && get_option( 'page_comments' ) && 1 < get_query_var( 'cpage' ) ) { // If viewing a singular post with paged comments. $this->items[] = sprintf( $this->labels['paged_comments'], number_format_i18n( absint( get_query_var( 'cpage' ) ) ) ); } elseif ( is_paged() && true === $this->args['show_title'] ) { // If viewing a paged archive-type page. $this->items[] = sprintf( $this->labels['paged'], number_format_i18n( absint( get_query_var( 'paged' ) ) ) ); } } /** * Adds the network (all sites) home page link to the items array. * * @since 1.0.0 * @access protected * @return void */ protected function add_network_home_link() { if ( is_multisite() && ! is_main_site() && true === $this->args['network'] ) { $this->items[] = sprintf( '%s', esc_url( network_home_url() ), $this->labels['home'] ); } } /** * Adds the current site's home page link to the items array. * * @since 1.0.0 * @access protected * @return void */ protected function add_site_home_link() { $network = is_multisite() && ! is_main_site() && true === $this->args['network']; $label = $network ? get_bloginfo( 'name' ) : $this->labels['home']; $rel = $network ? '' : ' rel="home"'; $this->items[] = sprintf( '%s', esc_url( user_trailingslashit( home_url() ) ), $rel, $label ); } /** * Adds items for the front page to the items array. * * @since 1.0.0 * @access protected * @return void */ protected function add_front_page_items() { // Only show front items if the 'show_on_front' argument is set to 'true'. if ( true === $this->args['show_on_front'] || is_paged() || ( is_singular() && 1 < get_query_var( 'page' ) ) ) { // Add network home link. $this->add_network_home_link(); if ( is_paged() ) { // If on a paged view, add the site home link. $this->add_site_home_link(); } elseif ( true === $this->args['show_title'] ) { // If on the main front page, add the network home title. $this->items[] = is_multisite() && true === $this->args['network'] ? get_bloginfo( 'name' ) : $this->labels['home']; } } } /** * Adds items for the posts page (i.e., is_home()) to the items array. * * @since 1.0.0 * @access protected * @return void */ protected function add_blog_items() { // Get the post ID and post. $post_id = get_queried_object_id(); $post = get_post( $post_id ); // If the post has parents, add them to the trail. if ( 0 < $post->post_parent ) { $this->add_post_parents( $post->post_parent ); } // Get the page title. $title = get_the_title( $post_id ); // Add the posts page item. if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $title ); } elseif ( $title && true === $this->args['show_title'] ) { $this->items[] = $title; } } /** * Adds singular post items to the items array. * * @since 1.0.0 * @access protected * @return void */ protected function add_singular_items() { // Get the queried post. $post = get_queried_object(); $post_id = get_queried_object_id(); if ( 0 < $post->post_parent ) { // If the post has a parent, follow the parent trail. $this->add_post_parents( $post->post_parent ); } else { // If the post doesn't have a parent, get its hierarchy based off the post type. $this->add_post_hierarchy( $post_id ); } // Display terms for specific post type taxonomy if requested. if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) { $this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] ); } // End with the post title. $post_title = single_post_title( '', false ); if ( $post_title ) { if ( ( 1 < get_query_var( 'page' ) || is_paged() ) || ( get_option( 'page_comments' ) && 1 < absint( get_query_var( 'cpage' ) ) ) ) { $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), $post_title ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = $post_title; } } } /** * Adds the items to the trail items array for taxonomy term archives. * * @since 1.0.0 * @access protected * @global object $wp_rewrite * @return void */ protected function add_term_archive_items() { global $wp_rewrite; // Get some taxonomy and term variables. $term = get_queried_object(); $taxonomy = get_taxonomy( $term->taxonomy ); $done_post_type = false; // If there are rewrite rules for the taxonomy. if ( false !== $taxonomy->rewrite ) { // If 'with_front' is true, dd $wp_rewrite->front to the trail. if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front ) { $this->add_rewrite_front_items(); } // Get parent pages by path if they exist. $this->add_path_parents( $taxonomy->rewrite['slug'] ); // Add post type archive if its 'has_archive' matches the taxonomy rewrite 'slug'. if ( $taxonomy->rewrite['slug'] ) { $slug = trim( $taxonomy->rewrite['slug'], '/' ); // Deals with the situation if the slug has a '/' between multiple // strings. For example, "movies/genres" where "movies" is the post // type archive. $matches = explode( '/', $slug ); // If matches are found for the path. if ( isset( $matches ) ) { // Reverse the array of matches to search for posts in the proper order. $matches = array_reverse( $matches ); // Loop through each of the path matches. foreach ( $matches as $match ) { // Get public post types that match the rewrite slug. $post_types = $this->get_post_types_by_slug( $match ); if ( ! empty( $post_types ) ) { $post_type_object = $post_types[0]; // Add support for a non-standard label of 'archive_title' (special use case). $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; // Core filter hook. $label = apply_filters( 'sinatra_post_type_archive_title', $label, $post_type_object->name ); // Add the post type archive link to the trail. $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label ); $done_post_type = true; // Break out of the loop. break; } } } } } // If there's a single post type for the taxonomy, use it. if ( false === $done_post_type && 1 === count( $taxonomy->object_type ) && post_type_exists( $taxonomy->object_type[0] ) ) { // If the post type is 'post'. if ( 'post' === $taxonomy->object_type[0] ) { $post_id = get_option( 'page_for_posts' ); if ( 'posts' !== get_option( 'show_on_front' ) && 0 < $post_id ) { $this->items[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) ); } // If the post type is not 'post'. } else { $post_type_object = get_post_type_object( $taxonomy->object_type[0] ); $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; // Core filter hook. $label = apply_filters( 'sinatra_post_type_archive_title', $label, $post_type_object->name ); $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), $label ); } } // If the taxonomy is hierarchical, list its parent terms. if ( is_taxonomy_hierarchical( $term->taxonomy ) && $term->parent ) { $this->add_term_parents( $term->parent, $term->taxonomy ); } // Add the term name to the trail end. if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $term->taxonomy ) ), single_term_title( '', false ) ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = single_term_title( '', false ); } } /** * Adds the items to the trail items array for post type archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_post_type_archive_items() { // Get the post type object. $post_type_object = get_post_type_object( get_query_var( 'post_type' ) ); if ( false !== $post_type_object->rewrite ) { // If 'with_front' is true, add $wp_rewrite->front to the trail. if ( $post_type_object->rewrite['with_front'] ) { $this->add_rewrite_front_items(); } // If there's a rewrite slug, check for parents. if ( ! empty( $post_type_object->rewrite['slug'] ) ) { $this->add_path_parents( $post_type_object->rewrite['slug'] ); } } // Add the post type [plural] name to the trail end. if ( is_paged() || is_author() ) { $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type_object->name ) ), post_type_archive_title( '', false ) ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = post_type_archive_title( '', false ); } // If viewing a post type archive by author. if ( is_author() ) { $this->add_user_archive_items(); } } /** * Adds the items to the trail items array for user (author) archives. * * @since 1.0.0 * @access protected * @global object $wp_rewrite * @return void */ protected function add_user_archive_items() { global $wp_rewrite; // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Get the user ID. $user_id = get_query_var( 'author' ); // If $author_base exists, check for parent pages. if ( ! empty( $wp_rewrite->author_base ) && ! is_post_type_archive() ) { $this->add_path_parents( $wp_rewrite->author_base ); } // Add the author's display name to the trail end. if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $user_id ) ), get_the_author_meta( 'display_name', $user_id ) ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = get_the_author_meta( 'display_name', $user_id ); } } /** * Adds the items to the trail items array for minute + hour archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_minute_hour_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Add the minute + hour item. if ( true === $this->args['show_title'] ) { $this->items[] = sprintf( $this->labels['archive_minute_hour'], get_the_time( esc_html_x( 'g:i a', 'minute and hour archives time format', 'sinatra' ) ) ); } } /** * Adds the items to the trail items array for minute archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_minute_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Add the minute item. if ( true === $this->args['show_title'] ) { $this->items[] = sprintf( $this->labels['archive_minute'], get_the_time( esc_html_x( 'i', 'minute archives time format', 'sinatra' ) ) ); } } /** * Adds the items to the trail items array for hour archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_hour_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Add the hour item. if ( true === $this->args['show_title'] ) { $this->items[] = sprintf( $this->labels['archive_hour'], get_the_time( esc_html_x( 'g a', 'hour archives time format', 'sinatra' ) ) ); } } /** * Adds the items to the trail items array for day archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_day_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Get year, month, and day. $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sinatra' ) ) ); $month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'sinatra' ) ) ); $day = sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'sinatra' ) ) ); // Add the year and month items. $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month ); // Add the day item. if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y' ) ), get_the_time( 'm' ), get_the_time( 'd' ) ), $day ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = $day; } } /** * Adds the items to the trail items array for week archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_week_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Get the year and week. $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sinatra' ) ) ); $week = sprintf( $this->labels['archive_week'], get_the_time( esc_html_x( 'W', 'weekly archives date format', 'sinatra' ) ) ); // Add the year item. $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); // Add the week item. if ( is_paged() ) { $this->items[] = esc_url( get_archives_link( add_query_arg( array( 'm' => get_the_time( 'Y' ), 'w' => get_the_time( 'W' ), ), home_url() ), $week, false ) ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = $week; } } /** * Adds the items to the trail items array for month archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_month_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Get the year and month. $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sinatra' ) ) ); $month = sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'sinatra' ) ) ); // Add the year item. $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); // Add the month item. if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ), $month ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = $month; } } /** * Adds the items to the trail items array for year archives. * * @since 1.0.0 * @access protected * @return void */ protected function add_year_archive_items() { // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Get the year. $year = sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sinatra' ) ) ); // Add the year item. if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y' ) ) ), $year ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = $year; } } /** * Adds the items to the trail items array for archives that don't have a more specific method * defined in this class. * * @since 1.0.0 * @access protected * @return void */ protected function add_default_archive_items() { // If this is a date-/time-based archive, add $wp_rewrite->front to the trail. if ( is_date() || is_time() ) { $this->add_rewrite_front_items(); } if ( true === $this->args['show_title'] ) { $this->items[] = $this->labels['archives']; } } /** * Adds the items to the trail items array for search results. * * @since 1.0.0 * @access protected * @return void */ protected function add_search_items() { if ( is_paged() ) { $this->items[] = sprintf( '%s', esc_url( get_search_link() ), sprintf( $this->labels['search'], get_search_query() ) ); } elseif ( true === $this->args['show_title'] ) { $this->items[] = sprintf( $this->labels['search'], get_search_query() ); } } /** * Adds the items to the trail items array for 404 pages. * * @since 1.0.0 * @access protected * @return void */ protected function add_404_items() { if ( true === $this->args['show_title'] ) { $this->items[] = $this->labels['error_404']; } } /** * Adds a specific post's parents to the items array. * * @since 1.0.0 * @access protected * @param int $post_id Post ID. * @return void */ protected function add_post_parents( $post_id ) { $parents = array(); while ( $post_id ) { // Get the post by ID. $post = get_post( $post_id ); // If we hit a page that's set as the front page, bail. if ( 'page' === $post->post_type && 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) === $post_id ) { break; } // Add the formatted post link to the array of parents. $parents[] = sprintf( '%s', esc_url( get_permalink( $post_id ) ), get_the_title( $post_id ) ); // If there's no longer a post parent, break out of the loop. if ( 0 >= $post->post_parent ) { break; } // Change the post ID to the parent post to continue looping. $post_id = $post->post_parent; } // Get the post hierarchy based off the final parent post. $this->add_post_hierarchy( $post_id ); // Display terms for specific post type taxonomy if requested. if ( ! empty( $this->post_taxonomy[ $post->post_type ] ) ) { $this->add_post_terms( $post_id, $this->post_taxonomy[ $post->post_type ] ); } // Merge the parent items into the items array. $this->items = array_merge( $this->items, array_reverse( $parents ) ); } /** * Adds a specific post's hierarchy to the items array. The hierarchy is determined by post type's * rewrite arguments and whether it has an archive page. * * @since 1.0.0 * @access protected * @param int $post_id Post ID. * @return void */ protected function add_post_hierarchy( $post_id ) { // Get the post type. $post_type = get_post_type( $post_id ); $post_type_object = get_post_type_object( $post_type ); if ( 'post' === $post_type ) { // If this is the 'post' post type, get the rewrite front items and map the rewrite tags. // Add $wp_rewrite->front to the trail. $this->add_rewrite_front_items(); // Map the rewrite tags. $this->map_rewrite_tags( $post_id, get_option( 'permalink_structure' ) ); } elseif ( false !== $post_type_object->rewrite ) { // If the post type has rewrite rules. // If 'with_front' is true, add $wp_rewrite->front to the trail. if ( $post_type_object->rewrite['with_front'] ) { $this->add_rewrite_front_items(); } // If there's a path, check for parents. if ( ! empty( $post_type_object->rewrite['slug'] ) ) { $this->add_path_parents( $post_type_object->rewrite['slug'] ); } } // If there's an archive page, add it to the trail. if ( $post_type_object->has_archive ) { // Add support for a non-standard label of 'archive_title' (special use case). $label = ! empty( $post_type_object->labels->archive_title ) ? $post_type_object->labels->archive_title : $post_type_object->labels->name; // Core filter hook. $label = apply_filters( 'sinatra_post_type_archive_title', $label, $post_type_object->name ); $this->items[] = sprintf( '%s', esc_url( get_post_type_archive_link( $post_type ) ), $label ); } // Map the rewrite tags if there's a `%` in the slug. if ( 'post' !== $post_type && ! empty( $post_type_object->rewrite['slug'] ) && false !== strpos( $post_type_object->rewrite['slug'], '%' ) ) { $this->map_rewrite_tags( $post_id, $post_type_object->rewrite['slug'] ); } } /** * Gets post types by slug. This is needed because the get_post_types() function doesn't exactly * match the 'has_archive' argument when it's set as a string instead of a boolean. * * @since 0.6.0 * @access protected * @param int $slug The post type archive slug to search for. * @return array */ protected function get_post_types_by_slug( $slug ) { $return = array(); $post_types = get_post_types( array(), 'objects' ); foreach ( $post_types as $type ) { if ( $slug === $type->has_archive || ( true === $type->has_archive && $slug === $type->rewrite['slug'] ) ) { $return[] = $type; } } return $return; } /** * Adds a post's terms from a specific taxonomy to the items array. * * @since 1.0.0 * @access protected * @param int $post_id The ID of the post to get the terms for. * @param string $taxonomy The taxonomy to get the terms from. * @return void */ protected function add_post_terms( $post_id, $taxonomy ) { // Get the post categories. $terms = get_the_terms( $post_id, $taxonomy ); // Check that categories were returned. if ( $terms && ! is_wp_error( $terms ) ) { // Sort the terms by ID and get the first category. if ( function_exists( 'wp_list_sort' ) ) { $terms = wp_list_sort( $terms, 'term_id' ); } else { usort( $terms, '_usort_terms_by_ID' ); } $term = get_term( $terms[0], $taxonomy ); // If the category has a parent, add the hierarchy to the trail. if ( 0 < $term->parent ) { $this->add_term_parents( $term->parent, $taxonomy ); } // Add the category archive link to the trail. $this->items[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name ); } } /** * Get parent posts by path. Currently, this method only supports getting parents of the 'page' * post type. The goal of this function is to create a clear path back to home given what would * normally be a "ghost" directory. If any page matches the given path, it'll be added. * * @since 1.0.0 * @access protected * @param string $path The path (slug) to search for posts by. * @return void */ protected function add_path_parents( $path ) { // Trim '/' off $path in case we just got a simple '/' instead of a real path. $path = trim( $path, '/' ); // If there's no path, return. if ( empty( $path ) ) { return; } // Get parent post by the path. $post = get_page_by_path( $path ); if ( ! empty( $post ) ) { $this->add_post_parents( $post->ID ); } elseif ( is_null( $post ) ) { // Separate post names into separate paths by '/'. $path = trim( $path, '/' ); preg_match_all( '/\/.*?\z/', $path, $matches ); // If matches are found for the path. if ( isset( $matches ) ) { // Reverse the array of matches to search for posts in the proper order. $matches = array_reverse( $matches ); // Loop through each of the path matches. foreach ( $matches as $match ) { // If a match is found. if ( isset( $match[0] ) ) { // Get the parent post by the given path. $path = str_replace( $match[0], '', $path ); $post = get_page_by_path( trim( $path, '/' ) ); // If a parent post is found, set the $post_id and break out of the loop. if ( ! empty( $post ) && 0 < $post->ID ) { $this->add_post_parents( $post->ID ); break; } } } } } } /** * Searches for term parents of hierarchical taxonomies. This function is similar to the WordPress * function get_category_parents() but handles any type of taxonomy. * * @since 1.0.0 * @param int $term_id ID of the term to get the parents of. * @param string $taxonomy Name of the taxonomy for the given term. * @return void */ protected function add_term_parents( $term_id, $taxonomy ) { // Set up some default arrays. $parents = array(); // While there is a parent ID, add the parent term link to the $parents array. while ( $term_id ) { // Get the parent term. $term = get_term( $term_id, $taxonomy ); // Add the formatted term link to the array of parent terms. $parents[] = sprintf( '%s', esc_url( get_term_link( $term, $taxonomy ) ), $term->name ); // Set the parent term's parent as the parent ID. $term_id = $term->parent; } // If we have parent terms, reverse the array to put them in the proper order for the trail. if ( ! empty( $parents ) ) { $this->items = array_merge( $this->items, array_reverse( $parents ) ); } } /** * Turns %tag% from permalink structures into usable links for the breadcrumb trail. This feels kind of * hackish for now because we're checking for specific %tag% examples and only doing it for the 'post' * post type. In the future, maybe it'll handle a wider variety of possibilities, especially for custom post * types. * * @since 0.6.0 * @access protected * @param int $post_id ID of the post whose parents we want. * @param string $path Path of a potential parent page. * @return void */ protected function map_rewrite_tags( $post_id, $path ) { $post = get_post( $post_id ); // Trim '/' from both sides of the $path. $path = trim( $path, '/' ); // Split the $path into an array of strings. $matches = explode( '/', $path ); // If matches are found for the path. if ( is_array( $matches ) ) { // Loop through each of the matches, adding each to the $trail array. foreach ( $matches as $match ) { // Trim any '/' from the $match. $tag = trim( $match, '/' ); if ( '%year%' === $tag ) { // If using the %year% tag, add a link to the yearly archive. $this->items[] = sprintf( '%s', esc_url( get_year_link( get_the_time( 'Y', $post_id ) ) ), sprintf( $this->labels['archive_year'], get_the_time( esc_html_x( 'Y', 'yearly archives date format', 'sinatra' ) ) ) ); } elseif ( '%monthnum%' === $tag ) { // If using the %monthnum% tag, add a link to the monthly archive. $this->items[] = sprintf( '%s', esc_url( get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) ), sprintf( $this->labels['archive_month'], get_the_time( esc_html_x( 'F', 'monthly archives date format', 'sinatra' ) ) ) ); } elseif ( '%day%' === $tag ) { // If using the %day% tag, add a link to the daily archive. $this->items[] = sprintf( '%s', esc_url( get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) ), sprintf( $this->labels['archive_day'], get_the_time( esc_html_x( 'j', 'daily archives date format', 'sinatra' ) ) ) ); } elseif ( '%author%' === $tag ) { // If using the %author% tag, add a link to the post author archive. $this->items[] = sprintf( '%s', esc_url( get_author_posts_url( $post->post_author ) ), get_the_author_meta( 'display_name', $post->post_author ) ); } elseif ( taxonomy_exists( trim( $tag, '%' ) ) ) { // If using the %category% tag, add a link to the first category archive to match permalinks. // Force override terms in this post type. $this->post_taxonomy[ $post->post_type ] = false; // Add the post categories. $this->add_post_terms( $post_id, trim( $tag, '%' ) ); } } } } } class-sinatra-dynamic-styles.php000064400000220130151231536700012765 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Dynamic_Styles' ) ) : /** * Dynamically generate CSS code. */ class Sinatra_Dynamic_Styles { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * URI for Dynamic CSS file. * * @since 1.0.0 * @var object */ private $dynamic_css_uri; /** * Path for Dynamic CSS file. * * @since 1.0.0 * @var object */ private $dynamic_css_path; /** * Main Sinatra_Dynamic_Styles Instance. * * @since 1.0.0 * @return Sinatra_Dynamic_Styles */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Dynamic_Styles ) ) { self::$instance = new self(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { $upload_dir = wp_upload_dir(); $this->dynamic_css_uri = trailingslashit( set_url_scheme( $upload_dir['baseurl'] ) ) . 'sinatra/'; $this->dynamic_css_path = trailingslashit( set_url_scheme( $upload_dir['basedir'] ) ) . 'sinatra/'; if ( ! is_customize_preview() && wp_is_writable( trailingslashit( $upload_dir['basedir'] ) ) ) { add_action( 'sinatra_enqueue_scripts', array( $this, 'enqueue_dynamic_style' ), 20 ); } else { add_action( 'sinatra_enqueue_scripts', array( $this, 'print_dynamic_style' ), 99 ); } // Include button styles. add_filter( 'sinatra_dynamic_styles', array( $this, 'get_button_styles' ), 6 ); // Remove Customizer Custom CSS from wp_head, we will include it in our dynamic file. if ( ! is_customize_preview() ) { remove_action( 'wp_head', 'wp_custom_css_cb', 101 ); } // Generate new styles on Customizer Save action. add_action( 'customize_save_after', array( $this, 'update_dynamic_file' ) ); // Generate new styles on theme activation. add_action( 'after_switch_theme', array( $this, 'update_dynamic_file' ) ); // Delete the css stye on theme deactivation. add_action( 'switch_theme', array( $this, 'delete_dynamic_file' ) ); // Generate initial dynamic css. add_action( 'init', array( $this, 'init' ) ); } /** * Init. * * @since 1.0.0 */ public function init() { // Ensure we have dynamic stylesheet generated. if ( false === get_transient( 'sinatra_has_dynamic_css' ) ) { $this->update_dynamic_file(); } } /** * Enqueues dynamic styles file. * * @since 1.0.0 */ public function enqueue_dynamic_style() { $exists = file_exists( $this->dynamic_css_path . 'dynamic-styles.css' ); // Generate the file if it's missing. if ( ! $exists ) { $exists = $this->update_dynamic_file(); } // Enqueue the file if available. if ( $exists ) { wp_enqueue_style( 'sinatra-dynamic-styles', $this->dynamic_css_uri . 'dynamic-styles.css', false, filemtime( $this->dynamic_css_path . 'dynamic-styles.css' ), 'all' ); } } /** * Prints inline dynamic styles if writing to file is not possible. * * @since 1.0.0 */ public function print_dynamic_style() { $dynamic_css = $this->get_css(); wp_add_inline_style( 'sinatra-styles', $dynamic_css ); } /** * Generates dynamic CSS code, minifies it and cleans cache. * * @param boolean $custom_css - should we include the wp_get_custom_css. * @return string, minifed code * @since 1.0.0 */ public function get_css( $custom_css = false ) { // Refresh options. sinatra()->options->refresh(); // Delete google fonts enqueue transients. delete_transient( 'sinatra_google_fonts_enqueue' ); // Add our theme custom CSS. $css = ''; // Accent color. $accent_color = sinatra_option( 'accent_color' ); $css .= ' #si-scroll-top:hover::before, .si-btn, input[type=submit], input[type=reset], .comment-form input[type=checkbox]:checked, #comments .bypostauthor-badge, .single .post-tags a:hover, .single .post-category .cat-links a:hover, .tagcloud a:hover, #main .mejs-controls .mejs-time-rail .mejs-time-current, .si-btn.sinatra-read-more::after, .post_format-post-format-quote .si-blog-entry-content .quote-post-bg::after, .si-hover-slider .post-category a, .si-single-title-in-page-header.single .page-header .post-category a, .entry-media > a:hover .entry-media-icon::before, .si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after, .si-pre-footer-cta-style-2 #si-pre-footer::after, .select2-container--default .select2-results__option--highlighted[aria-selected], .si-input-supported input[type=radio]:checked::before, .si-input-supported input[type=checkbox]:checked, .sinatra-sidebar-style-2 #secondary .widget-title::before, .sinatra-sidebar-style-2 .elementor-widget-sidebar .widget-title::before, .widget .cat-item a:hover + span, .widget_archive li a:hover + span, .widget .cat-item.current-cat a + span, #sinatra-footer .widget .cat-item a:hover + span, #sinatra-footer .widget_archive li a:hover + span, #sinatra-footer .widget .cat-item.current-cat a + span, .si-btn.btn-outline:hover, #infinite-handle span { background-color: ' . $accent_color . '; } .si-btn:hover, #infinite-handle span:hover, input[type=submit]:hover, input[type=reset]:hover, input[type=reset]:focus, .si-btn:focus, input[type=submit]:focus, .si-hover-slider .post-category a:hover, .si-single-title-in-page-header.single .page-header .post-category a:hover { background-color: ' . sinatra_luminance( $accent_color, .15 ) . '; } mark, span.highlight, code, kbd, var, samp, tt { background-color: ' . sinatra_hex2rgba( $accent_color, .09 ) . '; } code.block { background-color: ' . sinatra_hex2rgba( $accent_color, .075 ) . '; } .content-area a:not(.si-btn):not(.wp-block-button__link), #secondary .sinatra-core-custom-list-widget .si-entry a:not(.si-btn), #secondary a:not(.si-btn):hover, .si-header-widgets .si-header-widget.sinatra-active .si-icon.si-search, .sinatra-logo .site-title a:hover, #sinatra-header-inner .sinatra-nav > ul > li > a:hover, #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a, #sinatra-topbar .sinatra-nav > ul > li > a:hover, #sinatra-topbar .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-item > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-ancestor > a, .si-topbar-widget__text a:hover, .si-topbar-widget__text a, .sinatra-social-nav > ul > li > a .si-icon.bottom-icon, .si-header-widgets a:not(.si-btn):hover, #sinatra-header-inner .si-header-widgets .sinatra-active, .sinatra-pagination .navigation .nav-links .page-numbers:hover, .widget .cat-item.current-cat > a, .widget ul li.current_page_item > a, #main .search-form .search-submit:hover, #colophon .search-form .search-submit:hover, #cancel-comment-reply-link:hover, .comment-form .required, .navigation .nav-links .page-numbers:hover, #main .entry-meta a:hover, #main .author-box-title a:hover, .single .post-category a, .page-links span:hover, .site-content .page-links span:hover, .navigation .nav-links .page-numbers.current, .page-links > span, .site-content .page-links > span, .si-btn.btn-outline, code, kbd, var, samp, tt, .is-mobile-menu-active .si-hamburger, .si-hamburger:hover, .single #main .post-nav a:hover, #sinatra-topbar .si-topbar-widget__text .si-icon { color: ' . $accent_color . '; } #page ::-moz-selection { background-color: ' . $accent_color . '; color: #FFF; } #page ::selection { background-color: ' . $accent_color . '; color: #FFF; } #comments .comment-actions .reply a:hover, .comment-form input[type=checkbox]:checked, .comment-form input[type=checkbox]:focus, .comment-form input[type=radio]:checked, .comment-form input[type=radio]:focus, .single .post-category a, #colophon, #secondary .widget-title, .elementor-widget-sidebar .widget-title, .si-hover-slider .post-category a, .si-single-title-in-page-header.single .page-header .post-category a, .si-entry blockquote, .wp-block-quote.is-style-large, .wp-block-quote.is-large, .wp-block-quote.has-text-align-right, .navigation .nav-links .page-numbers.current, .page-links > span, .site-content .page-links > span, .si-input-supported input[type=radio]:checked, .si-input-supported input[type=checkbox]:checked, .si-btn.btn-outline { border-color: ' . $accent_color . '; } #masthead .si-header-widgets .dropdown-item::after, .sinatra-nav > ul .sub-menu::after, textarea:focus, input[type="text"]:focus, input[type="email"]:focus, input[type=password]:focus, input[type=tel]:focus, input[type=url]:focus, input[type=search]:focus, input[type=date]:focus { border-bottom-color: ' . $accent_color . '; outline: none !important; } .si-header-widgets .dropdown-item, .preloader-1 > div, .sinatra-nav .sub-menu { border-top-color: ' . $accent_color . '; } .sinatra-animate-arrow:hover .arrow-handle, .sinatra-animate-arrow:hover .arrow-bar, .sinatra-animate-arrow:focus .arrow-handle, .sinatra-animate-arrow:focus .arrow-bar, .sinatra-pagination .navigation .nav-links .page-numbers.next:hover .sinatra-animate-arrow .arrow-handle, .sinatra-pagination .navigation .nav-links .page-numbers.prev:hover .sinatra-animate-arrow .arrow-handle, .sinatra-pagination .navigation .nav-links .page-numbers.next:hover .sinatra-animate-arrow .arrow-bar, .sinatra-pagination .navigation .nav-links .page-numbers.prev:hover .sinatra-animate-arrow .arrow-bar { fill: ' . $accent_color . '; } .si-input-supported input[type=checkbox]:focus:hover { box-shadow: inset 0 0 0 2px ' . $accent_color . '; } '; $header_layout_3_additional_css = ''; if ( 'layout-3' === sinatra_option( 'header_layout' ) || is_customize_preview() ) { $header_layout_3_additional_css = ' .sinatra-header-layout-3 .si-logo-container > .si-container { flex-wrap: wrap; } .sinatra-header-layout-3 .si-logo-container .sinatra-logo > .logo-inner { align-items: flex-start; } .sinatra-header-layout-3 .si-logo-container .sinatra-logo { order: 0; align-items: flex-start; flex-basis: auto; margin-left: 0; } .sinatra-header-layout-3 .si-logo-container .si-header-element { flex-basis: auto; } .sinatra-header-layout-3 .si-logo-container .si-mobile-nav { order: 5; } '; } /** * Top Bar. */ // Background. $css .= $this->get_design_options_field_css( '#sinatra-topbar', 'top_bar_background', 'background' ); // Border. $css .= $this->get_design_options_field_css( '#sinatra-topbar', 'top_bar_border', 'border' ); $css .= $this->get_design_options_field_css( '.si-topbar-widget', 'top_bar_border', 'separator_color' ); // Top Bar colors. $topbar_color = sinatra_option( 'top_bar_text_color' ); // Top Bar text color. if ( isset( $topbar_color['text-color'] ) && $topbar_color['text-color'] ) { $css .= '#sinatra-topbar { color: ' . $topbar_color['text-color'] . '; }'; } // Top Bar link color. if ( isset( $topbar_color['link-color'] ) && $topbar_color['link-color'] ) { $css .= ' .si-topbar-widget__text a, .si-topbar-widget .sinatra-nav > ul > li > a, .si-topbar-widget__socials .sinatra-social-nav > ul > li > a, #sinatra-topbar .si-topbar-widget__text .si-icon { color: ' . $topbar_color['link-color'] . '; } '; } // Top Bar link hover color. if ( isset( $topbar_color['link-hover-color'] ) && $topbar_color['link-hover-color'] ) { $css .= ' #sinatra-topbar .sinatra-nav > ul > li > a:hover, #sinatra-topbar .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-item > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-topbar .si-topbar-widget__text a:hover, #sinatra-topbar .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: ' . $topbar_color['link-hover-color'] . '; } '; } /** * Header. */ // Background. $css .= $this->get_design_options_field_css( '#sinatra-header-inner', 'header_background', 'background' ); // Font colors. $header_color = sinatra_option( 'header_text_color' ); // Header text color. if ( isset( $header_color['text-color'] ) && $header_color['text-color'] ) { $css .= '.sinatra-logo .site-description { color: ' . $header_color['text-color'] . '; }'; } // Header link color. if ( isset( $header_color['link-color'] ) && $header_color['link-color'] ) { $css .= ' #sinatra-header, .si-header-widgets a:not(.si-btn), .sinatra-logo a, .si-hamburger { color: ' . $header_color['link-color'] . '; } '; } // Header link hover color. if ( isset( $header_color['link-hover-color'] ) && $header_color['link-hover-color'] ) { $css .= ' .si-header-widgets a:not(.si-btn):hover, #sinatra-header-inner .si-header-widgets .sinatra-active, .sinatra-logo .site-title a:hover, .si-hamburger:hover, .is-mobile-menu-active .si-hamburger, #sinatra-header-inner .sinatra-nav > ul > li > a:hover, #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: ' . $header_color['link-hover-color'] . '; } '; } // Header border. $css .= $this->get_design_options_field_css( '#sinatra-header-inner', 'header_border', 'border' ); // Header separator color. $css .= $this->get_design_options_field_css( '.si-header-widget', 'header_border', 'separator_color' ); // Main navigation breakpoint. $css .= ' @media screen and (max-width: ' . intval( sinatra_option( 'main_nav_mobile_breakpoint' ) ) . 'px) { #sinatra-header-inner .sinatra-nav { display: none; color: #000; } .si-mobile-nav { display: inline-flex; } #sinatra-header-inner { position: relative; } #sinatra-header-inner .sinatra-nav > ul > li > a { color: inherit; } #sinatra-header-inner .si-nav-container { position: static; border: none; } #sinatra-header-inner .site-navigation { display: none; position: absolute; top: 100%; width: 100%; left: 0; right: 0; margin: -1px 0 0; background: #FFF; border-top: 1px solid #eaeaea; box-shadow: 0 15px 25px -10px rgba(50, 52, 54, 0.125); z-index: 999; font-size: 1rem; padding: 0; } #sinatra-header-inner .site-navigation > ul { max-height: initial; display: block; } #sinatra-header-inner .site-navigation > ul > li > a { padding: 0 !important; } #sinatra-header-inner .site-navigation > ul li { display: block; width: 100%; padding: 0; margin: 0; margin-left: 0 !important; } #sinatra-header-inner .site-navigation > ul .sub-menu { position: static; display: none; border: none; box-shadow: none; border: 0; opacity: 1; visibility: visible; font-size: rem(14px); transform: none; background: #f8f8f8; pointer-events: all; min-width: initial; left: 0; padding: 0; margin: 0; border-radius: 0; line-height: inherit; } #sinatra-header-inner .site-navigation > ul .sub-menu > li > a > span { padding-left: 50px !important; } #sinatra-header-inner .site-navigation > ul .sub-menu .sub-menu > li > a > span { padding-left: 70px !important; } #sinatra-header-inner .site-navigation > ul .sub-menu a > span { padding: 10px 30px 10px 50px; } #sinatra-header-inner .site-navigation > ul a { padding: 0; position: relative; border-bottom: 1px solid #eaeaea; background: none; } #sinatra-header-inner .site-navigation > ul a > span { padding: 10px 30px !important; width: 100%; display: block; } #sinatra-header-inner .site-navigation > ul a > span::after, #sinatra-header-inner .site-navigation > ul a > span::before { display: none !important; } #sinatra-header-inner .site-navigation > ul a > span.description { display: none; } #sinatra-header-inner .site-navigation > ul .menu-item-has-children > a > span { max-width: calc(100% - 50px); } #sinatra-header-inner .site-navigation > ul .menu-item-has-children > a::after { font-family: "sinatra" !important; content: "\e92e" !important; position: absolute !important; top: 0 !important; bottom: 0; right: 0; border-left: 1px solid rgba(0,0,0,.09); display: flex; align-items: center; justify-content: center; width: 50px; margin: 0 !important; font-size: 1em; transform: none !important; } #sinatra-header-inner .site-navigation > ul .menu-item-has-children.si-open > a::after { content: "\e931" !important; } .sinatra-header-layout-3 .sinatra-widget-location-left .dropdown-item { left: auto; right: -7px; } .sinatra-header-layout-3 .sinatra-widget-location-left .dropdown-item::after { left: auto; right: 8px; } .sinatra-nav .sub-menu li.current-menu-item > a { font-weight: bold; } ' . $header_layout_3_additional_css . ' } '; /** * Main Navigation. */ // Font Color. $main_nav_font_color = sinatra_option( 'main_nav_font_color' ); if ( $main_nav_font_color['link-color'] ) { $css .= '#sinatra-header-inner .sinatra-nav > ul > li > a { color: ' . $main_nav_font_color['link-color'] . '; }'; } if ( $main_nav_font_color['link-hover-color'] ) { $css .= ' #sinatra-header-inner .sinatra-nav > ul > li > a:hover, #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: ' . $main_nav_font_color['link-hover-color'] . '; } '; } if ( 'layout-3' === sinatra_option( 'header_layout' ) ) { // Background. $css .= $this->get_design_options_field_css( '.sinatra-header-layout-3 .si-nav-container', 'main_nav_background', 'background' ); // Border. $css .= $this->get_design_options_field_css( '.sinatra-header-layout-3 .si-nav-container', 'main_nav_border', 'border' ); } // Font size. $css .= $this->get_range_field_css( '.sinatra-nav.si-header-element, .sinatra-header-layout-1 .si-header-widgets, .sinatra-header-layout-2 .si-header-widgets', 'font-size', 'main_nav_font_size', false ); /** * Hero Section. */ if ( sinatra_option( 'enable_hero' ) ) { // Hero height. $css .= '#hero .si-hover-slider .hover-slide-item { height: ' . sinatra_option( 'hero_hover_slider_height' ) . 'px; }'; } /** * Pre Footer. */ if ( sinatra_option( 'enable_pre_footer_cta' ) ) { // Call to Action. if ( sinatra_option( 'enable_pre_footer_cta' ) ) { $cta_style = absint( sinatra_option( 'pre_footer_cta_style' ) ); // Background. $cta_background = sinatra_option( 'pre_footer_cta_background' ); if ( 1 === $cta_style || is_customize_preview() ) { $css .= $this->get_design_options_field_css( '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after', 'pre_footer_cta_background', 'background' ); } if ( 2 === $cta_style || is_customize_preview() ) { $css .= $this->get_design_options_field_css( '.si-pre-footer-cta-style-2 #si-pre-footer::after', 'pre_footer_cta_background', 'background' ); } if ( 'image' === $cta_background['background-type'] && isset( $cta_background['background-color-overlay'] ) && $cta_background['background-color-overlay'] ) { $css .= ' .si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before, .si-pre-footer-cta-style-2 #si-pre-footer::before { background-color: ' . $cta_background['background-color-overlay'] . '; } '; } // Text color. $css .= $this->get_design_options_field_css( '#si-pre-footer .h2, #si-pre-footer .h3, #si-pre-footer .h4', 'pre_footer_cta_text_color', 'color' ); // Border. if ( 1 === $cta_style || is_customize_preview() ) { $css .= $this->get_design_options_field_css( '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before', 'pre_footer_cta_border', 'border' ); } if ( 2 === $cta_style || is_customize_preview() ) { $css .= $this->get_design_options_field_css( '.si-pre-footer-cta-style-2 #si-pre-footer::before', 'pre_footer_cta_border', 'border' ); } // Font size. $css .= $this->get_range_field_css( '#si-pre-footer .h3', 'font-size', 'pre_footer_cta_font_size', true ); } } // Footer Background. if ( sinatra_option( 'enable_footer' ) || sinatra_option( 'enable_copyright' ) ) { // Background. $css .= $this->get_design_options_field_css( '#colophon', 'footer_background', 'background' ); // Footer font color. $footer_font_color = sinatra_option( 'footer_text_color' ); // Footer text color. if ( isset( $footer_font_color['text-color'] ) && $footer_font_color['text-color'] ) { $css .= ' #colophon { color: ' . $footer_font_color['text-color'] . '; } '; } // Footer link color. if ( isset( $footer_font_color['link-color'] ) && $footer_font_color['link-color'] ) { $css .= ' #colophon a { color: ' . $footer_font_color['link-color'] . '; } '; } // Footer link hover color. if ( isset( $footer_font_color['link-hover-color'] ) && $footer_font_color['link-hover-color'] ) { $css .= ' #colophon a:hover, #colophon li.current_page_item > a, #colophon .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: ' . $footer_font_color['link-hover-color'] . '; } '; } // Footer widget title. if ( isset( $footer_font_color['widget-title-color'] ) && $footer_font_color['widget-title-color'] ) { $css .= ' #colophon .widget-title { color: ' . $footer_font_color['widget-title-color'] . '; } '; } } // Main Footer border. if ( sinatra_option( 'enable_footer' ) ) { // Border. $footer_border = sinatra_option( 'footer_border' ); if ( $footer_border['border-top-width'] ) { $css .= ' #colophon { border-top-width: ' . $footer_border['border-top-width'] . 'px; border-top-style: ' . $footer_border['border-style'] . '; border-top-color: ' . $footer_border['border-color'] . '; } '; } if ( $footer_border['border-bottom-width'] ) { $css .= ' #colophon { border-bottom-width: ' . $footer_border['border-bottom-width'] . 'px; border-bottom-style: ' . $footer_border['border-style'] . '; border-bottom-color: ' . $footer_border['border-color'] . '; } '; } } // Sidebar. $css .= ' #secondary { width: ' . intval( sinatra_option( 'sidebar_width' ) ) . '%; } body:not(.sinatra-no-sidebar) #primary { max-width: ' . intval( 100 - intval( sinatra_option( 'sidebar_width' ) ) ) . '%; } '; // Content background. $boxed_content_background_color = sinatra_option( 'boxed_content_background_color' ); // Boxed Separated Layout specific CSS. $css .= ' .sinatra-layout__boxed-separated.author .author-box, .sinatra-layout__boxed-separated #content, .sinatra-layout__boxed-separated.sinatra-sidebar-style-3 #secondary .si-widget, .sinatra-layout__boxed-separated.sinatra-sidebar-style-3 .elementor-widget-sidebar .si-widget, .sinatra-layout__boxed-separated.blog .sinatra-article, .sinatra-layout__boxed-separated.search-results .sinatra-article, .sinatra-layout__boxed-separated.category .sinatra-article { background-color: ' . $boxed_content_background_color . '; } @media screen and (max-width: 960px) { .sinatra-layout__boxed-separated #page { background-color: ' . $boxed_content_background_color . '; } } '; $css .= ' .sinatra-layout__boxed #page { background-color: ' . $boxed_content_background_color . '; } '; // Content text color. $content_text_color = sinatra_option( 'content_text_color' ); $css .= ' body { color: ' . $content_text_color . '; } .comment-form .comment-notes, #comments .no-comments, #page .wp-caption .wp-caption-text, #comments .comment-meta, .comments-closed, .entry-meta, .si-entry cite, legend, .si-page-header-description, .page-links em, .site-content .page-links em, .single .entry-footer .last-updated, .single .post-nav .post-nav-title, #main .widget_recent_comments span, #main .widget_recent_entries span, #main .widget_calendar table > caption, .post-thumb-caption, .wp-block-image figcaption, .wp-block-embed figcaption { color: ' . sinatra_hex2rgba( $content_text_color, 0.73 ) . '; } .navigation .nav-links .page-numbers svg { fill: ' . sinatra_hex2rgba( $content_text_color, 0.73 ) . '; } '; // Lightened or darkened background color for backgrounds, borders & inputs. $background_color = sinatra_get_background_color(); $content_text_color_offset = sinatra_light_or_dark( $background_color, sinatra_luminance( $background_color, -0.045 ), sinatra_luminance( $background_color, 0.2 ) ); // Only add for dark background color. if ( ! sinatra_is_light_color( $background_color ) ) { $css .= ' #content textarea, #content input[type="text"], #content input[type="number"], #content input[type="email"], #content input[type=password], #content input[type=tel], #content input[type=url], #content input[type=search], #content input[type=date] { background-color: ' . $background_color . '; } '; // Offset border color. $css .= ' .sinatra-sidebar-style-3 #secondary .si-widget { border-color: ' . $content_text_color_offset . '; } '; // Offset background color. $css .= ' .entry-meta .entry-meta-elements > span:before { background-color: ' . $content_text_color_offset . '; } '; } // Content link hover color. $css .= ' .content-area a:not(.si-btn):not(.wp-block-button__link):hover, #secondary .sinatra-core-custom-list-widget .si-entry a:not(.si-btn):hover, .si-breadcrumbs a:hover { color: ' . sinatra_option( 'content_link_hover_color' ) . '; } '; // Headings Color. $css .= ' h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .sinatra-logo .site-title, .error-404 .page-header h1 { color: ' . sinatra_option( 'headings_color' ) . '; } '; // Container width. $css .= ' .si-container, .alignfull.si-wrap-content > div { max-width: ' . sinatra_option( 'container_width' ) . 'px; } .sinatra-layout__boxed #page, .sinatra-layout__boxed.si-sticky-header.sinatra-is-mobile #sinatra-header-inner, .sinatra-layout__boxed.si-sticky-header:not(.sinatra-header-layout-3) #sinatra-header-inner, .sinatra-layout__boxed.si-sticky-header:not(.sinatra-is-mobile).sinatra-header-layout-3 #sinatra-header-inner .si-nav-container > .si-container { max-width: ' . ( intval( sinatra_option( 'container_width' ) ) + 100 ) . 'px; } '; // Adjust fullwidth sections for boxed layouts. if ( 'boxed' === sinatra_option( 'site_layout' ) || is_customize_preview() ) { $css .= ' @media screen and (max-width: ' . intval( sinatra_option( 'container_width' ) ) . 'px) { body.sinatra-layout__boxed.sinatra-no-sidebar .elementor-section.elementor-section-stretched, body.sinatra-layout__boxed.sinatra-no-sidebar .si-fw-section, body.sinatra-layout__boxed.sinatra-no-sidebar .entry-content .alignfull { margin-left: -50px !important; margin-right: -50px !important; } } '; } // Logo max height. $css .= $this->get_range_field_css( '.sinatra-logo img', 'max-height', 'logo_max_height' ); $css .= $this->get_range_field_css( '.sinatra-logo img.si-svg-logo', 'height', 'logo_max_height' ); // Logo margin. $css .= $this->get_spacing_field_css( '.sinatra-logo .logo-inner', 'margin', 'logo_margin' ); /** * Transparent header. */ // Logo max height. $css .= $this->get_range_field_css( '.si-tsp-header .sinatra-logo img', 'max-height', 'tsp_logo_max_height' ); $css .= $this->get_range_field_css( '.si-tsp-header .sinatra-logo img.si-svg-logo', 'height', 'tsp_logo_max_height' ); // Logo margin. $css .= $this->get_spacing_field_css( '.si-tsp-header .sinatra-logo .logo-inner', 'margin', 'tsp_logo_margin' ); // Main Header custom background. $css .= $this->get_design_options_field_css( '.si-tsp-header #sinatra-header-inner', 'tsp_header_background', 'background' ); /** Font Colors */ $tsp_font_color = sinatra_option( 'tsp_header_font_color' ); // Header text color. if ( isset( $tsp_font_color['text-color'] ) && $tsp_font_color['text-color'] ) { $css .= ' .si-tsp-header .sinatra-logo .site-description { color: ' . $tsp_font_color['text-color'] . '; } '; } // Header link color. if ( isset( $tsp_font_color['link-color'] ) && $tsp_font_color['link-color'] ) { $css .= ' .si-tsp-header #sinatra-header, .si-tsp-header .si-header-widgets a:not(.si-btn), .si-tsp-header .sinatra-logo a, .si-tsp-header .si-hamburger, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li > a { color: ' . $tsp_font_color['link-color'] . '; } '; } // Header link hover color. if ( isset( $tsp_font_color['link-hover-color'] ) && $tsp_font_color['link-hover-color'] ) { $css .= ' .si-tsp-header .si-header-widgets a:not(.si-btn):hover, .si-tsp-header #sinatra-header-inner .si-header-widgets .sinatra-active, .si-tsp-header .sinatra-logo .site-title a:hover, .si-tsp-header .si-hamburger:hover, .is-mobile-menu-active .si-tsp-header .si-hamburger, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li > a:hover, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: ' . $tsp_font_color['link-hover-color'] . '; } '; } /** Border Color */ $css .= $this->get_design_options_field_css( '.si-tsp-header #sinatra-header-inner', 'tsp_header_border', 'border' ); /** Separator Color */ $css .= $this->get_design_options_field_css( '.si-tsp-header .si-header-widget', 'tsp_header_border', 'separator_color' ); /** * Page Header. */ if ( sinatra_option( 'page_header_enable' ) ) { // Font size. $css .= $this->get_range_field_css( '#page .page-header .page-title', 'font-size', 'page_header_font_size', true ); // Page Title spacing. $css .= $this->get_spacing_field_css( '.si-page-title-align-left .page-header.si-has-page-title, .si-page-title-align-right .page-header.si-has-page-title, .si-page-title-align-center .page-header .si-page-header-wrapper', 'padding', 'page_header_spacing' ); // Page Header background. $css .= $this->get_design_options_field_css( '.si-tsp-header:not(.si-tsp-absolute) #masthead', 'page_header_background', 'background' ); $css .= $this->get_design_options_field_css( '.page-header', 'page_header_background', 'background' ); // Page Header font color. $page_header_color = sinatra_option( 'page_header_text_color' ); // Page Header text color. if ( isset( $page_header_color['text-color'] ) && $page_header_color['text-color'] ) { $css .= ' .page-header .page-title { color: ' . $page_header_color['text-color'] . '; } .page-header .si-page-header-description { color: ' . sinatra_hex2rgba( $page_header_color['text-color'], 0.75 ) . '; } '; } // Page Header link color. if ( isset( $page_header_color['link-color'] ) && $page_header_color['link-color'] ) { $css .= ' .page-header .si-breadcrumbs a { color: ' . $page_header_color['link-color'] . '; } .page-header .si-breadcrumbs span, .page-header .breadcrumb-trail .trail-items li::after, .page-header .si-breadcrumbs .separator { color: ' . sinatra_hex2rgba( $page_header_color['link-color'], 0.75 ) . '; } '; } // Page Header link hover color. if ( isset( $page_header_color['link-hover-color'] ) && $page_header_color['link-hover-color'] ) { $css .= ' .page-header .si-breadcrumbs a:hover { color: ' . $page_header_color['link-hover-color'] . '; } '; } // Page Header border color. $page_header_border = sinatra_option( 'page_header_border' ); $css .= $this->get_design_options_field_css( '.page-header', 'page_header_border', 'border' ); } /** * Breadcrumbs. */ if ( sinatra_option( 'breadcrumbs_enable' ) ) { // Spacing. $css .= $this->get_spacing_field_css( '.si-breadcrumbs', 'padding', 'breadcrumbs_spacing' ); if ( 'below-header' === sinatra_option( 'breadcrumbs_position' ) ) { // Background. $css .= $this->get_design_options_field_css( '.si-breadcrumbs', 'breadcrumbs_background', 'background' ); // Border. $css .= $this->get_design_options_field_css( '.si-breadcrumbs', 'breadcrumbs_border', 'border' ); // Text Color. $css .= $this->get_design_options_field_css( '.si-breadcrumbs', 'breadcrumbs_text_color', 'color' ); } } /** * Copyright Bar. */ if ( sinatra_option( 'enable_copyright' ) ) { $css .= $this->get_design_options_field_css( '#sinatra-copyright', 'copyright_background', 'background' ); // Copyright font color. $copyright_color = sinatra_option( 'copyright_text_color' ); // Copyright text color. if ( isset( $copyright_color['text-color'] ) && $copyright_color['text-color'] ) { $css .= ' #sinatra-copyright { color: ' . $copyright_color['text-color'] . '; } '; } // Copyright link color. if ( isset( $copyright_color['link-color'] ) && $copyright_color['link-color'] ) { $css .= ' #sinatra-copyright a { color: ' . $copyright_color['link-color'] . '; } '; } // Copyright link hover color. if ( isset( $copyright_color['link-hover-color'] ) && $copyright_color['link-hover-color'] ) { $css .= ' #sinatra-copyright a:hover, #sinatra-copyright .sinatra-social-nav > ul > li > a .si-icon.bottom-icon, #sinatra-copyright .sinatra-nav > ul > li.current-menu-item > a, #sinatra-copyright .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-copyright .sinatra-nav > ul > li:hover > a { color: ' . $copyright_color['link-hover-color'] . '; } '; } // Copyright separator color. $footer_text_color = sinatra_option( 'footer_text_color' ); $footer_text_color = $footer_text_color['text-color']; $copyright_separator_color = sinatra_light_or_dark( $footer_text_color, 'rgba(255,255,255,0.1)', 'rgba(0,0,0,0.1)' ); $css .= ' #sinatra-copyright.contained-separator > .si-container::before { background-color: ' . $copyright_separator_color . '; } #sinatra-copyright.fw-separator { border-top-color: ' . $copyright_separator_color . '; } '; } /** * Typography. */ // Base HTML font size. $css .= $this->get_range_field_css( 'html', 'font-size', 'html_base_font_size', true, 'px' ); // Font smoothing. if ( sinatra_option( 'font_smoothing' ) ) { $css .= ' * { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } '; } // Body. $css .= $this->get_typography_field_css( 'body', 'body_font' ); // Headings. $css .= $this->get_typography_field_css( 'h1, .h1, .sinatra-logo .site-title, .page-header .page-title, h2, .h2, h3, .h3, h4, h5, h6', 'headings_font' ); $css .= $this->get_typography_field_css( 'h1, .h1, .sinatra-logo .site-title, .page-header .page-title', 'h1_font' ); $css .= $this->get_typography_field_css( 'h2, .h2', 'h2_font' ); $css .= $this->get_typography_field_css( 'h3, .h3', 'h3_font' ); $css .= $this->get_typography_field_css( 'h4', 'h4_font' ); $css .= $this->get_typography_field_css( 'h5', 'h5_font' ); $css .= $this->get_typography_field_css( 'h6', 'h6_font' ); $css .= $this->get_typography_field_css( 'h1 em, h2 em, h3 em, h4 em, h5 em, h6 em, .h1 em, .h2 em, .h3 em, .sinatra-logo .site-title em, .error-404 .page-header h1 em', 'heading_em_font' ); // Emphasized Heading. $css .= $this->get_typography_field_css( 'h1 em, h2 em, h3 em, h4 em, h5 em, h6 em, .h1 em, .h2 em, .h3 em, .sinatra-logo .site-title em, .error-404 .page-header h1 em', 'heading_em_font' ); // Site Title font size. $css .= $this->get_range_field_css( '#sinatra-header .sinatra-logo .site-title', 'font-size', 'logo_text_font_size', true ); // Sidebar widget title. $css .= $this->get_range_field_css( '#main .widget-title', 'font-size', 'sidebar_widget_title_font_size', true ); // Footer widget title. $css .= $this->get_range_field_css( '#colophon .widget-title', 'font-size', 'footer_widget_title_font_size', true ); // Blog Single Post - Title Spacing. $css .= $this->get_spacing_field_css( '.si-single-title-in-page-header #page .page-header .si-page-header-wrapper', 'padding', 'single_title_spacing', true ); // Blog Single Post - Content Font Size. $css .= $this->get_range_field_css( '.single-post .entry-content', 'font-size', 'single_content_font_size', true ); // Blog Single Post - narrow container. if ( 'narrow' === sinatra_option( 'single_content_width' ) ) { $css .= ' .single-post.narrow-content .entry-content > :not([class*="align"]):not([class*="gallery"]):not(.wp-block-image):not(.quote-inner):not(.quote-post-bg), .single-post.narrow-content .mce-content-body:not([class*="page-template-full-width"]) > :not([class*="align"]):not([data-wpview-type*="gallery"]):not(blockquote):not(.mceTemp), .single-post.narrow-content .entry-footer, .single-post.narrow-content .entry-content > .alignwide, .single-post.narrow-content p.has-background:not(.alignfull):not(.alignwide), .single-post.narrow-content .post-nav, .single-post.narrow-content #sinatra-comments-toggle, .single-post.narrow-content #comments, .single-post.narrow-content .entry-content .aligncenter, .single-post.narrow-content .si-narrow-element, .single-post.narrow-content.si-single-title-in-content .entry-header, .single-post.narrow-content.si-single-title-in-content .entry-meta, .single-post.narrow-content.si-single-title-in-content .post-category, .single-post.narrow-content.sinatra-no-sidebar .si-page-header-wrapper, .single-post.narrow-content.sinatra-no-sidebar .si-breadcrumbs nav { max-width: ' . sinatra_option( 'single_narrow_container_width' ) . 'px; margin-left: auto; margin-right: auto; } .single-post.narrow-content .author-box, .single-post.narrow-content .entry-content > .alignwide, .single.si-single-title-in-page-header .page-header.si-align-center .si-page-header-wrapper { max-width: ' . ( intval( sinatra_option( 'single_narrow_container_width' ) ) + 70 ) . 'px; } '; } // Allow CSS to be filtered. $css = apply_filters( 'sinatra_dynamic_styles', $css ); // Add user custom CSS. if ( $custom_css || ! is_customize_preview() ) { $css .= wp_get_custom_css(); } // Minify the CSS code. $css = $this->minify( $css ); return $css; } /** * Update dynamic css file with new CSS. Cleans caches after that. * * @return [Boolean] returns true if successfully updated the dynamic file. */ public function update_dynamic_file() { $css = $this->get_css( true ); if ( empty( $css ) || '' === trim( $css ) ) { return; } // Load file.php file. require_once ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'file.php'; // phpcs:ignore global $wp_filesystem; // Check if the the global filesystem isn't setup yet. if ( is_null( $wp_filesystem ) ) { WP_Filesystem(); } $wp_filesystem->mkdir( $this->dynamic_css_path ); if ( $wp_filesystem->put_contents( $this->dynamic_css_path . 'dynamic-styles.css', $css ) ) { $this->clean_cache(); set_transient( 'sinatra_has_dynamic_css', true, 0 ); return true; } return false; } /** * Delete dynamic css file. * * @return void */ public function delete_dynamic_file() { // Load file.php file. require_once ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'file.php'; // phpcs:ignore global $wp_filesystem; // Check if the the global filesystem isn't setup yet. if ( is_null( $wp_filesystem ) ) { WP_Filesystem(); } $wp_filesystem->delete( $this->dynamic_css_path . 'dynamic-styles.css' ); delete_transient( 'sinatra_has_dynamic_css' ); } /** * Simple CSS code minification. * * @param string $css code to be minified. * @return string, minifed code * @since 1.0.0 */ private function minify( $css ) { $css = preg_replace( '/\s+/', ' ', $css ); $css = preg_replace( '/\/\*[^\!](.*?)\*\//', '', $css ); $css = preg_replace( '/(,|:|;|\{|}) /', '$1', $css ); $css = preg_replace( '/ (,|;|\{|})/', '$1', $css ); $css = preg_replace( '/(:| )0\.([0-9]+)(%|em|ex|px|in|cm|mm|pt|pc)/i', '${1}.${2}${3}', $css ); $css = preg_replace( '/(:| )(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/i', '${1}0', $css ); return trim( $css ); } /** * Cleans various caches. Compatible with cache plugins. * * @since 1.0.0 */ private function clean_cache() { // If W3 Total Cache is being used, clear the cache. if ( function_exists( 'w3tc_pgcache_flush' ) ) { w3tc_pgcache_flush(); } // if WP Super Cache is being used, clear the cache. if ( function_exists( 'wp_cache_clean_cache' ) ) { global $file_prefix; wp_cache_clean_cache( $file_prefix ); } // If SG CachePress is installed, reset its caches. if ( class_exists( 'SG_CachePress_Supercacher' ) ) { if ( method_exists( 'SG_CachePress_Supercacher', 'purge_cache' ) ) { SG_CachePress_Supercacher::purge_cache(); } } // Clear caches on WPEngine-hosted sites. if ( class_exists( 'WpeCommon' ) ) { if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) { WpeCommon::purge_memcached(); } if ( method_exists( 'WpeCommon', 'clear_maxcdn_cache' ) ) { WpeCommon::clear_maxcdn_cache(); } if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) ) { WpeCommon::purge_varnish_cache(); } } // Clean OpCache. if ( function_exists( 'opcache_reset' ) ) { opcache_reset(); // phpcs:ignore } // Clean WordPress cache. if ( function_exists( 'wp_cache_flush' ) ) { wp_cache_flush(); } } /** * Prints spacing field CSS based on passed params. * * @since 1.0.0 * * @param string $css_selector CSS selector. * @param string $css_property CSS property, such as 'margin', 'padding' or 'border'. * @param string $setting_id The ID of the customizer setting containing all information about the setting. * @param bool $responsive Has responsive values. * @return string Generated CSS. */ public function get_spacing_field_css( $css_selector, $css_property, $setting_id, $responsive = true ) { // Get the saved setting. $setting = sinatra_option( $setting_id ); // If setting doesn't exist, return. if ( ! is_array( $setting ) ) { return; } // Get the unit. Defaults to px. $unit = 'px'; if ( isset( $setting['unit'] ) ) { if ( $setting['unit'] ) { $unit = $setting['unit']; } unset( $setting['unit'] ); } // CSS buffer. $css_buffer = ''; // Loop through options. foreach ( $setting as $key => $value ) { // Check if responsive options are available. if ( is_array( $value ) ) { if ( 'desktop' === $key ) { $mq_open = ''; $mq_close = ''; } elseif ( 'tablet' === $key ) { $mq_open = '@media only screen and (max-width: 768px) {'; $mq_close = '}'; } elseif ( 'mobile' === $key ) { $mq_open = '@media only screen and (max-width: 480px) {'; $mq_close = '}'; } else { $mq_open = ''; $mq_close = ''; } // Add media query prefix. $css_buffer .= $mq_open . $css_selector . '{'; // Loop through all choices. foreach ( $value as $pos => $val ) { if ( empty( $val ) ) { continue; } if ( 'border' === $css_property ) { $pos .= '-width'; } $css_buffer .= $css_property . '-' . $pos . ': ' . intval( $val ) . $unit . ';'; } $css_buffer .= '}' . $mq_close; } else { if ( 'border' === $css_property ) { $key .= '-width'; } $css_buffer .= $css_property . '-' . $key . ': ' . intval( $value ) . $unit . ';'; } } // Check if field is has responsive values. if ( ! $responsive ) { $css_buffer = $css_selector . '{' . $css_buffer . '}'; } // Finally, return the generated CSS code. return $css_buffer; } /** * Prints range field CSS based on passed params. * * @since 1.0.0 * * @param string $css_selector CSS selector. * @param string $css_property CSS property, such as 'margin', 'padding' or 'border'. * @param string $setting_id The ID of the customizer setting containing all information about the setting. * @param bool $responsive Has responsive values. * @param string $unit Unit. * @return string Generated CSS. */ public function get_range_field_css( $css_selector, $css_property, $setting_id, $responsive = true, $unit = 'px' ) { // Get the saved setting. $setting = sinatra_option( $setting_id ); // If just a single value option. if ( ! is_array( $setting ) ) { return $css_selector . ' { ' . $css_property . ': ' . $setting . $unit . '; }'; } // Resolve units. if ( isset( $setting['unit'] ) ) { if ( $setting['unit'] ) { $unit = $setting['unit']; } unset( $setting['unit'] ); } // CSS buffer. $css_buffer = ''; if ( is_array( $setting ) && ! empty( $setting ) ) { // Media query syntax wrap. $mq_open = ''; $mq_close = ''; // Loop through options. foreach ( $setting as $key => $value ) { if ( empty( $value ) ) { continue; } if ( 'desktop' === $key ) { $mq_open = ''; $mq_close = ''; } elseif ( 'tablet' === $key ) { $mq_open = '@media only screen and (max-width: 768px) {'; $mq_close = '}'; } elseif ( 'mobile' === $key ) { $mq_open = '@media only screen and (max-width: 480px) {'; $mq_close = '}'; } else { $mq_open = ''; $mq_close = ''; } // Add media query prefix. $css_buffer .= $mq_open . $css_selector . '{'; $css_buffer .= $css_property . ': ' . floatval( $value ) . $unit . ';'; $css_buffer .= '}' . $mq_close; } } // Finally, return the generated CSS code. return $css_buffer; } /** * Prints design options field CSS based on passed params. * * @since 1.0.0 * @param string $css_selector CSS selector. * @param string|mixed $setting The ID of the customizer setting containing all information about the setting. * @param string $type Design options field type. * @return string Generated CSS. */ public function get_design_options_field_css( $css_selector, $setting, $type ) { if ( is_string( $setting ) ) { // Get the saved setting. $setting = sinatra_option( $setting ); } // Setting has to be array. if ( ! is_array( $setting ) || empty( $setting ) ) { return; } // CSS buffer. $css_buffer = ''; // Background. if ( 'background' === $type ) { // Background type. $background_type = $setting['background-type']; if ( 'color' === $background_type ) { if ( isset( $setting['background-color'] ) && ! empty( $setting['background-color'] ) ) { $css_buffer .= 'background: ' . $setting['background-color'] . ';'; } } elseif ( 'gradient' === $background_type ) { $css_buffer .= 'background: ' . $setting['gradient-color-1'] . ';'; if ( 'linear' === $setting['gradient-type'] ) { $css_buffer .= ' background: -webkit-linear-gradient(' . $setting['gradient-linear-angle'] . 'deg, ' . $setting['gradient-color-1'] . ' ' . $setting['gradient-color-1-location'] . '%, ' . $setting['gradient-color-2'] . ' ' . $setting['gradient-color-2-location'] . '%); background: -o-linear-gradient(' . $setting['gradient-linear-angle'] . 'deg, ' . $setting['gradient-color-1'] . ' ' . $setting['gradient-color-1-location'] . '%, ' . $setting['gradient-color-2'] . ' ' . $setting['gradient-color-2-location'] . '%); background: linear-gradient(' . $setting['gradient-linear-angle'] . 'deg, ' . $setting['gradient-color-1'] . ' ' . $setting['gradient-color-1-location'] . '%, ' . $setting['gradient-color-2'] . ' ' . $setting['gradient-color-2-location'] . '%); '; } elseif ( 'radial' === $setting['gradient-type'] ) { $css_buffer .= ' background: -webkit-radial-gradient(' . $setting['gradient-position'] . ', circle, ' . $setting['gradient-color-1'] . ' ' . $setting['gradient-color-1-location'] . '%, ' . $setting['gradient-color-2'] . ' ' . $setting['gradient-color-2-location'] . '%); background: -o-radial-gradient(' . $setting['gradient-position'] . ', circle, ' . $setting['gradient-color-1'] . ' ' . $setting['gradient-color-1-location'] . '%, ' . $setting['gradient-color-2'] . ' ' . $setting['gradient-color-2-location'] . '%); background: radial-gradient(circle at ' . $setting['gradient-position'] . ', ' . $setting['gradient-color-1'] . ' ' . $setting['gradient-color-1-location'] . '%, ' . $setting['gradient-color-2'] . ' ' . $setting['gradient-color-2-location'] . '%); '; } } elseif ( 'image' === $background_type ) { $css_buffer .= ' background-image: url(' . $setting['background-image'] . '); background-size: ' . $setting['background-size'] . '; background-attachment: ' . $setting['background-attachment'] . '; background-position: ' . $setting['background-position-x'] . '% ' . $setting['background-position-y'] . '%; background-repeat: ' . $setting['background-repeat'] . '; '; } $css_buffer = ! empty( $css_buffer ) ? $css_selector . '{' . $css_buffer . '}' : ''; if ( 'image' === $background_type && isset( $setting['background-color-overlay'] ) && $setting['background-color-overlay'] && isset( $setting['background-image'] ) && $setting['background-image'] ) { $css_buffer .= $css_selector . '::after { background-color: ' . $setting['background-color-overlay'] . '; }'; } } elseif ( 'color' === $type ) { // Text color. if ( isset( $setting['text-color'] ) && ! empty( $setting['text-color'] ) ) { $css_buffer .= $css_selector . ' { color: ' . $setting['text-color'] . '; }'; } // Link Color. if ( isset( $setting['link-color'] ) && ! empty( $setting['link-color'] ) ) { $css_buffer .= $css_selector . ' a { color: ' . $setting['link-color'] . '; }'; } // Link Hover Color. if ( isset( $setting['link-hover-color'] ) && ! empty( $setting['link-hover-color'] ) ) { $css_buffer .= $css_selector . ' a:hover { color: ' . $setting['link-hover-color'] . ' !important; }'; } } elseif ( 'border' === $type ) { // Color. if ( isset( $setting['border-color'] ) && ! empty( $setting['border-color'] ) ) { $css_buffer .= 'border-color:' . $setting['border-color'] . ';'; } // Style. if ( isset( $setting['border-style'] ) && ! empty( $setting['border-style'] ) ) { $css_buffer .= 'border-style: ' . $setting['border-style'] . ';'; } // Width. $positions = array( 'top', 'right', 'bottom', 'left' ); foreach ( $positions as $position ) { if ( isset( $setting[ 'border-' . $position . '-width' ] ) && ! empty( $setting[ 'border-' . $position . '-width' ] ) ) { $css_buffer .= 'border-' . $position . '-width: ' . $setting[ 'border-' . $position . '-width' ] . 'px;'; } } $css_buffer = ! empty( $css_buffer ) ? $css_selector . '{' . $css_buffer . '}' : ''; } elseif ( 'separator_color' === $type && isset( $setting['separator-color'] ) && ! empty( $setting['separator-color'] ) ) { // Separator Color. $css_buffer .= $css_selector . '::after { background-color:' . $setting['separator-color'] . '; }'; } // Finally, return the generated CSS code. return $css_buffer; } /** * Prints typography field CSS based on passed params. * * @since 1.0.0 * @param string $css_selector CSS selector. * @param string|mixed $setting The ID of the customizer setting containing all information about the setting. * @return string Generated CSS. */ public function get_typography_field_css( $css_selector, $setting ) { if ( is_string( $setting ) ) { // Get the saved setting. $setting = sinatra_option( $setting ); } // Setting has to be array. if ( ! is_array( $setting ) || empty( $setting ) ) { return; } // CSS buffer. $css_buffer = ''; // Properties. $properties = array( 'font-weight', 'font-style', 'text-transform', 'text-decoration', ); foreach ( $properties as $property ) { if ( 'inherit' !== $setting[ $property ] ) { $css_buffer .= $property . ':' . $setting[ $property ] . ';'; } } // Font family. if ( 'inherit' !== $setting['font-family'] ) { $font_family = sinatra()->fonts->get_font_family( $setting['font-family'] ); $css_buffer .= 'font-family: ' . $font_family . ';'; } // Letter spacing. if ( ! empty( $setting['letter-spacing'] ) ) { $css_buffer .= 'letter-spacing:' . $setting['letter-spacing'] . $setting['letter-spacing-unit'] . ';'; } // Font size. if ( ! empty( $setting['font-size-desktop'] ) ) { $css_buffer .= 'font-size:' . $setting['font-size-desktop'] . $setting['font-size-unit'] . ';'; } // Line Height. if ( ! empty( $setting['line-height-desktop'] ) ) { $css_buffer .= 'line-height:' . $setting['line-height-desktop'] . ';'; } $css_buffer = $css_buffer ? $css_selector . '{' . $css_buffer . '}' : ''; // Responsive options - tablet. $tablet = ''; if ( ! empty( $setting['font-size-tablet'] ) ) { $tablet .= 'font-size:' . $setting['font-size-tablet'] . $setting['font-size-unit'] . ';'; } if ( ! empty( $setting['line-height-tablet'] ) ) { $tablet .= 'line-height:' . $setting['line-height-tablet'] . ';'; } $tablet = ! empty( $tablet ) ? '@media only screen and (max-width: 768px) {' . $css_selector . '{' . $tablet . '} }' : ''; $css_buffer .= $tablet; // Responsive options - mobile. $mobile = ''; if ( ! empty( $setting['font-size-mobile'] ) ) { $mobile .= 'font-size:' . $setting['font-size-mobile'] . $setting['font-size-unit'] . ';'; } if ( ! empty( $setting['line-height-mobile'] ) ) { $mobile .= 'line-height:' . $setting['line-height-mobile'] . ';'; } $mobile = ! empty( $mobile ) ? '@media only screen and (max-width: 480px) {' . $css_selector . '{' . $mobile . '} }' : ''; $css_buffer .= $mobile; // Equeue google fonts. if ( sinatra()->fonts->is_google_font( $setting['font-family'] ) ) { $params = array(); if ( 'inherit' !== $setting['font-weight'] ) { $params['weight'] = $setting['font-weight']; } if ( 'inherit' !== $setting['font-style'] ) { $params['style'] = $setting['font-style']; } if ( $setting['font-subsets'] && ! empty( $setting['font-subsets'] ) ) { $params['subsets'] = $setting['font-subsets']; } sinatra()->fonts->enqueue_google_font( $setting['font-family'], $params ); } // Finally, return the generated CSS code. return $css_buffer; } /** * Filters the dynamic styles to include button styles and makes sure it has the highest priority. * * @since 1.0.0 * @param string $css The dynamic CSS. * @return string Filtered dynamic CSS. */ public function get_button_styles( $css ) { /** * Primary Button. */ $primary_button_selector = ' .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span'; $primary_button_bg_color = sinatra_option( 'primary_button_bg_color' ); $primary_button_border_radius = sinatra_option( 'primary_button_border_radius' ); if ( '' !== $primary_button_bg_color ) { $css .= $primary_button_selector . ' { background-color: ' . $primary_button_bg_color . '; }'; } // Primary button text color, border color & border width. $css .= $primary_button_selector . ' { color: ' . sinatra_option( 'primary_button_text_color' ) . '; border-color: ' . sinatra_option( 'primary_button_border_color' ) . '; border-width: ' . sinatra_option( 'primary_button_border_width' ) . 'px; border-top-left-radius: ' . $primary_button_border_radius['top-left'] . 'px; border-top-right-radius: ' . $primary_button_border_radius['top-right'] . 'px; border-bottom-right-radius: ' . $primary_button_border_radius['bottom-right'] . 'px; border-bottom-left-radius: ' . $primary_button_border_radius['bottom-left'] . 'px; }'; // Primary button hover. $primary_button_hover_selector = ' .si-btn:hover, .si-btn:focus, body:not(.wp-customizer) input[type=submit]:hover, body:not(.wp-customizer) input[type=submit]:focus, .site-main .woocommerce #respond input#submit:hover, .site-main .woocommerce #respond input#submit:focus, .site-main .woocommerce a.button:hover, .site-main .woocommerce a.button:focus, .site-main .woocommerce button.button:hover, .site-main .woocommerce button.button:focus, .site-main .woocommerce input.button:hover, .site-main .woocommerce input.button:focus, .woocommerce ul.products li.product .added_to_cart:hover, .woocommerce ul.products li.product .added_to_cart:focus, .woocommerce ul.products li.product .button:hover, .woocommerce ul.products li.product .button:focus, .woocommerce div.product form.cart .button:hover, .woocommerce div.product form.cart .button:focus, .woocommerce #review_form #respond .form-submit input:hover, .woocommerce #review_form #respond .form-submit input:focus, #infinite-handle span:hover'; $primary_button_hover_bg_color = sinatra_option( 'primary_button_hover_bg_color' ); // Primary button hover bg color. if ( '' !== $primary_button_hover_bg_color ) { $css .= $primary_button_hover_selector . ' { background-color: ' . $primary_button_hover_bg_color . '; }'; } // Primary button hover color & border. $css .= $primary_button_hover_selector . '{ color: ' . sinatra_option( 'primary_button_hover_text_color' ) . '; border-color: ' . sinatra_option( 'primary_button_hover_border_color' ) . '; }'; // Primary button typography. $css .= $this->get_typography_field_css( $primary_button_selector, 'primary_button_typography' ); /** * Secondary Button. */ $secondary_button_selector = ' .btn-secondary, .si-btn.btn-secondary'; $secondary_button_bg_color = sinatra_option( 'secondary_button_bg_color' ); $secondary_button_border_radius = sinatra_option( 'secondary_button_border_radius' ); // Secondary button text color, border color & border width. $css .= $secondary_button_selector . ' { color: ' . sinatra_option( 'secondary_button_text_color' ) . '; border-color: ' . sinatra_option( 'secondary_button_border_color' ) . '; border-width: ' . sinatra_option( 'secondary_button_border_width' ) . 'px; background-color: ' . $secondary_button_bg_color . '; border-top-left-radius: ' . $secondary_button_border_radius['top-left'] . 'px; border-top-right-radius: ' . $secondary_button_border_radius['top-right'] . 'px; border-bottom-right-radius: ' . $secondary_button_border_radius['bottom-right'] . 'px; border-bottom-left-radius: ' . $secondary_button_border_radius['bottom-left'] . 'px; }'; // Secondary button hover. $secondary_button_hover_selector = ' .btn-secondary:hover, .btn-secondary:focus, .si-btn.btn-secondary:hover, .si-btn.btn-secondary:focus'; $secondary_button_hover_bg_color = sinatra_option( 'secondary_button_hover_bg_color' ); // Secondary button hover color & border. $css .= $secondary_button_hover_selector . '{ color: ' . sinatra_option( 'secondary_button_hover_text_color' ) . '; border-color: ' . sinatra_option( 'secondary_button_hover_border_color' ) . '; background-color: ' . $secondary_button_hover_bg_color . '; }'; // Secondary button typography. $css .= $this->get_typography_field_css( $secondary_button_selector, 'secondary_button_typography' ); // Text Button. $css .= ' .si-btn.btn-text-1, .btn-text-1 { color: ' . sinatra_option( 'text_button_text_color' ) . '; } '; $css .= ' .si-btn.btn-text-1:hover, .si-btn.btn-text-1:focus, .btn-text-1:hover, .btn-text-1:focus { color: ' . sinatra_option( 'accent_color' ) . '; } '; $css .= ' .si-btn.btn-text-1 > span::before { background-color: ' . sinatra_option( 'accent_color' ) . '; } '; if ( sinatra_option( 'text_button_hover_text_color' ) ) { $css .= ' .si-btn.btn-text-1:hover, .si-btn.btn-text-1:focus, .btn-text-1:hover, .btn-text-1:focus { color: ' . sinatra_option( 'text_button_hover_text_color' ) . '; } .si-btn.btn-text-1 > span::before { background-color: ' . sinatra_option( 'text_button_hover_text_color' ) . '; } '; } // Secondary button typography. $css .= $this->get_typography_field_css( '.si-btn.btn-text-1, .btn-text-1', 'text_button_typography' ); // Return the filtered CSS. return $css; } /** * Generate dynamic Block Editor styles. * * @since 1.0.9 * @return string */ public function get_block_editor_css() { // Current post. $post_id = get_the_ID(); $post_type = get_post_type( $post_id ); // Layout. $site_layout = sinatra_get_site_layout( $post_id ); $sidebar_position = sinatra_get_sidebar_position( $post_id ); $container_width = sinatra_option( 'container_width' ); $single_content_width = sinatra_option( 'single_content_width' ); $container_width = $container_width - 100; if ( sinatra_is_sidebar_displayed( $post_id ) ) { $sidebar_width = sinatra_option( 'sidebar_width' ); $container_width = $container_width * ( 100 - intval( $sidebar_width ) ) / 100; $container_width = $container_width - 50; if ( 'boxed-separated' === $site_layout ) { if ( 3 === intval( sinatra_option( 'sidebar_style' ) ) ) { $container_width += 15; } } } if ( 'boxed-separated' === $site_layout ) { $container_width += 16; } if ( 'boxed' === $site_layout ) { $container_width = $container_width + 200; } $background_color = get_background_color(); $accent_color = sinatra_option( 'accent_color' ); $content_color = sinatra_option( 'boxed_content_background_color' ); $text_color = sinatra_option( 'content_text_color' ); $link_hover_color = sinatra_option( 'content_link_hover_color' ); $headings_color = sinatra_option( 'headings_color' ); $font_smoothing = sinatra_option( 'font_smoothing' ); $css = ''; // Base HTML font size. $css .= $this->get_range_field_css( 'html', 'font-size', 'html_base_font_size', true, 'px' ); // Accent color. $css .= ' .editor-styles-wrapper .block-editor-rich-text__editable mark, .editor-styles-wrapper .block-editor-rich-text__editable span.highlight, .editor-styles-wrapper .block-editor-rich-text__editable code, .editor-styles-wrapper .block-editor-rich-text__editable kbd, .editor-styles-wrapper .block-editor-rich-text__editable var, .editor-styles-wrapper .block-editor-rich-text__editable samp, .editor-styles-wrapper .block-editor-rich-text__editable tt { background-color: ' . sinatra_hex2rgba( $accent_color, .09 ) . '; } .editor-styles-wrapper .wp-block code.block, .editor-styles-wrapper .block code { background-color: ' . sinatra_hex2rgba( $accent_color, .075 ) . '; } .editor-styles-wrapper .wp-block .block-editor-rich-text__editable a, .editor-styles-wrapper .block-editor-rich-text__editable code, .editor-styles-wrapper .block-editor-rich-text__editable kbd, .editor-styles-wrapper .block-editor-rich-text__editable var, .editor-styles-wrapper .block-editor-rich-text__editable samp, .editor-styles-wrapper .block-editor-rich-text__editable tt { color: ' . $accent_color . '; } #editor .editor-styles-wrapper ::-moz-selection { background-color: ' . $accent_color . '; color: #FFF; } #editor .editor-styles-wrapper ::selection { background-color: ' . $accent_color . '; color: #FFF; } .editor-styles-wrapper blockquote, .editor-styles-wrapper .wp-block-quote { border-color: ' . $accent_color . '; } '; // Container width. if ( 'fw-stretched' === $site_layout ) { $css .= ' .editor-styles-wrapper .wp-block { max-width: none; } '; } elseif ( 'boxed-separated' === $site_layout || 'boxed' === $site_layout ) { $css .= ' .editor-styles-wrapper { max-width: ' . $container_width . 'px; margin: 0 auto; background-color: ' . $content_color . '; } .editor-styles-wrapper .wp-block { max-width: none; } '; if ( 'boxed' === $site_layout ) { $css .= ' .editor-styles-wrapper { -webkit-box-shadow: 0 0 30px rgba(50, 52, 54, 0.06); box-shadow: 0 0 30px rgba(50, 52, 54, 0.06); padding-left: 42px; padding-right: 42px; } '; } else { $css .= ' .editor-styles-wrapper { border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.085); } '; } } else { $css .= ' .editor-styles-wrapper .wp-block { max-width: ' . $container_width . 'px; } '; } if ( 'post' === $post_type && 'narrow' === $single_content_width ) { $narrow_container_width = intval( sinatra_option( 'single_narrow_container_width' ) ); $css .= ' .editor-styles-wrapper .wp-block { max-width: ' . $narrow_container_width . 'px; } '; } // Background color. $css .= ' :root .editor-styles-wrapper { background-color: #' . trim( $background_color, '#' ) . '; } '; // Body. $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper, .editor-styles-wrapper .wp-block, .block-editor-default-block-appender textarea.block-editor-default-block-appender__content', 'body_font' ); $css .= ' :root .editor-styles-wrapper { color: ' . $text_color . '; } '; // If single post, use single post font size settings. if ( 'post' === $post_type ) { $css .= $this->get_range_field_css( ':root .editor-styles-wrapper .wp-block', 'font-size', 'single_content_font_size', true ); } // Headings typography. $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h1, :root .editor-styles-wrapper h2, :root .editor-styles-wrapper h3, :root .editor-styles-wrapper h4, :root .editor-styles-wrapper h5, :root .editor-styles-wrapper h6, :root .editor-styles-wrapper .editor-post-title__block .editor-post-title__input', 'headings_font' ); // Heading em. $css .= $this->get_typography_field_css( '.editor-styles-wrapper h1 em, .editor-styles-wrapper h2 em, .editor-styles-wrapper h3 em, .editor-styles-wrapper h4 em, .editor-styles-wrapper h5 em, .editor-styles-wrapper h6 em', 'heading_em_font' ); // Headings (H1-H6). $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h1, :root .editor-styles-wrapper .h1, :root .editor-styles-wrapper .editor-post-title__block .editor-post-title__input', 'h1_font' ); $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h2, :root .editor-styles-wrapper .h2', 'h2_font' ); $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h3, :root .editor-styles-wrapper .h3', 'h3_font' ); $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h4', 'h4_font' ); $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h5', 'h5_font' ); $css .= $this->get_typography_field_css( ':root .editor-styles-wrapper h6', 'h6_font' ); $css .= ' :root .editor-styles-wrapper h1, :root .editor-styles-wrapper h2, :root .editor-styles-wrapper h3, :root .editor-styles-wrapper h4, :root .editor-styles-wrapper h5, :root .editor-styles-wrapper h6, :root .editor-post-title__block .editor-post-title__input { color: ' . $headings_color . '; } '; // Page header font size. $css .= $this->get_range_field_css( ':root .editor-styles-wrapper .editor-post-title__block .editor-post-title__input', 'font-size', 'page_header_font_size', true ); // Link hover color. $css .= ' .editor-styles-wrapper .wp-block .block-editor-rich-text__editable a:hover { color: ' . $link_hover_color . '; } '; // Font smoothing. if ( $font_smoothing ) { $css .= ' .editor-styles-wrapper { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } '; } return $css; } } endif; /** * The function which returns the one Sinatra_Dynamic_Styles instance. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: * * @since 1.0.0 * @return object */ function sinatra_dynamic_styles() { return Sinatra_Dynamic_Styles::instance(); } sinatra_dynamic_styles(); common.php000064400000057165151231536700006566 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! function_exists( 'sinatra_get_allowed_html_tags' ) ) { /** * Array of allowed HTML Tags. * * @since 1.0.0 * @param string $type predefined HTML tags group name. * @return array, allowed HTML tags. */ function sinatra_get_allowed_html_tags( $type = 'basic' ) { $tags = array(); switch ( $type ) { case 'basic': $tags = array( 'strong' => array(), 'em' => array(), 'b' => array(), 'br' => array(), 'i' => array( 'class' => array(), ), 'img' => array( 'src' => array(), 'alt' => array(), 'width' => array(), 'height' => array(), 'class' => array(), 'id' => array(), ), 'span' => array( 'class' => array(), ), 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), 'class' => array(), 'role' => array(), 'id' => array(), ), ); break; case 'button': $tags = array( 'strong' => array(), 'em' => array(), 'span' => array( 'class' => array(), ), 'i' => array( 'class' => array(), ), ); break; case 'span': $tags = array( 'span' => array( 'class' => array(), ), ); break; case 'icon': $tags = array( 'i' => array(), 'span' => array(), 'img' => array(), ); break; default: $tags = array( 'strong' => array(), 'em' => array(), 'b' => array(), 'i' => array(), 'img' => array( 'src' => array(), 'alt' => array(), 'width' => array(), 'height' => array(), 'class' => array(), 'id' => array(), ), 'span' => array(), 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), 'class' => array(), 'role' => array(), 'id' => array(), ), ); break; } return apply_filters( 'sinatra_allowed_html_tags', $tags, $type ); } } /** * Returns the value for option. * * @since 1.0.0 * * @param string $id Option ID. * @param string $prefix Theme prefix. * @param string $type Option or Theme Mod. * @return mixed Option value. */ function sinatra_option( $id, $prefix = 'sinatra_', $type = 'theme_mod' ) { if ( 'theme_mod' === $type ) { return sinatra()->options->get( $prefix . $id ); } else { return get_option( $prefix . $id, sinatra()->options->get( $prefix . $id ) ); } } /** * Get default for option. * * @since 1.1.0 * * @param string $id Option ID. * @param string $prefix Theme prefix. * @return mixed Option value. */ function sinatra_get_default( $id, $prefix = 'sinatra_' ) { return sinatra()->options->get_default( $prefix . $id ); } /** * Checks to see if Top Bar is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean if Top Bar is enabled. */ function sinatra_is_top_bar_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $top_bar_displayed = sinatra_option( 'top_bar_enable' ); if ( $post_id && $top_bar_displayed ) { $top_bar_displayed = ! get_post_meta( $post_id, 'sinatra_disable_topbar', true ); } // Do not show top bar on 404 page. if ( is_404() ) { $top_bar_displayed = false; } return apply_filters( 'sinatra_is_top_bar_displayed', $top_bar_displayed, $post_id ); } /** * Checks to see if Page Preloader is displayed. * * @since 1.0.0 * * @return boolean, true if Preloader is displayed. */ function sinatra_is_preloader_displayed() { $displayed = (bool) sinatra_option( 'preloader' ); return apply_filters( 'sinatra_is_preloader_displayed', $displayed ); } /** * Checks to see if Header is displayed. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean true if Header is displayed. */ function sinatra_is_header_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $displayed = true; if ( $post_id ) { $displayed = ! get_post_meta( $post_id, 'sinatra_disable_header', true ); } return apply_filters( 'sinatra_is_header_displayed', $displayed, $post_id ); } /** * Checks to see if Transparent Header is enabled. * * @since 1.0.0 * @param int $post_id Optional. The post ID to check. * @return boolean, true if Header is transparent. */ function sinatra_is_header_transparent( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $enabled = sinatra_option( 'tsp_header' ); if ( $enabled && sinatra_is_section_disabled( sinatra_option( 'tsp_header_disable_on' ), $post_id ) ) { $enabled = false; } if ( $post_id ) { $_meta = get_post_meta( $post_id, 'sinatra_transparent_header', true ); if ( 'enable' === $_meta ) { $enabled = true; } elseif ( 'disable' === $_meta ) { $enabled = false; } } return apply_filters( 'sinatra_transparent_header', $enabled, $post_id ); } /** * Checks to see if Pre Footer is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean true if Pre Footer is enabled. */ function sinatra_is_pre_footer_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $displayed = false; // Customizer option to enable pre-footer. if ( sinatra_option( 'enable_pre_footer_cta' ) ) { $displayed = true; } // At least one pre-footer are has to be enabled. if ( ! sinatra_is_pre_footer_cta_displayed( $post_id ) ) { $displayed = false; } return apply_filters( 'sinatra_is_pre_footer_displayed', $displayed, $post_id ); } /** * Checks to see if Pre Footer is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean True if Pre Footer is enabled. */ function sinatra_is_pre_footer_cta_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $displayed = false; if ( sinatra_option( 'enable_pre_footer_cta' ) ) { $displayed = true; } if ( $displayed && sinatra_is_section_disabled( sinatra_option( 'pre_footer_cta_hide_on' ), $post_id ) ) { $displayed = false; } if ( $post_id && $displayed ) { $displayed = ! get_post_meta( $post_id, 'sinatra_disable_prefooter_cta', true ); } // Do not show pre footer widgets on 404 page. if ( is_404() ) { $displayed = false; } return apply_filters( 'sinatra_is_pre_footer_cta_displayed', $displayed, $post_id ); } /** * Checks to see if Hero section is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean True if Hero is enabled. */ function sinatra_is_hero_displayed( $post_id = 0 ) { $displayed = true; if ( ! sinatra_option( 'enable_hero' ) ) { $displayed = false; } if ( $displayed && ! sinatra_is_section_disabled( sinatra_option( 'hero_enable_on' ), $post_id ) ) { $displayed = false; } return apply_filters( 'sinatra_is_hero_displayed', $displayed, $post_id ); } /** * Checks to see if Main Footer is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, true if Main Footer is enabled. */ function sinatra_is_footer_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $footer_displayed = sinatra_option( 'enable_footer' ); if ( $post_id && $footer_displayed ) { $footer_displayed = ! get_post_meta( $post_id, 'sinatra_disable_footer', true ); } // Do not show footer widgets on 404 page. if ( is_404() ) { $footer_displayed = false; } if ( $footer_displayed && ! current_user_can( 'edit_theme_options' ) ) { $footer_columns = sinatra_get_footer_column_count(); $footer_active = false; for ( $i = 1; $i <= $footer_columns; $i++ ) { $footer_active = $footer_active || is_active_sidebar( 'sinatra-footer-' . $i ); } $footer_displayed = $footer_displayed && $footer_active; } return apply_filters( 'sinatra_is_footer_displayed', $footer_displayed, $post_id ); } /** * Checks to see if Copyright Bar is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, true if Copyright bar is enabled. */ function sinatra_is_copyright_bar_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $displayed = sinatra_option( 'enable_copyright' ); $widgets = sinatra_option( 'copyright_widgets' ); if ( $displayed && ! is_array( $widgets ) || empty( $widgets ) ) { $displayed = false; } if ( $post_id && $displayed ) { $displayed = ! get_post_meta( $post_id, 'sinatra_disable_copyright', true ); } // Do not show copyright bar on 404 page. if ( is_404() ) { $displayed = false; } return apply_filters( 'sinatra_is_copyright_displayed', $displayed, $post_id ); } /** * Checks to see if Colophon section is enabled. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, true if Colophon is enabled. */ function sinatra_is_colophon_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $displayed = true; // Do not show colophon if both footer and copyright bar are not displayed. if ( ! sinatra_is_footer_displayed( $post_id ) && ! sinatra_is_copyright_bar_displayed( $post_id ) ) { $displayed = false; } // Do not show colophon on 404 page. if ( is_404() ) { $displayed = false; } return apply_filters( 'sinatra_is_colophon_displayed', $displayed, $post_id ); } /** * Checks to see if Page Header is displayed. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, if Page Header is displayed. */ function sinatra_is_page_header_displayed( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $displayed = sinatra_option( 'page_header_enable' ); if ( $post_id && $displayed ) { $displayed = sinatra_page_header_has_title( $post_id ) || sinatra_page_header_has_breadcrumbs( $post_id ); } elseif ( is_404() ) { $displayed = false; } if ( is_front_page() ) { $displayed = false; } return apply_filters( 'sinatra_is_page_header_displayed', $displayed, $post_id ); } /** * Checks to see if WooCommerce is installed & activated. * * @since 1.0.0 * @return boolean, if Copyright bar is enabled. */ function sinatra_is_woocommerce_activated() { return class_exists( 'woocommerce' ); } /** * Get registered sidebar name by sidebar ID. * * @since 1.0.0 * @param string $sidebar_id Sidebar ID. * @return string Sidebar name. */ function sinatra_get_sidebar_name_by_id( $sidebar_id = '' ) { if ( ! $sidebar_id ) { return; } global $wp_registered_sidebars; $sidebar_name = ''; if ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ) { $sidebar_name = $wp_registered_sidebars[ $sidebar_id ]['name']; } return $sidebar_name; } /** * Convert hexdec color string to rgb(a) string. * * @since 1.0.0 * @param string $color Hex color code. * @param string | boolean $opacity opacity value. * @return string color in rgba format. */ function sinatra_hex2rgba( $color, $opacity = false ) { $default = 'rgb(0,0,0)'; // Return default if no color provided. if ( empty( $color ) ) { return $default; } if ( substr( $color, 0, 4 ) === 'rgba' ) { return $color; } // Sanitize $color if "#" is provided. if ( '#' === $color[0] ) { $color = substr( $color, 1 ); } // Check if color has 6 or 3 characters and get values. if ( 6 === strlen( $color ) ) { $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); } elseif ( 3 === strlen( $color ) ) { $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); } else { return $default; } // Convert hexadec to rgb. $rgb = array_map( 'hexdec', $hex ); // Check if opacity is set(rgba or rgb). if ( $opacity ) { if ( abs( $opacity ) > 1 ) { $opacity = 1; } $output = 'rgba(' . implode( ',', $rgb ) . ',' . $opacity . ')'; } else { $output = 'rgb(' . implode( ',', $rgb ) . ')'; } // Return rgb(a) color string. return $output; } /** * Convert rgb(a) color string to hex string. * * @since 1.0.0 * @param string $color rgb(a) color code. * @return string color in HEX format. */ function sinatra_rgba2hex( $color ) { preg_match( '/rgba?\(\s?([0-9]{1,3}),\s?([0-9]{1,3}),\s?([0-9]{1,3})/i', $color, $matches ); if ( ! is_array( $matches ) || count( $matches ) < 3 ) { return false; } $hex = ''; for ( $i = 1; $i <= 3; $i++ ) { $x = dechex( (int) $matches[ $i ] ); $hex .= ( 1 === strlen( $x ) ) ? '0' . $x : $x; } if ( $hex ) { return '#' . $hex; } return false; } /** * Lightens/darkens a given colour (in hex format), returning the altered color in hex format. * * @since 1.0.0 * @param string $hexcolor Color as hexadecimal (with or without hash). * @param float $percent Decimal ( 0.2 = lighten by 20%, -0.4 = darken by 40% ). * @return string Lightened/Darkend color as hexadecimal (with hash) */ function sinatra_luminance( $hexcolor, $percent ) { if ( empty( $hexcolor ) ) { return; } // Check if color is in RGB format and convert to HEX. if ( false !== strpos( $hexcolor, 'rgb' ) ) { $hexcolor = sinatra_rgba2hex( $hexcolor ); } if ( strlen( $hexcolor ) < 6 ) { $hexcolor = $hexcolor[0] . $hexcolor[0] . $hexcolor[1] . $hexcolor[1] . $hexcolor[2] . $hexcolor[2]; } $hexcolor = array_map( 'hexdec', str_split( str_pad( str_replace( '#', '', $hexcolor ), 6, '0' ), 2 ) ); foreach ( $hexcolor as $i => $color ) { $from = $percent < 0 ? 0 : $color; $to = $percent < 0 ? $color : 255; $pvalue = ceil( ( $to - $from ) * $percent ); $hexcolor[ $i ] = str_pad( dechex( $color + $pvalue ), 2, '0', STR_PAD_LEFT ); } // Return hex color. return '#' . implode( $hexcolor ); } /** * Determine whether a hex color is light. * * @param mixed $color Color. * @return bool True if a light color. */ function sinatra_is_light_color( $color ) { // Ensure we color is in hex format. if ( false !== strpos( $color, 'rgb' ) ) { $color = sinatra_rgba2hex( $color ); } $hex = str_replace( '#', '', $color ); $c_r = hexdec( substr( $hex, 0, 2 ) ); $c_g = hexdec( substr( $hex, 2, 2 ) ); $c_b = hexdec( substr( $hex, 4, 2 ) ); $brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) / 1000; return $brightness > 155; } /** * Detect if we should use a light or dark color on a background color. * * @param mixed $color Color. * @param string $dark Darkest reference. Defaults to '#000000'. * @param string $light Lightest reference. Defaults to '#FFFFFF'. * @return string */ function sinatra_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) { return sinatra_is_light_color( $color ) ? $dark : $light; } if ( ! function_exists( 'sinatra_get_prop' ) ) : /** * Get a specific property of an array without needing to check if that property exists. * * Provide a default value if you want to return a specific value if the property is not set. * * @since 1.0.0 * * @param array $array Array from which the property's value should be retrieved. * @param string $prop Name of the property to be retrieved. * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null. * * @return null|string|mixed The value */ function sinatra_get_prop( $array, $prop, $default = null ) { if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) { return $default; } if ( isset( $array[ $prop ] ) ) { $value = $array[ $prop ]; } else { $value = ''; } return empty( $value ) && null !== $default ? $default : $value; } endif; /** * Print objects to error log. * * @since 1.0.0 * @param string $object Object to be printed. */ function sinatra_log( $object ) { // phpcs:disable ob_start(); print_r( $object ); error_log( ob_get_clean() ); // phpcs:enable } /** * Returns blog page URL. * * @since 1.0.0 * @return String, current page URL. */ function sinatra_get_blog_url() { $blog_url = ''; // If front page is set to display a static page, get the URL of the posts page. if ( 'page' === get_option( 'show_on_front' ) ) { $page_for_posts = get_option( 'page_for_posts' ); if ( $page_for_posts ) { $blog_url = get_permalink( $page_for_posts ); } } else { // The front page IS the posts page. Get its URL. $blog_url = home_url( '/' ); } return apply_filters( 'sinatra_site_url', $blog_url ); } /** * Returns array of default values for Design Options field. * * @since 1.0.0 * @param array $options Default options. * @return array $defaults array of default values. */ function sinatra_design_options_defaults( $options = array() ) { $defaults = array(); // Background options. if ( isset( $options['background'] ) ) { // Default background type. if ( isset( $options['background']['background-type'] ) && in_array( $options['background']['background-type'], array( 'color', 'image', 'gradient' ), true ) ) { $defaults['background-type'] = $options['background']['background-type']; } else { $defaults['background-type'] = 'color'; } // Background color defaults. if ( isset( $options['background']['color'] ) ) { $defaults += wp_parse_args( (array) $options['background']['color'], array( 'background-color' => '', ) ); } // Background image defaults. if ( isset( $options['background']['image'] ) ) { $defaults += wp_parse_args( (array) $options['background']['image'], array( 'background-image' => '', 'background-repeat' => 'no-repeat', 'background-position-x' => '50', 'background-position-y' => '50', 'background-size' => 'cover', 'background-attachment' => 'inherit', 'background-image-id' => '', 'background-color-overlay' => 'rgba(0,0,0,0.5)', ) ); } // Background gradient defaults. if ( isset( $options['background']['gradient'] ) ) { $defaults += wp_parse_args( (array) $options['background']['gradient'], array( 'gradient-color-1' => '#16222A', 'gradient-color-1-location' => '0', 'gradient-color-2' => '#3A6073', 'gradient-color-2-location' => '100', 'gradient-type' => 'linear', 'gradient-linear-angle' => '45', 'gradient-position' => 'center center', ) ); } } // Border default. if ( isset( $options['border'] ) ) { $defaults += wp_parse_args( (array) $options['border'], array( 'border-left-width' => '', 'border-top-width' => '', 'border-right-width' => '', 'border-bottom-width' => '', 'border-color' => '', 'style' => 'solid', 'separator-color' => '', ) ); } // Color default. if ( isset( $options['color'] ) ) { $defaults += wp_parse_args( (array) $options['color'], array( 'text-color' => '', 'link-color' => '', 'link-hover-color' => '', ) ); } return apply_filters( 'sinatra_design_options_defaults', $defaults, $options ); } /** * Returns array of default values for Typography field. * * @since 1.0.0 * @param array $options Default options. * @return array $defaults array of default values. */ function sinatra_typography_defaults( $options = array() ) { $defaults = apply_filters( 'sinatra_typography_defaults', array( 'font-family' => 'inherit', 'font-subsets' => array(), 'font-weight' => '400', 'font-style' => 'inherit', 'text-transform' => 'inherit', 'text-decoration' => 'inherit', 'font-size-desktop' => '', 'font-size-tablet' => '', 'font-size-mobile' => '', 'font-size-unit' => 'px', 'letter-spacing' => '0', 'letter-spacing-unit' => 'px', 'line-height-desktop' => '', 'line-height-tablet' => '', 'line-height-mobile' => '', 'line-height-unit' => '', ) ); $options = wp_parse_args( $options, $defaults ); return $options; } if ( ! function_exists( 'sinatra_enable_page_builder_compatibility' ) ) : /** * Allow filter to enable/disable page builder compatibility. * * @since 1.0.0 * * @return bool True - If the page builder compatibility is enabled. False - IF the page builder compatibility is disabled. */ function sinatra_enable_page_builder_compatibility() { return apply_filters( 'sinatra_enable_page_builder_compatibility', true ); } endif; /** * Insert into array before specified key. * * @since 1.0.0 * @param array $array Array to be modified. * @param array $pairs Array of key => value pairs to insert. * @param mixed $key Key of $array to insert before or after. * @param string $position Before or after $key. * @return array $result Array with inserted $new value. */ function sinatra_array_insert( $array, $pairs, $key, $position = 'after' ) { $key_pos = array_search( $key, array_keys( $array ), true ); if ( 'after' === $position ) { $key_pos++; } if ( false !== $key_pos ) { $result = array_slice( $array, 0, $key_pos ); $result = array_merge( $result, $pairs ); $result = array_merge( $result, array_slice( $array, $key_pos ) ); } else { $result = array_merge( $array, $pairs ); } return $result; } /** * Get background color based on site layout. * * @since 1.0.0 * @return string Background color. */ function sinatra_get_background_color() { $site_layout = sinatra_get_site_layout(); if ( in_array( $site_layout, array( 'boxed', 'boxed-separated' ), true ) ) { $background_color = sinatra_option( 'boxed_content_background_color' ); } else { $background_color = '#' . get_background_color(); } return $background_color; } /** * Check if a section is disabled. * * @since 1.1.0 * * @param array $disabled_on Array of pages where the section is disabled. * @param int $post_id Current page ID. * @return bool Section is displayed. */ function sinatra_is_section_disabled( $disabled_on = array(), $post_id = 0 ) { $disabled = false; if ( is_front_page() && in_array( 'home', $disabled_on, true ) ) { $disabled = true; } elseif ( is_home() && in_array( 'posts_page', $disabled_on, true ) ) { $disabled = true; } elseif ( is_search() && in_array( 'search', $disabled_on, true ) ) { $disabled = true; } elseif ( is_archive() && in_array( 'archive', $disabled_on, true ) ) { $disabled = true; } elseif ( is_404() && in_array( '404', $disabled_on, true ) ) { $disabled = true; } elseif ( is_singular() || ! empty( $post_id ) ) { if ( empty( $post_id ) ) { $post_id = sinatra_get_the_id(); } if ( in_array( get_post_type( $post_id ), $disabled_on, true ) ) { $disabled = true; } } return $disabled; } /** * Get all the registered image sizes along with their dimensions. * * @since 1.1.0 * @return array $image_sizes The image sizes */ function sinatra_get_image_sizes() { global $_wp_additional_image_sizes; $default_image_sizes = get_intermediate_image_sizes(); foreach ( $default_image_sizes as $size ) { $image_sizes[ $size ]['width'] = intval( get_option( "{$size}_size_w" ) ); $image_sizes[ $size ]['height'] = intval( get_option( "{$size}_size_h" ) ); $image_sizes[ $size ]['crop'] = get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false; } if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) { $image_sizes = array_merge( $image_sizes, $_wp_additional_image_sizes ); } $image_sizes['full'] = array( 'width' => '', 'height' => '', 'crop' => '', ); return $image_sizes; } compatibility/back-compat.php000064400000005331151231536700012314 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Prevent switching to Highend X on old versions of WordPress. * * Switches to the default theme. * * @since 1.0.0 */ function sinatra_switch_theme() { switch_theme( WP_DEFAULT_THEME ); unset( $_GET['activated'] ); // phpcs:ignore add_action( 'admin_notices', 'sinatra_upgrade_notice' ); } add_action( 'after_switch_theme', 'sinatra_switch_theme' ); /** * Adds a message for unsuccessful theme switch. * * Prints an update nag after an unsuccessful attempt to switch to * Sinatra on WordPress versions prior to 4.7. * * @since 1.0.0 * @global string $wp_version WordPress version. */ function sinatra_upgrade_notice() { /* translators: %s WordPress version */ $message = sprintf( esc_html__( 'Sinatra theme requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'sinatra' ), $GLOBALS['wp_version'] ); printf( '

        %s

        ', esc_html( $message ) ); } /** * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. * * @since 1.0.0 * @global string $wp_version WordPress version. */ function sinatra_customize_prevent() { /* translators: %s WordPress version */ $message = sprintf( esc_html__( 'Sinatra theme requires at least WordPress version 4.7. You are running version %s. Please upgrade your WordPress and try again.', 'sinatra' ), $GLOBALS['wp_version'] ); wp_die( esc_html( $message ), '', array( 'back_link' => true ) ); } add_action( 'load-customize.php', 'sinatra_customize_prevent' ); /** * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. * * @since 1.0.0 * @global string $wp_version WordPress version. */ function sinatra_preview_prevent() { if ( isset( $_GET['preview'] ) ) { // phpcs:ignore /* translators: %s WordPress version */ $message = sprintf( esc_html__( 'Sinatra theme requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'sinatra' ), $GLOBALS['wp_version'] ); wp_die( esc_html( $message ) ); } } add_action( 'template_redirect', 'sinatra_preview_prevent' ); if ( ! function_exists( 'wp_body_open' ) ) { /** * Backward compatibility for wp_body_open hook. * * @since 1.0.0 */ function wp_body_open() { // phpcs:ignore do_action( 'wp_body_open' ); // phpcs:ignore } } compatibility/class-sinatra-beaver-themer.php000064400000012216151231536700015423 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Return if Beaver Themer not active. if ( ! class_exists( 'FLThemeBuilderLoader' ) || ! class_exists( 'FLThemeBuilderLayoutData' ) ) { return; } // PHP 5.3+ is required. if ( ! version_compare( PHP_VERSION, '5.3', '>=' ) ) { return; } if ( ! class_exists( 'Sinatra_Beaver_Themer' ) ) : /** * Beaver Themer compatibility. */ class Sinatra_Beaver_Themer { /** * Singleton instance of the class. * * @var object */ private static $instance; /** * Instance. * * @since 1.0.0 * @return Sinatra_Beaver_Themer */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Beaver_Themer ) ) { self::$instance = new Sinatra_Beaver_Themer(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 * @return void */ public function __construct() { add_action( 'after_setup_theme', array( $this, 'add_theme_support' ) ); add_action( 'wp', array( $this, 'header_footer_render' ) ); add_action( 'wp', array( $this, 'page_header_render' ) ); add_filter( 'fl_theme_builder_part_hooks', array( $this, 'register_part_hooks' ) ); } /** * Add theme support * * @since 1.0.0 */ public function add_theme_support() { add_theme_support( 'fl-theme-builder-headers' ); add_theme_support( 'fl-theme-builder-footers' ); add_theme_support( 'fl-theme-builder-parts' ); } /** * Update header/footer with Beaver template * * @since 1.0.0 */ public function header_footer_render() { // Get the header ID. $header_ids = FLThemeBuilderLayoutData::get_current_page_header_ids(); // If we have a header, remove the theme header and hook in Theme Builder's. if ( ! empty( $header_ids ) ) { // Remove Top Bar. remove_action( 'sinatra_header', 'sinatra_topbar_output', 10 ); // Remove Main Header. remove_action( 'sinatra_header', 'sinatra_header_output', 20 ); // Replacement header. add_action( 'sinatra_header', 'FLThemeBuilderLayoutRenderer::render_header' ); } // Get the footer ID. $footer_ids = FLThemeBuilderLayoutData::get_current_page_footer_ids(); // If we have a footer, remove the theme footer and hook in Theme Builder's. if ( ! empty( $footer_ids ) ) { // Remove Main Footer. remove_action( 'sinatra_footer', 'sinatra_footer_output', 20 ); // Remove Copyright Bar. remove_action( 'sinatra_footer', 'sinatra_copyright_bar_output', 30 ); // Replacement footer. add_action( 'sinatra_footer', 'FLThemeBuilderLayoutRenderer::render_footer' ); } } /** * Remove page header if using Beaver Themer. * * @since 1.0.0 */ public function page_header_render() { // Get the page ID. $page_ids = FLThemeBuilderLayoutData::get_current_page_content_ids(); // If we have a content layout, remove the theme page header. if ( ! empty( $page_ids ) ) { remove_action( 'sinatra_page_header', 'sinatra_page_header_template' ); } } /** * Register hooks * * @since 1.0.0 */ public function register_part_hooks() { return array( array( 'label' => 'Header', 'hooks' => array( 'sinatra_before_masthead' => esc_html__( 'Before Header', 'sinatra' ), 'sinatra_after_masthead' => esc_html__( 'After Header', 'sinatra' ), ), ), array( 'label' => 'Main', 'hooks' => array( 'sinatra_before_main' => esc_html__( 'Before Main', 'sinatra' ), 'sinatra_after_main' => esc_html__( 'After Main', 'sinatra' ), ), ), array( 'label' => 'Content', 'hooks' => array( 'sinatra_before_page_content' => esc_html__( 'Before Content', 'sinatra' ), 'sinatra_after_page_content' => esc_html__( 'After Content', 'sinatra' ), ), ), array( 'label' => 'Footer', 'hooks' => array( 'sinatra_before_colophon' => esc_html__( 'Before Footer', 'sinatra' ), 'sinatra_after_colophon' => esc_html__( 'After Footer', 'sinatra' ), ), ), array( 'label' => 'Sidebar', 'hooks' => array( 'sinatra_before_sidebar' => esc_html__( 'Before Sidebar', 'sinatra' ), 'sinatra_after_sidebar' => esc_html__( 'After Sidebar', 'sinatra' ), ), ), array( 'label' => 'Singular', 'hooks' => array( 'sinatra_before_singular' => __( 'Before Singular', 'sinatra' ), 'sinatra_after_singular' => __( 'After Singular', 'sinatra' ), 'sinatra_before_comments' => __( 'Before Comments', 'sinatra' ), 'sinatra_after_comments' => __( 'After Comments', 'sinatra' ), 'sinatra_before_single_content' => __( 'Before Single Content', 'sinatra' ), 'sinatra_after_single_content' => __( 'After Single Content', 'sinatra' ), ), ), ); } } endif; /** * Returns the one Sinatra_Beaver_Themer instance. */ function sinatra_beaver_themer() { return Sinatra_Beaver_Themer::instance(); } sinatra_beaver_themer(); compatibility/class-sinatra-elementor-pro.php000064400000011021151231536700015456 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Return if Elementor not active. if ( ! class_exists( '\Elementor\Plugin' ) || ! class_exists( 'ElementorPro\Modules\ThemeBuilder\Module' ) ) { return; } // PHP 5.3+ is required. if ( ! version_compare( PHP_VERSION, '5.3', '>=' ) ) { return; } if ( ! class_exists( 'Sinatra_Elementor_Pro' ) ) : /** * Elementor compatibility. */ class Sinatra_Elementor_Pro { /** * Singleton instance of the class. * * @var object */ private static $instance; /** * Elementor location manager * * @var object */ public $elementor_location_manager; /** * Instance. * * @since 1.0.0 * @return Sinatra_Elementor_Pro */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Elementor_Pro ) ) { self::$instance = new Sinatra_Elementor_Pro(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 * @return void */ public function __construct() { // Register theme locations. add_action( 'elementor/theme/register_locations', array( $this, 'register_locations' ) ); // Override templates. add_action( 'sinatra_header', array( $this, 'do_header' ), 0 ); add_action( 'sinatra_footer', array( $this, 'do_footer' ), 0 ); add_action( 'sinatra_content_404', array( $this, 'do_content_none' ), 0 ); add_action( 'sinatra_content_single', array( $this, 'do_content_single_post' ), 0 ); add_action( 'sinatra_content_page', array( $this, 'do_content_single_page' ), 0 ); add_action( 'sinatra_content_archive', array( $this, 'do_archive' ), 0 ); } /** * Register Theme Location for Elementor. * * @param object $manager Elementor object. * @since 1.0.0 * @return void */ public function register_locations( $manager ) { $manager->register_all_core_location(); $this->elementor_location_manager = \ElementorPro\Modules\ThemeBuilder\Module::instance()->get_locations_manager(); // phpcs:ignore } /** * Override Header. * * @since 1.0.0 * @return void */ public function do_header() { $did_location = $this->elementor_location_manager->do_location( 'header' ); if ( $did_location ) { remove_action( 'sinatra_header', 'sinatra_topbar_output', 10 ); remove_action( 'sinatra_header', 'sinatra_header_output', 20 ); } } /** * Override Footer. * * @since 1.0.0 * @return void */ public function do_footer() { $did_location = $this->elementor_location_manager->do_location( 'footer' ); if ( $did_location ) { remove_action( 'sinatra_footer', 'sinatra_footer_output', 20 ); remove_action( 'sinatra_footer', 'sinatra_copyright_bar_output', 30 ); } } /** * Override Footer. * * @since 1.0.0 * @return void */ public function do_content_none() { if ( ! is_404() ) { return; } $did_location = $this->elementor_location_manager->do_location( 'single' ); if ( $did_location ) { remove_action( 'sinatra_content_404', 'sinatra_404_page_content' ); } } /** * Override Single Post. * * @since 1.0.0 * @return void */ public function do_content_single_post() { $did_location = $this->elementor_location_manager->do_location( 'single' ); if ( $did_location ) { remove_action( 'sinatra_content_single', 'sinatra_content_single' ); remove_action( 'sinatra_after_singular', 'sinatra_output_comments' ); } } /** * Override Single Page. * * @since 1.0.0 * @return void */ public function do_content_single_page() { $did_location = $this->elementor_location_manager->do_location( 'single' ); if ( $did_location ) { remove_action( 'sinatra_content_page', 'sinatra_content_page' ); remove_action( 'sinatra_after_singular', 'sinatra_output_comments' ); } } /** * Override Archive. * * @since 1.0.0 * @return void */ public function do_archive() { $did_location = $this->elementor_location_manager->do_location( 'archive' ); if ( $did_location ) { remove_action( 'sinatra_before_content', 'sinatra_archive_info' ); remove_action( 'sinatra_content_archive', 'sinatra_content' ); } } } endif; /** * Returns the one Sinatra_Elementor_Pro instance. */ function sinatra_elementor_pro() { return Sinatra_Elementor_Pro::instance(); } sinatra_elementor_pro(); compatibility/class-sinatra-elementor.php000064400000010670151231536700014671 0ustar00 * @since 1.0.0 */ namespace Elementor; // phpcs:ignore /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Return if Elementor not active. if ( ! class_exists( '\Elementor\Plugin' ) ) { return; } if ( ! class_exists( 'Sinatra_Elementor' ) ) : /** * Elementor compatibility. */ class Sinatra_Elementor { /** * Singleton instance of the class. * * @var object */ private static $instance; /** * Instance. * * @since 1.0.0 * @return Sinatra_Elementor */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Elementor ) ) { self::$instance = new Sinatra_Elementor(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 * @return void */ public function __construct() { // Enqueue Elementor editor styles. add_action( 'elementor/preview/enqueue_styles', array( $this, 'enqueue_editor_style' ) ); // Setup postdata for Elementor pages. add_action( 'wp', array( $this, 'setup_postdata' ), 1 ); add_action( 'elementor/preview/init', array( $this, 'setup_postdata' ), 5 ); // Enqueue additional Elementor styles. add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_additional' ) ); } /** * Editor stylesheet. * * @since 1.0.0 */ public function enqueue_editor_style() { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( 'sinatra-elementor-editor', SINATRA_THEME_URI . '/assets/css/compatibility/elementor-editor-style' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); } /** * Setup default postdata for Elementor pages. * * @since 1.0.0 * * @return void */ public function setup_postdata() { // Page builder compatibility disabled. if ( ! sinatra_enable_page_builder_compatibility() ) { return; } // Skip posts. if ( 'post' === get_post_type() ) { return; } // Don't modify postdata if we are not on Elementor's edit page. if ( ! $this->is_elementor_editor() ) { return; } global $post; $id = sinatra_get_the_id(); $setup = get_post_meta( $id, '_sinatra_page_builder_setup', true ); if ( isset( $post ) && empty( $setup ) && ( is_admin() || is_singular() ) && empty( $post->post_content ) && $this->is_built_with_elementor( $id ) ) { update_post_meta( $id, '_sinatra_page_builder_setup', true ); update_post_meta( $id, 'sinatra_disable_page_title', true ); update_post_meta( $id, 'sinatra_disable_breadcrumbs', true ); update_post_meta( $id, 'sinatra_disable_thumbnail', true ); update_post_meta( $id, 'sinatra_sidebar_position', 'no-sidebar' ); update_post_meta( $id, '_wp_page_template', 'page-templates/template-sinatra-fullwidth.php' ); } } /** * Additional Elementor styles. * * @since 1.0.0 */ public function enqueue_additional() { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Enqueue theme stylesheet. wp_enqueue_style( 'sinatra-elementor', SINATRA_THEME_URI . '/assets/css/compatibility/elementor' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); } /** * Check if page is built with elementor. * * @param int $id Post/Page Id. * @since 1.0.0 * * @return boolean */ public function is_built_with_elementor( $id ) { if ( version_compare( ELEMENTOR_VERSION, '1.5.0', '<' ) ) { return ( 'builder' === Plugin::$instance->db->get_edit_mode( $id ) ); } else { return Plugin::$instance->db->is_built_with_elementor( $id ); } } /** * Check if Elementor Editor is loaded. * * @since 1.0.0 * * @return boolean Elementor editor is loaded. */ private function is_elementor_editor() { return ( isset( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ); // phpcs:ignore } } endif; /** * Returns the one Sinatra_Elementor instance. */ function sinatra_elementor() { return Sinatra_Elementor::instance(); } sinatra_elementor(); compatibility/class-sinatra-endurance.php000064400000036362151231536700014651 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( 'BlueHost' !== get_option( 'mm_brand' ) ) { return; } if ( ! class_exists( 'Sinatra_Endurance' ) ) : /** * Sinatra integration for Bluehost */ class Sinatra_Endurance { /** * Singleton instance of the class. * * @var object */ private static $instance; /** * Main Sinatra_Endurance Instance. * * @since 1.0.0 * @return Sinatra_Endurance */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Endurance ) ) { self::$instance = new Sinatra_Endurance(); } return self::$instance; } /** * Constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_action( 'customize_register', array( $this, 'register_options' ), 11 ); /** * Add WP Pointers. */ add_action( 'admin_enqueue_scripts', array( $this, 'add_pointers' ) ); /** * Script to handle WP Pointers interaction. */ add_action( 'admin_print_footer_scripts', array( $this, 'add_pointers_script' ) ); /** * Ajax handler to restart the Customizer Tour. */ add_action( 'wp_ajax_sinatra_start_customizer_tour', array( $this, 'start_customizer_tour' ) ); /** * Modify recommended plugins. */ add_filter( 'sinatra_recommended_plugins', array( $this, 'recommended_plugins' ) ); } /** * Registers custom options in Customizer. * * @since 1.0.0 * @param WP_Customize_Manager $customizer Instance of WP_Customize_Manager class. */ public function register_options( $customizer ) { // Help section in Customizer. if ( class_exists( 'Sinatra_Customizer_Control_Button' ) ) { $customizer->add_section( 'sinatra_section_help', array( 'title' => esc_html__( 'Help', 'sinatra' ), 'priority' => 999, ) ); // Reset tour. $customizer->add_setting( 'sinatra_help_reset_tour', array( 'sanitize_callback' => 'sinatra_no_sanitize', ) ); $customizer->add_control( new Sinatra_Customizer_Control_Button( $customizer, 'sinatra_help_reset_tour', array( 'label' => esc_html__( 'Take a Tour', 'sinatra' ), 'section' => 'sinatra_section_help', 'ajax_action' => 'sinatra_start_customizer_tour', 'button_text' => esc_html__( 'Start Tour', 'sinatra' ), 'settings' => 'sinatra_help_reset_tour', 'priority' => 10, ) ) ); // Sinatra docs. $customizer->add_setting( 'sinatra_help_sinatra_docs', array( 'sanitize_callback' => 'sinatra_no_sanitize', ) ); $customizer->add_control( new Sinatra_Customizer_Control_Button( $customizer, 'sinatra_help_sinatra_docs', array( 'label' => esc_html__( 'Sinatra Theme Guide', 'sinatra' ), 'section' => 'sinatra_section_help', 'button_text' => esc_html__( 'Help Articles', 'sinatra' ), 'button_url' => 'https://sinatrawp.com/docs/', 'settings' => 'sinatra_help_sinatra_docs', 'priority' => 20, ) ) ); // Customizer docs. $customizer->add_setting( 'sinatra_help_customizer_docs', array( 'sanitize_callback' => 'sinatra_no_sanitize', ) ); $customizer->add_control( new Sinatra_Customizer_Control_Button( $customizer, 'sinatra_help_customizer_docs', array( 'label' => esc_html__( 'WordPress Customizer Tutorial', 'sinatra' ), 'section' => 'sinatra_section_help', 'button_text' => esc_html__( 'Customizer Guide', 'sinatra' ), 'button_url' => 'https://sinatrawp.com/docs/the-ultimate-guide-to-the-wordpress-customizer/', 'settings' => 'sinatra_help_customizer_docs', 'priority' => 30, ) ) ); } } /** * Create pointers for current screen. * * @since 1.0.0 */ public function add_pointers() { $current_screen = get_current_screen(); if ( ! $current_screen ) { return; } $pointers = array(); // Get all pointers. switch ( $current_screen->id ) { case 'customize': $pointers = $this->customizer_pointers(); break; default: break; } // Check if any pointers are to be displayed. if ( empty( $pointers ) ) { return; } // Filter out dismissed pointers. $dismissed = get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ); $dismissed = explode( ',', (string) $dismissed ); foreach ( $pointers as $pointer_id => $pointer ) { if ( in_array( $pointer_id, $dismissed, true ) ) { $this->pointers = array(); break; } if ( empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) { $this->pointers = array(); break; } $this->pointers[ $pointer_id ] = $pointer; } // Check if any pointers are to be displayed. if ( empty( $this->pointers ) ) { return; } // Enqueue pointer script. wp_enqueue_style( 'wp-pointer' ); wp_enqueue_script( 'wp-pointer' ); } /** * Customizer pointers. * * @since 1.0.0 */ public function customizer_pointers() { $pointers = array( 'sinatra-pointer-01' => array( 'id' => 'sinatra-pointer-01', 'target' => '#customize-info', 'next' => 'sinatra-pointer-02', 'options' => array( 'content' => '

        WordPress + Bluehost

        ' . esc_html__( 'Welcome to your WordPress Site! Let us give you a quick overview to help you customize your website’s design. Or, come back to this tour at any time in the “Help” tab.', 'sinatra' ) . '

        ', 'position' => array( 'edge' => 'left', 'align' => 'top', ), ), 'focus' => array( 'type' => 'root', ), 'arrow' => 'arrow-top', ), 'sinatra-pointer-02' => array( 'id' => 'sinatra-pointer-02', 'target' => '#accordion-section-themes', 'previous' => 'sinatra-pointer-01', 'next' => 'sinatra-pointer-03', 'options' => array( 'content' => '

        ' . esc_html__( 'Your website design and theme', 'sinatra' ) . '

        ' . '

        ' . sprintf( wp_kses( 'To help you get building as fast as possible, we pre-installed our favorite theme, %3$sSinatra%4$s, but you can change this theme at any time. %1$sRead more about Sinatra.%2$s', sinatra_get_allowed_html_tags() ), '', '', '', '' ) . '

        ', 'position' => array( 'edge' => 'left', 'align' => 'middle', ), ), 'focus' => array( 'type' => 'root', ), ), 'sinatra-pointer-03' => array( 'id' => 'sinatra-pointer-03', 'target' => '#accordion-panel-sinatra_panel_general', 'previous' => 'sinatra-pointer-02', 'next' => 'sinatra-pointer-04', 'options' => array( 'content' => '

        ' . esc_html__( 'Customize your design', 'sinatra' ) . '

        ' . '

        ' . esc_html__( 'Give your site a personalized look. Here you can change your site layout, colors, fonts and more.', 'sinatra' ) . '

        ', 'position' => array( 'edge' => 'left', 'align' => 'middle', ), ), 'focus' => array( 'type' => 'root', ), ), 'sinatra-pointer-04' => array( 'id' => 'sinatra-pointer-04', 'target' => '#accordion-panel-sinatra_panel_blog', 'previous' => 'sinatra-pointer-03', 'next' => 'sinatra-pointer-05', 'options' => array( 'content' => '

        ' . esc_html__( 'Change your blog layout or location', 'sinatra' ) . '

        ' . '

        ' . esc_html__( 'Customize the look and feel of your blog and introduce yourself to your viewers, customers or the world.', 'sinatra' ) . '

        ', 'position' => array( 'edge' => 'left', 'align' => 'middle', ), ), 'focus' => array( 'type' => 'root', ), ), 'sinatra-pointer-05' => array( 'id' => 'sinatra-pointer-05', 'target' => '#customize-header-actions', 'previous' => 'sinatra-pointer-04', 'options' => array( 'content' => '

        ' . esc_html__( 'Save, preview, publish or exit', 'sinatra' ) . '

        ' . '

        ' . esc_html__( 'Done for now? Save, preview, publish or schedule when you want to publish the latest edits to your site. Or, close the customizer to go to your WordPress dashboard to modify your website’s settings or preferences. ', 'sinatra' ) . '

        ', 'position' => array( 'edge' => 'top', 'align' => 'left', ), ), 'focus' => array( 'type' => 'root', ), ), ); return $pointers; } /** * Print JavaScript if pointers are available. * * @since 1.0.0 */ public function add_pointers_script() { if ( empty( $this->pointers ) ) { return; } $pointers = wp_json_encode( $this->pointers ); // phpcs:disable echo " "; // phpcs:enable } /** * AJAX handler to reset WP Pointers for the customizer tour. * * @since 1.0.0 */ public function start_customizer_tour() { // Security check. check_ajax_referer( 'sinatra_customizer' ); $customizer_pointers = $this->customizer_pointers(); if ( ! empty( $customizer_pointers ) ) { $dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) ); foreach ( $customizer_pointers as $pointer => $config ) { $key = array_search( $pointer, $dismissed, true ); if ( false !== $key ) { unset( $dismissed[ $key ] ); } } $dismissed = implode( ',', $dismissed ); update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed ); // Reload page and start the tour. wp_send_json_success( array( 'reload' => true ) ); } // Error. wp_send_json_error(); } /** * Modify recommended plugins for Endurance users. * * @since 1.0.0 * @param Array $plugins Array of recommended plugins. * @return Array Modified array of recommended plugins. */ public function recommended_plugins( $plugins ) { if ( is_array( $plugins ) && ! empty( $plugins ) ) { foreach ( $plugins as $slug => $plugin ) { if ( isset( $plugin['endurance'] ) && false === $plugin['endurance'] ) { unset( $plugins[ $slug ] ); } } } return $plugins; } } endif; /** * The function which returns the one Sinatra_Endurance instance. */ function sinatra_endurance() { return Sinatra_Endurance::instance(); } sinatra_endurance(); compatibility/class-sinatra-hfe.php000064400000004235151231536700013441 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Return if Elementor not active. if ( ! class_exists( '\Elementor\Plugin' ) ) { return; } // Return if HFE not active. if ( ! class_exists( 'Header_Footer_Elementor' ) ) { return false; } if ( ! class_exists( 'Sinatra_HFE' ) ) : /** * HFE compatibility. */ class Sinatra_HFE { /** * Singleton instance of the class. * * @var object */ private static $instance; /** * Instance. * * @since 1.0.0 * @return Sinatra_HFE */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_HFE ) ) { self::$instance = new Sinatra_HFE(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 * @return void */ public function __construct() { add_action( 'after_setup_theme', array( $this, 'add_theme_support' ) ); add_action( 'sinatra_header', array( $this, 'do_header' ), 0 ); add_action( 'sinatra_footer', array( $this, 'do_footer' ), 0 ); } /** * Add theme support * * @since 1.0.0 */ public function add_theme_support() { add_theme_support( 'header-footer-elementor' ); } /** * Override Header * * @since 1.0.0 * @return void */ public function do_header() { if ( ! hfe_header_enabled() ) { return; } hfe_render_header(); remove_action( 'sinatra_header', 'sinatra_topbar_output', 10 ); remove_action( 'sinatra_header', 'sinatra_header_output', 20 ); } /** * Override Footer * * @since 1.0.0 * @return void */ public function do_footer() { if ( ! hfe_footer_enabled() ) { return; } hfe_render_footer(); remove_action( 'sinatra_footer', 'sinatra_footer_output', 20 ); remove_action( 'sinatra_footer', 'sinatra_copyright_bar_output', 30 ); } } endif; /** * Returns the one Sinatra_HFE instance. */ function sinatra_hfe() { return Sinatra_HFE::instance(); } sinatra_hfe(); compatibility/class-sinatra-jetpack.php000064400000005275151231536700014325 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } // Check if Jetpack is installed & activated. if ( ! class_exists( 'Jetpack' ) ) { return; } if ( ! class_exists( 'Sinatra_Jetpack' ) ) : /** * Jetpack compatibility class. */ class Sinatra_Jetpack { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { add_action( 'after_setup_theme', array( $this, 'jetpack_supports' ) ); add_filter( 'infinite_scroll_credit', array( $this, 'tweak_credits_link' ) ); add_filter( 'infinite_scroll_js_settings', array( $this, 'filter_infinite_scroll_js_settings' ) ); } /** * Add Jetpack theme supports. * * @since 1.0.0 */ public function jetpack_supports() { /** * Add theme support for Infinite Scroll. */ add_theme_support( 'infinite-scroll', array( 'container' => 'content', 'render' => array( $this, 'infinite_scroll_render' ), 'footer' => 'page', 'posts_per_page' => get_option( 'posts_per_page' ), 'type' => 'click', ) ); /** * Add theme support for Responsive Videos. */ add_theme_support( 'jetpack-responsive-videos' ); /** * Add theme support for geo-location. */ add_theme_support( 'jetpack-geo-location' ); } /** * Custom render function for Infinite Scroll. * * @since 1.0.0 */ public function infinite_scroll_render() { // WooCommerce products. if ( function_exists( 'is_shop' ) && is_shop() || function_exists( 'is_product_taxonomy' ) && is_product_taxonomy() ) { // Shop & category pages handled by default. return; } else { while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content/content', sinatra_get_article_feed_layout() ); endwhile; } } /** * Tweak footer credits bar link. * * @since 1.0.0 */ public function tweak_credits_link() { return '' . esc_html__( 'Proudly powered by WordPress', 'sinatra' ) . ' | Sinatra Theme'; } /** * Filter Jetpack infinite scroll JS settings. * * @since 1.0.0 * @param array $settings Infinite Scroll JS settings. */ public function filter_infinite_scroll_js_settings( $settings ) { $settings['text'] = esc_html__( 'Load More', 'sinatra' ); return $settings; } } endif; new Sinatra_Jetpack(); compatibility/class-sinatra-wpforms.php000064400000001647151231536700014400 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_WPForms' ) ) : /** * WPForms compatibility class. */ class Sinatra_WPForms { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { add_action( 'activate_wpforms-lite/wpforms.php', array( $this, 'disable_redirect_on_activation' ), 20 ); // If WPForms is not activated then return. if ( ! class_exists( 'WPForms' ) ) { return; } } /** * Disable admin page redirect on plugin activation. * * @since 1.0.0 */ public function disable_redirect_on_activation() { delete_transient( 'wpforms_activation_redirect' ); } } endif; new Sinatra_WPForms(); compatibility/socialsnap/class-sinatra-socialsnap.php000064400000005315151231536700017167 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_SocialSnap' ) ) : /** * Social Snap compatibility class. */ class Sinatra_SocialSnap { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { add_action( 'activate_socialsnap/socialsnap.php', array( $this, 'disable_redirect_on_activation' ), 20 ); // If Social Snap is not activated then return. if ( ! class_exists( 'SocialSnap' ) ) { return; } // Filter Customizer options. add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ), 20 ); // Set default Customizer values. add_filter( 'sinatra_default_option_values', array( $this, 'default_customizer_values' ), 20 ); // Remove Social Snap Lite from recommended plugins. add_filter( 'sinatra_recommended_plugins', array( $this, 'update_recommended_plugins' ) ); // Include helper functions. require SINATRA_THEME_PATH . '/inc/compatibility/socialsnap/socialsnap-functions.php'; // phpcs:ignore } /** * Disable admin page redirect on plugin activation. * * @since 1.0.0 */ public static function disable_redirect_on_activation() { delete_site_transient( 'socialsnap_activation_redirect' ); } /** * Filter options to include Social Snap. * * @since 1.1.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { $options['setting']['sinatra_single_post_meta_elements']['control']['choices']['shares'] = esc_html__( 'Shares', 'sinatra' ); $options['setting']['sinatra_blog_entry_meta_elements']['control']['choices']['shares'] = esc_html__( 'Shares', 'sinatra' ); return $options; } /** * Add defaults for Social Snap options. * * @param array $defaults Array of default values. * @return array Array of default values. */ public function default_customizer_values( $defaults ) { $defaults['sinatra_single_post_meta_elements']['shares'] = false; $defaults['sinatra_blog_entry_meta_elements']['shares'] = false; return $defaults; } /** * Removes Social Snap lite from recommended plugins if premium version of Social Snap is activated. * * @param array $plugins Plugins array. * @return array */ public function update_recommended_plugins( $plugins ) { // Check if pro version is installed. if ( socialsnap()->pro ) { unset( $plugins['socialsnap'] ); } return $plugins; } } endif; new Sinatra_SocialSnap(); compatibility/socialsnap/socialsnap-functions.php000064400000001454151231536700016433 0ustar00 * @since 1.1.0 */ if ( ! function_exists( 'sinatra_entry_meta_shares' ) ) : /** * Add share count information to entry meta. * * @since 1.1.0 */ function sinatra_entry_meta_shares() { $share_count = socialsnap_get_total_share_count(); // Icon. $icon = sinatra_get_meta_icon( 'share', '' ); $output = sprintf( '%3$s%1$s %2$s', socialsnap_format_number( $share_count ), esc_html( _n( 'Share', 'Shares', $share_count, 'sinatra' ) ), wp_kses_post( $icon ) ); echo wp_kses_post( apply_filters( 'sinatra_entry_share_count', $output ) ); } endif; compatibility/woocommerce/class-sinatra-customizer-widget-cart.php000064400000002000151231536700021616 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget_Cart' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget_Cart extends Sinatra_Customizer_Widget { /** * Primary class constructor. * * @since 1.0.0 * @param array $args An array of the values for this widget. */ public function __construct( $args = array() ) { parent::__construct( $args ); $this->name = esc_html__( 'Cart', 'sinatra' ); $this->description = esc_html__( 'Displays WooCommerce cart.', 'sinatra' ); $this->icon = 'dashicons dashicons-cart'; $this->type = 'cart'; } /** * Displays the form for this widget on the Widgets page of the WP Admin area. * * @since 1.0.0 * @return void */ public function form() {} } endif; compatibility/woocommerce/class-sinatra-customizer-woocommerce.php000064400000036020151231536700021734 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_WooCommerce' ) ) : /** * Sinatra WooCommerce section in Customizer. */ class Sinatra_Customizer_WooCommerce { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Registers our custom options in Customizer. add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ), 20 ); add_action( 'customize_register', array( $this, 'customizer_tweak' ), 20 ); // Add default values for WooCommerce options. add_filter( 'sinatra_default_option_values', array( $this, 'default_customizer_values' ) ); // Add localized strings to script. add_filter( 'sinatra_customizer_localized', array( $this, 'customizer_localized_strings' ) ); } /** * Add defaults for new WooCommerce customizer options. * * @param array $defaults Array of default values. * @return array Array of default values. */ public function default_customizer_values( $defaults ) { $defaults['sinatra_wc_product_gallery_lightbox'] = true; $defaults['sinatra_wc_product_gallery_zoom'] = true; $defaults['sinatra_shop_product_hover'] = 'none'; $defaults['sinatra_product_sale_badge'] = 'percentage'; $defaults['sinatra_product_sale_badge_text'] = esc_html__( 'Sale!', 'sinatra' ); $defaults['sinatra_wc_product_slider_arrows'] = true; $defaults['sinatra_wc_product_gallery_style'] = 'default'; $defaults['sinatra_wc_product_sidebar_position'] = 'no-sidebar'; $defaults['sinatra_wc_sidebar_position'] = 'no-sidebar'; $defaults['sinatra_wc_upsell_products'] = true; $defaults['sinatra_wc_upsells_columns'] = 4; $defaults['sinatra_wc_upsells_rows'] = 1; $defaults['sinatra_wc_related_products'] = true; $defaults['sinatra_wc_related_columns'] = 4; $defaults['sinatra_wc_related_rows'] = 1; $defaults['sinatra_wc_cross_sell_products'] = true; $defaults['sinatra_wc_cross_sell_rows'] = 1; $defaults['sinatra_product_catalog_elements'] = array( 'category' => true, 'title' => true, 'ratings' => true, 'price' => true, ); return $defaults; } /** * Tweak Customizer. * * @since 1.0.0 * @param WP_Customize_Manager $customizer Instance of WP_Customize_Manager class. */ public function customizer_tweak( $customizer ) { // Move WooCommerce panel. $customizer->get_panel( 'woocommerce' )->priority = 10; return $customizer; } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Shop image hover effect. $options['setting']['sinatra_shop_product_hover'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'woocommerce_product_catalog', 'label' => esc_html__( 'Product image hover', 'sinatra' ), 'description' => esc_html__( 'Effect for product image on hover', 'sinatra' ), 'choices' => array( 'none' => esc_html__( 'No Effect', 'sinatra' ), 'image-swap' => esc_html__( 'Image Swap', 'sinatra' ), ), ), ); // Sale badge. $options['setting']['sinatra_product_sale_badge'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'woocommerce_product_catalog', 'label' => esc_html__( 'Product sale badge', 'sinatra' ), 'description' => esc_html__( 'Choose what to display on the product sale badge.', 'sinatra' ), 'choices' => array( 'hide' => esc_html__( 'Hide badge', 'sinatra' ), 'percentage' => esc_html__( 'Show percentage', 'sinatra' ), 'text' => esc_html__( 'Show text', 'sinatra' ), ), ), ); // Sale badge text. $options['setting']['sinatra_product_sale_badge_text'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'control' => array( 'type' => 'sinatra-text', 'label' => esc_html__( 'Sale badge text', 'sinatra' ), 'description' => esc_html__( 'Add custom text for the product sale badge.', 'sinatra' ), 'placeholder' => esc_html__( 'Sale!', 'sinatra' ), 'section' => 'woocommerce_product_catalog', 'required' => array( array( 'control' => 'sinatra_product_sale_badge', 'value' => 'text', 'operator' => '==', ), ), ), ); // Catalog product elements. $options['setting']['sinatra_product_catalog_elements'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_sortable', 'control' => array( 'type' => 'sinatra-sortable', 'section' => 'woocommerce_product_catalog', 'label' => esc_html__( 'Product details', 'sinatra' ), 'description' => esc_html__( 'Set order and visibility for product details.', 'sinatra' ), 'choices' => array( 'title' => esc_html__( 'Title', 'sinatra' ), 'ratings' => esc_html__( 'Ratings', 'sinatra' ), 'price' => esc_html__( 'Price', 'sinatra' ), 'category' => esc_html__( 'Category', 'sinatra' ), ), ), ); // Section. $options['section']['sinatra_woocommerce_single_product'] = array( 'title' => esc_html__( 'Single Product', 'sinatra' ), 'priority' => 50, 'panel' => 'woocommerce', ); // Product Gallery Zoom. $options['setting']['sinatra_wc_product_gallery_zoom'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Gallery Zoom', 'sinatra' ), 'description' => esc_html__( 'Enable zoom effect when hovering product gallery.', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'space' => true, ), ); // Product Gallery Lightbox. $options['setting']['sinatra_wc_product_gallery_lightbox'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Gallery Lightbox', 'sinatra' ), 'description' => esc_html__( 'Open product gallery images in lightbox.', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'space' => true, ), ); // Product slider arrows. $options['setting']['sinatra_wc_product_slider_arrows'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Slider Arrows', 'sinatra' ), 'description' => esc_html__( 'Enable left and right arrows on product gallery slider.', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'space' => true, ), ); // Related Products. $options['setting']['sinatra_wc_related_products'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Related Products', 'sinatra' ), 'description' => esc_html__( 'Display related products.', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'space' => true, ), ); // Related product column count. $options['setting']['sinatra_wc_related_columns'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Related Products Columns', 'sinatra' ), 'description' => esc_html__( 'How many related products should be shown per row?', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'min' => 1, 'max' => 6, 'step' => 1, 'required' => array( array( 'control' => 'sinatra_wc_related_products', 'value' => true, 'operator' => '==', ), ), ), ); // Related product row count. $options['setting']['sinatra_wc_related_rows'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Related Products Rows', 'sinatra' ), 'description' => esc_html__( 'How many rows of related products should be shown?', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'min' => 1, 'max' => 5, 'step' => 1, 'required' => array( array( 'control' => 'sinatra_wc_related_products', 'value' => true, 'operator' => '==', ), ), ), ); // Up-Sell Products. $options['setting']['sinatra_wc_upsell_products'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Up-Sell Products', 'sinatra' ), 'description' => esc_html__( 'Display linked upsell products.', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'space' => true, ), ); // Up-Sells column count. $options['setting']['sinatra_wc_upsells_columns'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Up-Sell Products Columns', 'sinatra' ), 'description' => esc_html__( 'How many up-sell products should be shown per row?', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'min' => 1, 'max' => 6, 'step' => 1, 'required' => array( array( 'control' => 'sinatra_wc_upsell_products', 'value' => true, 'operator' => '==', ), ), ), ); // Up-Sells rows count. $options['setting']['sinatra_wc_upsells_rows'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Up-Sell Products Rows', 'sinatra' ), 'description' => esc_html__( 'How many rows of up-sell products should be shown?', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'min' => 1, 'max' => 6, 'step' => 1, 'required' => array( array( 'control' => 'sinatra_wc_upsell_products', 'value' => true, 'operator' => '==', ), ), ), ); // Cross-Sell Products. $options['setting']['sinatra_wc_cross_sell_products'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Cross-Sell Products', 'sinatra' ), 'description' => esc_html__( 'Display linked cross-sell products on cart page.', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'space' => true, ), ); // Cross-Sells rows count. $options['setting']['sinatra_wc_cross_sell_rows'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Cross-Sell Products Rows', 'sinatra' ), 'description' => esc_html__( 'How many rows of cross-sell products should be shown?', 'sinatra' ), 'section' => 'sinatra_woocommerce_single_product', 'min' => 1, 'max' => 6, 'step' => 1, 'required' => array( array( 'control' => 'sinatra_wc_cross_sells_products', 'value' => true, 'operator' => '==', ), ), ), ); $sidebar_options = array(); $sidebar_options['sinatra_wc_sidebar_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'WooCommerce', 'sinatra' ), 'description' => esc_html__( 'Choose default sidebar position for cart, checkout and catalog pages. You can change this setting per page via metabox settings.', 'sinatra' ), 'section' => 'sinatra_section_sidebar', 'choices' => array( 'default' => esc_html__( 'Default', 'sinatra' ), 'no-sidebar' => esc_html__( 'No Sidebar', 'sinatra' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'sinatra' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'sinatra' ), ), ), ); $sidebar_options['sinatra_wc_product_sidebar_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'WooCommerce - Single Product', 'sinatra' ), 'description' => esc_html__( 'Choose default sidebar position layout for product pages. You can change this setting per product via metabox settings.', 'sinatra' ), 'section' => 'sinatra_section_sidebar', 'choices' => array( 'default' => esc_html__( 'Default', 'sinatra' ), 'no-sidebar' => esc_html__( 'No Sidebar', 'sinatra' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'sinatra' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'sinatra' ), ), ), ); $options['setting'] = sinatra_array_insert( $options['setting'], $sidebar_options, 'sinatra_archive_sidebar_position' ); return $options; } /** * Add localize strings. * * @param array $strings Array of strings to be localized. * @return array Modified string array. */ public function customizer_localized_strings( $strings ) { // Preview a random single product for WooCommerce > Single Product section. $products = get_posts( array( 'post_type' => 'product', 'posts_per_page' => 1, 'orderby' => 'rand', ) ); if ( count( $products ) ) { $strings['preview_url_for_section']['sinatra_woocommerce_single_product'] = get_permalink( $products[0] ); } return $strings; } } endif; new Sinatra_Customizer_WooCommerce(); compatibility/woocommerce/class-sinatra-woocommerce.php000064400000115771151231536700017545 0ustar00 * @since 1.0.0 */ // If WooCommerce is not activated then return. if ( ! sinatra_is_woocommerce_activated() ) { add_action( 'activate_woocommerce/woocommerce.php', array( sinatra_dynamic_styles(), 'delete_dynamic_file' ) ); return; } /** * Sinatra WooCommerce Compatibility. */ if ( ! class_exists( 'Sinatra_Woocommerce' ) ) : /** * Sinatra WooCommerce Compatibility * * @since 1.0.0 */ class Sinatra_Woocommerce { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * Main Instance. * * @since 1.0.0 * @return Sinatra_Woocommerce */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Woocommerce ) ) { self::$instance = new Sinatra_Woocommerce(); self::$instance->includes(); self::$instance->actions(); } return self::$instance; } /** * Include files. * * @since 1.0.0 */ private function includes() { require SINATRA_THEME_PATH . '/inc/compatibility/woocommerce/woocommerce-functions.php'; // phpcs:ignore require SINATRA_THEME_PATH . '/inc/compatibility/woocommerce/class-sinatra-customizer-woocommerce.php'; // phpcs:ignore } /** * WooCommerce actions. * * @since 1.0.0 */ private function actions() { // Cart fragment. if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) { add_filter( 'woocommerce_add_to_cart_fragments', array( $this, 'cart_widget_count_fragment' ) ); add_filter( 'woocommerce_add_to_cart_fragments', array( $this, 'cart_widget_dropdown_fragment' ) ); } else { add_filter( 'add_to_cart_fragments', array( $this, 'cart_widget_count_fragment' ) ); add_filter( 'add_to_cart_fragments', array( $this, 'cart_widget_dropdown_fragment' ) ); } // Frontend actions only. if ( ! is_admin() ) { add_action( 'wp', array( $this, 'product_catalog_elements' ) ); // Disable WooCommerce shop title. add_filter( 'woocommerce_show_page_title', '__return_false' ); // Disable Sinatra page description. add_filter( 'sinatra_page_header_description', array( $this, 'shop_remove_page_description' ) ); // Remove WooCommerce content wrappers. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); // Remove WooCommerce breadcrumbs. remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 ); // Extend Sinatra breadcrumb trail. add_filter( 'breadcrumb_trail_items', array( $this, 'breadcrumbs' ), 20, 2 ); // Remove WooCommerce sidebar. remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar' ); add_action( 'sinatra_woocommerce_sidebar', 'woocommerce_get_sidebar' ); // Add our content wrappers. add_action( 'woocommerce_before_main_content', array( $this, 'content_wrapper_start' ), 10 ); add_action( 'woocommerce_after_main_content', array( $this, 'content_wrapper_end' ), 10 ); // Replace WooCommerce pagination with Sinatra pagination. remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); add_action( 'woocommerce_after_shop_loop', 'sinatra_pagination' ); // Add back to shop button to Empty Cart. add_action( 'woocommerce_cart_is_empty', 'sinatra_wc_empty_cart_button' ); // Add wrapper to result count and catalog ordering. add_action( 'woocommerce_before_shop_loop', array( $this, 'result_wrapper_start' ), 19 ); add_action( 'woocommerce_before_shop_loop', array( $this, 'result_wrapper_end' ), 31 ); // Remove opening link tag. remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 ); // Add thumbnail wrapper. add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'loop_product_thumb_wrap_start' ), 5 ); add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'loop_product_thumb_wrap_end' ), 15 ); // Add product link to thumnail. add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 6 ); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 13 ); // Add alternative image to display on hover. add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'product_image_swap' ), 11 ); // Add to cart button to display on hover. add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 14 ); // Add wrapper to product meta details. add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'loop_product_details_wrap_open' ), 19 ); add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'loop_product_details_wrap_end' ), 10 ); add_action( 'woocommerce_before_single_product_summary', array( $this, 'single_product_wrapper_start' ), 5 ); add_action( 'woocommerce_after_single_product_summary', array( $this, 'single_product_wrapper_end' ), 5 ); // Remove add to cart button from catalog pages. remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); // Percentage sale badge. add_filter( 'woocommerce_sale_flash', 'sinatra_wc_add_percentage_to_sale_badge', 20, 3 ); // Out of stock product badge. add_action( 'woocommerce_before_shop_loop_item_title', 'sinatra_wc_out_of_stock_badge', 10 ); add_action( 'woocommerce_before_single_product_summary', 'sinatra_wc_out_of_stock_badge', 10 ); // Additional classes for add to cart button. add_filter( 'woocommerce_loop_add_to_cart_args', array( $this, 'loop_add_to_cart_args' ) ); // Heading for checkout page order. add_action( 'woocommerce_review_order_before_payment', array( $this, 'review_order_heading' ) ); // Remove mini cart buttons and replace with ours. remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 ); remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 ); add_action( 'woocommerce_widget_shopping_cart_buttons', 'sinatra_wc_widget_shopping_cart_buttons', 10 ); // Hide Yith wishlist - we show it in our page title anyway. add_filter( 'yith_wcwl_wishlist_title', '__return_false', 20 ); // Remove checkout heading. add_action( 'woocommerce_checkout_shipping', array( $this, 'checkout_shipping_heading' ), 9 ); add_filter( 'woocommerce_subcategory_count_html', 'sinatra_wc_cat_count_filter', 10, 2 ); add_filter( 'woocommerce_rating_filter_count', 'sinatra_wc_rating_count_filter', 10, 3 ); add_filter( 'woocommerce_layered_nav_count', 'sinatra_wc_layered_count_filter', 10, 3 ); // Upsell Products. remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); add_action( 'woocommerce_after_single_product_summary', array( $this, 'woocommerce_upsell_display' ), 15 ); // Related Products. remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); add_action( 'woocommerce_after_single_product_summary', array( $this, 'woocommerce_related_products' ), 15 ); // Related products columns/count. add_filter( 'woocommerce_output_related_products_args', array( $this, 'single_product_related_products_args' ) ); add_filter( 'woocommerce_single_product_carousel_options', array( $this, 'single_product_slider_options' ) ); // Cross-Sell products. remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); add_action( 'woocommerce_cart_collaterals', array( $this, 'woocommerce_cross_sell_display' ) ); // Product gallery thumbnail columns. add_filter( 'woocommerce_product_thumbnails_columns', array( $this, 'product_thumbnails_columns' ) ); } // Enqueue styles. add_action( 'sinatra_enqueue_scripts', array( $this, 'enqueue' ) ); // Single product actions. add_action( 'wp_head', array( $this, 'product_actions' ), 9 ); // Register WooCommerce sidebars. add_action( 'widgets_init', array( $this, 'register_wc_sidebars' ) ); // Add correct sidebar. add_filter( 'sinatra_sidebar_name', array( $this, 'set_sidebar' ) ); // Set sidebar position. add_filter( 'sinatra_default_sidebar_position', array( $this, 'set_default_sidebar_position' ) ); // Remove item from cart. add_action( 'wp_ajax_sinatra_remove_wc_cart_item', array( $this, 'remove_item_from_cart' ) ); add_action( 'wp_ajax_nopriv_sinatra_remove_wc_cart_item', array( $this, 'remove_item_from_cart' ) ); // Add theme supports. add_action( 'after_setup_theme', array( $this, 'theme_supports' ), 20 ); // Add customizer cart widget. add_filter( 'sinatra_customizer_widgets', array( $this, 'add_customizer_cart_widget' ) ); add_filter( 'sinatra_main_header_widgets', array( $this, 'add_cart_to_main_header_widgets' ) ); // Loads Cart Customizer widgets class. add_action( 'customize_register', array( $this, 'load_customizer_widget' ), 20 ); // Handle admin redirects. add_action( 'admin_init', array( $this, 'admin_redirects' ), 9 ); // Add dynamic CSS. add_filter( 'sinatra_dynamic_styles', array( $this, 'dynamic_css' ), 5 ); // Update dynamic styles on deactivation. add_action( 'deactivate_woocommerce/woocommerce.php', array( sinatra_dynamic_styles(), 'delete_dynamic_file' ) ); // Return Shop page ID. add_filter( 'sinatra_get_the_id', array( $this, 'get_the_id' ) ); add_filter( 'woocommerce_product_related_products_heading', array( $this, 'related_products_heading' ) ); } /** * Declare WooCommerce support. * * @since 1.0.0 */ public function theme_supports() { // Declare WooCommerce compatibility. add_theme_support( 'woocommerce', array( 'gallery_thumbnail_image_width' => 150, ) ); // Product Gallery Slider. add_theme_support( 'wc-product-gallery-slider' ); // Product Gallery Zoom. if ( sinatra_option( 'wc_product_gallery_zoom' ) ) { add_theme_support( 'wc-product-gallery-zoom' ); } // Product Gallery Lightbox. if ( sinatra_option( 'wc_product_gallery_lightbox' ) ) { add_theme_support( 'wc-product-gallery-lightbox' ); } } /** * Enqueue WooCommerce styles. * * @since 1.0.0 */ public function enqueue() { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Enqueue WooCommerce compatibility stylesheet. wp_enqueue_style( 'sinatra-woocommerce', SINATRA_THEME_URI . '/assets/css/compatibility/woocommerce' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); // Enqueue WooCommerce compatibility script. wp_enqueue_script( 'sinatra-wc', SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'sinatra-wc' . $sinatra_suffix . '.js', array( 'jquery' ), SINATRA_THEME_VERSION, true ); } /** * Add or remove actions depending on enabled product catalog elements. * * @return void */ public function product_catalog_elements() { $elements = sinatra_option( 'product_catalog_elements' ); $hook = 'woocommerce_before_shop_loop_item_title'; $priority = 20; if ( ! empty( $elements ) ) { foreach ( $elements as $element => $enabled ) { if ( 'title' === $element ) { if ( ! $enabled ) { remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title' ); } else { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close' ); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', $priority ); add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 4 ); } $hook = 'woocommerce_after_shop_loop_item_title'; $priority = 5; } elseif ( 'ratings' === $element ) { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); if ( $enabled ) { add_action( $hook, 'woocommerce_template_loop_rating', $priority ); $priority++; } } elseif ( 'price' === $element ) { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); if ( $enabled ) { add_action( $hook, 'woocommerce_template_loop_price', $priority ); $priority++; } } elseif ( 'category' === $element ) { if ( $enabled ) { add_action( $hook, array( $this, 'template_loop_category' ), $priority ); $priority++; } } } } } /** * Print product categories in loop template. * * @return void */ public function template_loop_category() { global $product; $product_cats = wp_get_post_terms( $product->get_id(), 'product_cat' ); $cats = array(); if ( is_array( $product_cats ) && ! empty( $product_cats ) ) { foreach ( $product_cats as $product_cat ) { $cats[] = '' . esc_html( $product_cat->name ) . ''; } } echo '' . wp_kses_post( implode( ', ', $cats ) ) . ''; } /** * Add start wrapper to result count and catalog ordering. * * @since 1.0.0 * @return void */ public function result_wrapper_start() { if ( ! woocommerce_products_will_display() ) { return; } echo '
        '; } /** * Add end wrapper to result count and catalog ordering. * * @since 1.0.0 * @return void */ public function result_wrapper_end() { if ( ! woocommerce_products_will_display() ) { return; } echo '
        '; } /** * Update cart count in Cart Widget via AJAX. * * @param array $fragments Fragments to refresh via AJAX. * @return array Fragments to refresh via AJAX * @since 1.0.0 */ public function cart_widget_count_fragment( $fragments ) { $fragments['.si-header-widget__cart a.si-cart'] = sinatra_wc_cart_icon( false ); return $fragments; } /** * Update Cart Widget dropdown via AJAX. * * @param array $fragments Fragments to refresh via AJAX. * @return array Fragments to refresh via AJAX * @since 1.0.0 */ public function cart_widget_dropdown_fragment( $fragments ) { $fragments['.si-header-widget__cart .dropdown-item'] = sinatra_wc_cart_dropdown( false ); return $fragments; } /** * Add start of WooCommerce content wrapper. * * @since 1.0.0 * @return void */ public function content_wrapper_start() { ?>
        '; } /** * Add end of Single Product content wrapper. * * @since 1.0.0 * @return void */ public function single_product_wrapper_end() { echo ''; } /** * Single product actions. * * @since 1.0.0 * @return void */ public function product_actions() { if ( ! is_product() ) { return; } // Remove Sinatra page title on WooCommerce product pages. add_filter( 'sinatra_page_header_has_title', '__return_false' ); // Disable Comments toggle. add_filter( 'sinatra_display_comments_toggle', '__return_false' ); } /** * Add support for Customizer cart widget. * * @since 1.0.0 * @param array $widgets Array of available customizer widgets. * @return array */ public function add_customizer_cart_widget( $widgets ) { $widgets['cart'] = 'Sinatra_Customizer_Widget_Cart'; return $widgets; } /** * Add cart widget to Header widgets. * * @since 1.0.0 * @param array $widgets Array of available main header widgets. * @return array */ public function add_cart_to_main_header_widgets( $widgets ) { $widgets['cart'] = array( 'max_uses' => 1, ); return $widgets; } /** * Overwrite the items for the breadcrumb trail. * * @since 1.0.0 * @param array $items Array of items belonging to the current breadcrumb trail. * @param array $args Arguments used to build the breadcrumb trail. * @return array */ public function breadcrumbs( $items, $args ) { if ( function_exists( 'is_shop' ) && is_shop() ) { $items[ count( $items ) - 1 ] = __( 'Shop', 'sinatra' ); } return $items; } /** * Register WooCommerce sidebars. * * @since 1.0.0 * @return void */ public function register_wc_sidebars() { // Register WooCommerce Sidebar. register_sidebar( apply_filters( 'sinatra_woocommerce_sidebar_name', array( 'name' => esc_html__( 'WooCommerce Sidebar', 'sinatra' ), 'id' => 'sinatra-wc-sidebar', 'description' => __( 'Widgets in this area are displayed on WooCommerce pages except Product pages.', 'sinatra' ), 'before_widget' => '
        ', 'after_widget' => '
        ', 'before_title' => '

        ', 'after_title' => '

        ', ) ) ); // Register Product Sidebar. register_sidebar( apply_filters( 'sinatra_woocommerce_product_sidebar_name', array( 'name' => esc_html__( 'Product Sidebar', 'sinatra' ), 'id' => 'sinatra-wc-product-sidebar', 'description' => __( 'Widgets in this area are displayed on WooCommerce Product pages.', 'sinatra' ), 'before_widget' => '
        ', 'after_widget' => '
        ', 'before_title' => '

        ', 'after_title' => '

        ', ) ) ); } /** * Change sidebar name on WooCommerce pages. * * @since 1.0.0 * @param string $sidebar_name Sidebar name for woocmmerce pages. * @return string */ public function set_sidebar( $sidebar_name ) { if ( is_product() ) { $sidebar_name = 'sinatra-wc-product-sidebar'; } elseif ( is_woocommerce() || is_cart() || is_checkout() ) { $sidebar_name = 'sinatra-wc-sidebar'; } return $sidebar_name; } /** * Change default sidebar position on WooCommerce pages. * * @since 1.0.0 * @param string $position Sidebar position for woocmmerce pages. * @return string */ public function set_default_sidebar_position( $position ) { if ( is_product() ) { $position = sinatra_option( 'wc_product_sidebar_position' ); } elseif ( is_woocommerce() || is_cart() || is_checkout() ) { $position = sinatra_option( 'wc_sidebar_position' ); } if ( is_product() || is_woocommerce() || is_cart() || is_checkout() ) { if ( 'default' === $position ) { return sinatra_option( 'sidebar_position' ); } else { return $position; } } return $position; } /** * Remove Sinatra page description on WooCommerce pages. * * @since 1.0.0 * @param string $description Page description. * @return boolean|string */ public function shop_remove_page_description( $description ) { if ( is_woocommerce() ) { return false; } return $description; } /** * Remove item from cart. * * @since 1.0.0 * @return void */ public function remove_item_from_cart() { check_ajax_referer( 'sinatra-nonce' ); if ( ! isset( $_POST['product_key'] ) ) { wp_send_json_error(); } $product_key = sanitize_text_field( wp_unslash( $_POST['product_key'] ) ); $cart = WC()->instance()->cart; $cart_item_id = $cart->find_product_in_cart( $product_key ); if ( $cart_item_id ) { $cart->set_quantity( $cart_item_id, 0 ); wp_send_json_success(); } wp_send_json_error(); } /** * Display an alternative image (from product gallery) when hovering product image on catalog pages. * * @since 1.0.0 * @return void */ public function product_image_swap() { global $product; $hover_style = sinatra_option( 'shop_product_hover' ); if ( 'image-swap' === $hover_style ) { $attachment_ids = $product->get_gallery_image_ids(); if ( $attachment_ids ) { $image_size = apply_filters( 'single_product_archive_thumbnail_size', 'shop_catalog' ); // phpcs:ignore $attachment_id = reset( $attachment_ids ); echo wp_kses_post( apply_filters( 'sinatra_woocommerce_product_image_swap', wp_get_attachment_image( $attachment_id, $image_size, false, array( 'class' => 'show-on-hover' ) ) ) ); } } } /** * Add start wrapper for loop product thumbnail. * * @since 1.0.0 * @return void */ public function loop_product_thumb_wrap_start() { $class = 'si-product-thumb'; if ( 'image-swap' === sinatra_option( 'shop_product_hover' ) ) { global $product; $attachment_ids = $product->get_gallery_image_ids(); if ( $attachment_ids ) { $class .= ' swap-on-hover'; } } echo '
        '; } /** * Add end wrapper for loop product thumbnail. * * @since 1.0.0 * @return void */ public function loop_product_thumb_wrap_end() { echo '
        '; } /** * Add start wrapper for loop product details. * * @since 1.0.0 * @return void */ public function loop_product_details_wrap_open() { echo '
        '; } /** * Add end wrapper for loop product details. * * @since 1.0.0 * @return void */ public function loop_product_details_wrap_end() { echo '
        '; } /** * Additional classes for add to cart button on loop products. * * @since 1.0.0 * @param array $args Arguments for add to cart button in loop products. * @return array */ public function loop_add_to_cart_args( $args ) { $args['class'] .= ' si-btn'; return $args; } /** * Loads Customizer widgets classes. * * @since 1.0.0 * @return void */ public function load_customizer_widget() { $path = SINATRA_THEME_PATH . '/inc/compatibility/woocommerce/class-sinatra-customizer-widget-cart.php'; if ( file_exists( $path ) ) { require $path; // phpcs:ignore } } /** * Review order heading. * * @since 1.0.0 * @return void */ public function review_order_heading() { echo wp_kses_post( apply_filters( 'sinatra_review_order_heading', '

        ' . __( 'Payment', 'sinatra' ) . '

        ' ) ); } /** * Display a heading on Checkout / Shipping. * * @since 1.0.0 * @return void */ public function checkout_shipping_heading() { if ( true !== WC()->cart->needs_shipping_address() ) { return; } echo wp_kses_post( apply_filters( 'sinatra_checkout_shipping_heading', '

        ' . __( 'Shipping', 'sinatra' ) . '

        ' ) ); } /** * Related products column count. * * @since 1.0.0 * @param array $args Arguments for related products on single product page. * @return array */ public function single_product_related_products_args( $args ) { $columns = intval( sinatra_option( 'wc_related_columns' ) ); $rows = intval( sinatra_option( 'wc_related_rows' ) ); $args['posts_per_page'] = $columns * $rows; $args['columns'] = $columns; return $args; } /** * Cross-Sell Products. * * @since 1.0.0 * @return void */ public function woocommerce_cross_sell_display() { // Check if cross-sells are enabled. if ( sinatra_option( 'wc_cross_sell_products' ) ) { $rows = intval( sinatra_option( 'wc_cross_sell_rows' ) ); woocommerce_cross_sell_display( 2 * $rows, 2 ); } } /** * Upsell Products. * * @since 1.0.0 * @return void */ public function woocommerce_upsell_display() { // Check if upsells are enabled. if ( sinatra_option( 'wc_upsell_products' ) ) { $columns = intval( sinatra_option( 'wc_upsells_columns' ) ); $rows = intval( sinatra_option( 'wc_upsells_rows' ) ); woocommerce_upsell_display( $columns * $rows, $columns ); } } /** * Related Products. * * @since 1.0.0 * @return void */ public function woocommerce_related_products() { // Check if related products are enabled. if ( sinatra_option( 'wc_related_products' ) ) { woocommerce_output_related_products(); } } /** * Add arrows to product slider on single product. * * @since 1.0.0 * @param array $options Array of options for product slider. * @return array */ public function single_product_slider_options( $options ) { if ( ! sinatra_option( 'wc_product_slider_arrows' ) ) { return $options; } $options['directionNav'] = true; $options['prevText'] = sinatra_animated_arrow( 'left', false ); $options['nextText'] = sinatra_animated_arrow( 'right', false ); return $options; } /** * Product gallery thumbnail columns. * * @since 1.0.0 * @param integer $columns Number of product thumnail columns on single product page. * @return integer */ public function product_thumbnails_columns( $columns ) { return 5; } /** * Related products heading on single product pages. * * @since 1.0.0 * @param string $heading Related products heading. * @return string */ public function related_products_heading( $heading ) { return __( 'Related Products', 'sinatra' ); } /** * Handle redirects to setup/welcome page after install and updates. * * @since 1.0.0 * * @return void */ public function admin_redirects() { $current_page = isset( $_GET['page'] ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : false; // phpcs:ignore // Prevent WooCommerce automatic wizard redirect. if ( false !== strpos( $current_page, 'sinatra' ) ) { add_filter( 'woocommerce_prevent_automatic_wizard_redirect', '__return_true' ); } } /** * Generates dynamic CSS code for woocommerce. * * @param string $css Dynamic CSS code generated by the theme. * @return string Modified CSS code. * @since 1.0.0 */ public function dynamic_css( $css ) { // Accent Color. $accent_color = sinatra_option( 'accent_color' ); $css .= ' .si-header-widgets .si-cart .si-cart-count, .si-woo-steps .si-step.is-active > span:first-child, .woocommerce div.product form.cart .button, .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .onsale, .woocommerce span.onsale, .woocommerce-store-notice, p.demo_store, .woocommerce ul.products li.product .button, .widget.woocommerce .wc-layered-nav-term:hover .count, .widget.woocommerce .product-categories li a:hover ~ .count, .widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a:before, .woocommerce .widget_rating_filter ul li.chosen a::before, .widget.woocommerce .wc-layered-nav-term.chosen .count, .widget.woocommerce .product-categories li.current-cat > .count, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle:after, .woocommerce .widget_layered_nav_filters ul li a:hover, .woocommerce div.product div.images .woocommerce-product-gallery__trigger:hover:before, .woocommerce #review_form #respond .form-submit input { background-color: ' . $accent_color . '; } .woocommerce #review_form #respond .form-submit input:hover, .woocommerce #review_form #respond .form-submit input:focus, .woocommerce div.product form.cart .button:hover, .woocommerce div.product form.cart .button:focus, .site-main .woocommerce #respond input#submit:hover, .site-main .woocommerce #respond input#submit:focus, .site-main .woocommerce a.button:hover, .site-main .woocommerce a.button:focus, .site-main .woocommerce button.button:hover, .site-main .woocommerce button.button:focus, .site-main .woocommerce input.button:hover, .site-main .woocommerce input.button:focus, .woocommerce ul.products li.product .button:hover, .woocommerce ul.products li.product .button:focus, .woocommerce .widget_price_filter .ui-slider .ui-slider-range, .widget.woocommerce .wc-layered-nav-rating a:hover em, .widget.woocommerce .wc-layered-nav-rating.chosen a em { background-color: ' . sinatra_luminance( $accent_color, .15 ) . '; } .woocommerce #yith-wcwl-form table.shop_table .product-subtotal .amount, .woocommerce .woocommerce-cart-form table.shop_table .product-subtotal .amount, .woocommerce ul.products li.product .price, .woocommerce .woocommerce-checkout-review-order .order-total .woocommerce-Price-amount.amount, #main .woocommerce-MyAccount-navigation li.is-active, .woocommerce .star-rating span::before, .widget.woocommerce .wc-layered-nav-term:hover a, .widget.woocommerce .wc-layered-nav-term a:hover, .widget.woocommerce .product-categories li a:hover, .widget.woocommerce .product-categories li.current-cat > a, .woocommerce ins .amount, .woocommerce .widget_rating_filter ul li.chosen a::before, .widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen, .woocommerce .widget_shopping_cart .total .amount, .woocommerce .widget_shopping_cart .total .tax_label, .woocommerce.widget_shopping_cart .total .amount, .woocommerce.widget_shopping_cart .total .tax_label, .woocommerce .widget_shopping_cart .cart_list li a.remove:hover:before, .woocommerce.widget_shopping_cart .cart_list li a.remove:hover:before, .woocommerce div.product .woocommerce-tabs ul.tabs li.active > a, .woocommerce div.product p.price, .woocommerce div.product span.price, .woocommerce div.product #reviews .comment-form-rating .stars a, .woocommerce div.product .woocommerce-pagination ul li span.current, .woocommerce div.product .woocommerce-pagination ul li a:hover, .wc-cart-widget-header .si-cart-subtotal span, .si-header-widget__cart:hover > a, .si-woo-steps .si-step.is-active, .cart_totals .order-total td { color: ' . $accent_color . '; } .wc-layered-nav-rating a:hover .star-rating span:before { color: ' . sinatra_luminance( $accent_color, .15 ) . '; } .widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a:before, .woocommerce div.product div.images .flex-control-thumbs li img.flex-active, .woocommerce div.product .woocommerce-pagination ul li span.current { border-color: ' . $accent_color . '; } .woocommerce-cart table.cart td.actions .coupon .input-text:focus, .woocommerce-checkout table.cart td.actions .coupon .input-text:focus, #add_payment_method table.cart td.actions .coupon .input-text:focus { border-bottom-color: ' . $accent_color . '; } '; // Content text color. $content_text_color = sinatra_option( 'content_text_color' ); $css .= ' .si-cart-item .si-x, .woocommerce form.login .lost_password a, .woocommerce form.register .lost_password a, .woocommerce a.remove, #add_payment_method .cart-collaterals .cart_totals .woocommerce-shipping-destination, .woocommerce-cart .cart-collaterals .cart_totals .woocommerce-shipping-destination, .woocommerce-checkout .cart-collaterals .cart_totals .woocommerce-shipping-destination, .woocommerce ul.products li.product .si-loop-product__category-wrap a, .woocommerce ul.products li.product .si-loop-product__category-wrap, .woocommerce .woocommerce-checkout-review-order table.shop_table thead th, #add_payment_method #payment div.payment_box, .woocommerce-cart #payment div.payment_box, .woocommerce-checkout #payment div.payment_box, #add_payment_method #payment ul.payment_methods .about_paypal, .woocommerce-cart #payment ul.payment_methods .about_paypal, .woocommerce-checkout #payment ul.payment_methods .about_paypal, .woocommerce table dl, .woocommerce table .wc-item-meta, .widget.woocommerce .reviewer, .woocommerce.widget_shopping_cart .cart_list li a.remove:before, .woocommerce .widget_shopping_cart .cart_list li a.remove:before, .woocommerce .widget_shopping_cart .cart_list li .quantity, .woocommerce.widget_shopping_cart .cart_list li .quantity, .woocommerce div.product .woocommerce-product-rating .woocommerce-review-link, .woocommerce div.product .woocommerce-tabs table.shop_attributes td, .woocommerce div.product .product_meta > span span:not(.si-woo-meta-title), .woocommerce div.product .product_meta > span a, .woocommerce .star-rating::before, .woocommerce div.product #reviews #comments ol.commentlist li .comment-text p.meta, .ywar_review_count, .woocommerce .add_to_cart_inline del, .woocommerce div.product p.price del, .woocommerce div.product span.price del, .woocommerce #yith-wcwl-form table.shop_table thead, .woocommerce .woocommerce-cart-form table.shop_table thead, .woocommerce .woocommerce-checkout-review-order table.shop_table thead, .woocommerce div.product .woocommerce-tabs ul.tabs li a { color: ' . sinatra_hex2rgba( $content_text_color, 0.73 ) . '; } .woocommerce-message, .woocommerce-error, .woocommerce-info, .woocommerce-message, .woocommerce div.product .woocommerce-tabs ul.tabs li:not(.active) a:hover { color: ' . $content_text_color . '; } .woocommerce div.product .woocommerce-product-gallery .flex-direction-nav svg path { fill: ' . $content_text_color . ' !important; } '; // Background Color - generated from text color. $background_color = sinatra_get_background_color(); $css .= ' .woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-prev, .woocommerce div.product .woocommerce-product-gallery .flex-direction-nav .flex-next, .woocommerce .quantity .si-woo-minus, .woocommerce .quantity .si-woo-plus { background-color: ' . $background_color . '; } '; $content_text_color_offset = sinatra_light_or_dark( $background_color, sinatra_luminance( $background_color, -0.045 ), sinatra_luminance( $background_color, 0.2 ) ); $css .= ' .woocommerce #yith-wcwl-form table.shop_table thead th, .woocommerce .woocommerce-cart-form table.shop_table thead th, .woocommerce .woocommerce-checkout-review-order table.shop_table thead th, .woocommerce .cart_totals table.shop_table .order-total th, .woocommerce .cart_totals table.shop_table .order-total td, .woocommerce div.product .woocommerce-tabs .wc-tab, #page .woocommerce-error, #page .woocommerce-info, #page .woocommerce-message, .woocommerce div.product .woocommerce-tabs ul.tabs:before, .woocommerce div.product .woocommerce-tabs ul.tabs:after { background-color: ' . $content_text_color_offset . '; } '; // Border color. $css .= ' .woocommerce #yith-wcwl-form table.shop_table th:first-child, .woocommerce #yith-wcwl-form table.shop_table td:first-child, .woocommerce .woocommerce-cart-form table.shop_table th:first-child, .woocommerce .woocommerce-cart-form table.shop_table td:first-child, .woocommerce .woocommerce-checkout-review-order table.shop_table th:first-child, .woocommerce .woocommerce-checkout-review-order table.shop_table td:first-child, .woocommerce #yith-wcwl-form table.shop_table td, .woocommerce .woocommerce-cart-form table.shop_table td, .woocommerce .woocommerce-checkout-review-order table.shop_table td, .woocommerce #yith-wcwl-form table.shop_table tr:nth-last-child(2) td, .woocommerce .woocommerce-cart-form table.shop_table tr:nth-last-child(2) td, .woocommerce .cart_totals table.shop_table, .woocommerce .cart_totals table.shop_table th, .woocommerce .cart_totals table.shop_table td { border-color: ' . $content_text_color_offset . '; } '; // Content link hover color. $css .= ' #add_payment_method #payment ul.payment_methods .about_paypal:hover, .si-woo-before-shop select.custom-select-loaded:hover ~ #si-orderby, .woocommerce-cart #payment ul.payment_methods .about_paypal:hover, .woocommerce-checkout #payment ul.payment_methods .about_paypal:hover, .woocommerce div.product .woocommerce-product-rating .woocommerce-review-link:hover, .woocommerce ul.products li.product .meta-wrap .woocommerce-loop-product__link:hover, .woocommerce ul.products li.product .si-loop-product__category-wrap a:hover { color: ' . sinatra_option( 'content_link_hover_color' ) . '; } '; /** * Header. */ // Background. $header_background = sinatra_option( 'header_background' ); if ( 'color' === $header_background['background-type'] && $header_background['background-color'] ) { $css .= ' .si-header-widget__cart .si-cart .si-cart-count { border: 2px solid ' . $header_background['background-color'] . '; } '; } /** * Typography. */ // Headings. $css .= sinatra_dynamic_styles()->get_typography_field_css( '.woocommerce div.product h1.product_title, .woocommerce #reviews #comments h2, .woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title', 'headings_font' ); $css .= sinatra_dynamic_styles()->get_typography_field_css( '.woocommerce div.product h1.product_title', 'h2_font' ); $css .= sinatra_dynamic_styles()->get_typography_field_css( '.woocommerce #reviews #comments h2', 'h3_font' ); $css .= sinatra_dynamic_styles()->get_typography_field_css( '.woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title', 'h4_font' ); return $css; } /** * Return post ID. * * @param int $post_id Post ID. * @return int Modified post ID. */ public function get_the_id( $post_id ) { if ( is_shop() ) { $post_id = wc_get_page_id( 'shop' ); } return $post_id; } } endif; if ( ! function_exists( 'sinatra_woocommerce' ) ) : /** * The function which returns the one Sinatra_Woocommerce instance. * * @since 1.0.0 * @return object */ function sinatra_woocommerce() { return Sinatra_Woocommerce::instance(); } endif; sinatra_woocommerce(); compatibility/woocommerce/woocommerce-functions.php000064400000014612151231536700017001 0ustar00 * @since 1.0.0 */ if ( ! function_exists( 'sinatra_get_wc_version' ) ) : /** * Get the version of the currently installed WooCommerce. * * @since 1.0.0 * @return woocommerce version number or null. */ function sinatra_get_wc_version() { return defined( 'WC_VERSION' ) && WC_VERSION ? WC_VERSION : null; } endif; if ( ! function_exists( 'sinatra_header_widget_cart' ) ) : /** * Outputs the header cart widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function sinatra_header_widget_cart( $options ) { // Cart widget. sinatra_wc_cart_icon(); // Skip dropdown on checkout and cart. if ( is_checkout() || is_cart() ) { return; } // Cart dropdown contents. sinatra_wc_cart_dropdown(); } endif; if ( ! function_exists( 'sinatra_wc_cart_icon' ) ) : /** * Outputs the WooCommerce cart widget icon. * * @since 1.0.0 * @param boolean $echo Return or print. */ function sinatra_wc_cart_icon( $echo = true ) { ob_start(); wc_get_template_part( 'cart/header-widget/icon' ); $output = ob_get_clean(); if ( true === $echo ) { echo $output; // phpcs:ignore } else { return $output; } } endif; if ( ! function_exists( 'sinatra_wc_cart_dropdown' ) ) : /** * Outputs the WooCommerce cart dropdown. * * @since 1.0.0 * @param bool $echo Print or return content. */ function sinatra_wc_cart_dropdown( $echo = true ) { ob_start(); wc_get_template_part( 'cart/header-widget/dropdown' ); $output = ob_get_clean(); if ( true === $echo ) { echo $output; // phpcs:ignore } else { return $output; } } endif; if ( ! function_exists( 'sinatra_wc_out_of_stock_badge' ) ) : /** * Outputs out of stock (sold out) badge for product. * * @since 1.0.0 */ function sinatra_wc_out_of_stock_badge() { global $product; if ( ! $product->is_in_stock() ) { esc_html( sprintf( apply_filters( 'sinatra_woocommerce_out_of_stock_badge', sprintf( '%s', esc_html__( 'Sold Out', 'sinatra' ) ) ) ) ); } } endif; if ( ! function_exists( 'sinatra_wc_add_percentage_to_sale_badge' ) ) : /** * Outputs badge with percentage discount for product. * * @since 1.0.0 * @param string $html Cart widget content. * @param object $post Post object. * @param object $product Product object. */ function sinatra_wc_add_percentage_to_sale_badge( $html, $post, $product ) { $badge = sinatra_option( 'product_sale_badge' ); if ( 'hide' === $badge ) { return ''; } if ( ! $product->is_in_stock() && ! $product->backorders_allowed() ) { return ''; } $text = ''; if ( 'text' === $badge ) { $text = sinatra_option( 'product_sale_badge_text' ); } elseif ( 'percentage' === $badge ) { if ( $product->is_type( 'variable' ) ) { $percentages = array(); // Get all variation prices. $prices = $product->get_variation_prices(); // Loop through variation prices. foreach ( $prices['price'] as $key => $price ) { // Only on sale variations. if ( $prices['regular_price'][ $key ] !== $price ) { // Prevent dividing by 0. if ( ! $prices['regular_price'][ $key ] ) { return $html; } // Calculate and set in the array the percentage for each variation on sale. $percentages[] = round( 100 - ( $prices['sale_price'][ $key ] / $prices['regular_price'][ $key ] * 100 ) ); } } // We keep the highest value. $text = '-' . max( $percentages ) . '%'; } else { $regular_price = (float) $product->get_regular_price(); $sale_price = (float) $product->get_sale_price(); // Prevent dividing by 0. if ( ! $regular_price ) { return $html; } $text = '-' . round( 100 - ( $sale_price / $regular_price * 100 ) ) . '%'; } } return $text || is_customize_preview() ? '' . esc_html( $text ) . '' : ''; } endif; if ( ! function_exists( 'sinatra_wc_empty_cart_button' ) ) : /** * Add empty cart - button to return to cart page. * * @since 1.0.0 */ function sinatra_wc_empty_cart_button() { if ( ! wc_get_page_id( 'shop' ) ) { return; } ?>

        ', $output ); $output = str_replace( ')', '', $output ); return $output; } endif; if ( ! function_exists( 'sinatra_wc_cat_count_filter' ) ) : /** * Filters product category subtitle (count). * * @since 1.0.0 * * @param string $output The count output. * @param array $category The category. * @return string */ function sinatra_wc_cat_count_filter( $output, $category ) { $count = $category->count; /* translators: %s is category count */ $text = sprintf( _n( '%s product', '%s products', $count, 'sinatra' ), $count ); return '' . esc_html( $text ) . ''; } endif; core/class-sinatra-db-updater.php000064400000006053151231536700013005 0ustar00 * @since 1.1.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_DB_Updater' ) ) : /** * Sinatra_DB_Updater Class. */ class Sinatra_DB_Updater { /** * DB updates and callbacks that need to be run per version. * * @var array */ private static $db_updates = array( '1.1.0' => array( 'v_1_1_0', ), ); /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { if ( is_admin() ) { add_action( 'admin_init', array( $this, 'updates' ) ); } else { add_action( 'wp', array( $this, 'updates' ) ); } } /** * Implement theme update logic. * * @since 1.0.0 */ public function updates() { $updates = $this->get_db_update_callbacks(); $current_version = get_option( 'sinatra-theme-updater', null ); if ( empty( $updates ) ) { return; } if ( ! is_null( $current_version ) && -1 < version_compare( $current_version, max( array_keys( $updates ) ) ) ) { return; } foreach ( $updates as $version => $callbacks ) { if ( version_compare( $current_version, $version, '<' ) ) { foreach ( $callbacks as $callback ) { call_user_func( array( 'Sinatra_DB_Updater', $callback ) ); } } } // Update dynamic stylesheet on theme update. sinatra_dynamic_styles()->update_dynamic_file(); $this->update_db_version(); } /** * Update DB version to current. * * @param string|null $version New Astra theme version or null. */ public static function update_db_version( $version = null ) { update_option( 'sinatra-theme-updater', SINATRA_THEME_VERSION ); } /** * Get list of DB update callbacks. * * @since 1.1.0 * @return array */ public function get_db_update_callbacks() { return self::$db_updates; } /** * DB Update v1.1.0 * * @since 1.1.0 * @return void */ public static function v_1_1_0() { sinatra()->options->set( 'sinatra_single_post_elements', array( 'thumb' => sinatra()->options->get( 'sinatra_single_post_thumb' ), 'category' => sinatra()->options->get( 'sinatra_single_post_categories' ), 'tags' => sinatra()->options->get( 'sinatra_single_post_tags' ), 'last-updated' => sinatra()->options->get( 'sinatra_single_last_updated' ), 'about-author' => sinatra()->options->get( 'sinatra_single_about_author' ), 'prev-next-post' => sinatra()->options->get( 'sinatra_single_post_next_prev' ), ) ); // Single Post Layout to Single Title Position. switch ( sinatra()->options->get( 'sinatra_single_post_layout' ) ) { case 'layout-1': sinatra()->options->set( 'sinatra_single_title_position', 'in-content' ); break; case 'layout-2': sinatra()->options->set( 'sinatra_single_title_position', 'in-page-header' ); break; } } } endif; new Sinatra_DB_Updater(); core/class-sinatra-enqueue-scripts.php000064400000011646151231536700014116 0ustar00 * @since 1.0.0 */ /** * Enqueue and register scripts and styles. * * @since 1.0.0 */ function sinatra_enqueues() { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Enqueue theme stylesheet. wp_enqueue_style( 'sinatra-styles', SINATRA_THEME_URI . '/assets/css/style' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); // Enqueue IE specific styles. wp_enqueue_style( 'sinatra-ie', SINATRA_THEME_URI . '/assets/css/compatibility/ie' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); wp_style_add_data( 'sinatra-ie', 'conditional', 'IE' ); // Enqueue HTML5 shiv. wp_register_script( 'html5shiv', SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'vendors/html5' . $sinatra_suffix . '.js', array(), '3.7.3', true ); // Load only on < IE9. wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' ); // Flexibility.js for crossbrowser flex support. wp_enqueue_script( 'sinatra-flexibility', SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'vendors/flexibility' . $sinatra_suffix . '.js', array(), SINATRA_THEME_VERSION, false ); wp_add_inline_script( 'sinatra-flexibility', 'flexibility(document.documentElement);' ); wp_script_add_data( 'sinatra-flexibility', 'conditional', 'IE' ); // Register ImagesLoaded library. wp_register_script( 'imagesloaded', SINATRA_THEME_URI . '/assets/js/' . $sinatra_dir . 'vendors/imagesloaded' . $sinatra_suffix . '.js', array(), '4.1.4', true ); // Register Sinatra slider. wp_register_script( 'sinatra-slider', SINATRA_THEME_URI . '/assets/js/sinatra-slider' . $sinatra_suffix . '.js', array( 'imagesloaded' ), SINATRA_THEME_VERSION, true ); // Load comment reply script if comments are open. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Enqueue main theme script. wp_enqueue_script( 'sinatra-js', SINATRA_THEME_URI . '/assets/js/sinatra' . $sinatra_suffix . '.js', array(), SINATRA_THEME_VERSION, true ); // Comment count used in localized strings. $comment_count = get_comments_number(); // Localized variables so they can be used for translatable strings. $localized = array( 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), 'nonce' => wp_create_nonce( 'sinatra-nonce' ), 'responsive-breakpoint' => intval( sinatra_option( 'main_nav_mobile_breakpoint' ) ), 'sticky-header' => sinatra_option( 'sticky_header' ), 'strings' => array( /* translators: %s Comment count */ 'comments_toggle_show' => $comment_count > 0 ? esc_html( sprintf( _n( 'Show %s Comment', 'Show %s Comments', $comment_count, 'sinatra' ), $comment_count ) ) : esc_html__( 'Leave a Comment', 'sinatra' ), 'comments_toggle_hide' => esc_html__( 'Hide Comments', 'sinatra' ), ), ); wp_localize_script( 'sinatra-js', 'sinatra_vars', apply_filters( 'sinatra_localized', $localized ) ); // Enqueue google fonts. sinatra()->fonts->enqueue_google_fonts(); // Add additional theme styles. do_action( 'sinatra_enqueue_scripts' ); } add_action( 'wp_enqueue_scripts', 'sinatra_enqueues' ); /** * Skip link focus fix for IE11. * * @since 1.0.0 * * @return void */ function sinatra_skip_link_focus_fix() { ?> fonts->enqueue_google_fonts(); // Add dynamic CSS as inline style. wp_add_inline_style( 'sinatra-block-editor-styles', apply_filters( 'sinatra_block_editor_dynamic_css', sinatra_dynamic_styles()->get_block_editor_css() ) ); } add_action( 'enqueue_block_editor_assets', 'sinatra_block_editor_assets' ); core/class-sinatra-fonts.php000064400000026702151231536700012112 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Fonts' ) ) : /** * Sinatra helper class to handle fonts. * * @since 1.0.0 */ class Sinatra_Fonts { /** * System Fonts * * @since 1.0.0 * @var array */ public $system_fonts = array(); /** * Google Fonts * * @since 1.0.0 * @var array */ public $google_fonts = array(); /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { } /** * Get System Fonts. * * @since 1.0.0 * * @return Array All the system fonts in Sinatra */ public function get_system_fonts() { if ( empty( $this->system_fonts ) ) { $this->system_fonts = array( 'Helvetica' => array( 'fallback' => 'Verdana, Arial, sans-serif', 'variants' => array( '300', '400', '700', ), ), 'Verdana' => array( 'fallback' => 'Helvetica, Arial, sans-serif', 'variants' => array( '300', '400', '700', ), ), 'Arial' => array( 'fallback' => 'Helvetica, Verdana, sans-serif', 'variants' => array( '300', '400', '700', ), ), 'Times' => array( 'fallback' => 'Georgia, serif', 'variants' => array( '300', '400', '700', ), ), 'Georgia' => array( 'fallback' => 'Times, serif', 'variants' => array( '300', '400', '700', ), ), 'Courier' => array( 'fallback' => 'monospace', 'variants' => array( '300', '400', '700', ), ), ); } return apply_filters( 'sinatra_system_fonts', $this->system_fonts ); } /** * Return an array of standard websafe fonts. * * @return array Standard websafe fonts. */ public function get_standard_fonts() { $standard_fonts = array( 'Serif' => array( 'fallback' => 'Georgia, Times, "Times New Roman", serif', 'variants' => array( '300', '400', '700', ), ), 'Sans Serif' => array( 'fallback' => 'Helvetica, Arial, sans-serif', 'variants' => array( '300', '400', '700', ), ), 'Monospace' => array( 'fallback' => 'Monaco, "Lucida Sans Typewriter", "Lucida Typewriter", "Courier New", Courier, monospace', 'variants' => array( '300', '400', '700', ), ), ); return apply_filters( 'sinatra_standard_fonts', $standard_fonts ); } /** * Default system font. * * @since 1.0.0 * * @return string Default system font. */ public function get_default_system_font() { $font = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;'; return apply_filters( 'sinatra_default_system_font', $font ); } /** * Google Fonts. * Array is generated from the google-fonts.json file. * * @since 1.0.0 * * @return Array Array of Google Fonts. */ public function get_google_fonts() { if ( empty( $this->google_fonts ) ) { $google_fonts_file = apply_filters( 'sinatra_google_fonts_json_file', SINATRA_THEME_PATH . '/assets/fonts/google-fonts.json' ); if ( ! file_exists( $google_fonts_file ) ) { return array(); } global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once ABSPATH . '/wp-admin/includes/file.php'; // phpcs:ignore WP_Filesystem(); } $file_contants = $wp_filesystem->get_contents( $google_fonts_file ); $google_fonts_json = json_decode( $file_contants, 1 ); foreach ( $google_fonts_json as $key => $font ) { $name = key( $font ); foreach ( $font[ $name ] as $font_key => $single_font ) { if ( 'variants' === $font_key ) { foreach ( $single_font as $variant_key => $variant ) { if ( 'regular' === $variant ) { $font[ $name ][ $font_key ][ $variant_key ] = '400'; } if ( 'italic' === $variant ) { $font[ $name ][ $font_key ][ $variant_key ] = '400italic'; } if ( strpos( $font[ $name ][ $font_key ][ $variant_key ], 'italic' ) ) { unset( $font[ $name ][ $font_key ][ $variant_key ] ); } } } $this->google_fonts[ $name ] = $font[ $name ]; } } } return apply_filters( 'sinatra_google_fonts', $this->google_fonts ); } /** * Google Font subsets. * * @since 1.0.0 * * @return Array Array of Google Fonts. */ public function get_google_font_subsets() { $subsets = array( 'arabic' => esc_html__( 'Arabic', 'sinatra' ), 'bengali' => esc_html__( 'Bengali', 'sinatra' ), 'chinese-hongkong' => esc_html__( 'Chinese (Hong Kong)', 'sinatra' ), 'chinese-simplified' => esc_html__( 'Chinese (Simplified)', 'sinatra' ), 'chinese-traditional' => esc_html__( 'Chinese (Traditional)', 'sinatra' ), 'cyrillic' => esc_html__( 'Cyrillic', 'sinatra' ), 'cyrillic-ext' => esc_html__( 'Cyrillic Extended', 'sinatra' ), 'devanagari' => esc_html__( 'Devanagari', 'sinatra' ), 'greek' => esc_html__( 'Greek', 'sinatra' ), 'greek-ext' => esc_html__( 'Greek Extended', 'sinatra' ), 'gujarati' => esc_html__( 'Gujarati', 'sinatra' ), 'gurmukhi' => esc_html__( 'Gurmukhi', 'sinatra' ), 'hebrew' => esc_html__( 'Hebrew', 'sinatra' ), 'japanese' => esc_html__( 'Japanese', 'sinatra' ), 'kannada' => esc_html__( 'Kannada', 'sinatra' ), 'khmer' => esc_html__( 'Khmer', 'sinatra' ), 'korean' => esc_html__( 'Korean', 'sinatra' ), 'latin' => esc_html__( 'Latin', 'sinatra' ), 'latin-ext' => esc_html__( 'Latin Extended', 'sinatra' ), 'malayalam' => esc_html__( 'Malayalam', 'sinatra' ), 'myanmar' => esc_html__( 'Myanmar', 'sinatra' ), 'oriya' => esc_html__( 'Oriya', 'sinatra' ), 'sinhala' => esc_html__( 'Sinhala', 'sinatra' ), 'tamil' => esc_html__( 'Tamil', 'sinatra' ), 'telugu' => esc_html__( 'Telugu', 'sinatra' ), 'thai' => esc_html__( 'Thai', 'sinatra' ), 'vietnamese' => esc_html__( 'Vietnamese', 'sinatra' ), ); return apply_filters( 'sinatra_google_font_subsets', $subsets ); } /** * Return an array of backup fonts based on the font-category. * * @return array */ public function get_backup_fonts() { $backup_fonts = array( 'sans-serif' => 'Helvetica, Arial, sans-serif', 'serif' => 'Georgia, serif', 'display' => '"Comic Sans MS", cursive, sans-serif', 'handwriting' => '"Comic Sans MS", cursive, sans-serif', 'monospace' => '"Lucida Console", Monaco, monospace', ); return apply_filters( 'sinatra_backup_fonts', $backup_fonts ); } /** * Enqueue Google fonts. * * @since 1.0.0 */ public function enqueue_google_fonts() { $fonts = get_transient( 'sinatra_google_fonts_enqueue' ); if ( false === $fonts || empty( $fonts ) ) { return; } $url = '//fonts.googleapis.com/css'; $family = array(); $subsets = array(); foreach ( $fonts as $font_family => $font ) { if ( ! empty( $font['weight'] ) ) { $family[] = $font_family . ':' . implode( ',', $font['weight'] ); } else { $family[] = $font_family; } $subsets = array_unique( array_merge( $subsets, $font['subsets'] ) ); } $family = implode( '|', $family ); $subsets = implode( ',', $subsets ); $url = add_query_arg( array( 'family' => $family, 'display' => 'swap', 'subsets' => $subsets, ), $url ); // Enqueue. wp_enqueue_style( 'sinatra-google-fonts', $url, false, SINATRA_THEME_VERSION, false ); } /** * Check if font familu is a Google font. * * @since 1.0.0 * @param string $font_family Font Family. * @return boolean */ public function is_google_font( $font_family ) { $google_fonts = $this->get_google_fonts(); return isset( $google_fonts[ $font_family ] ); } /** * Store list of Google fonts to enqueue. * * @since 1.0.0 * @param string $family Font Family. * @param array $args Array of font details. * @return void */ public function enqueue_google_font( $family, $args = array() ) { $fonts = get_transient( 'sinatra_google_fonts_enqueue' ); $fonts = $fonts ? $fonts : array(); // Default args. $args = wp_parse_args( $args, array( 'weight' => array( '400' ), 'style' => array( 'normal' ), 'subsets' => array( 'latin' ), ) ); // Convert all args to arrays. foreach ( $args as $key => $value ) { if ( ! is_array( $args[ $key ] ) ) { $args[ $key ] = array( $value ); } } if ( in_array( 'italic', $args['style'], true ) ) { foreach ( $args['weight'] as $weight ) { $args['weight'][] = $weight . 'i'; } } // Remove uneccesary info. unset( $args['style'] ); // Sanitize key. $family = str_replace( ' ', '+', $family ); // Check if we previously enqueued this font. if ( ! isset( $fonts[ $family ] ) ) { $fonts[ $family ] = $args; } else { foreach ( $args as $key => $value ) { $fonts[ $family ][ $key ] = array_unique( array_merge( $fonts[ $family ][ $key ], $value ) ); } } set_transient( 'sinatra_google_fonts_enqueue', $fonts ); } /** * Get All Fonts. * * @since 1.0.0 * * @return Array All the system fonts in Sinatra */ public function get_fonts() { $fonts = array(); $fonts['standard_fonts'] = array( 'name' => esc_html__( 'Standard', 'sinatra' ), 'fonts' => self::get_standard_fonts(), ); $fonts['system_fonts'] = array( 'name' => esc_html__( 'System Fonts', 'sinatra' ), 'fonts' => self::get_system_fonts(), ); $fonts['google_fonts'] = array( 'name' => esc_html__( 'Google Fonts', 'sinatra' ), 'fonts' => self::get_google_fonts(), ); return apply_filters( 'sinatra_get_fonts', $fonts ); } /** * Get complete font family stack. * * @since 1.0.0 * * @param string $font Font family. * @return string Font family including backup families. */ public function get_font_family( $font ) { if ( 'default' === $font ) { $font = $this->get_default_system_font(); } else { $fonts = $this->get_fonts(); $backup = ''; if ( isset( $fonts['system_fonts']['fonts'][ $font ] ) ) { $backup = $fonts['system_fonts']['fonts'][ $font ]['fallback']; } elseif ( isset( $fonts['google_fonts']['fonts'][ $font ] ) ) { $backups = $this->get_backup_fonts(); $category = $fonts['google_fonts']['fonts'][ $font ]['category']; $backup = isset( $backups[ $category ] ) ? $backups[ $category ] : ''; } elseif ( isset( $fonts['standard_fonts']['fonts'][ $font ] ) ) { $backup = $fonts['standard_fonts']['fonts'][ $font ]['fallback']; $font = ''; } if ( false !== strpos( $font, ' ' ) ) { $font = '"' . $font . '"'; } $font = $font . ', ' . $backup; $font = trim( $font, ', ' ); } return apply_filters( 'sinatra_font_family', $font ); } } endif; core/class-sinatra-options.php000064400000063237151231536700012460 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Options' ) ) : /** * Sinatra Options Class. */ class Sinatra_Options { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * Options variable. * * @since 1.0.0 * @var mixed $options */ private static $options; /** * Main Sinatra_Options Instance. * * @since 1.0.0 * @return Sinatra_Options */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Options ) ) { self::$instance = new self(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Refresh options. add_action( 'after_setup_theme', array( $this, 'refresh' ) ); } /** * Set default option values. * * @since 1.0.0 * @return array Default values. */ public function get_defaults() { $defaults = array( /** * General Settings. */ // Layout. 'sinatra_site_layout' => 'fw-contained', 'sinatra_container_width' => 1200, // Base Colors. 'sinatra_accent_color' => '#3857F1', 'sinatra_content_text_color' => '#30373e', 'sinatra_headings_color' => '#23282d', 'sinatra_content_link_hover_color' => '#23282d', 'sinatra_body_background_heading' => true, 'sinatra_content_background_heading' => true, 'sinatra_boxed_content_background_color' => '#FFFFFF', 'sinatra_scroll_top_visibility' => 'all', // Base Typography. 'sinatra_html_base_font_size' => array( 'desktop' => 16, ), 'sinatra_font_smoothing' => true, 'sinatra_typography_body_heading' => false, 'sinatra_typography_headings_heading' => false, 'sinatra_body_font' => sinatra_typography_defaults( array( 'font-family' => 'default', 'font-weight' => 400, 'font-size-desktop' => '0.9375', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.733', ) ), 'sinatra_headings_font' => sinatra_typography_defaults( array( 'font-weight' => 500, 'font-style' => 'normal', 'text-transform' => 'none', 'text-decoration' => 'none', ) ), 'sinatra_h1_font' => sinatra_typography_defaults( array( 'font-weight' => 600, 'font-size-desktop' => '2.375', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.1', ) ), 'sinatra_h2_font' => sinatra_typography_defaults( array( 'font-weight' => 'inherit', 'font-size-desktop' => '1.875', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.25', ) ), 'sinatra_h3_font' => sinatra_typography_defaults( array( 'font-weight' => 'inherit', 'font-size-desktop' => '1.625', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.25', ) ), 'sinatra_h4_font' => sinatra_typography_defaults( array( 'font-weight' => 'inherit', 'font-size-desktop' => '1.25', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.5', ) ), 'sinatra_h5_font' => sinatra_typography_defaults( array( 'font-weight' => 'inherit', 'font-size-desktop' => '1', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.5', ) ), 'sinatra_h6_font' => sinatra_typography_defaults( array( 'font-weight' => 'inherit', 'font-size-desktop' => '0.6875', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.72', 'text-transform' => 'uppercase', 'letter-spacing' => '2', ) ), 'sinatra_heading_em_font' => sinatra_typography_defaults( array( 'font-weight' => 'inherit', 'font-style' => 'italic', ) ), 'sinatra_footer_widget_title_font_size' => array( 'desktop' => 1.125, 'unit' => 'em', ), // Primary Button. 'sinatra_primary_button_heading' => false, 'sinatra_primary_button_bg_color' => '', 'sinatra_primary_button_hover_bg_color' => '', 'sinatra_primary_button_text_color' => '#FFFFFF', 'sinatra_primary_button_hover_text_color' => '#FFFFFF', 'sinatra_primary_button_border_radius' => array( 'top-left' => 2, 'top-right' => 2, 'bottom-right' => 2, 'bottom-left' => 2, 'unit' => 'px', ), 'sinatra_primary_button_border_width' => 1, 'sinatra_primary_button_border_color' => 'rgba(0, 0, 0, 0.12)', 'sinatra_primary_button_hover_border_color' => 'rgba(0, 0, 0, 0.12)', 'sinatra_primary_button_typography' => sinatra_typography_defaults( array( 'font-family' => 'inherit', 'font-weight' => 500, 'font-size-desktop' => '0.9375', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.4', ) ), // Secondary Button. 'sinatra_secondary_button_heading' => false, 'sinatra_secondary_button_bg_color' => '#23282d', 'sinatra_secondary_button_hover_bg_color' => '#3e4750', 'sinatra_secondary_button_text_color' => '#FFFFFF', 'sinatra_secondary_button_hover_text_color' => '#FFFFFF', 'sinatra_secondary_button_border_radius' => array( 'top-left' => 2, 'top-right' => 2, 'bottom-right' => 2, 'bottom-left' => 2, 'unit' => 'px', ), 'sinatra_secondary_button_border_width' => 1, 'sinatra_secondary_button_border_color' => 'rgba(0, 0, 0, 0.12)', 'sinatra_secondary_button_hover_border_color' => 'rgba(0, 0, 0, 0.12)', 'sinatra_secondary_button_typography' => sinatra_typography_defaults( array( 'font-family' => 'inherit', 'font-weight' => 500, 'font-size-desktop' => '0.9375', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.4', ) ), // Text button. 'sinatra_text_button_heading' => false, 'sinatra_text_button_text_color' => '#23282d', 'sinatra_text_button_hover_text_color' => '', 'sinatra_text_button_typography' => sinatra_typography_defaults( array( 'font-family' => 'inherit', 'font-weight' => 500, 'font-size-desktop' => '0.9375', 'font-size-unit' => 'rem', 'line-height-desktop' => '1.4', ) ), // Misc Settings. 'sinatra_enable_schema' => true, 'sinatra_custom_input_style' => true, 'sinatra_preloader_heading' => false, 'sinatra_preloader' => false, 'sinatra_preloader_style' => '1', 'sinatra_preloader_visibility' => 'all', 'sinatra_scroll_top_heading' => false, 'sinatra_enable_scroll_top' => true, /** * Logos & Site Title. */ 'sinatra_logo_default_retina' => '', 'sinatra_logo_max_height' => array( 'desktop' => 30, ), 'sinatra_logo_margin' => array( 'desktop' => array( 'top' => 25, 'right' => 0, 'bottom' => 25, 'left' => 0, ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'unit' => 'px', ), 'sinatra_display_tagline' => false, 'sinatra_logo_heading_site_identity' => true, 'sinatra_typography_logo_heading' => false, 'sinatra_logo_text_font_size' => array( 'desktop' => 1.875, 'unit' => 'rem', ), /** * Header. */ // Top Bar. 'sinatra_top_bar_enable' => false, 'sinatra_top_bar_container_width' => 'content-width', 'sinatra_top_bar_visibility' => 'hide-mobile-tablet', 'sinatra_top_bar_heading_widgets' => true, 'sinatra_top_bar_widgets' => array( array( 'classname' => 'sinatra_customizer_widget_text', 'type' => 'text', 'values' => array( 'content' => esc_html__( 'This is a placeholder text widget in Top Bar section.', 'sinatra' ), 'location' => 'left', 'visibility' => 'all', ), ), ), 'sinatra_top_bar_widgets_separator' => 'regular', 'sinatra_top_bar_heading_design_options' => false, 'sinatra_top_bar_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array( 'background-color' => '#FFFFFF', ), 'gradient' => array(), ), ) ), 'sinatra_top_bar_text_color' => sinatra_design_options_defaults( array( 'color' => array(), ) ), 'sinatra_top_bar_border' => sinatra_design_options_defaults( array( 'border' => array( 'border-bottom-width' => '1', 'border-style' => 'solid', 'border-color' => 'rgba(0,0,0, .085)', 'separator-color' => '#cccccc', ), ) ), // Main Header. 'sinatra_header_layout' => 'layout-1', 'sinatra_header_container_width' => 'content-width', 'sinatra_header_heading_widgets' => true, 'sinatra_header_widgets' => array( array( 'classname' => 'sinatra_customizer_widget_search', 'type' => 'search', 'values' => array( 'location' => 'left', 'visibility' => 'hide-mobile-tablet', ), ), ), 'sinatra_header_widgets_separator' => 'none', 'sinatra_header_heading_design_options' => false, 'sinatra_header_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array( 'background-color' => '#FFFFFF', ), 'gradient' => array(), 'image' => array(), ), ) ), 'sinatra_header_border' => sinatra_design_options_defaults( array( 'border' => array( 'border-bottom-width' => 1, 'border-color' => 'rgba(0,0,0, .085)', 'separator-color' => '#cccccc', ), ) ), 'sinatra_header_text_color' => sinatra_design_options_defaults( array( 'color' => array( 'text-color' => '#66717f', 'link-color' => '#23282d', ), ) ), // Transparent Header. 'sinatra_tsp_header' => false, 'sinatra_tsp_header_disable_on' => array( '404', 'posts_page', 'archive', 'search', ), 'sinatra_tsp_logo_heading' => false, 'sinatra_tsp_logo' => '', 'sinatra_tsp_logo_retina' => '', 'sinatra_tsp_logo_max_height' => array( 'desktop' => 30, ), 'sinatra_tsp_logo_margin' => array( 'desktop' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'tablet' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'mobile' => array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ), 'unit' => 'px', ), 'sinatra_tsp_colors_heading' => false, 'sinatra_tsp_header_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array(), ), ) ), 'sinatra_tsp_header_font_color' => sinatra_design_options_defaults( array( 'color' => array(), ) ), 'sinatra_tsp_header_border' => sinatra_design_options_defaults( array( 'border' => array(), ) ), // Sticky Header. 'sinatra_sticky_header' => false, // Main Navigation. 'sinatra_main_nav_heading_animation' => false, 'sinatra_main_nav_hover_animation' => 'underline', 'sinatra_main_nav_heading_sub_menus' => false, 'sinatra_main_nav_sub_indicators' => true, 'sinatra_main_nav_heading_mobile_menu' => false, 'sinatra_main_nav_mobile_breakpoint' => 960, 'sinatra_main_nav_mobile_label' => '', 'sinatra_nav_design_options' => false, 'sinatra_main_nav_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array( 'background-color' => '#FFFFFF', ), 'gradient' => array(), ), ) ), 'sinatra_main_nav_border' => sinatra_design_options_defaults( array( 'border' => array( 'border-top-width' => 1, 'border-bottom-width' => 1, 'border-style' => 'solid', 'border-color' => 'rgba(0,0,0, .085)', ), ) ), 'sinatra_main_nav_font_color' => sinatra_design_options_defaults( array( 'color' => array(), ) ), 'sinatra_typography_main_nav_heading' => false, 'sinatra_main_nav_font_size' => array( 'value' => 0.9375, 'unit' => 'rem', ), // Page Header. 'sinatra_page_header_enable' => true, 'sinatra_page_header_alignment' => 'left', 'sinatra_page_header_spacing' => array( 'desktop' => array( 'top' => 30, 'bottom' => 30, ), 'tablet' => array( 'top' => '', 'bottom' => '', ), 'mobile' => array( 'top' => '', 'bottom' => '', ), 'unit' => 'px', ), 'sinatra_page_header_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array( 'background-color' => 'rgba(0,0,0,.025)' ), 'gradient' => array(), 'image' => array(), ), ) ), 'sinatra_page_header_text_color' => sinatra_design_options_defaults( array( 'color' => array(), ) ), 'sinatra_page_header_border' => sinatra_design_options_defaults( array( 'border' => array( 'border-bottom-width' => 1, 'border-style' => 'solid', 'border-color' => 'rgba(0,0,0,.062)', ), ) ), 'sinatra_typography_page_header' => false, 'sinatra_page_header_font_size' => array( 'desktop' => 1.625, 'unit' => 'rem', ), // Breadcrumbs. 'sinatra_breadcrumbs_enable' => true, 'sinatra_breadcrumbs_hide_on' => array( 'home' ), 'sinatra_breadcrumbs_position' => 'in-page-header', 'sinatra_breadcrumbs_alignment' => 'left', 'sinatra_breadcrumbs_spacing' => array( 'desktop' => array( 'top' => 15, 'bottom' => 15, ), 'tablet' => array( 'top' => '', 'bottom' => '', ), 'mobile' => array( 'top' => '', 'bottom' => '', ), 'unit' => 'px', ), 'sinatra_breadcrumbs_heading_design' => false, 'sinatra_breadcrumbs_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array(), 'gradient' => array(), 'image' => array(), ), ) ), 'sinatra_breadcrumbs_text_color' => sinatra_design_options_defaults( array( 'color' => array(), ) ), 'sinatra_breadcrumbs_border' => sinatra_design_options_defaults( array( 'border' => array( 'border-top-width' => 0, 'border-bottom-width' => 0, 'border-color' => '', 'border-style' => 'solid', ), ) ), /** * Hero. */ 'sinatra_enable_hero' => false, 'sinatra_hero_type' => 'hover-slider', 'sinatra_hero_visibility' => 'all', 'sinatra_hero_enable_on' => array( 'home' ), 'sinatra_hero_hover_slider' => false, 'sinatra_hero_hover_slider_container' => 'content-width', 'sinatra_hero_hover_slider_height' => 500, 'sinatra_hero_hover_slider_overlay' => '1', 'sinatra_hero_hover_slider_elements' => array( 'category' => true, 'meta' => true, 'read_more' => true, ), 'sinatra_hero_hover_slider_posts' => false, 'sinatra_hero_hover_slider_post_number' => 3, 'sinatra_hero_hover_slider_category' => array(), /** * Blog. */ // Blog Page / Archive. 'sinatra_blog_entry_elements' => array( 'thumbnail' => true, 'header' => true, 'meta' => true, 'summary' => true, 'summary-footer' => true, ), 'sinatra_blog_entry_meta_elements' => array( 'author' => true, 'date' => true, 'category' => true, 'tag' => false, 'comments' => true, ), 'sinatra_entry_meta_icons' => false, 'sinatra_excerpt_length' => 30, 'sinatra_excerpt_more' => '…', 'sinatra_blog_layout' => 'blog-layout-1', 'sinatra_blog_image_position' => 'left', 'sinatra_blog_image_size' => 'large', 'sinatra_blog_horizontal_post_categories' => true, 'sinatra_blog_horizontal_read_more' => false, // Single Post. 'sinatra_single_post_layout_heading' => false, 'sinatra_single_title_position' => 'in-content', 'sinatra_single_title_alignment' => 'left', 'sinatra_single_title_spacing' => array( 'desktop' => array( 'top' => 152, 'bottom' => 100, ), 'tablet' => array( 'top' => 90, 'bottom' => 55, ), 'mobile' => array( 'top' => '', 'bottom' => '', ), 'unit' => 'px', ), 'sinatra_single_content_width' => 'narrow', 'sinatra_single_narrow_container_width' => 700, 'sinatra_single_post_elements_heading' => false, 'sinatra_single_post_meta_elements' => array( 'author' => true, 'date' => true, 'comments' => true, 'category' => false, ), 'sinatra_single_post_thumb' => true, 'sinatra_single_post_categories' => true, 'sinatra_single_post_tags' => true, 'sinatra_single_last_updated' => true, 'sinatra_single_about_author' => true, 'sinatra_single_post_next_prev' => true, 'sinatra_single_post_elements' => array( 'thumb' => true, 'category' => true, 'tags' => true, 'last-updated' => true, 'about-author' => true, 'prev-next-post' => true, ), 'sinatra_single_toggle_comments' => false, 'sinatra_single_entry_meta_icons' => false, 'sinatra_typography_single_post_heading' => false, 'sinatra_single_content_font_size' => array( 'desktop' => '1', 'unit' => 'rem', ), /** * Sidebar. */ 'sinatra_sidebar_position' => 'right-sidebar', 'sinatra_single_post_sidebar_position' => 'no-sidebar', 'sinatra_single_page_sidebar_position' => 'default', 'sinatra_archive_sidebar_position' => 'default', 'sinatra_sidebar_options_heading' => false, 'sinatra_sidebar_style' => '1', 'sinatra_sidebar_width' => 25, 'sinatra_sidebar_sticky' => '', 'sinatra_sidebar_responsive_position' => 'after-content', 'sinatra_typography_sidebar_heading' => false, 'sinatra_sidebar_widget_title_font_size' => array( 'desktop' => 1, 'unit' => 'rem', ), /** * Footer. */ // Pre Footer. 'sinatra_pre_footer_cta' => true, 'sinatra_enable_pre_footer_cta' => false, 'sinatra_pre_footer_cta_visibility' => 'all', 'sinatra_pre_footer_cta_hide_on' => array(), 'sinatra_pre_footer_cta_style' => '1', 'sinatra_pre_footer_cta_text' => wp_kses_post( __( 'This is an example of Pre Footer section in Sinatra.', 'sinatra' ) ), 'sinatra_pre_footer_cta_btn_text' => wp_kses_post( __( 'Example Button', 'sinatra' ) ), 'sinatra_pre_footer_cta_btn_url' => '#', 'sinatra_pre_footer_cta_btn_new_tab' => false, 'sinatra_pre_footer_cta_design_options' => false, 'sinatra_pre_footer_cta_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array(), 'gradient' => array(), 'image' => array(), ), ) ), 'sinatra_pre_footer_cta_border' => sinatra_design_options_defaults( array( 'border' => array(), ) ), 'sinatra_pre_footer_cta_text_color' => sinatra_design_options_defaults( array( 'color' => array( 'text-color' => '#FFFFFF', ), ) ), 'sinatra_pre_footer_cta_typography' => false, 'sinatra_pre_footer_cta_font_size' => array( 'desktop' => 1.75, 'unit' => 'rem', ), // Copyright. 'sinatra_enable_copyright' => true, 'sinatra_copyright_layout' => 'layout-1', 'sinatra_copyright_separator' => 'contained-separator', 'sinatra_copyright_visibility' => 'all', 'sinatra_copyright_heading_widgets' => true, 'sinatra_copyright_widgets' => array( array( 'classname' => 'sinatra_customizer_widget_text', 'type' => 'text', 'values' => array( 'content' => esc_html__( 'Copyright {{the_year}} — {{site_title}}. All rights reserved. {{theme_link}}', 'sinatra' ), 'location' => 'start', 'visibility' => 'all', ), ), ), 'sinatra_copyright_heading_design_options' => false, 'sinatra_copyright_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array(), 'gradient' => array(), ), ) ), 'sinatra_copyright_text_color' => sinatra_design_options_defaults( array( 'color' => array( 'text-color' => '', 'link-color' => '', 'link-hover-color' => '#FFFFFF', ), ) ), // Main Footer. 'sinatra_enable_footer' => true, 'sinatra_footer_layout' => 'layout-1', 'sinatra_footer_widgets_align_center' => false, 'sinatra_footer_visibility' => 'all', 'sinatra_footer_heading_design_options' => false, 'sinatra_footer_background' => sinatra_design_options_defaults( array( 'background' => array( 'color' => array( 'background-color' => '#23282d', ), 'gradient' => array(), 'image' => array(), ), ) ), 'sinatra_footer_text_color' => sinatra_design_options_defaults( array( 'color' => array( 'text-color' => '#9BA1A7', 'link-color' => '', 'link-hover-color' => '#FFFFFF', 'widget-title-color' => '#FFFFFF', ), ) ), 'sinatra_footer_border' => sinatra_design_options_defaults( array( 'border' => array(), ) ), 'sinatra_typography_main_footer_heading' => false, ); $defaults = apply_filters( 'sinatra_default_option_values', $defaults ); return $defaults; } /** * Get the options from static array() * * @since 1.0.0 * @return array Return array of theme options. */ public function get_options() { return self::$options; } /** * Get the options from static array() * * @since 1.0.0 * @return array Return array of theme options. */ public function get( $id ) { $value = isset( self::$options[ $id ] ) ? self::$options[ $id ] : self::get_default( $id ); $value = apply_filters( "theme_mod_{$id}", $value ); // phpcs:ignore return $value; } /** * Set option. * * @since 1.0.0 */ public function set( $id, $value ) { set_theme_mod( $id, $value ); self::$options[ $id ] = $value; } /** * Refresh options. * * @since 1.0.0 * @return void */ public function refresh() { self::$options = wp_parse_args( get_theme_mods(), self::get_defaults() ); } /** * Returns the default value for option. * * @since 1.0.0 * @param string $id Option ID. * @return mixed Default option value. */ public function get_default( $id ) { $defaults = self::get_defaults(); return isset( $defaults[ $id ] ) ? $defaults[ $id ] : false; } } endif; core/class-sinatra-theme-setup.php000064400000010170151231536700013211 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Theme_Setup' ) ) : /** * Sinatra Options Class. */ class Sinatra_Theme_Setup { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * Main Sinatra_Theme_Setup Instance. * * @since 1.0.0 * @return Sinatra_Theme_Setup */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Theme_Setup ) ) { self::$instance = new Sinatra_Theme_Setup(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Add theme supports. add_action( 'after_setup_theme', array( $this, 'setup' ), 10 ); // Content width. add_action( 'wp', array( $this, 'content_width' ) ); } /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. * * @since 1.0.0 */ public function setup() { // Make the theme available for translation. load_theme_textdomain( 'sinatra', SINATRA_THEME_PATH . '/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); // Add theme support for Post Thumbnails and image sizes. add_theme_support( 'post-thumbnails' ); // Add theme support for various Post Formats. add_theme_support( 'post-formats', array( 'gallery', 'image', 'link', 'quote', 'video', 'audio', 'status', 'aside', ) ); // Add title output. add_theme_support( 'title-tag' ); // Add wide image support. add_theme_support( 'align-wide' ); // Responsive embeds support. add_theme_support( 'responsive-embeds' ); // Add support for core block visual styles. add_theme_support( 'wp-block-styles' ); // Selective Refresh for Customizer. add_theme_support( 'customize-selective-refresh-widgets' ); // Excerpt support for pages. add_post_type_support( 'page', 'excerpt' ); // Register Navigation menu. register_nav_menus( array( 'sinatra-primary' => esc_html__( 'Primary Navigation', 'sinatra' ), ) ); // Add theme support for Custom Logo. add_theme_support( 'custom-logo', apply_filters( 'sinatra_custom_logo_args', array( 'width' => 200, 'height' => 40, 'flex-height' => true, 'flex-width' => true, ) ) ); // Add theme support for Custom Background. add_theme_support( 'custom-background', apply_filters( 'sinatra_custom_background_args', array( 'default-color' => '#FFFFFF', 'default-size' => 'fit', ) ) ); // Enable HTML5 markup. add_theme_support( 'html5', array( 'search-form', 'gallery', 'caption', 'script', 'style', ) ); // Add editor style. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; add_editor_style( 'assets/css/editor-style' . $sinatra_suffix . '.css' ); do_action( 'sinatra_after_setup_theme' ); } /** * Set the content width in pixels, based on the theme's design and stylesheet. * * @global int $content_width * @since 1.0.0 */ public function content_width() { global $content_width; if ( ! isset( $content_width ) ) { $content_width = apply_filters( 'sinatra_content_width', intval( sinatra_option( 'container_width' ) ) - 100 ); // phpcs:ignore } } } endif; /** * The function which returns the one Sinatra_Options instance. * * @since 1.0.0 * @return object */ function sinatra_theme_setup() { return Sinatra_Theme_Setup::instance(); } sinatra_theme_setup(); customizer/assets/css/sinatra-customizer-preview.css000064400000003332151231536700017102 0ustar00/* ========================================================================== * Sinatra Customizer Preview styles. * ========================================================================== */ .customize-partial-edit-shortcut-blogname, .customize-partial-edit-shortcut-sinatra_footer_widgets_align_center, .customize-partial-edit-shortcut-sinatra_hero_hover_slider_post_number { display: none !important; } .sinatra-hide-shortcuts .customize-partial-edit-shortcut { display: none !important; } .customize-partial-edit-shortcut { z-index: 9; } .customize-partial-edit-shortcut-sinatra_top_bar_widgets, .customize-partial-edit-shortcut-sinatra_enable_pre_footer_cta, .customize-partial-edit-shortcut-sinatra_header_widgets, .customize-partial-edit-shortcut-sinatra_copyright_widgets, .customize-partial-edit-shortcut-sinatra_hero_hover_slider_elements { left: 50%; top: 50%; } .customize-partial-edit-shortcut-sinatra_top_bar_widgets button, .customize-partial-edit-shortcut-sinatra_enable_pre_footer_cta button, .customize-partial-edit-shortcut-sinatra_header_widgets button, .customize-partial-edit-shortcut-sinatra_copyright_widgets button, .customize-partial-edit-shortcut-sinatra_hero_hover_slider_elements button { left: -15px; top: -15px; } .sinatra-social-nav .customize-partial-edit-shortcut { top: 0; } .sinatra-social-nav .customize-partial-edit-shortcut button { left: -20px; } .sinatra-primary-nav .customize-partial-edit-shortcut { top: 12px; } .sinatra-primary-nav .customize-partial-edit-shortcut button { left: -25px; } .sinatra-header-layout-3 .customize-partial-edit-shortcut-sinatra_header_layout { left: 30px; } .customize-partial-edit-shortcut-sinatra_footer_layout { top: 50%; left: 35px; } customizer/assets/css/sinatra-customizer-preview.min.css000064400000002604151231536700017665 0ustar00.customize-partial-edit-shortcut-blogname,.customize-partial-edit-shortcut-sinatra_footer_widgets_align_center,.customize-partial-edit-shortcut-sinatra_hero_hover_slider_post_number,.sinatra-hide-shortcuts .customize-partial-edit-shortcut{display:none!important}.customize-partial-edit-shortcut{z-index:9}.customize-partial-edit-shortcut-sinatra_copyright_widgets,.customize-partial-edit-shortcut-sinatra_enable_pre_footer_cta,.customize-partial-edit-shortcut-sinatra_header_widgets,.customize-partial-edit-shortcut-sinatra_hero_hover_slider_elements,.customize-partial-edit-shortcut-sinatra_top_bar_widgets{left:50%;top:50%}.customize-partial-edit-shortcut-sinatra_copyright_widgets button,.customize-partial-edit-shortcut-sinatra_enable_pre_footer_cta button,.customize-partial-edit-shortcut-sinatra_header_widgets button,.customize-partial-edit-shortcut-sinatra_hero_hover_slider_elements button,.customize-partial-edit-shortcut-sinatra_top_bar_widgets button{left:-15px;top:-15px}.sinatra-social-nav .customize-partial-edit-shortcut{top:0}.sinatra-social-nav .customize-partial-edit-shortcut button{left:-20px}.sinatra-primary-nav .customize-partial-edit-shortcut{top:12px}.sinatra-primary-nav .customize-partial-edit-shortcut button{left:-25px}.sinatra-header-layout-3 .customize-partial-edit-shortcut-sinatra_header_layout{left:30px}.customize-partial-edit-shortcut-sinatra_footer_layout{top:50%;left:35px}customizer/assets/css/sinatra-customizer.css000064400000125142151231536700015427 0ustar00/* ========================================================================== * Sinatra Customizer related styles. * ========================================================================== */ /** * Import configuration file with variables. */ .si-btn.btn-uppercase { text-transform: uppercase; letter-spacing: .1em; } .si-btn:disabled, .si-btn.disabled, body:not(.wp-customizer) input[type=submit]:disabled, body:not(.wp-customizer) input.disabled[type=submit], .site-main .woocommerce #respond input#submit:disabled, .site-main .woocommerce #respond input#submit.disabled, .site-main .woocommerce a.button:disabled, .site-main .woocommerce a.button.disabled, .site-main .woocommerce button.button:disabled, .site-main .woocommerce button.button.disabled, .site-main .woocommerce input.button:disabled, .site-main .woocommerce input.button.disabled, .woocommerce ul.products li.product .added_to_cart:disabled, .woocommerce ul.products li.product .added_to_cart.disabled, .woocommerce ul.products li.product .button:disabled, .woocommerce ul.products li.product .button.disabled, .woocommerce div.product form.cart .button:disabled, .woocommerce div.product form.cart .button.disabled, .woocommerce #review_form #respond .form-submit input:disabled, .woocommerce #review_form #respond .form-submit input.disabled, #infinite-handle span:disabled, #infinite-handle span.disabled { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { text-decoration: none; } .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { -webkit-transition: all 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: all 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); } .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { outline: none; border: none; margin: 0; padding: 0; text-shadow: none; -webkit-box-shadow: none; box-shadow: none; } /** * Import tooltips and info icon. */ /*****************************************/ /* Sinatra tooltip and info icon. /*****************************************/ .sinatra-info-icon, .sinatra-warning-icon { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin-left: 5px; position: relative; } .sinatra-info-icon svg, .sinatra-warning-icon svg { fill: #b5c9d6; } .sinatra-info-icon:hover svg, .sinatra-info-icon:focus svg, .sinatra-warning-icon:hover svg, .sinatra-warning-icon:focus svg { fill: #648da8; } .sinatra-info-icon:hover .sinatra-tooltip, .sinatra-info-icon:focus .sinatra-tooltip, .sinatra-warning-icon:hover .sinatra-tooltip, .sinatra-warning-icon:focus .sinatra-tooltip { display: block; } .sinatra-tooltip { display: none; position: absolute; background-color: #23282d; color: #d6e1e8; font-size: 13px; font-style: normal; width: 300px; padding: 16px 18px; z-index: 991; border-radius: 3px; line-height: 1.6; bottom: 100%; -webkit-transform: translate(0, -13px); -ms-transform: translate(0, -13px); transform: translate(0, -13px); } .sinatra-tooltip:after { content: ''; width: 10px; height: 10px; background-color: #23282d; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); position: absolute; top: calc(100% - 5px); left: var(--tooltip-left); margin-left: 14px; } .sinatra-tooltip.right-tooltip { left: 100%; top: 50%; -webkit-transform: translate(13px, -50%); -ms-transform: translate(13px, -50%); transform: translate(13px, -50%); } .sinatra-tooltip.top-right-tooltip { right: 0; bottom: 100%; -webkit-transform: translate(0, 13px); -ms-transform: translate(0, 13px); transform: translate(0, 13px); } .sinatra-tooltip.top-right-tooltip:after { top: calc(100% - 6px); left: calc(100% - 25px); margin-left: 0; } .sinatra-tooltip.small-tooltip { top: 5px; bottom: auto; left: 50%; width: auto; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); padding: 6px 10px; font-size: 11px; line-height: 1.5; white-space: nowrap; font-weight: 400; } .sinatra-tooltip.small-tooltip:after { display: none; } /** * Import configuration file with variables. */ /*****************************************/ /* Customizer base styles /*****************************************/ #accordion-section-sinatra_info { margin-bottom: 15px; } #accordion-panel-nav_menus, #accordion-section-sinatra_section_help .accordion-section-title, #accordion-panel-sinatra_panel_blog, #accordion-panel-sinatra_panel_header, #accordion-section-sinatra_section_transparent_header, #accordion-section-sinatra_section_page_header { margin-top: 12px; } #customize-control-sinatra_h1_font:after, #customize-control-sinatra_h2_font:after, #customize-control-sinatra_h3_font:after, #customize-control-sinatra_h4_font:after, #customize-control-sinatra_h5_font:after, #customize-control-sinatra_top_bar_background:after, #customize-control-sinatra_top_bar_text_color:after, #customize-control-sinatra_header_background:after, #customize-control-sinatra_header_text_color:after, #customize-control-sinatra_page_header_background:after, #customize-control-sinatra_page_header_text_color:after, #customize-control-sinatra_pre_footer_cta_background:after, #customize-control-sinatra_pre_footer_cta_text_color:after, #customize-control-sinatra_footer_background:after, #customize-control-sinatra_footer_text_color:after, #customize-control-sinatra_copyright_background:after, #customize-control-sinatra_single_post_thumb:after, #customize-control-sinatra_single_post_categories:after, #customize-control-sinatra_single_post_tags:after, #customize-control-sinatra_single_last_updated:after, #customize-control-sinatra_single_about_author:after, #customize-control-sinatra_single_post_next_prev:after, #customize-control-sinatra_primary_button_design_options:after, #customize-control-sinatra_single_toggle_comments:after { display: none; } .control-section { min-height: 100%; } .control-section-default.open { -js-display: flex !important; display: -webkit-box !important; display: -ms-flexbox !important; display: flex !important; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; } .control-section-default.open .customize-control { margin-bottom: 16px; } .control-section-default.open .customize-control:after { content: ''; display: block; margin-top: 16px; border-bottom: 1px solid #ddd; margin-left: -12px; margin-right: -12px; } .control-section-default.open .customize-control:last-child:after { display: none; } .control-section-default.open .customize-control input[type=text]:not(.wp-color-picker), .control-section-default.open .customize-control textarea, .control-section-default.open .customize-control select { margin-top: 6px; border-radius: 3px; -webkit-box-shadow: none !important; box-shadow: none !important; padding: 2px 8px; font-size: 13px; } .control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::-webkit-input-placeholder, .control-section-default.open .customize-control textarea:focus::-webkit-input-placeholder, .control-section-default.open .customize-control select:focus::-webkit-input-placeholder { opacity: 0.6; } .control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::-moz-placeholder, .control-section-default.open .customize-control textarea:focus::-moz-placeholder, .control-section-default.open .customize-control select:focus::-moz-placeholder { opacity: 0.6; } .control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus:-ms-input-placeholder, .control-section-default.open .customize-control textarea:focus:-ms-input-placeholder, .control-section-default.open .customize-control select:focus:-ms-input-placeholder { opacity: 0.6; } .control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::-ms-input-placeholder, .control-section-default.open .customize-control textarea:focus::-ms-input-placeholder, .control-section-default.open .customize-control select:focus::-ms-input-placeholder { opacity: 0.6; } .control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::placeholder, .control-section-default.open .customize-control textarea:focus::placeholder, .control-section-default.open .customize-control select:focus::placeholder { opacity: 0.6; } .control-section-default.open .customize-control select { cursor: pointer; } .control-section-default.open .customize-control textarea { padding: 10px 8px; width: 100%; } .control-section-default.open .widget-top .widget-action:focus .toggle-indicator:before { -webkit-box-shadow: none !important; box-shadow: none !important; } .control-section-default.open .widget-top .toggle-indicator { border-radius: 50%; } .control-section-default.open .widget-top .toggle-indicator:hover { background-color: #f0f0f0; color: #000; } #customize-control-background_repeat:after, #customize-control-background_attachment:after, #customize-control-background_size:after, #customize-control-background_position:after, #customize-control-background_preset:after { display: none; } #customize-control-background_repeat { margin-bottom: 0; } #customize-control-sinatra_header_layout.customize-control-sinatra-radio-image label, #customize-control-sinatra_footer_layout.customize-control-sinatra-radio-image label, #customize-control-sinatra_copyright_layout.customize-control-sinatra-radio-image label { -ms-flex-preferred-size: 50%; flex-basis: 50%; max-width: 50%; } #customize-control-sinatra_header_layout.customize-control-sinatra-radio-image label img, #customize-control-sinatra_footer_layout.customize-control-sinatra-radio-image label img, #customize-control-sinatra_copyright_layout.customize-control-sinatra-radio-image label img { width: 100%; height: auto; } .sinatra-hosting-button { margin: auto 0; } .sinatra-hosting-button > h3 { margin: 30px 0; background: none !important; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; border: none !important; } .sinatra-hosting-button > h3 .button-primary { padding-left: 20px !important; padding-right: 20px !important; font-weight: 400; } #customize-theme-controls #accordion-section-sinatra_info > h3 { padding: 0; border-left-color: #0073aa; } #customize-theme-controls #accordion-section-sinatra_info > h3 a { position: relative; z-index: 2; text-decoration: none; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -ms-flex-wrap: wrap; flex-wrap: wrap; color: #0073aa; padding: 10px 10px 11px 14px; overflow: hidden; } #customize-theme-controls #accordion-section-sinatra_info > h3 a:focus { -webkit-box-shadow: none; box-shadow: none; } #customize-theme-controls #accordion-section-sinatra_info > h3 a .dashicons { font-size: 85px; width: auto; height: auto; color: rgba(5, 10, 15, 0.03) !important; position: absolute; z-index: 1; right: -15px; bottom: -15px; } #customize-theme-controls #accordion-section-sinatra_info > h3:hover, #customize-theme-controls #accordion-section-sinatra_info > h3:focus { border-left-color: #0073aa; } #customize-theme-controls #accordion-section-sinatra_info > h3:hover a, #customize-theme-controls #accordion-section-sinatra_info > h3:focus a { color: #0073aa; background: #f3f3f5; } #customize-theme-controls #accordion-section-sinatra_info > h3:hover a .dashicons, #customize-theme-controls #accordion-section-sinatra_info > h3:focus a .dashicons { color: inherit; } #customize-theme-controls #accordion-section-sinatra_info > h3:hover:after, #customize-theme-controls #accordion-section-sinatra_info > h3:focus:after { color: #0073aa; } #customize-theme-controls #accordion-section-sinatra_info > h3:after { z-index: 2; display: block !important; } #customize-theme-controls #accordion-section-sinatra_info .sinatra-info-tagline { position: relative; z-index: 2; display: block; -ms-flex-preferred-size: 100%; flex-basis: 100%; overflow: hidden; font-weight: 400; font-size: 12px; line-height: 1.6; margin-top: 0; color: #656a6f; } #customize-controls .customize-control-description { font-style: normal; } #customize-controls .customize-control-description > p:first-child { margin-top: 0; } #customize-controls .customize-control-cropped_image .customize-control-description { margin-bottom: 12px; } #customize-controls .customize-control-title { position: relative; color: #23282d; } #customize-controls .sinatra-select-wrapper select { margin: 6px 0 0 0; } .sinatra-control-wrapper .customize-control-title { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } .sinatra-control-wrapper .customize-control-description { margin-top: -2px; margin-bottom: 6px; } .sinatra-control-wrapper .buttonset { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; border-left: 1px solid #d2d2d2; } .sinatra-control-wrapper .buttonset label { display: block; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; -ms-flex-preferred-size: 33.33%; flex-basis: 33.33%; max-width: 33.33%; padding: 7px 12px; background-color: #fff; border-top: solid 1px #d2d2d2; border-bottom: solid 1px #d2d2d2; border-right: solid 1px #d2d2d2; text-align: center; } .sinatra-control-wrapper .buttonset label:hover { color: #000; } .sinatra-control-wrapper .buttonset input { display: none; } .sinatra-control-wrapper .buttonset input:checked + label { background-color: #0085ba; color: #FFF; } .sinatra-control-wrapper .widget-inside .buttonset { margin-top: 6px; } .sinatra-control-wrapper .widget-inside .buttonset label { -ms-flex-preferred-size: initial; flex-basis: initial; max-width: initial; } .sinatra-control-wrapper .reset-defaults { text-decoration: none; color: rgba(0, 0, 0, 0.2); margin-right: 10px; } .sinatra-control-wrapper .reset-defaults:hover { color: #f00; } .sinatra-control-wrapper .reset-defaults > .dashicons { font-size: 14px; line-height: 20px; width: 14px; } #sinatra-available-widgets { position: absolute; top: 0; bottom: 0; left: 0; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); visibility: hidden; overflow-x: hidden; overflow-y: auto; width: 300px; margin: 0; z-index: 4; background: #eee; -webkit-transition: all .18s; transition: all .18s; border-right: 1px solid #ddd; } .sinatra-info-icon { margin-left: 10px; margin-top: 2px; } .sinatra-info-icon svg { fill: none; stroke: #c7c7c7; } .sinatra-info-icon:hover svg, .sinatra-info-icon:focus svg { fill: none; stroke: #555d66; } .sinatra-info-icon:hover .sinatra-tooltip, .sinatra-info-icon:focus .sinatra-tooltip { display: block; } .sinatra-tooltip { max-width: 180px; font-weight: 300; font-size: 12px; line-height: 1.5; padding: 8px 14px; text-transform: none; letter-spacing: 0; } .sinatra-tooltip.top-right-tooltip { -webkit-transform: translate(8px, -12px); -ms-transform: translate(8px, -12px); transform: translate(8px, -12px); } .sinatra-control-unit { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; margin-left: auto; } .sinatra-control-unit input { display: none; } .sinatra-control-unit input:checked + label { color: #000; text-decoration: underline; } .sinatra-control-unit label { margin: 0px 3px; color: #999; text-transform: uppercase; font-size: 9px; } .sinatra-control-unit label:hover { color: #000; } .select2-dropdown { z-index: 500000 !important; border-color: #7e8993; } .select2-container--default .select2-selection--single { border-color: #7e8993 !important; } .select2-container--default .select2-selection--single:focus { outline: none !important; } .select2-container--default.select2-container--focus .select2-selection--single { border-color: #0085ba !important; } .select2-container--default .select2-results__group { color: #aaa; font-weight: 400; } .select2-container--default .select2-results__option { padding: 5px 6px; margin: 0; } .select2-container--default .select2-results__option .select2-results__option { padding-left: 1.5em; } .select2-container--default .select2-selection--single .select2-selection__rendered { color: #32373c; line-height: 32px; } .select2-container--default .select2-results__option[aria-selected=true] { background-color: #eee; } .select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: #0085ba !important; } .select2-container .select2-selection--single { min-height: 32px; border-radius: 2px; } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px; } .select2-search--dropdown { padding: 0; } .select2-search--dropdown .select2-search__field { border-left: none !important; border-right: none !important; border-top: none !important; border-radius: 0; margin-left: 0 !important; padding: 2px 8px; border-bottom-color: #7e8993; } .select2-search--dropdown .select2-search__field:focus { -webkit-box-shadow: none; box-shadow: none; } .wp-pointer.sinatra-pointer { z-index: 500000 !important; } #wp-pointer-4.sinatra-pointer.wp-pointer-top .wp-pointer-arrow { right: 62px; left: auto; } .spinner { display: none; } .spinner.activated, .spinner.visible { display: inline-block; visibility: visible; } /** * Import customizer responsive buttons. */ /*****************************************/ /* Customizer responsive buttons styles /*****************************************/ .sinatra-responsive-switchers { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; margin: 2px 0 0 auto; } .sinatra-responsive-switchers.expanded li { display: initial; } .sinatra-responsive-switchers .sinatra-tooltip.small-tooltip { bottom: 100%; top: auto; margin-bottom: 5px; } .sinatra-responsive-switchers li { position: relative; margin: 0; cursor: pointer; display: none; } .sinatra-responsive-switchers li:first-child { display: initial; } .sinatra-responsive-switchers li:hover .small-tooltip { display: block; text-transform: capitalize; } .sinatra-responsive-switchers li .active .dashicons { background-color: #0073aa !important; color: #FFF !important; } .sinatra-responsive-switchers li:hover .dashicons { color: #23282d; } .sinatra-responsive-switchers li .dashicons { width: 20px; height: 20px; font-size: 12px; border-radius: 50%; background-color: #FFF; color: #808890; margin: 0 3px; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; border: 1px solid #e0e0e0; } .sinatra-responsive-switchers .dashicons-mobile:before { content: "\f470"; } .sinatra-control-wrapper .sinatra-control-wrap > div { display: none; -webkit-box-align: center; -ms-flex-align: center; align-items: center; width: 100%; } .sinatra-control-wrapper .sinatra-control-wrap > div.active { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; } /** * Import customizer popup options. */ /*****************************************/ /* Customizer popup options styles /*****************************************/ .si-btn.btn-uppercase { text-transform: uppercase; letter-spacing: .1em; } .si-btn:disabled, .si-btn.disabled, body:not(.wp-customizer) input[type=submit]:disabled, body:not(.wp-customizer) input.disabled[type=submit], .site-main .woocommerce #respond input#submit:disabled, .site-main .woocommerce #respond input#submit.disabled, .site-main .woocommerce a.button:disabled, .site-main .woocommerce a.button.disabled, .site-main .woocommerce button.button:disabled, .site-main .woocommerce button.button.disabled, .site-main .woocommerce input.button:disabled, .site-main .woocommerce input.button.disabled, .woocommerce ul.products li.product .added_to_cart:disabled, .woocommerce ul.products li.product .added_to_cart.disabled, .woocommerce ul.products li.product .button:disabled, .woocommerce ul.products li.product .button.disabled, .woocommerce div.product form.cart .button:disabled, .woocommerce div.product form.cart .button.disabled, .woocommerce #review_form #respond .form-submit input:disabled, .woocommerce #review_form #respond .form-submit input.disabled, #infinite-handle span:disabled, #infinite-handle span.disabled { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { text-decoration: none; } .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { -webkit-transition: all 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: all 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); } .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { outline: none; border: none; margin: 0; padding: 0; text-shadow: none; -webkit-box-shadow: none; box-shadow: none; } .sinatra-popup-options, .sinatra-popup-options .popup-link { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .sinatra-popup-options { -ms-flex-wrap: wrap; flex-wrap: wrap; position: relative; } .sinatra-popup-options .popup-link { margin-left: auto; background-color: #FFF; border-radius: 3px; margin-left: auto; font-size: 12px; width: 40px; height: 33px; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; border: 1px solid #e0e0e0; -webkit-transition: all .15s ease; transition: all .15s ease; text-decoration: none; color: #555d66; } .sinatra-popup-options .popup-link .dashicons { -webkit-transition: none; transition: none; color: inherit; } .sinatra-popup-options .popup-link.active, .sinatra-popup-options .popup-link:focus, .sinatra-popup-options .popup-link:hover { background-color: #0284ba; color: #fff; } .sinatra-popup-options .popup-link.active > .dashicons-edit:before { content: "\f335"; } .sinatra-popup-options .popup-link.hidden { display: none; } .sinatra-popup-options .popup-content { background-color: #fff; padding: 14px 20px; position: absolute; width: 100%; top: 100%; left: 0; margin: 10px 0 30px 0; -webkit-box-sizing: border-box; box-sizing: border-box; border: 1px solid #ddd; border-radius: 3px; -webkit-box-shadow: 0 0 50px rgba(0, 0, 0, 0.22); box-shadow: 0 0 50px rgba(0, 0, 0, 0.22); z-index: 1; } .sinatra-popup-options .popup-content:after { content: ''; position: absolute; top: -6px; right: 15px; background-color: #FFF; width: 10px; height: 10px; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); border-top: 1px solid #ddd; border-left: 1px solid #ddd; } .sinatra-popup-options .popup-element { margin: 12px 0; position: relative; } .sinatra-popup-options .popup-element.style-1 > label, .sinatra-popup-options .popup-element.style-2 > label { -ms-flex-negative: 0; flex-shrink: 0; font-size: 12px; line-height: 1; margin-right: 5px; } .sinatra-popup-options .popup-element.style-1 { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .sinatra-popup-options .popup-element.style-1 > .popup-input-wrapper { margin-left: auto; width: 55%; -ms-flex-negative: 1; flex-shrink: 1; } .sinatra-popup-options .popup-element.style-1 select, .sinatra-popup-options .popup-element.style-1 input { margin: 0 !important; } .sinatra-popup-options .popup-element.color-element { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; } .sinatra-popup-options .popup-element.color-element > label { min-height: 22px; line-height: 22px; } .sinatra-popup-options .popup-element.color-element .wp-color-result.button { position: absolute; top: 0; right: 0; height: 23px; min-height: 23px; width: 50px; padding: 0; } .sinatra-popup-options .popup-element.color-element .wp-color-result.button:before { width: 48px; } .sinatra-popup-options .popup-element.color-element .wp-color-result.button .wp-color-result-text { display: none; } .sinatra-popup-options .popup-element.color-element .wp-picker-container.wp-picker-active { -ms-flex-item-align: end; align-self: flex-end; } .sinatra-popup-options .popup-element.color-element .wp-picker-open + .wp-picker-input-wrap label input { padding: 8px 12px !important; border-radius: 3px 0 0 0 !important; } /** * Import customizer pointers api. */ /* ========================================================================== * WordPress Pointers API styles. * ========================================================================== */ .widget .customize-partial-edit-shortcut button, .customize-partial-edit-shortcut button { background: #0085ba !important; } .sinatra-pointer-buttons { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; width: 100%; } .sinatra-pointer-buttons .button-primary { margin-left: auto; } .sinatra-pointer-buttons a.close { margin-left: 15px; } .sinatra-pointer.arrow-top .wp-pointer-arrow { top: 0; margin-top: 12px; border-right-color: #0173a1; } .sinatra-pointer.arrow-top .wp-pointer-arrow .wp-pointer-arrow-inner { border-right-color: #0185ba; } .sinatra-pointer .wp-pointer-content { padding: 0 0 16px; border-radius: 4px; -webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1); border: 1px solid #ddd; } .sinatra-pointer .wp-pointer-content h3 { background: #0085ba; font-size: 16px; padding: 13px 16px; line-height: 24px; font-weight: 400; color: #FAFBFC; margin: 0; border-radius: 3px 3px 0 0; border: 1px solid #0073a1; border-bottom: none; margin: -1px; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .sinatra-pointer .wp-pointer-content h3:before { display: none; } .sinatra-pointer .wp-pointer-content h3 img { margin: 0 auto; height: 23px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .sinatra-pointer .wp-pointer-content p { padding: 0; margin: 16px 16px 32px 16px; font-size: 14px; line-height: 22px; color: #5c5c5c; } .sinatra-pointer .wp-pointer-content a { text-decoration: none; color: #0085ba; } .sinatra-pointer .wp-pointer-content a:hover { color: #00b1f7; } .sinatra-pointer .wp-pointer-content .button { font-weight: 300; -webkit-box-shadow: none; box-shadow: none; text-shadow: none; border: none; height: 32px; line-height: 32px; padding: 0 25px; border-radius: 3px; line-height: 32px; font-size: 13px; } .sinatra-pointer .wp-pointer-content .button-primary { -webkit-box-shadow: none; box-shadow: none; text-shadow: none; border: none; background-color: #0085ba; color: #FFF !important; } .sinatra-pointer .wp-pointer-content .button-primary:hover { background-color: #0097d4; } .sinatra-pointer .wp-pointer-content a.close { margin-left: 0; padding-left: 0; } .sinatra-pointer .wp-pointer-content a.close:before { display: none !important; } .sinatra-pointer .wp-pointer-content .wp-pointer-buttons { padding: 0 16px; } .sinatra-pointer .wp-pointer-content .wp-pointer-buttons a { color: #0085ba; } .sinatra-pointer .wp-pointer-content .wp-pointer-buttons a:hover { color: #00b1f7; } .sinatra-pointer .wp-pointer-content .wp-pointer-buttons a.close { margin-right: auto; } .sinatra-pointer .wp-pointer-content .wp-pointer-buttons a.button-primary { margin-left: 8px; } .sinatra-pointer .wp-pointer-content .wp-pointer-buttons a.button-secondary { border: 1px solid #0085ba; border-radius: 3px; background: none; } .sinatra-pointer.wp-pointer-top .wp-pointer-arrow { border-bottom-color: #00a9ed !important; } .sinatra-pointer.wp-pointer-top .wp-pointer-arrow .wp-pointer-arrow-inner { border-bottom-color: #0085ba !important; } /** * Import buttons. */ /*****************************************/ /* Button styles. /*****************************************/ .si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span { -js-display: inline-flex; display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; text-align: center; max-width: 100%; cursor: pointer; -moz-appearance: none; -webkit-appearance: none; -webkit-box-shadow: none; box-shadow: none; border-style: solid; -ms-flex-negative: 0; flex-shrink: 0; font-size: inherit; min-height: 45px; padding: .5em 2em; } .si-btn span, body:not(.wp-customizer) input[type=submit] span, .site-main .woocommerce #respond input#submit span, .site-main .woocommerce a.button span, .site-main .woocommerce button.button span, .site-main .woocommerce input.button span, .woocommerce ul.products li.product .added_to_cart span, .woocommerce ul.products li.product .button span, .woocommerce div.product form.cart .button span, .woocommerce #review_form #respond .form-submit input span, #infinite-handle span span { z-index: 2; position: relative; } .si-btn:disabled, .si-btn.disabled, body:not(.wp-customizer) input[type=submit]:disabled, body:not(.wp-customizer) input[type=submit].disabled, .site-main .woocommerce #respond input#submit:disabled, .site-main .woocommerce #respond input#submit.disabled, .site-main .woocommerce a.button:disabled, .site-main .woocommerce a.button.disabled, .site-main .woocommerce button.button:disabled, .site-main .woocommerce button.button.disabled, .site-main .woocommerce input.button:disabled, .site-main .woocommerce input.button.disabled, .woocommerce ul.products li.product .added_to_cart:disabled, .woocommerce ul.products li.product .added_to_cart.disabled, .woocommerce ul.products li.product .button:disabled, .woocommerce ul.products li.product .button.disabled, .woocommerce div.product form.cart .button:disabled, .woocommerce div.product form.cart .button.disabled, .woocommerce #review_form #respond .form-submit input:disabled, .woocommerce #review_form #respond .form-submit input.disabled, #infinite-handle span:disabled, #infinite-handle span.disabled { cursor: not-allowed !important; } .si-btn:disabled > span, .si-btn:disabled > i, .si-btn.disabled > span, .si-btn.disabled > i, body:not(.wp-customizer) input[type=submit]:disabled > span, body:not(.wp-customizer) input[type=submit]:disabled > i, body:not(.wp-customizer) input[type=submit].disabled > span, body:not(.wp-customizer) input[type=submit].disabled > i, .site-main .woocommerce #respond input#submit:disabled > span, .site-main .woocommerce #respond input#submit:disabled > i, .site-main .woocommerce #respond input#submit.disabled > span, .site-main .woocommerce #respond input#submit.disabled > i, .site-main .woocommerce a.button:disabled > span, .site-main .woocommerce a.button:disabled > i, .site-main .woocommerce a.button.disabled > span, .site-main .woocommerce a.button.disabled > i, .site-main .woocommerce button.button:disabled > span, .site-main .woocommerce button.button:disabled > i, .site-main .woocommerce button.button.disabled > span, .site-main .woocommerce button.button.disabled > i, .site-main .woocommerce input.button:disabled > span, .site-main .woocommerce input.button:disabled > i, .site-main .woocommerce input.button.disabled > span, .site-main .woocommerce input.button.disabled > i, .woocommerce ul.products li.product .added_to_cart:disabled > span, .woocommerce ul.products li.product .added_to_cart:disabled > i, .woocommerce ul.products li.product .added_to_cart.disabled > span, .woocommerce ul.products li.product .added_to_cart.disabled > i, .woocommerce ul.products li.product .button:disabled > span, .woocommerce ul.products li.product .button:disabled > i, .woocommerce ul.products li.product .button.disabled > span, .woocommerce ul.products li.product .button.disabled > i, .woocommerce div.product form.cart .button:disabled > span, .woocommerce div.product form.cart .button:disabled > i, .woocommerce div.product form.cart .button.disabled > span, .woocommerce div.product form.cart .button.disabled > i, .woocommerce #review_form #respond .form-submit input:disabled > span, .woocommerce #review_form #respond .form-submit input:disabled > i, .woocommerce #review_form #respond .form-submit input.disabled > span, .woocommerce #review_form #respond .form-submit input.disabled > i, #infinite-handle span:disabled > span, #infinite-handle span:disabled > i, #infinite-handle span.disabled > span, #infinite-handle span.disabled > i { opacity: .5; } button.si-btn:disabled { opacity: .5; } .btn-small, .site-main .woocommerce #respond input#submit, #secondary .woocommerce a.button, #secondary .woocommerce button.button, #secondary .woocommerce input.button, .site-main .woocommerce .woocommerce-table a.button, .site-main .woocommerce .woocommerce-orders-table a.button, .site-main .woocommerce .woocommerce-Pagination a.button, .site-main .woocommerce .shipping-calculator-form .button, .woocommerce #secondary .widget_price_filter .price_slider_amount .button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button { font-size: 90% !important; min-height: 40px; padding: .5em 1.5em; } .btn-large, #place_order { min-height: 57px; font-size: 108% !important; } .btn-xlarge { font-size: 130% !important; min-height: 69px; font-weight: 600; } .btn-fw { width: 100%; text-align: center; } .btn-large-radius { border-radius: 50px; } .btn-left-icon, .btn-right-icon { position: relative; } .btn-left-icon > i, .btn-right-icon > i { position: relative; font-size: 110%; } .btn-left-icon.btn-reveal > i, .btn-right-icon.btn-reveal > i { -webkit-transition: opacity 0.1s ease, -webkit-transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: opacity 0.1s ease, -webkit-transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.1s ease; transition: transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.1s ease, -webkit-transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); opacity: 0; position: absolute; top: 50%; margin-top: .1em; -webkit-transform: translate3d(0, -50%, 0); transform: translate3d(0, -50%, 0); } .btn-left-icon.btn-reveal > span, .btn-right-icon.btn-reveal > span { -webkit-transition: padding 0.26s cubic-bezier(0.25, 0.8, 0.25, 1), margin 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: padding 0.26s cubic-bezier(0.25, 0.8, 0.25, 1), margin 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); -webkit-backface-visibility: hidden; backface-visibility: hidden; will-change: padding, margin; } .btn-left-icon.btn-svg > svg, .btn-right-icon.btn-svg > svg { height: 1em !important; width: auto !important; vertical-align: middle; fill: currentColor; } .btn-left-icon > i { -webkit-box-ordinal-group: 2; -ms-flex-order: 1; order: 1; margin-right: .65em; margin-left: -.65em; } .btn-left-icon > span { -webkit-box-ordinal-group: 3; -ms-flex-order: 2; order: 2; } .btn-left-icon.btn-reveal > i { left: .8em; -webkit-transform: translate3d(10px, -50%, 0); transform: translate3d(10px, -50%, 0); margin-left: 0; margin-right: 0; } .btn-left-icon.btn-reveal:hover > span { padding-left: 1em; margin-right: -1em; } .btn-left-icon.btn-reveal:hover > i { opacity: 1; -webkit-transform: translate3d(0px, -50%, 0); transform: translate3d(0px, -50%, 0); } .btn-right-icon > i { -webkit-box-ordinal-group: 3; -ms-flex-order: 2; order: 2; margin-left: .65em; margin-right: -.65em; } .btn-right-icon.btn-reveal > i { right: .8em; -webkit-transform: translate3d(-10px, -50%, 0); transform: translate3d(-10px, -50%, 0); margin-left: 0; margin-right: 0; } .btn-right-icon.btn-reveal:hover > span { padding-right: 1em; margin-left: -1em; } .btn-right-icon.btn-reveal:hover > i { opacity: 1; -webkit-transform: translate3d(0px, -50%, 0); transform: translate3d(0px, -50%, 0); } .si-btn.btn-outline { background-color: rgba(0, 0, 0, 0); } .si-btn.btn-secondary.btn-outline { background-color: rgba(0, 0, 0, 0); } .si-btn.btn-with-shadow { -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); box-shadow: 0 0 0 rgba(0, 0, 0, 0); } .si-btn.btn-with-shadow:hover { -webkit-box-shadow: 0 5px 25px rgba(0, 0, 0, 0.175); box-shadow: 0 5px 25px rgba(0, 0, 0, 0.175); -webkit-transform: translateY(-2px); -ms-transform: translateY(-2px); transform: translateY(-2px); } .si-btn.btn-text-1 { padding: 0 !important; min-height: 0; height: auto; background: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; border: none !important; font-weight: 500; } .si-btn.btn-text-1 span { padding: 3px 0; } .si-btn.btn-text-1 span:before, .si-btn.btn-text-1 span:after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; border-radius: 6px; } .si-btn.btn-text-1 span:after { background: currentColor; opacity: .2; } .si-btn.btn-text-1 span:before { background: currentColor; -webkit-transform-origin: right center; -ms-transform-origin: right center; transform-origin: right center; -webkit-transform: scale(0, 1); -ms-transform: scale(0, 1); transform: scale(0, 1); -webkit-transition: -webkit-transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: -webkit-transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); transition: transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1), -webkit-transform 0.26s cubic-bezier(0.25, 0.8, 0.25, 1); -webkit-backface-visibility: hidden; will-change: scale; z-index: 1; } .si-btn.btn-text-1:hover > span:before { -webkit-transform-origin: left center; -ms-transform-origin: left center; transform-origin: left center; -webkit-transform: scale(1, 1); -ms-transform: scale(1, 1); transform: scale(1, 1); } .si-btn.btn-text-1.btn-left-icon > span, .si-btn.btn-text-1.btn-right-icon > span { padding-left: 0 !important; padding-right: 0 !important; } .si-btn.btn-text-1.btn-left-icon > i, .si-btn.btn-text-1.btn-right-icon > i { position: static; } customizer/assets/css/sinatra-customizer.min.css000064400000072427151231536700016220 0ustar00.sinatra-info-icon,.sinatra-warning-icon{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-left:5px;position:relative}.sinatra-info-icon svg,.sinatra-warning-icon svg{fill:#b5c9d6}.sinatra-info-icon:focus svg,.sinatra-info-icon:hover svg,.sinatra-warning-icon:focus svg,.sinatra-warning-icon:hover svg{fill:#648da8}.sinatra-info-icon:focus .sinatra-tooltip,.sinatra-info-icon:hover .sinatra-tooltip,.sinatra-warning-icon:focus .sinatra-tooltip,.sinatra-warning-icon:hover .sinatra-tooltip{display:block}.sinatra-tooltip{display:none;color:#d6e1e8;font-size:13px;font-style:normal;width:300px;padding:16px 18px;z-index:991;border-radius:3px;line-height:1.6;bottom:100%;transform:translateY(-13px)}.sinatra-tooltip,.sinatra-tooltip:after{position:absolute;background-color:#23282d}.sinatra-tooltip:after{content:"";width:10px;height:10px;transform:rotate(45deg);top:calc(100% - 5px);left:var(--tooltip-left);margin-left:14px}.sinatra-tooltip.right-tooltip{left:100%;top:50%;transform:translate(13px,-50%)}.sinatra-tooltip.top-right-tooltip{right:0;bottom:100%;transform:translateY(13px)}.sinatra-tooltip.top-right-tooltip:after{top:calc(100% - 6px);left:calc(100% - 25px);margin-left:0}.sinatra-tooltip.small-tooltip{top:5px;bottom:auto;left:50%;width:auto;transform:translateX(-50%);padding:6px 10px;font-size:11px;line-height:1.5;white-space:nowrap;font-weight:400}.sinatra-tooltip.small-tooltip:after{display:none}#accordion-section-sinatra_info{margin-bottom:15px}#accordion-panel-nav_menus,#accordion-panel-sinatra_panel_blog,#accordion-panel-sinatra_panel_header,#accordion-section-sinatra_section_help .accordion-section-title,#accordion-section-sinatra_section_page_header,#accordion-section-sinatra_section_transparent_header{margin-top:12px}#customize-control-sinatra_copyright_background:after,#customize-control-sinatra_footer_background:after,#customize-control-sinatra_footer_text_color:after,#customize-control-sinatra_h1_font:after,#customize-control-sinatra_h2_font:after,#customize-control-sinatra_h3_font:after,#customize-control-sinatra_h4_font:after,#customize-control-sinatra_h5_font:after,#customize-control-sinatra_header_background:after,#customize-control-sinatra_header_text_color:after,#customize-control-sinatra_page_header_background:after,#customize-control-sinatra_page_header_text_color:after,#customize-control-sinatra_pre_footer_cta_background:after,#customize-control-sinatra_pre_footer_cta_text_color:after,#customize-control-sinatra_primary_button_design_options:after,#customize-control-sinatra_single_about_author:after,#customize-control-sinatra_single_last_updated:after,#customize-control-sinatra_single_post_categories:after,#customize-control-sinatra_single_post_next_prev:after,#customize-control-sinatra_single_post_tags:after,#customize-control-sinatra_single_post_thumb:after,#customize-control-sinatra_single_toggle_comments:after,#customize-control-sinatra_top_bar_background:after,#customize-control-sinatra_top_bar_text_color:after{display:none}.control-section{min-height:100%}.control-section-default.open{-js-display:flex!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-direction:column;flex-direction:column}.control-section-default.open .customize-control{margin-bottom:16px}.control-section-default.open .customize-control:after{content:"";display:block;margin-top:16px;border-bottom:1px solid #ddd;margin-left:-12px;margin-right:-12px}.control-section-default.open .customize-control:last-child:after{display:none}.control-section-default.open .customize-control input[type=text]:not(.wp-color-picker),.control-section-default.open .customize-control select,.control-section-default.open .customize-control textarea{margin-top:6px;border-radius:3px;box-shadow:none!important;padding:2px 8px;font-size:13px}.control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::-webkit-input-placeholder,.control-section-default.open .customize-control select:focus::-webkit-input-placeholder,.control-section-default.open .customize-control textarea:focus::-webkit-input-placeholder{opacity:.6}.control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::-moz-placeholder,.control-section-default.open .customize-control select:focus::-moz-placeholder,.control-section-default.open .customize-control textarea:focus::-moz-placeholder{opacity:.6}.control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus:-ms-input-placeholder,.control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::-ms-input-placeholder,.control-section-default.open .customize-control select:focus:-ms-input-placeholder,.control-section-default.open .customize-control select:focus::-ms-input-placeholder,.control-section-default.open .customize-control textarea:focus:-ms-input-placeholder,.control-section-default.open .customize-control textarea:focus::-ms-input-placeholder{opacity:.6}.control-section-default.open .customize-control input[type=text]:not(.wp-color-picker):focus::placeholder,.control-section-default.open .customize-control select:focus::placeholder,.control-section-default.open .customize-control textarea:focus::placeholder{opacity:.6}.control-section-default.open .customize-control select{cursor:pointer}.control-section-default.open .customize-control textarea{padding:10px 8px;width:100%}.control-section-default.open .widget-top .widget-action:focus .toggle-indicator:before{box-shadow:none!important}.control-section-default.open .widget-top .toggle-indicator{border-radius:50%}.control-section-default.open .widget-top .toggle-indicator:hover{background-color:#f0f0f0;color:#000}#customize-control-background_attachment:after,#customize-control-background_position:after,#customize-control-background_preset:after,#customize-control-background_repeat:after,#customize-control-background_size:after{display:none}#customize-control-background_repeat{margin-bottom:0}#customize-control-sinatra_copyright_layout.customize-control-sinatra-radio-image label,#customize-control-sinatra_footer_layout.customize-control-sinatra-radio-image label,#customize-control-sinatra_header_layout.customize-control-sinatra-radio-image label{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}#customize-control-sinatra_copyright_layout.customize-control-sinatra-radio-image label img,#customize-control-sinatra_footer_layout.customize-control-sinatra-radio-image label img,#customize-control-sinatra_header_layout.customize-control-sinatra-radio-image label img{width:100%;height:auto}.sinatra-hosting-button{margin:auto 0}.sinatra-hosting-button>h3{margin:30px 0;background:none!important;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none!important}.sinatra-hosting-button>h3 .button-primary{padding-left:20px!important;padding-right:20px!important;font-weight:400}#customize-theme-controls #accordion-section-sinatra_info>h3{padding:0;border-left-color:#0073aa}#customize-theme-controls #accordion-section-sinatra_info>h3 a{position:relative;z-index:2;text-decoration:none;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;color:#0073aa;padding:10px 10px 11px 14px;overflow:hidden}#customize-theme-controls #accordion-section-sinatra_info>h3 a:focus{box-shadow:none}#customize-theme-controls #accordion-section-sinatra_info>h3 a .dashicons{font-size:85px;width:auto;height:auto;color:rgba(5,10,15,.03)!important;position:absolute;z-index:1;right:-15px;bottom:-15px}#customize-theme-controls #accordion-section-sinatra_info>h3:focus,#customize-theme-controls #accordion-section-sinatra_info>h3:hover{border-left-color:#0073aa}#customize-theme-controls #accordion-section-sinatra_info>h3:focus a,#customize-theme-controls #accordion-section-sinatra_info>h3:hover a{color:#0073aa;background:#f3f3f5}#customize-theme-controls #accordion-section-sinatra_info>h3:focus a .dashicons,#customize-theme-controls #accordion-section-sinatra_info>h3:hover a .dashicons{color:inherit}#customize-theme-controls #accordion-section-sinatra_info>h3:focus:after,#customize-theme-controls #accordion-section-sinatra_info>h3:hover:after{color:#0073aa}#customize-theme-controls #accordion-section-sinatra_info>h3:after{z-index:2;display:block!important}#customize-theme-controls #accordion-section-sinatra_info .sinatra-info-tagline{position:relative;z-index:2;display:block;-ms-flex-preferred-size:100%;flex-basis:100%;overflow:hidden;font-weight:400;font-size:12px;line-height:1.6;margin-top:0;color:#656a6f}#customize-controls .customize-control-description{font-style:normal}#customize-controls .customize-control-description>p:first-child{margin-top:0}#customize-controls .customize-control-cropped_image .customize-control-description{margin-bottom:12px}#customize-controls .customize-control-title{position:relative;color:#23282d}#customize-controls .sinatra-select-wrapper select{margin:6px 0 0}.sinatra-control-wrapper .customize-control-title{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex:1;flex:1}.sinatra-control-wrapper .customize-control-description{margin-top:-2px;margin-bottom:6px}.sinatra-control-wrapper .buttonset{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-left:1px solid #d2d2d2}.sinatra-control-wrapper .buttonset label{display:block;-ms-flex:1;flex:1;-ms-flex-preferred-size:33.33%;flex-basis:33.33%;max-width:33.33%;padding:7px 12px;background-color:#fff;border-top:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2;border-right:1px solid #d2d2d2;text-align:center}.sinatra-control-wrapper .buttonset label:hover{color:#000}.sinatra-control-wrapper .buttonset input{display:none}.sinatra-control-wrapper .buttonset input:checked+label{background-color:#0085ba;color:#fff}.sinatra-control-wrapper .widget-inside .buttonset{margin-top:6px}.sinatra-control-wrapper .widget-inside .buttonset label{-ms-flex-preferred-size:initial;flex-basis:auto;max-width:none}.sinatra-control-wrapper .reset-defaults{text-decoration:none;color:rgba(0,0,0,.2);margin-right:10px}.sinatra-control-wrapper .reset-defaults:hover{color:red}.sinatra-control-wrapper .reset-defaults>.dashicons{font-size:14px;line-height:20px;width:14px}#sinatra-available-widgets{position:absolute;top:0;bottom:0;left:0;transform:translate3d(-100%,0,0);visibility:hidden;overflow-x:hidden;overflow-y:auto;width:300px;margin:0;z-index:4;background:#eee;transition:all .18s;border-right:1px solid #ddd}.sinatra-info-icon{margin-left:10px;margin-top:2px}.sinatra-info-icon svg{fill:none;stroke:#c7c7c7}.sinatra-info-icon:focus svg,.sinatra-info-icon:hover svg{fill:none;stroke:#555d66}.sinatra-info-icon:focus .sinatra-tooltip,.sinatra-info-icon:hover .sinatra-tooltip{display:block}.sinatra-tooltip{max-width:180px;font-weight:300;font-size:12px;line-height:1.5;padding:8px 14px;text-transform:none;letter-spacing:0}.sinatra-tooltip.top-right-tooltip{transform:translate(8px,-12px)}.sinatra-control-unit{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;margin-left:auto}.sinatra-control-unit input{display:none}.sinatra-control-unit input:checked+label{color:#000;text-decoration:underline}.sinatra-control-unit label{margin:0 3px;color:#999;text-transform:uppercase;font-size:9px}.sinatra-control-unit label:hover{color:#000}.select2-dropdown{z-index:500000!important;border-color:#7e8993}.select2-container--default .select2-selection--single{border-color:#7e8993!important}.select2-container--default .select2-selection--single:focus{outline:none!important}.select2-container--default.select2-container--focus .select2-selection--single{border-color:#0085ba!important}.select2-container--default .select2-results__group{color:#aaa;font-weight:400}.select2-container--default .select2-results__option{padding:5px 6px;margin:0}.select2-container--default .select2-results__option .select2-results__option{padding-left:1.5em}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#32373c;line-height:32px}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#eee}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#0085ba!important}.select2-container .select2-selection--single{min-height:32px;border-radius:2px}.select2-container--default .select2-selection--single .select2-selection__arrow{height:32px}.select2-search--dropdown{padding:0}.select2-search--dropdown .select2-search__field{border-left:none!important;border-right:none!important;border-top:none!important;border-radius:0;margin-left:0!important;padding:2px 8px;border-bottom-color:#7e8993}.select2-search--dropdown .select2-search__field:focus{box-shadow:none}.wp-pointer.sinatra-pointer{z-index:500000!important}#wp-pointer-4.sinatra-pointer.wp-pointer-top .wp-pointer-arrow{right:62px;left:auto}.spinner{display:none}.spinner.activated,.spinner.visible{display:inline-block;visibility:visible}.sinatra-responsive-switchers{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;margin:2px 0 0 auto}.sinatra-responsive-switchers.expanded li{display:initial}.sinatra-responsive-switchers .sinatra-tooltip.small-tooltip{bottom:100%;top:auto;margin-bottom:5px}.sinatra-responsive-switchers li{position:relative;margin:0;cursor:pointer;display:none}.sinatra-responsive-switchers li:first-child{display:initial}.sinatra-responsive-switchers li:hover .small-tooltip{display:block;text-transform:capitalize}.sinatra-responsive-switchers li .active .dashicons{background-color:#0073aa!important;color:#fff!important}.sinatra-responsive-switchers li:hover .dashicons{color:#23282d}.sinatra-responsive-switchers li .dashicons{width:20px;height:20px;font-size:12px;border-radius:50%;background-color:#fff;color:#808890;margin:0 3px;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:1px solid #e0e0e0}.sinatra-responsive-switchers .dashicons-mobile:before{content:"\f470"}.sinatra-control-wrapper .sinatra-control-wrap>div{display:none;-ms-flex-align:center;align-items:center;width:100%}.sinatra-control-wrapper .sinatra-control-wrap>div.active{-js-display:flex;display:-ms-flexbox;display:flex}.si-btn.btn-uppercase{text-transform:uppercase;letter-spacing:.1em}#infinite-handle span.disabled,#infinite-handle span:disabled,.si-btn.disabled,.si-btn:disabled,.site-main .woocommerce #respond input#submit.disabled,.site-main .woocommerce #respond input#submit:disabled,.site-main .woocommerce a.button.disabled,.site-main .woocommerce a.button:disabled,.site-main .woocommerce button.button.disabled,.site-main .woocommerce button.button:disabled,.site-main .woocommerce input.button.disabled,.site-main .woocommerce input.button:disabled,.woocommerce #review_form #respond .form-submit input.disabled,.woocommerce #review_form #respond .form-submit input:disabled,.woocommerce div.product form.cart .button.disabled,.woocommerce div.product form.cart .button:disabled,.woocommerce ul.products li.product .added_to_cart.disabled,.woocommerce ul.products li.product .added_to_cart:disabled,.woocommerce ul.products li.product .button.disabled,.woocommerce ul.products li.product .button:disabled,body:not(.wp-customizer) input.disabled[type=submit],body:not(.wp-customizer) input[type=submit]:disabled{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#infinite-handle span,.si-btn,.site-main .woocommerce #respond input#submit,.site-main .woocommerce a.button,.site-main .woocommerce button.button,.site-main .woocommerce input.button,.woocommerce #review_form #respond .form-submit input,.woocommerce div.product form.cart .button,.woocommerce ul.products li.product .added_to_cart,.woocommerce ul.products li.product .button,body:not(.wp-customizer) input[type=submit]{text-decoration:none;transition:all .26s cubic-bezier(.25,.8,.25,1);outline:none;border:none;margin:0;padding:0;text-shadow:none}.sinatra-popup-options,.sinatra-popup-options .popup-link{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sinatra-popup-options{-ms-flex-wrap:wrap;flex-wrap:wrap;position:relative}.sinatra-popup-options .popup-link{background-color:#fff;border-radius:3px;margin-left:auto;font-size:12px;width:40px;height:33px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:1px solid #e0e0e0;transition:all .15s ease;text-decoration:none;color:#555d66}.sinatra-popup-options .popup-link .dashicons{transition:none;color:inherit}.sinatra-popup-options .popup-link.active,.sinatra-popup-options .popup-link:focus,.sinatra-popup-options .popup-link:hover{background-color:#0284ba;color:#fff}.sinatra-popup-options .popup-link.active>.dashicons-edit:before{content:"\f335"}.sinatra-popup-options .popup-link.hidden{display:none}.sinatra-popup-options .popup-content{background-color:#fff;padding:14px 20px;position:absolute;width:100%;top:100%;left:0;margin:10px 0 30px;box-sizing:border-box;border:1px solid #ddd;border-radius:3px;box-shadow:0 0 50px rgba(0,0,0,.22);z-index:1}.sinatra-popup-options .popup-content:after{content:"";position:absolute;top:-6px;right:15px;background-color:#fff;width:10px;height:10px;transform:rotate(45deg);border-top:1px solid #ddd;border-left:1px solid #ddd}.sinatra-popup-options .popup-element{margin:12px 0;position:relative}.sinatra-popup-options .popup-element.style-1>label,.sinatra-popup-options .popup-element.style-2>label{-ms-flex-negative:0;flex-shrink:0;font-size:12px;line-height:1;margin-right:5px}.sinatra-popup-options .popup-element.style-1{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sinatra-popup-options .popup-element.style-1>.popup-input-wrapper{margin-left:auto;width:55%;-ms-flex-negative:1;flex-shrink:1}.sinatra-popup-options .popup-element.style-1 input,.sinatra-popup-options .popup-element.style-1 select{margin:0!important}.sinatra-popup-options .popup-element.color-element{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}.sinatra-popup-options .popup-element.color-element>label{min-height:22px;line-height:22px}.sinatra-popup-options .popup-element.color-element .wp-color-result.button{position:absolute;top:0;right:0;height:23px;min-height:23px;width:50px;padding:0}.sinatra-popup-options .popup-element.color-element .wp-color-result.button:before{width:48px}.sinatra-popup-options .popup-element.color-element .wp-color-result.button .wp-color-result-text{display:none}.sinatra-popup-options .popup-element.color-element .wp-picker-container.wp-picker-active{-ms-flex-item-align:end;align-self:flex-end}.sinatra-popup-options .popup-element.color-element .wp-picker-open+.wp-picker-input-wrap label input{padding:8px 12px!important;border-radius:3px 0 0 0!important}.customize-partial-edit-shortcut button,.widget .customize-partial-edit-shortcut button{background:#0085ba!important}.sinatra-pointer-buttons{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}.sinatra-pointer-buttons .button-primary{margin-left:auto}.sinatra-pointer-buttons a.close{margin-left:15px}.sinatra-pointer.arrow-top .wp-pointer-arrow{top:0;margin-top:12px;border-right-color:#0173a1}.sinatra-pointer.arrow-top .wp-pointer-arrow .wp-pointer-arrow-inner{border-right-color:#0185ba}.sinatra-pointer .wp-pointer-content{padding:0 0 16px;border-radius:4px;box-shadow:0 3px 8px rgba(0,0,0,.1);border:1px solid #ddd}.sinatra-pointer .wp-pointer-content h3{background:#0085ba;font-size:16px;padding:13px 16px;line-height:24px;font-weight:400;color:#fafbfc;margin:0;border-radius:3px 3px 0 0;border:1px solid #0073a1;border-bottom:none;margin:-1px;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sinatra-pointer .wp-pointer-content h3:before{display:none}.sinatra-pointer .wp-pointer-content h3 img{margin:0 auto;height:23px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.sinatra-pointer .wp-pointer-content p{padding:0;margin:16px 16px 32px;font-size:14px;line-height:22px;color:#5c5c5c}.sinatra-pointer .wp-pointer-content a{text-decoration:none;color:#0085ba}.sinatra-pointer .wp-pointer-content a:hover{color:#00b1f7}.sinatra-pointer .wp-pointer-content .button{font-weight:300;box-shadow:none;text-shadow:none;border:none;height:32px;padding:0 25px;border-radius:3px;line-height:32px;font-size:13px}.sinatra-pointer .wp-pointer-content .button-primary{box-shadow:none;text-shadow:none;border:none;background-color:#0085ba;color:#fff!important}.sinatra-pointer .wp-pointer-content .button-primary:hover{background-color:#0097d4}.sinatra-pointer .wp-pointer-content a.close{margin-left:0;padding-left:0}.sinatra-pointer .wp-pointer-content a.close:before{display:none!important}.sinatra-pointer .wp-pointer-content .wp-pointer-buttons{padding:0 16px}.sinatra-pointer .wp-pointer-content .wp-pointer-buttons a{color:#0085ba}.sinatra-pointer .wp-pointer-content .wp-pointer-buttons a:hover{color:#00b1f7}.sinatra-pointer .wp-pointer-content .wp-pointer-buttons a.close{margin-right:auto}.sinatra-pointer .wp-pointer-content .wp-pointer-buttons a.button-primary{margin-left:8px}.sinatra-pointer .wp-pointer-content .wp-pointer-buttons a.button-secondary{border:1px solid #0085ba;border-radius:3px;background:none}.sinatra-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#00a9ed!important}.sinatra-pointer.wp-pointer-top .wp-pointer-arrow .wp-pointer-arrow-inner{border-bottom-color:#0085ba!important}#infinite-handle span,.si-btn,.site-main .woocommerce #respond input#submit,.site-main .woocommerce a.button,.site-main .woocommerce button.button,.site-main .woocommerce input.button,.woocommerce #review_form #respond .form-submit input,.woocommerce div.product form.cart .button,.woocommerce ul.products li.product .added_to_cart,.woocommerce ul.products li.product .button,body:not(.wp-customizer) input[type=submit]{-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-align:center;max-width:100%;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;box-shadow:none;border-style:solid;-ms-flex-negative:0;flex-shrink:0;font-size:inherit;min-height:45px;padding:.5em 2em}#infinite-handle span span,.si-btn span,.site-main .woocommerce #respond input#submit span,.site-main .woocommerce a.button span,.site-main .woocommerce button.button span,.site-main .woocommerce input.button span,.woocommerce #review_form #respond .form-submit input span,.woocommerce div.product form.cart .button span,.woocommerce ul.products li.product .added_to_cart span,.woocommerce ul.products li.product .button span,body:not(.wp-customizer) input[type=submit] span{z-index:2;position:relative}#infinite-handle span.disabled,#infinite-handle span:disabled,.si-btn.disabled,.si-btn:disabled,.site-main .woocommerce #respond input#submit.disabled,.site-main .woocommerce #respond input#submit:disabled,.site-main .woocommerce a.button.disabled,.site-main .woocommerce a.button:disabled,.site-main .woocommerce button.button.disabled,.site-main .woocommerce button.button:disabled,.site-main .woocommerce input.button.disabled,.site-main .woocommerce input.button:disabled,.woocommerce #review_form #respond .form-submit input.disabled,.woocommerce #review_form #respond .form-submit input:disabled,.woocommerce div.product form.cart .button.disabled,.woocommerce div.product form.cart .button:disabled,.woocommerce ul.products li.product .added_to_cart.disabled,.woocommerce ul.products li.product .added_to_cart:disabled,.woocommerce ul.products li.product .button.disabled,.woocommerce ul.products li.product .button:disabled,body:not(.wp-customizer) input[type=submit].disabled,body:not(.wp-customizer) input[type=submit]:disabled{cursor:not-allowed!important}#infinite-handle span.disabled>i,#infinite-handle span.disabled>span,#infinite-handle span:disabled>i,#infinite-handle span:disabled>span,.si-btn.disabled>i,.si-btn.disabled>span,.si-btn:disabled>i,.si-btn:disabled>span,.site-main .woocommerce #respond input#submit.disabled>i,.site-main .woocommerce #respond input#submit.disabled>span,.site-main .woocommerce #respond input#submit:disabled>i,.site-main .woocommerce #respond input#submit:disabled>span,.site-main .woocommerce a.button.disabled>i,.site-main .woocommerce a.button.disabled>span,.site-main .woocommerce a.button:disabled>i,.site-main .woocommerce a.button:disabled>span,.site-main .woocommerce button.button.disabled>i,.site-main .woocommerce button.button.disabled>span,.site-main .woocommerce button.button:disabled>i,.site-main .woocommerce button.button:disabled>span,.site-main .woocommerce input.button.disabled>i,.site-main .woocommerce input.button.disabled>span,.site-main .woocommerce input.button:disabled>i,.site-main .woocommerce input.button:disabled>span,.woocommerce #review_form #respond .form-submit input.disabled>i,.woocommerce #review_form #respond .form-submit input.disabled>span,.woocommerce #review_form #respond .form-submit input:disabled>i,.woocommerce #review_form #respond .form-submit input:disabled>span,.woocommerce div.product form.cart .button.disabled>i,.woocommerce div.product form.cart .button.disabled>span,.woocommerce div.product form.cart .button:disabled>i,.woocommerce div.product form.cart .button:disabled>span,.woocommerce ul.products li.product .added_to_cart.disabled>i,.woocommerce ul.products li.product .added_to_cart.disabled>span,.woocommerce ul.products li.product .added_to_cart:disabled>i,.woocommerce ul.products li.product .added_to_cart:disabled>span,.woocommerce ul.products li.product .button.disabled>i,.woocommerce ul.products li.product .button.disabled>span,.woocommerce ul.products li.product .button:disabled>i,.woocommerce ul.products li.product .button:disabled>span,body:not(.wp-customizer) input[type=submit].disabled>i,body:not(.wp-customizer) input[type=submit].disabled>span,body:not(.wp-customizer) input[type=submit]:disabled>i,body:not(.wp-customizer) input[type=submit]:disabled>span,button.si-btn:disabled{opacity:.5}#secondary .woocommerce a.button,#secondary .woocommerce button.button,#secondary .woocommerce input.button,.btn-small,.site-main .woocommerce #respond input#submit,.site-main .woocommerce .shipping-calculator-form .button,.site-main .woocommerce .woocommerce-orders-table a.button,.site-main .woocommerce .woocommerce-Pagination a.button,.site-main .woocommerce .woocommerce-table a.button,.woocommerce #secondary .widget_price_filter .price_slider_amount .button,.woocommerce ul.products li.product .added_to_cart,.woocommerce ul.products li.product .button{font-size:90%!important;min-height:40px;padding:.5em 1.5em}#place_order,.btn-large{min-height:57px;font-size:108%!important}.btn-xlarge{font-size:130%!important;min-height:69px;font-weight:600}.btn-fw{width:100%;text-align:center}.btn-large-radius{border-radius:50px}.btn-left-icon,.btn-right-icon{position:relative}.btn-left-icon>i,.btn-right-icon>i{position:relative;font-size:110%}.btn-left-icon.btn-reveal>i,.btn-right-icon.btn-reveal>i{transition:transform .26s cubic-bezier(.25,.8,.25,1),opacity .1s ease;opacity:0;position:absolute;top:50%;margin-top:.1em;transform:translate3d(0,-50%,0)}.btn-left-icon.btn-reveal>span,.btn-right-icon.btn-reveal>span{transition:padding .26s cubic-bezier(.25,.8,.25,1),margin .26s cubic-bezier(.25,.8,.25,1);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;will-change:padding,margin}.btn-left-icon.btn-svg>svg,.btn-right-icon.btn-svg>svg{height:1em!important;width:auto!important;vertical-align:middle;fill:currentColor}.btn-left-icon>i{-ms-flex-order:1;order:1;margin-right:.65em;margin-left:-.65em}.btn-left-icon>span{-ms-flex-order:2;order:2}.btn-left-icon.btn-reveal>i{left:.8em;transform:translate3d(10px,-50%,0);margin-left:0;margin-right:0}.btn-left-icon.btn-reveal:hover>span{padding-left:1em;margin-right:-1em}.btn-left-icon.btn-reveal:hover>i{opacity:1;transform:translate3d(0,-50%,0)}.btn-right-icon>i{-ms-flex-order:2;order:2;margin-left:.65em;margin-right:-.65em}.btn-right-icon.btn-reveal>i{right:.8em;transform:translate3d(-10px,-50%,0);margin-left:0;margin-right:0}.btn-right-icon.btn-reveal:hover>span{padding-right:1em;margin-left:-1em}.btn-right-icon.btn-reveal:hover>i{opacity:1;transform:translate3d(0,-50%,0)}.si-btn.btn-outline,.si-btn.btn-secondary.btn-outline{background-color:transparent}.si-btn.btn-with-shadow{box-shadow:0 0 0 transparent}.si-btn.btn-with-shadow:hover{box-shadow:0 5px 25px rgba(0,0,0,.175);transform:translateY(-2px)}.si-btn.btn-text-1{padding:0!important;min-height:0;height:auto;background:none!important;box-shadow:none!important;border:none!important;font-weight:500}.si-btn.btn-text-1 span{padding:3px 0}.si-btn.btn-text-1 span:after,.si-btn.btn-text-1 span:before{content:"";position:absolute;bottom:-1px;left:0;width:100%;height:2px;border-radius:6px}.si-btn.btn-text-1 span:after{background:currentColor;opacity:.2}.si-btn.btn-text-1 span:before{background:currentColor;transform-origin:right center;transform:scaleX(0);transition:transform .26s cubic-bezier(.25,.8,.25,1);-webkit-backface-visibility:hidden;will-change:scale;z-index:1}.si-btn.btn-text-1:hover>span:before{transform-origin:left center;transform:scale(1)}.si-btn.btn-text-1.btn-left-icon>span,.si-btn.btn-text-1.btn-right-icon>span{padding-left:0!important;padding-right:0!important}.si-btn.btn-text-1.btn-left-icon>i,.si-btn.btn-text-1.btn-right-icon>i{position:static}customizer/assets/images/copyright-layout-1.svg000064400000000544151231536700015727 0ustar00footer-layout-1_2customizer/assets/images/copyright-layout-2.svg000064400000000556151231536700015733 0ustar00copyright-layout-2customizer/assets/images/footer-layout-1.svg000064400000004105151231536700015212 0ustar00customizer/assets/images/footer-layout-2.svg000064400000003740151231536700015217 0ustar00customizer/assets/images/footer-layout-3.svg000064400000003476151231536700015226 0ustar00 customizer/assets/images/footer-layout-4.svg000064400000003456151231536700015225 0ustar00customizer/assets/images/header-layout-1.svg000064400000001141151231536700015141 0ustar00header-layout-1customizer/assets/images/header-layout-2.svg000064400000001152151231536700015144 0ustar00header-layout-2customizer/assets/images/header-layout-3.svg000064400000001154151231536700015147 0ustar00header-layout-3customizer/assets/images/transparency-grid.png000064400000005126151231536700015670 0ustar00‰PNG  IHDRéùÚ_tEXtSoftwareAdobe ImageReadyqÉe<"iTXtXML:com.adobe.xmp wPÚHÊIDATxÚ¬\‹QìH T».Ò ›—dC$ã>ÞÕÂyÍHÝ’½U°¶ç£Ñ§Õ£1ÞÞÞâñûø÷¯ß///<Ü÷}mÿ?ûáþýóó3÷ÿ½Ÿþç¢ýs?ÇïÎíÿº~Ó~j?µ}~ž_íïÝãxúîÑþ^Œçéþ¯ö÷düû깯öÏmïÕüÍñ壯³Ÿä³¯äk!ÿlLÇö3™ÿO¢?{¢SÇõµ~NíWº}n¿º7íÇùÚöø‘Ptòý÷sÑ.NÏU}ž?4ï[]‡ÙWv‹ëHœÛùysÇB¦Yß(¾gÒ7’q`1Æj¾Ù8hêQ5/k‚äÞXÆ}Ÿã\a¬³’™Ôá××Wn ¥A±pX ¦¡a¡0Ê(\cT‹®‡ ¡ºŽ…É¢"™; %¦1Ãd âŠd}™È›‰ÞAô™Í“ £`C®Õ}û³5;\MЦ'¡áqaz׎ 1ô–ÑPÐJÙ”adб,¢nˆ¶óÃÂסƒ~¸0怆WmÁtN,ôŒÉÜ]g&ñf ±Y°0JÇeó9õ ã‡X šÆÍ¢w‘Cƒ†ÌæÃù\u“y¡ïõ:ÓSÞäüžþßÌp²HòX˜Q‘ƒ…qrG5¿nß]ÙdŽÃÍÅÜþT.—qY^L#Cs½:|Ì9*§íòU¾©¸§_…jþ»ÿãã›Û2oî(ÿJNr¡3¼ÁpA\È8Aù€¨Yö+QŠ…CsS‰zrÆC‘3²á ;å•H’gýfŽ…dŽÄ‘›¿(aÐw²nìsIdCAv zc£aüϱÀ”¯Ê>¢¡a:†BÈØuÖgçè‡KÃþ´{Œ¤.ó©` ¡üÁÁDS8ˆ¦R±ÉV  3ÍÈälLHò9‡dáœ&éKWîq£1^Ezn‹$%dI æN 2NGq§0õ*4töwÝ\šC‡Ó´0˜ÃNnî䟎ÌUD†ˆèS§Î‹˜j/ƒ­Ó½LehÕ>#ßr€©dN!‰Kíà +*a€0PMXŸ PkØMKØÔŸ+A,Œ5M‰#4‡á„ï€4ˆ‚!acÀò¹D‹Ü*ŒÂ%›`Ȧ’¡Ù> ÒÇéÃ%ºÆz•Ù‡a#j\?ãø wÿyÔ º{`ñ¨•"÷|zæP‹xܾÝ©})¼¯öÆíçš1þ§gµšjóñ³Ñ>OòQŠ€G-ëJÑ÷¤ýU!Iòqòh5‹ìæÛÜݶSfÂÄ»¬#ãÌ¡´¶Ø6Ó ºQmÞÆ Æä.X4Ú-´À@!ýbt§2ªã(õ6†›“V嘎AKâDèÝ•ƒ€à8 e_¦O[Ò@„ÞlvãAM F>ê´É¦±º9ͤÌqêXö“¦ƒ­NÊDs½+Wû™4Ú¤ ¶:…ãtÔÕ•ߟ?¸‹>-ÆæEâlÕT åjÒIêWŠ5ÝV™xØŽRTP…§a Y­ªc (e•nTãÊñÇIú¥ª«²“b4lá×üÞßßÓœT_QLÞÐFžÖaݱd%.,IEND®B`‚customizer/assets/images/transparency.svg000064400000000745151231536700014762 0ustar00transparencycustomizer/assets/images/wpbh.svg000064400000013637151231536700013215 0ustar00wpbhcustomizer/assets/js/customize-controls.min.js000064400000007342151231536700015702 0ustar00!function(api,$){api.sectionConstructor["sinatra-info"]=api.Section.extend({attachEvents:function(){},isContextuallyActive:function(){return!0}}),api.sinatraCustomizerPreviewer={init:function(){var control;this.preview.bind("set-footer-widget",(function(data){(control=api.control("sidebars_widgets["+data+"]")).focus(),api.Widgets.availableWidgetsPanel.open(control)})),this.preview.bind("set-navigation-widget",(function(data){(control=api.control("nav_menu_locations["+data+"]")).focus()}))}};var sinatraOldPreviewer=api.Previewer;api.Previewer=sinatraOldPreviewer.extend({initialize:function(params,options){api.sinatraCustomizerPreviewer.preview=this,sinatraOldPreviewer.prototype.initialize.call(this,params,options)}}),_.each(sinatra_customizer_localized.preview_url_for_section,(function(url,id){url&&wp.customize.section(id,(function(section){section.expanded.bind((function(isExpanded){isExpanded&&wp.customize.previewer.previewUrl.set(url)}))}))})),$(document).ready((function($){var $tooltip,$icon_pos_l,$title_width;(api.sinatraCustomizerPreviewer.init(),$(".sinatra-control-responsive").each((function(){$(this).find(".control-responsive").first().addClass("active")})),$(".customize-control").on("click",".sinatra-responsive-switchers span",(function(event){var $this=$(this),$switcher_container=$this.closest(".sinatra-responsive-switchers"),$switcher_buttons=$switcher_container.find("li span"),$device=$(event.currentTarget).data("device"),$control=$(".sinatra-control-responsive"),$body=$(".wp-full-overlay"),$footer_devices=$(".wp-full-overlay-footer .devices");$switcher_container.hasClass("expanded")?$this.parent().is(":first-child")&&$this.hasClass("active")?($switcher_container.removeClass("expanded"),$this.removeClass("active")):($switcher_buttons.removeClass("active"),$this.addClass("active")):($switcher_container.addClass("expanded"),$this.addClass("active")),$control.find(".control-responsive").removeClass("active"),$control.find(".control-responsive."+$device).addClass("active"),$control.removeClass("control-device-desktop control-device-tablet control-device-mobile").addClass("control-device-"+$device),$body.removeClass("preview-desktop preview-tablet preview-mobile").addClass("preview-"+$device),$footer_devices.find("button").removeClass("active").attr("aria-pressed",!1),$footer_devices.find("button.preview-"+$device).addClass("active").attr("aria-pressed",!0)})),$(".wp-full-overlay-footer .devices button").on("click",(function(event){$(this);var $devices=$(".customize-control .sinatra-responsive-switchers"),$device=$(event.currentTarget).data("device"),$control=$(".sinatra-control-responsive");$devices.find("span").removeClass("active"),$devices.find("span.preview-"+$device).addClass("active"),"desktop"===$device?$devices.removeClass("expanded"):$devices.addClass("expanded"),$control.find(".control-responsive").removeClass("active"),$control.find(".control-responsive."+$device).addClass("active"),$control.removeClass("control-device-desktop control-device-tablet control-device-mobile").addClass("control-device-"+$device)})),$(".sinatra-tooltip").length)&&$(".sinatra-tooltip").each((function(){($tooltip=$(this)).hasClass("top-right-tooltip")||$tooltip.hasClass("small-tooltip")||($title_width=$tooltip.closest(".sinatra-control-wrapper").outerWidth(),($icon_pos_l=$tooltip.closest(".sinatra-info-icon").css("position","static").position().left)<$title_width-$icon_pos_l?($tooltip[0].style.setProperty("--tooltip-left",Math.min(104,$icon_pos_l)+"px"),$tooltip.css("left",Math.max(0,$icon_pos_l-104))):($tooltip.css("left",Math.min($icon_pos_l-90,$title_width-208)),$icon_pos_l<$title_width-104?$tooltip[0].style.setProperty("--tooltip-left","90px"):$tooltip[0].style.setProperty("--tooltip-left",$icon_pos_l-178+"px")))}))}))}(wp.customize,jQuery);;customizer/assets/js/customize-dependency.min.js000064400000005555151231536700016161 0ustar00!function($){"use strict";var sinatraDependencies={listenTo:{},init:function(){var self=this;wp.customize.control.each((function(control){self.showSinatraControl(control)})),_.each(self.listenTo,(function(slaves,master){_.each(slaves,(function(slave){wp.customize(master,(function(setting){wp.customize.control(slave,(function(control){var setActiveState,isDisplayed;isDisplayed=function(){return self.showSinatraControl(wp.customize.control(slave))},(setActiveState=function(){control.active.set(isDisplayed())})(),setting.bind(setActiveState),control.active.validate=isDisplayed}))}))}))}))},showSinatraControl:function(control){var i,show=!0;if(_.isString(control)&&(control=wp.customize.control(control)),void 0===control||control.params&&_.isEmpty(control.params.required))return!0;for(i=0;i="===operator||"greater or equal"===operator||"equal or greater"===operator)return value2>=value1;if("<="===operator||"smaller or equal"===operator||"equal or smaller"===operator)return value2<=value1;if(">"===operator||"greater"===operator)return value2>value1;if("<"===operator||"smaller"===operator)return value2'),$style_tag=$("head").find("#sinatra-dynamic-"+id)),sinatra_style_tag_collection[id]=$style_tag,$style_tag)}function sinatra_print_visibility_classes($element,newval){$element.length&&($element.removeClass("sinatra-hide-mobile sinatra-hide-tablet sinatra-hide-mobile-tablet"),"all"!==newval&&$element.addClass("sinatra-"+newval))}function sinatra_hex2rgba(hex,opacity){if("rgba"===hex.substring(0,4))return hex;hex=hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(m,r,g,b){return r+r+g+g+b+b}));var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return opacity&&(opacity>1&&(opacity=1),opacity=","+opacity),!!result&&"rgba("+parseInt(result[1],16)+","+parseInt(result[2],16)+","+parseInt(result[3],16)+opacity+")"}function sinatra_luminance(hex,percent){hex.includes("rgb")&&(hex=function(c){var a,x;a=(a=c.split("(")[1].split(")")[0].trim()).split(",");for(var result="",i=0;i<3;i++)x=parseInt(a[i]).toString(16),result+=1===x.length?"0"+x:x;if(result)return"#"+result;return!1}(hex));hex=hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(m,r,g,b){return r+r+g+g+b+b}));var from,to,result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);if(!/^#[0-9A-F]{6}$/i.test(hex))return hex;for(var i=1;i<=3;i++)result[i]=parseInt(result[i],16),from=percent<0?0:result[i],to=percent<0?result[i]:255,result[i]=result[i]+Math.ceil((to-from)*percent);return result="#"+sinatra_dec2hex(result[1])+sinatra_dec2hex(result[2])+sinatra_dec2hex(result[3])}function sinatra_dec2hex(c){var hex=c.toString(16);return 1==hex.length?"0"+hex:hex}function sinatra_spacing_field_css(selector,property,setting,responsive){if(Array.isArray(setting)||"object"==typeof setting){var unit="px",css="";"unit"in setting&&(unit=setting.unit);var before="",after="";return Object.keys(setting).forEach((function(index,el){"unit"!==index&&(responsive?("tablet"===index?(before="@media only screen and (max-width: 768px) {",after="}"):"mobile"===index?(before="@media only screen and (max-width: 480px) {",after="}"):(before="",after=""),css+=before+selector+"{",Object.keys(setting[index]).forEach((function(position){"border"===property&&(position+="-width"),setting[index][position]&&(css+=property+"-"+position+": "+setting[index][position]+unit+";")})),css+="}"+after):("border"===property&&(index+="-width"),css+=property+"-"+index+": "+setting[index]+unit+";"))})),responsive||(css=selector+"{"+css+"}"),css}}function sinatra_range_field_css(selector,property,setting,responsive,unit){var css="",before="",after="";return responsive&&(Array.isArray(setting)||"object"==typeof setting)&&Object.keys(setting).forEach((function(index,el){if(setting[index]){if("tablet"===index)before="@media only screen and (max-width: 768px) {",after="}";else if("mobile"===index)before="@media only screen and (max-width: 480px) {",after="}";else{if("desktop"!==index)return;before="",after=""}css+=before+selector+"{"+property+": "+setting[index]+unit+"; }"+after}})),responsive||(setting=setting.value?setting.value:0,css=selector+"{"+property+": "+setting+unit+"; }"),css}function sinatra_typography_field_css(selector,setting){var css="";return css+=selector+"{","default"===setting["font-family"]?css+="font-family: "+sinatra_customizer_preview.default_system_font+";":setting["font-family"]in sinatra_customizer_preview.fonts.standard_fonts.fonts?css+="font-family: "+sinatra_customizer_preview.fonts.standard_fonts.fonts[setting["font-family"]].fallback+";":"inherit"!==setting["font-family"]&&(css+='font-family: "'+setting["font-family"]+'";'),css+="font-weight:"+setting["font-weight"]+";",css+="font-style:"+setting["font-style"]+";",css+="text-transform:"+setting["text-transform"]+";","text-decoration"in setting&&(css+="text-decoration:"+setting["text-decoration"]+";"),"letter-spacing"in setting&&(css+="letter-spacing:"+setting["letter-spacing"]+setting["letter-spacing-unit"]+";"),"line-height-desktop"in setting&&(css+="line-height:"+setting["line-height-desktop"]+";"),"font-size-desktop"in setting&&"font-size-unit"in setting&&(css+="font-size:"+setting["font-size-desktop"]+setting["font-size-unit"]+";"),css+="}","font-size-tablet"in setting&&setting["font-size-tablet"]&&(css+="@media only screen and (max-width: 768px) {"+selector+"{font-size: "+setting["font-size-tablet"]+setting["font-size-unit"]+";}}"),"line-height-tablet"in setting&&setting["line-height-tablet"]&&(css+="@media only screen and (max-width: 768px) {"+selector+"{line-height:"+setting["line-height-tablet"]+";}}"),"font-size-mobile"in setting&&setting["font-size-mobile"]&&(css+="@media only screen and (max-width: 480px) {"+selector+"{font-size: "+setting["font-size-mobile"]+setting["font-size-unit"]+";}}"),"line-height-mobile"in setting&&setting["line-height-mobile"]&&(css+="@media only screen and (max-width: 480px) {"+selector+"{line-height:"+setting["line-height-mobile"]+";}}"),css}function sinatra_enqueue_google_font(font){if(sinatra_customizer_preview.fonts.google_fonts.fonts[font])(function(id,url){sinatra_link_tag_collection[id]?sinatra_link_tag_collection[id]:(($link_tag=$("head").find("#sinatra-dynamic-link-"+id)).length?$link_tag.attr("href",url):($("head").append(''),$link_tag=$("head").find("#sinatra-dynamic-link-"+id)),sinatra_link_tag_collection[id]=$link_tag)})("google-font-"+font.trim().toLowerCase().replace(" ","-"),sinatra_customizer_preview.google_fonts_url+"/css?family="+font+":"+sinatra_customizer_preview.google_font_weights)}function sinatra_design_options_css(selector,setting,type){var css="";if("background"===type){var bg_type=setting["background-type"];css+=selector+"{","color"===bg_type?(setting["background-color"]=setting["background-color"]?setting["background-color"]:"inherit",css+="background: "+setting["background-color"]+";"):"gradient"===bg_type?(css+="background: "+setting["gradient-color-1"]+";","linear"===setting["gradient-type"]?css+="background: -webkit-linear-gradient("+setting["gradient-linear-angle"]+"deg, "+setting["gradient-color-1"]+" "+setting["gradient-color-1-location"]+"%, "+setting["gradient-color-2"]+" "+setting["gradient-color-2-location"]+"%);background: -o-linear-gradient("+setting["gradient-linear-angle"]+"deg, "+setting["gradient-color-1"]+" "+setting["gradient-color-1-location"]+"%, "+setting["gradient-color-2"]+" "+setting["gradient-color-2-location"]+"%);background: linear-gradient("+setting["gradient-linear-angle"]+"deg, "+setting["gradient-color-1"]+" "+setting["gradient-color-1-location"]+"%, "+setting["gradient-color-2"]+" "+setting["gradient-color-2-location"]+"%);":"radial"===setting["gradient-type"]&&(css+="background: -webkit-radial-gradient("+setting["gradient-position"]+", circle, "+setting["gradient-color-1"]+" "+setting["gradient-color-1-location"]+"%, "+setting["gradient-color-2"]+" "+setting["gradient-color-2-location"]+"%);background: -o-radial-gradient("+setting["gradient-position"]+", circle, "+setting["gradient-color-1"]+" "+setting["gradient-color-1-location"]+"%, "+setting["gradient-color-2"]+" "+setting["gradient-color-2-location"]+"%);background: radial-gradient(circle at "+setting["gradient-position"]+", "+setting["gradient-color-1"]+" "+setting["gradient-color-1-location"]+"%, "+setting["gradient-color-2"]+" "+setting["gradient-color-2-location"]+"%);")):"image"===bg_type&&(css+="background-image: url("+setting["background-image"]+");background-size: "+setting["background-size"]+";background-attachment: "+setting["background-attachment"]+";background-position: "+setting["background-position-x"]+"% "+setting["background-position-y"]+"%;background-repeat: "+setting["background-repeat"]+";"),css+="}","image"===bg_type&&setting["background-color-overlay"]&&setting["background-image"]?css+=selector+"::after { background-color: "+setting["background-color-overlay"]+"; }":css+=selector+"::after { background-color: initial; }"}else"color"===type?(setting["text-color"]=setting["text-color"]?setting["text-color"]:"inherit",setting["link-color"]=setting["link-color"]?setting["link-color"]:"inherit",setting["link-hover-color"]=setting["link-hover-color"]?setting["link-hover-color"]:"inherit",css+=selector+" { color: "+setting["text-color"]+"; }",css+=selector+" a { color: "+setting["link-color"]+"; }",css+=selector+" a:hover { color: "+setting["link-hover-color"]+" !important; }"):"border"===type?(setting["border-color"]=setting["border-color"]?setting["border-color"]:"inherit",setting["border-style"]=setting["border-style"]?setting["border-style"]:"solid",setting["border-left-width"]=setting["border-left-width"]?setting["border-left-width"]:0,setting["border-top-width"]=setting["border-top-width"]?setting["border-top-width"]:0,setting["border-right-width"]=setting["border-right-width"]?setting["border-right-width"]:0,setting["border-bottom-width"]=setting["border-bottom-width"]?setting["border-bottom-width"]:0,css+=selector+"{",css+="border-color: "+setting["border-color"]+";",css+="border-style: "+setting["border-style"]+";",css+="border-left-width: "+setting["border-left-width"]+"px;",css+="border-top-width: "+setting["border-top-width"]+"px;",css+="border-right-width: "+setting["border-right-width"]+"px;",css+="border-bottom-width: "+setting["border-bottom-width"]+"px;",css+="}"):"separator_color"===type&&(css+=selector+":after{ background-color: "+setting["separator-color"]+"; }");return css}api("sinatra_logo_max_height",(function(value){value.bind((function(newval){if($(".sinatra-logo").length){$style_tag=sinatra_get_style_tag("sinatra_logo_max_height");var style_css="";style_css+=sinatra_range_field_css(".sinatra-logo img","max-height",newval,!0,"px"),style_css+=sinatra_range_field_css(".sinatra-logo img.si-svg-logo","height",newval,!0,"px"),$style_tag.html(style_css)}}))})),api("sinatra_logo_text_font_size",(function(value){value.bind((function(newval){if($("#sinatra-header .sinatra-logo .site-title").length){$style_tag=sinatra_get_style_tag("sinatra_logo_text_font_size");var style_css="";style_css+=sinatra_range_field_css("#sinatra-header .sinatra-logo .site-title","font-size",newval,!0,newval.unit),$style_tag.html(style_css)}}))})),api("sinatra_logo_margin",(function(value){value.bind((function(newval){if($(".sinatra-logo").length){$style_tag=sinatra_get_style_tag("sinatra_logo_margin");var style_css=sinatra_spacing_field_css(".sinatra-logo .logo-inner","margin",newval,!0);$style_tag.html(style_css)}}))})),api("blogdescription",(function(value){value.bind((function(newval){$(".sinatra-logo").find(".site-description").length&&$(".sinatra-logo").find(".site-description").html(newval)}))})),api("blogname",(function(value){value.bind((function(newval){$(".sinatra-logo").find(".site-title").length&&$(".sinatra-logo").find(".site-title").find("a").html(newval)}))})),api("sinatra_site_layout",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)sinatra-layout__\S+/g)||[]).join(" ")})),$body.addClass("sinatra-layout__"+newval)}))})),api("sinatra_sidebar_sticky",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)si-sticky-\S+/g)||[]).join(" ")})),newval&&$body.addClass("si-sticky-"+newval)}))})),api("sinatra_sidebar_width",(function(value){value.bind((function(newval){if($("#secondary").length){$style_tag=sinatra_get_style_tag("sinatra_sidebar_width");var style_css="#secondary { width: "+newval.value+"%; }";style_css+="body:not(.sinatra-no-sidebar) #primary { max-width: "+(100-parseInt(newval.value))+"%;};",$style_tag.html(style_css)}}))})),api("sinatra_sidebar_style",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)sinatra-sidebar-style-\S+/g)||[]).join(" ")})),$body.addClass("sinatra-sidebar-style-"+newval)}))})),api("sinatra_sidebar_responsive_position",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)si-sidebar-r__\S+/g)||[]).join(" ")})),newval&&$body.addClass("si-sidebar-r__"+newval)}))})),api("sinatra_blog_image_position",(function(value){value.bind((function(newval){$(".si-blog-entry-wrapper").removeClass((function(index,className){return(className.match(/(^|\s)si-thumb-\S+/g)||[]).join(" ")})),$(".si-blog-entry-wrapper").addClass("si-thumb-"+newval)}))})),api("sinatra_single_title_alignment",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)si-page-title-align-\S+/g)||[]).join(" ")})),$body.addClass("si-page-title-align-"+newval)}))})),api("sinatra_single_title_spacing",(function(value){value.bind((function(newval){if($(".page-header").length){$style_tag=sinatra_get_style_tag("sinatra_single_title_spacing");var style_css=sinatra_spacing_field_css(".si-single-title-in-page-header #page .page-header .si-page-header-wrapper","padding",newval,!0);$style_tag.html(style_css)}}))})),api("sinatra_single_narrow_container_width",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_single_narrow_container_width");var style_css="";style_css+='.single-post.narrow-content .entry-content > :not([class*="align"]):not([class*="gallery"]):not(.wp-block-image):not(.quote-inner):not(.quote-post-bg), .single-post.narrow-content .mce-content-body:not([class*="page-template-full-width"]) > :not([class*="align"]):not([data-wpview-type*="gallery"]):not(blockquote):not(.mceTemp), .single-post.narrow-content .entry-footer, .single-post.narrow-content .post-nav, .single-post.narrow-content .entry-content > .alignwide, .single-post.narrow-content p.has-background:not(.alignfull):not(.alignwide).single-post.narrow-content #sinatra-comments-toggle, .single-post.narrow-content #comments, .single-post.narrow-content .entry-content .aligncenter, .single-post.narrow-content .si-narrow-element, .single-post.narrow-content.si-single-title-in-content .entry-header, .single-post.narrow-content.si-single-title-in-content .entry-meta, .single-post.narrow-content.si-single-title-in-content .post-category, .single-post.narrow-content.sinatra-no-sidebar .si-page-header-wrapper, .single-post.narrow-content.sinatra-no-sidebar .si-breadcrumbs > .si-container > nav {max-width: '+parseInt(newval.value)+"px; margin-left: auto; margin-right: auto; }",style_css+=".single-post.narrow-content .author-box, .single-post.narrow-content .entry-content > .alignwide { max-width: "+(parseInt(newval.value)+70)+"px;}",$style_tag.html(style_css)}))})),api("sinatra_single_content_font_size",(function(value){value.bind((function(newval){if($(".single-post").length){$style_tag=sinatra_get_style_tag("sinatra_single_content_font_size");var style_css="";style_css+=sinatra_range_field_css(".single-post .entry-content","font-size",newval,!0,newval.unit),$style_tag.html(style_css)}}))})),api("sinatra_header_container_width",(function(value){value.bind((function(newval){var $header=$("#sinatra-header");$header.length&&("full-width"===newval?$header.addClass("si-container__wide"):$header.removeClass("si-container__wide"))}))})),api("sinatra_main_nav_mobile_breakpoint",(function(value){value.bind((function(newval){if($("#sinatra-header-inner .sinatra-nav").length){$style_tag=sinatra_get_style_tag("sinatra_main_nav_mobile_breakpoint");var style_css="";style_css+="@media screen and (min-width: "+parseInt(newval)+"px) {#sinatra-header-inner .sinatra-nav {display:flex} .si-mobile-nav {display:none;} }",style_css+="@media screen and (max-width: "+parseInt(newval)+"px) {#sinatra-header-inner .sinatra-nav {display:none} .si-mobile-nav {display:inline-flex;} }",$style_tag.html(style_css)}}))})),api("sinatra_main_nav_mobile_label",(function(value){value.bind((function(newval){$(".si-hamburger-sinatra-primary-nav").find(".hamburger-label").length&&$(".si-hamburger-sinatra-primary-nav").find(".hamburger-label").html(newval)}))})),api("sinatra_main_nav_font_color",(function(value){value.bind((function(newval){if($("#sinatra-header-inner .sinatra-nav").length){$style_tag=sinatra_get_style_tag("sinatra_main_nav_font_color");var style_css="";newval["link-color"]=newval["link-color"]?newval["link-color"]:"inherit",style_css+="#sinatra-header-inner .sinatra-nav > ul > li > a { color: "+newval["link-color"]+"; }",newval["link-hover-color"]=newval["link-hover-color"]?newval["link-hover-color"]:api.value("sinatra_accent_color")(),style_css+="#sinatra-header-inner .sinatra-nav > ul > li > a:hover, #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: "+newval["link-hover-color"]+"; }",$style_tag.html(style_css)}}))})),api("sinatra_main_nav_background",(function(value){value.bind((function(newval){if($(".sinatra-header-layout-3 .si-nav-container").length){$style_tag=sinatra_get_style_tag("sinatra_main_nav_background");var style_css=sinatra_design_options_css(".sinatra-header-layout-3 .si-nav-container",newval,"background");$style_tag.html(style_css)}}))})),api("sinatra_main_nav_border",(function(value){value.bind((function(newval){if($(".sinatra-header-layout-3 .si-nav-container").length){$style_tag=sinatra_get_style_tag("sinatra_main_nav_border");var style_css=sinatra_design_options_css(".sinatra-header-layout-3 .si-nav-container",newval,"border");$style_tag.html(style_css)}}))})),api("sinatra_main_nav_font_size",(function(value){value.bind((function(newval){if($("#sinatra-header-inner").length){$style_tag=sinatra_get_style_tag("sinatra_main_nav_font_size");var style_css="";style_css+=sinatra_range_field_css(".sinatra-nav.si-header-element, .sinatra-header-layout-1 .si-header-widgets, .sinatra-header-layout-2 .si-header-widgets","font-size",newval,!1,newval.unit),$style_tag.html(style_css)}}))})),api("sinatra_top_bar_container_width",(function(value){value.bind((function(newval){var $topbar=$("#sinatra-topbar");$topbar.length&&("full-width"===newval?$topbar.addClass("si-container__wide"):$topbar.removeClass("si-container__wide"))}))})),api("sinatra_top_bar_visibility",(function(value){value.bind((function(newval){sinatra_print_visibility_classes($("#sinatra-topbar"),newval)}))})),api("sinatra_top_bar_widgets_separator",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)sinatra-topbar__separators-\S+/g)||[]).join(" ")})),$body.addClass("sinatra-topbar__separators-"+newval)}))})),api("sinatra_top_bar_background",(function(value){value.bind((function(newval){if($("#sinatra-topbar").length){$style_tag=sinatra_get_style_tag("sinatra_top_bar_background");var style_css=sinatra_design_options_css("#sinatra-topbar",newval,"background");$style_tag.html(style_css)}}))})),api("sinatra_top_bar_text_color",(function(value){value.bind((function(newval){if($("#sinatra-topbar").length){$style_tag=sinatra_get_style_tag("sinatra_top_bar_text_color");var style_css="";newval["text-color"]=newval["text-color"]?newval["text-color"]:"inherit",newval["link-color"]=newval["link-color"]?newval["link-color"]:"inherit",newval["link-hover-color"]=newval["link-hover-color"]?newval["link-hover-color"]:"inherit",style_css+="#sinatra-topbar { color: "+newval["text-color"]+"; }",style_css+=".si-topbar-widget__text a, .si-topbar-widget .sinatra-nav > ul > li > a, .si-topbar-widget__socials .sinatra-social-nav > ul > li > a, #sinatra-topbar .si-topbar-widget__text .si-icon { color: "+newval["link-color"]+"; }",style_css+="#sinatra-topbar .sinatra-nav > ul > li > a:hover, #sinatra-topbar .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-item > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-topbar .si-topbar-widget__text a:hover, #sinatra-topbar .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: "+newval["link-hover-color"]+"; }",$style_tag.html(style_css)}}))})),api("sinatra_top_bar_border",(function(value){value.bind((function(newval){if($("#sinatra-topbar").length){$style_tag=sinatra_get_style_tag("sinatra_top_bar_border");var style_css=sinatra_design_options_css("#sinatra-topbar",newval,"border");style_css+=sinatra_design_options_css("#sinatra-topbar .si-topbar-widget",newval,"separator_color"),$style_tag.html(style_css)}}))})),api("sinatra_main_nav_hover_animation",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)sinatra-menu-animation-\S+/g)||[]).join(" ")})),$body.addClass("sinatra-menu-animation-"+newval)}))})),api("sinatra_header_widgets_separator",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)sinatra-header__separators-\S+/g)||[]).join(" ")})),$body.addClass("sinatra-header__separators-"+newval)}))})),api("sinatra_header_background",(function(value){value.bind((function(newval){if($("#sinatra-header-inner").length){$style_tag=sinatra_get_style_tag("sinatra_header_background");var style_css=sinatra_design_options_css("#sinatra-header-inner",newval,"background");"color"===newval["background-type"]&&newval["background-color"]?style_css+=".si-header-widget__cart .si-cart .si-cart-count { border: 2px solid "+newval["background-color"]+"; }":style_css+=".si-header-widget__cart .si-cart .si-cart-count { border: none; }",$style_tag.html(style_css)}}))})),api("sinatra_header_text_color",(function(value){value.bind((function(newval){if($("#sinatra-header").length){$style_tag=sinatra_get_style_tag("sinatra_header_text_color");var style_css="";style_css+=".sinatra-logo .site-description { color: "+newval["text-color"]+"; }",newval["link-color"]&&(style_css+="#sinatra-header, .si-header-widgets a:not(.si-btn), .sinatra-logo a,.si-hamburger { color: "+newval["link-color"]+"; }",style_css+=".hamburger-inner,.hamburger-inner::before,.hamburger-inner::after { background-color: "+newval["link-color"]+"; }"),newval["link-hover-color"]&&(style_css+=".si-header-widgets a:not(.si-btn):hover, #sinatra-header-inner .si-header-widgets .sinatra-active,.sinatra-logo .site-title a:hover, .si-hamburger:hover .hamburger-label, .is-mobile-menu-active .si-hamburger .hamburger-label,#sinatra-header-inner .sinatra-nav > ul > li > a:hover,#sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a,#sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a,#sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a,#sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a,#sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a,#sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: "+newval["link-hover-color"]+"; }",style_css+=".si-hamburger:hover .hamburger-inner,.si-hamburger:hover .hamburger-inner::before,.si-hamburger:hover .hamburger-inner::after,.is-mobile-menu-active .si-hamburger .hamburger-inner,.is-mobile-menu-active .si-hamburger .hamburger-inner::before,.is-mobile-menu-active .si-hamburger .hamburger-inner::after { background-color: "+newval["link-hover-color"]+"; }"),$style_tag.html(style_css)}}))})),api("sinatra_header_border",(function(value){value.bind((function(newval){if($("#sinatra-header-inner").length){$style_tag=sinatra_get_style_tag("sinatra_header_border");var style_css=sinatra_design_options_css("#sinatra-header-inner",newval,"border");newval["separator-color"]=newval["separator-color"]?newval["separator-color"]:"inherit",style_css+=".si-header-widget:after { background-color: "+newval["separator-color"]+"; }",$style_tag.html(style_css)}}))})),api("sinatra_hero_hover_slider_container",(function(value){value.bind((function(newval){var $hero_container=$("#hero .si-hero-container");$hero_container.length&&("full-width"===newval?$hero_container.addClass("si-container__wide"):$hero_container.removeClass("si-container__wide"))}))})),api("sinatra_hero_hover_slider_overlay",(function(value){value.bind((function(newval){var $hero=$("#hero .si-hover-slider");$hero.length&&$hero.removeClass((function(index,className){return(className.match(/(^|\s)slider-overlay-\S+/g)||[]).join(" ")})).addClass("slider-overlay-"+newval)}))})),api("sinatra_hero_hover_slider_height",(function(value){value.bind((function(newval){var $hero=$("#hero");$hero.length&&$hero.find(".hover-slide-item").css("height",newval.value+"px")}))})),api("sinatra_hero_visibility",(function(value){value.bind((function(newval){sinatra_print_visibility_classes($("#hero"),newval)}))})),api("sinatra_main_nav_sub_indicators",(function(value){value.bind((function(newval){newval?$body.addClass("sinatra-with-dropdown-indicators"):$body.removeClass("sinatra-with-dropdown-indicators")}))})),api("sinatra_custom_input_style",(function(value){value.bind((function(newval){newval?$body.addClass("si-input-supported"):$body.removeClass("si-input-supported")}))})),api("sinatra_enable_pre_footer_cta",(function(value){value.bind((function(newval){newval?$body.addClass("si-pre-footer-cta-style-"+api.value("sinatra_pre_footer_cta_style")()):$body.removeClass((function(index,className){return(className.match(/(^|\s)si-pre-footer-cta-style-\S+/g)||[]).join(" ")}))}))})),api("sinatra_pre_footer_cta_visibility",(function(value){value.bind((function(newval){var $cta=$(".si-pre-footer-cta");$cta.length&&sinatra_print_visibility_classes($cta,newval)}))})),api("sinatra_pre_footer_cta_text",(function(value){value.bind((function(newval){var $cta=$("#si-pre-footer .si-pre-footer-cta");$cta.length&&$cta.find("p.h3").html(newval)}))})),api("sinatra_pre_footer_cta_style",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)si-pre-footer-cta-style-\S+/g)||[]).join(" ")})).addClass("si-pre-footer-cta-style-"+api.value("sinatra_pre_footer_cta_style")())}))})),api("sinatra_pre_footer_cta_btn_text",(function(value){value.bind((function(newval){var $cta=$("#si-pre-footer .si-pre-footer-cta");$cta.length&&(newval?$cta.find("a").css("display","inline-flex").html(newval):$cta.find("a").css("display","none").html(""))}))})),api("sinatra_pre_footer_cta_background",(function(value){value.bind((function(newval){if($("#si-pre-footer .si-pre-footer-cta").length){$style_tag=sinatra_get_style_tag("sinatra_pre_footer_cta_background");var style_css="";"color"===newval["background-type"]?(style_css+=sinatra_design_options_css(".si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before, .si-pre-footer-cta-style-2 #si-pre-footer::before",newval,"background"),style_css+=".si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after,.si-pre-footer-cta-style-2 #si-pre-footer::after{ background-image: none; }"):(style_css+=sinatra_design_options_css(".si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after",newval,"background"),style_css+=sinatra_design_options_css(".si-pre-footer-cta-style-2 #si-pre-footer::after",newval,"background")),"image"===newval["background-type"]&&newval["background-color-overlay"]&&newval["background-image"]&&(style_css+=".si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before,.si-pre-footer-cta-style-2 #si-pre-footer::before{ background-color: "+newval["background-color-overlay"]+"; }"),$style_tag.html(style_css)}}))})),api("sinatra_pre_footer_cta_text_color",(function(value){value.bind((function(newval){if($("#si-pre-footer .si-pre-footer-cta").length){$style_tag=sinatra_get_style_tag("sinatra_pre_footer_cta_text_color");var style_css="";style_css+=sinatra_design_options_css("#si-pre-footer .h2",newval,"color"),style_css+=sinatra_design_options_css("#si-pre-footer .h3",newval,"color"),style_css+=sinatra_design_options_css("#si-pre-footer .h4",newval,"color"),$style_tag.html(style_css)}}))})),api("sinatra_pre_footer_cta_border",(function(value){value.bind((function(newval){if($("#si-pre-footer .si-pre-footer-cta").length){$style_tag=sinatra_get_style_tag("sinatra_pre_footer_cta_border");var style_css=sinatra_design_options_css(".si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before, .si-pre-footer-cta-style-2 #si-pre-footer::before",newval,"border");$style_tag.html(style_css)}}))})),api("sinatra_pre_footer_cta_font_size",(function(value){value.bind((function(newval){if($("#si-pre-footer .si-pre-footer-cta").length){$style_tag=sinatra_get_style_tag("sinatra_pre_footer_cta_font_size");var style_css=sinatra_range_field_css("#si-pre-footer .h3","font-size",newval,!0,newval.unit);$style_tag.html(style_css)}}))})),api("sinatra_product_sale_badge_text",(function(value){value.bind((function(newval){var $badge=$(".woocommerce ul.products li.product .onsale, .woocommerce span.onsale").not(".sold-out");$badge.length&&$badge.html(newval)}))})),api("sinatra_accent_color",(function(value){value.bind((function(newval){var style_css;$style_tag=sinatra_get_style_tag("sinatra_accent_color"),style_css=".si-header-widgets .si-cart .si-cart-count,#si-scroll-top:hover::before, .sinatra-menu-animation-underline #sinatra-header-inner .sinatra-nav > ul > li > a > span::before, .si-btn, #infinite-handle span, input[type=submit], .comment-form input[type=checkbox]:checked, #comments .bypostauthor-badge, input[type=radio]:checked::before, .single .post-tags a:hover, .single .post-category .cat-links a:hover, #main .mejs-controls .mejs-time-rail .mejs-time-current, .si-hamburger:hover .hamburger-inner, .si-hamburger:hover .hamburger-inner::before, .si-hamburger:hover .hamburger-inner::after, .tagcloud a:hover, .si-btn.sinatra-read-more::after, .post_format-post-format-quote .si-blog-entry-content .quote-post-bg::after, .si-hover-slider .post-category a,.si-single-title-in-page-header.single .page-header .post-category a,.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after,.si-pre-footer-cta-style-2 #si-pre-footer::after,.entry-media > a:hover .entry-media-icon::before, .si-woo-steps .si-step.is-active > span:first-child, .si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after, .si-pre-footer-cta-style-2 #si-pre-footer::after, .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .select2-container--default .select2-results__option--highlighted[data-selected], .si-input-supported input[type=radio]:checked:before, .si-input-supported input[type=checkbox]:checked, .woocommerce ul.products li.product .onsale, .woocommerce span.onsale, .woocommerce-store-notice, p.demo_store, .woocommerce ul.products li.product .button, .sinatra-sidebar-style-2 #secondary .widget-title:before, .widget.woocommerce .wc-layered-nav-term:hover .count, .widget.woocommerce .product-categories li a:hover ~ .count, .widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a:before, .woocommerce .widget_rating_filter ul li.chosen a::before, .widget.woocommerce .wc-layered-nav-term.chosen .count, .widget.woocommerce .product-categories li.current-cat > .count, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle:after, .woocommerce .widget_layered_nav_filters ul li a:hover, .woocommerce div.product form.cart .button, .widget.woocommerce .wc-layered-nav-rating a:hover em, .widget.woocommerce .wc-layered-nav-rating.chosen a em, .widget .cat-item a:hover + span, .widget_archive li a:hover + span, .widget .cat-item.current-cat a + span, #sinatra-footer .widget .cat-item a:hover + span, #sinatra-footer .widget_archive li a:hover + span, #sinatra-footer .widget .cat-item.current-cat a + span, .si-btn.btn-outline:hover, .si-hamburger:hover .hamburger-inner, .si-hamburger:hover .hamburger-inner::before, .si-hamburger:hover .hamburger-inner::after, .is-mobile-menu-active .si-hamburger .hamburger-inner, .is-mobile-menu-active .si-hamburger .hamburger-inner::before, .is-mobile-menu-active .si-hamburger .hamburger-inner::after, .woocommerce div.product div.images .woocommerce-product-gallery__trigger:hover:before, .woocommerce #review_form #respond .form-submit input { background-color: "+newval+";}",style_css+=".si-btn:hover, input[type=submit]:hover, #infinite-handle span:hover, .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button:hover, .site-main .woocommerce button.button:hover, .site-main .woocommerce input.button:hover, .si-hover-slider .post-category a:hover, .si-single-title-in-page-header.single .page-header .post-category a:hover, .woocommerce ul.products li.product .button:hover, .woocommerce .widget_price_filter .ui-slider .ui-slider-range, .wc-layered-nav-rating a:hover .star-rating span:before, .woocommerce #review_form #respond .form-submit input:hover { background-color: "+sinatra_luminance(newval,.15)+";}",style_css+=".wc-layered-nav-rating a:hover .star-rating span:before { color: "+sinatra_luminance(newval,.15)+";}",style_css+="code, kbd, var, samp, mark, span.highlight, tt { background-color: "+sinatra_hex2rgba(newval,.12)+";}",style_css+="code.block { background-color: "+sinatra_hex2rgba(newval,.075)+";}",style_css+=".content-area a:not(.si-btn):not(.wp-block-button__link),.si-sidebar-container a:hover:not(.si-btn), .si-header-widgets .si-header-widget:hover, .si-header-widgets .si-header-widget.sinatra-active .si-icon.si-search, #sinatra-header-inner .si-header-widgets .sinatra-active, .sinatra-logo .site-title a:hover,#sinatra-header-inner .sinatra-nav > ul > li > a:hover, #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a, #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a, #sinatra-topbar .sinatra-nav > ul > li > a:hover, #sinatra-topbar .sinatra-nav > ul > li.menu-item-has-children:hover > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-item > a, #sinatra-topbar .sinatra-nav > ul > li.current-menu-ancestor > a, .si-topbar-widget__text a:hover, .si-topbar-widget__text a, .si-header-widgets a:not(.si-btn):hover, .sinatra-social-nav > ul > li > a .si-icon.bottom-icon, .sinatra-pagination .navigation .nav-links .page-numbers:hover, .widget .cat-item.current-cat > a, .widget ul li.current_page_item > a, #main .search-form .search-submit:hover, #cancel-comment-reply-link:hover, .comment-form .required, .navigation .nav-links .page-numbers:hover, #main .entry-meta a:hover, #main .author-box-title a, .single .post-category a, .page-links span:hover, .site-content .page-links span:hover, .wc-cart-widget-header .si-cart-subtotal span, .si-header-widget__cart:hover > a, .woocommerce #yith-wcwl-form table.shop_table .product-subtotal .amount, .woocommerce .woocommerce-cart-form table.shop_table .product-subtotal .amount, .si-woo-steps .si-step.is-active, .cart_totals .order-total td, .navigation .nav-links .page-numbers.current, .page-links > span, .site-content .page-links > span, .woocommerce ul.products li.product .price, .woocommerce .woocommerce-checkout-review-order .order-total .woocommerce-Price-amount.amount, .woocommerce-info::before, #main .woocommerce-MyAccount-navigation li.is-active, .woocommerce .star-rating span::before, .widget.woocommerce .wc-layered-nav-term:hover a, .widget.woocommerce .wc-layered-nav-term a:hover,.widget.woocommerce .product-categories li a:hover, .widget.woocommerce .product-categories li.current-cat > a, .woocommerce ins .amount, .woocommerce .widget_rating_filter ul li.chosen a::before, .widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a, .woocommerce .widget_shopping_cart .total .amount, .woocommerce .widget_shopping_cart .total .tax_label, .woocommerce.widget_shopping_cart .total .amount, .woocommerce.widget_shopping_cart .total .tax_label, .si-btn.btn-outline, .woocommerce .widget_shopping_cart .cart_list li a.remove:hover:before, .woocommerce div.product .woocommerce-tabs ul.tabs li.active > a,.woocommerce.widget_shopping_cart .cart_list li a.remove:hover:before, .woocommerce div.product p.price, .woocommerce div.product span.price, .woocommerce div.product #reviews .comment-form-rating .stars a, .woocommerce div.product .woocommerce-pagination ul li span.current, .woocommerce div.product .woocommerce-pagination ul li a:hover, code, kbd, var, samp, tt, .is-mobile-menu-active .si-hamburger .hamburger-label, .si-hamburger:hover .hamburger-label, .single #main .post-nav a:hover, #sinatra-topbar .si-topbar-widget__text .si-icon, .sinatra-core-custom-list-widget .si-widget-icon {color: "+newval+";}",style_css+="#main ::-moz-selection { background-color: "+newval+"; color: #FFF; }",style_css+="#main ::selection { background-color: "+newval+"; color: #FFF; }",style_css+='#comments .comment-actions .reply a:hover, .comment-form input[type=checkbox]:checked, .comment-form input[type=checkbox]:focus, .comment-form input[type=radio]:checked, .comment-form input[type=radio]:focus, .single .post-category a, #secondary .widget-title, .si-hover-slider .post-category a, .si-single-title-in-page-header.single .page-header .post-category a, .entry-content blockquote, .wp-block-quote.is-style-large, .wp-block-quote.is-large, .wp-block-quote.has-text-align-right, [type="radio"]:checked + label:before, .si-input-supported input[type=radio]:checked, .si-input-supported input[type=checkbox]:checked, .widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a:before, .widget.woocommerce .widget_rating_filter.chosen a:after, .si-btn.btn-outline, .page-links > span, .site-content .page-links > span, .navigation .nav-links .page-numbers.current, .woocommerce div.product div.images .flex-control-thumbs li img.flex-active, .woocommerce div.product .woocommerce-pagination ul li span.current {border-color: '+newval+";}",style_css+='#masthead .si-header-widgets .dropdown-item::after, .sinatra-nav > ul .sub-menu::after,textarea:focus, input[type="text"]:focus, input[type="email"]:focus, input[type=password]:focus, input[type=tel]:focus, input[type=url]:focus, input[type=search]:focus, input[type=date]:focus, #add_payment_method table.cart td.actions .coupon .input-text:focus, .woocommerce-cart table.cart td.actions .coupon .input-text:focus, .woocommerce-checkout table.cart td.actions .coupon .input-text:focus {border-bottom-color: '+newval+";}",style_css+=".si-header-widgets .dropdown-item, .site .woocommerce-info, .preloader-1 > div, .si-header-element.sinatra-nav .sub-menu {border-top-color: "+newval+";}",style_css+=".sinatra-animate-arrow:hover .arrow-handle, .sinatra-animate-arrow:hover .arrow-bar, .sinatra-animate-arrow:focus .arrow-handle, .sinatra-animate-arrow:focus .arrow-bar, .sinatra-pagination .navigation .nav-links .page-numbers.next:hover .sinatra-animate-arrow .arrow-handle,.sinatra-pagination .navigation .nav-links .page-numbers.prev:hover .sinatra-animate-arrow .arrow-handle,.sinatra-pagination .navigation .nav-links .page-numbers.next:hover .sinatra-animate-arrow .arrow-bar,.sinatra-pagination .navigation .nav-links .page-numbers.prev:hover .sinatra-animate-arrow .arrow-bar {fill: "+newval+";}",style_css+=".si-input-supported input[type=checkbox]:focus:hover { box-shadow: inset 0 0 0 2px "+newval+"; }",style_css+=".si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before,.si-pre-footer-cta-style-2 #si-pre-footer::before { background: linear-gradient(to right, "+sinatra_hex2rgba(newval,.9)+" 0%, "+sinatra_hex2rgba(newval,.82)+" 35%, "+sinatra_hex2rgba(newval,.4)+" 100% );-webkit-gradient(linear, left top, right top, from("+sinatra_hex2rgba(newval,.9)+"), color-stop(35%, "+sinatra_hex2rgba(newval,.82)+"), to("+sinatra_hex2rgba(newval,.4)+")); }",$style_tag.html(style_css)}))})),api("sinatra_boxed_content_background_color",(function(value){value.bind((function(newval){var style_css="";newval&&(style_css=".sinatra-layout__boxed #page, .sinatra-layout__boxed-separated #content, .sinatra-layout__boxed-separated.sinatra-sidebar-style-3 #secondary .si-widget, .sinatra-layout__boxed-separated.sinatra-sidebar-style-3 .elementor-widget-sidebar .si-widget, .sinatra-layout__boxed-separated.blog .sinatra-article, .sinatra-layout__boxed-separated.search-results .sinatra-article, .sinatra-layout__boxed-separated.category .sinatra-article { background-color: "+newval+"; }",style_css+="@media screen and (max-width: 960px) { .sinatra-layout__boxed-separated #page { background-color: "+newval+"; }}"),($style_tag=sinatra_get_style_tag("sinatra_boxed_content_background_color")).html(style_css)}))})),api("sinatra_content_text_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_content_text_color");var style_css="";newval&&(style_css="body { color: "+newval+";}.comment-form .comment-notes, #comments .no-comments, #page .wp-caption .wp-caption-text,#comments .comment-meta,.comments-closed,.entry-meta,.si-entry cite,legend,.si-page-header-description,.page-links em,.site-content .page-links em,.single .entry-footer .last-updated,.single .post-nav .post-nav-title,#main .widget_recent_comments span,#main .widget_recent_entries span,#main .widget_calendar table > caption,.post-thumb-caption, .wp-block-image figcaption, .si-cart-item .si-x,.woocommerce form.login .lost_password a,.woocommerce form.register .lost_password a,.woocommerce a.remove,#add_payment_method .cart-collaterals .cart_totals .woocommerce-shipping-destination, .woocommerce-cart .cart-collaterals .cart_totals .woocommerce-shipping-destination, .woocommerce-checkout .cart-collaterals .cart_totals .woocommerce-shipping-destination,.woocommerce ul.products li.product .si-loop-product__category-wrap a,.woocommerce ul.products li.product .si-loop-product__category-wrap,.woocommerce .woocommerce-checkout-review-order table.shop_table thead th,#add_payment_method #payment div.payment_box, .woocommerce-cart #payment div.payment_box, .woocommerce-checkout #payment div.payment_box,#add_payment_method #payment ul.payment_methods .about_paypal, .woocommerce-cart #payment ul.payment_methods .about_paypal, .woocommerce-checkout #payment ul.payment_methods .about_paypal,.woocommerce table dl,.woocommerce table .wc-item-meta,.widget.woocommerce .reviewer,.woocommerce.widget_shopping_cart .cart_list li a.remove:before,.woocommerce .widget_shopping_cart .cart_list li a.remove:before,.woocommerce .widget_shopping_cart .cart_list li .quantity, .woocommerce.widget_shopping_cart .cart_list li .quantity,.woocommerce div.product .woocommerce-product-rating .woocommerce-review-link,.woocommerce div.product .woocommerce-tabs table.shop_attributes td,.woocommerce div.product .product_meta > span span:not(.si-woo-meta-title), .woocommerce div.product .product_meta > span a,.woocommerce .star-rating::before,.woocommerce div.product #reviews #comments ol.commentlist li .comment-text p.meta,.ywar_review_count,.woocommerce .add_to_cart_inline del, .woocommerce div.product p.price del, .woocommerce div.product span.price del { color: "+sinatra_hex2rgba(newval,.75)+"; }"),$style_tag.html(style_css)}))})),api("sinatra_content_link_hover_color",(function(value){value.bind((function(newval){var style_css="";newval&&(style_css+=".content-area a:not(.si-btn):not(.wp-block-button__link):hover, .si-woo-before-shop select.custom-select-loaded:hover ~ #si-orderby, #add_payment_method #payment ul.payment_methods .about_paypal:hover, .woocommerce-cart #payment ul.payment_methods .about_paypal:hover, .woocommerce-checkout #payment ul.payment_methods .about_paypal:hover, .si-breadcrumbs a:hover, .woocommerce div.product .woocommerce-product-rating .woocommerce-review-link:hover, .woocommerce ul.products li.product .meta-wrap .woocommerce-loop-product__link:hover, .woocommerce ul.products li.product .si-loop-product__category-wrap a:hover { color: "+newval+";}"),($style_tag=sinatra_get_style_tag("sinatra_content_link_hover_color")).html(style_css)}))})),api("sinatra_headings_color",(function(value){value.bind((function(newval){var style_css="";newval&&(style_css="h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .sinatra-logo .site-title, .error-404 .page-header h1 { color: "+newval+";}"),($style_tag=sinatra_get_style_tag("sinatra_headings_color")).html(style_css)}))})),api("sinatra_scroll_top_visibility",(function(value){value.bind((function(newval){sinatra_print_visibility_classes($("#si-scroll-top"),newval)}))})),api("sinatra_preloader_visibility",(function(value){value.bind((function(newval){sinatra_print_visibility_classes($("#si-preloader"),newval)}))})),api("sinatra_footer_visibility",(function(value){value.bind((function(newval){sinatra_print_visibility_classes($("#sinatra-footer"),newval)}))})),api("sinatra_footer_background",(function(value){value.bind((function(newval){if($("#colophon").length){$style_tag=sinatra_get_style_tag("sinatra_footer_background");var style_css=sinatra_design_options_css("#colophon",newval,"background");$style_tag.html(style_css)}}))})),api("sinatra_footer_text_color",(function(value){var copyright_separator_color,style_css,$footer=$("#sinatra-footer");value.bind((function(newval){$footer.length&&($style_tag=sinatra_get_style_tag("sinatra_footer_text_color"),style_css="",newval["text-color"]=newval["text-color"]?newval["text-color"]:"inherit",newval["link-color"]=newval["link-color"]?newval["link-color"]:"inherit",newval["link-hover-color"]=newval["link-hover-color"]?newval["link-hover-color"]:"inherit",newval["widget-title-color"]=newval["widget-title-color"]?newval["widget-title-color"]:"inherit",style_css+="#colophon { color: "+newval["text-color"]+"; }",style_css+="#colophon a { color: "+newval["link-color"]+"; }",style_css+="#colophon a:hover, #colophon li.current_page_item > a, #colophon .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: "+newval["link-hover-color"]+"; }",style_css+="#colophon .widget-title { color: "+newval["widget-title-color"]+"; }",copyright_separator_color=function(color,dark="#000000",light="#FFFFFF"){return function(color=""){var r,g,b;return color.match(/^rgb/)?(r=(color=color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],g=color[2],b=color[3]):(r=(color=+("0x"+color.slice(1).replace(color.length<5&&/./g,"$&$&")))>>16,g=color>>8&255,b=255&color),(299*r+587*g+114*b)/1e3>137}(color)?dark:light}(newval["text-color"],"rgba(255,255,255,0.1)","rgba(0,0,0,0.1)"),style_css+="#sinatra-copyright.contained-separator > .si-container:before { background-color: "+copyright_separator_color+"; }",style_css+="#sinatra-copyright.fw-separator { border-top-color: "+copyright_separator_color+"; }",$style_tag.html(style_css))}))})),api("sinatra_footer_border",(function(value){value.bind((function(newval){if($("#sinatra-footer").length){$style_tag=sinatra_get_style_tag("sinatra_footer_border");var style_css="";newval["border-top-width"]&&(style_css+="#colophon { border-top-width: "+newval["border-top-width"]+"px;border-top-style: "+newval["border-style"]+";border-top-color: "+newval["border-color"]+";}"),newval["border-bottom-width"]&&(style_css+="#colophon { border-bottom-width: "+newval["border-bottom-width"]+"px;border-bottom-style: "+newval["border-style"]+";border-bottom-color: "+newval["border-color"]+";}"),$style_tag.html(style_css)}}))})),api("sinatra_copyright_layout",(function(value){value.bind((function(newval){$body.removeClass((function(index,className){return(className.match(/(^|\s)sinatra-copyright-layout-\S+/g)||[]).join(" ")})),$body.addClass("sinatra-copyright-"+newval)}))})),api("sinatra_copyright_separator",(function(value){value.bind((function(newval){var $copyright=$("#sinatra-copyright");$copyright.length&&($copyright.removeClass("fw-separator contained-separator"),"none"!==newval&&$copyright.addClass(newval))}))})),api("sinatra_copyright_visibility",(function(value){value.bind((function(newval){sinatra_print_visibility_classes($("#sinatra-copyright"),newval)}))})),api("sinatra_copyright_background",(function(value){value.bind((function(newval){if($("#sinatra-copyright").length){$style_tag=sinatra_get_style_tag("sinatra_copyright_background");var style_css=sinatra_design_options_css("#sinatra-copyright",newval,"background");$style_tag.html(style_css)}}))})),api("sinatra_copyright_text_color",(function(value){value.bind((function(newval){if($("#sinatra-copyright").length){$style_tag=sinatra_get_style_tag("sinatra_copyright_text_color");var style_css="";newval["text-color"]=newval["text-color"]?newval["text-color"]:"inherit",newval["link-color"]=newval["link-color"]?newval["link-color"]:"inherit",newval["link-hover-color"]=newval["link-hover-color"]?newval["link-hover-color"]:"inherit",style_css+="#sinatra-copyright { color: "+newval["text-color"]+"; }",style_css+="#sinatra-copyright a { color: "+newval["link-color"]+"; }",style_css+="#sinatra-copyright a:hover, #sinatra-copyright .sinatra-social-nav > ul > li > a .si-icon.bottom-icon, #sinatra-copyright li.current_page_item > a, #sinatra-copyright .sinatra-nav > ul > li.current-menu-item > a, #sinatra-copyright .sinatra-nav > ul > li.current-menu-ancestor > a #sinatra-copyright .sinatra-nav > ul > li:hover > a, #sinatra-copyright .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: "+newval["link-hover-color"]+"; }",$style_tag.html(style_css)}}))})),api("sinatra_container_width",(function(value){value.bind((function(newval){var style_css;$style_tag=sinatra_get_style_tag("sinatra_container_width"),style_css=".si-container,.alignfull > div { max-width: "+newval.value+"px;}",style_css+=".sinatra-layout__boxed #page, .sinatra-layout__boxed.si-sticky-header.sinatra-is-mobile #sinatra-header-inner, .sinatra-layout__boxed.si-sticky-header:not(.sinatra-header-layout-3) #sinatra-header-inner, .sinatra-layout__boxed.si-sticky-header:not(.sinatra-is-mobile).sinatra-header-layout-3 #sinatra-header-inner .si-nav-container > .si-container { max-width: "+(parseInt(newval.value)+100)+"px; }",$style_tag.html(style_css)}))})),api("sinatra_tsp_logo_max_height",(function(value){value.bind((function(newval){if($(".si-tsp-header .sinatra-logo").length){$style_tag=sinatra_get_style_tag("sinatra_tsp_logo_max_height");var style_css="";style_css+=sinatra_range_field_css(".si-tsp-header .sinatra-logo img","max-height",newval,!0,"px"),style_css+=sinatra_range_field_css(".si-tsp-header .sinatra-logo img.si-svg-logo","height",newval,!0,"px"),$style_tag.html(style_css)}}))})),api("sinatra_tsp_logo_margin",(function(value){value.bind((function(newval){if($(".si-tsp-header .sinatra-logo").length){$style_tag=sinatra_get_style_tag("sinatra_tsp_logo_margin");var style_css=sinatra_spacing_field_css(".si-tsp-header .sinatra-logo .logo-inner","margin",newval,!0);$style_tag.html(style_css)}}))})),api("sinatra_tsp_header_background",(function(value){value.bind((function(newval){if($(".si-tsp-header").length){$style_tag=sinatra_get_style_tag("sinatra_tsp_header_background");var style_css="";style_css+=sinatra_design_options_css(".si-tsp-header #sinatra-header-inner",newval,"background"),$style_tag.html(style_css)}}))})),api("sinatra_tsp_header_font_color",(function(value){value.bind((function(newval){if($(".si-tsp-header").length){$style_tag=sinatra_get_style_tag("sinatra_tsp_header_font_color");var style_css="";newval["text-color"]=newval["text-color"]?newval["text-color"]:"inherit",newval["link-color"]=newval["link-color"]?newval["link-color"]:"inherit",newval["link-hover-color"]=newval["link-hover-color"]?newval["link-hover-color"]:"inherit",style_css+=".si-tsp-header .sinatra-logo .site-description { color: "+newval["text-color"]+"; }",newval["link-color"]&&(style_css+=".si-tsp-header #sinatra-header, .si-tsp-header .si-header-widgets a:not(.si-btn), .si-tsp-header .sinatra-logo a,.si-tsp-header .si-hamburger, .si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li > a { color: "+newval["link-color"]+"; }",style_css+=".si-tsp-header .hamburger-inner,.si-tsp-header .hamburger-inner::before,.si-tsp-header .hamburger-inner::after { background-color: "+newval["link-color"]+"; }"),newval["link-hover-color"]&&(style_css+=".si-tsp-header .si-header-widgets a:not(.si-btn):hover, .si-tsp-header #sinatra-header-inner .si-header-widgets .sinatra-active,.si-tsp-header .sinatra-logo .site-title a:hover, .si-tsp-header .si-hamburger:hover .hamburger-label, .is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-label,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li > a:hover,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a,.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: "+newval["link-hover-color"]+"; }",style_css+=".si-tsp-header .si-hamburger:hover .hamburger-inner,.si-tsp-header .si-hamburger:hover .hamburger-inner::before,.si-tsp-header .si-hamburger:hover .hamburger-inner::after,.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-inner,.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-inner::before,.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-inner::after { background-color: "+newval["link-hover-color"]+"; }"),$style_tag.html(style_css)}}))})),api("sinatra_tsp_header_border",(function(value){value.bind((function(newval){if($(".si-tsp-header").length){$style_tag=sinatra_get_style_tag("sinatra_tsp_header_border");var style_css="";style_css+=sinatra_design_options_css(".si-tsp-header #sinatra-header-inner",newval,"border"),newval["separator-color"]=newval["separator-color"]?newval["separator-color"]:"inherit",style_css+=".si-tsp-header .si-header-widget:after { background-color: "+newval["separator-color"]+"; }",$style_tag.html(style_css)}}))})),api("sinatra_page_header_alignment",(function(value){value.bind((function(newval){$body.hasClass("single-post")||($body.removeClass((function(index,className){return(className.match(/(^|\s)si-page-title-align-\S+/g)||[]).join(" ")})),$body.addClass("si-page-title-align-"+newval))}))})),api("sinatra_page_header_spacing",(function(value){value.bind((function(newval){if($(".page-header").length){$style_tag=sinatra_get_style_tag("sinatra_page_header_spacing");var style_css=sinatra_spacing_field_css(".si-page-title-align-left .page-header.si-has-page-title, .si-page-title-align-right .page-header.si-has-page-title, .si-page-title-align-center .page-header .si-page-header-wrapper","padding",newval,!0);$style_tag.html(style_css)}}))})),api("sinatra_page_header_background",(function(value){value.bind((function(newval){if($(".page-header").length){$style_tag=sinatra_get_style_tag("sinatra_page_header_background");var style_css="";style_css+=sinatra_design_options_css(".page-header",newval,"background"),style_css+=sinatra_design_options_css(".si-tsp-header:not(.si-tsp-absolute) #masthead",newval,"background"),$style_tag.html(style_css)}}))})),api("sinatra_page_header_text_color",(function(value){value.bind((function(newval){if($(".page-header").length){$style_tag=sinatra_get_style_tag("sinatra_page_header_text_color");var style_css="";newval["text-color"]=newval["text-color"]?newval["text-color"]:"inherit",newval["link-color"]=newval["link-color"]?newval["link-color"]:"inherit",newval["link-hover-color"]=newval["link-hover-color"]?newval["link-hover-color"]:"inherit",style_css+=".page-header .page-title { color: "+newval["text-color"]+"; }",style_css+=".page-header .si-page-header-description{ color: "+sinatra_hex2rgba(newval["text-color"],.75)+"}",style_css+=".page-header .si-breadcrumbs a{ color: "+newval["link-color"]+"; }",style_css+=".page-header .si-breadcrumbs span,.page-header .breadcrumb-trail .trail-items li::after, .page-header .si-breadcrumbs .separator{ color: "+sinatra_hex2rgba(newval["link-color"],.75)+"}",$style_tag.html(style_css)}}))})),api("sinatra_page_header_border",(function(value){value.bind((function(newval){if($(".page-header").length){$style_tag=sinatra_get_style_tag("sinatra_page_header_border");var style_css=sinatra_design_options_css(".page-header",newval,"border");$style_tag.html(style_css)}}))})),api("sinatra_breadcrumbs_alignment",(function(value){value.bind((function(newval){var $breadcrumbs=$("#main > .si-breadcrumbs > .si-container");$breadcrumbs.length&&($breadcrumbs.removeClass((function(index,className){return(className.match(/(^|\s)si-text-align\S+/g)||[]).join(" ")})),$breadcrumbs.addClass("si-text-align-"+newval))}))})),api("sinatra_breadcrumbs_spacing",(function(value){value.bind((function(newval){if($(".si-breadcrumbs").length){$style_tag=sinatra_get_style_tag("sinatra_breadcrumbs_spacing");var style_css=sinatra_spacing_field_css(".si-breadcrumbs","padding",newval,!0);$style_tag.html(style_css)}}))})),api("sinatra_breadcrumbs_background",(function(value){value.bind((function(newval){if($(".si-breadcrumbs").length){$style_tag=sinatra_get_style_tag("sinatra_breadcrumbs_background");var style_css=sinatra_design_options_css(".si-breadcrumbs",newval,"background");$style_tag.html(style_css)}}))})),api("sinatra_breadcrumbs_text_color",(function(value){value.bind((function(newval){if($(".si-breadcrumbs").length){$style_tag=sinatra_get_style_tag("sinatra_breadcrumbs_text_color");var style_css=sinatra_design_options_css(".si-breadcrumbs",newval,"color");$style_tag.html(style_css)}}))})),api("sinatra_breadcrumbs_border",(function(value){value.bind((function(newval){if($(".si-breadcrumbs").length){$style_tag=sinatra_get_style_tag("sinatra_breadcrumbs_border");var style_css=sinatra_design_options_css(".si-breadcrumbs",newval,"border");$style_tag.html(style_css)}}))})),api("sinatra_html_base_font_size",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_html_base_font_size");var style_css=sinatra_range_field_css("html","font-size",newval,!0,"px");$style_tag.html(style_css)}))})),api("sinatra_font_smoothing",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_font_smoothing"),newval?$style_tag.html("*,*::before,*::after {-moz-osx-font-smoothing: grayscale;-webkit-font-smoothing: antialiased;}"):$style_tag.html("*,*::before,*::after {-moz-osx-font-smoothing: auto;-webkit-font-smoothing: auto;}"),$style_tag=sinatra_get_style_tag("sinatra_html_base_font_size");var style_css=sinatra_range_field_css("html","font-size",newval,!0,"px");$style_tag.html(style_css)}))})),api("sinatra_body_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_body_font");var style_css=sinatra_typography_field_css("body",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_headings_font",(function(value){var style_css;value.bind((function(newval){"h1, .h1, .sinatra-logo .site-title, .page-header h1.page-title",", h2, .h2, .woocommerce div.product h1.product_title",", h3, .h3, .woocommerce #reviews #comments h2",", h4, .woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title",", h5, h6",style_css=sinatra_typography_field_css("h1, .h1, .sinatra-logo .site-title, .page-header h1.page-title, h2, .h2, .woocommerce div.product h1.product_title, h3, .h3, .woocommerce #reviews #comments h2, h4, .woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title, h5, h6",newval),sinatra_enqueue_google_font(newval["font-family"]),($style_tag=sinatra_get_style_tag("sinatra_headings_font")).html(style_css)}))})),api("sinatra_h1_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_h1_font");var style_css=sinatra_typography_field_css("h1, .h1, .sinatra-logo .site-title, .page-header h1.page-title",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_h2_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_h2_font");var style_css=sinatra_typography_field_css("h2, .h2, .woocommerce div.product h1.product_title",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_h3_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_h3_font");var style_css=sinatra_typography_field_css("h3, .h3, .woocommerce #reviews #comments h2",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_h4_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_h4_font");var style_css=sinatra_typography_field_css("h4, .woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_h5_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_h5_font");var style_css=sinatra_typography_field_css("h5",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_h6_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_h6_font");var style_css=sinatra_typography_field_css("h6",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_heading_em_font",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_heading_em_font");var style_css=sinatra_typography_field_css("h1 em, h2 em, h3 em, h4 em, h5 em, h6 em, .h1 em, .h2 em, .h3 em, .sinatra-logo .site-title em, .error-404 .page-header h1 em",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api("sinatra_sidebar_widget_title_font_size",(function(value){value.bind((function(newval){if($("#main .widget-title").length){$style_tag=sinatra_get_style_tag("sinatra_sidebar_widget_title_font_size");var style_css="";style_css+=sinatra_range_field_css("#main .widget-title","font-size",newval,!0,newval.unit),$style_tag.html(style_css)}}))})),api("sinatra_footer_widget_title_font_size",(function(value){value.bind((function(newval){if($("#colophon .widget-title").length){$style_tag=sinatra_get_style_tag("sinatra_footer_widget_title_font_size");var style_css="";style_css+=sinatra_range_field_css("#colophon .widget-title","font-size",newval,!0,newval.unit),$style_tag.html(style_css)}}))})),api("sinatra_page_header_font_size",(function(value){value.bind((function(newval){if($(".page-header .page-title").length){$style_tag=sinatra_get_style_tag("sinatra_page_header_font_size");var style_css="";style_css+=sinatra_range_field_css("#page .page-header .page-title","font-size",newval,!0,newval.unit),$style_tag.html(style_css)}}))}));var $btn_selectors=".si-btn, body:not(.wp-customizer) input[type=submit], .site-main .woocommerce #respond input#submit, .site-main .woocommerce a.button, .site-main .woocommerce button.button, .site-main .woocommerce input.button, .woocommerce ul.products li.product .added_to_cart, .woocommerce ul.products li.product .button, .woocommerce div.product form.cart .button, .woocommerce #review_form #respond .form-submit input, #infinite-handle span",$btn_hover_selectors=".si-btn:hover, .si-btn:focus, body:not(.wp-customizer) input[type=submit]:hover, body:not(.wp-customizer) input[type=submit]:focus, .site-main .woocommerce #respond input#submit:hover, .site-main .woocommerce #respond input#submit:focus, .site-main .woocommerce a.button:hover, .site-main .woocommerce a.button:focus, .site-main .woocommerce button.button:hover, .site-main .woocommerce button.button:focus, .site-main .woocommerce input.button:hover, .site-main .woocommerce input.button:focus, .woocommerce ul.products li.product .added_to_cart:hover, .woocommerce ul.products li.product .added_to_cart:focus, .woocommerce ul.products li.product .button:hover, .woocommerce ul.products li.product .button:focus, .woocommerce div.product form.cart .button:hover, .woocommerce div.product form.cart .button:focus, .woocommerce #review_form #respond .form-submit input:hover, .woocommerce #review_form #respond .form-submit input:focus, #infinite-handle span:hover";api("sinatra_primary_button_bg_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_bg_color");var style_css="";newval&&(style_css=$btn_selectors+"{ background-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_hover_bg_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_hover_bg_color");var style_css="";newval&&(style_css=$btn_hover_selectors+" { background-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_text_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_text_color");var style_css="";newval&&(style_css=$btn_selectors+" { color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_hover_text_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_hover_text_color");var style_css="";newval&&(style_css=$btn_hover_selectors+" { color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_border_width",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_border_width");var style_css="";newval&&(style_css=$btn_selectors+" { border-width: "+newval.value+"px; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_border_radius",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_border_radius");var style_css="";newval&&(style_css=$btn_selectors+" { border-top-left-radius: "+newval["top-left"]+"px;border-top-right-radius: "+newval["top-right"]+"px;border-bottom-left-radius: "+newval["bottom-left"]+"px;border-bottom-right-radius: "+newval["bottom-right"]+"px; }",console.log(style_css)),$style_tag.html(style_css)}))})),api("sinatra_primary_button_border_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_border_color");var style_css="";newval&&(style_css=$btn_selectors+" { border-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_hover_border_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_hover_border_color");var style_css="";newval&&(style_css=$btn_hover_selectors+" { border-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_primary_button_typography",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_primary_button_typography");var style_css=sinatra_typography_field_css($btn_selectors,newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))}));var $btn_sec_selectors=".btn-secondary, .si-btn.btn-secondary",$btn_sec_hover_selectors=".btn-secondary:hover, .btn-secondary:focus, .si-btn.btn-secondary:hover, .si-btn.btn-secondary:focus";api("sinatra_secondary_button_bg_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_bg_color");var style_css="";newval&&(style_css=$btn_sec_selectors+"{ background-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_hover_bg_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_hover_bg_color");var style_css="";newval&&(style_css=$btn_sec_hover_selectors+"{ background-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_text_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_text_color");var style_css="";newval&&(style_css=$btn_sec_selectors+"{ color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_hover_text_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_hover_text_color");var style_css="";newval&&(style_css=$btn_sec_hover_selectors+"{ color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_border_width",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_border_width");var style_css="";newval&&(style_css=$btn_sec_selectors+" { border-width: "+newval.value+"px; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_border_radius",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_border_radius");var style_css="";newval&&(style_css=$btn_sec_selectors+" { border-top-left-radius: "+newval["top-left"]+"px;border-top-right-radius: "+newval["top-right"]+"px;border-bottom-left-radius: "+newval["bottom-left"]+"px;border-bottom-right-radius: "+newval["bottom-right"]+"px; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_border_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_border_color");var style_css="";newval&&(style_css=$btn_sec_selectors+" { border-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_hover_border_color",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_hover_border_color");var style_css="";newval&&(style_css=$btn_sec_hover_selectors+" { border-color: "+newval+"; }"),$style_tag.html(style_css)}))})),api("sinatra_secondary_button_typography",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_secondary_button_typography");var style_css=sinatra_typography_field_css($btn_sec_selectors,newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))}));api("sinatra_text_button_text_color",(function(value){value.bind((function(newval){var style_css="";newval&&(style_css=".si-btn.btn-text-1, .btn-text-1{ color: "+newval+"; }"),($style_tag=sinatra_get_style_tag("sinatra_text_button_text_color")).html(style_css)}))})),api("sinatra_text_button_hover_text_color",(function(value){value.bind((function(newval){var style_css="";newval&&(style_css=".si-btn.btn-text-1:hover, .si-btn.btn-text-1:focus, .btn-text-1:hover, .btn-text-1:focus{ color: "+newval+"; }",style_css+=".si-btn.btn-text-1 > span::before { background-color: "+newval+" }"),($style_tag=sinatra_get_style_tag("sinatra_text_button_hover_text_color")).html(style_css)}))})),api("sinatra_text_button_typography",(function(value){value.bind((function(newval){$style_tag=sinatra_get_style_tag("sinatra_text_button_typography");var style_css=sinatra_typography_field_css(".si-btn.btn-text-1, .btn-text-1",newval);sinatra_enqueue_google_font(newval["font-family"]),$style_tag.html(style_css)}))})),api.selectiveRefresh&&api.selectiveRefresh.bind("partial-content-rendered",(function(placement){"sinatra_hero_hover_slider_post_number"!==placement.partial.id&&"sinatra_hero_hover_slider_elements"!==placement.partial.id||(document.querySelectorAll(placement.partial.params.selector).forEach(item=>{sinatraHoverSlider(item)}),api("sinatra_hero_hover_slider_height",(function(newval){newval.callbacks.fireWith(newval,[newval.get()])}))),"sinatra_preloader_style"===placement.partial.id&&($body.removeClass("si-loaded"),setTimeout((function(){window.sinatra.preloader()}),300))})),api.sinatraCustomizerPreview={init:function(){var self=this;self.preview.body.on("click",".sinatra-set-widget",(function(){self.preview.send("set-footer-widget",$(this).data("sidebar-id"))}))}};var sinatraOldPreview=api.Preview;api.Preview=sinatraOldPreview.extend({initialize:function(params,options){api.sinatraCustomizerPreview.preview=this,sinatraOldPreview.prototype.initialize.call(this,params,options)}}),$((function(){api.sinatraCustomizerPreview.init()}))}(jQuery);;customizer/assets/js/dev/customize-controls.js000064400000013324151231536700015673 0ustar00;( function( api, $ ) { // Extends our custom "sinatra-info" section. Make it visible. api.sectionConstructor[ 'sinatra-info' ] = api.Section.extend( { // No events for this type of section. attachEvents: function () {}, // Always make the section active. isContextuallyActive: function () { return true; } } ); // Custom Customizer Previewer class. api.sinatraCustomizerPreviewer = { init: function () { var self = this, control; // Listen to the "set-footer-widget" event. this.preview.bind( 'set-footer-widget', function( data ) { // Focus control. control = api.control( 'sidebars_widgets[' + data + ']' ); control.focus(); // Open widgets panel. api.Widgets.availableWidgetsPanel.open( control ); } ); // Listen to the "set-footer-widget" event. this.preview.bind( 'set-navigation-widget', function( data ) { // Focus control. control = api.control( 'nav_menu_locations[' + data + ']' ); control.focus(); } ); } }; // Store old previewer. var sinatraOldPreviewer = api.Previewer; api.Previewer = sinatraOldPreviewer.extend( { initialize: function( params, options ) { // Store a reference to the Previewer api.sinatraCustomizerPreviewer.preview = this; // Call the old Previewer's initialize function sinatraOldPreviewer.prototype.initialize.call( this, params, options ); } } ); // Change preview url for certain sections. _.each( sinatra_customizer_localized.preview_url_for_section, function( url, id ) { if ( url ) { wp.customize.section( id, function ( section ) { section.expanded.bind( function ( isExpanded ) { if ( isExpanded ) { wp.customize.previewer.previewUrl.set( url ); } }); }); } } ); $( document ).ready( function($) { // Initialize our Previewer api.sinatraCustomizerPreviewer.init(); // Display the first responsive control $( '.sinatra-control-responsive' ).each( function(){ $( this ).find('.control-responsive').first().addClass( 'active' ); } ); // Responsive switchers $( '.customize-control' ).on( 'click', '.sinatra-responsive-switchers span', function( event ) { var $this = $(this), $switcher_container = $this.closest( '.sinatra-responsive-switchers' ), $switcher_buttons = $switcher_container.find( 'li span' ), $device = $( event.currentTarget ).data( 'device' ), $control = $( '.sinatra-control-responsive' ), $body = $( '.wp-full-overlay' ), $footer_devices = $( '.wp-full-overlay-footer .devices' ); if ( ! $switcher_container.hasClass( 'expanded' ) ) { $switcher_container.addClass( 'expanded' ); $this.addClass( 'active' ); } else { if ( $this.parent().is( ':first-child' ) ) { if ( $this.hasClass( 'active' ) ) { $switcher_container.removeClass( 'expanded' ); $this.removeClass( 'active' ); } else { $switcher_buttons.removeClass( 'active' ); $this.addClass( 'active' ); } } else { $switcher_buttons.removeClass( 'active' ); $this.addClass( 'active' ); } } // Control class $control.find( '.control-responsive' ).removeClass( 'active' ); $control.find( '.control-responsive.' + $device ).addClass( 'active' ); $control.removeClass( 'control-device-desktop control-device-tablet control-device-mobile' ).addClass( 'control-device-' + $device ); // Wrapper class $body.removeClass( 'preview-desktop preview-tablet preview-mobile' ).addClass( 'preview-' + $device ); // Panel footer buttons $footer_devices.find( 'button' ).removeClass( 'active' ).attr( 'aria-pressed', false ); $footer_devices.find( 'button.preview-' + $device ).addClass( 'active' ).attr( 'aria-pressed', true ); }); // If panel footer buttons clicked $( '.wp-full-overlay-footer .devices button' ).on( 'click', function( event ) { // Set up variables var $this = $( this ), $devices = $( '.customize-control .sinatra-responsive-switchers' ), $device = $( event.currentTarget ).data( 'device' ), $control = $( '.sinatra-control-responsive' ); // Button class $devices.find( 'span' ).removeClass( 'active' ); $devices.find( 'span.preview-' + $device ).addClass( 'active' ); // Add expanded class if ( 'desktop' === $device ) { $devices.removeClass( 'expanded' ); } else { $devices.addClass( 'expanded' ); } // Control class $control.find( '.control-responsive' ).removeClass( 'active' ); $control.find( '.control-responsive.' + $device ).addClass( 'active' ); $control.removeClass( 'control-device-desktop control-device-tablet control-device-mobile' ).addClass( 'control-device-' + $device ); }); // Tooltip positioning if ( $( '.sinatra-tooltip' ).length ) { var $tooltip, $icon_pos_l, $icon_pos_r, $title_width; $( '.sinatra-tooltip' ).each( function() { $tooltip = $(this); if ( $tooltip.hasClass('top-right-tooltip') || $tooltip.hasClass('small-tooltip') ) { return; } $title_width = $tooltip.closest( '.sinatra-control-wrapper' ).outerWidth(); $icon_pos_l = $tooltip.closest('.sinatra-info-icon').css('position', 'static').position().left; $icon_pos_r = $title_width - $icon_pos_l; if ( $icon_pos_l < $icon_pos_r ) { $tooltip[0].style.setProperty( "--tooltip-left", Math.min( 104, $icon_pos_l ) + 'px' ); $tooltip.css( 'left', Math.max(0, $icon_pos_l - 104) ); } else { $tooltip.css( 'left', Math.min( $icon_pos_l - 90, $title_width - 208 ) ); if ( $icon_pos_l < ( $title_width - 104 ) ) { $tooltip[0].style.setProperty( "--tooltip-left", '90px' ); } else { $tooltip[0].style.setProperty( "--tooltip-left", ( $icon_pos_l - 178 ) + 'px' ); } } }); } }); } )( wp.customize, jQuery );;customizer/assets/js/dev/customize-dependency.js000064400000012653151231536700016152 0ustar00;( function( $ ) { "use strict"; var sinatraDependencies = { listenTo: {}, init: function() { var self = this; // Initialize visibility on load wp.customize.control.each( function( control ) { self.showSinatraControl( control ); }); _.each( self.listenTo, function( slaves, master ) { _.each( slaves, function( slave ) { wp.customize( master, function( setting ) { var setupControl = function( control ) { var setActiveState, isDisplayed; isDisplayed = function() { return self.showSinatraControl( wp.customize.control( slave ) ); }; setActiveState = function() { control.active.set( isDisplayed() ); }; setActiveState(); setting.bind( setActiveState ); control.active.validate = isDisplayed; }; wp.customize.control( slave, setupControl ); } ); } ); }); }, /** * Should we show the control? * * @since 1.0.0 * @param {string|object} control - The control-id or the control object. * @returns {bool} */ showSinatraControl: function( control ) { var self = this, show = true, i; if ( _.isString( control ) ) { control = wp.customize.control( control ); } // Exit early if control not found or if "required" argument is not defined. if ( 'undefined' === typeof control || ( control.params && _.isEmpty( control.params.required ) ) ) { return true; } // Loop control requirements. for ( i = 0; i < control.params.required.length; i++ ) { if ( ! self.checkCondition( control.params.required[ i ], control, 'AND' ) ) { show = false; } } return show; }, /** * Check a condition. * * @since 1.0.0 * @param {Object} requirement - The requirement, inherited from showSinatraControl. * @param {Object} control - The control object. * @param {string} relation - Can be one of 'AND' or 'OR'. */ checkCondition: function( requirement, control, relation ) { var self = this, childRelation = ( 'AND' === relation ) ? 'OR' : 'AND', nestedItems, i; // If an array of other requirements nested, we need to process them separately. if ( 'undefined' !== typeof requirement[0] && 'undefined' === typeof requirement.control ) { nestedItems = []; // Loop sub-requirements. for ( i = 0; i < requirement.length; i++ ) { nestedItems.push( self.checkCondition( requirement[ i ], control, childRelation ) ); } // OR relation. Check that true is part of the array. if ( 'OR' === childRelation ) { return ( -1 !== nestedItems.indexOf( true ) ); } // AND relation. Check that false is not part of the array. return ( -1 === nestedItems.indexOf( false ) ); } // Early exit if setting is not defined. if ( 'undefined' === typeof wp.customize.control( requirement.control ) ) { return true; } self.listenTo[ requirement.control ] = self.listenTo[ requirement.control ] || []; if ( -1 === self.listenTo[ requirement.control ].indexOf( control.id ) ) { self.listenTo[ requirement.control ].push( control.id ); } return self.evaluate( requirement.value, wp.customize.control( requirement.control ).setting._value, requirement.operator ); }, /** * Figure out if the 2 values have the relation we want. * * @since 1.0.0 * @param {mixed} value1 - The 1st value. * @param {mixed} value2 - The 2nd value. * @param {string} operator - The comparison to use. * @returns {bool} */ evaluate: function( value1, value2, operator ) { var found = false; if ( '===' === operator ) { return value1 === value2; } if ( '==' === operator || '=' === operator || 'equals' === operator || 'equal' === operator ) { return value1 == value2; } if ( '!==' === operator ) { return value1 !== value2; } if ( '!=' === operator || 'not equal' === operator ) { return value1 != value2; } if ( '>=' === operator || 'greater or equal' === operator || 'equal or greater' === operator ) { return value2 >= value1; } if ( '<=' === operator || 'smaller or equal' === operator || 'equal or smaller' === operator ) { return value2 <= value1; } if ( '>' === operator || 'greater' === operator ) { return value2 > value1; } if ( '<' === operator || 'smaller' === operator ) { return value2 < value1; } if ( 'contains' === operator || 'in' === operator ) { if ( _.isArray( value1 ) && _.isArray( value2 ) ) { _.each( value2, function( value ) { if ( value1.includes( value ) ) { found = true; return false; } } ); return found; } if ( _.isArray( value2 ) ) { _.each( value2, function( value ) { if ( value == value1 ) { // jshint ignore:line found = true; } } ); return found; } if ( _.isObject( value2 ) ) { if ( ! _.isUndefined( value2[ value1 ] ) ) { found = true; } _.each( value2, function( subValue ) { if ( value1 === subValue ) { found = true; } } ); return found; } if ( _.isString( value2 ) ) { if ( _.isString( value1 ) ) { return ( -1 < value1.indexOf( value2 ) && -1 < value2.indexOf( value1 ) ); } return -1 < value1.indexOf( value2 ); } } return value1 == value2; }, }; // END var sinatraDependencies $( document ).ready( function() { sinatraDependencies.init(); }); } )( jQuery );;customizer/assets/js/dev/customize-preview.js000064400000304373151231536700015520 0ustar00/** * Update Customizer settings live. * * @since 1.0.0 */ ;( function( $ ) { "use strict"; // Declare variables var api = wp.customize, $body = $( 'body' ), $head = $( 'head' ), $style_tag, $link_tag, sinatra_visibility_classes = 'sinatra-hide-mobile sinatra-hide-tablet sinatra-hide-mobile-tablet', sinatra_style_tag_collection = [], sinatra_link_tag_collection = []; /** * Helper function to get style tag with id. */ function sinatra_get_style_tag( id ) { if ( sinatra_style_tag_collection[ id ] ) { return sinatra_style_tag_collection[ id ]; } $style_tag = $( 'head' ).find( '#sinatra-dynamic-' + id ); if ( ! $style_tag.length ) { $( 'head' ).append( '' ); $style_tag = $( 'head' ).find( '#sinatra-dynamic-' + id ); } sinatra_style_tag_collection[ id ] = $style_tag; return $style_tag; } /** * Helper function to get link tag with id. */ function sinatra_get_link_tag( id, url ) { if ( sinatra_link_tag_collection[ id ] ) { return sinatra_link_tag_collection[ id ]; } $link_tag = $( 'head' ).find( '#sinatra-dynamic-link-' + id ); if ( ! $link_tag.length ) { $( 'head' ).append( '' ); $link_tag = $( 'head' ).find( '#sinatra-dynamic-link-' + id ); } else { $link_tag.attr( 'href', url ); } sinatra_link_tag_collection[ id ] = $link_tag; return $link_tag; } /* * Helper function to print visibility classes. */ function sinatra_print_visibility_classes( $element, newval ) { if ( ! $element.length ) { return; } $element.removeClass( sinatra_visibility_classes ); if ( 'all' !== newval ) { $element.addClass( 'sinatra-' + newval ); } } /* * Helper function to convert hex to rgba. */ function sinatra_hex2rgba( hex, opacity ) { if ( 'rgba' === hex.substring(0, 4) ) { return hex; } // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF"). var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; hex = hex.replace( shorthandRegex, function(m, r, g, b) { return r + r + g + g + b + b; } ); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec( hex ); if ( opacity ) { if ( opacity > 1 ) { opacity = 1; } opacity = ',' + opacity; } if ( result ) { return 'rgba(' + parseInt(result[1], 16) + ',' + parseInt(result[2], 16) + ',' + parseInt(result[3], 16) + opacity + ')'; } return false; } /** * Helper function to lighten or darken the provided hex color. */ function sinatra_luminance( hex, percent ) { // Convert RGB color to HEX. if ( hex.includes( 'rgb' ) ) { hex = sinatra_rgba2hex( hex ); } // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF"). var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; hex = hex.replace( shorthandRegex, function(m, r, g, b) { return r + r + g + g + b + b; } ); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec( hex ); var isColor = /^#[0-9A-F]{6}$/i.test( hex ); if ( ! isColor ) { return hex; } var from, to; for ( var i = 1; i <= 3; i++ ) { result[i] = parseInt( result[i], 16 ); from = percent < 0 ? 0 : result[i]; to = percent < 0 ? result[i] : 255; result[i] = result[i] + Math.ceil( (to - from) * percent ); } result = '#' + sinatra_dec2hex( result[1] ) + sinatra_dec2hex( result[2] ) + sinatra_dec2hex( result[3] ); return result; } /** * Convert dec to hex. */ function sinatra_dec2hex( c ) { var hex = c.toString(16); return hex.length == 1 ? "0" + hex : hex; } /** * Convert rgb to hex. */ function sinatra_rgba2hex( c ) { var a, x; a = c.split("(")[1].split(")")[0].trim(); a = a.split(","); var result = ''; for ( var i = 0; i < 3; i++ ) { x = parseInt( a[i] ).toString(16); result += ( 1 === x.length ) ? "0" + x : x; } if ( result ) { return '#' + result; } return false; } /** * Check if is light color. */ function sinatra_is_light_color( color = '' ) { var r,g,b, brightness; if ( color.match(/^rgb/) ) { color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/); r = color[1]; g = color[2]; b = color[3]; } else { color = +("0x" + color.slice(1).replace( color.length < 5 && /./g, '$&$&' ) ); r = color >> 16; g = color >> 8 & 255; b = color & 255; } brightness = ( r * 299 + g * 587 + b * 114 ) / 1000; return brightness > 137; } /** * Detect if we should use a light or dark color on a background color. */ function sinatra_light_or_dark( color, dark = '#000000', light = '#FFFFFF' ) { return sinatra_is_light_color( color ) ? dark : light; } /** * Spacing field CSS. */ function sinatra_spacing_field_css( selector, property, setting, responsive ) { if ( ! Array.isArray( setting ) && 'object' !== typeof( setting ) ) { return; } // Set up unit. var unit = 'px', css = ''; if ( 'unit' in setting ) { unit = setting.unit; } var before = '', after = ''; Object.keys(setting).forEach(function (index, el) { if ( 'unit' === index ) { return; } if ( responsive ) { if ( 'tablet' === index ) { before = '@media only screen and (max-width: 768px) {'; after = '}'; } else if ( 'mobile' === index ) { before = '@media only screen and (max-width: 480px) {'; after = '}'; } else { before = ''; after = ''; } css += before + selector + '{'; Object.keys( setting[index] ).forEach( function ( position ) { if ( 'border' === property ) { position += '-width'; } if ( setting[index][position] ) { css += property + '-' + position + ': ' + setting[index][position] + unit + ';'; } }); css += '}' + after; } else { if ( 'border' === property ) { index += '-width'; } css += property + '-' + index + ': ' + setting[index] + unit + ';'; } }); if ( ! responsive ) { css = selector + '{' + css + '}'; } return css; } /** * Range field CSS. */ function sinatra_range_field_css( selector, property, setting, responsive, unit ) { var css = '', before = '', after = ''; if ( responsive && ( Array.isArray( setting ) || 'object' === typeof( setting ) ) ) { Object.keys(setting).forEach(function (index, el) { if ( setting[index] ) { if ( 'tablet' === index ) { before = '@media only screen and (max-width: 768px) {'; after = '}'; } else if ( 'mobile' === index ) { before = '@media only screen and (max-width: 480px) {'; after = '}'; } else if ( 'desktop' === index ) { before = ''; after = ''; } else { return; } css += before + selector + '{' + property + ': ' + setting[index] + unit + '; }' + after; } }); } if ( ! responsive ) { if ( setting.value ) { setting = setting.value; } else { setting = 0; } css = selector + '{' + property + ': ' + setting + unit + '; }'; } return css; } /** * Typography field CSS. */ function sinatra_typography_field_css( selector, setting ) { var css = ''; css += selector + '{'; if ( 'default' === setting['font-family'] ) { css += 'font-family: ' + sinatra_customizer_preview.default_system_font + ';'; } else if ( setting['font-family'] in sinatra_customizer_preview.fonts.standard_fonts.fonts ) { css += 'font-family: ' + sinatra_customizer_preview.fonts.standard_fonts.fonts[ setting['font-family'] ]['fallback'] + ';'; } else if ( 'inherit' !== setting['font-family'] ) { css += 'font-family: "' + setting['font-family'] + '";'; } css += 'font-weight:' + setting['font-weight'] + ';'; css += 'font-style:' + setting['font-style'] + ';'; css += 'text-transform:' + setting['text-transform'] + ';'; if ( 'text-decoration' in setting ) { css += 'text-decoration:' + setting['text-decoration'] + ';'; } if ( 'letter-spacing' in setting ) { css += 'letter-spacing:' + setting['letter-spacing'] + setting['letter-spacing-unit'] + ';'; } if ( 'line-height-desktop' in setting ) { css += 'line-height:' + setting['line-height-desktop'] + ';'; } if ( 'font-size-desktop' in setting && 'font-size-unit' in setting ) { css += 'font-size:' + setting['font-size-desktop'] + setting['font-size-unit'] + ';'; } css += '}'; if ( 'font-size-tablet' in setting && setting['font-size-tablet'] ) { css += '@media only screen and (max-width: 768px) {' + selector + '{' + 'font-size: ' + setting['font-size-tablet'] + setting['font-size-unit'] + ';' + '}' + '}'; } if ( 'line-height-tablet' in setting && setting['line-height-tablet'] ) { css += '@media only screen and (max-width: 768px) {' + selector + '{' + 'line-height:' + setting['line-height-tablet'] + ';' + '}' + '}'; } if ( 'font-size-mobile' in setting && setting['font-size-mobile'] ) { css += '@media only screen and (max-width: 480px) {' + selector + '{' + 'font-size: ' + setting['font-size-mobile'] + setting['font-size-unit'] + ';' + '}' + '}'; } if ( 'line-height-mobile' in setting && setting['line-height-mobile'] ) { css += '@media only screen and (max-width: 480px) {' + selector + '{' + 'line-height:' + setting['line-height-mobile'] + ';' + '}' + '}'; } return css; } /** * Load google font. */ function sinatra_enqueue_google_font( font ) { if ( sinatra_customizer_preview.fonts.google_fonts.fonts[ font ] ) { var id = 'google-font-' + font.trim().toLowerCase().replace( ' ', '-' ); var url = sinatra_customizer_preview.google_fonts_url + '/css?family=' + font + ":" + sinatra_customizer_preview.google_font_weights; var tag = sinatra_get_link_tag( id, url ); } } /** * Design Options field CSS. */ function sinatra_design_options_css( selector, setting, type ) { var css = '', before = '', after = ''; if ( 'background' === type ) { var bg_type = setting['background-type']; css += selector + '{'; if ( 'color' === bg_type ) { setting['background-color'] = setting['background-color'] ? setting['background-color'] : 'inherit'; css += 'background: ' + setting['background-color'] + ';'; } else if ( 'gradient' === bg_type ) { css += 'background: ' + setting['gradient-color-1'] + ';'; if ( 'linear' === setting['gradient-type'] ) { css += 'background: -webkit-linear-gradient(' + setting['gradient-linear-angle'] + 'deg, ' + setting['gradient-color-1'] + ' ' + setting['gradient-color-1-location'] + '%, ' + setting['gradient-color-2'] + ' ' + setting['gradient-color-2-location'] + '%);' + 'background: -o-linear-gradient(' + setting['gradient-linear-angle'] + 'deg, ' + setting['gradient-color-1'] + ' ' + setting['gradient-color-1-location'] + '%, ' + setting['gradient-color-2'] + ' ' + setting['gradient-color-2-location'] + '%);' + 'background: linear-gradient(' + setting['gradient-linear-angle'] + 'deg, ' + setting['gradient-color-1'] + ' ' + setting['gradient-color-1-location'] + '%, ' + setting['gradient-color-2'] + ' ' + setting['gradient-color-2-location'] + '%);'; } else if ( 'radial' === setting['gradient-type'] ) { css += 'background: -webkit-radial-gradient(' + setting['gradient-position'] + ', circle, ' + setting['gradient-color-1'] + ' ' + setting['gradient-color-1-location'] + '%, ' + setting['gradient-color-2'] + ' ' + setting['gradient-color-2-location'] + '%);' + 'background: -o-radial-gradient(' + setting['gradient-position'] + ', circle, ' + setting['gradient-color-1'] + ' ' + setting['gradient-color-1-location'] + '%, ' + setting['gradient-color-2'] + ' ' + setting['gradient-color-2-location'] + '%);' + 'background: radial-gradient(circle at ' + setting['gradient-position'] + ', ' + setting['gradient-color-1'] + ' ' + setting['gradient-color-1-location'] + '%, ' + setting['gradient-color-2'] + ' ' + setting['gradient-color-2-location'] + '%);'; } } else if ( 'image' === bg_type ) { css += '' + 'background-image: url(' + setting['background-image'] + ');' + 'background-size: ' + setting['background-size'] + ';' + 'background-attachment: ' + setting['background-attachment'] + ';' + 'background-position: ' + setting['background-position-x'] + '% ' + setting['background-position-y'] + '%;' + 'background-repeat: ' + setting['background-repeat'] + ';'; } css += '}'; // Background image color overlay. if ( 'image' === bg_type && setting['background-color-overlay'] && setting['background-image'] ) { css += selector + '::after { background-color: ' + setting['background-color-overlay'] + '; }'; } else { css += selector + '::after { background-color: initial; }'; } } else if ( 'color' === type ) { setting['text-color'] = setting['text-color'] ? setting['text-color'] : 'inherit'; setting['link-color'] = setting['link-color'] ? setting['link-color'] : 'inherit'; setting['link-hover-color'] = setting['link-hover-color'] ? setting['link-hover-color'] : 'inherit'; css += selector + ' { color: ' + setting['text-color'] + '; }'; css += selector + ' a { color: ' + setting['link-color'] + '; }'; css += selector + ' a:hover { color: ' + setting['link-hover-color'] + ' !important; }'; } else if ( 'border' === type ) { setting['border-color'] = setting['border-color'] ? setting['border-color'] : 'inherit'; setting['border-style'] = setting['border-style'] ? setting['border-style'] : 'solid'; setting['border-left-width'] = setting['border-left-width'] ? setting['border-left-width'] : 0; setting['border-top-width'] = setting['border-top-width'] ? setting['border-top-width'] : 0; setting['border-right-width'] = setting['border-right-width'] ? setting['border-right-width'] : 0; setting['border-bottom-width'] = setting['border-bottom-width'] ? setting['border-bottom-width'] : 0; css += selector + '{'; css += 'border-color: ' + setting['border-color'] + ';'; css += 'border-style: ' + setting['border-style'] + ';'; css += 'border-left-width: ' + setting['border-left-width'] + 'px;'; css += 'border-top-width: ' + setting['border-top-width'] + 'px;'; css += 'border-right-width: ' + setting['border-right-width'] + 'px;'; css += 'border-bottom-width: ' + setting['border-bottom-width'] + 'px;'; css += '}'; } else if ( 'separator_color' === type ) { css += selector + ':after{ background-color: ' + setting['separator-color'] + '; }'; } return css; } /** * Logo max height. */ api( 'sinatra_logo_max_height', function( value ) { value.bind( function( newval ) { var $logo = $( '.sinatra-logo' ); if ( ! $logo.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_logo_max_height' ); var style_css = ''; style_css += sinatra_range_field_css( '.sinatra-logo img', 'max-height', newval, true, 'px' ); style_css += sinatra_range_field_css( '.sinatra-logo img.si-svg-logo', 'height', newval, true, 'px' ); $style_tag.html( style_css ); }); }); /** * Logo text font size. */ api( 'sinatra_logo_text_font_size', function( value ) { value.bind( function( newval ) { var $logo = $( '#sinatra-header .sinatra-logo .site-title' ); if ( ! $logo.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_logo_text_font_size' ); var style_css = ''; style_css += sinatra_range_field_css( '#sinatra-header .sinatra-logo .site-title', 'font-size', newval, true, newval.unit ); $style_tag.html( style_css ); }); }); /** * Logo margin. */ api( 'sinatra_logo_margin', function( value ) { value.bind( function( newval ) { var $logo = $( '.sinatra-logo' ); if ( ! $logo.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_logo_margin' ); var style_css = sinatra_spacing_field_css( '.sinatra-logo .logo-inner', 'margin', newval, true ); $style_tag.html( style_css ); }); }); /** * Tagline. */ api( 'blogdescription', function( value ) { value.bind( function( newval ) { if ( $( '.sinatra-logo' ).find( '.site-description' ).length ) { $( '.sinatra-logo' ).find( '.site-description' ).html( newval ); } }); }); /** * Site Title. */ api( 'blogname', function( value ) { value.bind( function( newval ) { if ( $( '.sinatra-logo' ).find( '.site-title' ).length ) { $( '.sinatra-logo' ).find( '.site-title' ).find( 'a' ).html( newval ); } }); }); /** * Site Layout. */ api( 'sinatra_site_layout', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)sinatra-layout__\S+/g) || []).join(' '); }); $body.addClass( 'sinatra-layout__' + newval ); }); }); /** * Sticky Sidebar. */ api( 'sinatra_sidebar_sticky', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)si-sticky-\S+/g) || []).join(' '); }); if ( newval ) { $body.addClass( 'si-sticky-' + newval ); } }); }); /** * Sidebar width. */ api( 'sinatra_sidebar_width', function( value ) { value.bind( function( newval ) { var $sidebar = $( '#secondary' ); if ( ! $sidebar.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_sidebar_width' ); var style_css = '#secondary { width: ' + newval.value + '%; }'; style_css += 'body:not(.sinatra-no-sidebar) #primary { ' + 'max-width: ' + ( 100 - parseInt( newval.value ) ) + '%;' + '};'; $style_tag.html( style_css ); }); }); /** * Sidebar style. */ api( 'sinatra_sidebar_style', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)sinatra-sidebar-style-\S+/g) || []).join(' '); }); $body.addClass( 'sinatra-sidebar-style-' + newval ); }); }); /** * Responsive sidebar position. */ api( 'sinatra_sidebar_responsive_position', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)si-sidebar-r__\S+/g) || []).join(' '); }); if ( newval ) { $body.addClass( 'si-sidebar-r__' + newval ); } }); }); /** * Featured Image Position (Horizontal Blog layout) */ api( 'sinatra_blog_image_position', function( value ) { value.bind( function( newval ) { $('.si-blog-entry-wrapper').removeClass( function (index, className) { return (className.match (/(^|\s)si-thumb-\S+/g) || []).join(' '); }); $('.si-blog-entry-wrapper').addClass( 'si-thumb-' + newval ); }); }); /** * Single page - title in header alignment. */ api( 'sinatra_single_title_alignment', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)si-page-title-align-\S+/g) || []).join(' '); }); $body.addClass( 'si-page-title-align-' + newval ); }); }); /** * Single Page title spacing. */ api( 'sinatra_single_title_spacing', function( value ) { value.bind( function( newval ) { var $page_header = $( '.page-header' ); if ( ! $page_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_single_title_spacing' ); var style_css = sinatra_spacing_field_css( '.si-single-title-in-page-header #page .page-header .si-page-header-wrapper', 'padding', newval, true ); $style_tag.html( style_css ); }); }); /** * Single post narrow container width. */ api( 'sinatra_single_narrow_container_width', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_single_narrow_container_width' ); var style_css = ''; style_css += '.single-post.narrow-content .entry-content > :not([class*="align"]):not([class*="gallery"]):not(.wp-block-image):not(.quote-inner):not(.quote-post-bg), ' + '.single-post.narrow-content .mce-content-body:not([class*="page-template-full-width"]) > :not([class*="align"]):not([data-wpview-type*="gallery"]):not(blockquote):not(.mceTemp), ' + '.single-post.narrow-content .entry-footer, ' + '.single-post.narrow-content .post-nav, ' + '.single-post.narrow-content .entry-content > .alignwide, ' + '.single-post.narrow-content p.has-background:not(.alignfull):not(.alignwide)' + '.single-post.narrow-content #sinatra-comments-toggle, ' + '.single-post.narrow-content #comments, ' + '.single-post.narrow-content .entry-content .aligncenter, ' + '.single-post.narrow-content .si-narrow-element, ' + '.single-post.narrow-content.si-single-title-in-content .entry-header, ' + '.single-post.narrow-content.si-single-title-in-content .entry-meta, ' + '.single-post.narrow-content.si-single-title-in-content .post-category, ' + '.single-post.narrow-content.sinatra-no-sidebar .si-page-header-wrapper, ' + '.single-post.narrow-content.sinatra-no-sidebar .si-breadcrumbs > .si-container > nav {' + 'max-width: ' + parseInt( newval.value ) + 'px; margin-left: auto; margin-right: auto; ' + '}'; style_css += '.single-post.narrow-content .author-box, ' + '.single-post.narrow-content .entry-content > .alignwide { ' + 'max-width: ' + ( parseInt( newval.value ) + 70 ) + 'px;' + '}'; $style_tag.html( style_css ); }); }); /** * Single post content font size. */ api( 'sinatra_single_content_font_size', function( value ) { value.bind( function( newval ) { var $content = $( '.single-post' ); if ( ! $content.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_single_content_font_size' ); var style_css = ''; style_css += sinatra_range_field_css( '.single-post .entry-content', 'font-size', newval, true, newval.unit ); $style_tag.html( style_css ); }); }); /** * Header container width. */ api( 'sinatra_header_container_width', function( value ) { value.bind( function( newval ) { var $header = $( '#sinatra-header' ); if ( ! $header.length ) { return; } if ( 'full-width' === newval ) { $header.addClass( 'si-container__wide' ); } else { $header.removeClass( 'si-container__wide' ); } }); }); /** * Main navigation disply breakpoint. */ api( 'sinatra_main_nav_mobile_breakpoint', function( value ) { value.bind( function( newval ) { var $nav = $( '#sinatra-header-inner .sinatra-nav' ); if ( ! $nav.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_main_nav_mobile_breakpoint' ); var style_css = ''; style_css += '@media screen and (min-width: ' + parseInt( newval ) + 'px) {#sinatra-header-inner .sinatra-nav {display:flex} .si-mobile-nav {display:none;} }'; style_css += '@media screen and (max-width: ' + parseInt( newval ) + 'px) {#sinatra-header-inner .sinatra-nav {display:none} .si-mobile-nav {display:inline-flex;} }'; $style_tag.html( style_css ); }); }); /** * Mobile Menu Button Label. */ api( 'sinatra_main_nav_mobile_label', function( value ) { value.bind( function( newval ) { if ( $( '.si-hamburger-sinatra-primary-nav' ).find( '.hamburger-label' ).length ) { $( '.si-hamburger-sinatra-primary-nav' ).find( '.hamburger-label' ).html( newval ); } }); }); /** * Main Nav Font color. */ api( 'sinatra_main_nav_font_color', function( value ) { value.bind( function( newval ) { var $navigation = $( '#sinatra-header-inner .sinatra-nav' ); if ( ! $navigation.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_main_nav_font_color' ); var style_css = ''; // Link color. newval['link-color'] = newval['link-color'] ? newval['link-color'] : 'inherit'; style_css += '#sinatra-header-inner .sinatra-nav > ul > li > a { color: ' + newval['link-color'] + '; }'; // Link hover color. newval['link-hover-color'] = newval['link-hover-color'] ? newval['link-hover-color'] : api.value( 'sinatra_accent_color' )(); style_css += '#sinatra-header-inner .sinatra-nav > ul > li > a:hover, ' + '#sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a ' + '#sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a ' + '{ color: ' + newval['link-hover-color'] + '; }'; $style_tag.html( style_css ); }); }); /** * Main Nav Background. */ api( 'sinatra_main_nav_background', function( value ) { value.bind( function( newval ) { var $navigation = $( '.sinatra-header-layout-3 .si-nav-container' ); if ( ! $navigation.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_main_nav_background' ); var style_css = sinatra_design_options_css( '.sinatra-header-layout-3 .si-nav-container', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Main Nav Border. */ api( 'sinatra_main_nav_border', function( value ) { value.bind( function( newval ) { var $navigation = $( '.sinatra-header-layout-3 .si-nav-container' ); if ( ! $navigation.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_main_nav_border' ); var style_css = sinatra_design_options_css( '.sinatra-header-layout-3 .si-nav-container', newval, 'border' ); $style_tag.html( style_css ); }); }); /** * Main Nav font size. */ api( 'sinatra_main_nav_font_size', function( value ) { value.bind( function( newval ) { var $nav = $( '#sinatra-header-inner' ); if ( ! $nav.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_main_nav_font_size' ); var style_css = ''; style_css += sinatra_range_field_css( '.sinatra-nav.si-header-element, .sinatra-header-layout-1 .si-header-widgets, .sinatra-header-layout-2 .si-header-widgets', 'font-size', newval, false, newval.unit ); $style_tag.html( style_css ); }); }); /** * Top Bar container width. */ api( 'sinatra_top_bar_container_width', function( value ) { value.bind( function( newval ) { var $topbar = $( '#sinatra-topbar' ); if ( ! $topbar.length ) { return; } if ( 'full-width' === newval ) { $topbar.addClass( 'si-container__wide' ); } else { $topbar.removeClass( 'si-container__wide' ); } }); }); /** * Top Bar visibility. */ api( 'sinatra_top_bar_visibility', function( value ) { value.bind( function( newval ) { var $topbar = $( '#sinatra-topbar' ); sinatra_print_visibility_classes( $topbar, newval ); }); }); /** * Top Bar widgets separator. */ api( 'sinatra_top_bar_widgets_separator', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)sinatra-topbar__separators-\S+/g) || []).join(' '); }); $body.addClass( 'sinatra-topbar__separators-' + newval ); }); }); /** * Top Bar background. */ api( 'sinatra_top_bar_background', function( value ) { value.bind( function( newval ) { var $topbar = $( '#sinatra-topbar' ); if ( ! $topbar.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_top_bar_background' ); var style_css = sinatra_design_options_css( '#sinatra-topbar', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Top Bar color. */ api( 'sinatra_top_bar_text_color', function( value ) { value.bind( function( newval ) { var $topbar = $( '#sinatra-topbar' ); if ( ! $topbar.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_top_bar_text_color' ); var style_css = ''; newval['text-color'] = newval['text-color'] ? newval['text-color'] : 'inherit'; newval['link-color'] = newval['link-color'] ? newval['link-color'] : 'inherit'; newval['link-hover-color'] = newval['link-hover-color'] ? newval['link-hover-color'] : 'inherit'; // Text color. style_css += '#sinatra-topbar { color: ' + newval['text-color'] + '; }'; // Link color. style_css += '.si-topbar-widget__text a, ' + '.si-topbar-widget .sinatra-nav > ul > li > a, ' + '.si-topbar-widget__socials .sinatra-social-nav > ul > li > a, ' + '#sinatra-topbar .si-topbar-widget__text .si-icon { color: ' + newval['link-color'] + '; }'; // Link hover color. style_css += '#sinatra-topbar .sinatra-nav > ul > li > a:hover, ' + '#sinatra-topbar .sinatra-nav > ul > li.menu-item-has-children:hover > a, ' + '#sinatra-topbar .sinatra-nav > ul > li.current-menu-item > a, ' + '#sinatra-topbar .sinatra-nav > ul > li.current-menu-ancestor > a, ' + '#sinatra-topbar .si-topbar-widget__text a:hover, ' + '#sinatra-topbar .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: ' + newval['link-hover-color'] + '; }'; $style_tag.html( style_css ); }); }); /** * Top Bar border. */ api( 'sinatra_top_bar_border', function( value ) { value.bind( function( newval ) { var $topbar = $( '#sinatra-topbar' ); if ( ! $topbar.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_top_bar_border' ); var style_css = sinatra_design_options_css( '#sinatra-topbar', newval, 'border' ); style_css += sinatra_design_options_css( '#sinatra-topbar .si-topbar-widget', newval, 'separator_color' ); $style_tag.html( style_css ); }); }); /** * Header menu item hover animation. */ api( 'sinatra_main_nav_hover_animation', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)sinatra-menu-animation-\S+/g) || []).join(' '); }); $body.addClass( 'sinatra-menu-animation-' + newval ); }); }); /** * Header widgets separator. */ api( 'sinatra_header_widgets_separator', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)sinatra-header__separators-\S+/g) || []).join(' '); }); $body.addClass( 'sinatra-header__separators-' + newval ); }); }); /** * Header background. */ api( 'sinatra_header_background', function( value ) { value.bind( function( newval ) { var $header = $( '#sinatra-header-inner' ); if ( ! $header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_header_background' ); var style_css = sinatra_design_options_css( '#sinatra-header-inner', newval, 'background' ); if ( 'color' === newval['background-type'] && newval['background-color'] ) { style_css += '.si-header-widget__cart .si-cart .si-cart-count { border: 2px solid ' + newval['background-color'] + '; }'; } else { style_css += '.si-header-widget__cart .si-cart .si-cart-count { border: none; }'; } $style_tag.html( style_css ); }); }); /** * Header font color. */ api( 'sinatra_header_text_color', function( value ) { value.bind( function( newval ) { var $header = $( '#sinatra-header' ); if ( ! $header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_header_text_color' ); var style_css = ''; // Text color. style_css += '.sinatra-logo .site-description { color: ' + newval['text-color'] + '; }'; // Link color. if ( newval['link-color'] ) { style_css += '#sinatra-header, ' + '.si-header-widgets a:not(.si-btn), ' + '.sinatra-logo a,' + '.si-hamburger { color: ' + newval['link-color'] + '; }'; style_css += '.hamburger-inner,' + '.hamburger-inner::before,' + '.hamburger-inner::after { background-color: ' + newval['link-color'] + '; }'; } // Link hover color. if ( newval['link-hover-color'] ) { style_css += '.si-header-widgets a:not(.si-btn):hover, ' + '#sinatra-header-inner .si-header-widgets .sinatra-active,' + '.sinatra-logo .site-title a:hover, ' + '.si-hamburger:hover .hamburger-label, ' + '.is-mobile-menu-active .si-hamburger .hamburger-label,' + '#sinatra-header-inner .sinatra-nav > ul > li > a:hover,' + '#sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a,' + '#sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a,' + '#sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a,' + '#sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a,' + '#sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a,' + '#sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: ' + newval['link-hover-color'] + '; }'; style_css += '.si-hamburger:hover .hamburger-inner,' + '.si-hamburger:hover .hamburger-inner::before,' + '.si-hamburger:hover .hamburger-inner::after,' + '.is-mobile-menu-active .si-hamburger .hamburger-inner,' + '.is-mobile-menu-active .si-hamburger .hamburger-inner::before,' + '.is-mobile-menu-active .si-hamburger .hamburger-inner::after { background-color: ' + newval['link-hover-color'] + '; }'; } $style_tag.html( style_css ); }); }); /** * Header border. */ api( 'sinatra_header_border', function( value ) { value.bind( function( newval ) { var $header = $( '#sinatra-header-inner' ); if ( ! $header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_header_border' ); var style_css = sinatra_design_options_css( '#sinatra-header-inner', newval, 'border' ); // Separator color. newval['separator-color'] = newval['separator-color'] ? newval['separator-color'] : 'inherit'; style_css += '.si-header-widget:after { background-color: ' + newval['separator-color'] + '; }'; $style_tag.html( style_css ); }); }); /** * Hero container width. */ api( 'sinatra_hero_hover_slider_container', function( value ) { value.bind( function( newval ) { var $hero_container = $( '#hero .si-hero-container' ); if ( ! $hero_container.length ) { return; } if ( 'full-width' === newval ) { $hero_container.addClass( 'si-container__wide' ); } else { $hero_container.removeClass( 'si-container__wide' ); } }); }); /** * Hero overlay style. */ api( 'sinatra_hero_hover_slider_overlay', function( value ) { value.bind( function( newval ) { var $hero = $( '#hero .si-hover-slider' ); if ( ! $hero.length ) { return; } $hero.removeClass( function (index, className) { return (className.match (/(^|\s)slider-overlay-\S+/g) || []).join(' '); }).addClass( 'slider-overlay-' + newval ); }); }); /** * Hero height. */ api( 'sinatra_hero_hover_slider_height', function( value ) { value.bind( function( newval ) { var $hero = $( '#hero' ); if ( ! $hero.length ) { return; } $hero.find( '.hover-slide-item' ).css( 'height', newval.value + 'px' ); }); }); /** * Hero visibility. */ api( 'sinatra_hero_visibility', function( value ) { value.bind( function( newval ) { sinatra_print_visibility_classes( $( '#hero' ), newval ); }); }); /** * Dropdown indicators. */ api( 'sinatra_main_nav_sub_indicators', function( value ) { value.bind( function( newval ) { if ( newval ) { $body.addClass( 'sinatra-with-dropdown-indicators' ); } else { $body.removeClass( 'sinatra-with-dropdown-indicators' ); } }); }); /** * Custom input style. */ api( 'sinatra_custom_input_style', function( value ) { value.bind( function( newval ) { if ( newval ) { $body.addClass( 'si-input-supported' ); } else { $body.removeClass( 'si-input-supported' ); } }); }); /** * Pre Footer Call to Action Enable. */ api( 'sinatra_enable_pre_footer_cta', function( value ) { value.bind( function( newval ) { if ( newval ) { $body.addClass( 'si-pre-footer-cta-style-' + api.value( 'sinatra_pre_footer_cta_style' )() ); } else { $body.removeClass( function (index, className) { return (className.match (/(^|\s)si-pre-footer-cta-style-\S+/g) || []).join(' '); }); } }); }); /** * Pre Footer Call to Action visibility. */ api( 'sinatra_pre_footer_cta_visibility', function( value ) { value.bind( function( newval ) { var $cta = $( '.si-pre-footer-cta' ); if ( ! $cta.length ) { return; } sinatra_print_visibility_classes( $cta, newval ); }); }); /** * Pre Footer Call to Action Text. */ api( 'sinatra_pre_footer_cta_text', function( value ) { value.bind( function( newval ) { var $cta = $( '#si-pre-footer .si-pre-footer-cta' ); if ( ! $cta.length ) { return; } $cta.find( 'p.h3' ).html( newval ); }); }); /** * Pre Footer Call to Action Style. */ api( 'sinatra_pre_footer_cta_style', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)si-pre-footer-cta-style-\S+/g) || []).join(' '); }).addClass( 'si-pre-footer-cta-style-' + api.value( 'sinatra_pre_footer_cta_style' )() ); }); }); /** * Pre Footer Call to Action Button Text. */ api( 'sinatra_pre_footer_cta_btn_text', function( value ) { value.bind( function( newval ) { var $cta = $( '#si-pre-footer .si-pre-footer-cta' ); if ( ! $cta.length ) { return; } if ( newval ) { $cta.find( 'a' ).css( 'display', 'inline-flex' ).html( newval ); } else { $cta.find( 'a' ).css( 'display', 'none' ).html(''); } }); }); /** * Pre Footer Call to Action Background. */ api( 'sinatra_pre_footer_cta_background', function( value ) { value.bind( function( newval ) { var $cta = $( '#si-pre-footer .si-pre-footer-cta' ); if ( ! $cta.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_pre_footer_cta_background' ); var style_css = ''; if ( 'color' === newval['background-type'] ) { style_css += sinatra_design_options_css( '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before, .si-pre-footer-cta-style-2 #si-pre-footer::before', newval, 'background' ); style_css += '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after,' + '.si-pre-footer-cta-style-2 #si-pre-footer::after' + '{ background-image: none; }'; } else { style_css += sinatra_design_options_css( '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after', newval, 'background' ); style_css += sinatra_design_options_css( '.si-pre-footer-cta-style-2 #si-pre-footer::after', newval, 'background' ); } if ( 'image' === newval['background-type'] && newval['background-color-overlay'] && newval['background-image'] ) { style_css += '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before,' + '.si-pre-footer-cta-style-2 #si-pre-footer::before' + '{ background-color: ' + newval['background-color-overlay'] + '; }'; } $style_tag.html( style_css ); }); }); /** * Pre Footer Call to Action Text Color. */ api( 'sinatra_pre_footer_cta_text_color', function( value ) { value.bind( function( newval ) { var $cta = $( '#si-pre-footer .si-pre-footer-cta' ); if ( ! $cta.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_pre_footer_cta_text_color' ); var style_css = ''; style_css += sinatra_design_options_css( '#si-pre-footer .h2', newval, 'color' ); style_css += sinatra_design_options_css( '#si-pre-footer .h3', newval, 'color' ); style_css += sinatra_design_options_css( '#si-pre-footer .h4', newval, 'color' ); $style_tag.html( style_css ); }); }); /** * Pre Footer Call to Action Border. */ api( 'sinatra_pre_footer_cta_border', function( value ) { value.bind( function( newval ) { var $cta = $( '#si-pre-footer .si-pre-footer-cta' ); if ( ! $cta.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_pre_footer_cta_border' ); var style_css = sinatra_design_options_css( '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before, .si-pre-footer-cta-style-2 #si-pre-footer::before', newval, 'border' ); $style_tag.html( style_css ); }); }); /** * Pre Footer CTA font size. */ api( 'sinatra_pre_footer_cta_font_size', function( value ) { value.bind( function( newval ) { var $cta = $( '#si-pre-footer .si-pre-footer-cta' ); if ( ! $cta.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_pre_footer_cta_font_size' ); var style_css = sinatra_range_field_css( '#si-pre-footer .h3', 'font-size', newval, true, newval.unit ); $style_tag.html( style_css ); }); }); /** * WooCommerce sale badge text. */ api( 'sinatra_product_sale_badge_text', function( value ) { value.bind( function( newval ) { var $badge = $( '.woocommerce ul.products li.product .onsale, .woocommerce span.onsale' ).not( '.sold-out' ); if ( ! $badge.length ) { return; } $badge.html( newval ); }); }); /** * Accent color. */ api( 'sinatra_accent_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_accent_color' ); var style_css; // Background colors. style_css = '.si-header-widgets .si-cart .si-cart-count,' + '#si-scroll-top:hover::before, ' + '.sinatra-menu-animation-underline #sinatra-header-inner .sinatra-nav > ul > li > a > span::before, ' + '.si-btn, ' + '#infinite-handle span, ' + 'input[type=submit], ' + '.comment-form input[type=checkbox]:checked, ' + '#comments .bypostauthor-badge, ' + 'input[type=radio]:checked::before, ' + '.single .post-tags a:hover, ' + '.single .post-category .cat-links a:hover, ' + '#main .mejs-controls .mejs-time-rail .mejs-time-current, ' + '.si-hamburger:hover .hamburger-inner, ' + '.si-hamburger:hover .hamburger-inner::before, ' + '.si-hamburger:hover .hamburger-inner::after, ' + '.tagcloud a:hover, ' + '.si-btn.sinatra-read-more::after, ' + '.post_format-post-format-quote .si-blog-entry-content .quote-post-bg::after, ' + '.si-hover-slider .post-category a,' + '.si-single-title-in-page-header.single .page-header .post-category a,' + '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after,' + '.si-pre-footer-cta-style-2 #si-pre-footer::after,' + '.entry-media > a:hover .entry-media-icon::before, ' + '.si-woo-steps .si-step.is-active > span:first-child, ' + '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::after, ' + '.si-pre-footer-cta-style-2 #si-pre-footer::after, ' + '.site-main .woocommerce #respond input#submit, ' + '.site-main .woocommerce a.button, ' + '.site-main .woocommerce button.button, ' + '.site-main .woocommerce input.button, ' + '.select2-container--default .select2-results__option--highlighted[data-selected], ' + '.si-input-supported input[type=radio]:checked:before, ' + '.si-input-supported input[type=checkbox]:checked, ' + '.woocommerce ul.products li.product .onsale, ' + '.woocommerce span.onsale, ' + '.woocommerce-store-notice, ' + 'p.demo_store, ' + '.woocommerce ul.products li.product .button, ' + '.sinatra-sidebar-style-2 #secondary .widget-title:before, ' + '.widget.woocommerce .wc-layered-nav-term:hover .count, ' + '.widget.woocommerce .product-categories li a:hover ~ .count, ' + '.widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a:before, ' + '.woocommerce .widget_rating_filter ul li.chosen a::before, ' + '.widget.woocommerce .wc-layered-nav-term.chosen .count, ' + '.widget.woocommerce .product-categories li.current-cat > .count, ' + '.woocommerce .widget_price_filter .ui-slider .ui-slider-handle, ' + '.woocommerce .widget_price_filter .ui-slider .ui-slider-handle:after, ' + '.woocommerce .widget_layered_nav_filters ul li a:hover, ' + '.woocommerce div.product form.cart .button, ' + '.widget.woocommerce .wc-layered-nav-rating a:hover em, ' + '.widget.woocommerce .wc-layered-nav-rating.chosen a em, ' + '.widget .cat-item a:hover + span, ' + '.widget_archive li a:hover + span, ' + '.widget .cat-item.current-cat a + span, ' + '#sinatra-footer .widget .cat-item a:hover + span, ' + '#sinatra-footer .widget_archive li a:hover + span, ' + '#sinatra-footer .widget .cat-item.current-cat a + span, ' + '.si-btn.btn-outline:hover, ' + '.si-hamburger:hover .hamburger-inner, ' + '.si-hamburger:hover .hamburger-inner::before, ' + '.si-hamburger:hover .hamburger-inner::after, ' + '.is-mobile-menu-active .si-hamburger .hamburger-inner, ' + '.is-mobile-menu-active .si-hamburger .hamburger-inner::before, ' + '.is-mobile-menu-active .si-hamburger .hamburger-inner::after, ' + '.woocommerce div.product div.images .woocommerce-product-gallery__trigger:hover:before, ' + '.woocommerce #review_form #respond .form-submit input { ' + 'background-color: ' + newval + ';' + '}'; // Hover accent background color. style_css += '.si-btn:hover, ' + 'input[type=submit]:hover, ' + '#infinite-handle span:hover, ' + '.site-main .woocommerce #respond input#submit, ' + '.site-main .woocommerce a.button:hover, ' + '.site-main .woocommerce button.button:hover, ' + '.site-main .woocommerce input.button:hover, ' + '.si-hover-slider .post-category a:hover, ' + '.si-single-title-in-page-header.single .page-header .post-category a:hover, ' + '.woocommerce ul.products li.product .button:hover, ' + '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, ' + '.wc-layered-nav-rating a:hover .star-rating span:before, ' + '.woocommerce #review_form #respond .form-submit input:hover { ' + 'background-color: ' + sinatra_luminance( newval, 0.15 ) + ';' + '}'; // Hover accent color. style_css += '.wc-layered-nav-rating a:hover .star-rating span:before { ' + 'color: ' + sinatra_luminance( newval, 0.15 ) + ';' + '}'; style_css += 'code, ' + 'kbd, ' + 'var, ' + 'samp, ' + 'mark, ' + 'span.highlight, ' + 'tt { ' + 'background-color: ' + sinatra_hex2rgba( newval, 0.12 ) + ';' + '}'; style_css += 'code.block { ' + 'background-color: ' + sinatra_hex2rgba( newval, 0.075 ) + ';' + '}'; // Colors. style_css += '.content-area a:not(.si-btn):not(.wp-block-button__link),' + '.si-sidebar-container a:hover:not(.si-btn), ' + '.si-header-widgets .si-header-widget:hover, ' + '.si-header-widgets .si-header-widget.sinatra-active .si-icon.si-search, ' + '#sinatra-header-inner .si-header-widgets .sinatra-active, ' + '.sinatra-logo .site-title a:hover,' + '#sinatra-header-inner .sinatra-nav > ul > li > a:hover, ' + '#sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a, ' + '#sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a, ' + '#sinatra-topbar .sinatra-nav > ul > li > a:hover, ' + '#sinatra-topbar .sinatra-nav > ul > li.menu-item-has-children:hover > a, ' + '#sinatra-topbar .sinatra-nav > ul > li.current-menu-item > a, ' + '#sinatra-topbar .sinatra-nav > ul > li.current-menu-ancestor > a, ' + '.si-topbar-widget__text a:hover, ' + '.si-topbar-widget__text a, ' + '.si-header-widgets a:not(.si-btn):hover, ' + '.sinatra-social-nav > ul > li > a .si-icon.bottom-icon, ' + '.sinatra-pagination .navigation .nav-links .page-numbers:hover, ' + '.widget .cat-item.current-cat > a, ' + '.widget ul li.current_page_item > a, ' + '#main .search-form .search-submit:hover, ' + '#cancel-comment-reply-link:hover, ' + '.comment-form .required, ' + '.navigation .nav-links .page-numbers:hover, ' + '#main .entry-meta a:hover, ' + '#main .author-box-title a, ' + '.single .post-category a, ' + '.page-links span:hover, ' + '.site-content .page-links span:hover, ' + '.wc-cart-widget-header .si-cart-subtotal span, ' + '.si-header-widget__cart:hover > a, ' + '.woocommerce #yith-wcwl-form table.shop_table .product-subtotal .amount, ' + '.woocommerce .woocommerce-cart-form table.shop_table .product-subtotal .amount, ' + '.si-woo-steps .si-step.is-active, ' + '.cart_totals .order-total td, ' + '.navigation .nav-links .page-numbers.current, ' + '.page-links > span, ' + '.site-content .page-links > span, ' + '.woocommerce ul.products li.product .price, ' + '.woocommerce .woocommerce-checkout-review-order .order-total .woocommerce-Price-amount.amount, ' + '.woocommerce-info::before, ' + '#main .woocommerce-MyAccount-navigation li.is-active, ' + '.woocommerce .star-rating span::before, ' + '.widget.woocommerce .wc-layered-nav-term:hover a, ' + '.widget.woocommerce .wc-layered-nav-term a:hover,' + '.widget.woocommerce .product-categories li a:hover, ' + '.widget.woocommerce .product-categories li.current-cat > a, ' + '.woocommerce ins .amount, ' + '.woocommerce .widget_rating_filter ul li.chosen a::before, ' + '.widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a, ' + '.woocommerce .widget_shopping_cart .total .amount, ' + '.woocommerce .widget_shopping_cart .total .tax_label, ' + '.woocommerce.widget_shopping_cart .total .amount, ' + '.woocommerce.widget_shopping_cart .total .tax_label, ' + '.si-btn.btn-outline, ' + '.woocommerce .widget_shopping_cart .cart_list li a.remove:hover:before, ' + '.woocommerce div.product .woocommerce-tabs ul.tabs li.active > a,' + '.woocommerce.widget_shopping_cart .cart_list li a.remove:hover:before, ' + '.woocommerce div.product p.price, ' + '.woocommerce div.product span.price, ' + '.woocommerce div.product #reviews .comment-form-rating .stars a, ' + '.woocommerce div.product .woocommerce-pagination ul li span.current, ' + '.woocommerce div.product .woocommerce-pagination ul li a:hover, ' + 'code, ' + 'kbd, ' + 'var, ' + 'samp, ' + 'tt, ' + '.is-mobile-menu-active .si-hamburger .hamburger-label, ' + '.si-hamburger:hover .hamburger-label, ' + '.single #main .post-nav a:hover, ' + '#sinatra-topbar .si-topbar-widget__text .si-icon, ' + '.sinatra-core-custom-list-widget .si-widget-icon {' + 'color: ' + newval + ';' + '}'; // Selection. style_css += '#main ::-moz-selection { background-color: ' + newval + '; color: #FFF; }'; style_css += '#main ::selection { background-color: ' + newval + '; color: #FFF; }'; // Border color. style_css += '#comments .comment-actions .reply a:hover, ' + '.comment-form input[type=checkbox]:checked, .comment-form input[type=checkbox]:focus, ' + '.comment-form input[type=radio]:checked, .comment-form input[type=radio]:focus, ' + '.single .post-category a, ' + '#secondary .widget-title, ' + '.si-hover-slider .post-category a, ' + '.si-single-title-in-page-header.single .page-header .post-category a, ' + '.entry-content blockquote, ' + '.wp-block-quote.is-style-large, ' + '.wp-block-quote.is-large, ' + '.wp-block-quote.has-text-align-right, ' + '[type="radio"]:checked + label:before, ' + '.si-input-supported input[type=radio]:checked, ' + '.si-input-supported input[type=checkbox]:checked, ' + '.widget.woocommerce .woocommerce-widget-layered-nav-list .woocommerce-widget-layered-nav-list__item.chosen a:before, ' + '.widget.woocommerce .widget_rating_filter.chosen a:after, ' + '.si-btn.btn-outline, ' + '.page-links > span, .site-content .page-links > span, ' + '.navigation .nav-links .page-numbers.current, ' + '.woocommerce div.product div.images .flex-control-thumbs li img.flex-active, ' + '.woocommerce div.product .woocommerce-pagination ul li span.current {' + 'border-color: ' + newval + ';' + '}'; // Border bottom color. style_css += '#masthead .si-header-widgets .dropdown-item::after, ' + '.sinatra-nav > ul .sub-menu::after,' + 'textarea:focus, ' + 'input[type="text"]:focus, ' + 'input[type="email"]:focus, ' + 'input[type=password]:focus, ' + 'input[type=tel]:focus, ' + 'input[type=url]:focus, ' + 'input[type=search]:focus, ' + 'input[type=date]:focus, ' + '#add_payment_method table.cart td.actions .coupon .input-text:focus, ' + '.woocommerce-cart table.cart td.actions .coupon .input-text:focus, ' + '.woocommerce-checkout table.cart td.actions .coupon .input-text:focus {' + 'border-bottom-color: ' + newval + ';' + '}'; // Border top color. style_css += '.si-header-widgets .dropdown-item, ' + '.site .woocommerce-info, ' + '.preloader-1 > div, ' + '.si-header-element.sinatra-nav .sub-menu {' + 'border-top-color: ' + newval + ';' + '}'; // Fill color. style_css += '.sinatra-animate-arrow:hover .arrow-handle, ' + '.sinatra-animate-arrow:hover .arrow-bar, ' + '.sinatra-animate-arrow:focus .arrow-handle, ' + '.sinatra-animate-arrow:focus .arrow-bar, ' + '.sinatra-pagination .navigation .nav-links .page-numbers.next:hover .sinatra-animate-arrow .arrow-handle,' + '.sinatra-pagination .navigation .nav-links .page-numbers.prev:hover .sinatra-animate-arrow .arrow-handle,' + '.sinatra-pagination .navigation .nav-links .page-numbers.next:hover .sinatra-animate-arrow .arrow-bar,' + '.sinatra-pagination .navigation .nav-links .page-numbers.prev:hover .sinatra-animate-arrow .arrow-bar {' + 'fill: ' + newval + ';' + '}'; // Box shadow. style_css += '.si-input-supported input[type=checkbox]:focus:hover { ' + 'box-shadow: inset 0 0 0 2px ' + newval + '; ' + '}'; // Gradient. style_css += '.si-pre-footer-cta-style-1 #si-pre-footer .si-flex-row::before,' + '.si-pre-footer-cta-style-2 #si-pre-footer::before { ' + 'background: linear-gradient(to right, ' + sinatra_hex2rgba( newval, 0.9 ) + ' 0%, ' + sinatra_hex2rgba( newval, 0.82 ) + ' 35%, ' + sinatra_hex2rgba( newval, 0.4 ) + ' 100% );' + '-webkit-gradient(linear, left top, right top, from(' + sinatra_hex2rgba( newval, 0.9 ) + '), color-stop(35%, ' + sinatra_hex2rgba( newval, 0.82 ) + '), to(' + sinatra_hex2rgba( newval, 0.4 ) + ')); }'; $style_tag.html( style_css ); }); }); /** * Content background color. */ api( 'sinatra_boxed_content_background_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_boxed_content_background_color' ); var style_css = ''; if ( newval ) { style_css = '.sinatra-layout__boxed #page, ' + '.sinatra-layout__boxed-separated #content, ' + '.sinatra-layout__boxed-separated.sinatra-sidebar-style-3 #secondary .si-widget, ' + '.sinatra-layout__boxed-separated.sinatra-sidebar-style-3 .elementor-widget-sidebar .si-widget, ' + '.sinatra-layout__boxed-separated.blog .sinatra-article, ' + '.sinatra-layout__boxed-separated.search-results .sinatra-article, ' + '.sinatra-layout__boxed-separated.category .sinatra-article { background-color: ' + newval + '; }'; style_css += '@media screen and (max-width: 960px) { ' + '.sinatra-layout__boxed-separated #page { background-color: ' + newval + '; }' + '}'; } $style_tag.html( style_css ); }); }); /** * Content text color. */ api( 'sinatra_content_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_content_text_color' ); var style_css = ''; if ( newval ) { style_css = 'body { ' + 'color: ' + newval + ';' + '}' + '.comment-form .comment-notes, ' + '#comments .no-comments, ' + '#page .wp-caption .wp-caption-text,' + '#comments .comment-meta,' + '.comments-closed,' + '.entry-meta,' + '.si-entry cite,' + 'legend,' + '.si-page-header-description,' + '.page-links em,' + '.site-content .page-links em,' + '.single .entry-footer .last-updated,' + '.single .post-nav .post-nav-title,' + '#main .widget_recent_comments span,' + '#main .widget_recent_entries span,' + '#main .widget_calendar table > caption,' + '.post-thumb-caption, ' + '.wp-block-image figcaption, ' + '.si-cart-item .si-x,' + '.woocommerce form.login .lost_password a,' + '.woocommerce form.register .lost_password a,' + '.woocommerce a.remove,' + '#add_payment_method .cart-collaterals .cart_totals .woocommerce-shipping-destination, ' + '.woocommerce-cart .cart-collaterals .cart_totals .woocommerce-shipping-destination, ' + '.woocommerce-checkout .cart-collaterals .cart_totals .woocommerce-shipping-destination,' + '.woocommerce ul.products li.product .si-loop-product__category-wrap a,' + '.woocommerce ul.products li.product .si-loop-product__category-wrap,' + '.woocommerce .woocommerce-checkout-review-order table.shop_table thead th,' + '#add_payment_method #payment div.payment_box, ' + '.woocommerce-cart #payment div.payment_box, ' + '.woocommerce-checkout #payment div.payment_box,' + '#add_payment_method #payment ul.payment_methods .about_paypal, ' + '.woocommerce-cart #payment ul.payment_methods .about_paypal, ' + '.woocommerce-checkout #payment ul.payment_methods .about_paypal,' + '.woocommerce table dl,' + '.woocommerce table .wc-item-meta,' + '.widget.woocommerce .reviewer,' + '.woocommerce.widget_shopping_cart .cart_list li a.remove:before,' + '.woocommerce .widget_shopping_cart .cart_list li a.remove:before,' + '.woocommerce .widget_shopping_cart .cart_list li .quantity, ' + '.woocommerce.widget_shopping_cart .cart_list li .quantity,' + '.woocommerce div.product .woocommerce-product-rating .woocommerce-review-link,' + '.woocommerce div.product .woocommerce-tabs table.shop_attributes td,' + '.woocommerce div.product .product_meta > span span:not(.si-woo-meta-title), ' + '.woocommerce div.product .product_meta > span a,' + '.woocommerce .star-rating::before,' + '.woocommerce div.product #reviews #comments ol.commentlist li .comment-text p.meta,' + '.ywar_review_count,' + '.woocommerce .add_to_cart_inline del, ' + '.woocommerce div.product p.price del, ' + '.woocommerce div.product span.price del { color: ' + sinatra_hex2rgba( newval, 0.75 ) + '; }'; } $style_tag.html( style_css ); }); }); /** * Content link hover color. */ api( 'sinatra_content_link_hover_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_content_link_hover_color' ); var style_css = ''; if ( newval ) { // Content link hover. style_css += '.content-area a:not(.si-btn):not(.wp-block-button__link):hover, ' + '.si-woo-before-shop select.custom-select-loaded:hover ~ #si-orderby, ' + '#add_payment_method #payment ul.payment_methods .about_paypal:hover, ' + '.woocommerce-cart #payment ul.payment_methods .about_paypal:hover, ' + '.woocommerce-checkout #payment ul.payment_methods .about_paypal:hover, ' + '.si-breadcrumbs a:hover, ' + '.woocommerce div.product .woocommerce-product-rating .woocommerce-review-link:hover, ' + '.woocommerce ul.products li.product .meta-wrap .woocommerce-loop-product__link:hover, ' + '.woocommerce ul.products li.product .si-loop-product__category-wrap a:hover { ' + 'color: ' + newval + ';' + '}'; } $style_tag.html( style_css ); }); }); /** * Content text color. */ api( 'sinatra_headings_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_headings_color' ); var style_css = ''; if ( newval ) { style_css = 'h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .sinatra-logo .site-title, .error-404 .page-header h1 { ' + 'color: ' + newval + ';' + '}'; } $style_tag.html( style_css ); }); }); /** * Scroll Top visibility. */ api( 'sinatra_scroll_top_visibility', function( value ) { value.bind( function( newval ) { sinatra_print_visibility_classes( $( '#si-scroll-top' ), newval ); }); }); /** * Page Preloader visibility. */ api( 'sinatra_preloader_visibility', function( value ) { value.bind( function( newval ) { sinatra_print_visibility_classes( $( '#si-preloader' ), newval ); }); }); /** * Footer visibility. */ api( 'sinatra_footer_visibility', function( value ) { value.bind( function( newval ) { sinatra_print_visibility_classes( $( '#sinatra-footer' ), newval ); }); }); /** * Footer background. */ api( 'sinatra_footer_background', function( value ) { value.bind( function( newval ) { var $footer = $( '#colophon' ); if ( ! $footer.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_footer_background' ); var style_css = sinatra_design_options_css( '#colophon', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Footer font color. */ api( 'sinatra_footer_text_color', function( value ) { var $footer = $( '#sinatra-footer' ), copyright_separator_color, style_css; value.bind( function( newval ) { if ( ! $footer.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_footer_text_color' ); style_css = ''; newval['text-color'] = newval['text-color'] ? newval['text-color'] : 'inherit'; newval['link-color'] = newval['link-color'] ? newval['link-color'] : 'inherit'; newval['link-hover-color'] = newval['link-hover-color'] ? newval['link-hover-color'] : 'inherit'; newval['widget-title-color'] = newval['widget-title-color'] ? newval['widget-title-color'] : 'inherit'; // Text color. style_css += '#colophon { color: ' + newval['text-color'] + '; }'; // Link color. style_css += '#colophon a { color: ' + newval['link-color'] + '; }'; // Link hover color. style_css += '#colophon a:hover, #colophon li.current_page_item > a, #colophon .sinatra-social-nav > ul > li > a .si-icon.bottom-icon ' + '{ color: ' + newval['link-hover-color'] + '; }'; // Widget title color. style_css += '#colophon .widget-title { color: ' + newval['widget-title-color'] + '; }'; // Copyright separator color. copyright_separator_color = sinatra_light_or_dark( newval['text-color'], 'rgba(255,255,255,0.1)', 'rgba(0,0,0,0.1)' ); // copyright_separator_color = sinatra_luminance( newval['text-color'], 0.8 ); style_css += '#sinatra-copyright.contained-separator > .si-container:before { background-color: ' + copyright_separator_color + '; }'; style_css += '#sinatra-copyright.fw-separator { border-top-color: ' + copyright_separator_color + '; }'; $style_tag.html( style_css ); }); }); /** * Footer border. */ api( 'sinatra_footer_border', function( value ) { value.bind( function( newval ) { var $footer = $( '#sinatra-footer' ); if ( ! $footer.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_footer_border' ); var style_css = ''; if ( newval['border-top-width'] ) { style_css += '#colophon { ' + 'border-top-width: ' + newval['border-top-width'] + 'px;' + 'border-top-style: ' + newval['border-style'] + ';' + 'border-top-color: ' + newval['border-color'] + ';' + '}'; } if ( newval['border-bottom-width'] ) { style_css += '#colophon { ' + 'border-bottom-width: ' + newval['border-bottom-width'] + 'px;' + 'border-bottom-style: ' + newval['border-style'] + ';' + 'border-bottom-color: ' + newval['border-color'] + ';' + '}'; } $style_tag.html( style_css ); }); }); /** * Copyright layout. */ api( 'sinatra_copyright_layout', function( value ) { value.bind( function( newval ) { $body.removeClass( function (index, className) { return (className.match (/(^|\s)sinatra-copyright-layout-\S+/g) || []).join(' '); }); $body.addClass( 'sinatra-copyright-' + newval ); }); }); /** * Copyright separator. */ api( 'sinatra_copyright_separator', function( value ) { value.bind( function( newval ) { var $copyright = $( '#sinatra-copyright' ); if ( ! $copyright.length ) { return; } $copyright.removeClass( 'fw-separator contained-separator' ); if ( 'none' !== newval ) { $copyright.addClass( newval ); } }); }); /** * Copyright visibility. */ api( 'sinatra_copyright_visibility', function( value ) { value.bind( function( newval ) { sinatra_print_visibility_classes( $( '#sinatra-copyright' ), newval ); }); }); /** * Copyright background. */ api( 'sinatra_copyright_background', function( value ) { value.bind( function( newval ) { var $copyright = $( '#sinatra-copyright' ); if ( ! $copyright.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_copyright_background' ); var style_css = sinatra_design_options_css( '#sinatra-copyright', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Copyright text color. */ api( 'sinatra_copyright_text_color', function( value ) { value.bind( function( newval ) { var $copyright = $( '#sinatra-copyright' ); if ( ! $copyright.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_copyright_text_color' ); var style_css = ''; newval['text-color'] = newval['text-color'] ? newval['text-color'] : 'inherit'; newval['link-color'] = newval['link-color'] ? newval['link-color'] : 'inherit'; newval['link-hover-color'] = newval['link-hover-color'] ? newval['link-hover-color'] : 'inherit'; // Text color. style_css += '#sinatra-copyright { color: ' + newval['text-color'] + '; }'; // Link color. style_css += '#sinatra-copyright a { color: ' + newval['link-color'] + '; }'; // Link hover color. style_css += '#sinatra-copyright a:hover, #sinatra-copyright .sinatra-social-nav > ul > li > a .si-icon.bottom-icon, #sinatra-copyright li.current_page_item > a, #sinatra-copyright .sinatra-nav > ul > li.current-menu-item > a, #sinatra-copyright .sinatra-nav > ul > li.current-menu-ancestor > a #sinatra-copyright .sinatra-nav > ul > li:hover > a, #sinatra-copyright .sinatra-social-nav > ul > li > a .si-icon.bottom-icon { color: ' + newval['link-hover-color'] + '; }'; $style_tag.html( style_css ); }); }); /** * Container width. */ api( 'sinatra_container_width', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_container_width' ); var style_css; style_css = '.si-container,' + '.alignfull > div { ' + 'max-width: ' + newval.value + 'px;' + '}'; style_css += '.sinatra-layout__boxed #page, .sinatra-layout__boxed.si-sticky-header.sinatra-is-mobile #sinatra-header-inner, ' + '.sinatra-layout__boxed.si-sticky-header:not(.sinatra-header-layout-3) #sinatra-header-inner, ' + '.sinatra-layout__boxed.si-sticky-header:not(.sinatra-is-mobile).sinatra-header-layout-3 #sinatra-header-inner .si-nav-container > .si-container { max-width: ' + ( parseInt( newval.value) + 100 ) + 'px; }'; $style_tag.html( style_css ); }); }); /** * Transparent Header Logo max height. */ api( 'sinatra_tsp_logo_max_height', function( value ) { value.bind( function( newval ) { var $logo = $( '.si-tsp-header .sinatra-logo' ); if ( ! $logo.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_tsp_logo_max_height' ); var style_css = ''; style_css += sinatra_range_field_css( '.si-tsp-header .sinatra-logo img', 'max-height', newval, true, 'px' ); style_css += sinatra_range_field_css( '.si-tsp-header .sinatra-logo img.si-svg-logo', 'height', newval, true, 'px' ); $style_tag.html( style_css ); }); }); /** * Transparent Header Logo margin. */ api( 'sinatra_tsp_logo_margin', function( value ) { value.bind( function( newval ) { var $logo = $( '.si-tsp-header .sinatra-logo' ); if ( ! $logo.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_tsp_logo_margin' ); var style_css = sinatra_spacing_field_css( '.si-tsp-header .sinatra-logo .logo-inner', 'margin', newval, true ); $style_tag.html( style_css ); }); }); /** * Transparent header - Main Header & Topbar background. */ api( 'sinatra_tsp_header_background', function( value ) { value.bind( function( newval ) { var $tsp_header = $( '.si-tsp-header' ); if ( ! $tsp_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_tsp_header_background' ); var style_css = ''; style_css += sinatra_design_options_css( '.si-tsp-header #sinatra-header-inner', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Transparent header - Main Header & Topbar font color. */ api( 'sinatra_tsp_header_font_color', function( value ) { value.bind( function( newval ) { var $tsp_header = $( '.si-tsp-header' ); if ( ! $tsp_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_tsp_header_font_color' ); var style_css = ''; newval['text-color'] = newval['text-color'] ? newval['text-color'] : 'inherit'; newval['link-color'] = newval['link-color'] ? newval['link-color'] : 'inherit'; newval['link-hover-color'] = newval['link-hover-color'] ? newval['link-hover-color'] : 'inherit'; /** Header **/ // Text color. style_css += '.si-tsp-header .sinatra-logo .site-description { color: ' + newval['text-color'] + '; }'; // Link color. if ( newval['link-color'] ) { style_css += '.si-tsp-header #sinatra-header, ' + '.si-tsp-header .si-header-widgets a:not(.si-btn), ' + '.si-tsp-header .sinatra-logo a,' + '.si-tsp-header .si-hamburger, ' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li > a { color: ' + newval['link-color'] + '; }'; style_css += '.si-tsp-header .hamburger-inner,' + '.si-tsp-header .hamburger-inner::before,' + '.si-tsp-header .hamburger-inner::after { background-color: ' + newval['link-color'] + '; }'; } // Link hover color. if ( newval['link-hover-color'] ) { style_css += '.si-tsp-header .si-header-widgets a:not(.si-btn):hover, ' + '.si-tsp-header #sinatra-header-inner .si-header-widgets .sinatra-active,' + '.si-tsp-header .sinatra-logo .site-title a:hover, ' + '.si-tsp-header .si-hamburger:hover .hamburger-label, ' + '.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-label,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li > a:hover,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.menu-item-has-children:hover > a,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current-menu-item > a,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current-menu-ancestor > a,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.page_item_has_children:hover > a,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current_page_item > a,' + '.si-tsp-header #sinatra-header-inner .sinatra-nav > ul > li.current_page_ancestor > a { color: ' + newval['link-hover-color'] + '; }'; style_css += '.si-tsp-header .si-hamburger:hover .hamburger-inner,' + '.si-tsp-header .si-hamburger:hover .hamburger-inner::before,' + '.si-tsp-header .si-hamburger:hover .hamburger-inner::after,' + '.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-inner,' + '.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-inner::before,' + '.is-mobile-menu-active .si-tsp-header .si-hamburger .hamburger-inner::after { background-color: ' + newval['link-hover-color'] + '; }'; } $style_tag.html( style_css ); }); }); /** * Transparent header - Main Header & Topbar border. */ api( 'sinatra_tsp_header_border', function( value ) { value.bind( function( newval ) { var $tsp_header = $( '.si-tsp-header' ); if ( ! $tsp_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_tsp_header_border' ); var style_css = ''; style_css += sinatra_design_options_css( '.si-tsp-header #sinatra-header-inner', newval, 'border' ); // Separator color. newval['separator-color'] = newval['separator-color'] ? newval['separator-color'] : 'inherit'; style_css += '.si-tsp-header .si-header-widget:after { background-color: ' + newval['separator-color'] + '; }'; $style_tag.html( style_css ); }); }); /** * Page Header layout. */ api( 'sinatra_page_header_alignment', function( value ) { value.bind( function( newval ) { if ( $body.hasClass( 'single-post' ) ) { return; } $body.removeClass( function (index, className) { return (className.match (/(^|\s)si-page-title-align-\S+/g) || []).join(' '); }); $body.addClass( 'si-page-title-align-' + newval ); }); }); /** * Page Header spacing. */ api( 'sinatra_page_header_spacing', function( value ) { value.bind( function( newval ) { var $page_header = $( '.page-header' ); if ( ! $page_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_page_header_spacing' ); var style_css = sinatra_spacing_field_css( '.si-page-title-align-left .page-header.si-has-page-title, .si-page-title-align-right .page-header.si-has-page-title, .si-page-title-align-center .page-header .si-page-header-wrapper', 'padding', newval, true ); $style_tag.html( style_css ); }); }); /** * Page Header background. */ api( 'sinatra_page_header_background', function( value ) { value.bind( function( newval ) { var $page_header = $( '.page-header' ); if ( ! $page_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_page_header_background' ); var style_css = ''; style_css += sinatra_design_options_css( '.page-header', newval, 'background' ); style_css += sinatra_design_options_css( '.si-tsp-header:not(.si-tsp-absolute) #masthead', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Header Text color. */ api( 'sinatra_page_header_text_color', function( value ) { value.bind( function( newval ) { var $page_header = $( '.page-header' ); if ( ! $page_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_page_header_text_color' ); var style_css = ''; newval['text-color'] = newval['text-color'] ? newval['text-color'] : 'inherit'; newval['link-color'] = newval['link-color'] ? newval['link-color'] : 'inherit'; newval['link-hover-color'] = newval['link-hover-color'] ? newval['link-hover-color'] : 'inherit'; // Text color. style_css += '.page-header .page-title { color: ' + newval['text-color'] + '; }'; style_css += '.page-header .si-page-header-description' + '{ color: ' + sinatra_hex2rgba( newval['text-color'], 0.75 ) + '}'; // Link color. style_css += '.page-header .si-breadcrumbs a' + '{ color: ' + newval['link-color'] + '; }'; style_css += '.page-header .si-breadcrumbs span,' + '.page-header .breadcrumb-trail .trail-items li::after, .page-header .si-breadcrumbs .separator' + '{ color: ' + sinatra_hex2rgba( newval['link-color'], 0.75 ) + '}'; $style_tag.html( style_css ); }); }); /** * Page Header border. */ api( 'sinatra_page_header_border', function( value ) { value.bind( function( newval ) { var $page_header = $( '.page-header' ); if ( ! $page_header.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_page_header_border' ); var style_css = sinatra_design_options_css( '.page-header', newval, 'border' ); $style_tag.html( style_css ); }); }); /** * Breadcrumbs alignment. */ api( 'sinatra_breadcrumbs_alignment', function( value ) { value.bind( function( newval ) { var $breadcrumbs = $( '#main > .si-breadcrumbs > .si-container' ); if ( ! $breadcrumbs.length ) { return; } $breadcrumbs.removeClass( function (index, className) { return ( className.match (/(^|\s)si-text-align\S+/g) || []).join(' '); }); $breadcrumbs.addClass( 'si-text-align-' + newval ); }); }); /** * Breadcrumbs spacing. */ api( 'sinatra_breadcrumbs_spacing', function( value ) { value.bind( function( newval ) { var $breadcrumbs = $( '.si-breadcrumbs' ); if ( ! $breadcrumbs.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_breadcrumbs_spacing' ); var style_css = sinatra_spacing_field_css( '.si-breadcrumbs', 'padding', newval, true ); $style_tag.html( style_css ); }); }); /** * Breadcrumbs Background. */ api( 'sinatra_breadcrumbs_background', function( value ) { value.bind( function( newval ) { var $breadcrumbs = $( '.si-breadcrumbs' ); if ( ! $breadcrumbs.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_breadcrumbs_background' ); var style_css = sinatra_design_options_css( '.si-breadcrumbs', newval, 'background' ); $style_tag.html( style_css ); }); }); /** * Breadcrumbs Text Color. */ api( 'sinatra_breadcrumbs_text_color', function( value ) { value.bind( function( newval ) { var $breadcrumbs = $( '.si-breadcrumbs' ); if ( ! $breadcrumbs.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_breadcrumbs_text_color' ); var style_css = sinatra_design_options_css( '.si-breadcrumbs', newval, 'color' ); $style_tag.html( style_css ); }); }); /** * Breadcrumbs Border. */ api( 'sinatra_breadcrumbs_border', function( value ) { value.bind( function( newval ) { var $breadcrumbs = $( '.si-breadcrumbs' ); if ( ! $breadcrumbs.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_breadcrumbs_border' ); var style_css = sinatra_design_options_css( '.si-breadcrumbs', newval, 'border' ); $style_tag.html( style_css ); }); }); /** * Base HTML font size. */ api( 'sinatra_html_base_font_size', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_html_base_font_size' ); var style_css = sinatra_range_field_css( 'html', 'font-size', newval, true, 'px' ); $style_tag.html( style_css ); }); }); /** * Font smoothing. */ api( 'sinatra_font_smoothing', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_font_smoothing' ); if ( newval ) { $style_tag.html( '*,' + '*::before,' + '*::after {' + '-moz-osx-font-smoothing: grayscale;' + '-webkit-font-smoothing: antialiased;' + '}' ); } else { $style_tag.html( '*,' + '*::before,' + '*::after {' + '-moz-osx-font-smoothing: auto;' + '-webkit-font-smoothing: auto;' + '}' ); } $style_tag = sinatra_get_style_tag( 'sinatra_html_base_font_size' ); var style_css = sinatra_range_field_css( 'html', 'font-size', newval, true, 'px' ); $style_tag.html( style_css ); }); }); /** * Body font. */ api( 'sinatra_body_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_body_font' ); var style_css = sinatra_typography_field_css( 'body', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Headings font. */ api( 'sinatra_headings_font', function( value ) { var style_css, selector; value.bind( function( newval ) { selector = 'h1, .h1, .sinatra-logo .site-title, .page-header h1.page-title'; selector += ', h2, .h2, .woocommerce div.product h1.product_title'; selector += ', h3, .h3, .woocommerce #reviews #comments h2'; selector += ', h4, .woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title'; selector += ', h5, h6'; style_css = sinatra_typography_field_css( selector, newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag = sinatra_get_style_tag( 'sinatra_headings_font' ); $style_tag.html( style_css ); }); }); /** * Heading 1 font. */ api( 'sinatra_h1_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_h1_font' ); var style_css = sinatra_typography_field_css( 'h1, .h1, .sinatra-logo .site-title, .page-header h1.page-title', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Heading 2 font. */ api( 'sinatra_h2_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_h2_font' ); var style_css = sinatra_typography_field_css( 'h2, .h2, .woocommerce div.product h1.product_title', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Heading 3 font. */ api( 'sinatra_h3_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_h3_font' ); var style_css = sinatra_typography_field_css( 'h3, .h3, .woocommerce #reviews #comments h2', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Heading 4 font. */ api( 'sinatra_h4_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_h4_font' ); var style_css = sinatra_typography_field_css( 'h4, .woocommerce .cart_totals h2, .woocommerce .cross-sells > h4, .woocommerce #reviews #respond .comment-reply-title', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Heading 5 font. */ api( 'sinatra_h5_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_h5_font' ); var style_css = sinatra_typography_field_css( 'h5', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Heading 6 font. */ api( 'sinatra_h6_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_h6_font' ); var style_css = sinatra_typography_field_css( 'h6', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Heading emphasized font. */ api( 'sinatra_heading_em_font', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_heading_em_font' ); var style_css = sinatra_typography_field_css( 'h1 em, h2 em, h3 em, h4 em, h5 em, h6 em, .h1 em, .h2 em, .h3 em, .sinatra-logo .site-title em, .error-404 .page-header h1 em', newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); /** * Sidebar widget title font size. */ api( 'sinatra_sidebar_widget_title_font_size', function( value ) { value.bind( function( newval ) { var $widget_title = $( '#main .widget-title' ); if ( ! $widget_title.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_sidebar_widget_title_font_size' ); var style_css = ''; style_css += sinatra_range_field_css( '#main .widget-title', 'font-size', newval, true, newval.unit ); $style_tag.html( style_css ); }); }); /** * Footer widget title font size. */ api( 'sinatra_footer_widget_title_font_size', function( value ) { value.bind( function( newval ) { var $widget_title = $( '#colophon .widget-title' ); if ( ! $widget_title.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_footer_widget_title_font_size' ); var style_css = ''; style_css += sinatra_range_field_css( '#colophon .widget-title', 'font-size', newval, true, newval.unit ); $style_tag.html( style_css ); }); }); /** * Page title font size. */ api( 'sinatra_page_header_font_size', function( value ) { value.bind( function( newval ) { var $page_title = $( '.page-header .page-title' ); if ( ! $page_title.length ) { return; } $style_tag = sinatra_get_style_tag( 'sinatra_page_header_font_size' ); var style_css = ''; style_css += sinatra_range_field_css( '#page .page-header .page-title', 'font-size', newval, true, newval.unit ); $style_tag.html( style_css ); }); }); var $btn_selectors = '.si-btn, ' + 'body:not(.wp-customizer) input[type=submit], ' + '.site-main .woocommerce #respond input#submit, ' + '.site-main .woocommerce a.button, ' + '.site-main .woocommerce button.button, ' + '.site-main .woocommerce input.button, ' + '.woocommerce ul.products li.product .added_to_cart, ' + '.woocommerce ul.products li.product .button, ' + '.woocommerce div.product form.cart .button, ' + '.woocommerce #review_form #respond .form-submit input, ' + '#infinite-handle span'; var $btn_hover_selectors = '.si-btn:hover, ' + '.si-btn:focus, ' + 'body:not(.wp-customizer) input[type=submit]:hover, ' + 'body:not(.wp-customizer) input[type=submit]:focus, ' + '.site-main .woocommerce #respond input#submit:hover, ' + '.site-main .woocommerce #respond input#submit:focus, ' + '.site-main .woocommerce a.button:hover, ' + '.site-main .woocommerce a.button:focus, ' + '.site-main .woocommerce button.button:hover, ' + '.site-main .woocommerce button.button:focus, ' + '.site-main .woocommerce input.button:hover, ' + '.site-main .woocommerce input.button:focus, ' + '.woocommerce ul.products li.product .added_to_cart:hover, ' + '.woocommerce ul.products li.product .added_to_cart:focus, ' + '.woocommerce ul.products li.product .button:hover, ' + '.woocommerce ul.products li.product .button:focus, ' + '.woocommerce div.product form.cart .button:hover, ' + '.woocommerce div.product form.cart .button:focus, ' + '.woocommerce #review_form #respond .form-submit input:hover, ' + '.woocommerce #review_form #respond .form-submit input:focus, ' + '#infinite-handle span:hover'; /** * Primary button background color. */ api( 'sinatra_primary_button_bg_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_bg_color' ); var style_css = ''; if ( newval ) { style_css = $btn_selectors + '{ background-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Primary button hover background color. */ api( 'sinatra_primary_button_hover_bg_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_hover_bg_color' ); var style_css = ''; if ( newval ) { style_css = $btn_hover_selectors + ' { background-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Primary button text color. */ api( 'sinatra_primary_button_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_text_color' ); var style_css = ''; if ( newval ) { style_css = $btn_selectors + ' { color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Primary button hover text color. */ api( 'sinatra_primary_button_hover_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_hover_text_color' ); var style_css = ''; if ( newval ) { style_css = $btn_hover_selectors + ' { color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Primary button border width. */ api( 'sinatra_primary_button_border_width', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_border_width' ); var style_css = ''; if ( newval ) { style_css = $btn_selectors + ' { border-width: ' + newval.value + 'px; }'; } $style_tag.html( style_css ); }); }); /** * Primary button border radius. */ api( 'sinatra_primary_button_border_radius', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_border_radius' ); var style_css = ''; if ( newval ) { style_css = $btn_selectors + ' { ' + 'border-top-left-radius: ' + newval['top-left'] + 'px;' + 'border-top-right-radius: ' + newval['top-right'] + 'px;' + 'border-bottom-left-radius: ' + newval['bottom-left'] + 'px;' + 'border-bottom-right-radius: ' + newval['bottom-right'] + 'px; }'; console.log( style_css ); } $style_tag.html( style_css ); }); }); /** * Primary button border color. */ api( 'sinatra_primary_button_border_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_border_color' ); var style_css = ''; if ( newval ) { style_css = $btn_selectors + ' { border-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Primary button hover border color. */ api( 'sinatra_primary_button_hover_border_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_hover_border_color' ); var style_css = ''; if ( newval ) { style_css = $btn_hover_selectors + ' { border-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Primary button typography. */ api( 'sinatra_primary_button_typography', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_primary_button_typography' ); var style_css = sinatra_typography_field_css( $btn_selectors, newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); // Secondary button. var $btn_sec_selectors = '.btn-secondary, .si-btn.btn-secondary'; var $btn_sec_hover_selectors = '.btn-secondary:hover, ' + '.btn-secondary:focus, ' + '.si-btn.btn-secondary:hover, ' + '.si-btn.btn-secondary:focus'; /** * Secondary button background color. */ api( 'sinatra_secondary_button_bg_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_bg_color' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_selectors + '{ background-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button hover background color. */ api( 'sinatra_secondary_button_hover_bg_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_hover_bg_color' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_hover_selectors + '{ background-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button text color. */ api( 'sinatra_secondary_button_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_text_color' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_selectors + '{ color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button hover text color. */ api( 'sinatra_secondary_button_hover_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_hover_text_color' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_hover_selectors + '{ color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button border width. */ api( 'sinatra_secondary_button_border_width', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_border_width' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_selectors + ' { border-width: ' + newval.value + 'px; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button border radius. */ api( 'sinatra_secondary_button_border_radius', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_border_radius' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_selectors + ' { ' + 'border-top-left-radius: ' + newval['top-left'] + 'px;' + 'border-top-right-radius: ' + newval['top-right'] + 'px;' + 'border-bottom-left-radius: ' + newval['bottom-left'] + 'px;' + 'border-bottom-right-radius: ' + newval['bottom-right'] + 'px; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button border color. */ api( 'sinatra_secondary_button_border_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_border_color' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_selectors + ' { border-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button hover border color. */ api( 'sinatra_secondary_button_hover_border_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_hover_border_color' ); var style_css = ''; if ( newval ) { style_css = $btn_sec_hover_selectors + ' { border-color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Secondary button typography. */ api( 'sinatra_secondary_button_typography', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_secondary_button_typography' ); var style_css = sinatra_typography_field_css( $btn_sec_selectors, newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); // Text button. var $btn_text_selectors = '.si-btn.btn-text-1, .btn-text-1'; var $btn_text_hover_selectors = '.si-btn.btn-text-1:hover, .si-btn.btn-text-1:focus, .btn-text-1:hover, .btn-text-1:focus'; /** * Text button text color. */ api( 'sinatra_text_button_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_text_button_text_color' ); var style_css = ''; if ( newval ) { style_css = $btn_text_selectors + '{ color: ' + newval + '; }'; } $style_tag.html( style_css ); }); }); /** * Text button hover text color. */ api( 'sinatra_text_button_hover_text_color', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_text_button_hover_text_color' ); var style_css = ''; if ( newval ) { style_css = $btn_text_hover_selectors + '{ color: ' + newval + '; }'; style_css += '.si-btn.btn-text-1 > span::before { background-color: ' + newval + ' }'; } $style_tag.html( style_css ); }); }); /** * Text button typography. */ api( 'sinatra_text_button_typography', function( value ) { value.bind( function( newval ) { $style_tag = sinatra_get_style_tag( 'sinatra_text_button_typography' ); var style_css = sinatra_typography_field_css( $btn_text_selectors, newval ); sinatra_enqueue_google_font( newval['font-family'] ); $style_tag.html( style_css ); }); }); // Selective refresh. if ( api.selectiveRefresh ) { // Bind partial content rendered event. api.selectiveRefresh.bind( 'partial-content-rendered', function( placement ){ // Hero Hover Slider. if ( 'sinatra_hero_hover_slider_post_number' === placement.partial.id || 'sinatra_hero_hover_slider_elements' === placement.partial.id ) { document.querySelectorAll( placement.partial.params.selector ).forEach( ( item ) => { sinatraHoverSlider(item); }); // Force refresh height. api( 'sinatra_hero_hover_slider_height', function( newval ) { newval.callbacks.fireWith( newval, [ newval.get() ] ); } ); } // Preloader style. if ( 'sinatra_preloader_style' === placement.partial.id ) { $body.removeClass( 'si-loaded' ); setTimeout( function() { window.sinatra.preloader(); }, 300 ); } }); } // Custom Customizer Preview class (attached to the Customize API) api.sinatraCustomizerPreview = { // Init init: function () { var self = this; // Store a reference to "this" var previewBody = self.preview.body; previewBody.on( 'click', '.sinatra-set-widget', function(){ self.preview.send( 'set-footer-widget', $(this).data( 'sidebar-id' ) ); }); } }; /** * Capture the instance of the Preview since it is private (this has changed in WordPress 4.0) * * @see https://github.com/WordPress/WordPress/blob/5cab03ab29e6172a8473eb601203c9d3d8802f17/wp-admin/js/customize-controls.js#L1013 */ var sinatraOldPreview = api.Preview; api.Preview = sinatraOldPreview.extend( { initialize: function( params, options ) { // Store a reference to the Preview api.sinatraCustomizerPreview.preview = this; // Call the old Preview's initialize function sinatraOldPreview.prototype.initialize.call( this, params, options ); } } ); // Document ready $( function () { // Initialize our Preview api.sinatraCustomizerPreview.init(); } ); } )( jQuery );;customizer/class-sinatra-customizer-info-section.php000064400000004313151231536700017026 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Info_Section' ) ) : /** * Custom section in Customizer. */ class Sinatra_Customizer_Info_Section extends WP_Customize_Section { /** * The type of customize section being rendered. * * @since 1.0.0 * @var string */ public $type = 'sinatra-info'; /** * Button style. * * @since 1.0.0 * @var string */ public $style = ''; /** * Custom URL. * * @since 1.0.0 * @var string */ public $url = ''; /** * Link target. * * @since 1.0.0 * @var string */ public $target = ''; /** * Tagline. * * @since 1.0.0 * @var string */ public $tagline = ''; /** * Add custom parameters to pass to the JS via JSON. * * @since 1.0.0 */ public function json() { $json = parent::json(); $json['url'] = $this->url; $json['target'] = $this->target; $json['tagline'] = $this->tagline; $json['style'] = $this->style ? ' ' . $this->style : false; return $json; } /** * Outputs the Underscore.js template. * * @since 1.0.0 * @access public * @return void */ protected function render_template() { ?>
      • <# if ( data.url ) { #> <# if ( data.style ) { #> {{ data.title }} <# } else { #> {{ data.title }} <# if ( data.tagline ) { #> {{ data.tagline }} <# } #> <# } #> <# } #>

      • * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer' ) ) : /** * Sinatra Customizer class */ class Sinatra_Customizer { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * Customizer options. * * @since 1.0.0 * @var Array */ private static $options; /** * Main Sinatra_Customizer Instance. * * @since 1.0.0 * @return Sinatra_Customizer */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Customizer ) ) { self::$instance = new self(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Loads our Customizer custom controls. add_action( 'customize_register', array( $this, 'load_custom_controls' ) ); // Loads our Customizer helper functions. add_action( 'customize_register', array( $this, 'load_customizer_helpers' ) ); // Loads our Customizer widgets classes. add_action( 'customize_register', array( $this, 'load_customizer_widgets' ) ); // Tweak inbuilt sections. add_action( 'customize_register', array( $this, 'customizer_tweak' ), 11 ); // Registers our Customizer options. add_action( 'after_setup_theme', array( $this, 'register_options' ) ); // Registers our Customizer options. add_action( 'customize_register', array( $this, 'register_options_new' ) ); // Loads our Customizer controls assets. add_action( 'customize_controls_enqueue_scripts', array( $this, 'load_assets' ), 10 ); // Enqueues our Customizer preview assets. add_action( 'customize_preview_init', array( $this, 'load_preview_assets' ) ); // Add available top bar widgets panel. add_action( 'customize_controls_print_footer_scripts', array( $this, 'sinatra_customizer_widgets' ) ); add_action( 'customize_controls_print_footer_scripts', array( 'Sinatra_Customizer_Control', 'template_units' ) ); } /** * Loads our Customizer custom controls. * * @since 1.0.0 * @param WP_Customize_Manager $customizer Instance of WP_Customize_Manager class. */ public function load_custom_controls( $customizer ) { // Directory where each custom control is located. $path = SINATRA_THEME_PATH . '/inc/customizer/controls/'; // Require base control class. require $path . '/class-sinatra-customizer-control.php'; // phpcs:ignore $controls = $this->get_custom_controls(); // Load custom controls classes. foreach ( $controls as $control => $class ) { $control_path = $path . '/' . $control . '/class-sinatra-customizer-control-' . $control . '.php'; if ( file_exists( $control_path ) ) { require_once $control_path; // phpcs:ignore $customizer->register_control_type( $class ); } } } /** * Loads Customizer helper functions and sanitization callbacks. * * @since 1.0.0 */ public function load_customizer_helpers() { require SINATRA_THEME_PATH . '/inc/customizer/customizer-helpers.php'; // phpcs:ignore require SINATRA_THEME_PATH . '/inc/customizer/customizer-callbacks.php'; // phpcs:ignore require SINATRA_THEME_PATH . '/inc/customizer/customizer-partials.php'; // phpcs:ignore } /** * Loads Customizer widgets classes. * * @since 1.0.0 */ public function load_customizer_widgets() { $widgets = sinatra_get_customizer_widgets(); require SINATRA_THEME_PATH . '/inc/customizer/widgets/class-sinatra-customizer-widget.php'; // phpcs:ignore foreach ( $widgets as $id => $class ) { $path = SINATRA_THEME_PATH . '/inc/customizer/widgets/class-sinatra-customizer-widget-' . $id . '.php'; if ( file_exists( $path ) ) { require $path; // phpcs:ignore } } } /** * Move inbuilt panels into our sections. * * @since 1.0.0 * @param WP_Customize_Manager $customizer Instance of WP_Customize_Manager class. */ public static function customizer_tweak( $customizer ) { // Site Identity to Logo. $customizer->get_section( 'title_tagline' )->priority = 2; $customizer->get_section( 'title_tagline' )->title = esc_html__( 'Logos & Site Title', 'sinatra' ); // Custom logo. $customizer->get_control( 'custom_logo' )->description = esc_html__( 'Upload your logo image here.', 'sinatra' ); $customizer->get_control( 'custom_logo' )->priority = 10; $customizer->get_setting( 'custom_logo' )->transport = 'postMessage'; // Add selective refresh partial for Custom Logo. $customizer->selective_refresh->add_partial( 'custom_logo', array( 'selector' => '.sinatra-logo', 'render_callback' => 'sinatra_logo', 'container_inclusive' => false, 'fallback_refresh' => true, ) ); // Site title. $customizer->get_setting( 'blogname' )->transport = 'postMessage'; $customizer->get_control( 'blogname' )->description = esc_html__( 'Enter the name of your site here.', 'sinatra' ); $customizer->get_control( 'blogname' )->priority = 60; // Site description. $customizer->get_setting( 'blogdescription' )->transport = 'postMessage'; $customizer->get_control( 'blogdescription' )->description = esc_html__( 'A tagline is a short phrase, or sentence, used to convey the essence of the site.', 'sinatra' ); $customizer->get_control( 'blogdescription' )->priority = 70; // Site icon. $customizer->get_control( 'site_icon' )->priority = 90; // Site Background. $background_fields = array( 'background_color', 'background_image', 'background_preset', 'background_position', 'background_size', 'background_repeat', 'background_attachment', 'background_image', ); foreach ( $background_fields as $field ) { $customizer->get_control( $field )->section = 'sinatra_section_colors'; $customizer->get_control( $field )->priority = 50; } // Load the custom section class. require SINATRA_THEME_PATH . '/inc/customizer/class-sinatra-customizer-info-section.php'; // phpcs:ignore // Register custom section types. $customizer->register_section_type( 'Sinatra_Customizer_Info_Section' ); } /** * Registers our Customizer options. * * @since 1.0.0 */ public function register_options() { // Directory where each individual section is located. $path = SINATRA_THEME_PATH . '/inc/customizer/settings/class-sinatra-customizer-'; /** * Customizer sections. */ $sections = array( 'sections', 'colors', 'typography', 'layout', 'top-bar', 'main-header', 'main-navigation', 'hero', 'page-header', 'logo', 'single-post', 'blog-page', 'main-footer', 'copyright-settings', 'pre-footer', 'buttons', 'misc', 'transparent-header', 'sticky-header', 'sidebar', 'breadcrumbs', ); foreach ( $sections as $section ) { if ( file_exists( $path . $section . '.php' ) ) { require_once $path . $section . '.php'; // phpcs:ignore } } } /** * Registers our Customizer options. * * @since 1.0.0 * * @param WP_Customize_Manager $customizer instance of WP_Customize_Manager. * * @return void */ public function register_options_new( $customizer ) { $options = $this->get_customizer_options(); if ( isset( $options['panel'] ) && ! empty( $options['panel'] ) ) { foreach ( $options['panel'] as $id => $args ) { $this->add_panel( $id, $args, $customizer ); } } if ( isset( $options['section'] ) && ! empty( $options['section'] ) ) { foreach ( $options['section'] as $id => $args ) { $this->add_section( $id, $args, $customizer ); } } if ( isset( $options['setting'] ) && ! empty( $options['setting'] ) ) { foreach ( $options['setting'] as $id => $args ) { $this->add_setting( $id, $args, $customizer ); $this->add_control( $id, $args['control'], $customizer ); } } } /** * Filter and return Customizer options. * * @since 1.0.0 * * @return Array Customizer options for registering Sections/Panels/Controls. */ public function get_customizer_options() { if ( ! is_null( self::$options ) ) { return self::$options; } return apply_filters( 'sinatra_customizer_options', array() ); } /** * Register Customizer Panel. * * @since 1.0.0 * * @param Array $panel Panel settings. * @param WP_Customize_Manager $customizer instance of WP_Customize_Manager. * * @return void */ private function add_panel( $id, $args, $customizer ) { $class = sinatra_get_prop( $args, 'class', 'WP_Customize_Panel' ); $customizer->add_panel( new $class( $customizer, $id, $args ) ); } /** * Register Customizer Section. * * @since 1.0.0 * * @param Array $section Section settings. * @param WP_Customize_Manager $customizer instance of WP_Customize_Manager. * * @return void */ private function add_section( $id, $args, $customizer ) { $class = sinatra_get_prop( $args, 'class', 'WP_Customize_Section' ); $customizer->add_section( new $class( $customizer, $id, $args ) ); } /** * Register Customizer Control. * * @since 1.0.0 * * @param Array $control Control settings. * @param WP_Customize_Manager $customizer instance of WP_Customize_Manager. * * @return void */ private function add_control( $id, $args, $customizer ) { $class = $this->get_control_class( sinatra_get_prop( $args, 'type' ) ); $args['setting'] = $id; if ( false !== $class ) { $customizer->add_control( new $class( $customizer, $id, $args ) ); } else { $customizer->add_control( $id, $args ); } } /** * Register Customizer Setting. * * @since 1.0.0 * * @param Array $setting Settings. * @param WP_Customize_Manager $customizer instance of WP_Customize_Manager. * * @return void */ private function add_setting( $id, $setting, $customizer ) { $setting = wp_parse_args( $setting, $this->get_customizer_defaults( 'setting' ) ); $customizer->add_setting( $id, array( 'default' => sinatra()->options->get_default( $id ), 'type' => sinatra_get_prop( $setting, 'type' ), 'transport' => sinatra_get_prop( $setting, 'transport' ), 'sanitize_callback' => sinatra_get_prop( $setting, 'sanitize_callback', 'sinatra_no_sanitize' ), ) ); $partial = sinatra_get_prop( $setting, 'partial', false ); if ( $partial && isset( $customizer->selective_refresh ) ) { $customizer->selective_refresh->add_partial( $id, array( 'selector' => sinatra_get_prop( $partial, 'selector' ), 'container_inclusive' => sinatra_get_prop( $partial, 'container_inclusive' ), 'render_callback' => sinatra_get_prop( $partial, 'render_callback' ), 'fallback_refresh' => sinatra_get_prop( $partial, 'fallback_refresh' ), ) ); } } /** * Return custom controls. * * @since 1.0.0 * * @return Array custom control slugs & classnames. */ private function get_custom_controls() { return apply_filters( 'sinatra_custom_customizer_controls', array( 'toggle' => 'Sinatra_Customizer_Control_Toggle', 'select' => 'Sinatra_Customizer_Control_Select', 'heading' => 'Sinatra_Customizer_Control_Heading', 'color' => 'Sinatra_Customizer_Control_Color', 'range' => 'Sinatra_Customizer_Control_Range', 'spacing' => 'Sinatra_Customizer_Control_Spacing', 'widget' => 'Sinatra_Customizer_Control_Widget', 'radio-image' => 'Sinatra_Customizer_Control_Radio_Image', 'background' => 'Sinatra_Customizer_Control_Background', 'text' => 'Sinatra_Customizer_Control_Text', 'textarea' => 'Sinatra_Customizer_Control_Textarea', 'typography' => 'Sinatra_Customizer_Control_Typography', 'button' => 'Sinatra_Customizer_Control_Button', 'sortable' => 'Sinatra_Customizer_Control_Sortable', 'info' => 'Sinatra_Customizer_Control_Info', 'design-options' => 'Sinatra_Customizer_Control_Design_Options', 'alignment' => 'Sinatra_Customizer_Control_Alignment', 'checkbox-group' => 'Sinatra_Customizer_Control_Checkbox_Group', ) ); } /** * Return default values for customizer parts. * * @since 1.0.0 * * @return Array default values for the Customizer Configurations. */ private function get_customizer_defaults( $type ) { $defaults = array(); switch ( $type ) { case 'setting': $defaults = array( 'type' => 'theme_mod', 'transport' => 'refresh', ); break; case 'control': $defaults = array(); break; default: break; } return apply_filters( 'sinatra_customizer_configuration_defaults', $defaults, $type ); } /** * Get custom control classname. * * @since 1.0.0 * * @param string $control Control ID. * * @return string Control classname. */ private function get_control_class( $type ) { if ( false !== strpos( $type, 'sinatra-' ) ) { $controls = $this->get_custom_controls(); $type = trim( str_replace( 'sinatra-', '', $type ) ); if ( isset( $controls[ $type ] ) ) { return $controls[ $type ]; } } return false; } /** * Loads our own Customizer assets. * * @since 1.0.0 */ public function load_assets() { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; /** * Enqueue our Customizer styles. */ wp_enqueue_style( 'sinatra-customizer-styles', SINATRA_THEME_URI . '/inc/customizer/assets/css/sinatra-customizer' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION ); /** * Enqueue our Customizer controls script. */ wp_enqueue_script( 'sinatra-customizer-js', SINATRA_THEME_URI . '/inc/customizer/assets/js/' . $sinatra_dir . 'customize-controls' . $sinatra_suffix . '.js', array( 'wp-color-picker', 'jquery', 'customize-base' ), SINATRA_THEME_VERSION, true ); /** * Enqueue Customizer controls dependency script. */ wp_enqueue_script( 'sinatra-control-dependency-js', SINATRA_THEME_URI . '/inc/customizer/assets/js/' . $sinatra_dir . 'customize-dependency' . $sinatra_suffix . '.js', array( 'jquery' ), SINATRA_THEME_VERSION, true ); /** * Localize JS variables */ $sinatra_customizer_localized = array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'wpnonce' => wp_create_nonce( 'sinatra_customizer' ), 'color_palette' => array( '#ffffff', '#000000', '#e4e7ec', '#3857F1', '#f7b40b', '#e04b43', '#30373e', '#8a63d4' ), 'preview_url_for_section' => $this->get_preview_urls_for_section(), 'strings' => array( 'selectCategory' => esc_html__( 'Select a category', 'sinatra' ), ), ); /** * Allow customizer localized vars to be filtered. */ $sinatra_customizer_localized = apply_filters( 'sinatra_customizer_localized', $sinatra_customizer_localized ); wp_localize_script( 'sinatra-customizer-js', 'sinatra_customizer_localized', $sinatra_customizer_localized ); } /** * Loads customizer preview assets * * @since 1.0.0 */ public function load_preview_assets() { // Script debug. $sinatra_dir = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'dev/' : ''; $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $version = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? time() : SINATRA_THEME_VERSION; wp_enqueue_script( 'sinatra-customizer-preview-js', SINATRA_THEME_URI . '/inc/customizer/assets/js/' . $sinatra_dir . 'customize-preview' . $sinatra_suffix . '.js', array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $version, true ); // Enqueue Customizer preview styles. wp_enqueue_style( 'sinatra-customizer-preview-styles', SINATRA_THEME_URI . '/inc/customizer/assets/css/sinatra-customizer-preview' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION ); /** * Localize JS variables. */ $sinatra_customizer_localized = array( 'default_system_font' => sinatra()->fonts->get_default_system_font(), 'fonts' => sinatra()->fonts->get_fonts(), 'google_fonts_url' => '//fonts.googleapis.com', 'google_font_weights' => '100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i', ); /** * Allow customizer localized vars to be filtered. */ $sinatra_customizer_localized = apply_filters( 'sinatra_customize_preview_localized', $sinatra_customizer_localized ); wp_localize_script( 'sinatra-customizer-preview-js', 'sinatra_customizer_preview', $sinatra_customizer_localized ); } /** * Print the html template used to render the add top bar widgets frame. * * @since 1.0.0 */ public function sinatra_customizer_widgets() { // Get customizer widgets. $widgets = sinatra_get_customizer_widgets(); // Check if any available widgets exist. if ( ! is_array( $widgets ) || empty( $widgets ) ) { return; } ?>

        $classname ) { ?>
        template(); ?>
        'post', 'posts_per_page' => 1, 'orderby' => 'rand', ) ); if ( count( $posts ) ) { $return['sinatra_section_blog_single_post'] = get_permalink( $posts[0] ); } // Preview blog page. $return['sinatra_section_blog_page'] = sinatra_get_blog_url(); return $return; } } endif; customizer/controls/alignment/alignment.css000064400000010311151231536700015260 0ustar00/*****************************************/ /* Customizer control color style /*****************************************/ /** * Import configuration file with variables. */ .sinatra-alignment-control, .background-position-control { margin-top: 12px; } .sinatra-alignment-control input[type="radio"]:checked ~ .button, .background-position-control input[type="radio"]:checked ~ .button { background: #0071a1; border-color: #0071a1; z-index: 1; color: #FFF !important; } .sinatra-alignment-control input[type="radio"]:checked ~ .button .alignment-position-center-icon:before, .sinatra-alignment-control input[type="radio"]:checked ~ .button .background-position-center-icon:before, .background-position-control input[type="radio"]:checked ~ .button .alignment-position-center-icon:before, .background-position-control input[type="radio"]:checked ~ .button .background-position-center-icon:before { background-color: #FFF !important; } .sinatra-alignment-control input[type="radio"]:focus ~ .button, .background-position-control input[type="radio"]:focus ~ .button { border-color: #5b9dd9; -webkit-box-shadow: none !important; box-shadow: none !important; color: #23282d; } .sinatra-alignment-control .alignment-position-center-icon, .sinatra-alignment-control .alignment-position-center-icon:before { display: inline-block; line-height: 1; text-align: center; -webkit-transition: background-color .1s ease-in; transition: background-color .1s ease-in; } .sinatra-alignment-control .alignment-position-center-icon { height: 20px; margin-top: 13px; vertical-align: top; width: 20px; } .sinatra-alignment-control .alignment-position-center-icon:before { background-color: #555; border-radius: 50%; content: ""; height: 12px; width: 12px; } .sinatra-alignment-control .button:hover .alignment-position-center-icon:before, .sinatra-alignment-control input[type="radio"]:focus ~ .button .alignment-position-center-icon:before { background-color: #23282d; } .sinatra-alignment-control .button-group { display: block; } .sinatra-alignment-control .button-group.disabled { opacity: .15; pointer-events: none; } .sinatra-alignment-control .button-group .button { border-radius: 0; -webkit-box-shadow: none; box-shadow: none; /* Following properties are overridden by buttons responsive styles (see: wp-includes/css/buttons.css). */ height: 40px !important; line-height: 2.9 !important; margin: 0 -1px 0 0 !important; padding: 0 10px 1px !important; position: relative; } .sinatra-alignment-control .button-group .button:active, .sinatra-alignment-control .button-group .button:hover, .sinatra-alignment-control .button-group .button:focus { z-index: 1; } .sinatra-alignment-control .button-group .dashicons { margin-top: 9px; } .sinatra-alignment-control .button-group > label { margin: 0 !important; } .sinatra-alignment-control .button-group > label.disabled { opacity: .15; pointer-events: none; } .sinatra-alignment-control .button-group.si-top .si-left .dashicons { -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .sinatra-alignment-control .button-group.si-top .si-right .dashicons { -webkit-transform: rotate(-45deg); -ms-transform: rotate(-45deg); transform: rotate(-45deg); } .sinatra-alignment-control .button-group.si-bottom .si-left .dashicons { -webkit-transform: rotate(-45deg); -ms-transform: rotate(-45deg); transform: rotate(-45deg); } .sinatra-alignment-control .button-group.si-bottom .si-right .dashicons { -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .sinatra-alignment-control .button-group:first-child > label:first-child .button { border-top-left-radius: 3px; } .sinatra-alignment-control .button-group:first-child > label:last-child .button { border-top-right-radius: 3px; } .sinatra-alignment-control .button-group:last-child > label:first-child .button { border-bottom-left-radius: 3px; } .sinatra-alignment-control .button-group:last-child > label:last-child .button { border-bottom-right-radius: 3px; } .sinatra-alignment-control .button-group + .button-group { margin-top: -1px; } customizer/controls/alignment/alignment.js000064400000000322151231536700015105 0ustar00;(function($) { "use strict"; wp.customize.controlConstructor['sinatra-alignment'] = wp.customize.Control.extend({ ready: function() { 'use strict'; var control = this; }, }); })(jQuery);;customizer/controls/alignment/alignment.min.css000064400000006122151231536710016050 0ustar00.background-position-control,.sinatra-alignment-control{margin-top:12px}.background-position-control input[type=radio]:checked~.button,.sinatra-alignment-control input[type=radio]:checked~.button{background:#0071a1;border-color:#0071a1;z-index:1;color:#fff!important}.background-position-control input[type=radio]:checked~.button .alignment-position-center-icon:before,.background-position-control input[type=radio]:checked~.button .background-position-center-icon:before,.sinatra-alignment-control input[type=radio]:checked~.button .alignment-position-center-icon:before,.sinatra-alignment-control input[type=radio]:checked~.button .background-position-center-icon:before{background-color:#fff!important}.background-position-control input[type=radio]:focus~.button,.sinatra-alignment-control input[type=radio]:focus~.button{border-color:#5b9dd9;box-shadow:none!important;color:#23282d}.sinatra-alignment-control .alignment-position-center-icon,.sinatra-alignment-control .alignment-position-center-icon:before{display:inline-block;line-height:1;text-align:center;transition:background-color .1s ease-in}.sinatra-alignment-control .alignment-position-center-icon{height:20px;margin-top:13px;vertical-align:top;width:20px}.sinatra-alignment-control .alignment-position-center-icon:before{background-color:#555;border-radius:50%;content:"";height:12px;width:12px}.sinatra-alignment-control .button:hover .alignment-position-center-icon:before,.sinatra-alignment-control input[type=radio]:focus~.button .alignment-position-center-icon:before{background-color:#23282d}.sinatra-alignment-control .button-group{display:block}.sinatra-alignment-control .button-group.disabled{opacity:.15;pointer-events:none}.sinatra-alignment-control .button-group .button{border-radius:0;box-shadow:none;height:40px!important;line-height:2.9!important;margin:0 -1px 0 0!important;padding:0 10px 1px!important;position:relative}.sinatra-alignment-control .button-group .button:active,.sinatra-alignment-control .button-group .button:focus,.sinatra-alignment-control .button-group .button:hover{z-index:1}.sinatra-alignment-control .button-group .dashicons{margin-top:9px}.sinatra-alignment-control .button-group>label{margin:0!important}.sinatra-alignment-control .button-group>label.disabled{opacity:.15;pointer-events:none}.sinatra-alignment-control .button-group.si-top .si-left .dashicons{transform:rotate(45deg)}.sinatra-alignment-control .button-group.si-bottom .si-left .dashicons,.sinatra-alignment-control .button-group.si-top .si-right .dashicons{transform:rotate(-45deg)}.sinatra-alignment-control .button-group.si-bottom .si-right .dashicons{transform:rotate(45deg)}.sinatra-alignment-control .button-group:first-child>label:first-child .button{border-top-left-radius:3px}.sinatra-alignment-control .button-group:first-child>label:last-child .button{border-top-right-radius:3px}.sinatra-alignment-control .button-group:last-child>label:first-child .button{border-bottom-left-radius:3px}.sinatra-alignment-control .button-group:last-child>label:last-child .button{border-bottom-right-radius:3px}.sinatra-alignment-control .button-group+.button-group{margin-top:-1px}customizer/controls/alignment/alignment.min.js000064400000000213151231536710015667 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-alignment"]=wp.customize.Control.extend({ready:function(){}})}(jQuery);;customizer/controls/alignment/alignment.scss000064400000005224151231536710015453 0ustar00/*****************************************/ /* Customizer control color style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .sinatra-alignment-control, .background-position-control { margin-top: 12px; input[type="radio"]:checked ~ .button { background: #0071a1; border-color: #0071a1; z-index: 1; color: #FFF !important; .alignment-position-center-icon:before, .background-position-center-icon:before { background-color: #FFF !important; } } input[type="radio"]:focus ~ .button { border-color: #5b9dd9; box-shadow: none !important; color: #23282d; } } .sinatra-alignment-control { .alignment-position-center-icon, .alignment-position-center-icon:before { display: inline-block; line-height: 1; text-align: center; transition: background-color .1s ease-in; } .alignment-position-center-icon { height: 20px; margin-top: 13px; vertical-align: top; width: 20px; &:before { background-color: #555; border-radius: 50%; content: ""; height: 12px; width: 12px; } } .button:hover .alignment-position-center-icon:before, input[type="radio"]:focus ~ .button .alignment-position-center-icon:before { background-color: #23282d; } .button-group { display: block; &.disabled { opacity: .15; pointer-events: none; } .button { border-radius: 0; box-shadow: none; /* Following properties are overridden by buttons responsive styles (see: wp-includes/css/buttons.css). */ height: 40px !important; line-height: 2.9 !important; margin: 0 -1px 0 0 !important; padding: 0 10px 1px !important; position: relative; &:active, &:hover, &:focus { z-index: 1; } } .dashicons { margin-top: 9px; } & > label { margin: 0 !important; &.disabled { opacity: .15; pointer-events: none; } } &.si-top { .si-left { .dashicons { transform: rotate(45deg); } } .si-right { .dashicons { transform: rotate(-45deg); } } } &.si-bottom { .si-left { .dashicons { transform: rotate(-45deg); } } .si-right { .dashicons { transform: rotate(45deg); } } } &:first-child { & > label:first-child { .button { border-top-left-radius: 3px; } } & > label:last-child { .button { border-top-right-radius: 3px; } } } &:last-child { & > label:first-child { .button { border-bottom-left-radius: 3px; } } & > label:last-child { .button { border-bottom-right-radius: 3px; } } } & + .button-group { margin-top: -1px; } } }customizer/controls/alignment/class-sinatra-customizer-control-alignment.php000064400000023071151231536710023711 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Alignment' ) ) : /** * Sinatra Customizer custom background control class. */ class Sinatra_Customizer_Control_Alignment extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-alignment'; /** * Set the default typography options. * * @since 1.0.0 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); $this->strings = wp_parse_args( isset( $args['strings'] ) ? $args['strings'] : array(), array( 'top-left' => __( 'Top Left', 'sinatra' ), 'top' => __( 'Top', 'sinatra' ), 'top-right' => __( 'Top Right', 'sinatra' ), 'left' => __( 'Left', 'sinatra' ), 'center' => __( 'Center', 'sinatra' ), 'right' => __( 'Right', 'sinatra' ), 'bottom-left' => __( 'Bottom Left', 'sinatra' ), 'bottom' => __( 'Bottom', 'sinatra' ), 'bottom-right' => __( 'Bottom Right', 'sinatra' ), ) ); $this->icons = wp_parse_args( isset( $args['icons'] ) ? $args['icons'] : array(), array( 'top-left' => 'dashicons dashicons-arrow-left-alt', 'top' => 'dashicons dashicons-arrow-up-alt', 'top-right' => 'dashicons dashicons-arrow-right-alt', 'left' => 'dashicons dashicons-arrow-left-alt', 'center' => 'alignment-position-center-icon', 'right' => 'dashicons dashicons-arrow-right-alt', 'bottom-left' => 'dashicons dashicons-arrow-left-alt', 'bottom' => 'dashicons dashicons-arrow-down-alt', 'bottom-right' => 'dashicons dashicons-arrow-right-alt', ) ); // Alignment choices. $default_choices = array( 'top-left' => true, 'top' => true, 'top-right' => true, 'left' => true, 'center' => true, 'right' => true, 'bottom-left' => true, 'bottom' => true, 'bottom-right' => true, ); if ( isset( $args['choices'] ) ) { if ( 'horizontal' === $args['choices'] ) { $this->choices = array( 'top-left' => false, 'top' => false, 'top-right' => false, 'left' => true, 'center' => true, 'right' => true, 'bottom-left' => false, 'bottom' => false, 'bottom-right' => false, ); } elseif ( 'vertical' === $args['choices'] ) { $this->choices = array( 'top-left' => false, 'top' => true, 'top-right' => false, 'left' => false, 'center' => true, 'right' => false, 'bottom-left' => false, 'bottom' => true, 'bottom-right' => false, ); } elseif ( is_array( $args['choices'] ) ) { $this->choices = array( 'top-left' => false, 'top' => false, 'top-right' => false, 'left' => false, 'center' => false, 'right' => false, 'bottom-left' => false, 'bottom' => false, 'bottom-right' => false, ); foreach ( $args['choices'] as $choice ) { $this->choices[ $choice ] = true; } } } else { $this->choices = $default_choices; } foreach ( $this->choices as $key => $value ) { $this->choices[ $key ] = true === $value ? '' : 'disabled'; } } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['choices'] = $this->choices; $this->json['l10n'] = $this->strings; $this->json['icons'] = $this->icons; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #>
        {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# } #>
        <# if ( ! data.choices['top-left'] && ! data.choices['top'] && ! data.choices['top-right'] ) { #>
        <# } #> <# if ( ! data.choices['left'] && ! data.choices['center'] && ! data.choices['right'] ) { #>
        <# } #> <# if ( ! data.choices['bottom-left'] && ! data.choices['bottom'] && ! data.choices['bottom-right'] ) { #>
        <# } #>
        ' ); } if ( removeButton.length ) { removeButton.show(); } }); e.preventDefault(); }); control.container.on( 'click', '.background-image-upload-remove-button', function( e ) { var preview, removeButton; e.preventDefault(); control.saveValue( 'background-image', '' ); control.saveValue( 'background-image-id', '' ); preview = control.container.find( '.placeholder, .thumbnail' ); removeButton = control.container.find( '.background-image-upload-remove-button' ); // Hide unnecessary controls. control.container.find( '.background-image-advanced' ).hide(); control.container.find( '.advanced-settings' ).addClass( 'hidden' ).removeClass( 'up' ); if ( preview.length ) { preview.removeClass().addClass( 'placeholder' ).html( control.params.l10n.placeholder ); } if ( removeButton.length ) { removeButton.hide(); } }); control.container.on( 'click', '.advanced-settings', function( e ) { $(this).toggleClass('up'); control.container.find( '.background-image-advanced' ).toggle(); }); // Change the text value control.container.find( 'input.sinatra-range-input' ).on( 'change keyup', function() { control.autocorrect_range_input_number( $( this ), 1000, sinatra_range_input_number_timeout ); } ).on( 'focusout', function() { control.autocorrect_range_input_number( $( this ), 0, sinatra_range_input_number_timeout ); } ); // Update the range value control.container.find( 'input[type=range]' ).on( 'mousedown', function() { range = $( this ); range_input = range.parent().children( '.sinatra-range-input' ); value = range.attr( 'value' ); range_input.val( value ); range.mousemove( function() { value = range.attr( 'value' ); range_input.val( value ); clearTimeout( sinatra_range_input_number_timeout ); sinatra_range_input_number_timeout = setTimeout( function() { control.saveValue( range.data( 'key' ), value ); }, 25 ); } ); } ); }, /** * Saves the value. */ saveValue: function( property, value ) { var val = this.setting.get(); val = val || {}; if ( value !== val[ property ] ) { val = JSON.parse( JSON.stringify( val ) ); val[ property ] = value; this.setting.set( val ); } }, autocorrect_range_input_number: function( input_number, timeout ) { var range_input = input_number, range = range_input.parent().find( 'input[type="range"]' ), value = parseFloat( range_input.val() ), reset = parseFloat( range.find( '.sinatra-reset-range' ).attr( 'data-reset_value' ) ), step = parseFloat( range_input.attr( 'step' ) ), min = parseFloat( range_input.attr( 'min') ), max = parseFloat( range_input.attr( 'max') ); clearTimeout( timeout ); timeout = setTimeout( function() { if ( isNaN( value ) ) { range_input.val( reset ); range.val( reset ).trigger( 'change' ); return; } if ( step >= 1 && value % 1 !== 0 ) { value = Math.round( value ); range_input.val( value ); range.val( value ).trigger( 'change' ); } if ( value > max ) { range_input.val( max ); range.val( max ).trigger( 'change' ); } if ( value < min ) { range_input.val( min ); range.val( min ).trigger( 'change' ); } }, timeout ); range.val( value ).trigger( 'change' ); this.saveValue( range.data('key'), value ); } }); })( jQuery );;customizer/controls/background/background.min.css000064400000001751151231536710016355 0ustar00.sinatra-background-wrapper .actions{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-top:12px}.sinatra-background-wrapper .actions .button{margin-top:0}.sinatra-background-wrapper .actions .advanced-settings{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-left:auto;text-decoration:none;color:#555d66}.sinatra-background-wrapper .actions .advanced-settings.up span.dashicons{transform:rotate(180deg)}.sinatra-background-wrapper .actions .advanced-settings:hover{color:#0085ba}.sinatra-background-wrapper .actions .advanced-settings.hidden{display:none}.sinatra-background-wrapper .actions .background-image-upload-remove-button{margin-right:6px}.sinatra-background-wrapper .background-image{margin-top:12px;margin-bottom:24px}.sinatra-background-wrapper .background-repeat{margin-bottom:6px}.sinatra-background-wrapper .more-settings.up{color:#0085ba}.sinatra-background-wrapper h4{margin-bottom:12px}customizer/controls/background/background.min.js000064400000010762151231536710016203 0ustar00!function($){wp.customize.controlConstructor["sinatra-background"]=wp.customize.Control.extend({ready:function(){"use strict";var range,range_input,sinatra_range_input_number_timeout,control=this,value=control.setting._value;control.container.find(".background-image-advanced").hide(),control.container.on("change",".background-repeat select",(function(){control.saveValue("background-repeat",$(this).val())})),control.container.on("change click",".background-size input",(function(){control.saveValue("background-size",$(this).val())})),control.container.on("change click",".background-attachment input",(function(){control.saveValue("background-attachment",$(this).val())})),control.container.on("click",".background-image-upload-button",(function(e){var image=wp.media({multiple:!1,title:control.params.l10n.select_image,button:{text:control.params.l10n.use_image}}).open().on("select",(function(){var previewImage,imageUrl,imageID,preview,removeButton,uploadedImageJSON=image.state().get("selection").first().toJSON();previewImage=_.isUndefined(uploadedImageJSON.sizes)?uploadedImageJSON.url:_.isUndefined(uploadedImageJSON.sizes.medium)?_.isUndefined(uploadedImageJSON.sizes.thumbnail)?_.isUndefined(uploadedImageJSON.sizes.full)?uploadedImageJSON.url:uploadedImageJSON.sizes.full.url:uploadedImageJSON.sizes.thumbnail.url:uploadedImageJSON.sizes.medium.url,imageUrl=uploadedImageJSON.url,imageID=uploadedImageJSON.id,uploadedImageJSON.width,uploadedImageJSON.height,""!==imageUrl&&(control.container.find(".background-image-advanced").show(),control.container.find(".advanced-settings").removeClass("hidden").addClass("up")),control.saveValue("background-image",imageUrl),control.saveValue("background-image-id",imageID),preview=control.container.find(".placeholder, .thumbnail"),removeButton=control.container.find(".background-image-upload-remove-button"),preview.length&&preview.removeClass().addClass("thumbnail thumbnail-image").html(''),removeButton.length&&removeButton.show()}));e.preventDefault()})),control.container.on("click",".background-image-upload-remove-button",(function(e){var preview,removeButton;e.preventDefault(),control.saveValue("background-image",""),control.saveValue("background-image-id",""),preview=control.container.find(".placeholder, .thumbnail"),removeButton=control.container.find(".background-image-upload-remove-button"),control.container.find(".background-image-advanced").hide(),control.container.find(".advanced-settings").addClass("hidden").removeClass("up"),preview.length&&preview.removeClass().addClass("placeholder").html(control.params.l10n.placeholder),removeButton.length&&removeButton.hide()})),control.container.on("click",".advanced-settings",(function(e){$(this).toggleClass("up"),control.container.find(".background-image-advanced").toggle()})),control.container.find("input.sinatra-range-input").on("change keyup",(function(){control.autocorrect_range_input_number($(this),1e3,sinatra_range_input_number_timeout)})).on("focusout",(function(){control.autocorrect_range_input_number($(this),0,sinatra_range_input_number_timeout)})),control.container.find("input[type=range]").on("mousedown",(function(){range=$(this),range_input=range.parent().children(".sinatra-range-input"),value=range.attr("value"),range_input.val(value),range.mousemove((function(){value=range.attr("value"),range_input.val(value),clearTimeout(sinatra_range_input_number_timeout),sinatra_range_input_number_timeout=setTimeout((function(){control.saveValue(range.data("key"),value)}),25)}))}))},saveValue:function(property,value){var val=this.setting.get();value!==(val=val||{})[property]&&((val=JSON.parse(JSON.stringify(val)))[property]=value,this.setting.set(val))},autocorrect_range_input_number:function(input_number,timeout){var range_input=input_number,range=range_input.parent().find('input[type="range"]'),value=parseFloat(range_input.val()),reset=parseFloat(range.find(".sinatra-reset-range").attr("data-reset_value")),step=parseFloat(range_input.attr("step")),min=parseFloat(range_input.attr("min")),max=parseFloat(range_input.attr("max"));clearTimeout(timeout),timeout=setTimeout((function(){if(isNaN(value))return range_input.val(reset),void range.val(reset).trigger("change");step>=1&&value%1!=0&&(value=Math.round(value),range_input.val(value),range.val(value).trigger("change")),value>max&&(range_input.val(max),range.val(max).trigger("change")),value * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Background' ) ) : /** * Sinatra Customizer custom background control class. */ class Sinatra_Customizer_Control_Background extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-background'; /** * Show advanced settings. * * @since 1.0.0 * @var boolean */ public $advanced = true; /** * Media upload strings. * * @since 1.0.0 * @var boolean */ public $strings = array(); /** * Set the default typography options. * * @since 1.0.0 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); $default_strings = array( 'placeholder' => __( 'No image selected', 'sinatra' ), 'less' => __( 'Less Settings', 'sinatra' ), 'more' => __( 'Advanced', 'sinatra' ), 'select_image' => __( 'Select Image', 'sinatra' ), 'use_image' => __( 'Use This Image', 'sinatra' ), ); $strings = isset( $args['strings'] ) ? $args['strings'] : array(); $this->strings = wp_parse_args( $strings, $default_strings ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['advanced'] = $this->advanced; $this->json['l10n'] = $this->strings; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #>
        {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# } #>
        <# if ( data.value['background-image'] ) { #>
        <# } else { #>
        <# } #>
        <# if ( data.advanced ) { #> <# } #>
        <# if ( data.advanced ) { #>

        %
        %

        checked="checked" <# } #>> checked="checked" <# } #>> checked="checked" <# } #>>

        checked="checked" <# } #>> checked="checked" <# } #>> checked="checked" <# } #>>
        <# } #> * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Button' ) ) : /** * Sinatra Customizer custom background control class. */ class Sinatra_Customizer_Control_Button extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-button'; /** * Ajax Action. * * @var string */ public $ajax_action = ''; /** * Button text. * * @var string */ public $button_text = ''; /** * Button url. * * @var string */ public $button_url = '#'; /** * Link target. * * @since 1.0.0 * @var string */ public $target = '_blank'; /** * Set the default typography options. * * @since 1.0.0 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); if ( $this->ajax_action ) { $this->button_url = '#'; } } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['button_text'] = $this->button_text; $this->json['button_url'] = $this->button_url; $this->json['target'] = $this->target; $this->json['ajax_action'] = $this->ajax_action; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.ajax_action ) { #> <# } #> data-ajax-action="{{ data.ajax_action }}"<# } #>>{{{ data.button_text }}}
        <# if ( data.description ) { #>
        {{{ data.description }}}
        <# } #> * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Checkbox_Group' ) ) : /** * Sinatra Customizer checkbox group control class. */ class Sinatra_Customizer_Control_Checkbox_Group extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-checkbox-group'; /** * Link target. * * @since 1.0.0 * @var string */ public $choices = array(); /** * Constructor. * * @since 1.0.0 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['choices'] = $this->choices; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #>
        {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# } #>
        <# _.each( data.choices, function( params, key ) { #>

        <# } ) #>
        * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control' ) ) : /** * Sinatra Customizer custom control class. To be extended in other controls. */ class Sinatra_Customizer_Control extends WP_Customize_Control { /** * Whitelisting the "required" argument. * * @since 1.0.0 * @var array */ public $required = array(); /** * Whitelisting the "responsive" argument. * * @since 1.0.0 * @var array */ public $responsive = array(); /** * Set the default options. * * @since 1.0.0 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); if ( isset( $args['responsive'] ) && true === $args['responsive'] ) { $this->responsive = apply_filters( 'sinatra_customizer_responsive_breakpoints', array( 'desktop' => array( 'title' => esc_html__( 'Desktop', 'sinatra' ), 'icon' => 'dashicons dashicons-desktop', ), 'tablet' => array( 'title' => esc_html__( 'Tablet', 'sinatra' ), 'icon' => 'dashicons dashicons-tablet', ), 'mobile' => array( 'title' => esc_html__( 'Mobile', 'sinatra' ), 'icon' => 'dashicons dashicons-smartphone', ), ) ); } } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { // Script debug. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Control type. $sinatra_type = str_replace( 'sinatra-', '', $this->type ); /** * Enqueue control stylesheet */ wp_enqueue_style( 'sinatra-' . $sinatra_type . '-control-style', SINATRA_THEME_URI . '/inc/customizer/controls/' . $sinatra_type . '/' . $sinatra_type . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); /** * Enqueue our control script. */ wp_enqueue_script( 'sinatra-' . $sinatra_type . '-js', SINATRA_THEME_URI . '/inc/customizer/controls/' . $sinatra_type . '/' . $sinatra_type . $sinatra_suffix . '.js', array( 'jquery', 'customize-base' ), SINATRA_THEME_VERSION, true ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() * @since 1.0.0 */ public function to_json() { $this->json['settings'] = array(); foreach ( $this->settings as $key => $setting ) { $this->json['settings'][ $key ] = $setting->id; } $this->json['type'] = $this->type; $this->json['priority'] = $this->priority; $this->json['active'] = $this->active(); $this->json['section'] = $this->section; $this->json['label'] = $this->label; $this->json['description'] = $this->description; $this->json['instanceNumber'] = $this->instance_number; if ( 'dropdown-pages' === $this->type ) { $this->json['allow_addition'] = $this->allow_addition; } if ( isset( $this->default ) ) { $this->json['default'] = $this->default; } elseif ( isset( $this->setting->default ) ) { $this->json['default'] = $this->setting->default; } $this->json['value'] = $this->value(); $this->json['link'] = $this->get_link(); $this->json['id'] = $this->id; $this->json['required'] = $this->required; $this->json['responsive'] = $this->responsive; $this->json['inputAttrs'] = ''; foreach ( $this->input_attrs as $attr => $value ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } } /** * An Underscore (JS) template for this control's responsive devices buttons. * * @since 1.0.0 */ protected function responsive_devices() { ?>
          <# _.each( data.responsive, function( settings, device ) { #>
        • <# } ); #>
        * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Color' ) ) : /** * Sinatra Customizer custom color control class. */ class Sinatra_Customizer_Control_Color extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-color'; /** * Add support for showing the opacity value on the slider handle. * * @var boolean */ public $opacity; /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { // Script debug. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Control type. $sinatra_type = str_replace( 'sinatra-', '', $this->type ); // Enqueue WordPress color picker styles. wp_enqueue_style( 'wp-color-picker' ); // Enqueue control stylesheet. wp_enqueue_style( 'sinatra-' . $sinatra_type . '-control-style', SINATRA_THEME_URI . '/inc/customizer/controls/' . $sinatra_type . '/' . $sinatra_type . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); // Enqueue our control script. wp_enqueue_script( 'sinatra-' . $sinatra_type . '-js', SINATRA_THEME_URI . '/inc/customizer/controls/' . $sinatra_type . '/' . $sinatra_type . $sinatra_suffix . '.js', array( 'jquery', 'customize-base', 'wp-color-picker' ), SINATRA_THEME_VERSION, true ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['opacity'] = ( false === $this->opacity || 'false' === $this->opacity ) ? 'false' : 'true'; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #>
        {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# } #>
        label, body.wp-customizer .wp-picker-open + .wp-picker-input-wrap > span { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } body.wp-customizer .wp-picker-open + .wp-picker-input-wrap label { width: auto; -ms-flex-negative: 0; flex-shrink: 0; margin: 0; border-radius: 0; } body.wp-customizer .wp-picker-open + .wp-picker-input-wrap label input { padding: 0 12px; width: 100% !important; height: 100%; margin-top: 0; border-radius: 0; text-align: center; border: 1px solid #ddd; border-radius: 3px 0 0 0; border-bottom: none; background-color: #ffffff; color: #000; font-family: inherit; -ms-flex-item-align: end; align-self: flex-end; } body.wp-customizer .wp-picker-open + .wp-picker-input-wrap input[type="button"] { height: auto !important; padding: 8px 12px; border-radius: 0 3px 0 0; line-height: 1.3; color: #23282d; border: none; border-top: 1px solid #ddd; border-right: 1px solid #ddd; margin-left: 0; font-size: 13px; } body.wp-customizer .wp-picker-clear { width: 28%; -webkit-box-shadow: none !important; box-shadow: none !important; outline: none; } /* Responsive */ @media only screen and (max-width: 640px) { .wp-picker-input-wrap input[type="text"].wp-color-picker.sinatra-color-control { height: 33px; } } customizer/controls/color/color.js000064400000020520151231536710013410 0ustar00;(function( $ ) { wp.customize.controlConstructor['sinatra-color'] = wp.customize.Control.extend({ ready: function() { 'use strict'; var control = this, color = control.setting.get(); // Changes. control.container.on( 'color-updated', '.sinatra-color-control', function(){ value = $(this).val(); if ( value !== color ) { control.setting.set( value ); color = value; } }); } }); /** * Override the stock color.js toString() method to add support for * outputting RGBa or Hex. */ Color.prototype.toString = function( flag ) { // If our no-alpha flag has been passed in, output RGBa value with 100% opacity. // This is used to set the background color on the opacity slider during color changes. if ( 'no-alpha' == flag ) { return this.toCSS( 'rgba', '1' ).replace( /\s+/g, '' ); } // If we have a proper opacity value, output RGBa. if ( 1 > this._alpha ) { return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); } // Proceed with stock color.js hex output. var hex = parseInt( this._color, 10 ).toString( 16 ); if ( this.error ) { return ''; } if ( hex.length < 6 ) { for ( var i = 6 - hex.length - 1; i >= 0; i-- ) { hex = '0' + hex; } } return '#' + hex; }; /** * Given an RGBa, RGB, or hex color value, return the alpha channel value. */ function sinatra_get_alpha_value_from_color( value ) { var alphaVal; // Remove all spaces from the passed in value to help our RGBa regex. value = value.replace( / /g, '' ); if ( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ ) ) { alphaVal = parseFloat( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ )[1] ).toFixed(2) * 100; alphaVal = parseInt( alphaVal ); } else { alphaVal = 100; } return alphaVal; } /** * Force update the alpha value of the color picker object and maybe the alpha slider. */ function sinatra_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, update_slider ) { var iris, colorPicker, color; iris = $control.data( 'a8cIris' ); colorPicker = $control.data( 'wpWpColorPicker' ); // Set the alpha value on the Iris object. iris._color._alpha = alpha; // Store the new color value. color = iris._color.toString(); // Set the value of the input. $control.val( color ); // Update the background color of the color picker. colorPicker.toggler.css({ 'background-color': color }); // Maybe update the alpha slider itself. if ( update_slider ) { sinatraupdate_alpha_value_on_alpha_slider( alpha, $alphaSlider ); } // Trigger change. $control.trigger('color-updated'); } /** * Update the slider handle position and label. */ function sinatra_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ) { $alphaSlider.slider( 'value', alpha ); $alphaSlider.find( '.ui-slider-handle' ).text( alpha.toString() ); } /** * Initialization trigger. */ $( document ).ready( function( $ ) { // Loop over each control and transform it into our color picker. $( '.sinatra-color-control' ).each( function() { // Scope the vars. var $control, startingColor, showOpacity, defaultColor, colorPickerOptions, $container, $alphaSlider, alphaVal, sliderOptions; // Store the control instance. $control = $( this ); // Get a clean starting value for the option. startingColor = $control.val().replace( /\s+/g, '' ); // Get some data off the control. showOpacity = $control.attr( 'data-show-opacity' ); defaultColor = $control.attr( 'data-default-color' ); // Set up the options that we'll pass to wpColorPicker(). colorPickerOptions = { change: function( event, ui ) { var value, alpha, $transparency; value = ui.color.toString(); $control.val( value ); // Set the opacity value on the slider handle when the default color button is clicked. if ( defaultColor == value ) { alpha = sinatra_get_alpha_value_from_color( value ); $alphaSlider.find( '.ui-slider-handle' ).text( alpha ); } // Always show the background color of the opacity slider at 100% opacity. $transparency = $container.find( '.transparency' ); $transparency.css( 'background-color', ui.color.toString( 'no-alpha' ) ); $control.trigger('color-updated'); }, palettes: sinatra_customizer_localized.color_palette // Use the passed in palette. }; // Create the colorpicker. $control.wpColorPicker( colorPickerOptions ); $container = $control.parents( '.wp-picker-container:first' ); // Insert our opacity slider. if ( 'true' == showOpacity ) { $( '
        ' + '
        ' + '
        ' + '
        ' + '
        ' + '
        ' ).appendTo( $container.find( '.wp-picker-holder' ) ); } $alphaSlider = $container.find( '.alpha-slider' ); // If starting value is in format RGBa, grab the alpha channel. alphaVal = sinatra_get_alpha_value_from_color( startingColor ); // Set up jQuery UI slider() options. sliderOptions = { create: function( event, ui ) { var value = $( this ).slider( 'value' ); // Set up initial values. $( this ).find( '.ui-slider-handle' ).text( value ); $( this ).siblings( '.transparency ').css( 'background-color', startingColor ); }, value: alphaVal, range: 'max', step: 1, min: 0, max: 100, animate: 300 }; // Initialize jQuery UI slider with our options. $alphaSlider.slider( sliderOptions ); // Maybe show the opacity on the handle. if ( 'true' == showOpacity ) { $alphaSlider.find( '.ui-slider-handle' ).addClass( 'show-opacity' ); } // Bind event handlers for the click zones. $container.find( '.min-click-zone' ).on( 'click', function() { sinatra_update_alpha_value_on_color_control( 0, $control, $alphaSlider, true ); }); $container.find( '.max-click-zone' ).on( 'click', function() { sinatra_update_alpha_value_on_color_control( 100, $control, $alphaSlider, true ); }); // Bind event handler for clicking on a palette color. $container.find( '.iris-palette' ).on( 'click', function(e) { e.preventDefault(); var color, alpha; color = $( this ).css( 'background-color' ); alpha = sinatra_get_alpha_value_from_color( color ); sinatra_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); // Sometimes Iris doesn't set a perfect background-color on the palette, // for example rgba(20, 80, 100, 0.3) becomes rgba(20, 80, 100, 0.298039). // To compensante for this we round the opacity value on RGBa colors here // and save it a second time to the color picker object. if ( alpha != 100 ) { color = color.replace( /[^,]+(?=\))/, ( alpha / 100 ).toFixed( 2 ) ); } $control.val( color ); $control.wpColorPicker( 'color', color ); }); // Bind event handler for clicking on the 'Clear' button. $container.find( '.button.wp-picker-clear' ).on( 'click', function(e) { e.preventDefault(); $control.val( '' ); sinatra_update_alpha_value_on_alpha_slider( 100, $alphaSlider ); $control.trigger( 'color-updated' ); }); // Bind event handler for clicking on the 'Default' button. $container.find( '.button.wp-picker-default' ).on( 'click', function(e) { e.preventDefault(); var alpha = sinatra_get_alpha_value_from_color( defaultColor ); sinatra_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); }); // Bind event handler for typing or pasting into the input. $control.on( 'input', function(e) { e.preventDefault(); var value = $( this ).val(); var alpha = sinatra_get_alpha_value_from_color( value ); sinatra_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ); $control.trigger('color-updated'); }); // Update all the things when the slider is interacted with. $alphaSlider.slider().on( 'slide', function( event, ui ) { var alpha = parseFloat( ui.value ) / 100.0; sinatra_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, false ); // Change value shown on slider handle. $( this ).find( '.ui-slider-handle' ).text( ui.value ); }); // Fix Safari issue on input click $( '.iris-picker, .sinatra-color-control' ).on( 'click', function(e) { e.preventDefault(); }); }); }); })( jQuery );;customizer/controls/color/color.min.css000064400000012272151231536710014353 0ustar00.sinatra-color-wrapper .wp-picker-container{margin-top:6px}.sinatra-color-wrapper .sinatra-color-control{border-radius:3px 0 0 0!important;margin-top:0!important}.wp-core-ui .button.wp-color-result{background:transparent}body.wp-customizer .wp-picker-container{max-width:247px}body.wp-customizer .wp-picker-container .wp-picker-open~.wp-picker-holder .alpha-color-picker-container{display:block}body.wp-customizer .wp-picker-container .iris-picker{margin:0;box-sizing:content-box!important;border-color:#ddd;border-radius:0;max-width:calc(100% - 2px)}body.wp-customizer .wp-picker-container .iris-picker .iris-square{margin-right:0}body.wp-customizer .wp-picker-container .iris-picker .iris-strip{float:right}body.wp-customizer .wp-picker-container .iris-picker .iris-strip .ui-slider-handle{box-shadow:none;border-radius:2px;opacity:1}body.wp-customizer .wp-picker-container .iris-picker .iris-strip .ui-slider-handle:before{border-radius:2px}body.wp-customizer .wp-picker-container .wp-color-result.button{box-shadow:none;padding:0 0 0 45px;border:1px solid #ddd;height:34px;border-radius:3px;margin:0;max-width:160px;position:relative}body.wp-customizer .wp-picker-container .wp-color-result.button:focus,body.wp-customizer .wp-picker-container .wp-color-result.button:hover{border-color:#bcbcbc!important}body.wp-customizer .wp-picker-container .wp-color-result.button:before{content:"";background-image:url(../../assets/images/transparency.svg);position:absolute;left:0;top:0;bottom:0;width:45px;z-index:-1;background-repeat:repeat;background-size:18px}body.wp-customizer .wp-picker-container .wp-color-result.button .wp-color-result-text{background-color:#eee;height:32px;line-height:32px;border:none;box-shadow:none;border-radius:0 2px 2px 0;border-left:1px solid #ddd;padding:0 16px;position:relative;top:0;right:0;font-size:13px;color:#555d66}body.wp-customizer .alpha-color-picker-container{display:none;width:247px;border:1px solid #ddd;border-top:none;background-color:#fff;padding:0 11px 10px;border-radius:0 0 3px 3px;box-sizing:border-box;top:-1px;position:relative;z-index:2}body.wp-customizer .alpha-color-picker-container .ui-widget-content,body.wp-customizer .alpha-color-picker-container .ui-widget-header{background:transparent;border:none}body.wp-customizer .alpha-color-picker-container .ui-slider{position:relative;z-index:1;height:24px;text-align:center;margin:0 auto;width:88%;width:calc(100% - 28px)}body.wp-customizer .alpha-color-picker-container .ui-slider-handle,body.wp-customizer .alpha-color-picker-container .ui-widget-content .ui-state-default{color:#000;background-color:#fff;text-shadow:0 1px 0 #fff;text-decoration:none;position:absolute;z-index:2;border:1px solid #aaa;border-radius:2px;margin-top:-2px;top:0;height:26px;width:26px;cursor:ew-resize;font-size:0;padding:0;line-height:27px;margin-left:-14px}body.wp-customizer .alpha-color-picker-container .ui-slider-handle:focus,body.wp-customizer .alpha-color-picker-container .ui-widget-content .ui-state-default:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}body.wp-customizer .alpha-color-picker-container .ui-slider-handle.show-opacity{font-size:10px;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}body.wp-customizer .alpha-color-picker-container .click-zone{display:block;position:absolute;left:10px;width:14px;height:24px}body.wp-customizer .alpha-color-picker-container .max-click-zone{right:10px;left:auto}body.wp-customizer .alpha-color-picker-container .transparency{height:24px;width:100%;background-color:#fff;background-image:url(../../assets/images/transparency-grid.png);box-shadow:inset 0 0 5px rgba(0,0,0,.4);border-radius:3px;padding:0;margin-top:-24px}body.wp-customizer .alpha-color-picker-wrap .ui-state-focus{background:transparent;border:none}body.wp-customizer .alpha-color-picker-wrap a.iris-square-value:focus{box-shadow:none}body.wp-customizer .wp-picker-holder{max-width:247px}body.wp-customizer .wp-picker-input-wrap{overflow:hidden}body.wp-customizer .wp-picker-open+.wp-picker-input-wrap{width:100%;margin-top:12px;-js-display:flex!important;display:-ms-flexbox!important;display:flex!important;max-width:247px;border-radius:0}body.wp-customizer .wp-picker-open+.wp-picker-input-wrap>label,body.wp-customizer .wp-picker-open+.wp-picker-input-wrap>span{-ms-flex:1;flex:1}body.wp-customizer .wp-picker-open+.wp-picker-input-wrap label{width:auto;-ms-flex-negative:0;flex-shrink:0;margin:0;border-radius:0}body.wp-customizer .wp-picker-open+.wp-picker-input-wrap label input{padding:0 12px;width:100%!important;height:100%;margin-top:0;border-radius:0;text-align:center;border:1px solid #ddd;border-radius:3px 0 0 0;border-bottom:none;background-color:#fff;color:#000;font-family:inherit;-ms-flex-item-align:end;align-self:flex-end}body.wp-customizer .wp-picker-open+.wp-picker-input-wrap input[type=button]{height:auto!important;padding:8px 12px;border-radius:0 3px 0 0;line-height:1.3;color:#23282d;border:none;border-top:1px solid #ddd;border-right:1px solid #ddd;margin-left:0;font-size:13px}body.wp-customizer .wp-picker-clear{width:28%;box-shadow:none!important;outline:none}@media only screen and (max-width:640px){.wp-picker-input-wrap input[type=text].wp-color-picker.sinatra-color-control{height:33px}}customizer/controls/color/color.min.js000064400000011056151231536710014176 0ustar00!function($){function sinatra_get_alpha_value_from_color(value){var alphaVal;return(value=value.replace(/ /g,"")).match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)?(alphaVal=100*parseFloat(value.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)[1]).toFixed(2),alphaVal=parseInt(alphaVal)):alphaVal=100,alphaVal}function sinatra_update_alpha_value_on_color_control(alpha,$control,$alphaSlider,update_slider){var iris,colorPicker,color;iris=$control.data("a8cIris"),colorPicker=$control.data("wpWpColorPicker"),iris._color._alpha=alpha,color=iris._color.toString(),$control.val(color),colorPicker.toggler.css({"background-color":color}),update_slider&&sinatraupdate_alpha_value_on_alpha_slider(alpha,$alphaSlider),$control.trigger("color-updated")}function sinatra_update_alpha_value_on_alpha_slider(alpha,$alphaSlider){$alphaSlider.slider("value",alpha),$alphaSlider.find(".ui-slider-handle").text(alpha.toString())}wp.customize.controlConstructor["sinatra-color"]=wp.customize.Control.extend({ready:function(){"use strict";var control=this,color=control.setting.get();control.container.on("color-updated",".sinatra-color-control",(function(){value=$(this).val(),value!==color&&(control.setting.set(value),color=value)}))}}),Color.prototype.toString=function(flag){if("no-alpha"==flag)return this.toCSS("rgba","1").replace(/\s+/g,"");if(1>this._alpha)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var hex=parseInt(this._color,10).toString(16);if(this.error)return"";if(hex.length<6)for(var i=6-hex.length-1;i>=0;i--)hex="0"+hex;return"#"+hex},$(document).ready((function($){$(".sinatra-color-control").each((function(){var $control,startingColor,showOpacity,defaultColor,colorPickerOptions,$container,$alphaSlider,sliderOptions;$control=$(this),startingColor=$control.val().replace(/\s+/g,""),showOpacity=$control.attr("data-show-opacity"),defaultColor=$control.attr("data-default-color"),colorPickerOptions={change:function(event,ui){var value,alpha;value=ui.color.toString(),$control.val(value),defaultColor==value&&(alpha=sinatra_get_alpha_value_from_color(value),$alphaSlider.find(".ui-slider-handle").text(alpha)),$container.find(".transparency").css("background-color",ui.color.toString("no-alpha")),$control.trigger("color-updated")},palettes:sinatra_customizer_localized.color_palette},$control.wpColorPicker(colorPickerOptions),$container=$control.parents(".wp-picker-container:first"),"true"==showOpacity&&$('
        ').appendTo($container.find(".wp-picker-holder")),$alphaSlider=$container.find(".alpha-slider"),sliderOptions={create:function(event,ui){var value=$(this).slider("value");$(this).find(".ui-slider-handle").text(value),$(this).siblings(".transparency ").css("background-color",startingColor)},value:sinatra_get_alpha_value_from_color(startingColor),range:"max",step:1,min:0,max:100,animate:300},$alphaSlider.slider(sliderOptions),"true"==showOpacity&&$alphaSlider.find(".ui-slider-handle").addClass("show-opacity"),$container.find(".min-click-zone").on("click",(function(){sinatra_update_alpha_value_on_color_control(0,$control,$alphaSlider,!0)})),$container.find(".max-click-zone").on("click",(function(){sinatra_update_alpha_value_on_color_control(100,$control,$alphaSlider,!0)})),$container.find(".iris-palette").on("click",(function(e){var color,alpha;e.preventDefault(),sinatra_update_alpha_value_on_alpha_slider(alpha=sinatra_get_alpha_value_from_color(color=$(this).css("background-color")),$alphaSlider),100!=alpha&&(color=color.replace(/[^,]+(?=\))/,(alpha/100).toFixed(2))),$control.val(color),$control.wpColorPicker("color",color)})),$container.find(".button.wp-picker-clear").on("click",(function(e){e.preventDefault(),$control.val(""),sinatra_update_alpha_value_on_alpha_slider(100,$alphaSlider),$control.trigger("color-updated")})),$container.find(".button.wp-picker-default").on("click",(function(e){e.preventDefault(),sinatra_update_alpha_value_on_alpha_slider(sinatra_get_alpha_value_from_color(defaultColor),$alphaSlider)})),$control.on("input",(function(e){e.preventDefault(),sinatra_update_alpha_value_on_alpha_slider(sinatra_get_alpha_value_from_color($(this).val()),$alphaSlider),$control.trigger("color-updated")})),$alphaSlider.slider().on("slide",(function(event,ui){sinatra_update_alpha_value_on_color_control(parseFloat(ui.value)/100,$control,$alphaSlider,!1),$(this).find(".ui-slider-handle").text(ui.value)})),$(".iris-picker, .sinatra-color-control").on("click",(function(e){e.preventDefault()}))}))}))}(jQuery);;customizer/controls/color/color.scss000064400000012002151231536710013743 0ustar00/*****************************************/ /* Customizer control color style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; $admin_border_color: #ddd; $color_picker_width: 247px; .sinatra-color-wrapper { .wp-picker-container { margin-top: 6px; } .sinatra-color-control { border-radius: 3px 0 0 0px !important; margin-top: 0 !important; } } .wp-core-ui .button.wp-color-result { background: transparent; } body.wp-customizer { .wp-picker-container { max-width: $color_picker_width; .wp-picker-open ~ .wp-picker-holder .alpha-color-picker-container { display: block; } .iris-picker { margin: 0 0 0 0; box-sizing: content-box !important; border-color: $admin_border_color; border-radius: 0; max-width: calc(100% - 2px); .iris-square { margin-right: 0; } .iris-strip { float: right; .ui-slider-handle { box-shadow: none; border-radius: 2px; opacity: 1; &:before { border-radius: 2px; } } } } .wp-color-result.button { box-shadow: none; padding: 0 0 0 45px; border: solid 1px #ddd; height: 34px; border-radius: $border_radius; margin: 0; max-width: 160px; position: relative; &:focus, &:hover { border-color: #bcbcbc !important; } &:before { content: ''; background-image: url( '../../assets/images/transparency.svg' ); position: absolute; left: 0; top: 0; bottom: 0; width: 45px; z-index: -1; background-repeat: repeat; background-size: 18px; } .wp-color-result-text { background-color: #eee; height: 32px; line-height: 32px; border: none; box-shadow: none; border-radius: 0 2px 2px 0; border-left: 1px solid #ddd; padding: 0 16px; position: relative; top: 0; right: 0; font-size: 13px; color: #555d66; } } } .alpha-color-picker-container { display: none; width: $color_picker_width; border: 1px solid $admin_border_color; border-top: none; background-color: $color_5; padding: 0 11px 10px; position: relative; border-radius: 0 0 $border_radius $border_radius; box-sizing: border-box; top: -1px; position: relative; z-index: 2; .ui-widget-content, .ui-widget-header { background: transparent; border: none; } .ui-slider { position: relative; z-index: 1; height: 24px; text-align: center; margin: 0 auto; width: 88%; width: calc( 100% - 28px ); } .ui-slider-handle, .ui-widget-content .ui-state-default { color: #000; background-color: $color_5; text-shadow: 0 1px 0 #fff; text-decoration: none; position: absolute; z-index: 2; border: 1px solid #aaa; border-radius: 2px; margin-top: -2px; top: 0; height: 26px; width: 26px; cursor: ew-resize; font-size: 0; padding: 0; line-height: 27px; margin-left: -14px; &:focus { box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30,140,190,.8); } } .ui-slider-handle.show-opacity { font-size: 10px; font-weight: 500; user-select: none; } .click-zone { display: block; position: absolute; left: 10px; width: 14px; height: 24px; } .max-click-zone { right: 10px; left: auto; } .transparency { height: 24px; width: 100%; background-color: $color_5; background-image: url( '../../assets/images/transparency-grid.png' ); box-shadow: 0 0 5px rgba(0,0,0,0.4) inset; border-radius: 3px; padding: 0; margin-top: -24px; } } .alpha-color-picker-wrap { .ui-state-focus { background: transparent; border: none; } a.iris-square-value { &:focus { box-shadow: none; } } } .wp-picker-holder { max-width: $color_picker_width; } .wp-picker-input-wrap { overflow: hidden; } .wp-picker-open + .wp-picker-input-wrap { width: 100%; margin-top: 12px; display: flex !important; max-width: $color_picker_width; border-radius: 0; & > label, & > span { flex: 1; } label { width: auto; flex-shrink: 0; margin: 0; border-radius: 0; input { padding: 0 12px; width: 100% !important; height: 100%; margin-top: 0; border-radius: 0; text-align: center; border: 1px solid $admin_border_color; border-radius: $border_radius 0 0 0; border-bottom: none; background-color: $color_5; color: #000; font-family: inherit; align-self: flex-end; } } input[type="button"] { height: auto !important; padding: 8px 12px; border-radius: 0 $border_radius 0 0; line-height: 1.3; color: $color_3; border: none; border-top: 1px solid $admin_border_color; border-right: 1px solid $admin_border_color; margin-left: 0; font-size: 13px; } } .wp-picker-clear { width: 28%; box-shadow: none !important; outline: none; } } /* Responsive */ @media only screen and (max-width: 640px) { .wp-picker-input-wrap input[type="text"].wp-color-picker.sinatra-color-control { height: 33px; } }customizer/controls/design-options/class-sinatra-customizer-control-design-options.php000064400000052671151231536710025671 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Design_Options' ) ) : /** * Sinatra Customizer design options control class. */ class Sinatra_Customizer_Control_Design_Options extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-design-options'; /** * The displayed fields. * * @var string */ public $display = array(); /** * The control icon. * * @var string */ public $icon = 'edit'; /** * Set the default options. * * @since 1.0.8 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { $this->display = array( 'background' => array(), 'color' => array(), 'border' => array(), ); parent::__construct( $manager, $id, $args ); } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { parent::enqueue(); // Script debug. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Enqueue WordPress color picker styles. wp_enqueue_style( 'wp-color-picker' ); // Enqueue background image stylesheet. if ( isset( $this->display['background'] ) ) { wp_enqueue_style( 'sinatra-background-control-style', SINATRA_THEME_URI . '/inc/customizer/controls/background/background' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); } } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['display'] = $this->display; $this->json['icon'] = $this->icon; $this->json['l10n'] = array( 'background-type' => esc_html__( 'Type', 'sinatra' ), 'gradient' => array( 'color-1' => esc_html__( 'Color 1', 'sinatra' ), 'color-2' => esc_html__( 'Color 2', 'sinatra' ), 'color-location' => esc_html__( 'Location', 'sinatra' ), 'type' => esc_html__( 'Type', 'sinatra' ), 'linear' => esc_html__( 'Linear', 'sinatra' ), 'radial' => esc_html__( 'Radial', 'sinatra' ), 'angle' => esc_html__( 'Angle', 'sinatra' ), 'position' => esc_html__( 'Position', 'sinatra' ), 'radial-position' => array( 'center center' => esc_html__( 'Center Center', 'sinatra' ), 'center left' => esc_html__( 'Center Left', 'sinatra' ), 'center right' => esc_html__( 'Center Right', 'sinatra' ), 'top center' => esc_html__( 'Top Center', 'sinatra' ), 'top left' => esc_html__( 'Top Left', 'sinatra' ), 'top right' => esc_html__( 'Top Right', 'sinatra' ), 'bottom center' => esc_html__( 'Bottom Center', 'sinatra' ), 'bottom left' => esc_html__( 'Bottom Left', 'sinatra' ), 'bottom right' => esc_html__( 'Bottom Right', 'sinatra' ), ), ), 'image' => array( 'placeholder' => __( 'No image selected', 'sinatra' ), 'less' => __( 'Less Settings', 'sinatra' ), 'more' => __( 'Advanced', 'sinatra' ), 'select_image' => __( 'Select Image', 'sinatra' ), 'use_image' => __( 'Use This Image', 'sinatra' ), ), 'border-styles' => array( 'solid' => esc_html__( 'Solid', 'sinatra' ), 'dotted' => esc_html__( 'Dotted', 'sinatra' ), 'dashed' => esc_html__( 'Dashed', 'sinatra' ), ), ); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# if ( 'background' in data.display ) { #>
        <# if ( 'color' in data.display['background'] ) { #>
        <# } #> <# if ( 'gradient' in data.display['background'] ) { #>
        <# } #> <# if ( 'image' in data.display['background'] ) { #>
        <# if ( data.value['background-image'] ) { #>
        <# } else { #>
        <# } #>

        %
        %

        checked="checked" <# } #>> checked="checked" <# } #>> checked="checked" <# } #>>

        checked="checked" <# } #>> checked="checked" <# } #>> checked="checked" <# } #>>
        <# } #> <# } #> <# if ( 'color' in data.display ) { #> <# _.each( data.display['color'], function( title, id ){ #>
        <# }); #> <# } #> <# if ( 'border' in data.display ) { #> <# if ( 'width' in data.display['border'] && 'positions' in data.display['border'] ) { #>
          <# _.each( data.display['border']['positions'], function( title, id ){ #>
        • {{{ title }}}
        • <# }); #>
        <# } #> <# if ( 'style' in data.display['border'] ) { #>
        <# } #> <# if ( 'color' in data.display['border'] ) { #>
        <# } #> <# if ( 'separator' in data.display['border'] ) { #>
        <# } #> <# } #>
        ' ); } if ( removeButton.length ) { removeButton.show(); } setTimeout( function() { $( 'body' ).on( 'click', outside_click_close ); }, 100 ); }); e.preventDefault(); }); control.container.on( 'click', '.background-image-upload-remove-button', function( e ) { var preview, removeButton; e.preventDefault(); control.container.find( '[data-option="background-image"]' ).val( '' ); control.container.find( '[data-option="background-image-id"]' ).val( '' ); control.update_value(); preview = control.container.find( '.placeholder, .thumbnail' ); removeButton = control.container.find( '.background-image-upload-remove-button' ); // Hide unnecessary controls. control.container.find( '.background-image-advanced' ).hide(); control.container.find( '.advanced-settings' ).addClass( 'hidden' ).removeClass( 'up' ); if ( preview.length ) { preview.removeClass().addClass( 'placeholder' ).html( control.params.l10n.image.placeholder ); } if ( removeButton.length ) { removeButton.hide(); } }); control.container.on( 'click', '.advanced-settings', function( e ) { $(this).toggleClass('up'); control.container.find( '.background-image-advanced' ).toggle(); }); // Spacing field. // Linked button control.container.on( 'click', '.sinatra-spacing-linked', function() { // Set up variables var $this = $( this ); // Remove linked class $this.closest( 'ul' ).find( '.spacing-input' ).removeClass( 'linked' ); // Remove class $this.parent( '.spacing-link-values' ).removeClass( 'unlinked' ); }); // Unlinked button control.container.on( 'click', '.sinatra-spacing-unlinked', function() { // Set up variables var $this = $( this ); // Remove linked class $this.closest( 'ul' ).find( '.spacing-input' ).addClass( 'linked' ); // Remove class $this.parent( '.spacing-link-values' ).addClass( 'unlinked' ); }); // Values linked inputs control.container.on( 'input', '.linked input', function() { var $val = $( this ).val(); $(this).closest( '.spacing-input' ).siblings( '.linked' ).find( 'input' ).val( $val ).change(); }); // Store new inputs control.container.on( 'change input', '.spacing-input input', function() { control.update_value(); }); // Reset default. control.container.find( '.reset-defaults' ).on( 'click', function() { var item, option_id; control.container.find( '[data-option]' ).each( function() { item = $(this); option_id = item.data('option'); if ( 'background-size' === option_id || 'background-attachment' === option_id ) { item.prop( 'checked', false ); if ( ( option_id in control.params.default ) && control.params.default[ option_id ] === item.val() ) { item.prop( 'checked', true ); } } else { item.val( control.params.default[ item.data('option') ] ).trigger( 'change' ); } }); control.container.find( '.background-image-upload-remove-button' ).click(); control.update_value(); }); }, // Update value. update_value: function(){ var self = this, value = {}, option; self.container.find( '[data-option]' ).each( function(){ option = $(this).data('option'); if ( 'background-size' === option || 'background-attachment' === option ) { value[ option ] = $(this).is( ':checked' ) ? $(this).val() : value[ option ]; } else { value[ option ] = $(this).val(); } }); self.setting.set( value ); }, autocorrect_range_input_number: function( input_number, timeout ) { var range_input = input_number, range = range_input.parent().find( 'input[type="range"]' ), value = parseFloat( range_input.val() ), reset = parseFloat( range.find( '.sinatra-reset-range' ).attr( 'data-reset_value' ) ), step = parseFloat( range_input.attr( 'step' ) ), min = parseFloat( range_input.attr( 'min') ), max = parseFloat( range_input.attr( 'max') ); clearTimeout( timeout ); timeout = setTimeout( function() { if ( isNaN( value ) ) { range_input.val( reset ); range.val( reset ).trigger( 'change' ); return; } if ( step >= 1 && value % 1 !== 0 ) { value = Math.round( value ); range_input.val( value ); range.val( value ).trigger( 'change' ); } if ( value > max ) { range_input.val( max ); range.val( max ).trigger( 'change' ); } if ( value < min ) { range_input.val( min ); range.val( min ).trigger( 'change' ); } }, timeout ); range.val( value ).trigger( 'change' ); this.update_value(); } }); })(jQuery);;customizer/controls/design-options/design-options.min.css000064400000000617151231536710020023 0ustar00.sinatra-design-options-wrapper .background-color-overlay .wp-color-result.button{top:1.33em!important}.sinatra-design-options-wrapper .sinatra-design-options-heading{-ms-flex-positive:1;flex-grow:1}.sinatra-design-options-wrapper .sinatra-range-suffix{margin-left:6px}.sinatra-design-options-wrapper .reset-defaults{display:none}.sinatra-design-options-wrapper .reset-defaults.active{display:block}customizer/controls/design-options/design-options.min.js000064400000016615151231536710017654 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-design-options"]=wp.customize.Control.extend({ready:function(){var range,range_input,value,control=this,popup_content=(control.setting.get(),control.container.find(".popup-content"));control.container.find("input[type=range]").on("mousedown",(function(){range=$(this),range_input=range.parent().children(".sinatra-range-input"),value=range.attr("value"),range_input.val(value),range.mousemove((function(){value=range.attr("value"),range_input.val(value),control.update_value()}))})),control.container.find("input[type=range]").on("mouseup",(function(){range=$(this),range_input=range.parent().children(".sinatra-range-input"),value=range.attr("value"),range_input.val(value),control.update_value(),$(this).off("mousemove")})),control.container.find("input.sinatra-range-input").on("change keyup",(function(){control.autocorrect_range_input_number($(this),1e3,void 0)})).on("focusout",(function(){control.autocorrect_range_input_number($(this),0,void 0)})),control.container.on("change",'[data-option="background-type"], [data-option="gradient-type"]',(function(){var field=$(this).attr("data-option");control.container.find('[data-dep-field="'+field+'"]').hide(),control.container.find('[data-dep-field="'+field+'"][data-dep-value="'+$(this).val()+'"]').show()})),control.container.find('[data-option="background-type"], [data-option="gradient-type"]').trigger("change"),control.container.on("color-updated",".sinatra-color-control",(function(){control.update_value()})),control.container.on("change",".sinatra-select-wrapper",(function(){control.update_value()})),control.container.find(".popup-link").on("click",(function(){popup_content.toggleClass("hidden"),$(this).toggleClass("active"),$(this).siblings(".reset-defaults").toggleClass("active"),$("body").on("click",outside_click_close)}));var outside_click_close=function(e){$(e.target).closest(".customize-save-button-wrapper").length||control.container.has($(e.target).closest(".popup-link")).length||control.container.has($(e.target).closest(".popup-content")).length||popup_content.hasClass("hidden")||$(e.target).closest(".reset-defaults").length||(popup_content.addClass("hidden"),control.container.find(".popup-link").removeClass("active"),control.container.find(".reset-defaults").removeClass("active"),$("body").off("click",outside_click_close))};control.container.find(".background-image-advanced").hide(),control.container.on("change",".background-repeat select",(function(){control.update_value()})),control.container.on("change click",".background-size input",(function(){control.update_value()})),control.container.on("change click",".background-attachment input",(function(){control.update_value()})),control.container.on("click",".background-image-upload-button",(function(e){$("body").off("click",outside_click_close);var image=wp.media({multiple:!1,title:control.params.l10n.image.select_image,button:{text:control.params.l10n.image.use_image}}).open().on("select",(function(){var previewImage,imageUrl,imageID,preview,removeButton,uploadedImageJSON=image.state().get("selection").first().toJSON();previewImage=_.isUndefined(uploadedImageJSON.sizes)?uploadedImageJSON.url:_.isUndefined(uploadedImageJSON.sizes.medium)?_.isUndefined(uploadedImageJSON.sizes.thumbnail)?_.isUndefined(uploadedImageJSON.sizes.full)?uploadedImageJSON.url:uploadedImageJSON.sizes.full.url:uploadedImageJSON.sizes.thumbnail.url:uploadedImageJSON.sizes.medium.url,imageUrl=uploadedImageJSON.url,imageID=uploadedImageJSON.id,uploadedImageJSON.width,uploadedImageJSON.height,""!==imageUrl&&(control.container.find(".background-image-advanced").show(),control.container.find(".advanced-settings").removeClass("hidden").addClass("up")),control.container.find('[data-option="background-image"]').val(imageUrl),control.container.find('[data-option="background-image-id"]').val(imageID),control.update_value(),preview=control.container.find(".placeholder, .thumbnail"),removeButton=control.container.find(".background-image-upload-remove-button"),preview.length&&preview.removeClass().addClass("thumbnail thumbnail-image").html(''),removeButton.length&&removeButton.show(),setTimeout((function(){$("body").on("click",outside_click_close)}),100)}));e.preventDefault()})),control.container.on("click",".background-image-upload-remove-button",(function(e){var preview,removeButton;e.preventDefault(),control.container.find('[data-option="background-image"]').val(""),control.container.find('[data-option="background-image-id"]').val(""),control.update_value(),preview=control.container.find(".placeholder, .thumbnail"),removeButton=control.container.find(".background-image-upload-remove-button"),control.container.find(".background-image-advanced").hide(),control.container.find(".advanced-settings").addClass("hidden").removeClass("up"),preview.length&&preview.removeClass().addClass("placeholder").html(control.params.l10n.image.placeholder),removeButton.length&&removeButton.hide()})),control.container.on("click",".advanced-settings",(function(e){$(this).toggleClass("up"),control.container.find(".background-image-advanced").toggle()})),control.container.on("click",".sinatra-spacing-linked",(function(){var $this=$(this);$this.closest("ul").find(".spacing-input").removeClass("linked"),$this.parent(".spacing-link-values").removeClass("unlinked")})),control.container.on("click",".sinatra-spacing-unlinked",(function(){var $this=$(this);$this.closest("ul").find(".spacing-input").addClass("linked"),$this.parent(".spacing-link-values").addClass("unlinked")})),control.container.on("input",".linked input",(function(){var $val=$(this).val();$(this).closest(".spacing-input").siblings(".linked").find("input").val($val).change()})),control.container.on("change input",".spacing-input input",(function(){control.update_value()})),control.container.find(".reset-defaults").on("click",(function(){var item,option_id;control.container.find("[data-option]").each((function(){item=$(this),"background-size"===(option_id=item.data("option"))||"background-attachment"===option_id?(item.prop("checked",!1),option_id in control.params.default&&control.params.default[option_id]===item.val()&&item.prop("checked",!0)):item.val(control.params.default[item.data("option")]).trigger("change")})),control.container.find(".background-image-upload-remove-button").click(),control.update_value()}))},update_value:function(){var option,value={};this.container.find("[data-option]").each((function(){option=$(this).data("option"),value[option]="background-size"===option||"background-attachment"===option?$(this).is(":checked")?$(this).val():value[option]:$(this).val()})),this.setting.set(value)},autocorrect_range_input_number:function(input_number,timeout){var range_input=input_number,range=range_input.parent().find('input[type="range"]'),value=parseFloat(range_input.val()),reset=parseFloat(range.find(".sinatra-reset-range").attr("data-reset_value")),step=parseFloat(range_input.attr("step")),min=parseFloat(range_input.attr("min")),max=parseFloat(range_input.attr("max"));clearTimeout(timeout),timeout=setTimeout((function(){if(isNaN(value))return range_input.val(reset),void range.val(reset).trigger("change");step>=1&&value%1!=0&&(value=Math.round(value),range_input.val(value),range.val(value).trigger("change")),value>max&&(range_input.val(max),range.val(max).trigger("change")),value * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Heading' ) ) : /** * Sinatra Customizer custom heading control class. */ class Sinatra_Customizer_Control_Heading extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-heading'; /** * Top spacer. * * @since 1.0.0 * @var boolean */ public $space = true; /** * Heading style. Possible options are: regular-heading and sub-heading. * * @since 1.0.0 * @var string */ public $style = 'regular-heading'; /** * Toggler. * * @since 1.0.0 * @var boolean */ public $toggle = true; /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['space'] = ( true === $this->space || 'true' === $this->space ) ? ' top-spacer' : ''; $this->json['toggle'] = ( true === $this->toggle || 'true' === $this->toggle ) ? ' toggle-heading' : ''; $this->json['style'] = $this->style; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?> <# if ( data.space ) { #>
        <# } #>
        <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #> <# if ( data.toggle ) { #> checked="checked" <# } #>> <# } #>
        * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Info' ) ) : /** * Sinatra Customizer info control class. */ class Sinatra_Customizer_Control_Info extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-info'; /** * Custom URL. * * @since 1.0.0 * @var string */ public $url = ''; /** * Link target. * * @since 1.0.0 * @var string */ public $target = '_blank'; /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { // Script debug. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Control type. $sinatra_type = str_replace( 'sinatra-', '', $this->type ); /** * Enqueue control stylesheet */ wp_enqueue_style( 'sinatra-' . $sinatra_type . '-control-style', SINATRA_THEME_URI . '/inc/customizer/controls/' . $sinatra_type . '/' . $sinatra_type . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['url'] = $this->url; $this->json['target'] = $this->target; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #>
        {{{ data.description }}}
        <# } #>
        * @see https://github.com/aristath/kirki * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Radio_Image' ) ) : /** * Sinatra Customizer custom heading control class. */ class Sinatra_Customizer_Control_Radio_Image extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-radio-image'; /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['choices'] = $this->choices; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #>
        {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# } #>
        <# for ( key in data.choices ) { #> checked="checked"<# } #>> <# } #>
        img { border-color: #0085ba; } .customize-control-sinatra-radio-image input:checked + label:after { content: '\f147'; -webkit-font-smoothing: antialiased; font: normal 16px/1 "dashicons"; vertical-align: top; position: absolute; bottom: 0; left: 6px; width: 20px; height: 20px; background-color: #0085ba; -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; color: #FFF; } .customize-control-sinatra-radio-image label { position: relative; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-box-flex: 0; -ms-flex: 0 0 auto; flex: 0 0 auto; -ms-flex-preferred-size: 33.33%; flex-basis: 33.33%; max-width: 33.33%; padding: 12px 6px 0 6px; margin: 0; } .customize-control-sinatra-radio-image label img { -webkit-box-sizing: border-box; box-sizing: border-box; border: solid 2px #fff; display: block; } .customize-control-sinatra-radio-image label:hover .small-tooltip { display: block; } customizer/controls/radio-image/radio-image.js000064400000000001151231536710015500 0ustar00;customizer/controls/radio-image/radio-image.min.css000064400000002321151231536710016445 0ustar00.customize-control-sinatra-radio-image .sinatra-radio-image-choices{box-sizing:border-box;margin-top:-6px;margin-left:-6px;margin-right:-6px;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.customize-control-sinatra-radio-image input{display:none}.customize-control-sinatra-radio-image input:checked+label>img{border-color:#0085ba}.customize-control-sinatra-radio-image input:checked+label:after{content:"\f147";-webkit-font-smoothing:antialiased;font:normal 16px/1 dashicons;vertical-align:top;position:absolute;bottom:0;left:6px;width:20px;height:20px;background-color:#0085ba;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#fff}.customize-control-sinatra-radio-image label{position:relative;box-sizing:border-box;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-preferred-size:33.33%;flex-basis:33.33%;max-width:33.33%;padding:12px 6px 0;margin:0}.customize-control-sinatra-radio-image label img{box-sizing:border-box;border:2px solid #fff;display:block}.customize-control-sinatra-radio-image label:hover .small-tooltip{display:block}customizer/controls/radio-image/radio-image.min.js000064400000000001151231536710016262 0ustar00;customizer/controls/radio-image/radio-image.scss000064400000002222151231536710016046 0ustar00/*****************************************/ /* Customizer radio image control style /*****************************************/ .customize-control-sinatra-radio-image { .sinatra-radio-image-choices { box-sizing: border-box; margin-top: -6px; margin-left: -6px; margin-right: -6px; display: flex; flex: 0 1 auto; flex-direction: row; flex-wrap: wrap; } input { display: none; &:checked { & + label { & > img { border-color: #0085ba; } &:after { content: '\f147'; -webkit-font-smoothing: antialiased; font: normal 16px/1 "dashicons"; vertical-align: top; position: absolute; bottom: 0; left: 6px; width: 20px; height: 20px; background-color: #0085ba; display: flex; align-items: center; justify-content: center; color: #FFF; } } } } label { position: relative; box-sizing: border-box; flex: 0 0 auto; flex-basis: 33.33%; max-width: 33.33%; padding: 12px 6px 0 6px; margin: 0; img { box-sizing: border-box; border: solid 2px #fff; display: block; } &:hover { .small-tooltip { display: block; } } } }customizer/controls/range/class-sinatra-customizer-control-range.php000064400000010731151231536710022144 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Range' ) ) : /** * Sinatra Customizer custom heading control class. */ class Sinatra_Customizer_Control_Range extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-range'; /** * Minimum range value. * * @since 1.0.0 * @var integer */ public $min = 0; /** * Maximum range value. * * @since 1.0.0 * @var integer */ public $max = 1000; /** * Range step value. * * @since 1.0.0 * @var integer */ public $step = 1; /** * Range unit. * * @since 1.0.0 * @var string */ public $unit = array(); /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['min'] = $this->min; $this->json['max'] = $this->max; $this->json['step'] = $this->step; $this->json['unit'] = $this->unit; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
        <# if ( data.label ) { #>
        {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
        <# } #>
        <# if ( ! _.isEmpty( data.responsive ) ) { #> <# _.each( data.responsive, function( settings, device ){ #>
        <# } ); #> <# } else { #> <# if ( _.isObject( data.value ) ) { #> <# } else { #> <# } #> <# if ( _.isObject( data.value ) ) { #> <# } else { #> <# } #> <# } #>
        = 1 && value % 1 !== 0 ) { value = Math.round( value ); range_input.val( value ); range.val( value ).change(); } if ( value > max ) { range_input.val( max ); range.val( max ).change(); } if ( value < min ) { range_input.val( min ); range.val( min ).change(); } range.val( value ).change(); }, /** * Initialize responsive controls for range. * * @since 1.0.0 * * @access private * * @returns {void} */ _initResponsiveControls: function() { var self = this, el = self.element, wrap = el.find( '.sinatra-control-wrap' ); el.addClass( 'sinatra-control-responsive' ); // Populate responsive switcher. if ( el.find( '.customize-control-title' ).length ) { var $switcher = $( '
          ' ); for ( var device in self.options.responsive ) { $switcher.append( '
        • ' + device + '
        • ' ); } el.find( '.customize-control-title' ).append( $switcher ); } }, /** * Initialize unit controls for range. * * @since 1.0.0 * * @access private * * @returns {void} */ _initUnit: function() { var self = this, el = self.element, wrap = el.find( '.sinatra-control-wrap' ); var template = wp.template( 'sinatra-control-unit' ); var data = { unit: self.options.unit, id: self.options.id, option: self.options.option, selected: wrap.attr( 'data-unit' ) }; if ( 'object' === typeof self.options.unit ) { $( template( data ) ).insertBefore( wrap ); if ( 'undefined' !== typeof self.options.value.unit ) { wrap.parent().find( '#' + self.options.id + '-' + self.options.value.unit + '-unit' ).click(); } } else if ( 'string' === typeof self.options.unit ) { $( '' + self.options.unit + '' ).insertAfter( wrap.find( '.sinatra-range-input' ) ); } wrap.parent().find( '.sinatra-control-unit input:checked' ).click(); } }; // Register the color picker as a widget. $.widget( 'sinatra.rangeControl', RangeControl ); }( jQuery ) ); })(jQuery);;customizer/controls/range/range.min.css000064400000005741151231536710014312 0ustar00.sinatra-range-wrapper .sinatra-control-wrap{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;box-sizing:border-box;margin-top:12px}.sinatra-range-wrapper .sinatra-control-wrap .sinatra-range-input,.sinatra-range-wrapper .sinatra-control-wrap .sinatra-reset-range,.sinatra-range-wrapper .sinatra-control-wrap input[type=range]{-ms-flex:1;flex:1}.sinatra-range-wrapper input[type=range]{background-color:#ddd;height:3px;padding:0;margin:0;cursor:pointer;transition:background .15s ease;border-radius:3px;-webkit-appearance:none}.sinatra-range-wrapper input[type=range]:focus{box-shadow:none!important;outline:none!important}.sinatra-range-wrapper input[type=range]:hover{background-color:rgba(0,0,0,.1)}.sinatra-range-wrapper input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background-color:#2e86b9;width:15px;height:15px;border:none;border-radius:50%;transition:background-color .15s ease,box-shadow .15s ease,transform .15s ease}.sinatra-range-wrapper input[type=range]::-webkit-slider-thumb:hover{background-color:#008ec2;box-shadow:0 0 0 10px rgba(46,134,185,.12)}.sinatra-range-wrapper input[type=range]::-webkit-slider-thumb:active{box-shadow:none;transform:scale(1.5);cursor:grabbing}.sinatra-range-wrapper input[type=range]::-moz-range-track{border:inherit;background-color:transparent}.sinatra-range-wrapper input[type=range]::-ms-track{border:inherit;color:transparent;background-color:transparent}.sinatra-range-wrapper input[type=range]::-ms-fill-lower,.sinatra-range-wrapper input[type=range]::-ms-fill-upper{background-color:transparent}.sinatra-range-wrapper input[type=range]::-ms-tooltip{display:none}.sinatra-range-wrapper input[type=range]::-moz-range-thumb{background-color:#2e86b9;width:15px;height:15px;border:none;border-radius:30px;transition:all .15s ease}.sinatra-range-wrapper input[type=range]::-moz-range-thumb:hover{background-color:#008ec2;transform:scale(1.25)}.sinatra-range-wrapper input[type=range]::-ms-thumb{background-color:#2e86b9;width:15px;height:15px;border:none;border-radius:30px;transition:all .15s ease}.sinatra-range-wrapper input[type=range]::-ms-thumb:hover{background-color:#008ec2;transform:scale(1.25)}.sinatra-range-wrapper .sinatra-range-input{max-width:50px;height:28px;text-align:center;font-size:13px;border-radius:3px;font-weight:400;color:#23282d;-moz-appearance:textfield;margin-left:6px!important}.sinatra-range-wrapper .sinatra-range-input::-webkit-inner-spin-button,.sinatra-range-wrapper .sinatra-range-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.sinatra-range-wrapper .sinatra-reset-range{max-width:16px;margin-left:12px;display:inline-block;position:relative;line-height:1;color:rgba(0,0,0,.2);cursor:pointer;text-align:center}.sinatra-range-wrapper .sinatra-reset-range:hover{color:red}.sinatra-range-wrapper .sinatra-reset-range span{width:13px;height:13px;font-size:13px;line-height:1}.sinatra-range-wrapper .sinatra-range-unit{margin-left:6px;color:#555d66}customizer/controls/range/range.min.js000064400000011604151231536710014131 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-range"]=wp.customize.Control.extend({ready:function(){var control=this,setting=control.setting.get();control.container.find(".sinatra-range-wrapper").rangeControl({id:control.params.id,unit:control.params.unit,value:setting,responsive:control.params.responsive,change:function(){control.save()}})},save:function(){var value={},devices=this.params.responsive;if(!1===devices||void 0===devices||0==devices.length)value.value=parseFloat(this.container.find(".sinatra-range-input").val());else for(var device in devices)value[device]=parseFloat(this.container.find(".control-responsive."+device+" .sinatra-range-input").val());this.container.find(".sinatra-control-unit").length&&(value.unit=this.container.find(".sinatra-control-unit input:checked").val()),this.setting.set(value)}}),function($,undef){var RangeControl;RangeControl={options:{id:!1,option:!1,responsive:!1,unit:!1,value:!1,change:!1},_create:function(){var el=this.element;this.unit=el.find(".sinatra-control-wrap").attr("data-unit"),this._addListeners(),"object"==typeof this.options.responsive&&this._initResponsiveControls(),!1!==this.options.unit&&this._initUnit()},_addListeners:function(){var range,input,value,newVal,self=this;self.element.change((function(event){$.isFunction(self.options.change)&&self.options.change.call(this,event)})),self.element.on("keyup input paste",".sinatra-range-input",(function(){self._autocorrectSlider($(this))})).on("focusout",(function(){self._autocorrectSlider($(this))})),self.element.on("click","input[type=range]",(function(){range=$(this),input=range.parent().children(".sinatra-range-input"),newVal=range.val(),value!==newVal&&(value=newVal,input.val(newVal).change())})),self.element.on("mousedown","input[type=range]",(function(){range=$(this),input=range.parent().children(".sinatra-range-input"),range.mousemove((function(){newVal=range.val(),value!==newVal&&(value=newVal,input.val(newVal).change())}))})),self.element.on("mouseup","input[type=range]",(function(){$(this).off("mousemove")})),self.element.on("click",".sinatra-reset-range",(function(){var $el;self.element.find(".sinatra-reset-range").each((function(index,el){$el=$(el),self.unit=$el.data("reset_unit"),$el.closest(".sinatra-range-wrapper").find('.sinatra-control-unit input[type="radio"][value="'+$el.data("reset_unit")+'"]').click(),$el.siblings("input").val($el.data("reset_value"))})),self.element.change()})),self.element.on("click",".sinatra-control-unit input",(function(){var $unit=$(this);self.element.find('.sinatra-control-wrap input[type="range"]').each((function(index,el){$(this).attr("min",$unit.data("min")),$(this).attr("max",$unit.data("max")),$(this).attr("step",$unit.data("step"))})),"px"!==$unit.val()||"rem"!==self.unit&&"em"!==self.unit?"rem"!==$unit.val()&&"em"!==$unit.val()||"px"!==self.unit||(self.element.find("input.sinatra-range-input").each((function(index,el){$(el).val($(el).val()/16),self._autocorrectSlider($(el))})),self.unit=$unit.val()):(self.element.find("input.sinatra-range-input").each((function(index,el){$(el).val(Math.floor(16*$(el).val())),self._autocorrectSlider($(el))})),self.unit=$unit.val())}))},_autocorrectSlider:function(range_input){var range=range_input.parent().find('input[type="range"]'),value=parseFloat(range_input.val()),step=parseFloat(range_input.attr("step")),min=parseFloat(range_input.attr("min")),max=parseFloat(range_input.attr("max"));isNaN(value)?range.change():(step>=1&&value%1!=0&&(value=Math.round(value),range_input.val(value),range.val(value).change()),value>max&&(range_input.val(max),range.val(max).change()),value');for(var device in this.options.responsive)$switcher.append('
        • '+device+'
        • ');el.find(".customize-control-title").append($switcher)}},_initUnit:function(){var wrap=this.element.find(".sinatra-control-wrap"),template=wp.template("sinatra-control-unit"),data={unit:this.options.unit,id:this.options.id,option:this.options.option,selected:wrap.attr("data-unit")};"object"==typeof this.options.unit?($(template(data)).insertBefore(wrap),void 0!==this.options.value.unit&&wrap.parent().find("#"+this.options.id+"-"+this.options.value.unit+"-unit").click()):"string"==typeof this.options.unit&&$(''+this.options.unit+"").insertAfter(wrap.find(".sinatra-range-input")),wrap.parent().find(".sinatra-control-unit input:checked").click()}},$.widget("sinatra.rangeControl",RangeControl)}(jQuery)}(jQuery);;customizer/controls/range/range.scss000064400000005373151231536710013714 0ustar00/*****************************************/ /* Customizer control range style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .sinatra-range-wrapper { .sinatra-control-wrap { display: flex; flex-wrap: wrap; align-items: center; box-sizing: border-box; margin-top: 12px; input[type=range], .sinatra-range-input, .sinatra-reset-range { flex: 1; } } input[type=range] { background-color: #ddd; height: 3px; padding: 0; margin: 0; cursor: pointer; transition: background .15s ease; border-radius: 3px; -webkit-appearance: none; &:focus { box-shadow: none !important; outline: none !important; } &:hover { background-color: rgba(0, 0, 0, 0.1); } &::-webkit-slider-thumb { -webkit-appearance: none; background-color: #2e86b9; width: 15px; height: 15px; border: none; border-radius: 50%; transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease; &:hover { background-color: #008ec2; box-shadow: 0 0 0 10px rgba(46, 134, 185, 0.12); } &:active { box-shadow: none; transform: scale(1.5); cursor: grabbing; } } &::-moz-range-track { border: inherit; background-color: transparent; } &::-ms-track { border: inherit; color: transparent; background-color: transparent; } &::-ms-fill-lower, &::-ms-fill-upper { background-color: transparent; } &::-ms-tooltip { display: none; } &::-moz-range-thumb { background-color: #2e86b9; width: 15px; height: 15px; border: none; border-radius: 30px; transition: all .15s ease; &:hover { background-color: #008ec2; transform: scale(1.25); } } &::-ms-thumb { background-color: #2e86b9; width: 15px; height: 15px; border: none; border-radius: 30px; transition: all .15s ease; &:hover { background-color: #008ec2; transform: scale(1.25); } } } .sinatra-range-input { max-width: 50px; height: 28px; text-align: center; font-size: 13px; border-radius: 3px; font-weight: 400; color: $color_3; -moz-appearance: textfield; margin-left: 6px !important; &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } } .sinatra-reset-range { max-width: 16px; margin-left: 12px; display: inline-block; position: relative; line-height: 1; color: rgba(0, 0, 0, 0.2); cursor: pointer; text-align: center; &:hover { color: #f00; } span { width: 13px; height: 13px; font-size: 13px; line-height: 1; } } .sinatra-range-unit { margin-left: 6px; color: #555d66; } }customizer/controls/select/class-sinatra-customizer-control-select.php000064400000011442151231536710022512 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Select' ) ) : /** * Sinatra Customizer custom select control class. */ class Sinatra_Customizer_Control_Select extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-select'; /** * Placeholder text. * * @since 1.0.0 * @var string|false */ public $placeholder = false; /** * Select2 flag. * * @since 1.0.0 * @var boolean */ public $is_select2 = false; /** * Data source. * * @since 1.0.0 * @var string|false */ public $data_source = false; /** * Multiple items. * * @since 1.0.0 * @var boolean */ public $multiple = false; /** * Set the default typography options. * * @since 1.0.8 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); if ( $this->is_select2 ) { switch ( $this->data_source ) { case 'category': $categories = get_categories(); $choices = array(); if ( ! empty( $categories ) ) { foreach ( $categories as $category ) { $choices[ $category->slug ] = $category->name; } } $this->choices = $choices; break; default: // code... break; } } } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['choices'] = $this->choices; $this->json['placeholder'] = $this->placeholder; $this->json['is_select2'] = $this->is_select2; $this->json['multiple'] = $this->multiple ? ' multiple="multiple"' : ''; if ( $this->multiple ) { $this->json['value'] = implode( ',', (array) $this->json['value'] ); } } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { parent::enqueue(); if ( $this->is_select2 ) { // Script debug. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; /** * Enqueue select2 stylesheet. */ wp_enqueue_style( 'sinatra-select2-style', SINATRA_THEME_URI . '/inc/admin/assets/css/select2' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); /** * Enqueue select2 script. */ wp_enqueue_script( 'sinatra-select2-js', SINATRA_THEME_URI . '/inc/admin/assets/js/libs/select2' . $sinatra_suffix . '.js', array( 'jquery' ), SINATRA_THEME_VERSION, true ); } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          ' + name + ''; }); self.container.find( '.sinatra-select-control' ).html( options ); } }); })(jQuery);;customizer/controls/select/select.min.css000064400000002236151231536710014654 0ustar00.sinatra-select-wrapper select{margin:6px 0 0}.sinatra-select-wrapper .select2-container--default .select2-selection--multiple{border-radius:3px;border-color:#7e8993}.sinatra-select-wrapper .select2-container--default .select2-selection--multiple .select2-selection__rendered{display:block}.sinatra-select-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:#eee;border-color:#ddd;border-radius:20px;padding:2px 10px;margin-bottom:0}.sinatra-select-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice__remove{position:relative;top:-1.5px;color:#aaa;margin-right:5px;font-weight:400}.sinatra-select-wrapper .select2-container--default .select2-selection--multiple .select2-selection__clear{margin-right:2px;font-weight:400;font-size:17px}.sinatra-select-wrapper .select2-container--default .select2-search--inline .select2-search__field{position:absolute;padding:0 5px;margin:0}.sinatra-select-wrapper .select2-container .select2-selection--multiple{min-height:35px}.select2-results{padding:6px}customizer/controls/select/select.min.js000064400000002134151231536710014475 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-select"]=wp.customize.Control.extend({ready:function(){var control=this;control.params.is_select2&&(control.container.find(".sinatra-select-control").select2({placeholder:sinatra_customizer_localized.strings.selectCategory,allowClear:!0}),control.container.on("select2:opening",".sinatra-select-control",(function(){control.populate_select2(),control.container.off("select2:opening",".sinatra-select-control")})),control.container.on("select2:select select2:unselect select2:clear",".sinatra-select-control",(function(){$(this).val()||control.setting.set([])})))},populate_select2:function(e){var self=this,options="",selected="",setting=self.setting.get();""===setting["font-family"]&&(selected=' selected="selected"'),$.each(self.params.choices,(function(id,name){selected="",(setting&&self.params.multiple&&-1!==setting.indexOf(id)||!self.params.multiple&&id===setting)&&(selected=' selected="selected"'),options+='"})),self.container.find(".sinatra-select-control").html(options)}})}(jQuery);;customizer/controls/select/select.scss000064400000002161151231536710014252 0ustar00/*****************************************/ /* Customizer control select style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .sinatra-select-wrapper { select { margin: 6px 0 0 0; } .select2-container--default .select2-selection--multiple { border-radius: 3px; border-color: #7e8993; .select2-selection__rendered { display: block; } .select2-selection__choice { display: flex; align-items: center; background-color: #eee; border-color: #ddd; border-radius: 20px; padding: 2px 10px; margin-bottom: 0; } .select2-selection__choice__remove { position: relative; top: -1.5px; color: #aaa; margin-right: 5px; font-weight: 400; } .select2-selection__clear { margin-right: 2px; font-weight: 400; font-size: 17px; } } .select2-container--default .select2-search--inline .select2-search__field { position: absolute; padding: 0px 5px; margin: 0; } .select2-container .select2-selection--multiple { min-height: 35px; } } .select2-results { padding: 6px; } customizer/controls/sortable/class-sinatra-customizer-control-sortable.php000064400000006714151231536710023410 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Sortable' ) ) : /** * Sinatra Customizer custom select control class. */ class Sinatra_Customizer_Control_Sortable extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-sortable'; /** * Should this element be sortable. Useful to control only visibility of items. * * @var boolean */ public $sortable = true; /** * Set the default typography options. * * @since 1.0.8 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['choices'] = $this->choices; $this->json['sortable'] = $this->sortable; foreach ( $this->choices as $key => $value ) { if ( ! isset( $this->json['value'][ $key ] ) ) { $this->json['value'][ $key ] = $this->json['default'][ $key ]; } } foreach ( $this->json['value'] as $key => $value ) { if ( ! isset( $this->json['choices'][ $key ] ) ) { unset( $this->json['value'][ $key ] ); } } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
            <# for ( key in data.value ) { #>
          • <# if ( data.sortable ) { #> <# } #> {{{ data.choices[ key ] }}}
          • <# } #>
          .sinatra-sortable-item', intersect: 'pointer', axis: 'y', update: function() { control.update(); } }); } // Set visibility. control.container.on( 'click', '.dashicons-visibility', function(){ $(this).closest( '.sinatra-sortable-item' ).toggleClass( 'invisible' ); control.update(); }); }, update: function() { var items = this.container.find( '.sinatra-sortable-item' ), new_val = {}, $item; if ( ! _.isEmpty( items ) ) { _.each( items, function( item ){ $item = $(item); new_val[ $item.data( 'value' ) ] = ! $item.hasClass( 'invisible' ); }); } this.setting.set( {} ); this.setting.set( new_val ); } }); })(jQuery); ;customizer/controls/sortable/sortable.min.css000064400000002016151231536710015540 0ustar00.sinatra-sortable-control{margin-top:12px;margin-bottom:24px}.sinatra-sortable-item.invisible{background-color:hsla(0,0%,100%,0)}.sinatra-sortable-item.invisible .dashicons-visibility:before{content:"\f530"}.sinatra-sortable-item{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:#fff;position:relative;line-height:1.3;font-size:1em;padding:0;margin:0 0 6px;border:1px solid #dedede}.sinatra-sortable-item .dashicons{-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:38px;height:44px;border-right:1px solid #dedede;font-size:16px}.sinatra-sortable-item .dashicons-menu{cursor:grab}.sinatra-sortable-item .dashicons-menu:active{cursor:grabbing}.sinatra-sortable-item .dashicons-visibility{cursor:pointer}.sinatra-sortable-item span{margin-left:12px;font-weight:400;white-space:nowrap;margin-right:30px;overflow:hidden;text-overflow:ellipsis;display:block;line-height:1}customizer/controls/sortable/sortable.min.js000064400000001333151231536710015365 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-sortable"]=wp.customize.Control.extend({ready:function(){var control=this;control.params.sortable&&control.container.find("ul").sortable({items:"> .sinatra-sortable-item",intersect:"pointer",axis:"y",update:function(){control.update()}}),control.container.on("click",".dashicons-visibility",(function(){$(this).closest(".sinatra-sortable-item").toggleClass("invisible"),control.update()}))},update:function(){var $item,items=this.container.find(".sinatra-sortable-item"),new_val={};_.isEmpty(items)||_.each(items,(function(item){$item=$(item),new_val[$item.data("value")]=!$item.hasClass("invisible")})),this.setting.set({}),this.setting.set(new_val)}})}(jQuery);;customizer/controls/sortable/sortable.scss000064400000002135151231536710015143 0ustar00/*****************************************/ /* Customizer control sortable style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .sinatra-sortable-control { margin-top: 12px; margin-bottom: 24px; } .sinatra-sortable-item.invisible { background-color: rgba(255,255,255,0); .dashicons-visibility:before { content: '\f530'; } } .sinatra-sortable-item { display: flex; align-items: center; background-color: #fff; position: relative; line-height: 1.3; font-size: 1em; padding: 0; margin: 0 0 6px; border: 1px solid #dedede; .dashicons { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 44px; border-right: 1px solid #dedede; font-size: 16px; } .dashicons-menu { cursor: grab; &:active { cursor: grabbing; } } .dashicons-visibility { cursor: pointer; } span { margin-left: 12px; font-weight: 400; white-space: nowrap; margin-right: 30px; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1; } }customizer/controls/spacing/class-sinatra-customizer-control-spacing.php000064400000012042151231536710023021 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Spacing' ) ) : /** * Sinatra Customizer custom select control class. */ class Sinatra_Customizer_Control_Spacing extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-spacing'; /** * The unit. * * @var string */ public $unit = array(); /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['title'] = esc_html__( 'Link values', 'sinatra' ); $this->json['choices'] = $this->choices; $this->json['unit'] = $this->unit; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          <# if ( data.label ) { #>
          {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #> <# if ( ! _.isEmpty( data.responsive ) ) { #> responsive_devices(); ?> <# } #>
          <# } #> <# if ( ! _.isEmpty( data.unit ) ) { #>
          <# _.each( data.unit, function( unit ){ #> checked="checked"<# } #> /> <# }); #>
          <# } #>
          <# if ( ! _.isEmpty( data.responsive ) ) { #> <# _.each( data.responsive, function( settings, device ){ #>
            <# _.each( data.choices, function( title, id ){ #> <# if ( _.isEmpty( data.value[ device ] ) ) { data.value[ device ] = []; } #>
          • {{{ title }}}
          • <# }); #> <# if ( _.size( data.choices ) > 1 ) { #>
          • <# } #>
          <# }); #> <# } else { #>
            <# _.each( data.choices, function( title, id ){ #>
          • {{{ title }}}
          • <# }); #>
          <# } #>
          ul { padding-top: 6px; display: none; width: 100%; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; } .customize-control-sinatra-spacing .sinatra-control-wrap > ul.active { -js-display: flex; display: -webkit-box; display: -ms-flexbox; display: flex; } .customize-control-sinatra-spacing .sinatra-control-wrap .reset-defaults { position: absolute; top: -18px; right: 0; margin-right: 0; } .customize-control-sinatra-spacing .spacing-control-wrap { width: 20%; margin: 0; } .customize-control-sinatra-spacing .spacing-control-wrap input, .customize-control-sinatra-spacing .spacing-control-wrap button { display: block; font-size: 12px; padding: 4px 0; width: 100%; height: 32px; border: 1px solid; border-color: #ddd; border-left-width: 0; border-radius: 0; text-align: center; -webkit-box-shadow: none !important; box-shadow: none !important; } .customize-control-sinatra-spacing .spacing-control-wrap input[type=number]::-webkit-inner-spin-button, .customize-control-sinatra-spacing .spacing-control-wrap input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } .customize-control-sinatra-spacing .spacing-control-wrap:first-child input { border-left-width: 1px; border-radius: 3px 0 0 3px; } .customize-control-sinatra-spacing .spacing-control-wrap .sinatra-spacing-label { display: block; color: #808890; font-size: 10px; padding-top: 4px; font-style: normal; text-transform: uppercase; font-weight: 400; text-align: center; } .customize-control-sinatra-spacing .spacing-control-wrap input:focus + .sinatra-spacing-label { color: #23282d; } .customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values { border: 1px solid #ddd; border-left-width: 0; padding: 0; outline: none; border-radius: 0 3px 3px 0; cursor: pointer; } .customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values span { display: block; width: 100%; height: 30px; line-height: 30px; font-size: 16px; border-radius: 0 2px 2px 0; color: #808890; } .customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values:hover span { color: #23282d; } .customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values .sinatra-spacing-linked { display: none; color: #0073aa !important; } .customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values.unlinked .sinatra-spacing-unlinked { display: none; } .customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values.unlinked .sinatra-spacing-linked { display: block; } customizer/controls/spacing/spacing.js000064400000004723151231536710014233 0ustar00;(function($) { "use strict"; wp.customize.controlConstructor['sinatra-spacing'] = wp.customize.Control.extend({ ready: function() { 'use strict'; var control = this; // Linked button. control.container.on( 'click', '.sinatra-spacing-linked', function() { // Set up variables. var $this = $( this ); // Remove linked class. $this.closest( 'ul' ).find( '.spacing-input' ).removeClass( 'linked' ); // Remove class. $this.parent( '.spacing-link-values' ).removeClass( 'unlinked' ); }); // Unlinked button. control.container.on( 'click', '.sinatra-spacing-unlinked', function() { // Set up variables. var $this = $( this ); // Remove linked class. $this.closest( 'ul' ).find( '.spacing-input' ).addClass( 'linked' ); // Remove class. $this.parent( '.spacing-link-values' ).addClass( 'unlinked' ); }); // Values linked inputs. control.container.on( 'input', '.linked input', function() { var $val = $( this ).val(); $(this).closest( '.spacing-input' ).siblings( '.linked' ).find( 'input' ).val( $val ).change(); }); // Change unit. control.container.find( '.sinatra-control-unit input[type="radio"]' ).on( 'change', function() { control.save_value(); }); // Store new inputs. control.container.on( 'change input', '.spacing-input input', function() { control.save_value(); }); // Reset default values. control.container.find( '.reset-defaults' ).on( 'click', function() { control.container.find( 'input[type="number"]' ).each( function() { $(this).val( $(this).data('default') ); }); control.save_value(); }); }, save_value: function() { var new_val = {}, devices = this.params.responsive, choices = this.params.choices, choice, device, units = this.container.find( '.sinatra-control-unit' ); if ( devices === undefined || devices.length == 0 ) { for ( choice in choices ) { new_val[ choice ] = this.container.find( '[data-spacing-choice="' + choice + '"]').val(); } } else { for ( device in devices ) { new_val[ device ] = {}; for ( choice in choices ) { new_val[ device ][ choice ] = this.container.find( '.control-responsive.' + device + ' [data-spacing-choice="' + choice + '"]').val(); } } } if ( units.length ) { new_val.unit = units.find( 'input[type="radio"]:checked' ).val(); } this.setting.set( new_val ); }, }); })(jQuery);;customizer/controls/spacing/spacing.min.css000064400000004535151231536710015172 0ustar00.customize-control-sinatra-spacing .sinatra-control-wrap{position:relative}.customize-control-sinatra-spacing .sinatra-control-wrap>ul{padding-top:6px;display:none;width:100%;-ms-flex-align:start;align-items:flex-start}.customize-control-sinatra-spacing .sinatra-control-wrap>ul.active{-js-display:flex;display:-ms-flexbox;display:flex}.customize-control-sinatra-spacing .sinatra-control-wrap .reset-defaults{position:absolute;top:-18px;right:0;margin-right:0}.customize-control-sinatra-spacing .spacing-control-wrap{width:20%;margin:0}.customize-control-sinatra-spacing .spacing-control-wrap button,.customize-control-sinatra-spacing .spacing-control-wrap input{display:block;font-size:12px;padding:4px 0;width:100%;height:32px;border:1px solid;border-color:#ddd;border-left-width:0;border-radius:0;text-align:center;box-shadow:none!important}.customize-control-sinatra-spacing .spacing-control-wrap input[type=number]::-webkit-inner-spin-button,.customize-control-sinatra-spacing .spacing-control-wrap input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.customize-control-sinatra-spacing .spacing-control-wrap:first-child input{border-left-width:1px;border-radius:3px 0 0 3px}.customize-control-sinatra-spacing .spacing-control-wrap .sinatra-spacing-label{display:block;color:#808890;font-size:10px;padding-top:4px;font-style:normal;text-transform:uppercase;font-weight:400;text-align:center}.customize-control-sinatra-spacing .spacing-control-wrap input:focus+.sinatra-spacing-label{color:#23282d}.customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values{border:1px solid #ddd;border-left-width:0;padding:0;outline:none;border-radius:0 3px 3px 0;cursor:pointer}.customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values span{display:block;width:100%;height:30px;line-height:30px;font-size:16px;border-radius:0 2px 2px 0;color:#808890}.customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values:hover span{color:#23282d}.customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values .sinatra-spacing-linked{display:none;color:#0073aa!important}.customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values.unlinked .sinatra-spacing-unlinked{display:none}.customize-control-sinatra-spacing .spacing-control-wrap .spacing-link-values.unlinked .sinatra-spacing-linked{display:block}customizer/controls/spacing/spacing.min.js000064400000003320151231536710015005 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-spacing"]=wp.customize.Control.extend({ready:function(){var control=this;control.container.on("click",".sinatra-spacing-linked",(function(){var $this=$(this);$this.closest("ul").find(".spacing-input").removeClass("linked"),$this.parent(".spacing-link-values").removeClass("unlinked")})),control.container.on("click",".sinatra-spacing-unlinked",(function(){var $this=$(this);$this.closest("ul").find(".spacing-input").addClass("linked"),$this.parent(".spacing-link-values").addClass("unlinked")})),control.container.on("input",".linked input",(function(){var $val=$(this).val();$(this).closest(".spacing-input").siblings(".linked").find("input").val($val).change()})),control.container.find('.sinatra-control-unit input[type="radio"]').on("change",(function(){control.save_value()})),control.container.on("change input",".spacing-input input",(function(){control.save_value()})),control.container.find(".reset-defaults").on("click",(function(){control.container.find('input[type="number"]').each((function(){$(this).val($(this).data("default"))})),control.save_value()}))},save_value:function(){var choice,device,new_val={},devices=this.params.responsive,choices=this.params.choices,units=this.container.find(".sinatra-control-unit");if(void 0===devices||0==devices.length)for(choice in choices)new_val[choice]=this.container.find('[data-spacing-choice="'+choice+'"]').val();else for(device in devices)for(choice in new_val[device]={},choices)new_val[device][choice]=this.container.find(".control-responsive."+device+' [data-spacing-choice="'+choice+'"]').val();units.length&&(new_val.unit=units.find('input[type="radio"]:checked').val()),this.setting.set(new_val)}})}(jQuery);;customizer/controls/spacing/spacing.scss000064400000003737151231536710014576 0ustar00/*****************************************/ /* Customizer control spacing style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .customize-control-sinatra-spacing { .sinatra-control-wrap { position: relative; & > ul { padding-top: 6px; display: none; width: 100%; align-items: flex-start; &.active { display: flex; } } .reset-defaults { position: absolute; top: -18px; right: 0; margin-right: 0; } } .spacing-control-wrap { width: 20%; margin: 0; input, button { display: block; font-size: 12px; padding: 4px 0; width: 100%; height: 32px; border: 1px solid; border-color: #ddd; border-left-width: 0; border-radius: 0; text-align: center; box-shadow: none !important; } input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } &:first-child input { border-left-width: 1px; border-radius: 3px 0 0 3px; } .sinatra-spacing-label { display: block; color: #808890; font-size: 10px; padding-top: 4px; font-style: normal; text-transform: uppercase; font-weight: 400; text-align: center; } input:focus + .sinatra-spacing-label { color: #23282d; } .spacing-link-values { border: 1px solid #ddd; border-left-width: 0; padding: 0; outline: none; border-radius: 0 3px 3px 0; cursor: pointer; span { display: block; width: 100%; height: 30px; line-height: 30px; font-size: 16px; border-radius: 0 2px 2px 0; color: #808890; } &:hover span { color: #23282d; } .sinatra-spacing-linked { display: none; color: #0073aa !important; } &.unlinked { .sinatra-spacing-unlinked { display: none; } .sinatra-spacing-linked { display: block; } } } } } customizer/controls/text/class-sinatra-customizer-control-text.php000064400000004441151231536710021725 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Text' ) ) : /** * Sinatra Customizer custom select control class. */ class Sinatra_Customizer_Control_Text extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-text'; /** * Placeholder text. * * @since 1.0.0 * @var string|false */ public $placeholder = ''; /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['placeholder'] = $this->placeholder; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Textarea' ) ) : /** * Sinatra Customizer custom select control class. */ class Sinatra_Customizer_Control_Textarea extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-textarea'; /** * Placeholder text. * * @since 1.0.0 * @var string|false */ public $placeholder = ''; /** * Textarea rows parameter. * * @since 1.0.0 * @var string|false */ public $rows = '5'; /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['rows'] = $this->rows; $this->json['placeholder'] = $this->placeholder; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Toggle' ) ) : /** * Sinatra Customizer custom toggle control class. */ class Sinatra_Customizer_Control_Toggle extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-toggle'; /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          <# if ( data.label ) { #>
          {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
          <# } #>
          checked="checked" <# } #>>
          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Typography' ) ) : /** * Sinatra Customizer custom typography control class. */ class Sinatra_Customizer_Control_Typography extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-typography'; /** * The control type. * * @var string */ public $display = array(); /** * Set the default typography options. * * @since 1.0.8 * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id Control ID. * @param array $args Default parent's arguments. */ public function __construct( $manager, $id, $args = array() ) { $this->display = array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'font-style' => array(), 'text-transform' => array(), 'letter-spacing' => array(), 'text-decoration' => array(), 'font-size' => array(), 'line-height' => array(), ); parent::__construct( $manager, $id, $args ); } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { parent::enqueue(); wp_localize_script( $this->type . '-js', 'sinatra_typography_vars', array( 'fonts' => sinatra()->fonts->get_fonts(), 'default' => sinatra()->fonts->get_default_system_font(), ) ); // Script debug. $sinatra_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; /** * Enqueue select2 stylesheet. */ wp_enqueue_style( 'sinatra-select2-style', SINATRA_THEME_URI . '/inc/admin/assets/css/select2' . $sinatra_suffix . '.css', false, SINATRA_THEME_VERSION, 'all' ); /** * Enqueue select2 script. */ wp_enqueue_script( 'sinatra-select2-js', SINATRA_THEME_URI . '/inc/admin/assets/js/libs/select2' . $sinatra_suffix . '.js', array( 'jquery' ), SINATRA_THEME_VERSION, true ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['display'] = $this->display; $this->json['l10n'] = array( 'advanced' => esc_html__( 'Advanced', 'sinatra' ), 'font-family' => esc_html__( 'Font Family', 'sinatra' ), 'font-subsets' => esc_html__( 'Languages', 'sinatra' ), 'font-weight' => esc_html__( 'Weight', 'sinatra' ), 'font-size' => esc_html__( 'Size', 'sinatra' ), 'font-style' => esc_html__( 'Style', 'sinatra' ), 'text-transform' => esc_html__( 'Transform', 'sinatra' ), 'text-decoration' => esc_html__( 'Decoration', 'sinatra' ), 'line-height' => esc_html__( 'Line Height', 'sinatra' ), 'letter-spacing' => esc_html__( 'Letter Spacing', 'sinatra' ), 'inherit' => esc_html__( 'Inherit', 'sinatra' ), 'default' => esc_html__( 'Default System Font', 'sinatra' ), 'weights' => array( 'inherit' => esc_html__( 'Inherit', 'sinatra' ), '100' => esc_html__( 'Thin 100', 'sinatra' ), '100italic' => esc_html__( 'Thin 100 Italic', 'sinatra' ), '200' => esc_html__( 'Extra-Thin 200', 'sinatra' ), '200italic' => esc_html__( 'Extra-Thin 200 Italic', 'sinatra' ), '300' => esc_html__( 'Light 300', 'sinatra' ), '300italic' => esc_html__( 'Light 300 Italic', 'sinatra' ), '400' => esc_html__( 'Normal 400', 'sinatra' ), '400italic' => esc_html__( 'Normal 400 Italic', 'sinatra' ), '500' => esc_html__( 'Medium 500', 'sinatra' ), '500italic' => esc_html__( 'Medium 500 Italic', 'sinatra' ), '600' => esc_html__( 'Semi-Bold 600', 'sinatra' ), '600italic' => esc_html__( 'Semi-Bold 600 Italic', 'sinatra' ), '700' => esc_html__( 'Bold 700', 'sinatra' ), '700italic' => esc_html__( 'Bold 700 Italic', 'sinatra' ), '800' => esc_html__( 'Extra-Bold 800', 'sinatra' ), '800italic' => esc_html__( 'Extra-Bold 800 Italic', 'sinatra' ), '900' => esc_html__( 'Black 900', 'sinatra' ), '900italic' => esc_html__( 'Black 900 Italic', 'sinatra' ), ), 'subsets' => sinatra()->fonts->get_google_font_subsets(), 'transforms' => array( 'inherit' => esc_html__( 'Inherit', 'sinatra' ), 'uppercase' => esc_html__( 'Uppercase', 'sinatra' ), 'lowercase' => esc_html__( 'Lowercase', 'sinatra' ), 'capitalize' => esc_html__( 'Capitalize', 'sinatra' ), 'none' => esc_html__( 'None', 'sinatra' ), ), 'decorations' => array( 'inherit' => esc_html__( 'Inherit', 'sinatra' ), 'underline' => esc_html__( 'Underline', 'sinatra' ), 'overline' => esc_html__( 'Overline', 'sinatra' ), 'line-through' => esc_html__( 'Line Through', 'sinatra' ), 'none' => esc_html__( 'None', 'sinatra' ), ), 'styles' => array( 'inherit' => esc_html__( 'Inherit', 'sinatra' ), 'normal' => esc_html__( 'Normal', 'sinatra' ), 'italic' => esc_html__( 'Italic', 'sinatra' ), 'oblique' => esc_html__( 'Oblique', 'sinatra' ), ), ); $default_units = array( 'font-size' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 50, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 3.5, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 3.5, 'step' => 0.01, ), ), 'letter-spacing' => array( array( 'id' => 'px', 'name' => 'px', 'min' => -10, 'max' => 10, 'step' => 1, ), ), 'line-height' => array( array( 'id' => '', 'name' => '', 'min' => 1, 'max' => 10, 'step' => 0.1, ), ), ); $this->json['units'] = array(); foreach ( array( 'font-size', 'letter-spacing', 'line-height' ) as $key ) { if ( isset( $this->display[ $key ] ) && isset( $this->display[ $key ]['unit'] ) ) { $this->json['units'][ $key ] = $this->display[ $key ]['unit']; } } $this->json['units'] = wp_parse_args( $this->json['units'], $default_units ); $this->json['responsive'] = array( 'desktop' => array( 'title' => esc_html__( 'Desktop', 'sinatra' ), 'icon' => 'dashicons dashicons-desktop', ), 'tablet' => array( 'title' => esc_html__( 'Tablet', 'sinatra' ), 'icon' => 'dashicons dashicons-tablet', ), 'mobile' => array( 'title' => esc_html__( 'Mobile', 'sinatra' ), 'icon' => 'dashicons dashicons-smartphone', ), ); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          <# if ( data.label ) { #>
          {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
          <# } #>
          <# if ( 'font-family' in data.display ) { #>
          <# } #> <# if ( 'font-subsets' in data.display ) { #>
          <# } #> <# if ( 'font-size' in data.display ) { #>
          <# _.each( data.responsive, function( settings, device ){ #>
          <# } ); #>
          <# } #> <# if ( 'font-weight' in data.display ) { #>
          <# } #> <# if ( 'font-style' in data.display ) { #>
          <# } #> <# if ( 'text-transform' in data.display ) { #>
          <# } #> <# if ( 'text-decoration' in data.display ) { #>
          <# } #> <# if ( 'line-height' in data.display ) { #>
          <# _.each( data.responsive, function( settings, device ){ #>
          <# } ); #>
          <# } #> <# if ( 'letter-spacing' in data.display ) { #>
          <# } #>
          { if ( item in control.params.display ) { control.container.find( '[data-option="' + item + '"]' ).val( control.params.default[ item ] ).trigger( 'change' ); } }); rangeFields.forEach( (item) => { control.container.find( '[data-option-id="' + item + '"]' ).find( '.sinatra-reset-range' ).click(); }); }); var outside_click_close = function(e) { if ( ! $( e.target ).closest( '.select2-container' ).length && ! $( e.target ).closest( '.customize-save-button-wrapper' ).length && ! $( e.target ).closest( '.reset-defaults' ).length && ! control.container.has( $( e.target ).closest( '.popup-link' ) ).length && ! control.container.has( $( e.target ).closest( '.popup-content' ) ).length && ! popup_content.hasClass( 'hidden' ) ) { popup_content.addClass( 'hidden' ); control.container.find( '.popup-link' ).removeClass( 'active' ); control.container.find( '.reset-defaults' ).removeClass( 'active' ); $( 'body' ).off( 'click', outside_click_close ); } }; }, // Update value. update_value: function(){ var self = this, value = {}, option; self.container.find( '[data-option]' ).each( function(){ option = $(this).data('option'); if ( 'font-size-unit' === option || 'line-height-unit' === option || 'letter-spacing-unit' === option ) { value[ option ] = $(this).is( ':checked' ) ? $(this).val() : value[ option ]; } else { value[ option ] = $(this).val(); } }); self.setting.set( value ); }, // Populate available font weights for given font family. update_font_weight_field: function( font_family ) { var self = this, options = '', selected = '', setting = self.setting.get(); if ( 'inherit' === font_family ) { selected = ' selected="selected"'; } options += ''; if ( 'inherit' === font_family || 'default' === font_family ) { var default_weights = [ '100', '200', '300','400','500', '600', '700', '800', '900' ]; $.each( default_weights, function( index, variant ){ if ( variant === setting['font-weight'] ) { selected = ' selected="selected"'; } else { selected = ''; } options += ''; }); } else { $.each( sinatra_typography_vars.fonts, function( group_id, group ){ if ( 'undefined' !== typeof group.fonts[ font_family ] ) { $.each( group.fonts[ font_family ].variants, function( index, variant ){ if ( variant === setting['font-weight'] ) { selected = ' selected="selected"'; } else { selected = ''; } options += ''; }); return; } }); } self.container.find( '.sinatra-typography-font-weight' ).find( 'select' ).html( options ); }, // Populate available font subsets for given font family. update_font_subsets_field: function( font_family ) { var self = this, options = '', selected = '', setting = self.setting.get(), field = self.container.find( '.sinatra-typography-font-subsets' ); if ( 'default' === font_family || 'inherit' === font_family ) { field.hide(); return; } $.each( sinatra_typography_vars.fonts, function( group_id, group ){ if ( 'undefined' !== typeof group.fonts[ font_family ] ) { if ( 'system_fonts' === group_id || 'standard_fonts' === group_id ) { field.hide(); } else { field.show(); } $.each( group.fonts[ font_family ].subsets, function( index, subsets ){ selected = ''; if ( setting['font-subsets'] && -1 !== setting['font-subsets'].indexOf( subsets ) || 'latin' === subsets ) { selected = ' selected="selected"'; } options += ''; }); return; } }); field.find( 'select' ).html( options ); }, // Populate available font families. populate_font_family_field: function(e){ var self = this, options = '', selected = '', setting = self.setting.get(); selected = 'inherit' === setting['font-family'] ? ' selected="selected"' : ''; options += ''; selected = 'default' === setting['font-family'] ? ' selected="selected"' : ''; options += ''; $.each( sinatra_typography_vars.fonts, function( group_id, group ){ options += ''; $.each( group.fonts, function( font, font_options ) { if ( font === setting['font-family'] ) { selected = ' selected="selected"'; } else { selected = ''; } options += ''; }); options += ''; }); self.container.find( '#font-family-' + self.params.id ).html( options ); }, }); })(jQuery);;customizer/controls/typography/typography.min.css000064400000007533151231536710016537 0ustar00.sinatra-typography-wrapper .sinatra-control-wrap{width:100%}.sinatra-typography-wrapper .sinatra-range-wrapper{position:relative}.sinatra-typography-wrapper .sinatra-range-wrapper label{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:6px}.sinatra-typography-wrapper .sinatra-range-wrapper .sinatra-control-unit{position:absolute;top:4px;right:0;z-index:1}.sinatra-typography-wrapper .sinatra-typography-heading{-ms-flex-positive:1;flex-grow:1}.sinatra-typography-wrapper .sinatra-typography-advanced{background-color:#fff;padding:15px 22px;position:absolute;width:100%;top:100%;left:0;margin-top:15px;box-sizing:border-box;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.1);z-index:1}.sinatra-typography-wrapper .advanced-settings{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-left:auto;text-decoration:none;color:#555d66}.sinatra-typography-wrapper .advanced-settings.active,.sinatra-typography-wrapper .advanced-settings:focus,.sinatra-typography-wrapper .advanced-settings:hover{background-color:#0284ba;color:#fff}.sinatra-typography-wrapper .advanced-settings.hidden{display:none}.sinatra-typography-wrapper .sinatra-typography-font-family,.sinatra-typography-wrapper .sinatra-typography-font-style,.sinatra-typography-wrapper .sinatra-typography-font-subsets,.sinatra-typography-wrapper .sinatra-typography-font-weight,.sinatra-typography-wrapper .sinatra-typography-text-decoration,.sinatra-typography-wrapper .sinatra-typography-text-transform{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;margin-top:6px;margin-bottom:6px}.sinatra-typography-wrapper .sinatra-typography-font-family .select2-container,.sinatra-typography-wrapper .sinatra-typography-font-family select,.sinatra-typography-wrapper .sinatra-typography-font-style .select2-container,.sinatra-typography-wrapper .sinatra-typography-font-style select,.sinatra-typography-wrapper .sinatra-typography-font-subsets .select2-container,.sinatra-typography-wrapper .sinatra-typography-font-subsets select,.sinatra-typography-wrapper .sinatra-typography-font-weight .select2-container,.sinatra-typography-wrapper .sinatra-typography-font-weight select,.sinatra-typography-wrapper .sinatra-typography-text-decoration .select2-container,.sinatra-typography-wrapper .sinatra-typography-text-decoration select,.sinatra-typography-wrapper .sinatra-typography-text-transform .select2-container,.sinatra-typography-wrapper .sinatra-typography-text-transform select{width:150px!important;margin-left:auto!important}.sinatra-typography-wrapper .sinatra-typography-font-style,.sinatra-typography-wrapper .sinatra-typography-font-weight,.sinatra-typography-wrapper .sinatra-typography-text-decoration,.sinatra-typography-wrapper .sinatra-typography-text-transform{margin-top:0;margin-bottom:0}.sinatra-typography-wrapper .sinatra-typography-font-weight,.sinatra-typography-wrapper .sinatra-typography-letter-spacing,.sinatra-typography-wrapper .sinatra-typography-line-height{margin-top:12px}.sinatra-typography-wrapper .sinatra-typography-line-height,.sinatra-typography-wrapper .sinatra-typography-text-decoration{margin-bottom:24px}.sinatra-typography-wrapper .sinatra-typography-font-family{margin-bottom:12px}.sinatra-typography-wrapper .sinatra-responsive-switchers{margin-left:6px}.sinatra-typography-wrapper .advanced-settings{background-color:#fff;border-radius:2px;-js-display:inline-flex;display:-ms-inline-flexbox;display:inline-flex;margin-left:0;font-size:12px;width:40px;height:40px;-ms-flex-pack:center;justify-content:center;border:1px solid #e0e0e0;transition:all .15s ease}.sinatra-typography-wrapper .advanced-settings .dashicons{transition:none}.sinatra-typography-wrapper .reset-defaults{display:none}.sinatra-typography-wrapper .reset-defaults.active{display:block}customizer/controls/typography/typography.min.js000064400000013603151231536710016356 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-typography"]=wp.customize.Control.extend({ready:function(){var control=this,setting=control.setting.get(),popup_content=control.container.find(".popup-content");control.container.find("#font-family-"+control.params.id).select2(),control.container.find("#font-subsets-"+control.params.id).select2(),control.update_font_subsets_field(setting["font-family"]),control.container.on("change","#font-family-"+control.params.id,(function(){control.update_font_weight_field($(this).val()),control.update_font_subsets_field($(this).val())})),control.container.on("change","[data-option]",(function(){control.update_value()})),control.container.find(".sinatra-range-wrapper").each((function(){var $this=$(this);$this.rangeControl({id:control.params.id+"-"+$this.data("option-id"),option:$this.data("option-id"),unit:control.params.units[$this.data("option-id")],value:setting[$this.data("options-id")],responsive:control.params.responsive,change:function(){control.update_value()}})})),control.container.on("select2:opening","#font-family-"+control.params.id,(function(){control.populate_font_family_field(),control.container.off("select2:opening","#font-family-"+control.params.id)})),control.container.on("mousedown",'[data-option="font-weight"]',(function(){control.update_font_weight_field(control.container.find("#font-family-"+control.params.id).val()),control.container.off("mousedown",'[data-option="font-weight"]')})),control.container.on("select2:opening","#font-subsets-"+control.params.id,(function(){control.update_font_subsets_field(control.container.find("#font-family-"+control.params.id).val()),control.container.off("mousedown",'[data-option="font-subsets"]')})),control.container.find(".popup-link").on("click",(function(){popup_content.toggleClass("hidden"),$(this).toggleClass("active"),$(this).siblings(".reset-defaults").toggleClass("active"),$("body").on("click",outside_click_close)})),control.container.find(".reset-defaults").on("click",(function(){"font-family"in control.params.display&&(control.populate_font_family_field(),control.container.find("#font-family-"+control.params.id).val(control.params.default["font-family"]).trigger("change")),["font-weight","font-style","text-transform","text-decoration"].forEach(item=>{item in control.params.display&&control.container.find('[data-option="'+item+'"]').val(control.params.default[item]).trigger("change")}),["font-size","line-height","letter-spacing"].forEach(item=>{control.container.find('[data-option-id="'+item+'"]').find(".sinatra-reset-range").click()})}));var outside_click_close=function(e){$(e.target).closest(".select2-container").length||$(e.target).closest(".customize-save-button-wrapper").length||$(e.target).closest(".reset-defaults").length||control.container.has($(e.target).closest(".popup-link")).length||control.container.has($(e.target).closest(".popup-content")).length||popup_content.hasClass("hidden")||(popup_content.addClass("hidden"),control.container.find(".popup-link").removeClass("active"),control.container.find(".reset-defaults").removeClass("active"),$("body").off("click",outside_click_close))}},update_value:function(){var option,value={};this.container.find("[data-option]").each((function(){option=$(this).data("option"),value[option]="font-size-unit"===option||"line-height-unit"===option||"letter-spacing-unit"===option?$(this).is(":checked")?$(this).val():value[option]:$(this).val()})),this.setting.set(value)},update_font_weight_field:function(font_family){var self=this,options="",selected="",setting=self.setting.get();if("inherit"===font_family&&(selected=' selected="selected"'),options+='","inherit"===font_family||"default"===font_family){$.each(["100","200","300","400","500","600","700","800","900"],(function(index,variant){selected=variant===setting["font-weight"]?' selected="selected"':"",options+='"}))}else $.each(sinatra_typography_vars.fonts,(function(group_id,group){void 0===group.fonts[font_family]||$.each(group.fonts[font_family].variants,(function(index,variant){selected=variant===setting["font-weight"]?' selected="selected"':"",options+='"}))}));self.container.find(".sinatra-typography-font-weight").find("select").html(options)},update_font_subsets_field:function(font_family){var options="",selected="",setting=this.setting.get(),field=this.container.find(".sinatra-typography-font-subsets");"default"!==font_family&&"inherit"!==font_family?($.each(sinatra_typography_vars.fonts,(function(group_id,group){if(void 0!==group.fonts[font_family])return"system_fonts"===group_id||"standard_fonts"===group_id?field.hide():field.show(),void $.each(group.fonts[font_family].subsets,(function(index,subsets){selected="",(setting["font-subsets"]&&-1!==setting["font-subsets"].indexOf(subsets)||"latin"===subsets)&&(selected=' selected="selected"'),options+='"}))})),field.find("select").html(options)):field.hide()},populate_font_family_field:function(e){var options="",selected="",setting=this.setting.get();selected="inherit"===setting["font-family"]?' selected="selected"':"",options+='",selected="default"===setting["font-family"]?' selected="selected"':"",options+='",$.each(sinatra_typography_vars.fonts,(function(group_id,group){options+='',$.each(group.fonts,(function(font,font_options){selected=font===setting["font-family"]?' selected="selected"':"",options+='"})),options+=""})),this.container.find("#font-family-"+this.params.id).html(options)}})}(jQuery);;customizer/controls/typography/typography.scss000064400000004572151231536710016140 0ustar00/*****************************************/ /* Customizer control typography style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .sinatra-typography-wrapper { .sinatra-control-wrap { width: 100%; } .sinatra-range-wrapper { position: relative; label { display: flex; align-items: center; margin-bottom: 6px; } .sinatra-control-unit { position: absolute; top: 4px; right: 0; z-index: 1; } } .sinatra-typography-heading { flex-grow: 1; } .sinatra-typography-advanced { background-color: #fff; padding: 15px 22px; position: absolute; width: 100%; top: 100%; left: 0; margin-top: 15px; box-sizing: border-box; border-radius: $border_radius; box-shadow: 0 0 10px rgba(0,0,0,0.1); z-index: 1; } .advanced-settings { display: flex; align-items: center; margin-left: auto; text-decoration: none; color: #555d66; &.active, &:focus, &:hover { background-color: #0284ba; color: #fff; } &.hidden { display: none; } } .sinatra-typography-font-family, .sinatra-typography-font-subsets, .sinatra-typography-font-weight, .sinatra-typography-font-style, .sinatra-typography-text-transform, .sinatra-typography-text-decoration { display: flex; flex-wrap: wrap; align-items: center; margin-top: 6px; margin-bottom: 6px; .select2-container, select { width: 150px !important; margin-left: auto !important; } } .sinatra-typography-font-weight, .sinatra-typography-font-style, .sinatra-typography-text-transform, .sinatra-typography-text-decoration { margin-top: 0; margin-bottom: 0; } .sinatra-typography-font-weight, .sinatra-typography-letter-spacing, .sinatra-typography-line-height { margin-top: 12px; } .sinatra-typography-line-height, .sinatra-typography-text-decoration { margin-bottom: 24px; } .sinatra-typography-font-family { margin-bottom: 12px; } .sinatra-responsive-switchers { margin-left: 6px; } .advanced-settings { background-color: #FFF; border-radius: 2px; display: inline-flex; margin-left: 0; font-size: 12px; width: 40px; height: 40px; justify-content: center; border: 1px solid #e0e0e0; transition: all .15s ease; .dashicons { transition: none; } } .reset-defaults { display: none; &.active { display: block; } } }customizer/controls/widget/class-sinatra-customizer-control-widget.php000064400000010527151231536710022525 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Control_Widget' ) ) : /** * Sinatra Customizer custom select control class. */ class Sinatra_Customizer_Control_Widget extends Sinatra_Customizer_Control { /** * The control type. * * @var string */ public $type = 'sinatra-widget'; /** * Array of allowed customizer widgets. * * @var array */ public $widgets = array(); /** * Array of locations for widgets. * * @var array */ public $locations = array(); /** * Array of visibility options for widgets. * * @var array */ public $visibility = array(); /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['widgets'] = $this->widgets; $this->json['locations'] = $this->locations; $this->json['visibility'] = $this->visibility; // Add widget templates to be used when generating new widgets. if ( is_array( $this->widgets ) && ! empty( $this->widgets ) ) { // Get all widgets. $widgets = sinatra_get_customizer_widgets(); foreach ( $this->widgets as $widget_id => $args ) { // If this widget is not defined, skip. if ( ! isset( $widgets[ $widget_id ] ) ) { continue; } // Widget locations. $args['locations'] = $this->locations; $args['visibility'] = $this->visibility; $args['id'] = $this->id; // Create a widget instance. $classname = $widgets[ $widget_id ]; $instance = new $classname( $args ); // Add info about max uses for the widget. $max_uses = isset( $args['max_uses'] ) ? intval( $args['max_uses'] ) : -1; ob_start(); ?>
          > template(); ?>
          json['widget_tpl'][ $widget_id ] = ob_get_clean(); } } $value = $this->value(); $this->json['value'] = array(); // Added widgets. if ( is_array( $value ) && ! empty( $value ) ) { foreach ( $value as $i => $widget ) { // Widget type is required. if ( ! isset( $widget['type'], $widget['values'] ) ) { continue; } // This widget type is not allowed. if ( ! isset( $this->widgets[ $widget['type'] ] ) ) { continue; } // Create widget instance. $classname = $widget['classname']; $args = $this->widgets[ $widget['type'] ]; $args['id'] = $this->id . '_' . $i; $args['number'] = $i; $args['values'] = $widget['values']; $args['locations'] = $this->locations; $args['visibility'] = $this->visibility; if ( class_exists( $classname ) ) { $instance = new $classname( $args ); // Print widget template. ob_start(); $instance->template(); $this->json['value'][] = ob_get_clean(); } } } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>
          <# _.each( data.value, function( template, i ) { #> {{{ template }}} <# }); #>
          <# _.each( data.widget_tpl, function( template, i ) { #> {{{ template }}} <# }); #>
          0 && el.max_uses <= $(self.container).find('.sinatra-widget-container [data-widget-type="' + index + '"]').length ) { widget.addClass('disabled'); } }); } else { // Show all widgets $( '#sinatra-available-widgets-list .sinatra-widget' ).show(); } }, addWidget: function( widget_id_base ) { var widget_html, widget_uuid; widget_uuid = this.setting.id + '-' + this.widget_count; // Get widget form widget_html = $.trim( $(this.container).find( '.sinatra-widget-tpl-' + widget_id_base ).html() ); widget_html = widget_html.replace( /<[^<>]+>/g, function( m ) { return m.replace( /__i__|%i%/g, widget_uuid ); } ); // Append new widget. var $widget = $( widget_html ).appendTo( this.container.find( '.sinatra-widget-container' ) ); // Increase widget count. this.widget_count++; // Expand the widget and focus first setting. $widget.find( '.widget-top' ).trigger( 'click' ); this.update(); if ( $widget.find( '.sinatra-widget-nav-container' ).length ) { this.bindMenuLocation( $widget.find( '.sinatra-widget-nav-container' ) ); } }, close: function() { $( 'body' ).removeClass( 'sinatra-adding-widget' ); }, update: function() { // Get all widgets in the area var widgets = this.container.find( '.sinatra-widget-container .widget' ); var inputs, widgetobj, new_value = [], option, checked, $widget; if ( widgets.length ) { // Get from each widfget _.each( widgets, function( widget ){ $widget = $( widget ); widgetobj = {}; widgetobj.classname = $widget.data( 'widget-base' ); widgetobj.type = $widget.data( 'widget-type' ); widgetobj.values = {}; inputs = $widget.find( 'input, textarea, select' ); _.each( inputs, function( input ){ option = $( input ).attr('data-option-name'); // Save values. if ( typeof option !== typeof undefined && option !== false) { widgetobj.values[ $(input).attr('data-option-name') ] = $(input).val(); } }); _.each( $widget.find( '.buttonset' ), function( buttonset ){ // Save location if exist. checked = $( buttonset ).find( 'input[type="radio"]:checked'); // Save values. if ( typeof checked !== typeof undefined && checked !== false) { widgetobj.values[ checked.data('option-name') ] = checked.val(); } }); new_value.push( widgetobj ); }); this.setting.set( new_value ); } else { this.setting.set( false ); } }, setupSortable: function() { var self = this; $( this.container ).find( '.sinatra-widget-container' ).sortable({ items: '> .widget', handle: '.widget-top', intersect: 'pointer', axis: 'y', update: function() { self.update(); } }); } }); $(document).ready( function(){ var control; $( '.wp-full-overlay' ).on( 'click', '.sinatra-add-widget, .sinatra-close-widgets-panel', function(e) { e.preventDefault(); $( 'body' ).toggleClass( 'sinatra-adding-widget' ); if ( $( this ).data( 'location-title' ) ) { control = wp.customize.control( $(this).data('control') ); $( '#sinatra-available-widgets' ).attr( 'data-control', control.params.id ).find( '.sinatra-widget-caption' ).find( 'h3' ).html( $(this).data( 'location-title' ) ); } }); $( '.wp-full-overlay' ).on( 'click', '.customize-section-back', function(e) { $( 'body' ).removeClass( 'sinatra-adding-widget' ); $( '#sinatra-available-widgets' ).removeAttr( 'data-control' ); }); // Add widget to widget control. $( '#sinatra-available-widgets' ).on( 'click', '.sinatra-widget', function(e) { // Get active control. control = wp.customize.control( $( '#sinatra-available-widgets' ).attr('data-control') ); var widget_id = $( this ).data( 'widget-id' ); var widget_form = control.addWidget( widget_id ); control.close(); }); }); })(jQuery);;customizer/controls/widget/widget.min.css000064400000012311151231536710014657 0ustar00.sinatra-add-widget-wrap{-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.sinatra-control-wrapper.sinatra-widget-wrapper .customize-control-description{margin-bottom:12px!important}.sinatra-customizer-widget-form,.sinatra-widget-tmpls{display:none}.sinatra-add-widget:before{content:"\f132";display:inline-block;position:relative;left:-4px;font:normal 16px/1 dashicons;vertical-align:middle;transition:all .1s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body.sinatra-adding-widget #customize-preview{opacity:.4}body.sinatra-adding-widget #sinatra-available-widgets{transform:translateZ(0);visibility:visible}body.sinatra-adding-widget .sinatra-add-widget{background:#eee;border-color:#929793;color:#32373c;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}body.sinatra-adding-widget .sinatra-add-widget:before{transform:rotate(45deg)}.sinatra-widget-caption{padding:0 0 0 25px;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex:1;flex:1;border-bottom:1px solid #ddd}.sinatra-widget-caption h3{font-size:14px;display:block;font-weight:200;margin:0 auto 0 0;padding:0;line-height:1}.sinatra-widget-caption a{margin-left:auto;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:45px;height:45px;padding:0 2px 0 0;background:#eee;border-right:1px solid #ddd;border-left:1px solid #ddd;color:#444;text-align:left;cursor:pointer;transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;box-sizing:content-box;text-decoration:none}.sinatra-widget-caption a:before{font:normal 18px/1 dashicons;content:"\f335"}.sinatra-widget-caption a:focus,.sinatra-widget-caption a:hover{background-color:#f3f3f5;box-shadow:none;outline:none}#sinatra-available-widgets-list .sinatra-widget{position:relative;padding:15px 15px 15px 60px;background-color:#fff;border-bottom:1px solid #ddd;border-left:4px solid #fff;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out;cursor:pointer}#sinatra-available-widgets-list .sinatra-widget.disabled{opacity:.5;pointer-events:none}#sinatra-available-widgets-list .sinatra-widget .widget{margin:0}#sinatra-available-widgets-list .sinatra-widget .widget-top{border:none;background:inherit;box-shadow:none!important}#sinatra-available-widgets-list .sinatra-widget .widget-title{position:relative}#sinatra-available-widgets-list .sinatra-widget .widget-title h3{padding:0 0 5px;font-size:14px}#sinatra-available-widgets-list .sinatra-widget .widget-title i{position:absolute;top:-3px;right:100%;margin-right:20px;width:20px;height:20px;color:#32373c;font:normal 20px/1 dashicons;text-align:center;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#sinatra-available-widgets-list .sinatra-widget .widget-description{padding:0;color:#72777c;display:block;font-size:12px;overflow-wrap:break-word;word-wrap:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}#sinatra-available-widgets-list .sinatra-widget .widget-title-action button{display:none}#sinatra-available-widgets-list .sinatra-widget.selected,#sinatra-available-widgets-list .sinatra-widget:focus,#sinatra-available-widgets-list .sinatra-widget:hover{background-color:#f3f3f5;border-bottom-color:#ccc;color:#0073aa;border-left:4px solid #0073aa}.sinatra-widget-container .widget{margin-bottom:5px}.sinatra-widget-container .widget:last-child{margin-bottom:12px}.sinatra-widget-container .widget .widget-content p{margin:0 0 20px}.sinatra-widget-container .widget .widget-content label:not(.switch-label){color:#23282d;font-weight:500;display:block}.sinatra-widget-container .widget .widget-content button{display:inline-block;margin-top:6px}.sinatra-widget-container .widget .widget-content .description{font-size:11px}.sinatra-widget-container .widget:first-child .widget-top{border-top-left-radius:3px;border-top-right-radius:3px}.sinatra-widget-container .widget:last-child .widget-top{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.sinatra-widget-container .widget .widget-top{border:1px solid #ddd!important;box-shadow:none!important}.sinatra-widget-container .widget .widget-top .widget-title i{display:none}.sinatra-widget-container .widget .widget-inside{padding:20px;border-radius:0 0 3px 3px}.sinatra-widget-container .widget.sinatra-expanded .widget-top{background-color:#fff;border-radius:3px 3px 0 0!important}.sinatra-widget-container .widget.sinatra-expanded .toggle-indicator{transform:rotate(180deg)}.sinatra-widget-container .widget .widget-control-actions{margin-top:15px;-js-display:flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sinatra-widget-container .widget .widget-control-actions .spinner{margin-left:auto;margin-right:0;visibility:visible}.sinatra-widget-container .widget .widget-control-actions .widget-control-separator{display:inline-block;margin:0 2px}.sinatra-widget-container .sinatra-widget-nav-has-menu .sinatra-widget-nav-empty,.sinatra-widget-container .sinatra-widget-nav-selected{display:none}.sinatra-widget-container .sinatra-widget-nav-has-menu .sinatra-widget-nav-selected{display:block}customizer/controls/widget/widget.min.js000064400000011511151231536710014504 0ustar00!function($){"use strict";wp.customize.controlConstructor["sinatra-widget"]=wp.customize.Control.extend({ready:function(){var control=this;control.widget_count=control.container.find(".widget").length,control.setupSortable(),control.container.on("click",".sinatra-widget-container .widget-top",(function(){$(this).closest(".widget").toggleClass("sinatra-expanded").find(".widget-inside").slideToggle(200)})),control.container.on("click",".sinatra-widget-container .widget-control-close",(function(){$(this).closest(".widget").toggleClass("sinatra-expanded").find(".widget-inside").slideToggle(200)})),control.container.on("click",".sinatra-add-widget",(function(e){e.preventDefault(),control.updateList()})),control.container.on("change paste keyup","input, textarea, select",(function(e){control.update()})),control.container.on("click",".widget-control-remove",(function(){$(this).closest(".widget").remove(),control.update(),control.updateList()})),control.container.on("click",".sinatra-widget-edit-nav",(function(){wp.customize.control("nav_menu_locations["+$(this).closest(".sinatra-widget-nav-container").data("menu-location")+"]").focus(),control.close()})),wp.customize.previewer.bind("url",this.close),$(control.container).find(".sinatra-widget-nav-container").each((function(){var $this=$(this);control.bindMenuLocation($this)}))},bindMenuLocation:function($container){var menu_location=$container.data("menu-location");wp.customize("nav_menu_locations["+menu_location+"]",(function(value){value.bind((function(newval){if(newval){var menu_name=wp.customize.control("nav_menu_locations["+menu_location+"]").container.find("option:selected").html();$container.addClass("sinatra-widget-nav-has-menu").find(".sinatra-widget-nav-name").html(menu_name)}else $container.removeClass("sinatra-widget-nav-has-menu")}))}))},updateList:function(){var widget,self=this,widgets=self.params.widgets;widgets?($("#sinatra-available-widgets-list .sinatra-widget").hide().removeClass("disabled"),$.each(widgets,(function(index,el){(widget=$("#sinatra-available-widgets-list #sinatra-widget-tpl-sinatra_customizer_widget_"+index)).show(),el.hasOwnProperty("max_uses")&&el.max_uses>0&&el.max_uses<=$(self.container).find('.sinatra-widget-container [data-widget-type="'+index+'"]').length&&widget.addClass("disabled")}))):$("#sinatra-available-widgets-list .sinatra-widget").show()},addWidget:function(widget_id_base){var widget_html,widget_uuid;widget_uuid=this.setting.id+"-"+this.widget_count,widget_html=(widget_html=$.trim($(this.container).find(".sinatra-widget-tpl-"+widget_id_base).html())).replace(/<[^<>]+>/g,(function(m){return m.replace(/__i__|%i%/g,widget_uuid)}));var $widget=$(widget_html).appendTo(this.container.find(".sinatra-widget-container"));this.widget_count++,$widget.find(".widget-top").trigger("click"),this.update(),$widget.find(".sinatra-widget-nav-container").length&&this.bindMenuLocation($widget.find(".sinatra-widget-nav-container"))},close:function(){$("body").removeClass("sinatra-adding-widget")},update:function(){var inputs,widgetobj,option,checked,$widget,widgets=this.container.find(".sinatra-widget-container .widget"),new_value=[];widgets.length?(_.each(widgets,(function(widget){$widget=$(widget),(widgetobj={}).classname=$widget.data("widget-base"),widgetobj.type=$widget.data("widget-type"),widgetobj.values={},inputs=$widget.find("input, textarea, select"),_.each(inputs,(function(input){void 0!==(option=$(input).attr("data-option-name"))&&!1!==option&&(widgetobj.values[$(input).attr("data-option-name")]=$(input).val())})),_.each($widget.find(".buttonset"),(function(buttonset){void 0!==(checked=$(buttonset).find('input[type="radio"]:checked'))&&!1!==checked&&(widgetobj.values[checked.data("option-name")]=checked.val())})),new_value.push(widgetobj)})),this.setting.set(new_value)):this.setting.set(!1)},setupSortable:function(){var self=this;$(this.container).find(".sinatra-widget-container").sortable({items:"> .widget",handle:".widget-top",intersect:"pointer",axis:"y",update:function(){self.update()}})}}),$(document).ready((function(){var control;$(".wp-full-overlay").on("click",".sinatra-add-widget, .sinatra-close-widgets-panel",(function(e){e.preventDefault(),$("body").toggleClass("sinatra-adding-widget"),$(this).data("location-title")&&(control=wp.customize.control($(this).data("control")),$("#sinatra-available-widgets").attr("data-control",control.params.id).find(".sinatra-widget-caption").find("h3").html($(this).data("location-title")))})),$(".wp-full-overlay").on("click",".customize-section-back",(function(e){$("body").removeClass("sinatra-adding-widget"),$("#sinatra-available-widgets").removeAttr("data-control")})),$("#sinatra-available-widgets").on("click",".sinatra-widget",(function(e){control=wp.customize.control($("#sinatra-available-widgets").attr("data-control"));var widget_id=$(this).data("widget-id");control.addWidget(widget_id);control.close()}))}))}(jQuery);;customizer/controls/widget/widget.scss000064400000011332151231536710014262 0ustar00/*****************************************/ /* Customizer control widget style /*****************************************/ /** * Import configuration file with variables. */ @import '../../../../assets/sass/config'; .sinatra-add-widget-wrap { display: flex; justify-content: flex-end; } .sinatra-control-wrapper.sinatra-widget-wrapper { .customize-control-description { margin-bottom: 12px !important; } } .sinatra-customizer-widget-form, .sinatra-widget-tmpls { display: none; } .sinatra-add-widget { &::before { content: "\f132"; display: inline-block; position: relative; left: -4px; font: normal 16px/1 dashicons; vertical-align: middle; transition: all 0.1s; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } } body.sinatra-adding-widget { #customize-preview { opacity: 0.4; } #sinatra-available-widgets { transform: translate3d(0, 0, 0); visibility: visible; } .sinatra-add-widget { background: #eee; border-color: #929793; color: #32373c; box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5); &:before { transform: rotate(45deg); } } } .sinatra-widget-caption { padding: 0 0 0 25px; display: flex; align-items: center; flex-wrap: wrap; flex: 1; border-bottom: 1px solid #ddd; h3 { font-size: 14px; display: block; font-weight: 200; margin: 0 auto 0 0; padding: 0; line-height: 1; } a { margin-left: auto; display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; padding: 0 2px 0 0; background: #eee; border-right: 1px solid #ddd; border-left: 1px solid #ddd; color: #444; text-align: left; cursor: pointer; transition: color .15s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out; box-sizing: content-box; text-decoration: none; &:before { font: normal 18px/1 dashicons; content: "\f335"; } &:hover, &:focus { background-color: #f3f3f5; box-shadow: none; outline: none; } } } #sinatra-available-widgets-list { .sinatra-widget { position: relative; padding: 15px 15px 15px 60px; background-color: #fff; border-bottom: 1px solid #ddd; border-left: 4px solid #fff; transition: .15s color ease-in-out, .15s background-color ease-in-out, .15s border-color ease-in-out; cursor: pointer; &.disabled { opacity: 0.5; pointer-events: none; } .widget { margin: 0; } .widget-top { border: none; background: inherit; box-shadow: none !important; } .widget-title { position: relative; h3 { padding: 0 0 5px; font-size: 14px; } i { position: absolute; top: -3px; right: 100%; margin-right: 20px; width: 20px; height: 20px; color: #32373c; font: normal 20px/1 dashicons; text-align: center; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } } .widget-description { padding: 0; color: #72777c; display: block; font-size: 12px; overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; } .widget-title-action { button { display: none; } } &:hover, &.selected, &:focus { background-color: #f3f3f5; border-bottom-color: #ccc; color: #0073aa; border-left: 4px solid #0073aa; } } } .sinatra-widget-container { .widget { margin-bottom: 5px; &:last-child { margin-bottom: 12px; } .widget-content { p { margin: 0 0 20px 0; } label:not(.switch-label) { color: #23282d; font-weight: 500; display: block; } button { display: inline-block; margin-top: 6px; } .description { font-size: 11px; } } &:first-child { .widget-top { border-top-left-radius: 3px; border-top-right-radius: 3px; } } &:last-child { .widget-top { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; } } .widget-top { border: 1px solid #ddd !important; box-shadow: none !important; .widget-title { i { display: none; } } } .widget-inside { padding: 20px; border-radius: 0 0 3px 3px; } &.sinatra-expanded { .widget-top { background-color: #FFF; border-radius: 3px 3px 0 0 !important; } .toggle-indicator { transform: rotate(180deg); } } .widget-control-actions { margin-top: 15px; display: flex; align-items: center; .spinner { margin-left: auto; margin-right: 0; visibility: visible; } .widget-control-separator { display: inline-block; margin: 0 2px; } } } .sinatra-widget-nav-selected { display: none; } .sinatra-widget-nav-has-menu { .sinatra-widget-nav-empty { display: none; } .sinatra-widget-nav-selected { display: block; } } }customizer/customizer-callbacks.php000064400000042137151231536710013615 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Number sanitization callback * * @since 1.0.0 * @param int $val Number. */ function sinatra_sanitize_number( $val ) { return is_numeric( $val ) ? $val : 0; } /** * Toggle field sanitization. * * @since 1.0.0 * @param mixed $input Value of the toggle field. * @param object $setting Setting object. */ function sinatra_sanitize_toggle( $input, $setting ) { // Ensure input is a slug. $input = sanitize_key( $input ); return true === (bool) $input; } /** * Select field sanitization callback. * * @since 1.0.0 * @param mixed $input Value of the select field. * @param object $setting Setting object. */ function sinatra_sanitize_select( $input, $setting ) { $multiple = isset( $setting->manager->get_control( $setting->id )->multiple ) ? $setting->manager->get_control( $setting->id )->multiple : false; // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; if ( $multiple ) { // Check if input is array. if ( is_array( $input ) && ! empty( $input ) ) { $return = array(); // Get only valid values. foreach ( $input as $selected ) { $selected = sanitize_key( $selected ); if ( array_key_exists( $selected, $choices ) ) { $return[] = $selected; } } // Return valid only. return $return; } else { // Return default if input valid. return array(); } } else { // Ensure input is a slug. $input = sanitize_key( $input ); // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } } /** * Textarea field sanitization callback. * * @since 1.0.0 * @param mixed $input Value of the select field. * @param object $setting Setting object. */ function sinatra_sanitize_textarea( $input, $setting ) { return wp_kses_post( $input ); } /** * Color field sanitization callback * * @since 1.0.0 * @param string $color Color code. */ function sinatra_sanitize_color( $color ) { if ( empty( $color ) || is_array( $color ) ) { return ''; } if ( false === strpos( $color, 'rgba' ) ) { return sinatra_sanitize_hex_color( $color ); } return sinatra_sanitize_alpha_color( $color ); } /** * Sanitize HEX color. * * @since 1.0.0 * @param string $color Color code in HEX. */ function sinatra_sanitize_hex_color( $color ) { if ( '' === $color ) { return ''; } // 3 or 6 hex digits, or the empty string. if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { return $color; } return ''; } /** * Sanitize Alpha color. * * @since 1.0.0 * @param string $color Color code in RGBA. */ function sinatra_sanitize_alpha_color( $color ) { if ( '' === $color ) { return ''; } if ( false === strpos( $color, 'rgba' ) ) { /* Hex sanitize */ return sinatra_sanitize_hex_color( $color ); } /* rgba sanitize */ $color = str_replace( ' ', '', $color ); sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')'; } /** * Sanitize image. * * @since 1.0.0 * @param mixed $image Selected image.. * @param object $setting Setting object. */ function sinatra_sanitize_image( $image, $setting ) { /* * Array of valid image file types. * * The array includes image mime types that are included in wp_get_mime_types() */ $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon', 'svg' => 'image/svg+xml', ); // Return an array with file extension and mime_type. $file = wp_check_filetype( $image, $mimes ); // If $image has a valid mime_type, return it; otherwise, return the default. return ( $file['ext'] ? $image : $setting->default ); } /** * Sanitize widget control value. * * @since 1.0.0 * @param array $widgets Array of saved widgets. * @param object $setting WP Customize manager object. */ function sinatra_sanitize_widget( $widgets, $setting ) { // Widgets has to be an array. if ( ! is_array( $widgets ) || empty( $widgets ) ) { return array(); } $control = $setting->manager->get_control( $setting->id ); // Control widgets. $control_widgets = $control->widgets; // Control locations. $control_locations = $control->locations; // Control visibility options. $control_visibility = $control->visibility; // Used to control max uses for widgets. $widget_uses = array(); foreach ( $widgets as $index => $widget ) { // Check if this widget is allowed. if ( ! array_key_exists( $widget['type'], $control_widgets ) ) { unset( $widgets[ $index ] ); continue; } // Set max usage for widget. if ( ! isset( $widget_uses[ $widget['type'] ] ) ) { $widget_uses[ $widget['type'] ] = isset( $control_widgets[ $widget['type'] ]['max_uses'] ) ? intval( $control_widgets[ $widget['type'] ]['max_uses'] ) : -1; } // Remove if max widgets exceeded count. if ( -1 !== $widget_uses[ $widget['type'] ] ) { if ( $widget_uses[ $widget['type'] ] > 0 ) { // Widget count still good. $widget_uses[ $widget['type'] ]--; } else { // Exceeded widget max usage. unset( $widgets[ $index ] ); continue; } } // Ensure widget has values. if ( ! isset( $widget['values'] ) || ! is_array( $widget['values'] ) ) { $widget['values'] = array(); } // Validate the location parameter. if ( isset( $widget['values']['location'] ) ) { if ( empty( $control_locations ) ) { // No locations available. unset( $widget['values']['location'] ); } elseif ( ! array_key_exists( $widget['values']['location'], $control_locations ) ) { // This locations is not available, take one from array of available locations. $widget['values']['location'] = key( $control_locations ); } } elseif ( ! empty( $control_locations ) ) { // Widget has to have a location option. $widget['values']['location'] = key( $control_locations ); } // Validate the visibility parameter. if ( isset( $widget['values']['visibility'] ) ) { if ( empty( $control_visibility ) ) { // No visibility available. $widget['values']['visibility'] = ''; } elseif ( ! array_key_exists( $widget['values']['visibility'], $control_visibility ) ) { // This locations is not available, take one from array of available locations. $widget['values']['visibility'] = key( $control_visibility ); } } elseif ( ! empty( $control_visibility ) ) { // Widget has to have a location option. $widget['values']['visibility'] = key( $control_visibility ); } // Validate widget values. if ( ! empty( $widget['values'] ) ) { $classname = $widget['classname']; $instance = new $classname( $widget['values'] ); $widget['values'] = $instance->values; } } return $widgets; } /** * No sanitization. Used for controls that only output HTML. * * @since 1.0.0 * @param mixed $val Value. */ function sinatra_no_sanitize( $val ) { return $val; } /** * Sanitize Background control value. * * @since 1.0.0 * @param mixed $background Value. */ function sinatra_sanitize_background( $background ) { $bg_params = array( 'background-image' => '', 'background-image-id' => '', 'background-repeat' => 'repeat', 'background-position-x' => '50', 'background-position-y' => '50', 'background-size' => 'auto', 'background-attachment' => 'scroll', ); foreach ( $bg_params as $key => $value ) { if ( isset( $background[ $key ] ) ) { if ( 'background-image' === $key ) { $bg_params[ $key ] = esc_url_raw( $background[ $key ] ); } else { $bg_params[ $key ] = esc_attr( $background[ $key ] ); } } } if ( empty( $bg_params['background-image'] ) ) { $bg_params['background-image-id'] = ''; } return $bg_params; } /** * Sanitize Spacing control value. * * @since 1.0.0 * @param mixed $values Values. * @param object $setting WP Customize Setting instance. * @param mixed $default Default Value. */ function sinatra_sanitize_spacing( $values, $setting, $default = array() ) { $control = $setting->manager->get_control( $setting->id ); $control_choices = $control->choices; $control_units = $control->unit; foreach ( $control_choices as $key => $value ) { if ( ! isset( $values[ $key ] ) ) { $values[ $key ] = isset( $default[ $key ] ) ? $default[ $key ] : 0; } } foreach ( $values as $key => $value ) { if ( 'unit' === $key ) { continue; } if ( ! isset( $control_choices[ $key ] ) ) { unset( $values[ $key ] ); continue; } $values[ $key ] = is_numeric( $value ) ? $value : ''; } if ( isset( $values['unit'] ) && ! in_array( $values['unit'], $control_units, true ) ) { if ( isset( $default['unit'] ) ) { $values['unit'] = $default['unit']; } elseif ( ! empty( $control_units ) ) { $values['unit'] = $control_units[0]; } else { $values['unit'] = ''; } } return $values; } /** * Sanitize Range control value. * * @since 1.0.0 * @param mixed $value Values. * @param object $setting WP Customize Setting instance. * @param mixed $default Default Value. */ function sinatra_sanitize_range( $value, $setting, $default = '' ) { if ( is_array( $value ) ) { if ( isset( $value['value'], $value['unit'] ) ) { return array( 'value' => floatval( $value['value'] ), 'unit' => sanitize_text_field( $value['unit'] ), ); } elseif ( isset( $value['value'] ) ) { return floatval( $value['value'] ); } } return is_numeric( $value ) ? floatval( $value ) : $default; } /** * Sanitize Responsive control value. * Iterate through all responsive breakpoints and sanitize each value. * * @since 1.0.0 * @param mixed $values Values. * @param object $setting WP Customize Setting instance. */ function sinatra_sanitize_responsive( $values, $setting ) { $control = $setting->manager->get_control( $setting->id ); $control_type = str_replace( 'sinatra-', '', $control->type ); $control_units = isset( $control->unit ) ? $control->unit : false; if ( is_array( $control->responsive ) && ! empty( $control->responsive ) ) { // Ensure all responsive devices are in value. foreach ( $control->responsive as $device => $settings ) { if ( ! isset( $values[ $device ] ) ) { $values[ $device ] = isset( $setting->default[ $device ] ) ? $setting->default[ $device ] : ''; } } // Ensure all devices in value are allowed and sanitize value. foreach ( $values as $device => $value ) { if ( 'unit' === $device ) { continue; } if ( ! isset( $control->responsive[ $device ] ) ) { unset( $values[ $device ] ); continue; } // Sanitize value. $values[ $device ] = call_user_func_array( 'sinatra_sanitize_' . $control_type, array( $values[ $device ], $setting, isset( $setting->default[ $device ] ) ? $setting->default[ $device ] : '', ) ); } } return $values; } /** * Typography field sanitization. * * @since 1.0.0 * @param mixed $value Value of the toggle field. * @param object $setting Setting object. */ function sinatra_sanitize_typography( $value, $setting ) { $defaults = array( 'font-family' => '', 'font-subsets' => array(), 'font-weight' => '', 'font-style' => '', 'text-transform' => '', 'font-size-desktop' => '', 'font-size-tablet' => '', 'font-size-mobile' => '', 'font-size-unit' => '', 'letter-spacing' => '', 'letter-spacing-unit' => '', 'line-height-desktop' => '', 'line-height-tablet' => '', 'line-height-mobile' => '', 'line-height-unit' => '', ); $defaults = wp_parse_args( $setting->default, $defaults ); $value = wp_parse_args( $value, $defaults ); return $value; } /** * Design Options field sanitization. * * @since 1.0.0 * @param mixed $value Value of the toggle field. * @param object $setting Setting object. */ function sinatra_sanitize_design_options( $value, $setting ) { $control = $setting->manager->get_control( $setting->id ); $sanitized = (array) $setting->default; if ( isset( $control->display ) ) { if ( isset( $control->display['background'] ) ) { if ( ! array_key_exists( $value['background-type'], $control->display['background'] ) ) { $sanitized['background-type'] = 'color'; } else { $sanitized['background-type'] = $value['background-type']; } // Color. if ( array_key_exists( 'color', $control->display['background'] ) ) { if ( isset( $value['background-color'] ) ) { $sanitized['background-color'] = sinatra_sanitize_color( $value['background-color'] ); } } // Gradient. if ( array_key_exists( 'gradient', $control->display['background'] ) ) { if ( isset( $value['gradient-color-1'] ) ) { $sanitized['gradient-color-1'] = sinatra_sanitize_color( $value['gradient-color-1'] ); } if ( isset( $value['gradient-color-2'] ) ) { $sanitized['gradient-color-2'] = sinatra_sanitize_color( $value['gradient-color-2'] ); } if ( isset( $value['gradient-color-1-location'] ) ) { $sanitized['gradient-color-1-location'] = sinatra_sanitize_range( $value['gradient-color-1-location'], $setting ); } if ( isset( $value['gradient-color-2-location'] ) ) { $sanitized['gradient-color-2-location'] = sinatra_sanitize_range( $value['gradient-color-2-location'], $setting ); } if ( isset( $value['gradient-type'] ) && in_array( $value['gradient-type'], array( 'linear', 'radial' ), true ) ) { $sanitized['gradient-type'] = $value['gradient-type']; } if ( isset( $value['gradient-linear-angle'] ) ) { $sanitized['gradient-linear-angle'] = sinatra_sanitize_range( $value['gradient-linear-angle'], $setting ); } if ( isset( $value['gradient-position'] ) ) { $sanitized['gradient-position'] = sanitize_text_field( $value['gradient-position'] ); } } // Image. if ( array_key_exists( 'image', $control->display['background'] ) ) { if ( isset( $value['background-image'] ) ) { $sanitized['background-image'] = sanitize_text_field( $value['background-image'] ); } if ( isset( $value['background-image-id'] ) ) { $sanitized['background-image-id'] = sanitize_text_field( $value['background-image-id'] ); } if ( isset( $value['background-repeat'] ) ) { $sanitized['background-repeat'] = sanitize_text_field( $value['background-repeat'] ); } if ( isset( $value['background-position-x'] ) ) { $sanitized['background-position-x'] = intval( $value['background-position-x'] ); } if ( isset( $value['background-position-y'] ) ) { $sanitized['background-position-y'] = intval( $value['background-position-y'] ); } if ( isset( $value['background-size'] ) ) { $sanitized['background-size'] = sanitize_text_field( $value['background-size'] ); } if ( isset( $value['background-attachment'] ) ) { $sanitized['background-attachment'] = sanitize_text_field( $value['background-attachment'] ); } if ( isset( $value['background-color-overlay'] ) ) { $sanitized['background-color-overlay'] = sanitize_text_field( $value['background-color-overlay'] ); } } } if ( isset( $control->display['color'] ) ) { foreach ( $control->display['color'] as $id => $title ) { if ( isset( $value[ $id ] ) ) { $sanitized[ $id ] = sinatra_sanitize_color( $value[ $id ] ); } } } if ( isset( $control->display['border'] ) ) { // Border Color. if ( array_key_exists( 'color', $control->display['border'] ) && isset( $value['border-color'] ) ) { $sanitized['border-color'] = sinatra_sanitize_color( $value['border-color'] ); } // Border Style. if ( isset( $value['border-style'] ) ) { $sanitized['border-style'] = sanitize_key( $value['border-style'] ); } // Separator Border Style. if ( isset( $value['separator-color'] ) ) { $sanitized['separator-color'] = sinatra_sanitize_color( $value['separator-color'] ); } // Border Width. $border_width = array( 'left', 'top', 'right', 'bottom' ); foreach ( $border_width as $position ) { if ( isset( $value[ 'border-' . $position . '-width' ] ) ) { $sanitized[ 'border-' . $position . '-width' ] = intval( $value[ 'border-' . $position . '-width' ] ); } } } } return $sanitized; } /** * Sortable field sanitization. * * @since 1.0.0 * @param mixed $value Value of the toggle field. * @param object $setting Setting object. */ function sinatra_sanitize_sortable( $value, $setting ) { $control = $setting->manager->get_control( $setting->id ); $choices = $control->choices; $default = $setting->default; if ( empty( $value ) ) { return $default; } foreach ( $value as $item => $config ) { if ( ! isset( $choices[ $item ] ) ) { unset( $value[ $item ] ); } } foreach ( $choices as $item => $config ) { if ( ! isset( $value[ $item ] ) ) { $value[ $item ] = isset( $default[ $item ] ) ? $default[ $item ] : false; } } return $value; } customizer/customizer-helpers.php000064400000003622151231536710013334 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Returns array of available widgets. * * @since 1.0.0 * @return array, $widgets array of available widgets. */ function sinatra_get_customizer_widgets() { $widgets = array( 'text' => 'Sinatra_Customizer_Widget_Text', 'nav' => 'Sinatra_Customizer_Widget_Nav', 'socials' => 'Sinatra_Customizer_Widget_Socials', 'search' => 'Sinatra_Customizer_Widget_Search', 'button' => 'Sinatra_Customizer_Widget_Button', ); return apply_filters( 'sinatra_customizer_widgets', $widgets ); } /** * Get choices for "Hide on" customizer options. * * @since 1.0.0 * @return array */ function sinatra_get_display_choices() { // Default options. $return = array( 'home' => array( 'title' => esc_html__( 'Home Page', 'sinatra' ), ), 'posts_page' => array( 'title' => esc_html__( 'Blog / Posts Page', 'sinatra' ), ), 'search' => array( 'title' => esc_html__( 'Search', 'sinatra' ), ), 'archive' => array( 'title' => esc_html__( 'Archive', 'sinatra' ), 'desc' => esc_html__( 'Dynamic pages such as categories, tags, custom taxonomies...', 'sinatra' ), ), 'post' => array( 'title' => esc_html__( 'Single Post', 'sinatra' ), ), 'page' => array( 'title' => esc_html__( 'Single Page', 'sinatra' ), ), ); // Get additionally registered post types. $post_types = get_post_types( array( 'public' => true, '_builtin' => false, ), 'objects' ); if ( is_array( $post_types ) && ! empty( $post_types ) ) { foreach ( $post_types as $slug => $post_type ) { $return[ $slug ] = array( 'title' => $post_type->label, ); } } return apply_filters( 'sinatra_display_choices', $return ); } customizer/customizer-partials.php000064400000001105151231536710013503 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Customizer callback for the Site Title. * * @since 1.0.0 */ function sinatra_partial_blogname() { return get_bloginfo( 'name', 'display' ); } /** * Customizer callback for the Site Tagline. * * @since 1.0.0 */ function sinatra_partial_blogdescription() { return get_bloginfo( 'description', 'display' ); } customizer/settings/class-sinatra-customizer-blog-page.php000064400000017361151231536710020136 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Blog_Page' ) ) : /** * Sinatra Blog » Blog Page / Archive section in Customizer. */ class Sinatra_Customizer_Blog_Page { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_blog_page'] = array( 'title' => esc_html__( 'Blog Page / Archive', 'sinatra' ), 'panel' => 'sinatra_panel_blog', ); // Layout. $options['setting']['sinatra_blog_layout'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Layout', 'sinatra' ), 'description' => esc_html__( 'Choose blog layout. This will affect blog layout on archives, search results and posts page.', 'sinatra' ), 'section' => 'sinatra_section_blog_page', 'choices' => array( 'blog-layout-1' => esc_html__( 'Vertical', 'sinatra' ), 'blog-horizontal' => esc_html__( 'Horizontal', 'sinatra' ), ), ), ); $_image_sizes = sinatra_get_image_sizes(); $size_choices = array(); if ( ! empty( $_image_sizes ) ) { foreach ( $_image_sizes as $key => $value ) { $name = ucwords( str_replace( array( '-', '_' ), ' ', $key ) ); $size_choices[ $key ] = $name; if ( $value['width'] || $value['height'] ) { $size_choices[ $key ] .= ' (' . $value['width'] . 'x' . $value['height'] . ')'; } } } // Featured Image Size. $options['setting']['sinatra_blog_image_size'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Featured Image Size', 'sinatra' ), 'section' => 'sinatra_section_blog_page', 'choices' => $size_choices, ), ); // Post Elements. $options['setting']['sinatra_blog_entry_elements'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_sortable', 'control' => array( 'type' => 'sinatra-sortable', 'section' => 'sinatra_section_blog_page', 'label' => esc_html__( 'Post Elements', 'sinatra' ), 'description' => esc_html__( 'Set order and visibility for post elements.', 'sinatra' ), 'choices' => array( 'summary' => esc_html__( 'Summary', 'sinatra' ), 'header' => esc_html__( 'Title', 'sinatra' ), 'meta' => esc_html__( 'Post Meta', 'sinatra' ), 'thumbnail' => esc_html__( 'Featured Image', 'sinatra' ), 'summary-footer' => esc_html__( 'Read More', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_blog_layout', 'value' => 'blog-layout-1', 'operator' => '==', ), ), ), ); // Meta/Post Details Layout. $options['setting']['sinatra_blog_entry_meta_elements'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_sortable', 'control' => array( 'type' => 'sinatra-sortable', 'section' => 'sinatra_section_blog_page', 'label' => esc_html__( 'Post Meta', 'sinatra' ), 'description' => esc_html__( 'Set order and visibility for post meta details.', 'sinatra' ), 'choices' => array( 'author' => esc_html__( 'Author', 'sinatra' ), 'date' => esc_html__( 'Publish Date', 'sinatra' ), 'comments' => esc_html__( 'Comments', 'sinatra' ), 'category' => esc_html__( 'Categories', 'sinatra' ), 'tag' => esc_html__( 'Tags', 'sinatra' ), ), ), ); // Post Categories. $options['setting']['sinatra_blog_horizontal_post_categories'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Show Post Categories', 'sinatra' ), 'description' => esc_html__( 'A list of categories the post belongs to. Displayed above post title.', 'sinatra' ), 'section' => 'sinatra_section_blog_page', 'required' => array( array( 'control' => 'sinatra_blog_layout', 'value' => 'blog-horizontal', 'operator' => '==', ), ), ), ); // Read More Button. $options['setting']['sinatra_blog_horizontal_read_more'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Show Read More Button', 'sinatra' ), 'section' => 'sinatra_section_blog_page', 'required' => array( array( 'control' => 'sinatra_blog_layout', 'value' => 'blog-horizontal', 'operator' => '==', ), ), ), ); // Meta Author image. $options['setting']['sinatra_entry_meta_icons'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'section' => 'sinatra_section_blog_page', 'label' => esc_html__( 'Show avatar and icons in post meta', 'sinatra' ), ), ); // Featured Image Position. $options['setting']['sinatra_blog_image_position'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Featured Image Position', 'sinatra' ), 'section' => 'sinatra_section_blog_page', 'choices' => array( 'left' => esc_html__( 'Left', 'sinatra' ), 'right' => esc_html__( 'Right', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_blog_layout', 'value' => 'blog-horizontal', 'operator' => '==', ), ), ), ); // Excerpt Length. $options['setting']['sinatra_excerpt_length'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_section_blog_page', 'label' => esc_html__( 'Excerpt Length', 'sinatra' ), 'description' => esc_html__( 'Number of words displayed in the excerpt.', 'sinatra' ), 'min' => 0, 'max' => 100, 'step' => 1, 'unit' => '', 'responsive' => false, ), ); // Excerpt more. $options['setting']['sinatra_excerpt_more'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', 'control' => array( 'type' => 'sinatra-text', 'section' => 'sinatra_section_blog_page', 'label' => esc_html__( 'Excerpt More', 'sinatra' ), 'description' => esc_html__( 'What to append to excerpt if the text is cut.', 'sinatra' ), ), ); return $options; } } endif; new Sinatra_Customizer_Blog_Page(); customizer/settings/class-sinatra-customizer-breadcrumbs.php000064400000021133151231536710020562 0ustar00 * @since 1.1.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Breadcrumbs' ) ) : /** * Sinatra Breadcrumbs Settings section in Customizer. */ class Sinatra_Customizer_Breadcrumbs { /** * Primary class constructor. * * @since 1.1.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.1.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Main Navigation Section. $options['section']['sinatra_section_breadcrumbs'] = array( 'title' => esc_html__( 'Breadcrumbs', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 70, ); // Breadcrumbs. $options['setting']['sinatra_breadcrumbs_enable'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Breadcrumbs', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', ), ); // Hide breadcrumbs on. $options['setting']['sinatra_breadcrumbs_hide_on'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_no_sanitize', 'control' => array( 'type' => 'sinatra-checkbox-group', 'label' => esc_html__( 'Disable On: ', 'sinatra' ), 'description' => esc_html__( 'Choose on which pages you want to disable breadcrumbs. ', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'choices' => sinatra_get_display_choices(), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Position. $options['setting']['sinatra_breadcrumbs_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Position', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'choices' => array( 'in-page-header' => esc_html__( 'In Page Header', 'sinatra' ), 'below-header' => esc_html__( 'Below Header (Separate Container)', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Alignment. $options['setting']['sinatra_breadcrumbs_alignment'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-alignment', 'label' => esc_html__( 'Alignment', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'choices' => 'horizontal', 'icons' => array( 'left' => 'dashicons dashicons-editor-alignleft', 'center' => 'dashicons dashicons-editor-aligncenter', 'right' => 'dashicons dashicons-editor-alignright', ), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_position', 'value' => 'below-header', 'operator' => '==', ), ), ), ); // Spacing. $options['setting']['sinatra_breadcrumbs_spacing'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Spacing', 'sinatra' ), 'description' => esc_html__( 'Specify top and bottom padding.', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'choices' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), 'responsive' => true, 'unit' => array( 'px', ), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Design options heading. $options['setting']['sinatra_breadcrumbs_heading_design'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_position', 'value' => 'below-header', 'operator' => '==', ), ), ), ); // Background design. $options['setting']['sinatra_breadcrumbs_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), 'image' => esc_html__( 'Image', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_heading_design', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_position', 'value' => 'below-header', 'operator' => '==', ), ), ), ); // Text Color. $options['setting']['sinatra_breadcrumbs_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_heading_design', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_position', 'value' => 'below-header', 'operator' => '==', ), ), ), ); // Border. $options['setting']['sinatra_breadcrumbs_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_breadcrumbs', 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), ), ), 'required' => array( array( 'control' => 'sinatra_breadcrumbs_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_heading_design', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_breadcrumbs_position', 'value' => 'below-header', 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Breadcrumbs(); customizer/settings/class-sinatra-customizer-buttons.php000064400000040755151231536710020002 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Buttons' ) ) : /** * Buttons section in Customizer » General Settings. */ class Sinatra_Customizer_Buttons { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_buttons'] = array( 'title' => esc_html__( 'Buttons', 'sinatra' ), 'panel' => 'sinatra_panel_general', 'priority' => 60, ); /** * Primary Button */ $options['setting']['sinatra_primary_button_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Primary Button', 'sinatra' ), 'section' => 'sinatra_section_buttons', ), ); // Primary button background color. $options['setting']['sinatra_primary_button_bg_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Background Color', 'sinatra' ), 'description' => esc_html__( 'Set primary button background color. If left empty, accent color will be used instead.', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button hover background color. $options['setting']['sinatra_primary_button_hover_bg_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Background Color', 'sinatra' ), 'description' => esc_html__( 'Set primary button hover background color. If left empty, lightened accent color will be used instead.', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button text color. $options['setting']['sinatra_primary_button_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Text Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button text hover color. $options['setting']['sinatra_primary_button_hover_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Text Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button border width. $options['setting']['sinatra_primary_button_border_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_section_buttons', 'label' => esc_html__( 'Border Width', 'sinatra' ), 'min' => 0, 'max' => 15, 'step' => 1, 'unit' => 'px', 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button border radius. $options['setting']['sinatra_primary_button_border_radius'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Border Radius', 'sinatra' ), 'description' => esc_html__( 'Specify primary button corner roundness. Top left, top right, bottom left and bottom right is the order of the corresponding corners.', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'choices' => array( 'top-left' => '↖', 'top-right' => '↗', 'bottom-right' => '↘', 'bottom-left' => '↙', ), 'unit' => array( 'px', ), 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button border color. $options['setting']['sinatra_primary_button_border_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Border Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button hover border color. $options['setting']['sinatra_primary_button_hover_border_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Border Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Primary button typography. $options['setting']['sinatra_primary_button_typography'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'text-transform' => array(), 'letter-spacing' => array(), 'font-size' => array(), 'line-height' => array(), ), 'required' => array( array( 'control' => 'sinatra_primary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); /** * Secondary Button */ // Secondary button. $options['setting']['sinatra_secondary_button_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Secondary Button', 'sinatra' ), 'section' => 'sinatra_section_buttons', ), ); // Secondary button background color. $options['setting']['sinatra_secondary_button_bg_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Background Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button hover background color. $options['setting']['sinatra_secondary_button_hover_bg_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Background Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button text color. $options['setting']['sinatra_secondary_button_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Text Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button text hover color. $options['setting']['sinatra_secondary_button_hover_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Text Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button border width. $options['setting']['sinatra_secondary_button_border_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_section_buttons', 'label' => esc_html__( 'Border Width', 'sinatra' ), 'min' => 0, 'max' => 15, 'step' => 1, 'unit' => 'px', 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button border radius. $options['setting']['sinatra_secondary_button_border_radius'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Border Radius', 'sinatra' ), 'description' => esc_html__( 'Specify secondary button corner roundness. Top left, top right, bottom left and bottom right is the order of the corresponding corners.', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'choices' => array( 'top-left' => '↖', 'top-right' => '↗', 'bottom-right' => '↘', 'bottom-left' => '↙', ), 'unit' => array( 'px', ), 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button border color. $options['setting']['sinatra_secondary_button_border_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Border Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button hover border color. $options['setting']['sinatra_secondary_button_hover_border_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Border Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Secondary button typography. $options['setting']['sinatra_secondary_button_typography'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'text-transform' => array(), 'letter-spacing' => array(), 'font-size' => array(), 'line-height' => array(), ), 'required' => array( array( 'control' => 'sinatra_secondary_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); /** * Text Button */ $options['setting']['sinatra_text_button_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Text Button', 'sinatra' ), 'section' => 'sinatra_section_buttons', ), ); // Text button text color. $options['setting']['sinatra_text_button_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Text Color', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_text_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Text button text hover color. $options['setting']['sinatra_text_button_hover_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Hover Text Color', 'sinatra' ), 'description' => esc_html__( 'If left empty, accent color will be used instead.', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'opacity' => true, 'required' => array( array( 'control' => 'sinatra_text_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Text button typography. $options['setting']['sinatra_text_button_typography'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_buttons', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'text-transform' => array(), 'letter-spacing' => array(), 'font-size' => array(), 'line-height' => array(), ), 'required' => array( array( 'control' => 'sinatra_text_button_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Buttons(); customizer/settings/class-sinatra-customizer-colors.php000064400000010734151231536710017577 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Colors' ) ) : /** * Sinatra Colors section in Customizer. */ class Sinatra_Customizer_Colors { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_colors'] = array( 'title' => esc_html__( 'Base Colors', 'sinatra' ), 'panel' => 'sinatra_panel_general', 'priority' => 20, ); // Accent color. $options['setting']['sinatra_accent_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Accent Color', 'sinatra' ), 'description' => esc_html__( 'The accent color is used subtly throughout your site, to call attention to key elements.', 'sinatra' ), 'section' => 'sinatra_section_colors', 'priority' => 10, 'opacity' => false, ), ); // Body background heading. $options['setting']['sinatra_body_background_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'priority' => 40, 'label' => esc_html__( 'Body Background', 'sinatra' ), 'section' => 'sinatra_section_colors', 'toggle' => false, ), ); // Content background heading. $options['setting']['sinatra_content_colors_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'priority' => 50, 'label' => esc_html__( 'Content', 'sinatra' ), 'section' => 'sinatra_section_colors', 'toggle' => false, ), ); // Content text color. $options['setting']['sinatra_content_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Text Color', 'sinatra' ), 'section' => 'sinatra_section_colors', 'priority' => 50, 'opacity' => true, ), ); // Content text color. $options['setting']['sinatra_content_link_hover_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Link Hover Color', 'sinatra' ), 'description' => esc_html__( 'This only applies to entry content area, other links will use the accent color on hover.', 'sinatra' ), 'section' => 'sinatra_section_colors', 'priority' => 50, 'opacity' => true, ), ); // Headings color. $options['setting']['sinatra_headings_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Headings Color', 'sinatra' ), 'section' => 'sinatra_section_colors', 'priority' => 50, 'opacity' => true, ), ); // Content background color. $options['setting']['sinatra_boxed_content_background_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_color', 'control' => array( 'type' => 'sinatra-color', 'label' => esc_html__( 'Boxed Content - Background Color', 'sinatra' ), 'description' => esc_html__( 'Only used if Site Layout is Boxed or Boxed Content.', 'sinatra' ), 'section' => 'sinatra_section_colors', 'priority' => 50, 'opacity' => true, ), ); return $options; } } endif; new Sinatra_Customizer_Colors(); customizer/settings/class-sinatra-customizer-copyright-settings.php000064400000022564151231536710022150 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Copyright_Settings' ) ) : /** * Sinatra Copyright Bar section in Customizer. */ class Sinatra_Customizer_Copyright_Settings { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { // Registers our custom options in Customizer. add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_copyright_bar'] = array( 'title' => esc_html__( 'Copyright Bar', 'sinatra' ), 'priority' => 30, 'panel' => 'sinatra_panel_footer', ); // Enable Copyright Bar. $options['setting']['sinatra_enable_copyright'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Copyright Bar', 'sinatra' ), 'section' => 'sinatra_section_copyright_bar', ), ); // Copyright Layout. $options['setting']['sinatra_copyright_layout'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-radio-image', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Copyright Layout', 'sinatra' ), 'description' => esc_html__( 'Choose your site’s copyright widgets layout.', 'sinatra' ), 'choices' => array( 'layout-1' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/copyright-layout-1.svg', 'title' => esc_html__( 'Centered', 'sinatra' ), ), 'layout-2' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/copyright-layout-2.svg', 'title' => esc_html__( 'Inline', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); // Enable Copyright Bar. $options['setting']['sinatra_copyright_separator'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Copyright Separator', 'sinatra' ), 'description' => esc_html__( 'Select type of Copyright Separator.', 'sinatra' ), 'choices' => array( 'none' => esc_html__( 'None', 'sinatra' ), 'contained-separator' => esc_html__( 'Contained Separator', 'sinatra' ), 'fw-separator' => esc_html__( 'Fullwidth Separator', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); // Copyright visibility. $options['setting']['sinatra_copyright_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where Copyright Bar is displayed.', 'sinatra' ), 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); // Copyright widgets heading. $options['setting']['sinatra_copyright_heading_widgets'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Copyright Bar Widgets', 'sinatra' ), 'description' => esc_html__( 'Click the Add Widget button to add available widgets to your Copyright Bar.', 'sinatra' ), 'required' => array( array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); // Copyright widgets. $options['setting']['sinatra_copyright_widgets'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_widget', 'control' => array( 'type' => 'sinatra-widget', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Copyright Bar Widgets', 'sinatra' ), 'widgets' => array( 'text' => array( 'max_uses' => 3, ), 'nav' => array( 'menu_location' => apply_filters( 'sinatra_footer_menu_location', 'sinatra-footer' ), 'max_uses' => 1, ), 'socials' => array( 'max_uses' => 1, 'styles' => array( 'minimal' => esc_html__( 'Minimal', 'sinatra' ), 'rounded' => esc_html__( 'Rounded', 'sinatra' ), ), ), ), 'locations' => array( 'start' => esc_html__( 'Start', 'sinatra' ), 'end' => esc_html__( 'End', 'sinatra' ), ), 'visibility' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_copyright_heading_widgets', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#sinatra-copyright', 'render_callback' => 'sinatra_copyright_bar_output', 'container_inclusive' => true, 'fallback_refresh' => true, ), ); // Copyright design options heading. $options['setting']['sinatra_copyright_heading_design_options'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'required' => array( array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); // Copyright Background. $options['setting']['sinatra_copyright_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Background', 'sinatra' ), 'space' => true, 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_copyright_heading_design_options', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); // Copyright Text Color. $options['setting']['sinatra_copyright_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'section' => 'sinatra_section_copyright_bar', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'description' => '', 'space' => true, 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_copyright_heading_design_options', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_copyright', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Copyright_Settings(); customizer/settings/class-sinatra-customizer-hero.php000064400000025773151231536710017244 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Hero' ) ) : /** * Sinatra Page Title Settings section in Customizer. */ class Sinatra_Customizer_Hero { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Hero Section. $options['section']['sinatra_section_hero'] = array( 'title' => esc_html__( 'Hero', 'sinatra' ), 'priority' => 3, ); // Hero enable. $options['setting']['sinatra_enable_hero'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Enable Hero Section', 'sinatra' ), ), ); // Visibility. $options['setting']['sinatra_hero_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where the Hero is displayed.', 'sinatra' ), 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), ), ), ); // Hero display on. $options['setting']['sinatra_hero_enable_on'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_no_sanitize', 'control' => array( 'type' => 'sinatra-checkbox-group', 'label' => esc_html__( 'Enable On: ', 'sinatra' ), 'description' => esc_html__( 'Choose on which pages you want to enable Hero. ', 'sinatra' ), 'section' => 'sinatra_section_hero', 'choices' => array( 'home' => array( 'title' => esc_html__( 'Home Page', 'sinatra' ), ), 'posts_page' => array( 'title' => esc_html__( 'Blog / Posts Page', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), ), ), ); // Hover Slider heading. $options['setting']['sinatra_hero_hover_slider'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Style', 'sinatra' ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), ); // Hover Slider container width. $options['setting']['sinatra_hero_hover_slider_container'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Width', 'sinatra' ), 'description' => esc_html__( 'Stretch the container to full width, or match your site’s content width.', 'sinatra' ), 'choices' => array( 'content-width' => esc_html__( 'Content Width', 'sinatra' ), 'full-width' => esc_html__( 'Full Width', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_hover_slider', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), ); // Hover Slider height. $options['setting']['sinatra_hero_hover_slider_height'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Height', 'sinatra' ), 'description' => esc_html__( 'Set the height of the container.', 'sinatra' ), 'min' => 350, 'max' => 1000, 'step' => 1, 'unit' => 'px', 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_hover_slider', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), ); // Hover Slider overlay. $options['setting']['sinatra_hero_hover_slider_overlay'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Overlay', 'sinatra' ), 'description' => esc_html__( 'Choose hero overlay style.', 'sinatra' ), 'choices' => array( 'none' => esc_html__( 'None', 'sinatra' ), '1' => esc_html__( 'Overlay 1', 'sinatra' ), '2' => esc_html__( 'Overlay 2', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_hover_slider', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), ); // Hover Slider Elements. $options['setting']['sinatra_hero_hover_slider_elements'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_sortable', 'control' => array( 'type' => 'sinatra-sortable', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Post Elements', 'sinatra' ), 'description' => esc_html__( 'Set order and visibility for post elements.', 'sinatra' ), 'sortable' => false, 'choices' => array( 'category' => esc_html__( 'Categories', 'sinatra' ), 'meta' => esc_html__( 'Post Details', 'sinatra' ), 'read_more' => esc_html__( 'Continue Reading', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_hover_slider', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#hero', 'render_callback' => 'sinatra_hero', 'container_inclusive' => true, 'fallback_refresh' => true, ), ); // Post Settings heading. $options['setting']['sinatra_hero_hover_slider_posts'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Post Settings', 'sinatra' ), 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), ); // Post count. $options['setting']['sinatra_hero_hover_slider_post_number'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Post Number', 'sinatra' ), 'description' => esc_html__( 'Set the number of visible posts.', 'sinatra' ), 'min' => 1, 'max' => 4, 'step' => 1, 'unit' => '', 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_hover_slider_posts', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#hero', 'render_callback' => 'sinatra_hero', 'container_inclusive' => true, 'fallback_refresh' => true, ), ); // Post category. $options['setting']['sinatra_hero_hover_slider_category'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_hero', 'label' => esc_html__( 'Category', 'sinatra' ), 'description' => esc_html__( 'Display posts from selected category only. Leave empty to include all.', 'sinatra' ), 'is_select2' => true, 'data_source' => 'category', 'multiple' => true, 'required' => array( array( 'control' => 'sinatra_enable_hero', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_hover_slider_posts', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_hero_type', 'value' => 'hover-slider', 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Hero(); customizer/settings/class-sinatra-customizer-layout.php000064400000005076151231536710017616 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Layout' ) ) : /** * Sinatra Layout section in Customizer. */ class Sinatra_Customizer_Layout { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_layout_section'] = array( 'title' => esc_html__( 'Layout', 'sinatra' ), 'panel' => 'sinatra_panel_general', 'priority' => 10, ); // Site layout. $options['setting']['sinatra_site_layout'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_layout_section', 'label' => esc_html__( 'Site Layout', 'sinatra' ), 'description' => esc_html__( 'Choose your site’s main layout.', 'sinatra' ), 'choices' => array( 'fw-contained' => esc_html__( 'Full Width: Contained', 'sinatra' ), 'fw-stretched' => esc_html__( 'Full Width: Stretched', 'sinatra' ), 'boxed-separated' => esc_html__( 'Boxed Content', 'sinatra' ), 'boxed' => esc_html__( 'Boxed', 'sinatra' ), ), ), ); // Container width. $options['setting']['sinatra_container_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_layout_section', 'label' => esc_html__( 'Content Width', 'sinatra' ), 'description' => esc_html__( 'Change your site’s main container width.', 'sinatra' ), 'min' => 500, 'max' => 1920, 'step' => 10, 'unit' => 'px', 'required' => array( array( 'control' => 'sinatra_site_layout', 'value' => 'fw-stretched', 'operator' => '!=', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Layout(); customizer/settings/class-sinatra-customizer-logo.php000064400000014602151231536710017234 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Logo' ) ) : /** * Sinatra Logo section in Customizer. */ class Sinatra_Customizer_Logo { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Logo Retina. $options['setting']['sinatra_logo_default_retina'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_background', 'control' => array( 'type' => 'sinatra-background', 'section' => 'title_tagline', 'label' => esc_html__( 'Retina Logo', 'sinatra' ), 'description' => esc_html__( 'Upload exactly 2x the size of your default logo to make your logo crisp on HiDPI screens. This options is not required if logo above is in SVG format.', 'sinatra' ), 'priority' => 20, 'advanced' => false, 'strings' => array( 'select_image' => __( 'Select logo', 'sinatra' ), 'use_image' => __( 'Select', 'sinatra' ), ), 'required' => array( array( 'control' => 'custom_logo', 'value' => false, 'operator' => '!=', ), ), ), 'partial' => array( 'selector' => '.sinatra-logo', 'render_callback' => 'sinatra_logo', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Logo Max Height. $options['setting']['sinatra_logo_max_height'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Logo Height', 'sinatra' ), 'description' => esc_html__( 'Maximum logo image height.', 'sinatra' ), 'section' => 'title_tagline', 'priority' => 30, 'min' => 0, 'max' => 1000, 'step' => 10, 'unit' => 'px', 'responsive' => true, 'required' => array( array( 'control' => 'custom_logo', 'value' => false, 'operator' => '!=', ), ), ), ); // Logo margin. $options['setting']['sinatra_logo_margin'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Logo Margin', 'sinatra' ), 'description' => esc_html__( 'Specify spacing around logo. Negative values are allowed.', 'sinatra' ), 'section' => 'title_tagline', 'settings' => 'sinatra_logo_margin', 'priority' => 40, 'choices' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'right' => esc_html__( 'Right', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), 'left' => esc_html__( 'Left', 'sinatra' ), ), 'responsive' => true, 'unit' => array( 'px', ), ), ); // Show tagline. $options['setting']['sinatra_display_tagline'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Display Tagline', 'sinatra' ), 'section' => 'title_tagline', 'settings' => 'sinatra_display_tagline', 'priority' => 80, ), 'partial' => array( 'selector' => '.sinatra-logo', 'render_callback' => 'sinatra_logo', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Site Identity heading. $options['setting']['sinatra_logo_heading_site_identity'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Site Identity', 'sinatra' ), 'section' => 'title_tagline', 'settings' => 'sinatra_logo_heading_site_identity', 'priority' => 50, 'toggle' => false, ), ); // Logo typography heading. $options['setting']['sinatra_typography_logo_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'title_tagline', 'priority' => 100, 'required' => array( array( 'control' => 'custom_logo', 'value' => false, 'operator' => '==', ), ), ), ); // Site title font size. $options['setting']['sinatra_logo_text_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Site Title Font Size', 'sinatra' ), 'section' => 'title_tagline', 'priority' => 100, 'min' => 8, 'max' => 30, 'step' => 1, 'responsive' => true, 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 90, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'custom_logo', 'value' => false, 'operator' => '==', ), array( 'control' => 'sinatra_typography_logo_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Logo(); customizer/settings/class-sinatra-customizer-main-footer.php000064400000024152151231536710020515 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Main_Footer' ) ) : /** * Sinatra Main Footer section in Customizer. */ class Sinatra_Customizer_Main_Footer { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_main_footer'] = array( 'title' => esc_html__( 'Main Footer', 'sinatra' ), 'panel' => 'sinatra_panel_footer', 'priority' => 20, ); // Enable Footer. $options['setting']['sinatra_enable_footer'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Main Footer', 'sinatra' ), 'section' => 'sinatra_section_main_footer', ), ); // Footer Layout. $options['setting']['sinatra_footer_layout'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-radio-image', 'label' => esc_html__( 'Column Layout', 'sinatra' ), 'description' => esc_html__( 'Choose your site’s footer column layout.', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'choices' => array( 'layout-1' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/footer-layout-1.svg', 'title' => esc_html__( '1/4 + 1/4 + 1/4 + 1/4', 'sinatra' ), ), 'layout-2' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/footer-layout-2.svg', 'title' => esc_html__( '1/3 + 1/3 + 1/3', 'sinatra' ), ), 'layout-3' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/footer-layout-3.svg', 'title' => esc_html__( '2/3 + 1/3', 'sinatra' ), ), 'layout-4' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/footer-layout-4.svg', 'title' => esc_html__( '1/3 + 2/3', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#sinatra-footer-widgets', 'render_callback' => 'sinatra_footer_widgets', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Center footer widgets.. $options['setting']['sinatra_footer_widgets_align_center'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Center Widget Content', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#sinatra-footer-widgets', 'render_callback' => 'sinatra_footer_widgets', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Main Footer visibility. $options['setting']['sinatra_footer_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where Main Footer is displayed.', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), ), ), ); // Footer Design Options heading. $options['setting']['sinatra_footer_heading_design_options'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), ), ), ); // Footer Background. $options['setting']['sinatra_footer_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), 'image' => esc_html__( 'Image', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_footer_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Footer Text Color. $options['setting']['sinatra_footer_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), 'widget-title-color' => esc_html__( 'Widget Title Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_footer_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Footer Border. $options['setting']['sinatra_footer_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), ), ), 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_footer_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Footer typography heading. $options['setting']['sinatra_typography_main_footer_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'required' => array( array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), ), ), ); // Footer widget title font size. $options['setting']['sinatra_footer_widget_title_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Widget Title Font Size', 'sinatra' ), 'description' => esc_html__( 'Choose your widget title font size.', 'sinatra' ), 'section' => 'sinatra_section_main_footer', 'responsive' => true, 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 90, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'sinatra_typography_main_footer_heading', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_footer', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Main_Footer(); customizer/settings/class-sinatra-customizer-main-header.php000064400000021561151231536710020450 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Main_Header' ) ) : /** * Sinatra Main Header section in Customizer. */ class Sinatra_Customizer_Main_Header { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Main Header Section. $options['section']['sinatra_section_main_header'] = array( 'title' => esc_html__( 'Main Header', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 20, ); // Header Layout. $options['setting']['sinatra_header_layout'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-radio-image', 'label' => esc_html__( 'Header Layout', 'sinatra' ), 'description' => esc_html__( 'Pre-defined positions of header elements, such as logo and navigation.', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'choices' => array( 'layout-1' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/header-layout-1.svg', 'title' => esc_html__( 'Header 1', 'sinatra' ), ), 'layout-2' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/header-layout-2.svg', 'title' => esc_html__( 'Header 2', 'sinatra' ), ), 'layout-3' => array( 'image' => SINATRA_THEME_URI . '/inc/customizer/assets/images/header-layout-3.svg', 'title' => esc_html__( 'Header 3', 'sinatra' ), ), ), ), ); // Header container width. $options['setting']['sinatra_header_container_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Header Width', 'sinatra' ), 'description' => esc_html__( 'Stretch the Header container to full width, or match your site’s content width.', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'choices' => array( 'content-width' => esc_html__( 'Content Width', 'sinatra' ), 'full-width' => esc_html__( 'Full Width', 'sinatra' ), ), ), ); // Header widgets heading. $options['setting']['sinatra_header_heading_widgets'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Header Widgets', 'sinatra' ), 'description' => esc_html__( 'Click the Add Widget button to add available widgets to your Header. Click the down arrow icon to expand widget options.', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'space' => true, ), ); // Header widgets. $options['setting']['sinatra_header_widgets'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_widget', 'control' => array( 'type' => 'sinatra-widget', 'label' => esc_html__( 'Header Widgets', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'widgets' => apply_filters( 'sinatra_main_header_widgets', array( 'search' => array( 'max_uses' => 1, ), 'button' => array( 'max_uses' => 1, ), ) ), 'locations' => array( 'left' => esc_html__( 'Left', 'sinatra' ), 'right' => esc_html__( 'Right', 'sinatra' ), ), 'visibility' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_header_heading_widgets', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#sinatra-header', 'render_callback' => 'sinatra_header_content_output', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Header widget separator. $options['setting']['sinatra_header_widgets_separator'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Widgets Separator', 'sinatra' ), 'description' => esc_html__( 'Display a separator line between widgets.', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'choices' => array( 'none' => esc_html__( 'None', 'sinatra' ), 'regular' => esc_html__( 'Regular', 'sinatra' ), 'slanted' => esc_html__( 'Slanted', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_header_heading_widgets', 'value' => true, 'operator' => '==', ), ), ), ); // Header design options heading. $options['setting']['sinatra_header_heading_design_options'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'space' => true, ), ); // Header Background. $options['setting']['sinatra_header_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'description' => '', 'section' => 'sinatra_section_main_header', 'space' => true, 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), 'image' => esc_html__( 'Image', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_header_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Header Text Color. $options['setting']['sinatra_header_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'space' => true, 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Tagline Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_header_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Header Border. $options['setting']['sinatra_header_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_main_header', 'space' => true, 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), 'separator' => esc_html__( 'Separator Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_header_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Main_Header(); customizer/settings/class-sinatra-customizer-main-navigation.php000064400000023514151231536710021357 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Main_Navigation' ) ) : /** * Sinatra Main Navigation Settings section in Customizer. */ class Sinatra_Customizer_Main_Navigation { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Main Navigation Section. $options['section']['sinatra_section_main_navigation'] = array( 'title' => esc_html__( 'Main Navigation', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 30, ); // Navigation animation heading. $options['setting']['sinatra_main_nav_heading_animation'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Animation', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', ), ); // Hover animation. $options['setting']['sinatra_main_nav_hover_animation'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Hover Animation', 'sinatra' ), 'description' => esc_html__( 'Choose menu item hover animation style.', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'choices' => array( 'none' => esc_html__( 'None', 'sinatra' ), 'underline' => esc_html__( 'Underline', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_main_nav_heading_animation', 'value' => true, 'operator' => '==', ), ), ), ); // Sub Menus heading. $options['setting']['sinatra_main_nav_heading_sub_menus'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Sub Menus', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', ), ); // Sub-Menu Indicators. $options['setting']['sinatra_main_nav_sub_indicators'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Dropdown Indicators', 'sinatra' ), 'description' => esc_html__( 'Show indicators (arrow icons) on parent menu items that have sub menus.', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'required' => array( array( 'control' => 'sinatra_main_nav_heading_sub_menus', 'value' => true, 'operator' => '==', ), ), ), ); // Mobile Menu heading. $options['setting']['sinatra_main_nav_heading_mobile_menu'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Mobile Menu', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', ), ); // Mobile Menu Breakpoint. $options['setting']['sinatra_main_nav_mobile_breakpoint'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Mobile Breakpoint', 'sinatra' ), 'description' => esc_html__( 'Choose the breakpoint (in px) when to show the mobile navigation.', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'min' => 0, 'max' => 1920, 'step' => 1, 'unit' => 'px', 'required' => array( array( 'control' => 'sinatra_main_nav_heading_mobile_menu', 'value' => true, 'operator' => '==', ), ), ), ); // Mobile Menu Button Label. $options['setting']['sinatra_main_nav_mobile_label'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'control' => array( 'type' => 'sinatra-text', 'label' => esc_html__( 'Mobile Menu Button Label', 'sinatra' ), 'description' => esc_html__( 'This text will be displayed next to the mobile menu button.', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'placeholder' => esc_html__( 'Leave empty to hide the label...', 'sinatra' ), 'required' => array( array( 'control' => 'sinatra_main_nav_heading_mobile_menu', 'value' => true, 'operator' => '==', ), ), ), ); // Navigation design options heading. $options['setting']['sinatra_nav_design_options'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', ), ); // Navigation Background. $options['setting']['sinatra_main_nav_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_nav_design_options', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_header_layout', 'value' => 'layout-3', 'operator' => '==', ), ), ), ); // Navigation Font Color. $options['setting']['sinatra_main_nav_font_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'display' => array( 'color' => array( 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_nav_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Navigation Border. $options['setting']['sinatra_main_nav_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), ), ), 'required' => array( array( 'control' => 'sinatra_nav_design_options', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_header_layout', 'value' => 'layout-3', 'operator' => '==', ), ), ), ); // Main navigation typography heading. $options['setting']['sinatra_typography_main_nav_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', ), ); // Main navigation font size. $options['setting']['sinatra_main_nav_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Font Size', 'sinatra' ), 'description' => esc_html__( 'Choose your main navigation font size.', 'sinatra' ), 'section' => 'sinatra_section_main_navigation', 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 25, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 2, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 2, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'sinatra_typography_main_nav_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Main_Navigation(); customizer/settings/class-sinatra-customizer-misc.php000064400000014307151231536710017231 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Misc' ) ) : /** * Sinatra Misc section in Customizer. */ class Sinatra_Customizer_Misc { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_misc'] = array( 'title' => esc_html__( 'Misc Settings', 'sinatra' ), 'panel' => 'sinatra_panel_general', 'priority' => 60, ); // Schema toggle. $options['setting']['sinatra_enable_schema'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Schema Markup', 'sinatra' ), 'description' => esc_html__( 'Add structured data to your content.', 'sinatra' ), 'section' => 'sinatra_section_misc', ), ); // Custom form styles. $options['setting']['sinatra_custom_input_style'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Custom Form Styles', 'sinatra' ), 'description' => esc_html__( 'Custom design for checkboxes and radio buttons.', 'sinatra' ), 'section' => 'sinatra_section_misc', ), ); // Page Preloader heading. $options['setting']['sinatra_preloader_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Page Preloader', 'sinatra' ), 'section' => 'sinatra_section_misc', ), ); // Enable/Disable Page Preloader. $options['setting']['sinatra_preloader'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Page Preloader', 'sinatra' ), 'description' => esc_html__( 'Show animation until page is fully loaded.', 'sinatra' ), 'section' => 'sinatra_section_misc', 'required' => array( array( 'control' => 'sinatra_preloader_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Preloader visibility. $options['setting']['sinatra_preloader_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where Page Preloader is displayed.', 'sinatra' ), 'section' => 'sinatra_section_misc', 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_preloader_heading', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_preloader', 'value' => true, 'operator' => '==', ), ), ), ); // Scroll Top heading. $options['setting']['sinatra_scroll_top_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Scroll Top Button', 'sinatra' ), 'section' => 'sinatra_section_misc', ), ); // Enable/Disable Scroll Top. $options['setting']['sinatra_enable_scroll_top'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Scroll Top Button', 'sinatra' ), 'description' => esc_html__( 'A sticky button that allows users to easily return to the top of a page.', 'sinatra' ), 'section' => 'sinatra_section_misc', 'required' => array( array( 'control' => 'sinatra_scroll_top_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Scroll Top device visibility. $options['setting']['sinatra_scroll_top_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where the button is displayed.', 'sinatra' ), 'section' => 'sinatra_section_misc', 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_enable_scroll_top', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_scroll_top_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Misc(); customizer/settings/class-sinatra-customizer-page-header.php000064400000020615151231536710020437 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Page_Header' ) ) : /** * Sinatra Page Title Settings section in Customizer. */ class Sinatra_Customizer_Page_Header { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Page Title Section. $options['section']['sinatra_section_page_header'] = array( 'title' => esc_html__( 'Page Header', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 60, ); // Page Header enable. $options['setting']['sinatra_page_header_enable'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Page Header', 'sinatra' ), 'section' => 'sinatra_section_page_header', ), ); // Alignment. $options['setting']['sinatra_page_header_alignment'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-alignment', 'label' => esc_html__( 'Title Alignment', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'choices' => 'horizontal', 'icons' => array( 'left' => 'dashicons dashicons-editor-alignleft', 'center' => 'dashicons dashicons-editor-aligncenter', 'right' => 'dashicons dashicons-editor-alignright', ), 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Spacing. $options['setting']['sinatra_page_header_spacing'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Page Title Spacing', 'sinatra' ), 'description' => esc_html__( 'Specify Page Title top and bottom padding.', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'choices' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), 'responsive' => true, 'unit' => array( 'px', ), 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Page Header design options heading. $options['setting']['sinatra_page_header_heading_design'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Page Header background design. $options['setting']['sinatra_page_header_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), 'image' => esc_html__( 'Image', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_page_header_heading_design', 'value' => true, 'operator' => '==', ), ), ), ); // Page Header Text Color. $options['setting']['sinatra_page_header_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_page_header_heading_design', 'value' => true, 'operator' => '==', ), ), ), ); // Page Header Border. $options['setting']['sinatra_page_header_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), ), ), 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_page_header_heading_design', 'value' => true, 'operator' => '==', ), ), ), ); // Page Header typography heading. $options['setting']['sinatra_typography_page_header'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'required' => array( array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Page Header font size. $options['setting']['sinatra_page_header_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Page Title Font Size', 'sinatra' ), 'description' => esc_html__( 'Choose your page title font size.', 'sinatra' ), 'section' => 'sinatra_section_page_header', 'responsive' => true, 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 90, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'sinatra_typography_page_header', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_page_header_enable', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Page_Header(); customizer/settings/class-sinatra-customizer-pre-footer.php000064400000034251151231536710020360 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Pre_Footer' ) ) : /** * Sinatra Pre Footer section in Customizer. */ class Sinatra_Customizer_Pre_Footer { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Pre Footer. $options['section']['sinatra_section_pre_footer'] = array( 'title' => esc_html__( 'Pre Footer', 'sinatra' ), 'panel' => 'sinatra_panel_footer', 'priority' => 10, ); // Pre Footer - Call to Action. $options['setting']['sinatra_pre_footer_cta'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Call to Action', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', ), ); // Enable Pre Footer CTA. $options['setting']['sinatra_enable_pre_footer_cta'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Call to Action', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#si-pre-footer', 'render_callback' => 'sinatra_pre_footer', 'container_inclusive' => true, 'fallback_refresh' => true, ), ); // Pre Footer visibility. $options['setting']['sinatra_pre_footer_cta_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where the Top Bar is displayed.', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer Hide on. $options['setting']['sinatra_pre_footer_cta_hide_on'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_no_sanitize', 'control' => array( 'type' => 'sinatra-checkbox-group', 'label' => esc_html__( 'Disable On: ', 'sinatra' ), 'description' => esc_html__( 'Choose on which pages you want to disable Pre Footer Call to Action. ', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'choices' => sinatra_get_display_choices(), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer CTA Style. $options['setting']['sinatra_pre_footer_cta_style'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Style', 'sinatra' ), 'description' => esc_html__( 'Choose CTA Style.', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'choices' => array( '1' => esc_html__( 'Contained', 'sinatra' ), '2' => esc_html__( 'Fullwidth', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer CTA Text. $options['setting']['sinatra_pre_footer_cta_text'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_textarea', 'control' => array( 'type' => 'sinatra-textarea', 'label' => esc_html__( 'Content', 'sinatra' ), 'description' => esc_html__( 'Shortcodes and basic html elements allowed.', 'sinatra' ), 'placeholder' => esc_html__( 'Call to Action Content', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'rows' => '5', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer CTA Button Text. $options['setting']['sinatra_pre_footer_cta_btn_text'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'control' => array( 'type' => 'sinatra-text', 'label' => esc_html__( 'Button Text', 'sinatra' ), 'description' => esc_html__( 'Label for the CTA button.', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer CTA Button URL. $options['setting']['sinatra_pre_footer_cta_btn_url'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'control' => array( 'type' => 'sinatra-text', 'label' => esc_html__( 'Button Link', 'sinatra' ), 'description' => esc_html__( 'Link for the CTA button.', 'sinatra' ), 'placeholder' => 'http://', 'section' => 'sinatra_section_pre_footer', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer CTA open in new tab. $options['setting']['sinatra_pre_footer_cta_btn_new_tab'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Open link in new tab?', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer - Call to Action Design Options. $options['setting']['sinatra_pre_footer_cta_design_options'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer - Call to Action Background. $options['setting']['sinatra_pre_footer_cta_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), 'image' => esc_html__( 'Image', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_pre_footer_cta_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer - Call to Action Text Color. $options['setting']['sinatra_pre_footer_cta_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_pre_footer_cta_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Pre Footer - Call to Action Border. $options['setting']['sinatra_pre_footer_cta_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'right' => esc_html__( 'Right', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), 'left' => esc_html__( 'Left', 'sinatra' ), ), ), ), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_pre_footer_cta_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // CTA typography heading. $options['setting']['sinatra_pre_footer_cta_typography'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), ), ), ); // CTA font size. $options['setting']['sinatra_pre_footer_cta_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Font Size', 'sinatra' ), 'section' => 'sinatra_section_pre_footer', 'min' => 8, 'max' => 90, 'step' => 1, 'responsive' => true, 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 90, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'sinatra_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_enable_pre_footer_cta', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_pre_footer_cta_typography', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Pre_Footer(); customizer/settings/class-sinatra-customizer-sections.php000064400000003047151231536710020124 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Sections' ) ) : /** * Sinatra Customizer sections and panels. */ class Sinatra_Customizer_Sections { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom panels in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_panel' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_panel( $options ) { // General panel. $options['panel']['sinatra_panel_general'] = array( 'title' => esc_html__( 'General Settings', 'sinatra' ), 'priority' => 1, ); // Header panel. $options['panel']['sinatra_panel_header'] = array( 'title' => esc_html__( 'Header', 'sinatra' ), 'priority' => 3, ); // Footer panel. $options['panel']['sinatra_panel_footer'] = array( 'title' => esc_html__( 'Footer', 'sinatra' ), 'priority' => 5, ); // Blog settings. $options['panel']['sinatra_panel_blog'] = array( 'title' => esc_html__( 'Blog', 'sinatra' ), 'priority' => 6, ); return $options; } } endif; new Sinatra_Customizer_Sections(); customizer/settings/class-sinatra-customizer-sidebar.php000064400000022517151231536710017711 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Sidebar' ) ) : /** * Sinatra Sidebar section in Customizer. */ class Sinatra_Customizer_Sidebar { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_sidebar'] = array( 'title' => esc_html__( 'Sidebar', 'sinatra' ), 'priority' => 4, ); // Default sidebar position. $options['setting']['sinatra_sidebar_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_sidebar', 'label' => esc_html__( 'Default Position', 'sinatra' ), 'description' => esc_html__( 'Choose default sidebar position layout. You can change this setting per page via metabox settings.', 'sinatra' ), 'choices' => array( 'no-sidebar' => esc_html__( 'No Sidebar', 'sinatra' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'sinatra' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'sinatra' ), ), ), ); // Single post sidebar position. $options['setting']['sinatra_single_post_sidebar_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Single Post', 'sinatra' ), 'description' => esc_html__( 'Choose default sidebar position layout for single posts. You can change this setting per post via metabox settings.', 'sinatra' ), 'section' => 'sinatra_section_sidebar', 'choices' => array( 'default' => esc_html__( 'Default', 'sinatra' ), 'no-sidebar' => esc_html__( 'No Sidebar', 'sinatra' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'sinatra' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'sinatra' ), ), ), ); // Single page sidebar position. $options['setting']['sinatra_single_page_sidebar_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Page', 'sinatra' ), 'description' => esc_html__( 'Choose default sidebar position layout for pages. You can change this setting per page via metabox settings.', 'sinatra' ), 'section' => 'sinatra_section_sidebar', 'choices' => array( 'default' => esc_html__( 'Default', 'sinatra' ), 'no-sidebar' => esc_html__( 'No Sidebar', 'sinatra' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'sinatra' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'sinatra' ), ), ), ); // Archive sidebar position. $options['setting']['sinatra_archive_sidebar_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Archives & Search', 'sinatra' ), 'description' => esc_html__( 'Choose default sidebar position layout for archives and search results.', 'sinatra' ), 'section' => 'sinatra_section_sidebar', 'choices' => array( 'default' => esc_html__( 'Default', 'sinatra' ), 'no-sidebar' => esc_html__( 'No Sidebar', 'sinatra' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'sinatra' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'sinatra' ), ), ), ); // Sidebar options heading. $options['setting']['sinatra_sidebar_options_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Options', 'sinatra' ), 'section' => 'sinatra_section_sidebar', ), ); // Sidebar style. $options['setting']['sinatra_sidebar_style'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_sidebar', 'label' => esc_html__( 'Sidebar Style', 'sinatra' ), 'description' => esc_html__( 'Choose sidebar style.', 'sinatra' ), 'choices' => array( '1' => esc_html__( 'Minimal', 'sinatra' ), '2' => esc_html__( 'Title Focus', 'sinatra' ), '3' => esc_html__( 'Widgets Separated', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_sidebar_options_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Sidebar width. $options['setting']['sinatra_sidebar_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'section' => 'sinatra_section_sidebar', 'label' => esc_html__( 'Sidebar Width', 'sinatra' ), 'description' => esc_html__( 'Change your sidebar width.', 'sinatra' ), 'min' => 15, 'max' => 50, 'step' => 1, 'unit' => '%', 'required' => array( array( 'control' => 'sinatra_sidebar_options_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Sticky sidebar. $options['setting']['sinatra_sidebar_sticky'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_sidebar', 'label' => esc_html__( 'Sticky Sidebar', 'sinatra' ), 'description' => esc_html__( 'Stick sidebar when scrolling.', 'sinatra' ), 'choices' => array( '' => esc_html__( 'Disable', 'sinatra' ), 'sidebar' => esc_html__( 'Stick first widget', 'sinatra' ), 'last-widget' => esc_html__( 'Stick last widget', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_sidebar_options_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Sidebar mobile position. $options['setting']['sinatra_sidebar_responsive_position'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'section' => 'sinatra_section_sidebar', 'label' => esc_html__( 'Responsive Sidebar Position', 'sinatra' ), 'description' => esc_html__( 'Control sidebar position on smaller screens.', 'sinatra' ), 'choices' => array( 'hide' => esc_html__( 'Hide', 'sinatra' ), 'before-content' => esc_html__( 'Before Content', 'sinatra' ), 'after-content' => esc_html__( 'After Content', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_sidebar_options_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Sidebar typography heading. $options['setting']['sinatra_typography_sidebar_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_sidebar', ), ); // Sidebar widget heading. $options['setting']['sinatra_sidebar_widget_title_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Widget Title Font Size', 'sinatra' ), 'description' => esc_html__( 'Specify sidebar widget title font size.', 'sinatra' ), 'section' => 'sinatra_section_sidebar', 'responsive' => true, 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 90, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 5, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'sinatra_typography_sidebar_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Sidebar(); customizer/settings/class-sinatra-customizer-single-post.php000064400000025725151231536710020550 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Single_Post' ) ) : /** * Sinatra Blog - Single Post section in Customizer. */ class Sinatra_Customizer_Single_Post { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_blog_single_post'] = array( 'title' => esc_html__( 'Single Post', 'sinatra' ), 'panel' => 'sinatra_panel_blog', 'priority' => 20, ); // Single post layout. $options['setting']['sinatra_single_post_layout_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Layout', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', ), ); // Content Layout. $options['setting']['sinatra_single_title_position'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Title Position', 'sinatra' ), 'description' => esc_html__( 'Select title position for single post pages.', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'choices' => array( 'in-content' => esc_html__( 'In Content', 'sinatra' ), 'in-page-header' => esc_html__( 'In Page Header', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_single_post_layout_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Alignment. $options['setting']['sinatra_single_title_alignment'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-alignment', 'label' => esc_html__( 'Title Alignment', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'choices' => 'horizontal', 'icons' => array( 'left' => 'dashicons dashicons-editor-alignleft', 'center' => 'dashicons dashicons-editor-aligncenter', 'right' => 'dashicons dashicons-editor-alignright', ), 'required' => array( array( 'control' => 'sinatra_single_post_layout_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Spacing. $options['setting']['sinatra_single_title_spacing'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Title Spacing', 'sinatra' ), 'description' => esc_html__( 'Specify title top and bottom padding.', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'choices' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), 'responsive' => true, 'unit' => array( 'px', ), 'required' => array( array( 'control' => 'sinatra_single_post_layout_heading', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_single_title_position', 'value' => 'in-page-header', 'operator' => '==', ), ), ), ); // Content width. $options['setting']['sinatra_single_content_width'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Content Width', 'sinatra' ), 'description' => esc_html__( 'Narrow content width or match your site’s Content Width (defined in General Settings » Layout).', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'choices' => array( 'wide' => esc_html__( 'Content Width', 'sinatra' ), 'narrow' => esc_html__( 'Narrow Width', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_single_post_layout_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Narrow container width. $options['setting']['sinatra_single_narrow_container_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_range', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Narrow Container Width', 'sinatra' ), 'description' => esc_html__( 'Choose the width (in px) for narrow container on single posts.', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'min' => 500, 'max' => 1500, 'step' => 10, 'required' => array( array( 'control' => 'sinatra_single_content_width', 'value' => 'narrow', 'operator' => '==', ), array( 'control' => 'sinatra_single_post_layout_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Single post elements. $options['setting']['sinatra_single_post_elements_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Post Elements', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', ), ); $options['setting']['sinatra_single_post_elements'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_sortable', 'control' => array( 'type' => 'sinatra-sortable', 'section' => 'sinatra_section_blog_single_post', 'label' => esc_html__( 'Post Elements', 'sinatra' ), 'description' => esc_html__( 'Set visibility of post elements.', 'sinatra' ), 'sortable' => false, 'choices' => array( 'thumb' => esc_html__( 'Featured Image', 'sinatra' ), 'category' => esc_html__( 'Post Categories', 'sinatra' ), 'tags' => esc_html__( 'Post Tags', 'sinatra' ), 'last-updated' => esc_html__( 'Last Updated Date', 'sinatra' ), 'about-author' => esc_html__( 'About Author Box', 'sinatra' ), 'prev-next-post' => esc_html__( 'Next/Prev Post Links', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_single_post_elements_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Meta/Post Details Layout. $options['setting']['sinatra_single_post_meta_elements'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_sortable', 'control' => array( 'type' => 'sinatra-sortable', 'label' => esc_html__( 'Post Meta', 'sinatra' ), 'description' => esc_html__( 'Set order and visibility for post meta details.', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'choices' => array( 'author' => esc_html__( 'Author', 'sinatra' ), 'date' => esc_html__( 'Publish Date', 'sinatra' ), 'comments' => esc_html__( 'Comments', 'sinatra' ), 'category' => esc_html__( 'Categories', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_single_post_elements_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Meta icons. $options['setting']['sinatra_single_entry_meta_icons'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'section' => 'sinatra_section_blog_single_post', 'label' => esc_html__( 'Show avatar and icons in post meta', 'sinatra' ), 'required' => array( array( 'control' => 'sinatra_single_post_elements_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Toggle Comments. $options['setting']['sinatra_single_toggle_comments'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Show Toggle Comments', 'sinatra' ), 'description' => esc_html__( 'Hide comments and comment form behind a toggle button. ', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'required' => array( array( 'control' => 'sinatra_single_post_elements_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Single Post typography heading. $options['setting']['sinatra_typography_single_post_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Typography', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', ), ); // Single post content font size. $options['setting']['sinatra_single_content_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Post Content Font Size', 'sinatra' ), 'description' => esc_html__( 'Choose your single post content font size.', 'sinatra' ), 'section' => 'sinatra_section_blog_single_post', 'responsive' => true, 'unit' => array( array( 'id' => 'px', 'name' => 'px', 'min' => 8, 'max' => 30, 'step' => 1, ), array( 'id' => 'em', 'name' => 'em', 'min' => 0.5, 'max' => 1.875, 'step' => 0.01, ), array( 'id' => 'rem', 'name' => 'rem', 'min' => 0.5, 'max' => 1.875, 'step' => 0.01, ), ), 'required' => array( array( 'control' => 'sinatra_typography_single_post_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Single_Post(); customizer/settings/class-sinatra-customizer-sticky-header.php000064400000003017151231536710021026 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Sticky_Header' ) ) : /** * Sinatra Sticky Header section in Customizer. */ class Sinatra_Customizer_Sticky_Header { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Sticky Header Section. $options['section']['sinatra_section_sticky_header'] = array( 'title' => esc_html__( 'Sticky Header', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 80, ); // Enable Transparent Header. $options['setting']['sinatra_sticky_header'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Sticky Header', 'sinatra' ), 'section' => 'sinatra_section_sticky_header', ), ); return $options; } } endif; new Sinatra_Customizer_Sticky_Header(); customizer/settings/class-sinatra-customizer-top-bar.php000064400000024204151231536710017637 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Top_Bar' ) ) : /** * Sinatra Top Bar Settings section in Customizer. */ class Sinatra_Customizer_Top_Bar { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_top_bar'] = array( 'title' => esc_html__( 'Top Bar', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 10, ); // Enable Top Bar. $options['setting']['sinatra_top_bar_enable'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Top Bar', 'sinatra' ), 'description' => esc_html__( 'Top Bar is a section with widgets located above Main Header area.', 'sinatra' ), 'section' => 'sinatra_section_top_bar', ), ); // Top Bar container width. $options['setting']['sinatra_top_bar_container_width'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Top Bar Width', 'sinatra' ), 'description' => esc_html__( 'Stretch the Top Bar container to full width, or match your site’s content width.', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'choices' => array( 'content-width' => esc_html__( 'Content Width', 'sinatra' ), 'full-width' => esc_html__( 'Full Width', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar visibility. $options['setting']['sinatra_top_bar_visibility'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Device Visibility', 'sinatra' ), 'description' => esc_html__( 'Devices where the Top Bar is displayed.', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'choices' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar widgets heading. $options['setting']['sinatra_top_bar_heading_widgets'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Top Bar Widgets', 'sinatra' ), 'description' => esc_html__( 'Click the Add Widget button to add available widgets to your Top Bar.', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar widgets. $options['setting']['sinatra_top_bar_widgets'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_widget', 'control' => array( 'type' => 'sinatra-widget', 'label' => esc_html__( 'Top Bar Widgets', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'widgets' => array( 'text' => array( 'max_uses' => 3, ), 'nav' => array( 'max_uses' => 1, ), 'socials' => array( 'max_uses' => 1, 'styles' => array( 'minimal' => esc_html__( 'Minimal', 'sinatra' ), 'rounded' => esc_html__( 'Rounded', 'sinatra' ), ), ), ), 'locations' => array( 'left' => esc_html__( 'Left', 'sinatra' ), 'right' => esc_html__( 'Right', 'sinatra' ), ), 'visibility' => array( 'all' => esc_html__( 'Show on All Devices', 'sinatra' ), 'hide-mobile' => esc_html__( 'Hide on Mobile', 'sinatra' ), 'hide-tablet' => esc_html__( 'Hide on Tablet', 'sinatra' ), 'hide-mobile-tablet' => esc_html__( 'Hide on Mobile and Tablet', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_heading_widgets', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '#sinatra-topbar', 'render_callback' => 'sinatra_topbar_output', 'container_inclusive' => true, 'fallback_refresh' => true, ), ); // Top Bar widget separator. $options['setting']['sinatra_top_bar_widgets_separator'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_select', 'control' => array( 'type' => 'sinatra-select', 'label' => esc_html__( 'Widgets Separator', 'sinatra' ), 'description' => esc_html__( 'Display a separator line between widgets.', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'choices' => array( 'none' => esc_html__( 'None', 'sinatra' ), 'regular' => esc_html__( 'Regular', 'sinatra' ), 'slanted' => esc_html__( 'Slanted', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_heading_widgets', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar design options heading. $options['setting']['sinatra_top_bar_heading_design_options'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Design Options', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar Background. $options['setting']['sinatra_top_bar_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Background', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), 'gradient' => esc_html__( 'Gradient', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_top_bar_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar Text Color. $options['setting']['sinatra_top_bar_text_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_top_bar_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); // Top Bar Border. $options['setting']['sinatra_top_bar_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'label' => esc_html__( 'Border', 'sinatra' ), 'section' => 'sinatra_section_top_bar', 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), 'separator' => esc_html__( 'Separator Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_top_bar_enable', 'value' => true, 'operator' => '==', ), array( 'control' => 'sinatra_top_bar_heading_design_options', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Top_Bar(); customizer/settings/class-sinatra-customizer-transparent-header.php000064400000024731151231536710022067 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Transparent_Header' ) ) : /** * Sinatra Main Transparent section in Customizer. */ class Sinatra_Customizer_Transparent_Header { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Transparent Header Section. $options['section']['sinatra_section_transparent_header'] = array( 'title' => esc_html__( 'Transparent Header', 'sinatra' ), 'panel' => 'sinatra_panel_header', 'priority' => 80, ); // Enable Transparent Header. $options['setting']['sinatra_tsp_header'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Enable Globally', 'sinatra' ), 'section' => 'sinatra_section_transparent_header', ), ); // Disable choices. $disable_choices = array( '404' => array( 'title' => esc_html__( '404 page', 'sinatra' ), ), 'posts_page' => array( 'title' => esc_html__( 'Blog / Posts page', 'sinatra' ), ), 'archive' => array( 'title' => esc_html__( 'Archive pages', 'sinatra' ), ), 'search' => array( 'title' => esc_html__( 'Search pages', 'sinatra' ), ), 'post' => array( 'title' => esc_html__( 'Posts', 'sinatra' ), ), 'page' => array( 'title' => esc_html__( 'Pages', 'sinatra' ), ), ); // Get additionally registered post types. $post_types = get_post_types( array( 'public' => true, '_builtin' => false, ), 'objects' ); if ( is_array( $post_types ) && ! empty( $post_types ) ) { foreach ( $post_types as $slug => $post_type ) { $disable_choices[ $slug ] = array( 'title' => $post_type->label, ); } } // Transparent header display on. $options['setting']['sinatra_tsp_header_disable_on'] = array( 'transport' => 'refresh', 'sanitize_callback' => 'sinatra_no_sanitize', 'control' => array( 'type' => 'sinatra-checkbox-group', 'label' => esc_html__( 'Disable On: ', 'sinatra' ), 'description' => esc_html__( 'Choose on which pages you want to disable Transparent Header. ', 'sinatra' ), 'section' => 'sinatra_section_transparent_header', 'choices' => $disable_choices, 'required' => array( array( 'control' => 'sinatra_tsp_header', 'value' => true, 'operator' => '==', ), ), ), ); // Logo Settings Heading. $options['setting']['sinatra_tsp_logo_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Logo Settings', 'sinatra' ), 'section' => 'sinatra_section_transparent_header', ), ); // Logo. $options['setting']['sinatra_tsp_logo'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_background', 'control' => array( 'type' => 'sinatra-background', 'section' => 'sinatra_section_transparent_header', 'label' => esc_html__( 'Alternative Logo', 'sinatra' ), 'description' => esc_html__( 'Upload a different logo to be used with Transparent Header.', 'sinatra' ), 'advanced' => false, 'strings' => array( 'select_image' => __( 'Select logo', 'sinatra' ), 'use_image' => __( 'Select', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_tsp_logo_heading', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '.sinatra-logo', 'render_callback' => 'sinatra_logo', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Logo Retina. $options['setting']['sinatra_tsp_logo_retina'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_background', 'control' => array( 'type' => 'sinatra-background', 'section' => 'sinatra_section_transparent_header', 'label' => esc_html__( 'Alternative Logo - Retina', 'sinatra' ), 'description' => esc_html__( 'Upload exactly 2x the size of your alternative logo to make your logo crisp on HiDPI screens. This options is not required if logo above is in SVG format.', 'sinatra' ), 'advanced' => false, 'strings' => array( 'select_image' => __( 'Select logo', 'sinatra' ), 'use_image' => __( 'Select', 'sinatra' ), ), 'required' => array( array( 'control' => 'sinatra_tsp_logo_heading', 'value' => true, 'operator' => '==', ), ), ), 'partial' => array( 'selector' => '.sinatra-logo', 'render_callback' => 'sinatra_logo', 'container_inclusive' => false, 'fallback_refresh' => true, ), ); // Logo Max Height. $options['setting']['sinatra_tsp_logo_max_height'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Logo Height', 'sinatra' ), 'description' => esc_html__( 'Maximum logo image height on transparent header.', 'sinatra' ), 'section' => 'sinatra_section_transparent_header', 'min' => 0, 'max' => 1000, 'step' => 10, 'unit' => 'px', 'responsive' => true, 'required' => array( array( 'control' => 'sinatra_tsp_logo_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Logo margin. $options['setting']['sinatra_tsp_logo_margin'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-spacing', 'label' => esc_html__( 'Logo Margin', 'sinatra' ), 'description' => esc_html__( 'Specify spacing around logo on transparent header. Negative values are allowed. Leave empty to inherit from Logos & Site Title » Logo Margin.', 'sinatra' ), 'section' => 'sinatra_section_transparent_header', 'choices' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'right' => esc_html__( 'Right', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), 'left' => esc_html__( 'Left', 'sinatra' ), ), 'responsive' => true, 'unit' => array( 'px', ), 'required' => array( array( 'control' => 'sinatra_tsp_logo_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Custom Colors Heading. $options['setting']['sinatra_tsp_colors_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Main Header Colors', 'sinatra' ), 'section' => 'sinatra_section_transparent_header', ), ); // Background. $options['setting']['sinatra_tsp_header_background'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'section' => 'sinatra_section_transparent_header', 'label' => esc_html__( 'Background', 'sinatra' ), 'space' => true, 'display' => array( 'background' => array( 'color' => esc_html__( 'Solid Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_tsp_colors_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Text Color. $options['setting']['sinatra_tsp_header_font_color'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'section' => 'sinatra_section_transparent_header', 'label' => esc_html__( 'Font Color', 'sinatra' ), 'space' => true, 'display' => array( 'color' => array( 'text-color' => esc_html__( 'Text Color', 'sinatra' ), 'link-color' => esc_html__( 'Link Color', 'sinatra' ), 'link-hover-color' => esc_html__( 'Link Hover Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_tsp_colors_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Border. $options['setting']['sinatra_tsp_header_border'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_design_options', 'control' => array( 'type' => 'sinatra-design-options', 'section' => 'sinatra_section_transparent_header', 'label' => esc_html__( 'Border', 'sinatra' ), 'space' => true, 'display' => array( 'border' => array( 'style' => esc_html__( 'Style', 'sinatra' ), 'color' => esc_html__( 'Color', 'sinatra' ), 'width' => esc_html__( 'Width (px)', 'sinatra' ), 'positions' => array( 'top' => esc_html__( 'Top', 'sinatra' ), 'bottom' => esc_html__( 'Bottom', 'sinatra' ), ), 'separator' => esc_html__( 'Separator Color', 'sinatra' ), ), ), 'required' => array( array( 'control' => 'sinatra_tsp_colors_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Transparent_Header(); customizer/settings/class-sinatra-customizer-typography.php000064400000015027151231536710020504 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Typography' ) ) : /** * Sinatra Typography section in Customizer. */ class Sinatra_Customizer_Typography { /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { /** * Registers our custom options in Customizer. */ add_filter( 'sinatra_customizer_options', array( $this, 'register_options' ) ); } /** * Registers our custom options in Customizer. * * @since 1.0.0 * @param array $options Array of customizer options. */ public function register_options( $options ) { // Section. $options['section']['sinatra_section_typography'] = array( 'title' => esc_html__( 'Base Typography', 'sinatra' ), 'panel' => 'sinatra_panel_general', 'priority' => 30, ); // HTML base font size. $options['setting']['sinatra_html_base_font_size'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_responsive', 'control' => array( 'type' => 'sinatra-range', 'label' => esc_html__( 'Base Font Size', 'sinatra' ), 'description' => esc_html__( 'REM base of the root (html) element.', 'sinatra' ), 'section' => 'sinatra_section_typography', 'min' => 8, 'max' => 30, 'step' => 1, 'unit' => 'px', 'responsive' => true, ), ); // Anti-Aliased Font Smoothing. $options['setting']['sinatra_font_smoothing'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-toggle', 'label' => esc_html__( 'Font Smoothing', 'sinatra' ), 'description' => esc_html__( 'Enable/Disable anti-aliasing font smoothing.', 'sinatra' ), 'section' => 'sinatra_section_typography', ), ); // Headings typography heading. $options['setting']['sinatra_typography_body_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Body & Content', 'sinatra' ), 'section' => 'sinatra_section_typography', ), ); // Body Font. $options['setting']['sinatra_body_font'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', 'label' => esc_html__( 'Body Typography', 'sinatra' ), 'section' => 'sinatra_section_typography', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'font-style' => array(), 'text-transform' => array(), 'text-decoration' => array(), 'letter-spacing' => array(), 'font-size' => array(), 'line-height' => array(), ), 'required' => array( array( 'control' => 'sinatra_typography_body_heading', 'value' => true, 'operator' => '==', ), ), ), ); // Headings typography heading. $options['setting']['sinatra_typography_headings_heading'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_toggle', 'control' => array( 'type' => 'sinatra-heading', 'label' => esc_html__( 'Headings (H1 - H6)', 'sinatra' ), 'section' => 'sinatra_section_typography', ), ); // Headings default. $options['setting']['sinatra_headings_font'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', 'label' => esc_html__( 'Headings Default', 'sinatra' ), 'section' => 'sinatra_section_typography', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'font-style' => array(), 'text-transform' => array(), ), 'required' => array( array( 'control' => 'sinatra_typography_headings_heading', 'value' => true, 'operator' => '==', ), ), ), ); for ( $i = 1; $i <= 6; $i++ ) { $options['setting'][ 'sinatra_h' . $i . '_font' ] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', /* translators: %s Heading size */ 'label' => esc_html( sprintf( __( 'H%s', 'sinatra' ), $i ) ), 'section' => 'sinatra_section_typography', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'font-style' => array(), 'text-transform' => array(), 'text-decoration' => array(), 'letter-spacing' => array(), 'font-size' => array(), 'line-height' => array(), ), 'required' => array( array( 'control' => 'sinatra_typography_headings_heading', 'value' => true, 'operator' => '==', ), ), ), ); } $options['setting']['sinatra_heading_em_font'] = array( 'transport' => 'postMessage', 'sanitize_callback' => 'sinatra_sanitize_typography', 'control' => array( 'type' => 'sinatra-typography', 'label' => esc_html__( 'Heading Emphasized Text', 'sinatra' ), 'description' => esc_html__( 'Adds a separate font for styling of ‹em› tags, so you can create stylish typographic elements.', 'sinatra' ), 'section' => 'sinatra_section_typography', 'display' => array( 'font-family' => array(), 'font-subsets' => array(), 'font-weight' => array(), 'font-style' => array(), 'text-transform' => array(), 'text-decoration' => array(), 'letter-spacing' => array(), ), 'required' => array( array( 'control' => 'sinatra_typography_headings_heading', 'value' => true, 'operator' => '==', ), ), ), ); return $options; } } endif; new Sinatra_Customizer_Typography(); customizer/settings/index.php000064400000000250151231536710012431 0ustar00 * @since 1.0.0 */ /* Silence is golden, and we agree. */ customizer/widgets/class-sinatra-customizer-widget-button.php000064400000013751151231536710020702 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget_Button' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget_Button extends Sinatra_Customizer_Widget { /** * Menu Location for this widget * * @since 1.0.0 * @var string */ public $styles = array(); /** * Primary class constructor. * * @since 1.0.0 * @param array $args An array of the values for this widget. */ public function __construct( $args = array() ) { $values = array( 'text' => '', 'url' => '', 'target' => '_self', 'class' => '', 'style' => '', 'visibility' => 'all', ); $args['values'] = isset( $args['values'] ) ? wp_parse_args( $args['values'], $values ) : $values; $args['values']['text'] = wp_kses( $args['values']['text'], sinatra_get_allowed_html_tags() ); $args['values']['url'] = esc_url_raw( $args['values']['url'] ); $args['values']['target'] = sanitize_text_field( $args['values']['target'] ); $args['values']['class'] = sanitize_text_field( $args['values']['class'] ); $args['values']['style'] = sanitize_text_field( $args['values']['style'] ); $args['values']['visibility'] = isset( $args['values']['visibility'] ) ? sanitize_text_field( $args['values']['visibility'] ) : 'hide-mobile-tablet'; parent::__construct( $args ); $this->name = __( 'Button', 'sinatra' ); $this->description = __( 'A button with custom link.', 'sinatra' ); $this->icon = 'dashicons dashicons-admin-links'; $this->type = 'button'; $this->styles = isset( $args['styles'] ) ? $args['styles'] : array(); } /** * Displays the form for this widget on the Widgets page of the WP Admin area. * * @since 1.0.0 * @return void */ public function form() { ?>

          values['target'], true ); ?> data-option-name="target"> values['target'], true ); ?> data-option-name="target">

          styles ) ) { ?>

          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget_Nav' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget_Nav extends Sinatra_Customizer_Widget { /** * Primary class constructor. * * @since 1.0.0 * @param array $args An array of the values for this widget. */ public function __construct( $args = array() ) { $values = array( 'menu' => '', 'visibility' => 'all', ); $args['values'] = isset( $args['values'] ) ? wp_parse_args( $args['values'], $values ) : $values; parent::__construct( $args ); $this->name = __( 'Navigation', 'sinatra' ); $this->description = __( 'Add a navigation menu.', 'sinatra' ); $this->icon = 'dashicons dashicons-menu'; $this->type = 'nav'; } /** * Displays the form for this widget on the Widgets page of the WP Admin area. * * @since 1.0.0 * @return void */ public function form() { $menus = wp_get_nav_menus(); $has_menu_class = ! empty( $menus ) ? 'sinatra-widget-nav-has-menu' : ''; ?>

          ', '' ); ?>

          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget_Search' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget_Search extends Sinatra_Customizer_Widget { /** * Menu Location for this widget * * @since 1.0.0 * @var string */ public $styles = array(); /** * Primary class constructor. * * @since 1.0.0 * @param array $args An array of the values for this widget. */ public function __construct( $args = array() ) { $values = array( 'style' => '', 'visibility' => 'all', ); $args['values'] = isset( $args['values'] ) ? wp_parse_args( $args['values'], $values ) : $values; $args['values']['style'] = sanitize_text_field( $args['values']['style'] ); parent::__construct( $args ); $this->name = __( 'Search', 'sinatra' ); $this->description = __( 'A search form for your site.', 'sinatra' ); $this->icon = 'dashicons dashicons-search'; $this->type = 'search'; $this->styles = isset( $args['styles'] ) ? $args['styles'] : array(); } /** * Displays the form for this widget on the Widgets page of the WP Admin area. * * @since 1.0.0 * @return void */ public function form() { if ( ! empty( $this->styles ) ) { ?>

          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget_Socials' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget_Socials extends Sinatra_Customizer_Widget_Nav { /** * Primary class constructor. * * @since 1.0.0 * @param array $args An array of the values for this widget. */ public function __construct( $args = array() ) { $values = array( 'style' => '', 'visibility' => 'all', ); $args['values'] = isset( $args['values'] ) ? wp_parse_args( $args['values'], $values ) : $values; $args['values']['style'] = sanitize_text_field( $args['values']['style'] ); parent::__construct( $args ); $this->name = __( 'Social Links', 'sinatra' ); $this->description = __( 'Links to your social media profiles.', 'sinatra' ); $this->icon = 'dashicons dashicons-twitter'; $this->type = 'socials'; $this->styles = isset( $args['styles'] ) ? $args['styles'] : array(); } /** * Displays the form for this widget on the Widgets page of the WP Admin area. * * @since 1.0.0 * @return void */ public function form() { parent::form(); if ( ! empty( $this->styles ) ) { ?>

          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget_Text' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget_Text extends Sinatra_Customizer_Widget { /** * Primary class constructor. * * @since 1.0.0 * @param array $args An array of the values for this widget. */ public function __construct( $args = array() ) { $args['name'] = __( 'Text', 'sinatra' ); $args['description'] = __( 'Arbitrary text.', 'sinatra' ); $args['icon'] = 'dashicons dashicons-text'; $args['type'] = 'text'; $values = array( 'content' => esc_html__( 'Text widget content goes here...', 'sinatra' ), 'visibility' => 'all', ); $args['values'] = isset( $args['values'] ) ? wp_parse_args( $args['values'], $values ) : $values; $args['values']['content'] = wp_kses( $args['values']['content'], sinatra_get_allowed_html_tags() ); parent::__construct( $args ); } /** * Displays the form for this widget on the Widgets page of the WP Admin area. * * @since 1.0.0 * @return void */ public function form() { ?>

          ', '' ) ); ?>

          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Sinatra_Customizer_Widget' ) ) : /** * Sinatra Customizer widget class */ class Sinatra_Customizer_Widget { /** * Root ID for all widgets of this type. * * @since 1.0.0 * @var mixed|string */ public $id_base; /** * Unique ID string of the current instance (id_base-number). * * @since 1.0.0 * @var bool|string */ public $id; /** * Name for this widget type. * * @since 1.0.0 * @var string */ public $name; /** * Icon for this widget type. * * @since 1.0.0 * @var string */ public $icon; /** * Type of widget. Shortened for id_base. * * @since 1.0.0 * @var bool|string */ public $type; /** * Description for this widget type. * * @since 1.0.0 * @var string */ public $description; /** * Option name for this widget type. * * @since 1.0. * @var string */ public $option_name; /** * Option name for this widget type. * * @since 1.0.0 * @var string */ public $values; /** * Unique ID number of the current instance. * * @since 1.0.0 * @var bool|int */ public $number = false; /** * Array of locations for widgets. * * @var array */ public $locations = array(); /** * Array of locations for widgets. * * @var array */ public $visibility = array(); /** * Primary class constructor. * * @since 1.0.0 * @param array $args Array with widget information. */ public function __construct( $args = array() ) { $this->id_base = isset( $args['id_base'] ) ? strtolower( $args['id_base'] ) : strtolower( get_class( $this ) ); $this->name = isset( $args['name'] ) ? $args['name'] : get_class( $this ); $this->description = isset( $args['description'] ) ? $args['description'] : ''; $this->id = isset( $args['id'] ) ? $this->id_base . '_' . $args['id'] : $this->id_base; $this->icon = isset( $args['icon'] ) ? $args['icon'] : 'dashicons dashicons-plus'; $this->option_name = 'sinatra_customizer_widget_' . $this->id_base; $this->values = isset( $args['values'] ) ? $args['values'] : array(); $this->number = isset( $args['number'] ) ? intval( $args['number'] ) : '__i__'; $this->type = isset( $args['type'] ) ? $args['type'] : ''; $this->locations = isset( $args['locations'] ) ? $args['locations'] : array(); $this->visibility = isset( $args['visibility'] ) ? $args['visibility'] : array(); } /** * Displays the form fields for this widget. * * @since 1.0.0 * @return void */ public function form() {} /** * Displays the complete widget control. * * @since 1.0.0 * @return void */ public function template() { ?>

          name ); ?>

          form(); ?> locations ) && is_array( $this->locations ) && ! empty( $this->locations ) ) { ?> values['location'] ) ? $this->values['location'] : key( $this->locations ); ?>

          locations as $id => $name ) { ?> data-option-name="location">

          visibility ) && is_array( $this->visibility ) && ! empty( $this->visibility ) ) { ?> values['visibility'] ) ? $this->values['visibility'] : key( array_reverse( $this->visibility ) ); ?>

          |

          description ) ) { ?>
          description ); ?>
          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Returns current page URL. * * @since 1.0.0 * @return string, current page URL. */ function sinatra_current_url() { global $wp; return home_url( add_query_arg( array(), $wp->request ) ); } /** * Returns site URL. * * @since 1.0.0 * @return string, current page URL. */ function sinatra_get_site_url() { return apply_filters( 'sinatra_site_url', home_url( '/' ) ); } /** * Returns site title. * * @since 1.0.0 * @return string, current page URL. */ function sinatra_get_site_title() { return apply_filters( 'sinatra_site_title', get_bloginfo( 'name' ) ); } /** * Returns site description. * * @since 1.0.0 * @return string, current page URL. */ function sinatra_get_site_description() { return apply_filters( 'sinatra_site_description', get_bloginfo( 'description' ) ); } if ( ! function_exists( 'sinatra_the_title' ) ) { /** * Wrapper function for sinatra_get_the_title(). * * @since 1.0.0 * @param string $before Optional. Content to prepend to the title. * @param string $after Optional. Content to append to the title. * @param int $post_id Optional, default to 0. Post id. * @param bool $echo Optional, default to true. Whether to display or return. * @return string|void String if $echo parameter is false. */ function sinatra_the_title( $before = '', $after = '', $post_id = 0, $echo = true ) { $title = sinatra_get_the_title( $post_id ); $before = apply_filters( 'sinatra_the_title_before', $before ); $after = apply_filters( 'sinatra_the_title_after', $after ); $title = $before . $title . $after; if ( $echo ) { echo wp_kses( $title, sinatra_get_allowed_html_tags() ); } else { return $title; } } } if ( ! function_exists( 'sinatra_get_the_title' ) ) { /** * Get page title. Adds support for non-singular pages. * * @since 1.0.0 * @param int $post_id Optional, default to 0. Post id. * @param bool $echo Optional, default to false. Whether to display or return. * @return string|void String if $echo parameter is false. */ function sinatra_get_the_title( $post_id = 0, $echo = false ) { $title = ''; if ( $post_id || is_singular() ) { $title = get_the_title( $post_id ); if ( function_exists( 'yith_wcwl_is_wishlist_page' ) && yith_wcwl_is_wishlist_page() ) { // Retireve wishlist title. $wishlist_title = get_option( 'yith_wcwl_wishlist_title' ) ? get_option( 'yith_wcwl_wishlist_title' ) : __( 'Wishlist', 'sinatra' ); // Yith wishlist title. $title = apply_filters( 'sinatra_yith_wishlist_title', esc_html( $wishlist_title ) ); } } else { if ( is_front_page() && is_home() ) { // Homepage. $title = apply_filters( 'sinatra_home_page_title', esc_html__( 'Home', 'sinatra' ) ); } elseif ( is_home() ) { // Blog page. $title = apply_filters( 'sinatra_blog_page_title', get_the_title( get_option( 'page_for_posts', true ) ) ); } elseif ( is_404() ) { // 404 page - title always display. $title = apply_filters( 'sinatra_404_page_title', esc_html__( 'This page doesn’t seem to exist.', 'sinatra' ) ); } elseif ( is_search() ) { // Search page - title always display. /* translators: 1: search string */ $title = apply_filters( 'sinatra_search_page_title', sprintf( __( 'Search results for: %s', 'sinatra' ), get_search_query() ) ); } elseif ( class_exists( 'WooCommerce' ) && is_shop() ) { // Woocommerce. $title = woocommerce_page_title( false ); } elseif ( is_author() ) { // Author post archive. $title = apply_filters( 'sinatra_author_page_title', esc_html__( 'Posts by', 'sinatra' ) . ' ' . esc_html( get_the_author() ) ); } elseif ( is_category() || is_tag() || is_tax() ) { // Category, tag and custom taxonomy archive. $title = single_term_title( '', false ); } elseif ( is_archive() ) { // Archive. $title = get_the_archive_title(); } } if ( $echo ) { echo wp_kses( $title, sinatra_get_allowed_html_tags() ); } else { return $title; } } } if ( ! function_exists( 'sinatra_get_the_id' ) ) { /** * Get post ID. * * @since 1.0.0 * @return string Current post/page ID. */ function sinatra_get_the_id() { $post_id = 0; if ( is_home() && 'page' === get_option( 'show_on_front' ) ) { $post_id = get_option( 'page_for_posts' ); } elseif ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) { $post_id = get_option( 'page_on_front' ); } elseif ( is_singular() ) { $post_id = get_the_ID(); } return apply_filters( 'sinatra_get_the_id', $post_id ); } } if ( ! function_exists( 'sinatra_get_the_description' ) ) { /** * Get page description. Adds support for non-singular pages. * * @since 1.0.0 * @param int $post_id Optional, default to 0. Post id. * @param bool $echo Optional, default to false. Whether to display or return. * @return string|void String if $echo parameter is false. */ function sinatra_get_the_description( $post_id = 0, $echo = false ) { $description = ''; if ( $post_id ) { // @todo: take from meta.. $description = get_the_excerpt( $post_id ); } elseif ( is_search() ) { global $wp_query; $found_posts = $wp_query->found_posts; if ( $found_posts > 0 ) { // Translators: $s number of found results. $description = sprintf( _n( '%s result found', '%s results found', $found_posts, 'sinatra' ), number_format_i18n( $found_posts ) ); } else { $description = esc_html__( 'No results found', 'sinatra' ); } } elseif ( is_author() ) { $description = ''; } else { $description = get_the_archive_description(); } if ( $echo ) { echo esc_html( $description ); } else { return $description; } } } /** * Checks to see if we're on the homepage or not. * * @since 1.0.0 * @return boolean, if current page is front page. */ function sinatra_is_frontpage() { return ( is_front_page() && ! is_home() ); } /** * Check if schema is enabled. * * @since 1.0.0 * @return boolean */ function sinatra_is_schema_enabled() { $enabled = sinatra_option( 'enable_schema' ); return apply_filters( 'sinatra_is_schema_enabled', $enabled ); } /** * Check if a custom logo has been uploaded. * * @since 1.0.0 * @return boolean */ function sinatra_has_logo() { if ( has_custom_logo() ) { return true; } return false; } /** * Get sidebar name. * * @since 1.0.0 * @return string|boolean */ function sinatra_get_sidebar() { $sidebar = 'sinatra-sidebar'; $sidebar = apply_filters( 'sinatra_sidebar_name', $sidebar ); if ( ! is_active_sidebar( $sidebar ) && ! current_user_can( 'edit_theme_options' ) ) { return false; } return $sidebar; } /** * Get site layout (content layout) position. * * @since 1.0.0 * @param object|int|null $post Optional. The post to check. If not supplied, defaults to the current post if used in the loop. * @return string, site layout. */ function sinatra_get_site_layout( $post = null ) { // Default site layout from Customizer. $default_site_layout = apply_filters( 'sinatra_default_site_layout', sinatra_option( 'site_layout' ), $post ); $site_layout = $default_site_layout; $post = is_null( $post ) ? sinatra_get_the_id() : $post; if ( $post ) { $post = get_post( $post ); // Singular pages have meta settings for content layout. if ( ! empty( $post ) ) { $site_layout = get_post_meta( $post->ID, 'sinatra_content_layout', true ); if ( empty( $site_layout ) ) { $site_layout = $default_site_layout; } } } return apply_filters( 'sinatra_site_layout', $site_layout ); } /** * Get sidebar layout position. * * @since 1.0.0 * @param object|int|null $post Optional. The post to check. If not supplied, defaults to the current post if used in the loop. * @return string, Sidebar layout position. */ function sinatra_get_sidebar_position( $post = null ) { // Default sidebar position. if ( is_singular( 'post' ) ) { $default_sidebar_position = sinatra_option( 'single_post_sidebar_position' ); } elseif ( is_singular( 'page' ) ) { $default_sidebar_position = sinatra_option( 'single_page_sidebar_position' ); } elseif ( is_archive() || is_search() ) { $default_sidebar_position = sinatra_option( 'archive_sidebar_position' ); } else { $default_sidebar_position = sinatra_option( 'sidebar_position' ); } if ( empty( $default_sidebar_position ) || 'default' === $default_sidebar_position ) { $default_sidebar_position = sinatra_option( 'sidebar_position' ); } $post = is_null( $post ) ? sinatra_get_the_id() : $post; $default_sidebar_position = apply_filters( 'sinatra_default_sidebar_position', $default_sidebar_position, $post ); $sidebar_position = $default_sidebar_position; // Get meta settings if page is set. if ( $post ) { $post = get_post( $post ); // Singular pages have meta settings for sidebar position. if ( ! empty( $post ) ) { $sidebar_position = get_post_meta( $post->ID, 'sinatra_sidebar_position', true ); if ( empty( $sidebar_position ) ) { $sidebar_position = $default_sidebar_position; } } } // Force no sidebar on 404 pages. if ( is_404() ) { $sidebar_position = 'no-sidebar'; } return apply_filters( 'sinatra_sidebar_position', $sidebar_position, $post ); } /** * Check if sidebar is displayed. * * @since 1.0.0 * @param int $post Optional. The post ID to check. If not supplied, defaults to the current post if used in the loop. * @return boolean Sidebar displayed. */ function sinatra_is_sidebar_displayed( $post = null ) { $position = sinatra_get_sidebar_position( $post ); $displayed = true; if ( 'no-sidebar' === $position || '' === $position || false === $position ) { $displayed = false; } if ( ! sinatra_get_sidebar() ) { $displayed = false; } return apply_filters( 'sinatra_is_sidebar_displayed', $displayed ); } /** * Check if sidebar is displayed. * * @since 1.0.0 * @return string Article feed layout slug. */ function sinatra_get_article_feed_layout() { $layout = ''; if ( is_home() || is_archive() || is_search() ) { $layout = sinatra_option( 'blog_layout' ); } return apply_filters( 'sinatra_article_feed_layout', $layout ); } /** * Get ordered array of single post page sections. * * @since 1.0.0 * @param int $post_id Optional. The post ID to check. If not supplied, defaults to the current post if used in the loop. * @return array, Section IDs for the single post layout. */ function sinatra_get_single_post_elements( $post_id = null ) { if ( ! $post_id ) { $post_id = get_the_ID(); } $post_format = get_post_format( $post_id ); $options = sinatra_get_page_elements( 'single_post_elements' ); $elements = array(); if ( 'quote' !== $post_format ) { $layout = sinatra_option( 'single_title_position' ); $layout = apply_filters( 'sinatra_single_title_position', $layout ); if ( 'in-content' === $layout ) { if ( in_array( 'category', $options, true ) ) { $elements[] = 'category'; } $elements[] = 'header'; $elements[] = 'meta'; if ( sinatra_show_post_thumbnail( $post_id ) && in_array( 'thumb', $options, true ) ) { $elements[] = 'thumbnail'; } } $elements[] = 'content'; $elements[] = 'content-footer'; } if ( in_array( 'about-author', $options, true ) ) { $elements[] = 'about-author'; } if ( in_array( 'prev-next-post', $options, true ) ) { $elements[] = 'prev-next-post'; } $elements = apply_filters( 'sinatra_single_content_elements', $elements ); return $elements; } /** * Check if single post element is displayed. * * @since 1.1.0 * @param string $element Element name. * @return boolean Element is enabled or not. */ function sinatra_single_post_displays( $element ) { $options = sinatra_get_page_elements( 'single_post_elements' ); return in_array( $element, $options, true ); } /** * Get ordered array of blog entry elements. * * @since 1.0.0 * @return array, Element IDs for the blog entry. */ function sinatra_get_blog_entry_elements() { $elements = sinatra_get_page_elements( 'blog_entry_elements' ); return apply_filters( 'sinatra_blog_entry_elements', $elements ); } /** * Get ordered array of page elements. * * @since 1.0.0 * @param string $id Customizer setting ID. * @param boolean $enabled_only Return only enabled/visible elements. * @return array $elements Array of element IDs for the blog entry. */ function sinatra_get_page_elements( $id, $enabled_only = true ) { $elements = sinatra_option( $id ); if ( empty( $elements ) ) { return array(); } if ( $enabled_only ) { return array_keys( $elements, true, true ); } return array_keys( $elements ); } /** * Get ordered array of meta elements. * * @since 1.0.0 * @param boolean $enabled_only Return only enabled/visible elements. * @return array $elements Element IDs for the blog entry. */ function sinatra_get_entry_meta_elements( $enabled_only = true ) { $elements = array(); if ( is_single() ) { $elements = sinatra_option( 'single_post_meta_elements' ); } else { $elements = sinatra_option( 'blog_entry_meta_elements' ); } if ( $enabled_only ) { $elements = array_keys( $elements, true, true ); } else { $elements = array_keys( $elements ); } return apply_filters( 'sinatra_entry_meta_elements', $elements ); } /** * Check if at least one entry meta element is enabled. * * @since 1.1.0 * @return boolean Has elements or not. */ function sinatra_has_entry_meta_elements() { $elements = sinatra_get_entry_meta_elements(); return ! empty( $elements ); } /** * Wrap comment submit button with span tag. * * @since 1.0.0 * @param string $submit_button Comment content. * @param array $args Button arguments. */ function sinatra_filter_comment_form_submit_button( $submit_button, $args ) { return '' . $submit_button . ''; // phpcs:ignore } add_filter( 'comment_form_submit_button', 'sinatra_filter_comment_form_submit_button', 10, 2 ); /** * Filter excerpt length. * * @since 1.0.0 * @param int $length Word count for excerpt. * @return int */ function sinatra_excerpt_length( $length ) { return intval( sinatra_option( 'excerpt_length' ) ); } add_filter( 'excerpt_length', 'sinatra_excerpt_length' ); /** * Filter excerpt more. * * @since 1.0.0 * @param string $more More indicator excerpt. * @return string */ function sinatra_excerpt_more( $more ) { return sinatra_option( 'excerpt_more' ); } add_filter( 'excerpt_more', 'sinatra_excerpt_more' ); /** * Determines if post thumbnail can be displayed. * * @since 1.0.0 * @param int $post_id Optional. The post ID to check. If not supplied, defaults to the current post if used in the loop. * @return boolean, Thumbnail displayed. */ function sinatra_show_post_thumbnail( $post_id = null ) { $post_id = is_null( $post_id ) ? sinatra_get_the_id() : $post_id; $display = ! post_password_required( $post_id ) && ! is_attachment( $post_id ) && has_post_thumbnail( $post_id ); if ( get_post_meta( $post_id, 'sinatra_disable_thumbnail', true ) ) { $display = false; } return apply_filters( 'sinatra_show_post_thumbnail', $display ); } if ( ! function_exists( 'sinatra_get_video_from_post' ) ) : /** * Get video HTML markup from post content. * * @since 1.0.0 * @param number $post_id Post id. * @return mixed */ function sinatra_get_video_from_post( $post_id = null ) { $post = get_post( $post_id ); $content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); // phpcs:ignore $embeds = apply_filters( 'sinatra_get_post_video', get_media_embedded_in_content( $content ) ); if ( empty( $embeds ) ) { return ''; } // Return first embedded item that is a video format. foreach ( $embeds as $embed ) { if ( strpos( $embed, 'video' ) || strpos( $embed, 'youtube' ) || strpos( $embed, 'vimeo' ) ) { return $embed; } } } endif; if ( ! function_exists( 'sinatra_get_audio_from_post' ) ) : /** * Get video HTML markup from post content. * * @since 1.0.0 * @param number $post_id Post id. * @return mixed */ function sinatra_get_audio_from_post( $post_id = null ) { $post = get_post( $post_id ); $content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); // phpcs:ignore $embeds = apply_filters( 'sinatra_get_post_audio', get_media_embedded_in_content( $content ) ); if ( empty( $embeds ) ) { return ''; } // check what is the first embed containg video tag, youtube or vimeo. foreach ( $embeds as $embed ) { if ( strpos( $embed, 'audio' ) || strpos( $embed, 'soundcloud' ) ) { return '' . $embed . ''; } } } endif; if ( ! function_exists( 'sinatra_get_post_gallery' ) ) : /** * A get_post_gallery() polyfill for Gutenberg. * * @since 1.0.0 * @param object|int|null $post Optional. The post to check. If not supplied, defaults to the current post if used in the loop. * @param boolean $html Return gallery HTML or array of gallery items. * @return string|array The gallery html or array of gallery items. */ function sinatra_get_post_gallery( $post = 0, $html = false ) { // Get gallery shortcode. $gallery = get_post_gallery( $post, $html ); // Already found a gallery so lets quit. if ( $gallery ) { return $gallery; } // Check the post exists. $post = get_post( $post ); if ( ! $post ) { return; } // Not using Gutenberg so let's quit. if ( ! function_exists( 'has_blocks' ) ) { return; } // Not using blocks so let's quit. if ( ! has_blocks( $post->post_content ) ) { return; } /** * Search for gallery blocks and then, if found, return the * first gallery block. */ $pattern = '/([\s\S]*?)/i'; preg_match_all( $pattern, $post->post_content, $the_galleries ); // Check a gallery was found and if so change the gallery html. if ( ! empty( $the_galleries[1] ) ) { $gallery_html = reset( $the_galleries[1] ); if ( $html ) { $gallery = $gallery_html; } else { $srcs = array(); $ids = array(); preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery_html, $src, PREG_SET_ORDER ); if ( ! empty( $src ) ) { foreach ( $src as $s ) { $srcs[] = $s[2]; } } preg_match_all( '#data-id=([\'"])(.+?)\1#is', $gallery_html, $id, PREG_SET_ORDER ); if ( ! empty( $id ) ) { foreach ( $id as $i ) { $ids[] = $i[2]; } } $gallery = array( 'ids' => implode( ',', $ids ), 'src' => $srcs, ); } } return $gallery; } endif; if ( ! function_exists( 'sinatra_get_image_from_post' ) ) : /** * Get image HTML markup from post content. * * @since 1.0.0 * @param object|int|null $post Optional. The post to check. If not supplied, defaults to the current post if used in the loop. * @param boolean $html Return image HTML or array of image items. * @return mixed */ function sinatra_get_image_from_post( $post = null, $html = true ) { // Check the post exists. $post = get_post( $post ); if ( ! $post ) { return; } $attachment_id = null; // Using Blocks, check if wp:image exists. if ( function_exists( 'has_blocks' ) && has_blocks( $post->post_content ) ) { /** * Search for image blocks. */ $pattern = '//i'; preg_match( $pattern, $post->post_content, $the_images ); // Check if an image was found. if ( ! empty( $the_images[1] ) ) { $attachment_id = absint( $the_images[1] ); } } // Nothing found, check if images added through Add Media. if ( ! $attachment_id ) { /** * Search for img tags in the content. */ $pattern = '//'; preg_match( $pattern, $post->post_content, $the_images ); // Check if an image was found. if ( ! empty( $the_images[0] ) ) { $attachment_id = absint( $the_images[0] ); } } // Still nothing was found, check for attached images. if ( ! $attachment_id ) { $the_images = get_attached_media( 'image', $post->ID ); if ( ! empty( $the_images ) ) { $image = reset( $the_images ); $attachment_id = $image->ID; } } // Check if an image was found. if ( $attachment_id ) { if ( $html ) { $atts = array( 'alt' => get_the_title( $post->ID ), ); if ( sinatra_get_schema_markup( 'image' ) ) { $atts['itemprop'] = 'image'; } return wp_get_attachment_image( $attachment_id, 'full', false, $atts ); } else { return wp_get_attachment_url( $attachment_id ); } } return false; } endif; if ( ! function_exists( 'sinatra_get_post_thumbnail' ) ) : /** * Get post thumbnail markup. * * @since 1.0.0 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param string|array $size Optional. Image size to use. Accepts any valid image size, or * an array of width and height values in pixels (in that order). * Default 'post-thumbnail'. * @param boolean $caption Optional. Display image caption. * @return string The post thumbnail image tag. */ function sinatra_get_post_thumbnail( $post = null, $size = 'post-thumbnail', $caption = false ) { $attachment_id = get_post_thumbnail_id( $post ); $attachment_alt = trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) ); // phpcs:ignore $attachment_alt = empty( $attachment_alt ) ? get_the_title( $post ) : $attachment_alt; $atts = array( 'alt' => $attachment_alt, ); if ( sinatra_get_schema_markup( 'image' ) ) { $atts['itemprop'] = 'image'; } $size = apply_filters( 'sinatra_post_thumbnail_default_size', $size ); $atts = apply_filters( 'sinatra_post_thumbnail_default_size', $atts ); $html = get_the_post_thumbnail( $post, $size, $atts ); if ( $caption ) { $caption = wp_get_attachment_caption( $attachment_id ); if ( ! empty( $caption ) ) { $caption = '
          ' . wp_kses( $caption, sinatra_get_allowed_html_tags( 'button' ) ) . '
          '; } $html .= $caption; } return apply_filters( 'sinatra_post_thumbnail_html', $html, $post, $attachment_id, $size, $atts ); } endif; if ( ! function_exists( 'sinatra_entry_get_permalink' ) ) : /** * Get permalink for one post entry. * * @since 1.0.0 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return string */ function sinatra_entry_get_permalink( $post = null ) { $permalink = ''; if ( 'link' === get_post_format( $post ) ) { $permalink = get_url_in_content( get_the_content( $post ) ); } else { $permalink = get_permalink( $post ); } return apply_filters( 'sinatra_entry_permalink', $permalink ); } endif; /** * Determines breadcrumbs are displayed. * * @since 1.1.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, Breadcrumbs displayed. */ function sinatra_has_breadcrumbs( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $display = sinatra_option( 'breadcrumbs_enable' ); if ( $display && sinatra_is_section_disabled( sinatra_option( 'breadcrumbs_hide_on' ), $post_id ) ) { $display = false; } if ( $display && $post_id && get_post_meta( $post_id, 'sinatra_disable_breadcrumbs', true ) ) { $display = false; } return apply_filters( 'sinatra_has_breadcrumbs', $display, $post_id ); } /** * Determines if page header breadcrumbs are displayed. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, Breadcrumbs displayed. */ function sinatra_page_header_has_breadcrumbs( $post_id = 0 ) { return sinatra_has_breadcrumbs( $post_id ) && 'in-page-header' === sinatra_option( 'breadcrumbs_position' ); } /** * Determines if page header title & description are displayed. * * @since 1.0.0 * * @param int $post_id Optional. The post ID to check. * @return boolean, Title & description displayed. */ function sinatra_page_header_has_title( $post_id = 0 ) { if ( ! $post_id ) { $post_id = sinatra_get_the_id(); } $display = true; if ( is_singular( 'post' ) && ! in_array( sinatra_option( 'single_title_position' ), array( 'in-page-header' ), true ) ) { $display = false; } // Disabled in post meta settings. if ( get_post_meta( $post_id, 'sinatra_disable_page_title', true ) ) { $display = false; } // Finally, check if title string is empty. if ( $display ) { $title = apply_filters( 'sinatra_page_header_title', sinatra_get_the_title() ); if ( ! $title ) { $display = false; } } return apply_filters( 'sinatra_page_header_has_title', $display ); } /** * Determines if comments are displayed. * * @since 1.0.0 * @return boolean, true if comments are displayed. */ function sinatra_comments_displayed() { $display = true; /* * Return false if comments are closed and there are no comments already posted. */ if ( ! is_singular() || ( ! comments_open() && ! get_comments_number() ) || ! post_type_supports( get_post_type(), 'comments' ) ) { $display = false; } /* * If the current post is protected by a password and * the visitor has not yet entered the password we will * return early without loading the comments. */ if ( post_password_required() ) { return false; } return apply_filters( 'sinatra_display_comments', $display ); } /** * Determines if comments toggle is displayed. * * @since 1.0.0 * @return boolean, true if comments toggle is displayed. */ function sinatra_comments_toggle_displayed() { $return = sinatra_option( 'single_toggle_comments' ); return apply_filters( 'sinatra_display_comments_toggle', $return ); } /** * Add attributes to Masthead. * * @since 1.1.1 * @param array $atts Attributes array. * @param int $post_id Optional. The post ID to check. If not supplied, defaults to the current post if used in the loop. * @return void|string */ function sinatra_masthead_atts( $atts = array(), $post_id = '' ) { if ( is_single() && 'in-page-header' === sinatra_option( 'single_title_position' ) && sinatra_is_header_transparent( $post_id ) ) { if ( sinatra_show_post_thumbnail( $post_id ) && sinatra_single_post_displays( 'thumb' ) ) { $atts['style'] = isset( $atts['style'] ) ? $atts['style'] : ''; $atts['style'] .= 'background-image: url(' . wp_get_attachment_image_url( get_post_thumbnail_id( $post_id ), 'full' ) . ');'; } } $atts = apply_filters( 'sinatra_masthead_atts', $atts, $post_id ); if ( ! empty( $atts ) ) { $output = ''; foreach ( $atts as $att => $content ) { $output .= sanitize_title( $att ) . '="' . esc_attr( $content ) . '"'; } $output = empty( $output ) ? '' : ' ' . $output; print $output; // phpcs:ignore } } /** * Add classes to Header. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_header_classes( $classes = array() ) { // Optional wide header container. if ( 'full-width' === sinatra_option( 'header_container_width' ) ) { $classes[] = 'si-container__wide'; } $classes = apply_filters( 'sinatra_header_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Add classes to Top Bar. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_top_bar_classes( $classes = array() ) { // Optional wide top bar container. if ( 'full-width' === sinatra_option( 'top_bar_container_width' ) ) { $classes[] = 'si-container__wide'; } // Top Bar visibility. $top_bar_visibility = sinatra_option( 'top_bar_visibility' ); if ( 'all' !== $top_bar_visibility ) { $classes[] = 'sinatra-' . $top_bar_visibility; } $classes = apply_filters( 'sinatra_top_bar_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Add classes to Page Header. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_page_header_classes( $classes = array() ) { $classes[] = 'page-header'; // Background image. if ( is_single() && 'in-page-header' === sinatra_option( 'single_title_position' ) ) { $classes[] = 'si-page-title-has-bg-img'; } if ( sinatra_page_header_has_title() ) { $classes[] = 'si-has-page-title'; } if ( sinatra_page_header_has_breadcrumbs() ) { $classes[] = 'si-has-breadcrumbs'; } $classes = apply_filters( 'sinatra_page_header_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Add attributes to Page Header. * * @since 1.0.0 * @param array $atts Array of additional attributes. * @param int $post_id Optional. The post ID to check. If not supplied, defaults to the current post if used in the loop. * @return void */ function sinatra_page_header_atts( $atts = array(), $post_id = '' ) { if ( is_single() && 'in-page-header' === sinatra_option( 'single_title_position' ) && ! sinatra_is_header_transparent( $post_id ) ) { if ( sinatra_show_post_thumbnail( $post_id ) && sinatra_single_post_displays( 'thumb' ) ) { $atts['style'] = isset( $atts['style'] ) ? $atts['style'] : ''; $atts['style'] .= 'background-image: url(' . wp_get_attachment_image_url( get_post_thumbnail_id( $post_id ), 'full' ) . ');'; } } $atts = apply_filters( 'sinatra_page_header_atts', $atts, $post_id ); if ( ! empty( $atts ) ) { $output = ''; foreach ( $atts as $att => $content ) { $output .= sanitize_title( $att ) . '="' . esc_attr( $content ) . '"'; } $output = empty( $output ) ? '' : ' ' . $output; print $output; // phpcs:ignore } } /** * Add classes to Hero. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_hero_classes( $classes = array() ) { // Hero visibility. $visibility = sinatra_option( 'hero_visibility' ); if ( 'all' !== $visibility ) { $classes[] = 'sinatra-' . $visibility; } $classes = apply_filters( 'sinatra_hero_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Add classes to Scroll Top Button. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_scroll_top_classes( $classes = array() ) { // Scroll Top visibility. $scroll_top_visibility = sinatra_option( 'scroll_top_visibility' ); if ( 'all' !== $scroll_top_visibility ) { $classes[] = 'sinatra-' . $scroll_top_visibility; } $classes = apply_filters( 'sinatra_scroll_top_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Add classes to Page Preloader. * * @since 1.0.0 * @return void */ function sinatra_preloader_classes() { $classes = array(); // Page Preloader visibility. $preloader_visibility = sinatra_option( 'preloader_visibility' ); if ( 'all' !== $preloader_visibility ) { $classes[] = 'sinatra-' . $preloader_visibility; } $classes = apply_filters( 'sinatra_preloader_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print ' class="' . esc_attr( $classes ) . '"'; } } /** * Add classes to Main Footer. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_footer_classes( $classes = array() ) { // Main Footer visibility. $footer_visibility = sinatra_option( 'footer_visibility' ); if ( 'all' !== $footer_visibility ) { $classes[] = 'sinatra-' . $footer_visibility; } $classes = apply_filters( 'sinatra_footer_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Get footer widgets column count. * * @since 1.0.0 * @return integer Number of footer columns */ function sinatra_get_footer_column_count() { $count = 4; return apply_filters( 'sinatra_footer_column_count', $count ); } /** * Get footer widgets column count. * * @since 1.0.0 * @param string $layout Footer layout. * @return array Classes array */ function sinatra_get_footer_column_class( $layout = 'layout-1' ) { $classes = array( 'layout-1' => array( 'col-xs-12 col-sm-6 stretch-xs col-md-3', 'col-xs-12 col-sm-6 stretch-xs col-md-3', 'col-xs-12 col-sm-6 stretch-xs col-md-3', 'col-xs-12 col-sm-6 stretch-xs col-md-3', ), 'layout-2' => array( 'col-xs-12 col-sm-6 stretch-xs col-md-4', 'col-xs-12 col-sm-6 stretch-xs col-md-4', 'col-xs-12 col-sm-6 stretch-xs col-md-4', ), 'layout-3' => array( 'col-xs-12 col-sm-6 stretch-xs col-md-8', 'col-xs-12 col-sm-6 stretch-xs col-md-4', ), 'layout-4' => array( 'col-xs-12 col-sm-6 stretch-xs col-md-4', 'col-xs-12 col-sm-6 stretch-xs col-md-8', ), ); $classes = apply_filters( 'sinatra_footer_column_classes', $classes, $layout ); $classes = isset( $classes[ $layout ] ) ? $classes[ $layout ] : array(); $align_center = sinatra_option( 'footer_widgets_align_center' ); if ( $align_center && ! empty( $classes ) ) { foreach ( $classes as $key => $column_class ) { $classes[ $key ] = $column_class . ' center-text'; } } return $classes; } /** * Add classes to Copyright bar. * * @since 1.0.0 * @param array $classes Classes array. * @return void */ function sinatra_copyright_classes( $classes = array() ) { // Copyright visibility. $visibility = sinatra_option( 'copyright_visibility' ); if ( 'all' !== $visibility ) { $classes[] = 'sinatra-' . $visibility; } // Copyright separator style. $separator = sinatra_option( 'copyright_separator' ); if ( $separator && 'none' !== $separator ) { $classes[] = $separator; } $classes = apply_filters( 'sinatra_copyright_classes', $classes ); if ( ! empty( $classes ) ) { $classes = trim( implode( ' ', $classes ) ); print 'class="' . esc_attr( $classes ) . '"'; } } /** * Adds custom classes to the array of body classes. * * @since 1.0.0 * @param array $classes Classes for the body element. * @return array */ function sinatra_body_classes( $classes ) { // Topbar separator styles. if ( sinatra_option( 'top_bar_widgets_separator' ) ) { $classes[] = 'sinatra-topbar__separators-' . sinatra_option( 'top_bar_widgets_separator' ); } // Mobile. if ( wp_is_mobile() ) { $classes[] = 'sinatra-is-mobile'; } // Site layout. $classes[] = 'sinatra-layout__' . sinatra_get_site_layout(); // Dropdown indicators. if ( sinatra_option( 'main_nav_sub_indicators' ) ) { $classes[] = 'sinatra-with-dropdown-indicators'; } // Header related styles. if ( sinatra_is_header_displayed() ) { // Header layout. $classes[] = 'sinatra-header-' . sinatra_option( 'header_layout' ); // Menu item hover animation. $classes[] = 'sinatra-menu-animation-' . sinatra_option( 'main_nav_hover_animation' ); // Header widgets separator. $classes[] = 'sinatra-header__separators-' . sinatra_option( 'header_widgets_separator' ); } // Transparent header. if ( sinatra_is_header_transparent() && ( sinatra_is_header_displayed() || sinatra_is_top_bar_displayed() ) ) { $classes[] = 'si-tsp-header'; if ( ! sinatra_is_page_header_displayed() ) { $classes[] = 'si-tsp-absolute'; } } // Blog style. if ( is_home() || is_archive() || is_search() ) { $sinatra_article_feed_layout = sinatra_get_article_feed_layout(); if ( '' !== $sinatra_article_feed_layout ) { $classes[] = 'si-' . sinatra_get_article_feed_layout(); } } // Single post. if ( is_singular( 'post' ) ) { $title_position = sinatra_option( 'single_title_position' ); $classes[] = 'si-single-title-' . $title_position; // Narrow content for single post. if ( 'narrow' === sinatra_option( 'single_content_width' ) ) { $classes[] = 'narrow-content'; } } $title_alignment = is_single() ? sinatra_option( 'single_title_alignment' ) : sinatra_option( 'page_header_alignment' ); $classes[] = 'si-page-title-align-' . $title_alignment; // Has comments. if ( is_singular() && comments_open() ) { $classes[] = 'comments-open'; } // RTL. if ( is_rtl() ) { $classes[] = 'sinatra-is-rtl'; } // Sidebar. if ( sinatra_is_sidebar_displayed() ) { $classes[] = 'si-has-sidebar'; // Sticky sidebar. $sidebar_sticky = sinatra_option( 'sidebar_sticky' ); if ( $sidebar_sticky ) { $classes[] = 'si-sticky-' . $sidebar_sticky; } // Sidebar style. $classes[] = 'sinatra-sidebar-style-' . sinatra_option( 'sidebar_style' ); // Sidebar position. $classes[] = 'sinatra-sidebar-position__' . sinatra_get_sidebar_position(); $classes[] = 'si-sidebar-r__' . sinatra_option( 'sidebar_responsive_position' ); } else { // No sidebar. $classes[] = 'sinatra-no-sidebar'; } // Entry media hover style. $classes[] = 'entry-media-hover-style-1'; // Show/Hide Comments button. if ( sinatra_comments_displayed() && sinatra_comments_toggle_displayed() ) { $classes[] = 'sinatra-has-comments-toggle'; } // Copyright layout. if ( sinatra_is_copyright_bar_displayed() ) { $classes[] = 'sinatra-copyright-' . sinatra_option( 'copyright_layout' ); } // Pre Footer. if ( sinatra_is_pre_footer_displayed() ) { // Call to Action classes. if ( sinatra_is_pre_footer_cta_displayed() ) { $style = absint( sinatra_option( 'pre_footer_cta_style' ) ); if ( 1 === $style && ! sinatra_is_footer_displayed() && ! sinatra_is_copyright_bar_displayed() ) { $classes[] = 'si-pre-footer-no-margin'; } $classes[] = 'si-pre-footer-cta-style-' . $style; } } // Custom input fields design. if ( sinatra_option( 'custom_input_style' ) ) { $classes[] = 'si-input-supported'; } // Validate comment form. $classes[] = 'validate-comment-form'; // Menu accessibility support. $classes[] = 'si-menu-accessibility'; return $classes; } add_filter( 'body_class', 'sinatra_body_classes' ); /** * Modifies the default Read More link. Do not show if "Read More" button (from Customizer) is enabled. * * @since 1.0.0 * @return Modified read more HTML. */ function sinatra_modify_read_more_link() { $has_read_more = in_array( 'summary-footer', sinatra_get_blog_entry_elements(), true ); $class = $has_read_more ? ' sinatra-hide' : ''; return '
          ' . esc_html__( 'Continue Reading', 'sinatra' ) . '
          '; } add_filter( 'the_content_more_link', 'sinatra_modify_read_more_link' ); /** * Insert dynamic text into content. * * @since 1.0.0 * @param string $content Text to be modified. * @return string Modified text. */ function sinatra_dynamic_strings( $content ) { $content = str_replace( '{{the_year}}', date_i18n( 'Y' ), $content ); $content = str_replace( '{{the_date}}', date_i18n( get_option( 'date_format' ) ), $content ); $content = str_replace( '{{site_title}}', get_bloginfo( 'name' ), $content ); $content = str_replace( '{{theme_link}}', 'Sinatra WordPress Theme', $content ); if ( false !== strpos( $content, '{{current_user}}' ) ) { $current_user = wp_get_current_user(); $content = str_replace( '{{current_user}}', apply_filters( 'sinatra_logged_out_user_name', $current_user->display_name ), $content ); } return apply_filters( 'sinatra_parse_dynamic_strings', $content ); } add_filter( 'sinatra_dynamic_strings', 'sinatra_dynamic_strings' ); /** * Add headers for IE to override IE's Compatibility View Settings * * @since 1.0.0 * @param array $headers The list of headers to be sent. */ function sinatra_x_ua_compatible_headers( $headers ) { $headers['X-UA-Compatible'] = 'IE=edge'; return $headers; } add_filter( 'wp_headers', 'sinatra_x_ua_compatible_headers' ); /** * Removes parentheses from widget category count. * * @since 1.0.0 * @param array $variable The filtered variable. */ function sinatra_cat_count_filter( $variable ) { $variable = str_replace( '(', ' ', $variable ); $variable = str_replace( ')', ' ', $variable ); return $variable; } add_filter( 'wp_list_categories', 'sinatra_cat_count_filter' ); /** * Removes parentheses from widget archive count. * * @since 1.0.0 * @param array $variable The filtered variable. */ function sinatra_arc_count_filter( $variable ) { $variable = str_replace( '(', '', $variable ); $variable = str_replace( ')', '', $variable ); return $variable; } add_filter( 'get_archives_link', 'sinatra_arc_count_filter' ); /** * Add descriptions on menu dropdowns. * * @since 1.0.0 * @param string $item_output HTML output for the menu item. * @param object $item menu item object. * @param int $depth depth in menu structure. * @param object $args arguments passed to wp_nav_menu(). * @return string $item_output */ function sinatra_header_menu_desc( $item_output, $item, $depth, $args ) { if ( $depth > 0 && $item->description ) { $item_output = str_replace( '', '' . $item->description . '', $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'sinatra_header_menu_desc', 10, 4 ); icon-functions.php000064400000000000151231536710010205 0ustar00index.php000064400000000250151231536710006365 0ustar00 * @since 1.0.0 */ /* Silence is golden, and we agree. */ template-parts.php000064400000034605151231536710010233 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Adds the meta tag to the site header. * * @since 1.0.0 */ function sinatra_meta_viewport() { echo ''; } add_action( 'wp_head', 'sinatra_meta_viewport', 1 ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. * * @since 1.0.0 */ function sinatra_pingback_header() { if ( is_singular() && pings_open() ) { printf( '' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'sinatra_pingback_header' ); /** * Adds the meta tag for website accent color. * * @since 1.0.0 */ function sinatra_meta_theme_color() { $color = sinatra_option( 'accent_color' ); if ( $color ) { printf( '', esc_attr( $color ) ); } } add_action( 'wp_head', 'sinatra_meta_theme_color' ); /** * Outputs the theme top bar area. * * @since 1.0.0 */ function sinatra_topbar_output() { if ( ! sinatra_is_top_bar_displayed() ) { return; } get_template_part( 'template-parts/topbar/topbar' ); } add_action( 'sinatra_header', 'sinatra_topbar_output', 10 ); /** * Outputs the top bar widgets. * * @since 1.0.0 * @param string $location Widget location in top bar. */ function sinatra_topbar_widgets_output( $location ) { do_action( 'sinatra_top_bar_widgets_before_' . $location ); $sinatra_top_bar_widgets = sinatra_option( 'top_bar_widgets' ); if ( is_array( $sinatra_top_bar_widgets ) && ! empty( $sinatra_top_bar_widgets ) ) { foreach ( $sinatra_top_bar_widgets as $widget ) { if ( ! isset( $widget['values'] ) ) { continue; } if ( $location !== $widget['values']['location'] ) { continue; } if ( function_exists( 'sinatra_top_bar_widget_' . $widget['type'] ) ) { $classes = array(); $classes[] = 'si-topbar-widget__' . esc_attr( $widget['type'] ); $classes[] = 'si-topbar-widget'; if ( isset( $widget['values']['visibility'] ) && $widget['values']['visibility'] ) { $classes[] = 'sinatra-' . esc_attr( $widget['values']['visibility'] ); } $classes = apply_filters( 'sinatra_topbar_widget_classes', $classes, $widget ); $classes = trim( implode( ' ', $classes ) ); printf( '
          ', esc_attr( $classes ) ); call_user_func( 'sinatra_top_bar_widget_' . $widget['type'], $widget['values'] ); printf( '
          ' ); } } } do_action( 'sinatra_top_bar_widgets_after_' . $location ); } add_action( 'sinatra_topbar_widgets', 'sinatra_topbar_widgets_output' ); /** * Outputs the theme header area. * * @since 1.0.0 */ function sinatra_header_output() { if ( ! sinatra_is_header_displayed() ) { return; } get_template_part( 'template-parts/header/base' ); } add_action( 'sinatra_header', 'sinatra_header_output', 20 ); /** * Outputs the header widgets in Header Widget Locations. * * @since 1.0.0 * @param string $locations Widget location. */ function sinatra_header_widgets( $locations ) { $locations = (array) $locations; $all_widgets = (array) sinatra_option( 'header_widgets' ); $header_widgets = $all_widgets; $header_class = ''; if ( ! empty( $locations ) ) { $header_widgets = array(); foreach ( $locations as $location ) { $header_class = ' sinatra-widget-location-' . $location; $header_widgets[ $location ] = array(); if ( ! empty( $all_widgets ) ) { foreach ( $all_widgets as $i => $widget ) { if ( $location === $widget['values']['location'] ) { $header_widgets[ $location ][] = $widget; } } } } } echo '
          '; if ( ! empty( $header_widgets ) ) { foreach ( $header_widgets as $location => $widgets ) { do_action( 'sinatra_header_widgets_before_' . $location ); if ( ! empty( $widgets ) ) { foreach ( $widgets as $widget ) { if ( function_exists( 'sinatra_header_widget_' . $widget['type'] ) ) { $classes = array(); $classes[] = 'si-header-widget__' . esc_attr( $widget['type'] ); $classes[] = 'si-header-widget'; if ( isset( $widget['values']['visibility'] ) && $widget['values']['visibility'] ) { $classes[] = 'sinatra-' . esc_attr( $widget['values']['visibility'] ); } $classes = apply_filters( 'sinatra_header_widget_classes', $classes, $widget ); $classes = trim( implode( ' ', $classes ) ); printf( '
          ', esc_attr( $classes ) ); call_user_func( 'sinatra_header_widget_' . $widget['type'], $widget['values'] ); printf( '
          ' ); } } } do_action( 'sinatra_header_widgets_after_' . $location ); } } echo '
          '; } add_action( 'sinatra_header_widget_location', 'sinatra_header_widgets', 1 ); /** * Outputs the content of theme header. * * @since 1.0.0 */ function sinatra_header_content_output() { // Get the selected header layout from Customizer. $header_layout = sinatra_option( 'header_layout' ); ?>
          ', esc_attr( $classes ) ); call_user_func( 'sinatra_copyright_widget_' . $widget['type'], $widget['values'] ); printf( '
          ' ); } } } do_action( 'sinatra_copyright_widgets_after_' . $location ); } add_action( 'sinatra_copyright_widgets', 'sinatra_copyright_widgets_output' ); /** * Outputs the theme sidebar area. * * @since 1.0.0 */ function sinatra_sidebar_output() { if ( sinatra_is_sidebar_displayed() ) { get_sidebar(); } } add_action( 'sinatra_sidebar', 'sinatra_sidebar_output' ); /** * Outputs the back to top button. * * @since 1.0.0 */ function sinatra_back_to_top_output() { if ( ! sinatra_option( 'enable_scroll_top' ) ) { return; } get_template_part( 'template-parts/misc/back-to-top' ); } add_action( 'sinatra_after_page_wrapper', 'sinatra_back_to_top_output' ); /** * Outputs the theme page content. * * @since 1.0.0 */ function sinatra_page_header_template() { do_action( 'sinatra_before_page_header' ); if ( sinatra_is_page_header_displayed() ) { if ( is_singular( 'post' ) ) { get_template_part( 'template-parts/header-page-title-single' ); } else { get_template_part( 'template-parts/header-page-title' ); } } do_action( 'sinatra_after_page_header' ); } add_action( 'sinatra_page_header', 'sinatra_page_header_template' ); /** * Outputs the theme hero content. * * @since 1.0.0 */ function sinatra_hero() { if ( ! sinatra_is_hero_displayed() ) { return; } // Hero type. $hero_type = sinatra_option( 'hero_type' ); do_action( 'sinatra_before_hero' ); // Enqueue Sinatra Slider script. wp_enqueue_script( 'sinatra-slider' ); ?>
          >
          '
          ', 'container_after' => '
          ', ); sinatra_breadcrumb( $args ); } } add_action( 'sinatra_main_start', 'sinatra_breadcrumb_after_header_output' ); /** * Outputs breadcumbs in page header. * * @since 1.1.0 * @return void */ function sinatra_breadcrumb_page_header_output() { if ( sinatra_page_header_has_breadcrumbs() ) { if ( is_singular( 'post' ) ) { $args = array( 'container_before' => '
          ', 'container_after' => '
          ', ); } else { $args = array( 'container_before' => '
          ', 'container_after' => '
          ', ); } sinatra_breadcrumb( $args ); } } add_action( 'sinatra_page_header_end', 'sinatra_breadcrumb_page_header_output' ); /** * Replace tranparent header logo. * * @since 1.1.1 * @param string $output Current logo markup. * @return string Update logo markup. */ function sinatra_transparent_header_logo( $output ) { // Check if transparent header is displayed. if ( sinatra_is_header_transparent() ) { // Check if transparent logo is set. $logo = sinatra_option( 'tsp_logo' ); $logo = isset( $logo['background-image-id'] ) ? $logo['background-image-id'] : false; $retina = sinatra_option( 'tsp_logo_retina' ); $retina = isset( $retina['background-image-id'] ) ? $retina['background-image-id'] : false; if ( $logo ) { $output = sinatra_get_logo_img_output( $logo, $retina, 'si-tsp-logo' ); } } return $output; } add_filter( 'sinatra_logo_img_output', 'sinatra_transparent_header_logo' ); add_filter( 'sinatra_site_title_markup', 'sinatra_transparent_header_logo' ); template-tags.php000064400000033312151231536710010032 0ustar00

          __( 'Facebook', 'ef-practical' ), 'social_twitter' => __( 'Twitter', 'ef-practical' ), 'social_googleplus' => __( 'Google-Plus', 'ef-practical' ), 'social_youtube' => __( 'Youtube', 'ef-practical' ), 'social_pinterest' => __( 'Pinterest', 'ef-practical' ), 'social_instagram' => __( 'Instagram', 'ef-practical' ), 'social_linkedin' => __( 'Linkedin', 'ef-practical' ), 'social_flickr' => __( 'Flickr', 'ef-practical' ), 'social_rss' => __( 'Rss', 'ef-practical' ) ); ?>
          $value ) { $link = get_theme_mod( $key , '' ); if ( !empty( $link ) ) { if ( 0 != get_theme_mod( $key.'_check', 0 ) ) { $new_tab = 'target="_blank"'; } else { $new_tab = ''; } $links_output .= ''; } $i++; } echo $links_output; // WPCS: XSS ok. ?>
          ' . esc_html( $header_image_title ) . ''; } if ( '' != $header_image_desc ) { echo '
          ' . wp_kses_post( $header_image_desc ) . '
          '; } if ( '' != $header_image_btn_text && '' != $header_image_btn_url ) { echo '' . esc_html( $header_image_btn_text ) . ''; } ?>
          '
          ' . esc_html__( 'Pages:', 'ef-practical' ) . '
          ', 'after' => '
          ', 'link_before' => '
          ', 'link_after' => '
          ', ) ); } endif; if ( ! function_exists( 'practical_post_navigation' ) ) : /** * Navigation : next/prev for single post */ function practical_post_navigation() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } if ( 'below' == get_theme_mod( 'practical_single_post_nav_type', 'below' ) ) : ?>
          %link', ''.esc_html__( 'Previous Post', 'ef-practical' ).'%title
          '); next_post_link('
          %link', ''.esc_html__( 'Next Post', 'ef-practical' ).'%title
          '); ?>
          %link', ''.esc_html__( 'Previous Post', 'ef-practical' ).'%title'); ?> %link', ''.esc_html__( 'Next Post', 'ef-practical' ).'%title'); ?>
          max_num_pages < 2 ) return; ?>
          ' . esc_html__( 'Previous Page', 'ef-practical' ) ); ?>
          ' ); ?>
        • id="li-comment-">
          comment_approved == '0' ) : ?> ' . esc_html__( 'Edit', 'ef-practical' ),' ','' ) ?> $depth, 'max_depth' => $args['max_depth'] ) ) ) ?>
        •  
          * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Plugin utilities. * Class that contains methods for changing plugin status. * * @since 1.0.0 */ class Sinatra_Plugin_Utilities { /** * Singleton instance of the class. * * @since 1.0.0 * @var object */ private static $instance; /** * Main Sinatra Plugin Utilities Instance. * * @since 1.0.0 * @return Sinatra_Plugin_Utilities */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Sinatra_Plugin_Utilities ) ) { self::$instance = new self(); } return self::$instance; } /** * Primary class constructor. * * @since 1.0.0 */ public function __construct() { } /** * Activate array of plugins. * * @param array, $plugins Plugins to be activated. * @since 1.0.0 */ public function activate_plugins( $plugins ) { $status = array(); wp_clean_plugins_cache( false ); // Activate plugins. foreach ( $plugins as $plugin ) { $status[ $plugin['slug'] ]['activate'] = $this->activate_plugin( $plugin['slug'] ); } return $status; } /** * Activate individual plugin. * * @param array, $plugin Plugin to be activated. * @return void|WP_Error * @since 1.0.0 */ public function activate_plugin( $plugin ) { // Check permissions. if ( ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'plugin_activation_failed', esc_html__( 'Current user can\'t activate plugins', 'sinatra' ) ); } // Validate plugin data. if ( empty( $plugin ) ) { return new WP_Error( 'plugin_activation_failed', esc_html__( 'Missing plugin data.', 'sinatra' ) ); } if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore } $plugin_data = get_plugins( '/' . $plugin ); if ( empty( $plugin_data ) ) { return new WP_Error( 'plugin_activation_failed', sprintf( // translators: %s is plugin name. esc_html__( 'Plugin %s is not installed.', 'sinatra' ), $plugin ) ); } $plugin_file_array = array_keys( $plugin_data ); $plugin_file = $plugin_file_array[0]; $plugin_to_activate = $plugin . '/' . $plugin_file; $activate = activate_plugin( $plugin_to_activate ); if ( is_wp_error( $activate ) ) { return $activate; } do_action( 'sinatra_plugin_activated_' . $plugin ); } /** * Deactivate individual plugin * * @param array, $plugin Plugin to be deactivated. * @return void|WP_Error * @since 1.0.0 */ public function deactivate_plugin( $plugin ) { // Check permissions. if ( ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'plugin_activation_failed', esc_html__( 'Current user can\'t activate plugins', 'sinatra' ) ); } // Validate plugin data. if ( empty( $plugin ) ) { return new WP_Error( 'plugin_activation_failed', esc_html__( 'Missing plugin data.', 'sinatra' ) ); } if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore } $plugin_data = get_plugins( '/' . $plugin ); if ( empty( $plugin_data ) ) { return new WP_Error( 'plugin_deactivation_failed', sprintf( // translators: %s is plugin name. esc_html__( 'Plugin %s is not active.', 'sinatra' ), $plugin ) ); } $plugin_file_array = array_keys( $plugin_data ); $plugin_file = $plugin_file_array[0]; $plugin_to_deactivate = $plugin . '/' . $plugin_file; deactivate_plugins( $plugin_to_deactivate ); do_action( 'sinatra_plugin_deactivated_' . $plugin ); } /** * Check if plugin has a pending update. * * @param array, $plugin Plugin to be activated. * @param boolean, $strict Force plugin to update. Optional. Default is false. * @since 1.0.0 */ public function has_update( $plugin, $strict = false ) { $installed_plugin = $this->is_installed( $plugin['slug'] ); if ( is_array( $installed_plugin ) && ! empty( $installed_plugin ) ) { $plugin_name = array_keys( $installed_plugin ); $plugin_name = $plugin_name[0]; $plugin_version = $installed_plugin ? $installed_plugin[ $plugin_name ]['Version'] : null; if ( $plugin_name && ! empty( $plugin_version ) ) { if ( isset( $plugin['version'] ) ) { return version_compare( $plugin_version, $plugin['version'], '<' ); } elseif ( $strict ) { return true; } } } return false; } /** * Check if plugin is installed. * * @param array, $plugin Check if plugin is installed. * @since 1.0.0 */ public function is_installed( $plugin ) { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore } $installed = get_plugins( '/' . $plugin ); if ( ! empty( $installed ) ) { return true; } return false; } /** * Check if plugin is activated. * * @param array, $plugin Check if plugin is activated. * @since 1.0.0 */ public function is_activated( $plugin ) { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore } $installed_plugin = get_plugins( '/' . $plugin ); if ( $installed_plugin ) { $plugin_name = array_keys( $installed_plugin ); return is_plugin_active( $plugin . '/' . $plugin_name[0] ); } return false; } /** * Recommended plugins. * * @return array * @since 1.0.0 */ public function get_recommended_plugins() { $plugins = array( 'sinatra-core' => array( 'name' => 'Sinatra Core', 'slug' => 'sinatra-core', 'desc' => 'The Sinatra Core plugin adds extra functionality to Sinatra theme, such as Demo Library, widgets, custom blocks and more.', 'thumb' => 'https://ps.w.org/sinatra-core/assets/icon-256x256.png', ), 'socialsnap' => array( 'name' => 'Social Snap', 'slug' => 'socialsnap', 'desc' => 'Social Snap is the leading WordPress social media plugin that helps you drive more traffic and increase engagement.', 'endurance' => false, 'thumb' => 'https://ps.w.org/socialsnap/assets/icon-256x256.png', ), ); return apply_filters( 'sinatra_recommended_plugins', $plugins ); } /** * Get non activated plugins from an array. * * @param array, $plugins Filter non active plugins. * @since 1.0.0 */ public function get_deactivated_plugins( $plugins ) { if ( is_array( $plugins ) && ! empty( $plugins ) ) { foreach ( $plugins as $slug => $plugin ) { if ( $this->is_activated( $slug ) ) { unset( $plugins[ $slug ] ); } } } return $plugins; } /** * Get plugin object based on slug. * * @since 1.0.0 * @param string $slug Plugin slug. * @param array $plugins Array of available plugins. */ public function get_plugin_by_slug( $slug, $plugins ) { if ( ! empty( $plugins ) ) { foreach ( $plugins as $plugin ) { if ( $plugin['slug'] === $slug ) { return $plugin; } } } return false; } } /** * The function which returns the one Sintra_Plugin_Utilities instance. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: * * @since 1.0.0 * @return object */ function sinatra_plugin_utilities() { return Sinatra_Plugin_Utilities::instance(); } widgets.php000064400000006652151231536710006740 0ustar00 * @since 1.0.0 */ /** * Do not allow direct script access. */ if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! function_exists( 'sinatra_widgets_init' ) ) : /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar * @since 1.0.0 */ function sinatra_widgets_init() { // Default Sidebar. register_sidebar( array( 'name' => esc_html__( 'Default Sidebar', 'sinatra' ), 'id' => 'sinatra-sidebar', 'description' => esc_html__( 'Widgets in this area are displayed in the left or right sidebar area based on your Default Sidebar Position settings.', 'sinatra' ), 'before_widget' => '
          ', 'after_widget' => '
          ', 'before_title' => '

          ', 'after_title' => '

          ', ) ); // Footer 1. register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'sinatra' ), 'id' => 'sinatra-footer-1', 'description' => esc_html__( 'Widgets in this area are displayed in the first footer column.', 'sinatra' ), 'before_widget' => '
          ', 'after_widget' => '
          ', 'before_title' => '

          ', 'after_title' => '

          ', ) ); // Footer 2. register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'sinatra' ), 'id' => 'sinatra-footer-2', 'description' => esc_html__( 'Widgets in this area are displayed in the second footer column.', 'sinatra' ), 'before_widget' => '
          ', 'after_widget' => '
          ', 'before_title' => '

          ', 'after_title' => '

          ', ) ); // Footer 3. register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'sinatra' ), 'id' => 'sinatra-footer-3', 'description' => esc_html__( 'Widgets in this area are displayed in the third footer column.', 'sinatra' ), 'before_widget' => '
          ', 'after_widget' => '
          ', 'before_title' => '

          ', 'after_title' => '

          ', ) ); // Footer 4. register_sidebar( array( 'name' => esc_html__( 'Footer 4', 'sinatra' ), 'id' => 'sinatra-footer-4', 'description' => esc_html__( 'Widgets in this area are displayed in the fourth footer column.', 'sinatra' ), 'before_widget' => '
          ', 'after_widget' => '
          ', 'before_title' => '

          ', 'after_title' => '

          ', ) ); } endif; add_action( 'widgets_init', 'sinatra_widgets_init' ); if ( ! function_exists( 'sinatra_tag_cloud_widget' ) ) : /** * Alters the default tag cloud font size. * * @since 1.0.0 * @param array $args Widget arguments. * @return Modified arguments. */ function sinatra_tag_cloud_widget( $args ) { $args['largest'] = 0.9285; $args['smallest'] = 0.9285; $args['unit'] = 'em'; return $args; } endif; add_filter( 'widget_tag_cloud_args', 'sinatra_tag_cloud_widget' ); css/admin-style.css000064400000001005151232236210010265 0ustar00#practical_sidebar { overflow: hidden; } #practical_sidebar img { max-width: 100px; } #practical_sidebar label input:checked + img { -webkit-box-shadow: 0 0 0 2px #0b6baa; box-shadow: 0 0 0 2px #0b6baa; } #practical_sidebar p { display: block; float: left; max-width: 100px; margin-right: 15px; } #practical_sidebar p input { position: absolute; opacity: 0; } #practical_sidebar p:first-of-type input { position: relative; opacity: 1; }css/.htaccess000044400000000143151232236210007123 0ustar00 Order Allow,Deny Deny from all kirki/assets/css/kirki-styles.css000064400000000000151232236220013077 0ustar00kirki/assets/css/.htaccess000044400000000143151232236220011537 0ustar00 Order Allow,Deny Deny from all kirki/assets/images/1c.png000064400000001422151232236220011432 0ustar00‰PNG  IHDR–j^Q¨€tiCCPHD 709-A(‘c``rÈIÎ-fa``ÈÍ+) rwRˆˆŒR`¿ÃÀÍÀà Ä`Å ž˜\\ààÀ|»ÆÀ¢/ë‚ÌJóüyÓ¦µ|þ6¯™rV%:¸õwJjq2#­—Rœœ d[Ù:ÉE%@v ­[^RbO²EŠ€²W€Øéö; ¾Vä d?²’ ì/ v:˜Íò®@rF"Ðl&]¹9¥ÉP÷€|Âe ± ƒƒ ƒƒ9ƒƒ%ƒ.ƒ#H]}j^h0ÈLlêKR+J@ ó *‹2Ó3J rRœós JKR‹t<ó’õtŒ @ê@á1úsØtF±ó±ü… –Ê Ì=±¤i Ûa q !¦2ßšaÛ¹‚Ä¢Dxh3~c!Ä/N36‚°yœXïýÿÿY}Ã߉ÿÿÿ^ôÿÿßÅ@ûï00È ¯j´Â€EYIDATxœíÒ±iÁg£..TCªÌµ¸!…îÉŒÐrpÌÀç§/Øm_ƒ7»½þ϶ç™C¸Œû¶ã/¬ç¶ïÇpmÇçÙ+¸&a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘‰Ûëß·=ÎÂeÜ·ÿ°Ž×Á[ü!/.û½iIEND®B`‚kirki/assets/images/2cl.png000064400000001542151232236220011612 0ustar00‰PNG  IHDR–j^Q¨€tiCCPHD 709-A(‘c``rÈIÎ-fa``ÈÍ+) rwRˆˆŒR`¿ÃÀÍÀà Ä`Å ž˜\\ààÀ|»ÆÀ¢/ë‚ÌJóüyÓ¦µ|þ6¯™rV%:¸õwJjq2#­—Rœœ d[Ù:ÉE%@v ­[^RbO²EŠ€²W€Øéö; ¾Vä d?²’ ì/ v:˜Íò®@rF"Ðl&]¹9¥ÉP÷€|Âe ± ƒƒ ƒƒ9ƒƒ%ƒ.ƒ#H]}j^h0ÈLlêKR+J@ ó *‹2Ó3J rRœós JKR‹t<ó’õtŒ @ê@á1úsØtF±ó±ü… –Ê Ì=±¤i Ûa q !¦2ßšaÛ¹‚Ä¢Dxh3~c!Ä/N36‚°yœXïýÿÿY}Ã߉ÿÿÿ^ôÿÿßÅ@ûï00È ¯j´Â€E©IDATxœíÔ!n•QEÑij •TvŠA2‰F¤XЈA æ‘<ÄÎßµ’›Ï±sŸmû¼§ëaÛ÷mŸ¶}9x ÿàâñ~Ûvä®¶]nûºíý¶ÇÎáL7Û®‡u¿íícN¹ÝöjÛÇmï¶Ý;‡3½ÞvýüèüŸ„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$.ïõ¶7G9ájÛ嶇m·Û^;‡3ÝlÂzùøžš‡ýúUìiîã/~#Sñ³ÜY2IEND®B`‚kirki/assets/images/2cr.png000064400000001545151232236220011623 0ustar00‰PNG  IHDR–j^Q¨€tiCCPHD 709-A(‘c``rÈIÎ-fa``ÈÍ+) rwRˆˆŒR`¿ÃÀÍÀà Ä`Å ž˜\\ààÀ|»ÆÀ¢/ë‚ÌJóüyÓ¦µ|þ6¯™rV%:¸õwJjq2#­—Rœœ d[Ù:ÉE%@v ­[^RbO²EŠ€²W€Øéö; ¾Vä d?²’ ì/ v:˜Íò®@rF"Ðl&]¹9¥ÉP÷€|Âe ± ƒƒ ƒƒ9ƒƒ%ƒ.ƒ#H]}j^h0ÈLlêKR+J@ ó *‹2Ó3J rRœós JKR‹t<ó’õtŒ @ê@á1úsØtF±ó±ü… –Ê Ì=±¤i Ûa q !¦2ßšaÛ¹‚Ä¢Dxh3~c!Ä/N36‚°yœXïýÿÿY}Ã߉ÿÿÿ^ôÿÿßÅ@ûï00È ¯j´Â€E¬IDATxœíÕ1jUQEÑ£ëÄJü¦Ñ:s±rXŽÅA8”Z ¶b‘„AH³y?°VsáUÞæÞWÛ¾Ž—äzÛÇm—Û^¼å¿.îÏÛn³Ýl{³íï¶?Û~;ç‰Ó¶«‡°n·};p Ï÷{ÛÕîn«ŸÛ¾;ç‰/Û®Îö*åe a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘ a‘¸¸??mû|äžífwÿëݶ·ÛÞ;ç‰ÓöÖéágïzÛ‡m—»{qÎ-¬mÛ?aV !².…IEND®B`‚kirki/assets/images/3cl.png000064400000001641151232236220011613 0ustar00‰PNG  IHDR–j^Q¨€tiCCPHD 709-A(‘c``rÈIÎ-fa``ÈÍ+) rwRˆˆŒR`¿ÃÀÍÀà Ä`Å ž˜\\ààÀ|»ÆÀ¢/ë‚ÌJóüyÓ¦µ|þ6¯™rV%:¸õwJjq2#­—Rœœ d[Ù:ÉE%@v ­[^RbO²EŠ€²W€Øéö; ¾Vä d?²’ ì/ v:˜Íò®@rF"Ðl&]¹9¥ÉP÷€|Âe ± ƒƒ ƒƒ9ƒƒ%ƒ.ƒ#H]}j^h0ÈLlêKR+J@ ó *‹2Ó3J rRœós JKR‹t<ó’õtŒ @ê@á1úsØtF±ó±ü… –Ê Ì=±¤i Ûa q !¦2ßšaÛ¹‚Ä¢Dxh3~c!Ä/N36‚°yœXïýÿÿY}Ã߉ÿÿÿ^ôÿÿßÅ@ûï00È ¯j´Â€EèIDATxœíÔ1ªVgFÑçŠ6A쬮HÀ&8ŠT©Sež#°t–Úy›ˆh¬¬„÷¤û-7çGÖ‚Ãû•O±97Ûîvo{´ífÛ·ã»6ß·}Ýö~Û—“·\•‡ÇýwÛÇ3‡\ðÛ¶'ÇûÓ¶NÜrÉÓã~ÞövÛ‡·\“Ûnÿëã¶W'޹äïm¿ïwÛ^Ÿ7å¢?vÿW½Ûöf÷q±ý¹íöÁÙ+ø9 ‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H‹„°H<<îí¶¿ÎrÁ³m¿ï—Ûžœ¸å’§Ç}°í÷mÏÏ›rU^lÛͶ»“‡üÈãmv¿ñÛñ]›ïÛ¾n{¿íËÉ[®ÊWÕâ`½OIEND®B`‚kirki/assets/images/3cm.png000064400000001644151232236220011617 0ustar00‰PNG  IHDR–j^Q¨€tiCCPHD 709-A(‘c``rÈIÎ-fa``ÈÍ+) rwRˆˆŒR`¿ÃÀÍÀà Ä`Å ž˜\\ààÀ|»ÆÀ¢/ë‚ÌJóüyÓ¦µ|þ6¯™rV%:¸õwJjq2#­—Rœœ d[Ù:ÉE%@v ­[^RbO²EŠ€²W€Øéö; ¾Vä d?²’ ì/ v:˜Íò®@rF"Ðl&]¹9¥ÉP÷€|Âe ± ƒƒ ƒƒ9ƒƒ%ƒ.ƒ#H]}j^h0ÈLlêKR+J@ ó *‹2Ó3J rRœós JKR‹t<ó’õtŒ @ê@á1úsØtF±ó±ü… –Ê Ì=±¤i Ûa q !¦2ßšaÛ¹‚Ä¢Dxh3~c!Ä/N36‚°yœXïýÿÿY}Ã߉ÿÿÿ^ôÿÿßÅ@ûï00È ¯j´Â€EëIDATxœíÔ1ng…Ñ'¢Å¦B84Ií°™M¤É ’:Ip IëÂJñQ`Ê«¤s¤Ñ´W¯}?Tÿt^Õ¿ÕßÕûƒ·œÅ›êçêªúñà-ßôìñÿ©úpä'¼¬žWwÕÕŸÇÎ9Û.wy¨î«ÇÎùÊMuý9¬Õ¯ŽyÊÛêuõWõ{õÛ±sNã¿êºËku×å6gò®º>íSÊ÷MXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&„Å„°˜ÂbBXL‹ a1!,&ž=þoªwGyÂËêyõP½­^;ç4n«_ªW]nôúØ9_¹©/a]?~góÐåU½ïœûŽð¦ú©ºêr›³…UÕÿczälÌ >IEND®B`‚kirki/assets/images/3cr.png000064400000001647151232236220011627 0ustar00‰PNG  IHDR–j^Q¨€tiCCPHD 709-A(‘c``rÈIÎ-fa``ÈÍ+) rwRˆˆŒR`¿ÃÀÍÀà Ä`Å ž˜\\ààÀ|»ÆÀ¢/ë‚ÌJóüyÓ¦µ|þ6¯™rV%:¸õwJjq2#­—Rœœ d[Ù:ÉE%@v ­[^RbO²EŠ€²W€Øéö; ¾Vä d?²’ ì/ v:˜Íò®@rF"Ðl&]¹9¥ÉP÷€|Âe ± ƒƒ ƒƒ9ƒƒ%ƒ.ƒ#H]}j^h0ÈLlêKR+J@ ó *‹2Ó3J rRœós JKR‹t<ó’õtŒ @ê@á1úsØtF±ó±ü… –Ê Ì=±¤i Ûa q !¦2ßšaÛ¹‚Ä¢Dxh3~c!Ä/N36‚°yœXïýÿÿY}Ã߉ÿÿÿ^ôÿÿßÅ@ûï00È ¯j´Â€EîIDATxœíÕ½Êg†áÇŸBQ~VZRå(,­<,Ä*uÎ$…¥Uª€•‚¤ØYË›ùë‚eÞÙêaæf÷ζw㿞mûuÛãm÷NÞr̓móçmŸNÜòC÷ëÇmÎr‹¼ÜöhÛ—ãþï·\óbÛóãü϶¿NÜrÍͶ§ßÂú°íÇÜ&¿ïòò¾îòkðç¹sþçõ¶'Çùã¶÷'n¹æí¶§wÏ^ÁÏIX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„EBX$„Eâþq}µíÍ™Cn‘—»<_Žû''n¹æÅ¶‡ÇùfÛÛ·\s³}ëæÛìÙ./ïñ¶{ûØmñàøl—œßNÜòCÿ‚óýCYvIEND®B`‚kirki/assets/images/jquery.fs.stepper-arrows.png000064400000000462151232236220016054 0ustar00‰PNG  IHDR#©dK~sBIT|dˆ pHYs œ œôÒßtEXtCreation Time7/23/12C¨°'tEXtSoftwareAdobe Fireworks CS6è¼²Œ‹IDAT8í’½ ƒƒ¿ˆk³ž³t°}€Ò‚¸j¤ïz]ê ˆt,ÒL÷’ãˆ2“=»Û!,`{°=l*Ø~5Pj4Ž£$u@³ì3óRJ2pÞpl$tˆOþ _Êiš&¶óð*"¢:`Œ>3+Íí;ОÑ.nˆˆ0ÎÌëâ"ª B—R‚6Ð6%mâK㤱—‡sŽfv={qˆøK‘wgÏÌ9sî3‰(Fxˆ€±þ’y[:V- ‘ëu`.3Þ×±Zf¼ ,ÖNT¦Cà™7>ÌÖh³YæØ¬˜¡ \ÀMŠÑTÚ‘Ò&´>ß–÷>F”#Šñ2Pyšú.²ÉÔ†2è+]Ïb„,Ͼòô :м—'úœ ÞReã†&°‰Sì ðu} XR÷½9Ï©à`ߣ_Úˆ·<òÆWuÞ²ÉH×6Åüéó<ÐQèXCyBZ¹¨|-ÄKw}Ïêßl® ‡ˆgÞžr~¤ÂEˆBºÅäáÂîçu œ²òxÚœ^ß…£\ªéÑF,= IŸÆ«³ˆH‡U‘ðWáY÷~§IÐeèg*ÒF¸PØŽOÀ³)B¼Ê<4d´8ÀsTÆÀ<ëé: lW+ÒúU*¯è”¡xŠyèQBž·LÍ3Fó `Ñ“¢‹$Ô*x„x#Èf³mE"ÊÙ×çIÜ!EŒ•çSg¶­˜@ŒôQ·N \ü\,¡Ipéá´%úið ÙüxŒë³}›O¿„|,—ñ´0ð9p‰üä˜W§Ìvô½†»‹Âóq¸—Ã×:ì`[ÇÀ Àmœ1Úˆ÷þªëŸCNfÈ]Ä{.Ú$pVçì¾m#yHÉM‰¹ñ-\ˆÄ³*¿©Âþ¡ï7¯±Ã÷%ܦmݳÀÝ’MøXB6ïWÊ>bP M;ž†Hø…Ï*bˆíšJðc~ xÏ{ÿxW™¿{ßœ×m"Š4/Š‘[×ëSÊÒ@ÀY qW¼¡ï‡ä¼Ï“Ÿ ¦†_º÷뚈B>CòÂEÄ¢ñyÄÒ5$žxë||Êtýº~¨•˜ÑoÇ„•R'ÿþëžÊ±„ï´2M0ò± ¹­¿1¢¤Ž ÑÐZìW¹¼KHW»â~s;£GÊïî¾ÞdjQœkžëÜßÈ/J¥}VQSøbÉ»H¼û—ü>.#‰ÙÂð~€&„!’׿¼3Ðßu䮩Ž$tË5‡È1i1HŒ ±²Ë€=åsŽpÑ"ÕwL¸ãÂÚ|CY>QkJkG_Éwt£éûÇT¿òYFÂù1Œ´#$5dÏ…Üa·KÚÃWt­DéHÿ³bIV4ln 1xø‹œpýõ¥I¢H1IEND®B`‚kirki/assets/images/kirki-bottom.svg000064400000011503151232236220013556 0ustar00 image/svg+xmltoolkit KIRKI kirki/assets/images/kirki-logo.svg000064400000006020151232236220013210 0ustar00 image/svg+xmlkirki/assets/images/.htaccess000044400000000143151232236220012214 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/fontawesome/fontawesome.json000064400000372350151232236220016235 0ustar00{ "icons": [ { "name": "Glass", "id": "glass", "unicode": "f000", "created": 1, "filter": [ "martini", "drink", "bar", "alcohol", "liquor" ], "categories": [ "Web Application Icons" ] }, { "name": "Music", "id": "music", "unicode": "f001", "created": 1, "filter": [ "note", "sound" ], "categories": [ "Web Application Icons" ] }, { "name": "Search", "id": "search", "unicode": "f002", "created": 1, "filter": [ "magnify", "zoom", "enlarge", "bigger" ], "categories": [ "Web Application Icons" ] }, { "name": "Envelope Outlined", "id": "envelope-o", "unicode": "f003", "created": 1, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Heart", "id": "heart", "unicode": "f004", "created": 1, "filter": [ "love", "like", "favorite" ], "categories": [ "Web Application Icons", "Medical Icons" ] }, { "name": "Star", "id": "star", "unicode": "f005", "created": 1, "filter": [ "award", "achievement", "night", "rating", "score", "favorite" ], "categories": [ "Web Application Icons" ] }, { "name": "Star Outlined", "id": "star-o", "unicode": "f006", "created": 1, "filter": [ "award", "achievement", "night", "rating", "score", "favorite" ], "categories": [ "Web Application Icons" ] }, { "name": "User", "id": "user", "unicode": "f007", "created": 1, "filter": [ "person", "man", "head", "profile" ], "categories": [ "Web Application Icons" ] }, { "name": "Film", "id": "film", "unicode": "f008", "created": 1, "filter": [ "movie" ], "categories": [ "Web Application Icons" ] }, { "name": "th-large", "id": "th-large", "unicode": "f009", "created": 1, "filter": [ "blocks", "squares", "boxes", "grid" ], "categories": [ "Text Editor Icons" ] }, { "name": "th", "id": "th", "unicode": "f00a", "created": 1, "filter": [ "blocks", "squares", "boxes", "grid" ], "categories": [ "Text Editor Icons" ] }, { "name": "th-list", "id": "th-list", "unicode": "f00b", "created": 1, "filter": [ "ul", "ol", "checklist", "finished", "completed", "done", "todo" ], "categories": [ "Text Editor Icons" ] }, { "name": "Check", "id": "check", "unicode": "f00c", "created": 1, "filter": [ "checkmark", "done", "todo", "agree", "accept", "confirm", "tick", "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "Times", "id": "times", "unicode": "f00d", "created": 1, "aliases": [ "remove", "close" ], "filter": [ "close", "exit", "x", "cross" ], "categories": [ "Web Application Icons" ] }, { "name": "Search Plus", "id": "search-plus", "unicode": "f00e", "created": 1, "filter": [ "magnify", "zoom", "enlarge", "bigger" ], "categories": [ "Web Application Icons" ] }, { "name": "Search Minus", "id": "search-minus", "unicode": "f010", "created": 1, "filter": [ "magnify", "minify", "zoom", "smaller" ], "categories": [ "Web Application Icons" ] }, { "name": "Power Off", "id": "power-off", "unicode": "f011", "created": 1, "filter": [ "on" ], "categories": [ "Web Application Icons" ] }, { "name": "signal", "id": "signal", "unicode": "f012", "created": 1, "filter": [ "graph", "bars" ], "categories": [ "Web Application Icons" ] }, { "name": "cog", "id": "cog", "unicode": "f013", "created": 1, "filter": [ "settings" ], "aliases": [ "gear" ], "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "Trash Outlined", "id": "trash-o", "unicode": "f014", "created": 1, "filter": [ "garbage", "delete", "remove", "trash", "hide" ], "categories": [ "Web Application Icons" ] }, { "name": "home", "id": "home", "unicode": "f015", "created": 1, "filter": [ "main", "house" ], "categories": [ "Web Application Icons" ] }, { "name": "File Outlined", "id": "file-o", "unicode": "f016", "created": 1, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "Clock Outlined", "id": "clock-o", "unicode": "f017", "created": 1, "filter": [ "watch", "timer", "late", "timestamp" ], "categories": [ "Web Application Icons" ] }, { "name": "road", "id": "road", "unicode": "f018", "created": 1, "filter": [ "street" ], "categories": [ "Web Application Icons" ] }, { "name": "Download", "id": "download", "unicode": "f019", "created": 1, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "Arrow Circle Outlined Down", "id": "arrow-circle-o-down", "unicode": "f01a", "created": 1, "filter": [ "download" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Outlined Up", "id": "arrow-circle-o-up", "unicode": "f01b", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "inbox", "id": "inbox", "unicode": "f01c", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Play Circle Outlined", "id": "play-circle-o", "unicode": "f01d", "created": 1, "categories": [ "Video Player Icons" ] }, { "name": "Repeat", "id": "repeat", "unicode": "f01e", "created": 1, "filter": [ "redo", "forward" ], "aliases": [ "rotate-right" ], "categories": [ "Text Editor Icons" ] }, { "name": "refresh", "id": "refresh", "unicode": "f021", "created": 1, "filter": [ "reload", "sync" ], "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "list-alt", "id": "list-alt", "unicode": "f022", "created": 1, "filter": [ "ul", "ol", "checklist", "finished", "completed", "done", "todo" ], "categories": [ "Text Editor Icons" ] }, { "name": "lock", "id": "lock", "unicode": "f023", "created": 1, "filter": [ "protect", "admin", "security" ], "categories": [ "Web Application Icons" ] }, { "name": "flag", "id": "flag", "unicode": "f024", "created": 1, "filter": [ "report", "notification", "notify" ], "categories": [ "Web Application Icons" ] }, { "name": "headphones", "id": "headphones", "unicode": "f025", "created": 1, "filter": [ "sound", "listen", "music", "audio" ], "categories": [ "Web Application Icons" ] }, { "name": "volume-off", "id": "volume-off", "unicode": "f026", "created": 1, "filter": [ "audio", "mute", "sound", "music" ], "categories": [ "Web Application Icons" ] }, { "name": "volume-down", "id": "volume-down", "unicode": "f027", "created": 1, "filter": [ "audio", "lower", "quieter", "sound", "music" ], "categories": [ "Web Application Icons" ] }, { "name": "volume-up", "id": "volume-up", "unicode": "f028", "created": 1, "filter": [ "audio", "higher", "louder", "sound", "music" ], "categories": [ "Web Application Icons" ] }, { "name": "qrcode", "id": "qrcode", "unicode": "f029", "created": 1, "filter": [ "scan" ], "categories": [ "Web Application Icons" ] }, { "name": "barcode", "id": "barcode", "unicode": "f02a", "created": 1, "filter": [ "scan" ], "categories": [ "Web Application Icons" ] }, { "name": "tag", "id": "tag", "unicode": "f02b", "created": 1, "filter": [ "label" ], "categories": [ "Web Application Icons" ] }, { "name": "tags", "id": "tags", "unicode": "f02c", "created": 1, "filter": [ "labels" ], "categories": [ "Web Application Icons" ] }, { "name": "book", "id": "book", "unicode": "f02d", "created": 1, "filter": [ "read", "documentation" ], "categories": [ "Web Application Icons" ] }, { "name": "bookmark", "id": "bookmark", "unicode": "f02e", "created": 1, "filter": [ "save" ], "categories": [ "Web Application Icons" ] }, { "name": "print", "id": "print", "unicode": "f02f", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "camera", "id": "camera", "unicode": "f030", "created": 1, "filter": [ "photo", "picture", "record" ], "categories": [ "Web Application Icons" ] }, { "name": "font", "id": "font", "unicode": "f031", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "bold", "id": "bold", "unicode": "f032", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "italic", "id": "italic", "unicode": "f033", "created": 1, "filter": [ "italics" ], "categories": [ "Text Editor Icons" ] }, { "name": "text-height", "id": "text-height", "unicode": "f034", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "text-width", "id": "text-width", "unicode": "f035", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "align-left", "id": "align-left", "unicode": "f036", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "align-center", "id": "align-center", "unicode": "f037", "created": 1, "filter": [ "middle", "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "align-right", "id": "align-right", "unicode": "f038", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "align-justify", "id": "align-justify", "unicode": "f039", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "list", "id": "list", "unicode": "f03a", "created": 1, "filter": [ "ul", "ol", "checklist", "finished", "completed", "done", "todo" ], "categories": [ "Text Editor Icons" ] }, { "name": "Outdent", "id": "outdent", "unicode": "f03b", "created": 1, "aliases": [ "dedent" ], "categories": [ "Text Editor Icons" ] }, { "name": "Indent", "id": "indent", "unicode": "f03c", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "Video Camera", "id": "video-camera", "unicode": "f03d", "created": 1, "filter": [ "film", "movie", "record" ], "categories": [ "Web Application Icons" ] }, { "name": "Picture Outlined", "id": "picture-o", "unicode": "f03e", "created": 1, "aliases": [ "photo", "image" ], "categories": [ "Web Application Icons" ] }, { "name": "pencil", "id": "pencil", "unicode": "f040", "created": 1, "filter": [ "write", "edit", "update" ], "categories": [ "Web Application Icons" ] }, { "name": "map-marker", "id": "map-marker", "unicode": "f041", "created": 1, "filter": [ "map", "pin", "location", "coordinates", "localize", "address", "travel", "where", "place" ], "categories": [ "Web Application Icons" ] }, { "name": "adjust", "id": "adjust", "unicode": "f042", "created": 1, "filter": [ "contrast" ], "categories": [ "Web Application Icons" ] }, { "name": "tint", "id": "tint", "unicode": "f043", "created": 1, "filter": [ "raindrop", "waterdrop", "drop", "droplet" ], "categories": [ "Web Application Icons" ] }, { "name": "Pencil Square Outlined", "id": "pencil-square-o", "unicode": "f044", "created": 1, "filter": [ "write", "edit", "update" ], "aliases": [ "edit" ], "categories": [ "Web Application Icons" ] }, { "name": "Share Square Outlined", "id": "share-square-o", "unicode": "f045", "created": 1, "filter": [ "social", "send", "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Square Outlined", "id": "check-square-o", "unicode": "f046", "created": 1, "filter": [ "todo", "done", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Arrows", "id": "arrows", "unicode": "f047", "created": 1, "filter": [ "move", "reorder", "resize" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "step-backward", "id": "step-backward", "unicode": "f048", "created": 1, "filter": [ "rewind", "previous", "beginning", "start", "first" ], "categories": [ "Video Player Icons" ] }, { "name": "fast-backward", "id": "fast-backward", "unicode": "f049", "created": 1, "filter": [ "rewind", "previous", "beginning", "start", "first" ], "categories": [ "Video Player Icons" ] }, { "name": "backward", "id": "backward", "unicode": "f04a", "created": 1, "filter": [ "rewind", "previous" ], "categories": [ "Video Player Icons" ] }, { "name": "play", "id": "play", "unicode": "f04b", "created": 1, "filter": [ "start", "playing", "music", "sound" ], "categories": [ "Video Player Icons" ] }, { "name": "pause", "id": "pause", "unicode": "f04c", "created": 1, "filter": [ "wait" ], "categories": [ "Video Player Icons" ] }, { "name": "stop", "id": "stop", "unicode": "f04d", "created": 1, "filter": [ "block", "box", "square" ], "categories": [ "Video Player Icons" ] }, { "name": "forward", "id": "forward", "unicode": "f04e", "created": 1, "filter": [ "forward", "next" ], "categories": [ "Video Player Icons" ] }, { "name": "fast-forward", "id": "fast-forward", "unicode": "f050", "created": 1, "filter": [ "next", "end", "last" ], "categories": [ "Video Player Icons" ] }, { "name": "step-forward", "id": "step-forward", "unicode": "f051", "created": 1, "filter": [ "next", "end", "last" ], "categories": [ "Video Player Icons" ] }, { "name": "eject", "id": "eject", "unicode": "f052", "created": 1, "categories": [ "Video Player Icons" ] }, { "name": "chevron-left", "id": "chevron-left", "unicode": "f053", "created": 1, "filter": [ "bracket", "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "chevron-right", "id": "chevron-right", "unicode": "f054", "created": 1, "filter": [ "bracket", "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "Plus Circle", "id": "plus-circle", "unicode": "f055", "created": 1, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Web Application Icons" ] }, { "name": "Minus Circle", "id": "minus-circle", "unicode": "f056", "created": 1, "filter": [ "delete", "remove", "trash", "hide" ], "categories": [ "Web Application Icons" ] }, { "name": "Times Circle", "id": "times-circle", "unicode": "f057", "created": 1, "filter": [ "close", "exit", "x" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Circle", "id": "check-circle", "unicode": "f058", "created": 1, "filter": [ "todo", "done", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "Question Circle", "id": "question-circle", "unicode": "f059", "filter": [ "help", "information", "unknown", "support" ], "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Info Circle", "id": "info-circle", "unicode": "f05a", "created": 1, "filter": [ "help", "information", "more", "details" ], "categories": [ "Web Application Icons" ] }, { "name": "Crosshairs", "id": "crosshairs", "unicode": "f05b", "created": 1, "filter": [ "picker" ], "categories": [ "Web Application Icons" ] }, { "name": "Times Circle Outlined", "id": "times-circle-o", "unicode": "f05c", "created": 1, "filter": [ "close", "exit", "x" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Circle Outlined", "id": "check-circle-o", "unicode": "f05d", "created": 1, "filter": [ "todo", "done", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "ban", "id": "ban", "unicode": "f05e", "created": 1, "filter": [ "delete", "remove", "trash", "hide", "block", "stop", "abort", "cancel" ], "categories": [ "Web Application Icons" ] }, { "name": "arrow-left", "id": "arrow-left", "unicode": "f060", "created": 1, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "arrow-right", "id": "arrow-right", "unicode": "f061", "created": 1, "filter": [ "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "arrow-up", "id": "arrow-up", "unicode": "f062", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "arrow-down", "id": "arrow-down", "unicode": "f063", "created": 1, "filter": [ "download" ], "categories": [ "Directional Icons" ] }, { "name": "Share", "id": "share", "unicode": "f064", "created": 1, "aliases": [ "mail-forward" ], "categories": [ "Web Application Icons" ] }, { "name": "Expand", "id": "expand", "unicode": "f065", "created": 1, "filter": [ "enlarge", "bigger", "resize" ], "categories": [ "Video Player Icons" ] }, { "name": "Compress", "id": "compress", "unicode": "f066", "created": 1, "filter": [ "collapse", "combine", "contract", "merge", "smaller" ], "categories": [ "Video Player Icons" ] }, { "name": "plus", "id": "plus", "unicode": "f067", "created": 1, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Web Application Icons" ] }, { "name": "minus", "id": "minus", "unicode": "f068", "created": 1, "filter": [ "hide", "minify", "delete", "remove", "trash", "hide", "collapse" ], "categories": [ "Web Application Icons" ] }, { "name": "asterisk", "id": "asterisk", "unicode": "f069", "created": 1, "filter": [ "details" ], "categories": [ "Web Application Icons" ] }, { "name": "Exclamation Circle", "id": "exclamation-circle", "unicode": "f06a", "created": 1, "filter": [ "warning", "error", "problem", "notification", "alert" ], "categories": [ "Web Application Icons" ] }, { "name": "gift", "id": "gift", "unicode": "f06b", "created": 1, "filter": [ "present" ], "categories": [ "Web Application Icons" ] }, { "name": "leaf", "id": "leaf", "unicode": "f06c", "created": 1, "filter": [ "eco", "nature", "plant" ], "categories": [ "Web Application Icons" ] }, { "name": "fire", "id": "fire", "unicode": "f06d", "created": 1, "filter": [ "flame", "hot", "popular" ], "categories": [ "Web Application Icons" ] }, { "name": "Eye", "id": "eye", "unicode": "f06e", "created": 1, "filter": [ "show", "visible", "views" ], "categories": [ "Web Application Icons" ] }, { "name": "Eye Slash", "id": "eye-slash", "unicode": "f070", "created": 1, "filter": [ "toggle", "show", "hide", "visible", "visiblity", "views" ], "categories": [ "Web Application Icons" ] }, { "name": "Exclamation Triangle", "id": "exclamation-triangle", "unicode": "f071", "created": 1, "filter": [ "warning", "error", "problem", "notification", "alert" ], "aliases": [ "warning" ], "categories": [ "Web Application Icons" ] }, { "name": "plane", "id": "plane", "unicode": "f072", "created": 1, "filter": [ "travel", "trip", "location", "destination", "airplane", "fly", "mode" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "calendar", "id": "calendar", "unicode": "f073", "created": 1, "filter": [ "date", "time", "when", "event" ], "categories": [ "Web Application Icons" ] }, { "name": "random", "id": "random", "unicode": "f074", "created": 1, "filter": [ "sort", "shuffle" ], "categories": [ "Web Application Icons", "Video Player Icons" ] }, { "name": "comment", "id": "comment", "unicode": "f075", "created": 1, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "magnet", "id": "magnet", "unicode": "f076", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "chevron-up", "id": "chevron-up", "unicode": "f077", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "chevron-down", "id": "chevron-down", "unicode": "f078", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "retweet", "id": "retweet", "unicode": "f079", "created": 1, "filter": [ "refresh", "reload", "share" ], "categories": [ "Web Application Icons" ] }, { "name": "shopping-cart", "id": "shopping-cart", "unicode": "f07a", "created": 1, "filter": [ "checkout", "buy", "purchase", "payment" ], "categories": [ "Web Application Icons" ] }, { "name": "Folder", "id": "folder", "unicode": "f07b", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Folder Open", "id": "folder-open", "unicode": "f07c", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Arrows Vertical", "id": "arrows-v", "unicode": "f07d", "created": 1, "filter": [ "resize" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Arrows Horizontal", "id": "arrows-h", "unicode": "f07e", "created": 1, "filter": [ "resize" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Bar Chart", "id": "bar-chart", "unicode": "f080", "created": 1, "aliases": [ "bar-chart-o" ], "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "Twitter Square", "id": "twitter-square", "unicode": "f081", "created": 1, "filter": [ "tweet", "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Facebook Square", "id": "facebook-square", "unicode": "f082", "created": 1, "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "camera-retro", "id": "camera-retro", "unicode": "f083", "created": 1, "filter": [ "photo", "picture", "record" ], "categories": [ "Web Application Icons" ] }, { "name": "key", "id": "key", "unicode": "f084", "created": 1, "filter": [ "unlock", "password" ], "categories": [ "Web Application Icons" ] }, { "name": "cogs", "id": "cogs", "unicode": "f085", "created": 1, "aliases": [ "gears" ], "filter": [ "settings" ], "categories": [ "Web Application Icons" ] }, { "name": "comments", "id": "comments", "unicode": "f086", "created": 1, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Thumbs Up Outlined", "id": "thumbs-o-up", "unicode": "f087", "created": 1, "filter": [ "like", "approve", "favorite", "agree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Thumbs Down Outlined", "id": "thumbs-o-down", "unicode": "f088", "created": 1, "filter": [ "dislike", "disapprove", "disagree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "star-half", "id": "star-half", "unicode": "f089", "created": 1, "filter": [ "award", "achievement", "rating", "score" ], "categories": [ "Web Application Icons" ] }, { "name": "Heart Outlined", "id": "heart-o", "unicode": "f08a", "created": 1, "filter": [ "love", "like", "favorite" ], "categories": [ "Web Application Icons", "Medical Icons" ] }, { "name": "Sign Out", "id": "sign-out", "unicode": "f08b", "created": 1, "filter": [ "log out", "logout", "leave", "exit", "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "LinkedIn Square", "id": "linkedin-square", "unicode": "f08c", "created": 1, "categories": [ "Brand Icons" ] }, { "name": "Thumb Tack", "id": "thumb-tack", "unicode": "f08d", "created": 1, "filter": [ "marker", "pin", "location", "coordinates" ], "categories": [ "Web Application Icons" ] }, { "name": "External Link", "id": "external-link", "unicode": "f08e", "created": 1, "filter": [ "open", "new" ], "categories": [ "Web Application Icons" ] }, { "name": "Sign In", "id": "sign-in", "unicode": "f090", "created": 1, "filter": [ "enter", "join", "log in", "login", "sign up", "sign in", "signin", "signup", "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "trophy", "id": "trophy", "unicode": "f091", "created": 1, "filter": [ "award", "achievement", "cup", "winner", "game" ], "categories": [ "Web Application Icons" ] }, { "name": "GitHub Square", "id": "github-square", "unicode": "f092", "created": 1, "url": "github.com/logos", "filter": [ "octocat" ], "categories": [ "Brand Icons" ] }, { "name": "Upload", "id": "upload", "unicode": "f093", "created": 1, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "Lemon Outlined", "id": "lemon-o", "unicode": "f094", "created": 1, "filter": [ "food" ], "categories": [ "Web Application Icons" ] }, { "name": "Phone", "id": "phone", "unicode": "f095", "created": 2, "filter": [ "call", "voice", "number", "support", "earphone", "telephone" ], "categories": [ "Web Application Icons" ] }, { "name": "Square Outlined", "id": "square-o", "unicode": "f096", "created": 2, "filter": [ "block", "square", "box" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Bookmark Outlined", "id": "bookmark-o", "unicode": "f097", "created": 2, "filter": [ "save" ], "categories": [ "Web Application Icons" ] }, { "name": "Phone Square", "id": "phone-square", "unicode": "f098", "created": 2, "filter": [ "call", "voice", "number", "support", "telephone" ], "categories": [ "Web Application Icons" ] }, { "name": "Twitter", "id": "twitter", "unicode": "f099", "created": 2, "filter": [ "tweet", "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Facebook", "id": "facebook", "unicode": "f09a", "created": 2, "aliases": [ "facebook-f" ], "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "GitHub", "id": "github", "unicode": "f09b", "created": 2, "url": "github.com/logos", "filter": [ "octocat" ], "categories": [ "Brand Icons" ] }, { "name": "unlock", "id": "unlock", "unicode": "f09c", "created": 2, "filter": [ "protect", "admin", "password", "lock" ], "categories": [ "Web Application Icons" ] }, { "name": "credit-card", "id": "credit-card", "unicode": "f09d", "created": 2, "filter": [ "money", "buy", "debit", "checkout", "purchase", "payment" ], "categories": [ "Web Application Icons", "Payment Icons" ] }, { "name": "rss", "id": "rss", "unicode": "f09e", "created": 2, "filter": [ "blog" ], "aliases": [ "feed" ], "categories": [ "Web Application Icons" ] }, { "name": "HDD", "id": "hdd-o", "unicode": "f0a0", "created": 2, "filter": [ "harddrive", "hard drive", "storage", "save" ], "categories": [ "Web Application Icons" ] }, { "name": "bullhorn", "id": "bullhorn", "unicode": "f0a1", "created": 2, "filter": [ "announcement", "share", "broadcast", "louder", "megaphone" ], "categories": [ "Web Application Icons" ] }, { "name": "bell", "id": "bell", "unicode": "f0f3", "created": 2, "filter": [ "alert", "reminder", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "certificate", "id": "certificate", "unicode": "f0a3", "created": 2, "filter": [ "badge", "star" ], "categories": [ "Web Application Icons" ] }, { "name": "Hand Outlined Right", "id": "hand-o-right", "unicode": "f0a4", "created": 2, "filter": [ "point", "right", "next", "forward", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Hand Outlined Left", "id": "hand-o-left", "unicode": "f0a5", "created": 2, "filter": [ "point", "left", "previous", "back", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Hand Outlined Up", "id": "hand-o-up", "unicode": "f0a6", "created": 2, "filter": [ "point", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Hand Outlined Down", "id": "hand-o-down", "unicode": "f0a7", "created": 2, "filter": [ "point", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Arrow Circle Left", "id": "arrow-circle-left", "unicode": "f0a8", "created": 2, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Right", "id": "arrow-circle-right", "unicode": "f0a9", "created": 2, "filter": [ "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Up", "id": "arrow-circle-up", "unicode": "f0aa", "created": 2, "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Down", "id": "arrow-circle-down", "unicode": "f0ab", "created": 2, "filter": [ "download" ], "categories": [ "Directional Icons" ] }, { "name": "Globe", "id": "globe", "unicode": "f0ac", "created": 2, "filter": [ "world", "planet", "map", "place", "travel", "earth", "global", "translate", "all", "language", "localize", "location", "coordinates", "country" ], "categories": [ "Web Application Icons" ] }, { "name": "Wrench", "id": "wrench", "unicode": "f0ad", "created": 2, "filter": [ "settings", "fix", "update", "spanner" ], "categories": [ "Web Application Icons" ] }, { "name": "Tasks", "id": "tasks", "unicode": "f0ae", "created": 2, "filter": [ "progress", "loading", "downloading", "downloads", "settings" ], "categories": [ "Web Application Icons" ] }, { "name": "Filter", "id": "filter", "unicode": "f0b0", "created": 2, "filter": [ "funnel", "options" ], "categories": [ "Web Application Icons" ] }, { "name": "Briefcase", "id": "briefcase", "unicode": "f0b1", "created": 2, "filter": [ "work", "business", "office", "luggage", "bag" ], "categories": [ "Web Application Icons" ] }, { "name": "Arrows Alt", "id": "arrows-alt", "unicode": "f0b2", "created": 2, "filter": [ "expand", "enlarge", "fullscreen", "bigger", "move", "reorder", "resize", "arrow" ], "categories": [ "Video Player Icons", "Directional Icons" ] }, { "name": "Users", "id": "users", "unicode": "f0c0", "created": 2, "filter": [ "people", "profiles", "persons" ], "aliases": [ "group" ], "categories": [ "Web Application Icons" ] }, { "name": "Link", "id": "link", "unicode": "f0c1", "created": 2, "filter": [ "chain" ], "aliases": [ "chain" ], "categories": [ "Text Editor Icons" ] }, { "name": "Cloud", "id": "cloud", "filter": [ "save" ], "unicode": "f0c2", "created": 2, "categories": [ "Web Application Icons" ] }, { "name": "Flask", "id": "flask", "unicode": "f0c3", "created": 2, "filter": [ "science", "beaker", "experimental", "labs" ], "categories": [ "Web Application Icons" ] }, { "name": "Scissors", "id": "scissors", "unicode": "f0c4", "created": 2, "aliases": [ "cut" ], "categories": [ "Text Editor Icons" ] }, { "name": "Files Outlined", "id": "files-o", "unicode": "f0c5", "created": 2, "filter": [ "duplicate", "clone", "copy" ], "aliases": [ "copy" ], "categories": [ "Text Editor Icons" ] }, { "name": "Paperclip", "id": "paperclip", "unicode": "f0c6", "created": 2, "filter": [ "attachment" ], "categories": [ "Text Editor Icons" ] }, { "name": "Floppy Outlined", "id": "floppy-o", "unicode": "f0c7", "created": 2, "aliases": [ "save" ], "categories": [ "Text Editor Icons" ] }, { "name": "Square", "id": "square", "unicode": "f0c8", "created": 2, "filter": [ "block", "box" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Bars", "id": "bars", "unicode": "f0c9", "created": 2, "aliases": [ "navicon", "reorder" ], "filter": [ "menu", "drag", "reorder", "settings", "list", "ul", "ol", "checklist", "todo", "list", "hamburger" ], "categories": [ "Web Application Icons" ] }, { "name": "list-ul", "id": "list-ul", "unicode": "f0ca", "created": 2, "filter": [ "ul", "ol", "checklist", "todo", "list" ], "categories": [ "Text Editor Icons" ] }, { "name": "list-ol", "id": "list-ol", "unicode": "f0cb", "created": 2, "filter": [ "ul", "ol", "checklist", "list", "todo", "list", "numbers" ], "categories": [ "Text Editor Icons" ] }, { "name": "Strikethrough", "id": "strikethrough", "unicode": "f0cc", "created": 2, "categories": [ "Text Editor Icons" ] }, { "name": "Underline", "id": "underline", "unicode": "f0cd", "created": 2, "categories": [ "Text Editor Icons" ] }, { "name": "table", "id": "table", "unicode": "f0ce", "created": 2, "filter": [ "data", "excel", "spreadsheet" ], "categories": [ "Text Editor Icons" ] }, { "name": "magic", "id": "magic", "unicode": "f0d0", "created": 2, "filter": [ "wizard", "automatic", "autocomplete" ], "categories": [ "Web Application Icons" ] }, { "name": "truck", "id": "truck", "unicode": "f0d1", "created": 2, "filter": [ "shipping" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Pinterest", "id": "pinterest", "unicode": "f0d2", "created": 2, "categories": [ "Brand Icons" ] }, { "name": "Pinterest Square", "id": "pinterest-square", "unicode": "f0d3", "created": 2, "categories": [ "Brand Icons" ] }, { "name": "Google Plus Square", "id": "google-plus-square", "unicode": "f0d4", "created": 2, "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Google Plus", "id": "google-plus", "unicode": "f0d5", "created": 2, "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Money", "id": "money", "unicode": "f0d6", "created": 2, "filter": [ "cash", "money", "buy", "checkout", "purchase", "payment" ], "categories": [ "Web Application Icons", "Currency Icons" ] }, { "name": "Caret Down", "id": "caret-down", "unicode": "f0d7", "created": 2, "filter": [ "more", "dropdown", "menu", "triangle down", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Up", "id": "caret-up", "unicode": "f0d8", "created": 2, "filter": [ "triangle up", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Left", "id": "caret-left", "unicode": "f0d9", "created": 2, "filter": [ "previous", "back", "triangle left", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Right", "id": "caret-right", "unicode": "f0da", "created": 2, "filter": [ "next", "forward", "triangle right", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Columns", "id": "columns", "unicode": "f0db", "created": 2, "filter": [ "split", "panes" ], "categories": [ "Text Editor Icons" ] }, { "name": "Sort", "id": "sort", "unicode": "f0dc", "created": 2, "filter": [ "order" ], "aliases": [ "unsorted" ], "categories": [ "Web Application Icons" ] }, { "name": "Sort Descending", "id": "sort-desc", "unicode": "f0dd", "created": 2, "filter": [ "dropdown", "more", "menu", "arrow" ], "aliases": [ "sort-down" ], "categories": [ "Web Application Icons" ] }, { "name": "Sort Ascending", "id": "sort-asc", "unicode": "f0de", "created": 2, "aliases": [ "sort-up" ], "filter": [ "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Envelope", "id": "envelope", "unicode": "f0e0", "created": 2, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "LinkedIn", "id": "linkedin", "unicode": "f0e1", "created": 2, "categories": [ "Brand Icons" ] }, { "name": "Undo", "id": "undo", "unicode": "f0e2", "created": 2, "filter": [ "back" ], "aliases": [ "rotate-left" ], "categories": [ "Text Editor Icons" ] }, { "name": "Gavel", "id": "gavel", "unicode": "f0e3", "created": 2, "filter": [ "judge", "lawyer", "opinion" ], "aliases": [ "legal" ], "categories": [ "Web Application Icons" ] }, { "name": "Tachometer", "id": "tachometer", "unicode": "f0e4", "created": 2, "filter": [ "speedometer", "fast" ], "aliases": [ "dashboard" ], "categories": [ "Web Application Icons" ] }, { "name": "comment-o", "id": "comment-o", "unicode": "f0e5", "created": 2, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "comments-o", "id": "comments-o", "unicode": "f0e6", "created": 2, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Lightning Bolt", "id": "bolt", "unicode": "f0e7", "created": 2, "filter": [ "lightning", "weather" ], "aliases": [ "flash" ], "categories": [ "Web Application Icons" ] }, { "name": "Sitemap", "id": "sitemap", "unicode": "f0e8", "created": 2, "filter": [ "directory", "hierarchy", "organization" ], "categories": [ "Web Application Icons" ] }, { "name": "Umbrella", "id": "umbrella", "unicode": "f0e9", "created": 2, "categories": [ "Web Application Icons" ] }, { "name": "Clipboard", "id": "clipboard", "unicode": "f0ea", "created": 2, "filter": [ "copy" ], "aliases": [ "paste" ], "categories": [ "Text Editor Icons" ] }, { "name": "Lightbulb Outlined", "id": "lightbulb-o", "unicode": "f0eb", "created": 3, "filter": [ "idea", "inspiration" ], "categories": [ "Web Application Icons" ] }, { "name": "Exchange", "id": "exchange", "unicode": "f0ec", "created": 3, "filter": [ "transfer", "arrows", "arrow" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Cloud Download", "id": "cloud-download", "unicode": "f0ed", "created": 3, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "Cloud Upload", "id": "cloud-upload", "unicode": "f0ee", "created": 3, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "user-md", "id": "user-md", "unicode": "f0f0", "created": 2, "filter": [ "doctor", "profile", "medical", "nurse" ], "categories": [ "Medical Icons" ] }, { "name": "Stethoscope", "id": "stethoscope", "unicode": "f0f1", "created": 3, "categories": [ "Medical Icons" ] }, { "name": "Suitcase", "id": "suitcase", "unicode": "f0f2", "created": 3, "filter": [ "trip", "luggage", "travel", "move", "baggage" ], "categories": [ "Web Application Icons" ] }, { "name": "Bell Outlined", "id": "bell-o", "unicode": "f0a2", "created": 3, "filter": [ "alert", "reminder", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Coffee", "id": "coffee", "unicode": "f0f4", "created": 3, "filter": [ "morning", "mug", "breakfast", "tea", "drink", "cafe" ], "categories": [ "Web Application Icons" ] }, { "name": "Cutlery", "id": "cutlery", "unicode": "f0f5", "created": 3, "filter": [ "food", "restaurant", "spoon", "knife", "dinner", "eat" ], "categories": [ "Web Application Icons" ] }, { "name": "File Text Outlined", "id": "file-text-o", "unicode": "f0f6", "created": 3, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "Building Outlined", "id": "building-o", "unicode": "f0f7", "created": 3, "filter": [ "work", "business", "apartment", "office", "company" ], "categories": [ "Web Application Icons" ] }, { "name": "hospital Outlined", "id": "hospital-o", "unicode": "f0f8", "created": 3, "filter": [ "building" ], "categories": [ "Medical Icons" ] }, { "name": "ambulance", "id": "ambulance", "unicode": "f0f9", "created": 3, "filter": [ "vehicle", "support", "help" ], "categories": [ "Medical Icons", "Transportation Icons" ] }, { "name": "medkit", "id": "medkit", "unicode": "f0fa", "created": 3, "filter": [ "first aid", "firstaid", "help", "support", "health" ], "categories": [ "Medical Icons" ] }, { "name": "fighter-jet", "id": "fighter-jet", "unicode": "f0fb", "created": 3, "filter": [ "fly", "plane", "airplane", "quick", "fast", "travel" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "beer", "id": "beer", "unicode": "f0fc", "created": 3, "filter": [ "alcohol", "stein", "drink", "mug", "bar", "liquor" ], "categories": [ "Web Application Icons" ] }, { "name": "H Square", "id": "h-square", "unicode": "f0fd", "created": 3, "filter": [ "hospital", "hotel" ], "categories": [ "Medical Icons" ] }, { "name": "Plus Square", "id": "plus-square", "unicode": "f0fe", "created": 3, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Medical Icons", "Web Application Icons", "Form Control Icons" ] }, { "name": "Angle Double Left", "id": "angle-double-left", "unicode": "f100", "created": 3, "filter": [ "laquo", "quote", "previous", "back", "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "Angle Double Right", "id": "angle-double-right", "unicode": "f101", "created": 3, "filter": [ "raquo", "quote", "next", "forward", "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "Angle Double Up", "id": "angle-double-up", "unicode": "f102", "created": 3, "filter": [ "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "Angle Double Down", "id": "angle-double-down", "unicode": "f103", "created": 3, "filter": [ "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "angle-left", "id": "angle-left", "unicode": "f104", "created": 3, "filter": [ "previous", "back", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "angle-right", "id": "angle-right", "unicode": "f105", "created": 3, "filter": [ "next", "forward", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "angle-up", "id": "angle-up", "unicode": "f106", "created": 3, "filter": [ "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "angle-down", "id": "angle-down", "unicode": "f107", "created": 3, "filter": [ "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Desktop", "id": "desktop", "unicode": "f108", "created": 3, "filter": [ "monitor", "screen", "desktop", "computer", "demo", "device" ], "categories": [ "Web Application Icons" ] }, { "name": "Laptop", "id": "laptop", "unicode": "f109", "created": 3, "filter": [ "demo", "computer", "device" ], "categories": [ "Web Application Icons" ] }, { "name": "tablet", "id": "tablet", "unicode": "f10a", "created": 3, "filter": [ "ipad", "device" ], "categories": [ "Web Application Icons" ] }, { "name": "Mobile Phone", "id": "mobile", "unicode": "f10b", "created": 3, "filter": [ "cell phone", "cellphone", "text", "call", "iphone", "number", "telephone" ], "aliases": [ "mobile-phone" ], "categories": [ "Web Application Icons" ] }, { "name": "Circle Outlined", "id": "circle-o", "unicode": "f10c", "created": 3, "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "quote-left", "id": "quote-left", "unicode": "f10d", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "quote-right", "id": "quote-right", "unicode": "f10e", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "Spinner", "id": "spinner", "unicode": "f110", "created": 3, "filter": [ "loading", "progress" ], "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "Circle", "id": "circle", "unicode": "f111", "created": 3, "filter": [ "dot", "notification" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Reply", "id": "reply", "unicode": "f112", "created": 3, "aliases": [ "mail-reply" ], "categories": [ "Web Application Icons" ] }, { "name": "GitHub Alt", "id": "github-alt", "unicode": "f113", "created": 3, "url": "github.com/logos", "filter": [ "octocat" ], "categories": [ "Brand Icons" ] }, { "name": "Folder Outlined", "id": "folder-o", "unicode": "f114", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "Folder Open Outlined", "id": "folder-open-o", "unicode": "f115", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "Smile Outlined", "id": "smile-o", "unicode": "f118", "created": 3.1, "filter": [ "face", "emoticon", "happy", "approve", "satisfied", "rating" ], "categories": [ "Web Application Icons" ] }, { "name": "Frown Outlined", "id": "frown-o", "unicode": "f119", "created": 3.1, "filter": [ "face", "emoticon", "sad", "disapprove", "rating" ], "categories": [ "Web Application Icons" ] }, { "name": "Meh Outlined", "id": "meh-o", "unicode": "f11a", "created": 3.1, "filter": [ "face", "emoticon", "rating", "neutral" ], "categories": [ "Web Application Icons" ] }, { "name": "Gamepad", "id": "gamepad", "unicode": "f11b", "created": 3.1, "filter": [ "controller" ], "categories": [ "Web Application Icons" ] }, { "name": "Keyboard Outlined", "id": "keyboard-o", "unicode": "f11c", "created": 3.1, "filter": [ "type", "input" ], "categories": [ "Web Application Icons" ] }, { "name": "Flag Outlined", "id": "flag-o", "unicode": "f11d", "created": 3.1, "filter": [ "report", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "flag-checkered", "id": "flag-checkered", "unicode": "f11e", "created": 3.1, "filter": [ "report", "notification", "notify" ], "categories": [ "Web Application Icons" ] }, { "name": "Terminal", "id": "terminal", "unicode": "f120", "created": 3.1, "filter": [ "command", "prompt", "code" ], "categories": [ "Web Application Icons" ] }, { "name": "Code", "id": "code", "unicode": "f121", "created": 3.1, "filter": [ "html", "brackets" ], "categories": [ "Web Application Icons" ] }, { "name": "reply-all", "id": "reply-all", "unicode": "f122", "created": 3.1, "aliases": [ "mail-reply-all" ], "categories": [ "Web Application Icons" ] }, { "name": "Star Half Outlined", "id": "star-half-o", "unicode": "f123", "created": 3.1, "filter": [ "award", "achievement", "rating", "score" ], "aliases": [ "star-half-empty", "star-half-full" ], "categories": [ "Web Application Icons" ] }, { "name": "location-arrow", "id": "location-arrow", "unicode": "f124", "created": 3.1, "filter": [ "map", "coordinates", "location", "address", "place", "where" ], "categories": [ "Web Application Icons" ] }, { "name": "crop", "id": "crop", "unicode": "f125", "created": 3.1, "categories": [ "Web Application Icons" ] }, { "name": "code-fork", "id": "code-fork", "unicode": "f126", "created": 3.1, "filter": [ "git", "fork", "vcs", "svn", "github", "rebase", "version", "merge" ], "categories": [ "Web Application Icons" ] }, { "name": "Chain Broken", "id": "chain-broken", "unicode": "f127", "created": 3.1, "filter": [ "remove" ], "aliases": [ "unlink" ], "categories": [ "Text Editor Icons" ] }, { "name": "Question", "id": "question", "unicode": "f128", "created": 3.1, "filter": [ "help", "information", "unknown", "support" ], "categories": [ "Web Application Icons" ] }, { "name": "Info", "id": "info", "unicode": "f129", "created": 3.1, "filter": [ "help", "information", "more", "details" ], "categories": [ "Web Application Icons" ] }, { "name": "exclamation", "id": "exclamation", "unicode": "f12a", "created": 3.1, "filter": [ "warning", "error", "problem", "notification", "notify", "alert" ], "categories": [ "Web Application Icons" ] }, { "name": "superscript", "id": "superscript", "unicode": "f12b", "created": 3.1, "filter": [ "exponential" ], "categories": [ "Text Editor Icons" ] }, { "name": "subscript", "id": "subscript", "unicode": "f12c", "created": 3.1, "categories": [ "Text Editor Icons" ] }, { "name": "eraser", "id": "eraser", "unicode": "f12d", "created": 3.1, "filter": [ "remove", "delete" ], "categories": [ "Text Editor Icons", "Web Application Icons" ] }, { "name": "Puzzle Piece", "id": "puzzle-piece", "unicode": "f12e", "created": 3.1, "filter": [ "addon", "add-on", "section" ], "categories": [ "Web Application Icons" ] }, { "name": "microphone", "id": "microphone", "unicode": "f130", "created": 3.1, "filter": [ "record", "voice", "sound" ], "categories": [ "Web Application Icons" ] }, { "name": "Microphone Slash", "id": "microphone-slash", "unicode": "f131", "created": 3.1, "filter": [ "record", "voice", "sound", "mute" ], "categories": [ "Web Application Icons" ] }, { "name": "shield", "id": "shield", "unicode": "f132", "created": 3.1, "filter": [ "award", "achievement", "security", "winner" ], "categories": [ "Web Application Icons" ] }, { "name": "calendar-o", "id": "calendar-o", "unicode": "f133", "created": 3.1, "filter": [ "date", "time", "when", "event" ], "categories": [ "Web Application Icons" ] }, { "name": "fire-extinguisher", "id": "fire-extinguisher", "unicode": "f134", "created": 3.1, "categories": [ "Web Application Icons" ] }, { "name": "rocket", "id": "rocket", "unicode": "f135", "created": 3.1, "filter": [ "app" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "MaxCDN", "id": "maxcdn", "unicode": "f136", "created": 3.1, "categories": [ "Brand Icons" ] }, { "name": "Chevron Circle Left", "id": "chevron-circle-left", "unicode": "f137", "created": 3.1, "filter": [ "previous", "back", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Chevron Circle Right", "id": "chevron-circle-right", "unicode": "f138", "created": 3.1, "filter": [ "next", "forward", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Chevron Circle Up", "id": "chevron-circle-up", "unicode": "f139", "created": 3.1, "filter": [ "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Chevron Circle Down", "id": "chevron-circle-down", "unicode": "f13a", "created": 3.1, "filter": [ "more", "dropdown", "menu", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "HTML 5 Logo", "id": "html5", "unicode": "f13b", "created": 3.1, "code": [ "code", "html5" ], "categories": [ "Brand Icons" ] }, { "name": "CSS 3 Logo", "id": "css3", "unicode": "f13c", "created": 3.1, "filter": [ "code" ], "categories": [ "Brand Icons" ] }, { "name": "Anchor", "id": "anchor", "unicode": "f13d", "created": 3.1, "filter": [ "link" ], "categories": [ "Web Application Icons" ] }, { "name": "Unlock Alt", "id": "unlock-alt", "unicode": "f13e", "created": 3.1, "filter": [ "protect", "admin", "password", "lock" ], "categories": [ "Web Application Icons" ] }, { "name": "Bullseye", "id": "bullseye", "unicode": "f140", "created": 3.1, "filter": [ "target" ], "categories": [ "Web Application Icons" ] }, { "name": "Ellipsis Horizontal", "id": "ellipsis-h", "unicode": "f141", "created": 3.1, "filter": [ "dots" ], "categories": [ "Web Application Icons" ] }, { "name": "Ellipsis Vertical", "id": "ellipsis-v", "unicode": "f142", "created": 3.1, "filter": [ "dots" ], "categories": [ "Web Application Icons" ] }, { "name": "RSS Square", "id": "rss-square", "unicode": "f143", "created": 3.1, "filter": [ "feed", "blog" ], "categories": [ "Web Application Icons" ] }, { "name": "Play Circle", "id": "play-circle", "unicode": "f144", "created": 3.1, "filter": [ "start", "playing" ], "categories": [ "Video Player Icons" ] }, { "name": "Ticket", "id": "ticket", "unicode": "f145", "created": 3.1, "filter": [ "movie", "pass", "support" ], "categories": [ "Web Application Icons" ] }, { "name": "Minus Square", "id": "minus-square", "unicode": "f146", "created": 3.1, "filter": [ "hide", "minify", "delete", "remove", "trash", "hide", "collapse" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Minus Square Outlined", "id": "minus-square-o", "unicode": "f147", "created": 3.1, "filter": [ "hide", "minify", "delete", "remove", "trash", "hide", "collapse" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Level Up", "id": "level-up", "unicode": "f148", "created": 3.1, "filter": [ "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Level Down", "id": "level-down", "unicode": "f149", "created": 3.1, "filter": [ "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Square", "id": "check-square", "unicode": "f14a", "created": 3.1, "filter": [ "checkmark", "done", "todo", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Pencil Square", "id": "pencil-square", "unicode": "f14b", "created": 3.1, "filter": [ "write", "edit", "update" ], "categories": [ "Web Application Icons" ] }, { "name": "External Link Square", "id": "external-link-square", "unicode": "f14c", "created": 3.1, "filter": [ "open", "new" ], "categories": [ "Web Application Icons" ] }, { "name": "Share Square", "id": "share-square", "unicode": "f14d", "created": 3.1, "filter": [ "social", "send" ], "categories": [ "Web Application Icons" ] }, { "name": "Compass", "id": "compass", "unicode": "f14e", "created": 3.2, "filter": [ "safari", "directory", "menu", "location" ], "categories": [ "Web Application Icons" ] }, { "name": "Caret Square Outlined Down", "id": "caret-square-o-down", "unicode": "f150", "created": 3.2, "aliases": [ "toggle-down" ], "filter": [ "more", "dropdown", "menu" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Caret Square Outlined Up", "id": "caret-square-o-up", "unicode": "f151", "created": 3.2, "aliases": [ "toggle-up" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Caret Square Outlined Right", "id": "caret-square-o-right", "unicode": "f152", "created": 3.2, "filter": [ "next", "forward" ], "aliases": [ "toggle-right" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Euro (EUR)", "id": "eur", "unicode": "f153", "created": 3.2, "aliases": [ "euro" ], "categories": [ "Currency Icons" ] }, { "name": "GBP", "id": "gbp", "unicode": "f154", "created": 3.2, "categories": [ "Currency Icons" ] }, { "name": "US Dollar", "id": "usd", "unicode": "f155", "created": 3.2, "aliases": [ "dollar" ], "categories": [ "Currency Icons" ] }, { "name": "Indian Rupee (INR)", "id": "inr", "unicode": "f156", "created": 3.2, "aliases": [ "rupee" ], "categories": [ "Currency Icons" ] }, { "name": "Japanese Yen (JPY)", "id": "jpy", "unicode": "f157", "created": 3.2, "aliases": [ "cny", "rmb", "yen" ], "categories": [ "Currency Icons" ] }, { "name": "Russian Ruble (RUB)", "id": "rub", "unicode": "f158", "created": 4, "aliases": [ "ruble", "rouble" ], "categories": [ "Currency Icons" ] }, { "name": "Korean Won (KRW)", "id": "krw", "unicode": "f159", "created": 3.2, "aliases": [ "won" ], "categories": [ "Currency Icons" ] }, { "name": "Bitcoin (BTC)", "id": "btc", "unicode": "f15a", "created": 3.2, "aliases": [ "bitcoin" ], "categories": [ "Currency Icons", "Brand Icons" ] }, { "name": "File", "id": "file", "unicode": "f15b", "created": 3.2, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "File Text", "id": "file-text", "unicode": "f15c", "created": 3.2, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "Sort Alpha Ascending", "id": "sort-alpha-asc", "unicode": "f15d", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Alpha Descending", "id": "sort-alpha-desc", "unicode": "f15e", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Amount Ascending", "id": "sort-amount-asc", "unicode": "f160", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Amount Descending", "id": "sort-amount-desc", "unicode": "f161", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Numeric Ascending", "id": "sort-numeric-asc", "unicode": "f162", "created": 3.2, "filter": [ "numbers" ], "categories": [ "Web Application Icons" ] }, { "name": "Sort Numeric Descending", "id": "sort-numeric-desc", "unicode": "f163", "created": 3.2, "filter": [ "numbers" ], "categories": [ "Web Application Icons" ] }, { "name": "thumbs-up", "id": "thumbs-up", "unicode": "f164", "created": 3.2, "filter": [ "like", "favorite", "approve", "agree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "thumbs-down", "id": "thumbs-down", "unicode": "f165", "created": 3.2, "filter": [ "dislike", "disapprove", "disagree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "YouTube Square", "id": "youtube-square", "unicode": "f166", "created": 3.2, "filter": [ "video", "film" ], "categories": [ "Brand Icons" ] }, { "name": "YouTube", "id": "youtube", "unicode": "f167", "created": 3.2, "filter": [ "video", "film" ], "categories": [ "Brand Icons" ] }, { "name": "Xing", "id": "xing", "unicode": "f168", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Xing Square", "id": "xing-square", "unicode": "f169", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "YouTube Play", "id": "youtube-play", "unicode": "f16a", "created": 3.2, "filter": [ "start", "playing" ], "categories": [ "Brand Icons", "Video Player Icons" ] }, { "name": "Dropbox", "id": "dropbox", "unicode": "f16b", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Stack Overflow", "id": "stack-overflow", "unicode": "f16c", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Instagram", "id": "instagram", "unicode": "f16d", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Flickr", "id": "flickr", "unicode": "f16e", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "App.net", "id": "adn", "unicode": "f170", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Bitbucket", "id": "bitbucket", "unicode": "f171", "created": 3.2, "filter": [ "git" ], "categories": [ "Brand Icons" ] }, { "name": "Bitbucket Square", "id": "bitbucket-square", "unicode": "f172", "created": 3.2, "filter": [ "git" ], "categories": [ "Brand Icons" ] }, { "name": "Tumblr", "id": "tumblr", "unicode": "f173", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Tumblr Square", "id": "tumblr-square", "unicode": "f174", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Long Arrow Down", "id": "long-arrow-down", "unicode": "f175", "created": 3.2, "categories": [ "Directional Icons" ] }, { "name": "Long Arrow Up", "id": "long-arrow-up", "unicode": "f176", "created": 3.2, "categories": [ "Directional Icons" ] }, { "name": "Long Arrow Left", "id": "long-arrow-left", "unicode": "f177", "created": 3.2, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "Long Arrow Right", "id": "long-arrow-right", "unicode": "f178", "created": 3.2, "categories": [ "Directional Icons" ] }, { "name": "Apple", "id": "apple", "unicode": "f179", "created": 3.2, "filter": [ "osx", "food" ], "categories": [ "Brand Icons" ] }, { "name": "Windows", "id": "windows", "unicode": "f17a", "created": 3.2, "filter": [ "microsoft" ], "categories": [ "Brand Icons" ] }, { "name": "Android", "id": "android", "unicode": "f17b", "created": 3.2, "filter": [ "robot" ], "categories": [ "Brand Icons" ] }, { "name": "Linux", "id": "linux", "unicode": "f17c", "created": 3.2, "filter": [ "tux" ], "categories": [ "Brand Icons" ] }, { "name": "Dribbble", "id": "dribbble", "unicode": "f17d", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Skype", "id": "skype", "unicode": "f17e", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Foursquare", "id": "foursquare", "unicode": "f180", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Trello", "id": "trello", "unicode": "f181", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Female", "id": "female", "unicode": "f182", "created": 3.2, "filter": [ "woman", "user", "person", "profile" ], "categories": [ "Web Application Icons" ] }, { "name": "Male", "id": "male", "unicode": "f183", "created": 3.2, "filter": [ "man", "user", "person", "profile" ], "categories": [ "Web Application Icons" ] }, { "name": "Gratipay (Gittip)", "id": "gratipay", "unicode": "f184", "created": 3.2, "aliases": [ "gittip" ], "filter": [ "heart", "like", "favorite", "love" ], "categories": [ "Brand Icons" ] }, { "name": "Sun Outlined", "id": "sun-o", "unicode": "f185", "created": 3.2, "filter": [ "weather", "contrast", "lighter", "brighten", "day" ], "categories": [ "Web Application Icons" ] }, { "name": "Moon Outlined", "id": "moon-o", "unicode": "f186", "created": 3.2, "filter": [ "night", "darker", "contrast" ], "categories": [ "Web Application Icons" ] }, { "name": "Archive", "id": "archive", "unicode": "f187", "created": 3.2, "filter": [ "box", "storage" ], "categories": [ "Web Application Icons" ] }, { "name": "Bug", "id": "bug", "unicode": "f188", "created": 3.2, "filter": [ "report", "insect" ], "categories": [ "Web Application Icons" ] }, { "name": "VK", "id": "vk", "unicode": "f189", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Weibo", "id": "weibo", "unicode": "f18a", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Renren", "id": "renren", "unicode": "f18b", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Pagelines", "id": "pagelines", "unicode": "f18c", "created": 4, "filter": [ "leaf", "leaves", "tree", "plant", "eco", "nature" ], "categories": [ "Brand Icons" ] }, { "name": "Stack Exchange", "id": "stack-exchange", "unicode": "f18d", "created": 4, "categories": [ "Brand Icons" ] }, { "name": "Arrow Circle Outlined Right", "id": "arrow-circle-o-right", "unicode": "f18e", "created": 4, "filter": [ "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Outlined Left", "id": "arrow-circle-o-left", "unicode": "f190", "created": 4, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Square Outlined Left", "id": "caret-square-o-left", "unicode": "f191", "created": 4, "filter": [ "previous", "back" ], "aliases": [ "toggle-left" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Dot Circle Outlined", "id": "dot-circle-o", "unicode": "f192", "created": 4, "filter": [ "target", "bullseye", "notification" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Wheelchair", "id": "wheelchair", "unicode": "f193", "created": 4, "filter": [ "handicap", "person" ], "categories": [ "Web Application Icons", "Medical Icons", "Transportation Icons", "Accessibility Icons" ] }, { "name": "Vimeo Square", "id": "vimeo-square", "unicode": "f194", "created": 4, "categories": [ "Brand Icons" ] }, { "name": "Turkish Lira (TRY)", "id": "try", "unicode": "f195", "created": 4, "aliases": [ "turkish-lira" ], "categories": [ "Currency Icons" ] }, { "name": "Plus Square Outlined", "id": "plus-square-o", "unicode": "f196", "created": 4, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Space Shuttle", "id": "space-shuttle", "unicode": "f197", "created": 4.1, "filter": null, "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Slack Logo", "id": "slack", "unicode": "f198", "created": 4.1, "filter": [ "hashtag", "anchor", "hash" ], "categories": [ "Brand Icons" ] }, { "name": "Envelope Square", "id": "envelope-square", "unicode": "f199", "created": 4.1, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "WordPress Logo", "id": "wordpress", "unicode": "f19a", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "OpenID", "id": "openid", "unicode": "f19b", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "University", "id": "university", "unicode": "f19c", "created": 4.1, "aliases": [ "institution", "bank" ], "categories": [ "Web Application Icons" ] }, { "name": "Graduation Cap", "id": "graduation-cap", "unicode": "f19d", "created": 4.1, "aliases": [ "mortar-board" ], "filter": [ "learning", "school", "student" ], "categories": [ "Web Application Icons" ] }, { "name": "Yahoo Logo", "id": "yahoo", "unicode": "f19e", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Google Logo", "id": "google", "unicode": "f1a0", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "reddit Logo", "id": "reddit", "unicode": "f1a1", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "reddit Square", "id": "reddit-square", "unicode": "f1a2", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "StumbleUpon Circle", "id": "stumbleupon-circle", "unicode": "f1a3", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "StumbleUpon Logo", "id": "stumbleupon", "unicode": "f1a4", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Delicious Logo", "id": "delicious", "unicode": "f1a5", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Digg Logo", "id": "digg", "unicode": "f1a6", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Pied Piper PP Logo (Old)", "id": "pied-piper-pp", "unicode": "f1a7", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Pied Piper Alternate Logo", "id": "pied-piper-alt", "unicode": "f1a8", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Drupal Logo", "id": "drupal", "unicode": "f1a9", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Joomla Logo", "id": "joomla", "unicode": "f1aa", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Language", "id": "language", "unicode": "f1ab", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Fax", "id": "fax", "unicode": "f1ac", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Building", "id": "building", "unicode": "f1ad", "created": 4.1, "filter": [ "work", "business", "apartment", "office", "company" ], "categories": [ "Web Application Icons" ] }, { "name": "Child", "id": "child", "unicode": "f1ae", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Paw", "id": "paw", "unicode": "f1b0", "created": 4.1, "filter": [ "pet" ], "categories": [ "Web Application Icons" ] }, { "name": "spoon", "id": "spoon", "unicode": "f1b1", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Cube", "id": "cube", "unicode": "f1b2", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Cubes", "id": "cubes", "unicode": "f1b3", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Behance", "id": "behance", "unicode": "f1b4", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Behance Square", "id": "behance-square", "unicode": "f1b5", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Steam", "id": "steam", "unicode": "f1b6", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Steam Square", "id": "steam-square", "unicode": "f1b7", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Recycle", "id": "recycle", "unicode": "f1b8", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Car", "id": "car", "unicode": "f1b9", "created": 4.1, "aliases": [ "automobile" ], "filter": [ "vehicle" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Taxi", "id": "taxi", "unicode": "f1ba", "created": 4.1, "aliases": [ "cab" ], "filter": [ "vehicle" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Tree", "id": "tree", "unicode": "f1bb", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Spotify", "id": "spotify", "unicode": "f1bc", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "deviantART", "id": "deviantart", "unicode": "f1bd", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "SoundCloud", "id": "soundcloud", "unicode": "f1be", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Database", "id": "database", "unicode": "f1c0", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "PDF File Outlined", "id": "file-pdf-o", "unicode": "f1c1", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Word File Outlined", "id": "file-word-o", "unicode": "f1c2", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Excel File Outlined", "id": "file-excel-o", "unicode": "f1c3", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Powerpoint File Outlined", "id": "file-powerpoint-o", "unicode": "f1c4", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Image File Outlined", "id": "file-image-o", "unicode": "f1c5", "created": 4.1, "aliases": [ "file-photo-o", "file-picture-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Archive File Outlined", "id": "file-archive-o", "unicode": "f1c6", "created": 4.1, "aliases": [ "file-zip-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Audio File Outlined", "id": "file-audio-o", "unicode": "f1c7", "created": 4.1, "aliases": [ "file-sound-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Video File Outlined", "id": "file-video-o", "unicode": "f1c8", "created": 4.1, "aliases": [ "file-movie-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Code File Outlined", "id": "file-code-o", "unicode": "f1c9", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Vine", "id": "vine", "unicode": "f1ca", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Codepen", "id": "codepen", "unicode": "f1cb", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "jsFiddle", "id": "jsfiddle", "unicode": "f1cc", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Life Ring", "id": "life-ring", "unicode": "f1cd", "created": 4.1, "aliases": [ { "life-bouy": "Deprecated - remove in 5.0.0" }, "life-buoy", "life-saver", "support" ], "categories": [ "Web Application Icons" ] }, { "name": "Circle Outlined Notched", "id": "circle-o-notch", "unicode": "f1ce", "created": 4.1, "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "Rebel Alliance", "id": "rebel", "unicode": "f1d0", "created": 4.1, "aliases": [ "ra", "resistance" ], "categories": [ "Brand Icons" ] }, { "name": "Galactic Empire", "id": "empire", "unicode": "f1d1", "created": 4.1, "aliases": [ "ge" ], "categories": [ "Brand Icons" ] }, { "name": "Git Square", "id": "git-square", "unicode": "f1d2", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Git", "id": "git", "unicode": "f1d3", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Hacker News", "id": "hacker-news", "unicode": "f1d4", "created": 4.1, "aliases": [ "y-combinator-square", "yc-square" ], "categories": [ "Brand Icons" ] }, { "name": "Tencent Weibo", "id": "tencent-weibo", "unicode": "f1d5", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "QQ", "id": "qq", "unicode": "f1d6", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Weixin (WeChat)", "id": "weixin", "unicode": "f1d7", "created": 4.1, "aliases": [ "wechat" ], "categories": [ "Brand Icons" ] }, { "name": "Paper Plane", "id": "paper-plane", "unicode": "f1d8", "created": 4.1, "aliases": [ "send" ], "categories": [ "Web Application Icons" ] }, { "name": "Paper Plane Outlined", "id": "paper-plane-o", "unicode": "f1d9", "created": 4.1, "aliases": [ "send-o" ], "categories": [ "Web Application Icons" ] }, { "name": "History", "id": "history", "unicode": "f1da", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Circle Outlined Thin", "id": "circle-thin", "unicode": "f1db", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "header", "id": "header", "unicode": "f1dc", "created": 4.1, "filter": [ "heading" ], "categories": [ "Text Editor Icons" ] }, { "name": "paragraph", "id": "paragraph", "unicode": "f1dd", "created": 4.1, "categories": [ "Text Editor Icons" ] }, { "name": "Sliders", "id": "sliders", "unicode": "f1de", "created": 4.1, "filter": [ "settings" ], "categories": [ "Web Application Icons" ] }, { "name": "Share Alt", "id": "share-alt", "unicode": "f1e0", "created": 4.1, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Share Alt Square", "id": "share-alt-square", "unicode": "f1e1", "created": 4.1, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Bomb", "id": "bomb", "unicode": "f1e2", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Futbol Outlined", "id": "futbol-o", "unicode": "f1e3", "created": 4.2, "aliases": [ "soccer-ball-o" ], "categories": [ "Web Application Icons" ] }, { "name": "TTY", "id": "tty", "unicode": "f1e4", "created": 4.2, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Binoculars", "id": "binoculars", "unicode": "f1e5", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Plug", "id": "plug", "unicode": "f1e6", "created": 4.2, "filter": [ "power", "connect" ], "categories": [ "Web Application Icons" ] }, { "name": "Slideshare", "id": "slideshare", "unicode": "f1e7", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Twitch", "id": "twitch", "unicode": "f1e8", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Yelp", "id": "yelp", "unicode": "f1e9", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Newspaper Outlined", "id": "newspaper-o", "unicode": "f1ea", "created": 4.2, "filter": [ "press" ], "categories": [ "Web Application Icons" ] }, { "name": "WiFi", "id": "wifi", "unicode": "f1eb", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Calculator", "id": "calculator", "unicode": "f1ec", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Paypal", "id": "paypal", "unicode": "f1ed", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Google Wallet", "id": "google-wallet", "unicode": "f1ee", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Visa Credit Card", "id": "cc-visa", "unicode": "f1f0", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "MasterCard Credit Card", "id": "cc-mastercard", "unicode": "f1f1", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Discover Credit Card", "id": "cc-discover", "unicode": "f1f2", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "American Express Credit Card", "id": "cc-amex", "unicode": "f1f3", "created": 4.2, "filter": [ "amex" ], "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Paypal Credit Card", "id": "cc-paypal", "unicode": "f1f4", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Stripe Credit Card", "id": "cc-stripe", "unicode": "f1f5", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Bell Slash", "id": "bell-slash", "unicode": "f1f6", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Bell Slash Outlined", "id": "bell-slash-o", "unicode": "f1f7", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Trash", "id": "trash", "unicode": "f1f8", "created": 4.2, "filter": [ "garbage", "delete", "remove", "hide" ], "categories": [ "Web Application Icons" ] }, { "name": "Copyright", "id": "copyright", "unicode": "f1f9", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "At", "id": "at", "unicode": "f1fa", "created": 4.2, "filter": [ "email", "e-mail" ], "categories": [ "Web Application Icons" ] }, { "name": "Eyedropper", "id": "eyedropper", "unicode": "f1fb", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Paint Brush", "id": "paint-brush", "unicode": "f1fc", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Birthday Cake", "id": "birthday-cake", "unicode": "f1fd", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Area Chart", "id": "area-chart", "unicode": "f1fe", "created": 4.2, "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "Pie Chart", "id": "pie-chart", "unicode": "f200", "created": 4.2, "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "Line Chart", "id": "line-chart", "unicode": "f201", "created": 4.2, "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "last.fm", "id": "lastfm", "unicode": "f202", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "last.fm Square", "id": "lastfm-square", "unicode": "f203", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Toggle Off", "id": "toggle-off", "unicode": "f204", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Toggle On", "id": "toggle-on", "unicode": "f205", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Bicycle", "id": "bicycle", "unicode": "f206", "created": 4.2, "filter": [ "vehicle", "bike" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Bus", "id": "bus", "unicode": "f207", "created": 4.2, "filter": [ "vehicle" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "ioxhost", "id": "ioxhost", "unicode": "f208", "created": 4.2, "url": "ioxhost.co.uk", "categories": [ "Brand Icons" ] }, { "name": "AngelList", "id": "angellist", "unicode": "f209", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Closed Captions", "id": "cc", "unicode": "f20a", "created": 4.2, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Shekel (ILS)", "id": "ils", "unicode": "f20b", "created": 4.2, "aliases": [ "shekel", "sheqel" ], "categories": [ "Currency Icons" ] }, { "name": "meanpath", "id": "meanpath", "unicode": "f20c", "created": 4.2, "url": "meanpath.com", "categories": [ "Brand Icons" ] }, { "name": "BuySellAds", "id": "buysellads", "unicode": "f20d", "created": 4.3, "url": "buysellads.com", "categories": [ "Brand Icons" ] }, { "name": "Connect Develop", "id": "connectdevelop", "unicode": "f20e", "created": 4.3, "url": "connectdevelop.com", "categories": [ "Brand Icons" ] }, { "name": "DashCube", "id": "dashcube", "unicode": "f210", "created": 4.3, "url": "dashcube.com", "categories": [ "Brand Icons" ] }, { "name": "Forumbee", "id": "forumbee", "unicode": "f211", "created": 4.3, "url": "forumbee.com", "categories": [ "Brand Icons" ] }, { "name": "Leanpub", "id": "leanpub", "unicode": "f212", "created": 4.3, "url": "leanpub.com", "categories": [ "Brand Icons" ] }, { "name": "Sellsy", "id": "sellsy", "unicode": "f213", "created": 4.3, "url": "sellsy.com", "categories": [ "Brand Icons" ] }, { "name": "Shirts in Bulk", "id": "shirtsinbulk", "unicode": "f214", "created": 4.3, "url": "shirtsinbulk.com", "categories": [ "Brand Icons" ] }, { "name": "SimplyBuilt", "id": "simplybuilt", "unicode": "f215", "created": 4.3, "url": "simplybuilt.com", "categories": [ "Brand Icons" ] }, { "name": "skyatlas", "id": "skyatlas", "unicode": "f216", "created": 4.3, "url": "skyatlas.com", "categories": [ "Brand Icons" ] }, { "name": "Add to Shopping Cart", "id": "cart-plus", "unicode": "f217", "created": 4.3, "filter": [ "add", "shopping" ], "categories": [ "Web Application Icons" ] }, { "name": "Shopping Cart Arrow Down", "id": "cart-arrow-down", "unicode": "f218", "created": 4.3, "filter": [ "shopping" ], "categories": [ "Web Application Icons" ] }, { "name": "Diamond", "id": "diamond", "unicode": "f219", "created": 4.3, "filter": [ "gem", "gemstone" ], "categories": [ "Web Application Icons" ] }, { "name": "Ship", "id": "ship", "unicode": "f21a", "created": 4.3, "filter": [ "boat", "sea" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "User Secret", "id": "user-secret", "unicode": "f21b", "created": 4.3, "filter": [ "whisper", "spy", "incognito", "privacy" ], "categories": [ "Web Application Icons" ] }, { "name": "Motorcycle", "id": "motorcycle", "unicode": "f21c", "created": 4.3, "filter": [ "vehicle", "bike" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Street View", "id": "street-view", "unicode": "f21d", "created": 4.3, "filter": [ "map" ], "categories": [ "Web Application Icons" ] }, { "name": "Heartbeat", "id": "heartbeat", "unicode": "f21e", "created": 4.3, "filter": [ "ekg" ], "categories": [ "Web Application Icons", "Medical Icons" ] }, { "name": "Venus", "id": "venus", "unicode": "f221", "created": 4.3, "filter": [ "female" ], "categories": [ "Gender Icons" ] }, { "name": "Mars", "id": "mars", "unicode": "f222", "created": 4.3, "filter": [ "male" ], "categories": [ "Gender Icons" ] }, { "name": "Mercury", "id": "mercury", "unicode": "f223", "created": 4.3, "filter": [ "transgender" ], "categories": [ "Gender Icons" ] }, { "name": "Transgender", "id": "transgender", "unicode": "f224", "created": 4.3, "aliases": [ "intersex" ], "categories": [ "Gender Icons" ] }, { "name": "Transgender Alt", "id": "transgender-alt", "unicode": "f225", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Venus Double", "id": "venus-double", "unicode": "f226", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Double", "id": "mars-double", "unicode": "f227", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Venus Mars", "id": "venus-mars", "unicode": "f228", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Stroke", "id": "mars-stroke", "unicode": "f229", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Stroke Vertical", "id": "mars-stroke-v", "unicode": "f22a", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Stroke Horizontal", "id": "mars-stroke-h", "unicode": "f22b", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Neuter", "id": "neuter", "unicode": "f22c", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Genderless", "id": "genderless", "unicode": "f22d", "created": 4.4, "categories": [ "Gender Icons" ] }, { "name": "Facebook Official", "id": "facebook-official", "unicode": "f230", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "Pinterest P", "id": "pinterest-p", "unicode": "f231", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "What's App", "id": "whatsapp", "unicode": "f232", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "Server", "id": "server", "unicode": "f233", "created": 4.3, "categories": [ "Web Application Icons" ] }, { "name": "Add User", "id": "user-plus", "unicode": "f234", "created": 4.3, "filter": [ "sign up", "signup" ], "categories": [ "Web Application Icons" ] }, { "name": "Remove User", "id": "user-times", "unicode": "f235", "created": 4.3, "categories": [ "Web Application Icons" ] }, { "name": "Bed", "id": "bed", "unicode": "f236", "created": 4.3, "filter": [ "travel" ], "aliases": [ "hotel" ], "categories": [ "Web Application Icons" ] }, { "name": "Viacoin", "id": "viacoin", "unicode": "f237", "created": 4.3, "url": "viacoin.org", "categories": [ "Brand Icons" ] }, { "name": "Train", "id": "train", "unicode": "f238", "created": 4.3, "categories": [ "Transportation Icons" ] }, { "name": "Subway", "id": "subway", "unicode": "f239", "created": 4.3, "categories": [ "Transportation Icons" ] }, { "name": "Medium", "id": "medium", "unicode": "f23a", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "Y Combinator", "id": "y-combinator", "unicode": "f23b", "created": 4.4, "aliases": [ "yc" ], "categories": [ "Brand Icons" ] }, { "name": "Optin Monster", "id": "optin-monster", "unicode": "f23c", "created": 4.4, "url": "optinmonster.com", "categories": [ "Brand Icons" ] }, { "name": "OpenCart", "id": "opencart", "unicode": "f23d", "created": 4.4, "url": "opencart.com", "categories": [ "Brand Icons" ] }, { "name": "ExpeditedSSL", "id": "expeditedssl", "unicode": "f23e", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Battery Full", "id": "battery-full", "unicode": "f240", "created": 4.4, "aliases": [ "battery-4", "battery" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery 3/4 Full", "id": "battery-three-quarters", "unicode": "f241", "created": 4.4, "aliases": [ "battery-3" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery 1/2 Full", "id": "battery-half", "unicode": "f242", "created": 4.4, "aliases": [ "battery-2" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery 1/4 Full", "id": "battery-quarter", "unicode": "f243", "created": 4.4, "aliases": [ "battery-1" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery Empty", "id": "battery-empty", "unicode": "f244", "created": 4.4, "aliases": [ "battery-0" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Mouse Pointer", "id": "mouse-pointer", "unicode": "f245", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "I Beam Cursor", "id": "i-cursor", "unicode": "f246", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Object Group", "id": "object-group", "unicode": "f247", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Object Ungroup", "id": "object-ungroup", "unicode": "f248", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Sticky Note", "id": "sticky-note", "unicode": "f249", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Sticky Note Outlined", "id": "sticky-note-o", "unicode": "f24a", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "JCB Credit Card", "id": "cc-jcb", "unicode": "f24b", "created": 4.4, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Diner's Club Credit Card", "id": "cc-diners-club", "unicode": "f24c", "created": 4.4, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Clone", "id": "clone", "unicode": "f24d", "created": 4.4, "filter": [ "copy" ], "categories": [ "Web Application Icons" ] }, { "name": "Balance Scale", "id": "balance-scale", "unicode": "f24e", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Hourglass Outlined", "id": "hourglass-o", "unicode": "f250", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Hourglass Start", "id": "hourglass-start", "unicode": "f251", "created": 4.4, "aliases": [ "hourglass-1" ], "categories": [ "Web Application Icons" ] }, { "name": "Hourglass Half", "id": "hourglass-half", "unicode": "f252", "created": 4.4, "aliases": [ "hourglass-2" ], "categories": [ "Web Application Icons" ] }, { "name": "Hourglass End", "id": "hourglass-end", "unicode": "f253", "created": 4.4, "aliases": [ "hourglass-3" ], "categories": [ "Web Application Icons" ] }, { "name": "Hourglass", "id": "hourglass", "unicode": "f254", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Rock (Hand)", "id": "hand-rock-o", "unicode": "f255", "created": 4.4, "aliases": [ "hand-grab-o" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Paper (Hand)", "id": "hand-paper-o", "unicode": "f256", "created": 4.4, "aliases": [ "hand-stop-o" ], "filter": [ "stop" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Scissors (Hand)", "id": "hand-scissors-o", "unicode": "f257", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Lizard (Hand)", "id": "hand-lizard-o", "unicode": "f258", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Spock (Hand)", "id": "hand-spock-o", "unicode": "f259", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Hand Pointer", "id": "hand-pointer-o", "unicode": "f25a", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Hand Peace", "id": "hand-peace-o", "unicode": "f25b", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Trademark", "id": "trademark", "unicode": "f25c", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Registered Trademark", "id": "registered", "unicode": "f25d", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Creative Commons", "id": "creative-commons", "unicode": "f25e", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "GG Currency", "id": "gg", "unicode": "f260", "created": 4.4, "categories": [ "Currency Icons", "Brand Icons" ] }, { "name": "GG Currency Circle", "id": "gg-circle", "unicode": "f261", "created": 4.4, "categories": [ "Currency Icons", "Brand Icons" ] }, { "name": "TripAdvisor", "id": "tripadvisor", "unicode": "f262", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Odnoklassniki", "id": "odnoklassniki", "unicode": "f263", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Odnoklassniki Square", "id": "odnoklassniki-square", "unicode": "f264", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Get Pocket", "id": "get-pocket", "unicode": "f265", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Wikipedia W", "id": "wikipedia-w", "unicode": "f266", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Safari", "id": "safari", "unicode": "f267", "created": 4.4, "filter": [ "browser" ], "categories": [ "Brand Icons" ] }, { "name": "Chrome", "id": "chrome", "unicode": "f268", "created": 4.4, "filter": [ "browser" ], "categories": [ "Brand Icons" ] }, { "name": "Firefox", "id": "firefox", "unicode": "f269", "created": 4.4, "filter": [ "browser" ], "categories": [ "Brand Icons" ] }, { "name": "Opera", "id": "opera", "unicode": "f26a", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Internet-explorer", "id": "internet-explorer", "unicode": "f26b", "created": 4.4, "filter": [ "browser", "ie" ], "categories": [ "Brand Icons" ] }, { "name": "Television", "id": "television", "unicode": "f26c", "created": 4.4, "aliases": [ "tv" ], "filter": [ "display", "computer", "monitor" ], "categories": [ "Web Application Icons" ] }, { "name": "Contao", "id": "contao", "unicode": "f26d", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "500px", "id": "500px", "unicode": "f26e", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Amazon", "id": "amazon", "unicode": "f270", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Calendar Plus Outlined", "id": "calendar-plus-o", "unicode": "f271", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Calendar Minus Outlined", "id": "calendar-minus-o", "unicode": "f272", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Calendar Times Outlined", "id": "calendar-times-o", "unicode": "f273", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Calendar Check Outlined", "id": "calendar-check-o", "unicode": "f274", "created": 4.4, "filter": [ "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "Industry", "id": "industry", "unicode": "f275", "created": 4.4, "filter": [ "factory" ], "categories": [ "Web Application Icons" ] }, { "name": "Map Pin", "id": "map-pin", "unicode": "f276", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Map Signs", "id": "map-signs", "unicode": "f277", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Map Outlined", "id": "map-o", "unicode": "f278", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Map", "id": "map", "unicode": "f279", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Commenting", "id": "commenting", "unicode": "f27a", "created": 4.4, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Commenting Outlined", "id": "commenting-o", "unicode": "f27b", "created": 4.4, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Houzz", "id": "houzz", "unicode": "f27c", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Vimeo", "id": "vimeo", "unicode": "f27d", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Font Awesome Black Tie", "id": "black-tie", "unicode": "f27e", "created": 4.4, "url": "blacktie.io", "categories": [ "Brand Icons" ] }, { "name": "Fonticons", "id": "fonticons", "unicode": "f280", "created": 4.4, "url": "fonticons.com", "categories": [ "Brand Icons" ] }, { "name": "reddit Alien", "id": "reddit-alien", "unicode": "f281", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Edge Browser", "id": "edge", "unicode": "f282", "created": 4.5, "filter": [ "browser", "ie" ], "categories": [ "Brand Icons" ] }, { "name": "Credit Card", "id": "credit-card-alt", "unicode": "f283", "created": 4.5, "filter": [ "money", "buy", "debit", "checkout", "purchase", "payment", "credit card" ], "categories": [ "Payment Icons", "Web Application Icons" ] }, { "name": "Codie Pie", "id": "codiepie", "unicode": "f284", "created": 4.5, "url": "codiepie.com", "categories": [ "Brand Icons" ] }, { "name": "MODX", "id": "modx", "unicode": "f285", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Fort Awesome", "id": "fort-awesome", "unicode": "f286", "created": 4.5, "url": "fortawesome.com", "categories": [ "Brand Icons" ] }, { "name": "USB", "id": "usb", "unicode": "f287", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Product Hunt", "id": "product-hunt", "unicode": "f288", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Mixcloud", "id": "mixcloud", "unicode": "f289", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Scribd", "id": "scribd", "unicode": "f28a", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Pause Circle", "id": "pause-circle", "unicode": "f28b", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Pause Circle Outlined", "id": "pause-circle-o", "unicode": "f28c", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Stop Circle", "id": "stop-circle", "unicode": "f28d", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Stop Circle Outlined", "id": "stop-circle-o", "unicode": "f28e", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Shopping Bag", "id": "shopping-bag", "unicode": "f290", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "Shopping Basket", "id": "shopping-basket", "unicode": "f291", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "Hashtag", "id": "hashtag", "unicode": "f292", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "Bluetooth", "id": "bluetooth", "unicode": "f293", "created": 4.5, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Bluetooth", "id": "bluetooth-b", "unicode": "f294", "created": 4.5, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Percent", "id": "percent", "unicode": "f295", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "GitLab", "id": "gitlab", "unicode": "f296", "created": 4.6, "url": "gitlab.com", "categories": [ "Brand Icons" ] }, { "name": "WPBeginner", "id": "wpbeginner", "unicode": "f297", "created": 4.6, "url": "wpbeginner.com", "categories": [ "Brand Icons" ] }, { "name": "WPForms", "id": "wpforms", "unicode": "f298", "created": 4.6, "url": "wpforms.com", "categories": [ "Brand Icons" ] }, { "name": "Envira Gallery", "id": "envira", "unicode": "f299", "created": 4.6, "url": "enviragallery.com", "filter": [ "leaf" ], "categories": [ "Brand Icons" ] }, { "name": "Universal Access", "id": "universal-access", "unicode": "f29a", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Wheelchair Alt", "id": "wheelchair-alt", "unicode": "f29b", "created": 4.6, "filter": [ "handicap", "person" ], "categories": [ "Web Application Icons", "Medical Icons", "Transportation Icons", "Accessibility Icons" ] }, { "name": "Question Circle Outlined", "id": "question-circle-o", "unicode": "f29c", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Blind", "id": "blind", "unicode": "f29d", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Audio Description", "id": "audio-description", "unicode": "f29e", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Volume Control Phone", "id": "volume-control-phone", "unicode": "f2a0", "created": 4.6, "filter": [ "telephone" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Braille", "id": "braille", "unicode": "f2a1", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Assistive Listening Systems", "id": "assistive-listening-systems", "unicode": "f2a2", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "American Sign Language Interpreting", "id": "american-sign-language-interpreting", "unicode": "f2a3", "created": 4.6, "aliases": [ "asl-interpreting" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Deaf", "id": "deaf", "unicode": "f2a4", "created": 4.6, "aliases": [ "deafness", "hard-of-hearing" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Glide", "id": "glide", "unicode": "f2a5", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Glide G", "id": "glide-g", "unicode": "f2a6", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Sign Language", "id": "sign-language", "unicode": "f2a7", "created": 4.6, "aliases": [ "signing" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Low Vision", "id": "low-vision", "unicode": "f2a8", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Viadeo", "id": "viadeo", "unicode": "f2a9", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Viadeo Square", "id": "viadeo-square", "unicode": "f2aa", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Snapchat", "id": "snapchat", "unicode": "f2ab", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Snapchat Ghost", "id": "snapchat-ghost", "unicode": "f2ac", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Snapchat Square", "id": "snapchat-square", "unicode": "f2ad", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Pied Piper Logo", "id": "pied-piper", "unicode": "f2ae", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "First Order", "id": "first-order", "unicode": "f2b0", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Yoast", "id": "yoast", "unicode": "f2b1", "created": 4.6, "url": "yoast.com", "categories": [ "Brand Icons" ] }, { "name": "ThemeIsle", "id": "themeisle", "unicode": "f2b2", "created": 4.6, "url": "themeisle.com", "categories": [ "Brand Icons" ] }, { "name": "Google Plus Official", "id": "google-plus-official", "unicode": "f2b3", "created": 4.6, "aliases": [ "google-plus-circle" ], "categories": [ "Brand Icons" ] }, { "name": "Font Awesome", "id": "font-awesome", "unicode": "f2b4", "created": 4.6, "aliases": [ "fa" ], "categories": [ "Brand Icons" ] }, { "name": "Handshake Outlined", "id": "handshake-o", "unicode": "f2b5", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Envelope Open", "id": "envelope-open", "unicode": "f2b6", "created": 4.7, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Envelope Open Outlined", "id": "envelope-open-o", "unicode": "f2b7", "created": 4.7, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Linode", "id": "linode", "unicode": "f2b8", "created": 4.7, "url": "linode.com", "categories": [ "Brand Icons" ] }, { "name": "Address Book", "id": "address-book", "unicode": "f2b9", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Address Book Outlined", "id": "address-book-o", "unicode": "f2ba", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Address Card", "id": "address-card", "unicode": "f2bb", "created": 4.7, "aliases": [ "vcard" ], "categories": [ "Web Application Icons" ] }, { "name": "Address Card Outlined", "id": "address-card-o", "unicode": "f2bc", "created": 4.7, "aliases": [ "vcard-o" ], "categories": [ "Web Application Icons" ] }, { "name": "User Circle", "id": "user-circle", "unicode": "f2bd", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "User Circle Outlined", "id": "user-circle-o", "unicode": "f2be", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "User Outlined", "id": "user-o", "unicode": "f2c0", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Identification Badge", "id": "id-badge", "unicode": "f2c1", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Identification Card", "id": "id-card", "unicode": "f2c2", "created": 4.7, "aliases": [ "drivers-license" ], "categories": [ "Web Application Icons" ] }, { "name": "Identification Card Outlined", "id": "id-card-o", "unicode": "f2c3", "created": 4.7, "aliases": [ "drivers-license-o" ], "categories": [ "Web Application Icons" ] }, { "name": "Quora", "id": "quora", "unicode": "f2c4", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Free Code Camp", "id": "free-code-camp", "unicode": "f2c5", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Telegram", "id": "telegram", "unicode": "f2c6", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Thermometer Full", "id": "thermometer-full", "unicode": "f2c7", "created": 4.7, "aliases": [ "thermometer-4", "thermometer" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer 3/4 Full", "id": "thermometer-three-quarters", "unicode": "f2c8", "created": 4.7, "aliases": [ "thermometer-3" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer 1/2 Full", "id": "thermometer-half", "unicode": "f2c9", "created": 4.7, "aliases": [ "thermometer-2" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer 1/4 Full", "id": "thermometer-quarter", "unicode": "f2ca", "created": 4.7, "aliases": [ "thermometer-1" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer Empty", "id": "thermometer-empty", "unicode": "f2cb", "created": 4.7, "aliases": [ "thermometer-0" ], "categories": [ "Web Application Icons" ] }, { "name": "Shower", "id": "shower", "unicode": "f2cc", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Bath", "id": "bath", "unicode": "f2cd", "created": 4.7, "aliases": [ "bathtub", "s15" ], "categories": [ "Web Application Icons" ] }, { "name": "Podcast", "id": "podcast", "unicode": "f2ce", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Maximize", "id": "window-maximize", "unicode": "f2d0", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Minimize", "id": "window-minimize", "unicode": "f2d1", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Restore", "id": "window-restore", "unicode": "f2d2", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Close", "id": "window-close", "unicode": "f2d3", "created": 4.7, "aliases": [ "times-rectangle" ], "categories": [ "Web Application Icons" ] }, { "name": "Window Close Outline", "id": "window-close-o", "unicode": "f2d4", "created": 4.7, "aliases": [ "times-rectangle-o" ], "categories": [ "Web Application Icons" ] }, { "name": "Bandcamp", "id": "bandcamp", "unicode": "f2d5", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Grav", "id": "grav", "unicode": "f2d6", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Etsy", "id": "etsy", "unicode": "f2d7", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "IMDB", "id": "imdb", "unicode": "f2d8", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Ravelry", "id": "ravelry", "unicode": "f2d9", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Eercast", "id": "eercast", "unicode": "f2da", "created": 4.7, "url": "eercast.com", "categories": [ "Brand Icons" ] }, { "name": "Microchip", "id": "microchip", "unicode": "f2db", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Snowflake Outlined", "id": "snowflake-o", "unicode": "f2dc", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Superpowers", "id": "superpowers", "unicode": "f2dd", "created": 4.7, "url": "superpowers.io", "categories": [ "Brand Icons" ] }, { "name": "WPExplorer", "id": "wpexplorer", "unicode": "f2de", "created": 4.7, "url": "wpexplorer.com", "categories": [ "Brand Icons" ] }, { "name": "Meetup", "id": "meetup", "unicode": "f2e0", "created": 4.7, "categories": [ "Brand Icons" ] } ] } kirki/assets/vendor/fontawesome/.htaccess000044400000000143151232236220014573 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/selectWoo/css/select2.css000064400000042304151232236220015264 0ustar00.select2-container { box-sizing: border-box; display: inline-block; margin: 0; position: relative; vertical-align: middle; } .select2-container .select2-selection--single { box-sizing: border-box; cursor: pointer; display: block; height: 28px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--single .select2-selection__rendered { display: block; padding-left: 8px; padding-right: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .select2-container .select2-selection--single .select2-selection__clear { position: relative; } .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 8px; padding-left: 20px; } .select2-container .select2-selection--multiple { box-sizing: border-box; cursor: pointer; display: block; min-height: 32px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--multiple .select2-selection__rendered { display: inline-block; overflow: hidden; padding-left: 8px; text-overflow: ellipsis; white-space: nowrap; } .select2-container .select2-search--inline { float: left; } .select2-container .select2-search--inline .select2-search__field { box-sizing: border-box; border: none; font-size: 100%; margin-top: 5px; padding: 0; } .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; } .select2-dropdown { background-color: white; border: 1px solid #aaa; border-radius: 4px; box-sizing: border-box; display: block; position: absolute; left: -100000px; width: 100%; z-index: 1051; } .select2-results { display: block; } .select2-results__options { list-style: none; margin: 0; padding: 0; } .select2-results__option { padding: 6px; user-select: none; -webkit-user-select: none; } .select2-results__option[data-selected] { cursor: pointer; } .select2-container--open .select2-dropdown { left: 0; } .select2-container--open .select2-dropdown--above { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--open .select2-dropdown--below { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-search--dropdown { display: block; padding: 4px; } .select2-search--dropdown .select2-search__field { padding: 4px; width: 100%; box-sizing: border-box; } .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; } .select2-search--dropdown.select2-search--hide { display: none; } .select2-close-mask { border: 0; margin: 0; padding: 0; display: block; position: fixed; left: 0; top: 0; min-height: 100%; min-width: 100%; height: auto; width: auto; opacity: 0; z-index: 99; background-color: #fff; filter: alpha(opacity=0); } .select2-hidden-accessible { border: 0 !important; clip: rect(0 0 0 0) !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; padding: 0 !important; position: absolute !important; width: 1px !important; } .select2-container--default .select2-selection--single { background-color: #fff; border: 1px solid #aaa; border-radius: 4px; } .select2-container--default .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--default .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; } .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; } .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 1px; right: auto; } .select2-container--default.select2-container--disabled .select2-selection--single { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { display: none; } .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--default .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; } .select2-container--default .select2-selection--multiple .select2-selection__rendered { box-sizing: border-box; list-style: none; margin: 0; padding: 0 5px; width: 100%; } .select2-container--default .select2-selection--multiple .select2-selection__rendered li { list-style: none; } .select2-container--default .select2-selection--multiple .select2-selection__placeholder { color: #999; margin-top: 5px; float: left; } .select2-container--default .select2-selection--multiple .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-top: 5px; margin-right: 10px; } .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #999; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #333; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--default.select2-container--focus .select2-selection--multiple { border: solid black 1px; outline: 0; } .select2-container--default.select2-container--disabled .select2-selection--multiple { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection__choice__remove { display: none; } .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; } .select2-container--default .select2-search--inline .select2-search__field { background: transparent; border: none; outline: 0; box-shadow: none; -webkit-appearance: textfield; } .select2-container--default .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--default .select2-results__option[role=group] { padding: 0; } .select2-container--default .select2-results__option[aria-disabled=true] { color: #999; } .select2-container--default .select2-results__option[data-selected=true] { background-color: #ddd; } .select2-container--default .select2-results__option .select2-results__option { padding-left: 1em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option { margin-left: -1em; padding-left: 2em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -2em; padding-left: 3em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -3em; padding-left: 4em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -4em; padding-left: 5em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -5em; padding-left: 6em; } .select2-container--default .select2-results__option--highlighted[data-selected] { background-color: #5897fb; color: white; } .select2-container--default .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic .select2-selection--single { background-color: #f7f7f7; border: 1px solid #aaa; border-radius: 4px; outline: 0; background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%); background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } .select2-container--classic .select2-selection--single:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--classic .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-right: 10px; } .select2-container--classic .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--classic .select2-selection--single .select2-selection__arrow { background-color: #ddd; border: none; border-left: 1px solid #aaa; border-top-right-radius: 4px; border-bottom-right-radius: 4px; height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); } .select2-container--classic .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { border: none; border-right: 1px solid #aaa; border-radius: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; left: 1px; right: auto; } .select2-container--classic.select2-container--open .select2-selection--single { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { background: transparent; border: none; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%); background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); } .select2-container--classic .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; outline: 0; } .select2-container--classic .select2-selection--multiple:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--multiple .select2-selection__rendered { list-style: none; margin: 0; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__clear { display: none; } .select2-container--classic .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { color: #888; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { color: #555; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { float: right; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--classic.select2-container--open .select2-selection--multiple { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--classic .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; outline: 0; } .select2-container--classic .select2-search--inline .select2-search__field { outline: 0; box-shadow: none; } .select2-container--classic .select2-dropdown { background-color: white; border: 1px solid transparent; } .select2-container--classic .select2-dropdown--above { border-bottom: none; } .select2-container--classic .select2-dropdown--below { border-top: none; } .select2-container--classic .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--classic .select2-results__option[role=group] { padding: 0; } .select2-container--classic .select2-results__option[aria-disabled=true] { color: grey; } .select2-container--classic .select2-results__option--highlighted[data-selected] { background-color: #3875d7; color: white; } .select2-container--classic .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic.select2-container--open .select2-dropdown { border-color: #5897fb; } kirki/assets/vendor/selectWoo/css/select2.min.css000064400000035534151232236220016055 0ustar00.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[data-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} kirki/assets/vendor/selectWoo/css/selectWoo.css000064400000042304151232236220015667 0ustar00.select2-container { box-sizing: border-box; display: inline-block; margin: 0; position: relative; vertical-align: middle; } .select2-container .select2-selection--single { box-sizing: border-box; cursor: pointer; display: block; height: 28px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--single .select2-selection__rendered { display: block; padding-left: 8px; padding-right: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .select2-container .select2-selection--single .select2-selection__clear { position: relative; } .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 8px; padding-left: 20px; } .select2-container .select2-selection--multiple { box-sizing: border-box; cursor: pointer; display: block; min-height: 32px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--multiple .select2-selection__rendered { display: inline-block; overflow: hidden; padding-left: 8px; text-overflow: ellipsis; white-space: nowrap; } .select2-container .select2-search--inline { float: left; } .select2-container .select2-search--inline .select2-search__field { box-sizing: border-box; border: none; font-size: 100%; margin-top: 5px; padding: 0; } .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; } .select2-dropdown { background-color: white; border: 1px solid #aaa; border-radius: 4px; box-sizing: border-box; display: block; position: absolute; left: -100000px; width: 100%; z-index: 1051; } .select2-results { display: block; } .select2-results__options { list-style: none; margin: 0; padding: 0; } .select2-results__option { padding: 6px; user-select: none; -webkit-user-select: none; } .select2-results__option[data-selected] { cursor: pointer; } .select2-container--open .select2-dropdown { left: 0; } .select2-container--open .select2-dropdown--above { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--open .select2-dropdown--below { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-search--dropdown { display: block; padding: 4px; } .select2-search--dropdown .select2-search__field { padding: 4px; width: 100%; box-sizing: border-box; } .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; } .select2-search--dropdown.select2-search--hide { display: none; } .select2-close-mask { border: 0; margin: 0; padding: 0; display: block; position: fixed; left: 0; top: 0; min-height: 100%; min-width: 100%; height: auto; width: auto; opacity: 0; z-index: 99; background-color: #fff; filter: alpha(opacity=0); } .select2-hidden-accessible { border: 0 !important; clip: rect(0 0 0 0) !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; padding: 0 !important; position: absolute !important; width: 1px !important; } .select2-container--default .select2-selection--single { background-color: #fff; border: 1px solid #aaa; border-radius: 4px; } .select2-container--default .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--default .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; } .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; } .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 1px; right: auto; } .select2-container--default.select2-container--disabled .select2-selection--single { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { display: none; } .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--default .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; } .select2-container--default .select2-selection--multiple .select2-selection__rendered { box-sizing: border-box; list-style: none; margin: 0; padding: 0 5px; width: 100%; } .select2-container--default .select2-selection--multiple .select2-selection__rendered li { list-style: none; } .select2-container--default .select2-selection--multiple .select2-selection__placeholder { color: #999; margin-top: 5px; float: left; } .select2-container--default .select2-selection--multiple .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-top: 5px; margin-right: 10px; } .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #999; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #333; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--default.select2-container--focus .select2-selection--multiple { border: solid black 1px; outline: 0; } .select2-container--default.select2-container--disabled .select2-selection--multiple { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection__choice__remove { display: none; } .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; } .select2-container--default .select2-search--inline .select2-search__field { background: transparent; border: none; outline: 0; box-shadow: none; -webkit-appearance: textfield; } .select2-container--default .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--default .select2-results__option[role=group] { padding: 0; } .select2-container--default .select2-results__option[aria-disabled=true] { color: #999; } .select2-container--default .select2-results__option[data-selected=true] { background-color: #ddd; } .select2-container--default .select2-results__option .select2-results__option { padding-left: 1em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option { margin-left: -1em; padding-left: 2em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -2em; padding-left: 3em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -3em; padding-left: 4em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -4em; padding-left: 5em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -5em; padding-left: 6em; } .select2-container--default .select2-results__option--highlighted[data-selected] { background-color: #5897fb; color: white; } .select2-container--default .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic .select2-selection--single { background-color: #f7f7f7; border: 1px solid #aaa; border-radius: 4px; outline: 0; background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%); background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } .select2-container--classic .select2-selection--single:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--classic .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-right: 10px; } .select2-container--classic .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--classic .select2-selection--single .select2-selection__arrow { background-color: #ddd; border: none; border-left: 1px solid #aaa; border-top-right-radius: 4px; border-bottom-right-radius: 4px; height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); } .select2-container--classic .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { border: none; border-right: 1px solid #aaa; border-radius: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; left: 1px; right: auto; } .select2-container--classic.select2-container--open .select2-selection--single { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { background: transparent; border: none; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%); background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); } .select2-container--classic .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; outline: 0; } .select2-container--classic .select2-selection--multiple:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--multiple .select2-selection__rendered { list-style: none; margin: 0; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__clear { display: none; } .select2-container--classic .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { color: #888; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { color: #555; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { float: right; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--classic.select2-container--open .select2-selection--multiple { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--classic .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; outline: 0; } .select2-container--classic .select2-search--inline .select2-search__field { outline: 0; box-shadow: none; } .select2-container--classic .select2-dropdown { background-color: white; border: 1px solid transparent; } .select2-container--classic .select2-dropdown--above { border-bottom: none; } .select2-container--classic .select2-dropdown--below { border-top: none; } .select2-container--classic .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--classic .select2-results__option[role=group] { padding: 0; } .select2-container--classic .select2-results__option[aria-disabled=true] { color: grey; } .select2-container--classic .select2-results__option--highlighted[data-selected] { background-color: #3875d7; color: white; } .select2-container--classic .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic.select2-container--open .select2-dropdown { border-color: #5897fb; } kirki/assets/vendor/selectWoo/css/selectWoo.min.css000064400000035534151232236220016460 0ustar00.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[data-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} kirki/assets/vendor/selectWoo/css/.htaccess000044400000000143151232236220015000 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/selectWoo/js/i18n/ar.js000064400000001544151232236230014556 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum;return"الرجاء حذ٠"+t+" عناصر"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"الرجاء Ø¥Ø¶Ø§ÙØ© "+t+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضاÙية..."},maximumSelected:function(e){return"تستطيع إختيار "+e.maximum+" بنود Ùقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/az.js000064400000001275151232236230014567 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nÉ™ticÉ™ yüklÉ™nir…"},maximumSelected:function(e){return"SadÉ™cÉ™ "+e.maximum+" element seçə bilÉ™rsiniz"},noResults:function(){return"NÉ™ticÉ™ tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/bg.js000064400000001612151232236230014540 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="ÐœÐ¾Ð»Ñ Ð²ÑŠÐ²ÐµÐ´ÐµÑ‚Ðµ Ñ "+t+" по-малко Ñимвол";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="ÐœÐ¾Ð»Ñ Ð²ÑŠÐ²ÐµÐ´ÐµÑ‚Ðµ още "+t+" Ñимвол";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат Ñе още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"ÐÑма намерени ÑъвпадениÑ"},searching:function(){return"ТърÑене…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/ca.js000064400000001554151232236230014540 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/cs.js000064400000002324151232236230014556 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvÄ›";case 3:return"tÅ™i";case 4:return"ÄtyÅ™i"}return""}return{errorLoading:function(){return"Výsledky nemohly být naÄteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak ménÄ›":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky ménÄ›":"Prosím zadejte o "+n+" znaků ménÄ›"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte jeÅ¡tÄ› jeden znak":n<=4?"Prosím zadejte jeÅ¡tÄ› další "+e(n,!0)+" znaky":"Prosím zadejte jeÅ¡tÄ› dalších "+n+" znaků"},loadingMore:function(){return"NaÄítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálnÄ› "+e(n,!1)+" položky":"Můžete zvolit maximálnÄ› "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/da.js000064400000001450151232236230014534 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/de.js000064400000001525151232236230014543 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/el.js000064400000002154151232236230014552 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόÏεσαν να φοÏτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="ΠαÏακαλώ διαγÏάψτε "+t+" χαÏακτήÏ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="ΠαÏακαλώ συμπληÏώστε "+t+" ή πεÏισσότεÏους χαÏακτήÏες";return n},loadingMore:function(){return"ΦόÏτωση πεÏισσότεÏων αποτελεσμάτων…"},maximumSelected:function(e){var t="ΜποÏείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βÏέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/en.js000064400000001473151232236230014557 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/es.js000064400000001547151232236230014566 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/et.js000064400000001407151232236230014562 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/eu.js000064400000001514151232236230014562 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/fa.js000064400000001754151232236230014545 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ù„Ø·ÙØ§Ù‹ "+t+" کاراکتر را حذ٠نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ù„Ø·ÙØ§Ù‹ تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای ÛŒØ§ÙØª نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/fi.js000064400000001416151232236230014550 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/fr.js000064400000001606151232236230014562 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/gl.js000064400000001566151232236230014562 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/he.js000064400000001667151232236230014556 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגי××” בטעינת התוצ×ות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="× × ×œ×ž×—×•×§ ";return t===1?n+="תו ×חד":n+=t+" תווי×",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="× × ×œ×”×›× ×™×¡ ";return t===1?n+="תו ×חד":n+=t+" תווי×",n+=" ×ו יותר",n},loadingMore:function(){return"טוען תוצ×ות נוספות…"},maximumSelected:function(e){var t="ב×פשרותך לבחור עד ";return e.maximum===1?t+="פריט ×חד":t+=e.maximum+" פריטי×",t},noResults:function(){return"×œ× × ×ž×¦×ו תוצ×ות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/hi.js000064400000002145151232236230014552 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अकà¥à¤·à¤° को हटा दें";return t>1&&(n=t+" अकà¥à¤·à¤°à¥‹à¤‚ को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अकà¥à¤·à¤° दरà¥à¤œ करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/hr.js000064400000001507151232236230014564 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite joÅ¡ "+e(n)},loadingMore:function(){return"UÄitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/hu.js000064400000001442151232236230014565 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/hy.js000064400000001755151232236230014600 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Ô±Ö€Õ¤ÕµÕ¸Ö‚Õ¶Ö„Õ¶Õ¥Ö€Õ¨ Õ°Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ§ Õ¢Õ¥Õ¼Õ¶Õ¥Õ¬Ö‰"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ô½Õ¶Õ¤Ö€Õ¸Ö‚Õ´ Õ¥Õ¶Ö„ Õ°Õ¥Õ¼Õ¡ÖÕ¶Õ¥Õ¬ "+t+" Õ¶Õ·Õ¡Õ¶";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ô½Õ¶Õ¤Ö€Õ¸Ö‚Õ´ Õ¥Õ¶Ö„ Õ´Õ¸Ö‚Õ¿Ö„Õ¡Õ£Ö€Õ¥Õ¬ "+t+" Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬ Õ¶Õ·Õ¡Õ¶Õ¶Õ¥Ö€";return n},loadingMore:function(){return"Ô²Õ¥Õ¼Õ¶Õ¾Õ¸Ö‚Õ´ Õ¥Õ¶ Õ¶Õ¸Ö€ արդյունքներ․․․"},maximumSelected:function(e){var t="Ô´Õ¸Ö‚Ö„ Õ¯Õ¡Ö€Õ¸Õ² Õ¥Ö„ Õ¨Õ¶Õ¿Ö€Õ¥Õ¬ Õ¡Õ¼Õ¡Õ¾Õ¥Õ¬Õ¡Õ£Õ¸Ö‚ÕµÕ¶Õ¨ "+e.maximum+" Õ¯Õ¥Õ¿";return t},noResults:function(){return"Ô±Ö€Õ¤ÕµÕ¸Ö‚Õ¶Ö„Õ¶Õ¥Ö€ Õ¹Õ¥Õ¶ Õ£Õ¿Õ¶Õ¾Õ¥Õ¬"},searching:function(){return"Որոնում․․․"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/id.js000064400000001360151232236230014544 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/is.js000064400000001405151232236230014563 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/it.js000064400000001554151232236230014571 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/ja.js000064400000001520151232236230014540 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"çµæžœãŒèª­ã¿è¾¼ã¾ã‚Œã¾ã›ã‚“ã§ã—ãŸ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除ã—ã¦ãã ã•ã„";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="å°‘ãªãã¨ã‚‚ "+t+" 文字を入力ã—ã¦ãã ã•ã„";return n},loadingMore:function(){return"読ã¿è¾¼ã¿ä¸­â€¦"},maximumSelected:function(e){var t=e.maximum+" ä»¶ã—ã‹é¸æŠžã§ãã¾ã›ã‚“";return t},noResults:function(){return"対象ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“"},searching:function(){return"検索ã—ã¦ã„ã¾ã™â€¦"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/km.js000064400000002051151232236230014555 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្ននáŸáž™"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចáŸáž‰ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនáŸáŸ‡";return n},loadingMore:function(){return"កំពុងទាញយកទិន្ននáŸáž™áž”ន្ážáŸ‚ម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានážáŸ‚ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/ko.js000064400000001526151232236230014565 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 ê¹ë‹ˆë‹¤. "+t+" ê¸€ìž ì§€ì›Œì£¼ì„¸ìš”.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" ê¸€ìž ë” ìž…ë ¥í•´ì£¼ì„¸ìš”.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 ì„ íƒ ê°€ëŠ¥í•©ë‹ˆë‹¤.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/lt.js000064400000001621151232236230014567 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="PaÅ¡alinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ä®raÅ¡ykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="JÅ«s galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"Ä…","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"IeÅ¡koma…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/lv.js000064400000001550151232236230014572 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="LÅ«dzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazÄk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="LÅ«dzu ievadiet vÄ“l "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielÄde…"},maximumSelected:function(t){var n="JÅ«s varat izvÄ“lÄ“ties ne vairÄk kÄ "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"SakritÄ«bu nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/mk.js000064400000001723151232236230014562 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внеÑете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внеÑете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете Ñамо "+e.maximum+" Ñтавк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Ðема пронајдено Ñовпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/ms.js000064400000001427151232236230014573 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/nb.js000064400000001421151232236230014545 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/nl.js000064400000001600151232236230014556 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/pl.js000064400000001635151232236230014570 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można zaÅ‚adować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"UsuÅ„ "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa Å‚adowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/pt-BR.js000064400000001525151232236230015077 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/pt.js000064400000001533151232236230014575 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/ro.js000064400000001615151232236230014573 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să È™tergeÈ›i"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceÈ›i "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="AveÈ›i voie să selectaÈ›i cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/ru.js000064400000002147151232236230014602 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Ðевозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="ПожалуйÑта, введите на "+n+" Ñимвол";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="ПожалуйÑта, введите еще Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ "+n+" Ñимвол";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Ð’Ñ‹ можете выбрать не более "+t.maximum+" Ñлемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"ПоиÑк…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/sk.js000064400000002240151232236230014563 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"Å¡tyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte eÅ¡te jeden znak":n<=4?"Prosím, zadajte eÅ¡te ÄalÅ¡ie "+e[n](!0)+" znaky":"Prosím, zadajte eÅ¡te Äalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliÅ¥ len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliÅ¥ najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliÅ¥ najviac "+t.maximum+" položiek"},noResults:function(){return"NenaÅ¡li sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/sl.js000064400000001572151232236230014573 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoÄe naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbriÅ¡ite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpiÅ¡ite Å¡e "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam veÄ zadetkov…"},maximumSelected:function(e){var t="OznaÄite lahko najveÄ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"IÅ¡Äem…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/sr-Cyrl.js000064400000002053151232236230015503 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није уÑпело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" Ñимбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" Ñимбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати Ñамо "+t.maximum+" Ñтавк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ðишта није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/sr.js000064400000001652151232236230014600 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="ObriÅ¡ite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar joÅ¡ "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje joÅ¡ rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"NiÅ¡ta nije pronaÄ‘eno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/sv.js000064400000001422151232236230014577 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/th.js000064400000002030151232236230014556 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออภ"+t+" ตัวอัà¸à¸©à¸£";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีภ"+t+" ตัวอัà¸à¸©à¸£";return n},loadingMore:function(){return"à¸à¸³à¸¥à¸±à¸‡à¸„้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือà¸à¹„ด้ไม่เà¸à¸´à¸™ "+e.maximum+" รายà¸à¸²à¸£";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"à¸à¸³à¸¥à¸±à¸‡à¸„้นข้อมูล…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/tr.js000064400000001405151232236230014575 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/uk.js000064400000002135151232236230014570 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Ðеможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь лаÑка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь лаÑка, введіть "+t+" або більше літер"},loadingMore:function(){return"Ð—Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ñ–Ð½ÑˆÐ¸Ñ… результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Ðічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/vi.js000064400000001441151232236230014566 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hÆ¡n "+t+" ký tá»±";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiá»u hÆ¡n "+t+' ký tá»±"';return n},loadingMore:function(){return"Äang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chá»n được "+e.maximum+" lá»±a chá»n";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Äang tìm…"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/zh-CN.js000064400000001401151232236230015063 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请å†è¾“入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多åªèƒ½é€‰æ‹©"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"æœç´¢ä¸­â€¦"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/zh-TW.js000064400000001304151232236230015117 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="è«‹å†è¼¸å…¥"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="ä½ åªèƒ½é¸æ“‡æœ€å¤š"+e.maximum+"é …";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"æœå°‹ä¸­â€¦"}}}),{define:e.define,require:e.require}})();kirki/assets/vendor/selectWoo/js/i18n/.htaccess000044400000000143151232236230015404 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/selectWoo/js/select2.full.js000064400000505301151232236230015677 0ustar00/*! * SelectWoo 1.0.1 * https://github.com/woocommerce/selectWoo * * Released under the MIT license * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function (root, jQuery) { if (jQuery === undefined) { // require('jQuery') returns a factory that requires window to // build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop // if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } } (function (jQuery) { // This is needed so we can catch the AMD loader configuration and use it // The inner file should be wrapped (by `banner.start.js`) in a function that // returns the AMD loader references. var S2 =(function () { // Restore the Select2 AMD loader so it can be used // Needed mostly in the language files, where the loader is not inserted if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { var S2 = jQuery.fn.select2.amd; } var S2;(function () { if (!S2 || !S2.requirejs) { if (!S2) { S2 = {}; } else { require = S2; } /** * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, handlers, defined = {}, waiting = {}, config = {}, defining = {}, hasOwn = Object.prototype.hasOwnProperty, aps = [].slice, jsSuffixRegExp = /\.js$/; function hasProp(obj, prop) { return hasOwn.call(obj, prop); } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, normalizedBaseParts, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name) { name = name.split('/'); lastIndex = name.length - 1; // If wanting node ID compatibility, strip .js from end // of IDs. Have to do this here, and not in nameToUrl // because node allows either .js or non .js to map // to same file. if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } // Starts with a '.' so need the baseName if (name[0].charAt(0) === '.' && baseParts) { //Convert baseName to array, and lop off the last part, //so that . matches that 'directory' and not name of the baseName's //module. For instance, baseName of 'one/two/three', maps to //'one/two/three.js', but we want the directory, 'one/two' for //this normalization. normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); name = normalizedBaseParts.concat(name); } //start trimDots for (i = 0; i < name.length; i++) { part = name[i]; if (part === '.') { name.splice(i, 1); i -= 1; } else if (part === '..') { // If at the start, or previous value is still .., // keep them so that when converted to a path it may // still work when converted to a path, even though // as an ID it is less than ideal. In larger point // releases, may be better to just kick out an error. if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') { continue; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join('/'); } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only //one arg, it is the array form without a callback. Insert //a null so that the following concat is correct. if (typeof args[0] !== 'string' && args.length === 1) { args.push(null); } return req.apply(undef, args.concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (hasProp(waiting, name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!hasProp(defined, name) && !hasProp(defining, name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } //Creates a parts array for a relName where first part is plugin ID, //second part is resource ID. Assumes relName has already been normalized. function makeRelParts(relName) { return relName ? splitPrefix(relName) : []; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relParts) { var plugin, parts = splitPrefix(name), prefix = parts[0], relResourceName = relParts[1]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relResourceName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relResourceName)); } else { name = normalize(name, relResourceName); } } else { name = normalize(name, relResourceName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } handlers = { require: function (name) { return makeRequire(name); }, exports: function (name) { var e = defined[name]; if (typeof e !== 'undefined') { return e; } else { return (defined[name] = {}); } }, module: function (name) { return { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } }; main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, relParts, args = [], callbackType = typeof callback, usingExports; //Use name if no relName relName = relName || name; relParts = makeRelParts(relName); //Call the callback to define the module, if necessary. if (callbackType === 'undefined' || callbackType === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relParts); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = handlers.require(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = handlers.exports(name); usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = handlers.module(name); } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else { throw new Error(name + ' missing ' + depName); } } ret = callback ? callback.apply(defined[name], args) : undefined; if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { if (handlers[deps]) { //callback in this case is really relName return handlers[deps](callback); } //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, makeRelParts(callback)).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (config.deps) { req(config.deps, config.callback); } if (!callback) { return; } if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { //Using a non-zero value because of concern for what old browsers //do, and latest browsers "upgrade" to 4 if lower value is used: //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: //If want a value immediately, use require('id') instead -- something //that works in almond on the global level, but not guaranteed and //unlikely to work in other AMD implementations. setTimeout(function () { main(undef, deps, callback, relName); }, 4); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { return req(cfg); }; /** * Expose module registry for debugging and tooling */ requirejs._defined = defined; define = function (name, deps, callback) { if (typeof name !== 'string') { throw new Error('See almond README: incorrect module build, no module name'); } //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } if (!hasProp(defined, name) && !hasProp(waiting, name)) { waiting[name] = [name, deps, callback]; } }; define.amd = { jQuery: true }; }()); S2.requirejs = requirejs;S2.require = require;S2.define = define; } }()); S2.define("almond", function(){}); /* global jQuery:false, $:false */ S2.define('jquery',[],function () { var _$ = jQuery || $; if (_$ == null && console && console.error) { console.error( 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.' ); } return _$; }); S2.define('select2/utils',[ 'jquery' ], function ($) { var Utils = {}; Utils.Extend = function (ChildClass, SuperClass) { var __hasProp = {}.hasOwnProperty; function BaseConstructor () { this.constructor = ChildClass; } for (var key in SuperClass) { if (__hasProp.call(SuperClass, key)) { ChildClass[key] = SuperClass[key]; } } BaseConstructor.prototype = SuperClass.prototype; ChildClass.prototype = new BaseConstructor(); ChildClass.__super__ = SuperClass.prototype; return ChildClass; }; function getMethods (theClass) { var proto = theClass.prototype; var methods = []; for (var methodName in proto) { var m = proto[methodName]; if (typeof m !== 'function') { continue; } if (methodName === 'constructor') { continue; } methods.push(methodName); } return methods; } Utils.Decorate = function (SuperClass, DecoratorClass) { var decoratedMethods = getMethods(DecoratorClass); var superMethods = getMethods(SuperClass); function DecoratedClass () { var unshift = Array.prototype.unshift; var argCount = DecoratorClass.prototype.constructor.length; var calledConstructor = SuperClass.prototype.constructor; if (argCount > 0) { unshift.call(arguments, SuperClass.prototype.constructor); calledConstructor = DecoratorClass.prototype.constructor; } calledConstructor.apply(this, arguments); } DecoratorClass.displayName = SuperClass.displayName; function ctr () { this.constructor = DecoratedClass; } DecoratedClass.prototype = new ctr(); for (var m = 0; m < superMethods.length; m++) { var superMethod = superMethods[m]; DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod]; } var calledMethod = function (methodName) { // Stub out the original method if it's not decorating an actual method var originalMethod = function () {}; if (methodName in DecoratedClass.prototype) { originalMethod = DecoratedClass.prototype[methodName]; } var decoratedMethod = DecoratorClass.prototype[methodName]; return function () { var unshift = Array.prototype.unshift; unshift.call(arguments, originalMethod); return decoratedMethod.apply(this, arguments); }; }; for (var d = 0; d < decoratedMethods.length; d++) { var decoratedMethod = decoratedMethods[d]; DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); } return DecoratedClass; }; var Observable = function () { this.listeners = {}; }; Observable.prototype.on = function (event, callback) { this.listeners = this.listeners || {}; if (event in this.listeners) { this.listeners[event].push(callback); } else { this.listeners[event] = [callback]; } }; Observable.prototype.trigger = function (event) { var slice = Array.prototype.slice; var params = slice.call(arguments, 1); this.listeners = this.listeners || {}; // Params should always come in as an array if (params == null) { params = []; } // If there are no arguments to the event, use a temporary object if (params.length === 0) { params.push({}); } // Set the `_type` of the first object to the event params[0]._type = event; if (event in this.listeners) { this.invoke(this.listeners[event], slice.call(arguments, 1)); } if ('*' in this.listeners) { this.invoke(this.listeners['*'], arguments); } }; Observable.prototype.invoke = function (listeners, params) { for (var i = 0, len = listeners.length; i < len; i++) { listeners[i].apply(this, params); } }; Utils.Observable = Observable; Utils.generateChars = function (length) { var chars = ''; for (var i = 0; i < length; i++) { var randomChar = Math.floor(Math.random() * 36); chars += randomChar.toString(36); } return chars; }; Utils.bind = function (func, context) { return function () { func.apply(context, arguments); }; }; Utils._convertData = function (data) { for (var originalKey in data) { var keys = originalKey.split('-'); var dataLevel = data; if (keys.length === 1) { continue; } for (var k = 0; k < keys.length; k++) { var key = keys[k]; // Lowercase the first letter // By default, dash-separated becomes camelCase key = key.substring(0, 1).toLowerCase() + key.substring(1); if (!(key in dataLevel)) { dataLevel[key] = {}; } if (k == keys.length - 1) { dataLevel[key] = data[originalKey]; } dataLevel = dataLevel[key]; } delete data[originalKey]; } return data; }; Utils.hasScroll = function (index, el) { // Adapted from the function created by @ShadowScripter // and adapted by @BillBarry on the Stack Exchange Code Review website. // The original code can be found at // http://codereview.stackexchange.com/q/13338 // and was designed to be used with the Sizzle selector engine. var $el = $(el); var overflowX = el.style.overflowX; var overflowY = el.style.overflowY; //Check both x and y declarations if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) { return false; } if (overflowX === 'scroll' || overflowY === 'scroll') { return true; } return ($el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth); }; Utils.escapeMarkup = function (markup) { var replaceMap = { '\\': '\', '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''', '/': '/' }; // Do not try to escape the markup if it's not a string if (typeof markup !== 'string') { return markup; } return String(markup).replace(/[&<>"'\/\\]/g, function (match) { return replaceMap[match]; }); }; // Append an array of jQuery nodes to a given element. Utils.appendMany = function ($element, $nodes) { // jQuery 1.7.x does not support $.fn.append() with an array // Fall back to a jQuery object collection using $.fn.add() if ($.fn.jquery.substr(0, 3) === '1.7') { var $jqNodes = $(); $.map($nodes, function (node) { $jqNodes = $jqNodes.add(node); }); $nodes = $jqNodes; } $element.append($nodes); }; // Determine whether the browser is on a touchscreen device. Utils.isTouchscreen = function() { if ('undefined' === typeof Utils._isTouchscreenCache) { Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement; } return Utils._isTouchscreenCache; } return Utils; }); S2.define('select2/results',[ 'jquery', './utils' ], function ($, Utils) { function Results ($element, options, dataAdapter) { this.$element = $element; this.data = dataAdapter; this.options = options; Results.__super__.constructor.call(this); } Utils.Extend(Results, Utils.Observable); Results.prototype.render = function () { var $results = $( '
            ' ); if (this.options.get('multiple')) { $results.attr('aria-multiselectable', 'true'); } this.$results = $results; return $results; }; Results.prototype.clear = function () { this.$results.empty(); }; Results.prototype.displayMessage = function (params) { var escapeMarkup = this.options.get('escapeMarkup'); this.clear(); this.hideLoading(); var $message = $( '
          • ' ); var message = this.options.get('translations').get(params.message); $message.append( escapeMarkup( message(params.args) ) ); $message[0].className += ' select2-results__message'; this.$results.append($message); }; Results.prototype.hideMessages = function () { this.$results.find('.select2-results__message').remove(); }; Results.prototype.append = function (data) { this.hideLoading(); var $options = []; if (data.results == null || data.results.length === 0) { if (this.$results.children().length === 0) { this.trigger('results:message', { message: 'noResults' }); } return; } data.results = this.sort(data.results); for (var d = 0; d < data.results.length; d++) { var item = data.results[d]; var $option = this.option(item); $options.push($option); } this.$results.append($options); }; Results.prototype.position = function ($results, $dropdown) { var $resultsContainer = $dropdown.find('.select2-results'); $resultsContainer.append($results); }; Results.prototype.sort = function (data) { var sorter = this.options.get('sorter'); return sorter(data); }; Results.prototype.highlightFirstItem = function () { var $options = this.$results .find('.select2-results__option[data-selected]'); var $selected = $options.filter('[data-selected=true]'); // Check if there are any selected options if ($selected.length > 0) { // If there are selected options, highlight the first $selected.first().trigger('mouseenter'); } else { // If there are no selected options, highlight the first option // in the dropdown $options.first().trigger('mouseenter'); } this.ensureHighlightVisible(); }; Results.prototype.setClasses = function () { var self = this; this.data.current(function (selected) { var selectedIds = $.map(selected, function (s) { return s.id.toString(); }); var $options = self.$results .find('.select2-results__option[data-selected]'); $options.each(function () { var $option = $(this); var item = $.data(this, 'data'); // id needs to be converted to a string when comparing var id = '' + item.id; if ((item.element != null && item.element.selected) || (item.element == null && $.inArray(id, selectedIds) > -1)) { $option.attr('data-selected', 'true'); } else { $option.attr('data-selected', 'false'); } }); }); }; Results.prototype.showLoading = function (params) { this.hideLoading(); var loadingMore = this.options.get('translations').get('searching'); var loading = { disabled: true, loading: true, text: loadingMore(params) }; var $loading = this.option(loading); $loading.className += ' loading-results'; this.$results.prepend($loading); }; Results.prototype.hideLoading = function () { this.$results.find('.loading-results').remove(); }; Results.prototype.option = function (data) { var option = document.createElement('li'); option.className = 'select2-results__option'; var attrs = { 'role': 'option', 'data-selected': 'false', 'tabindex': -1 }; if (data.disabled) { delete attrs['data-selected']; attrs['aria-disabled'] = 'true'; } if (data.id == null) { delete attrs['data-selected']; } if (data._resultId != null) { option.id = data._resultId; } if (data.title) { option.title = data.title; } if (data.children) { attrs['aria-label'] = data.text; delete attrs['data-selected']; } for (var attr in attrs) { var val = attrs[attr]; option.setAttribute(attr, val); } if (data.children) { var $option = $(option); var label = document.createElement('strong'); label.className = 'select2-results__group'; var $label = $(label); this.template(data, label); $label.attr('role', 'presentation'); var $children = []; for (var c = 0; c < data.children.length; c++) { var child = data.children[c]; var $child = this.option(child); $children.push($child); } var $childrenContainer = $('
              ', { 'class': 'select2-results__options select2-results__options--nested', 'role': 'listbox' }); $childrenContainer.append($children); $option.attr('role', 'list'); $option.append(label); $option.append($childrenContainer); } else { this.template(data, option); } $.data(option, 'data', data); return option; }; Results.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-results'; this.$results.attr('id', id); container.on('results:all', function (params) { self.clear(); self.append(params.data); if (container.isOpen()) { self.setClasses(); self.highlightFirstItem(); } }); container.on('results:append', function (params) { self.append(params.data); if (container.isOpen()) { self.setClasses(); } }); container.on('query', function (params) { self.hideMessages(); self.showLoading(params); }); container.on('select', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('unselect', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('open', function () { // When the dropdown is open, aria-expended="true" self.$results.attr('aria-expanded', 'true'); self.$results.attr('aria-hidden', 'false'); self.setClasses(); self.ensureHighlightVisible(); }); container.on('close', function () { // When the dropdown is closed, aria-expended="false" self.$results.attr('aria-expanded', 'false'); self.$results.attr('aria-hidden', 'true'); self.$results.removeAttr('aria-activedescendant'); }); container.on('results:toggle', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } $highlighted.trigger('mouseup'); }); container.on('results:select', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } var data = $highlighted.data('data'); if ($highlighted.attr('data-selected') == 'true') { self.trigger('close', {}); } else { self.trigger('select', { data: data }); } }); container.on('results:previous', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[data-selected]'); var currentIndex = $options.index($highlighted); // If we are already at te top, don't move further if (currentIndex === 0) { return; } var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first if ($highlighted.length === 0) { nextIndex = 0; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top; var nextTop = $next.offset().top; var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextTop - currentOffset < 0) { self.$results.scrollTop(nextOffset); } }); container.on('results:next', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[data-selected]'); var currentIndex = $options.index($highlighted); var nextIndex = currentIndex + 1; // If we are at the last option, stay there if (nextIndex >= $options.length) { return; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var nextBottom = $next.offset().top + $next.outerHeight(false); var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextBottom > currentOffset) { self.$results.scrollTop(nextOffset); } }); container.on('results:focus', function (params) { params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true'); self.$results.attr('aria-activedescendant', params.element.attr('id')); }); container.on('results:message', function (params) { self.displayMessage(params); }); if ($.fn.mousewheel) { this.$results.on('mousewheel', function (e) { var top = self.$results.scrollTop(); var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); if (isAtTop) { self.$results.scrollTop(0); e.preventDefault(); e.stopPropagation(); } else if (isAtBottom) { self.$results.scrollTop( self.$results.get(0).scrollHeight - self.$results.height() ); e.preventDefault(); e.stopPropagation(); } }); } this.$results.on('mouseup', '.select2-results__option[data-selected]', function (evt) { var $this = $(this); var data = $this.data('data'); if ($this.attr('data-selected') === 'true') { if (self.options.get('multiple')) { self.trigger('unselect', { originalEvent: evt, data: data }); } else { self.trigger('close', {}); } return; } self.trigger('select', { originalEvent: evt, data: data }); }); this.$results.on('mouseenter', '.select2-results__option[data-selected]', function (evt) { var data = $(this).data('data'); self.getHighlightedResults() .removeClass('select2-results__option--highlighted') .attr('aria-selected', 'false'); self.trigger('results:focus', { data: data, element: $(this) }); }); }; Results.prototype.getHighlightedResults = function () { var $highlighted = this.$results .find('.select2-results__option--highlighted'); return $highlighted; }; Results.prototype.destroy = function () { this.$results.remove(); }; Results.prototype.ensureHighlightVisible = function () { var $highlighted = this.getHighlightedResults(); if ($highlighted.length === 0) { return; } var $options = this.$results.find('[data-selected]'); var currentIndex = $options.index($highlighted); var currentOffset = this.$results.offset().top; var nextTop = $highlighted.offset().top; var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); var offsetDelta = nextTop - currentOffset; nextOffset -= $highlighted.outerHeight(false) * 2; if (currentIndex <= 2) { this.$results.scrollTop(0); } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { this.$results.scrollTop(nextOffset); } }; Results.prototype.template = function (result, container) { var template = this.options.get('templateResult'); var escapeMarkup = this.options.get('escapeMarkup'); var content = template(result, container); if (content == null) { container.style.display = 'none'; } else if (typeof content === 'string') { container.innerHTML = escapeMarkup(content); } else { $(container).append(content); } }; return Results; }); S2.define('select2/keys',[ ], function () { var KEYS = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }; return KEYS; }); S2.define('select2/selection/base',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function BaseSelection ($element, options) { this.$element = $element; this.options = options; BaseSelection.__super__.constructor.call(this); } Utils.Extend(BaseSelection, Utils.Observable); BaseSelection.prototype.render = function () { var $selection = $( '' + '' ); this._tabindex = 0; if (this.$element.data('old-tabindex') != null) { this._tabindex = this.$element.data('old-tabindex'); } else if (this.$element.attr('tabindex') != null) { this._tabindex = this.$element.attr('tabindex'); } $selection.attr('title', this.$element.attr('title')); $selection.attr('tabindex', this._tabindex); this.$selection = $selection; return $selection; }; BaseSelection.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-container'; var resultsId = container.id + '-results'; var searchHidden = this.options.get('minimumResultsForSearch') === Infinity; this.container = container; this.$selection.on('focus', function (evt) { self.trigger('focus', evt); }); this.$selection.on('blur', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', function (evt) { self.trigger('keypress', evt); if (evt.which === KEYS.SPACE) { evt.preventDefault(); } }); container.on('results:focus', function (params) { self.$selection.attr('aria-activedescendant', params.data._resultId); }); container.on('selection:update', function (params) { self.update(params.data); }); container.on('open', function () { // When the dropdown is open, aria-expanded="true" self.$selection.attr('aria-expanded', 'true'); self.$selection.attr('aria-owns', resultsId); self._attachCloseHandler(container); }); container.on('close', function () { // When the dropdown is closed, aria-expanded="false" self.$selection.attr('aria-expanded', 'false'); self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-owns'); // This needs to be delayed as the active element is the body when the // key is pressed. window.setTimeout(function () { self.$selection.focus(); }, 1); self._detachCloseHandler(container); }); container.on('enable', function () { self.$selection.attr('tabindex', self._tabindex); }); container.on('disable', function () { self.$selection.attr('tabindex', '-1'); }); }; BaseSelection.prototype._handleBlur = function (evt) { var self = this; // This needs to be delayed as the active element is the body when the tab // key is pressed, possibly along with others. window.setTimeout(function () { // Don't trigger `blur` if the focus is still in the selection if ( (document.activeElement == self.$selection[0]) || ($.contains(self.$selection[0], document.activeElement)) ) { return; } self.trigger('blur', evt); }, 1); }; BaseSelection.prototype._attachCloseHandler = function (container) { var self = this; $(document.body).on('mousedown.select2.' + container.id, function (e) { var $target = $(e.target); var $select = $target.closest('.select2'); var $all = $('.select2.select2-container--open'); $all.each(function () { var $this = $(this); if (this == $select[0]) { return; } var $element = $this.data('element'); $element.select2('close'); }); }); }; BaseSelection.prototype._detachCloseHandler = function (container) { $(document.body).off('mousedown.select2.' + container.id); }; BaseSelection.prototype.position = function ($selection, $container) { var $selectionContainer = $container.find('.selection'); $selectionContainer.append($selection); }; BaseSelection.prototype.destroy = function () { this._detachCloseHandler(this.container); }; BaseSelection.prototype.update = function (data) { throw new Error('The `update` method must be defined in child classes.'); }; return BaseSelection; }); S2.define('select2/selection/single',[ 'jquery', './base', '../utils', '../keys' ], function ($, BaseSelection, Utils, KEYS) { function SingleSelection () { SingleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(SingleSelection, BaseSelection); SingleSelection.prototype.render = function () { var $selection = SingleSelection.__super__.render.call(this); $selection.addClass('select2-selection--single'); $selection.html( '' + '' + '' + '' ); return $selection; }; SingleSelection.prototype.bind = function (container, $container) { var self = this; SingleSelection.__super__.bind.apply(this, arguments); var id = container.id + '-container'; this.$selection.find('.select2-selection__rendered') .attr('id', id) .attr('role', 'textbox') .attr('aria-readonly', 'true'); this.$selection.attr('aria-labelledby', id); // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove. this.$selection.attr('role', 'combobox'); this.$selection.on('mousedown', function (evt) { // Only respond to left clicks if (evt.which !== 1) { return; } self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on('focus', function (evt) { // User focuses on the container }); this.$selection.on('keydown', function (evt) { // If user starts typing an alphanumeric key on the keyboard, open if not opened. if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) { container.open(); } }); this.$selection.on('blur', function (evt) { // User exits the container }); container.on('focus', function (evt) { if (!container.isOpen()) { self.$selection.focus(); } }); container.on('selection:update', function (params) { self.update(params.data); }); }; SingleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; SingleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; SingleSelection.prototype.selectionContainer = function () { return $(''); }; SingleSelection.prototype.update = function (data) { if (data.length === 0) { this.clear(); return; } var selection = data[0]; var $rendered = this.$selection.find('.select2-selection__rendered'); var formatted = this.display(selection, $rendered); $rendered.empty().append(formatted); $rendered.prop('title', selection.title || selection.text); }; return SingleSelection; }); S2.define('select2/selection/multiple',[ 'jquery', './base', '../utils' ], function ($, BaseSelection, Utils) { function MultipleSelection ($element, options) { MultipleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(MultipleSelection, BaseSelection); MultipleSelection.prototype.render = function () { var $selection = MultipleSelection.__super__.render.call(this); $selection.addClass('select2-selection--multiple'); $selection.html( '
                ' ); return $selection; }; MultipleSelection.prototype.bind = function (container, $container) { var self = this; MultipleSelection.__super__.bind.apply(this, arguments); this.$selection.on('click', function (evt) { self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on( 'click', '.select2-selection__choice__remove', function (evt) { // Ignore the event if it is disabled if (self.options.get('disabled')) { return; } var $remove = $(this); var $selection = $remove.parent(); var data = $selection.data('data'); self.trigger('unselect', { originalEvent: evt, data: data }); } ); }; MultipleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; MultipleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; MultipleSelection.prototype.selectionContainer = function () { var $container = $( '
              • ' + '' + '×' + '' + '
              • ' ); return $container; }; MultipleSelection.prototype.update = function (data) { var self = this; this.clear(); if (data.length === 0) { return; } var $selections = []; for (var d = 0; d < data.length; d++) { var selection = data[d]; var $selection = this.selectionContainer(); var formatted = this.display(selection, $selection).trim(); $selection.append(formatted); $selection.prop('title', selection.title || selection.text); $selection.data('data', selection); $selections.push($selection); } var $rendered = this.$selection.find('.select2-selection__rendered'); Utils.appendMany($rendered, $selections); // Return cursor to search field after updating. // Needs 1 ms delay because of other 1 ms setTimeouts when rendering. if ('undefined' !== typeof this.$search) { setTimeout(function(){ self.$search.focus(); }, 1); } }; return MultipleSelection; }); S2.define('select2/selection/placeholder',[ '../utils' ], function (Utils) { function Placeholder (decorated, $element, options) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options); } Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { var $placeholder = this.selectionContainer(); $placeholder.html(this.display(placeholder)); $placeholder.addClass('select2-selection__placeholder') .removeClass('select2-selection__choice'); return $placeholder; }; Placeholder.prototype.update = function (decorated, data) { var singlePlaceholder = ( data.length == 1 && data[0].id != this.placeholder.id ); var multipleSelections = data.length > 1; if (multipleSelections || singlePlaceholder) { return decorated.call(this, data); } this.clear(); var $placeholder = this.createPlaceholder(this.placeholder); this.$selection.find('.select2-selection__rendered').append($placeholder); }; return Placeholder; }); S2.define('select2/selection/allowClear',[ 'jquery', '../keys' ], function ($, KEYS) { function AllowClear () { } AllowClear.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); if (this.placeholder == null) { if (this.options.get('debug') && window.console && console.error) { console.error( 'Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.' ); } } this.$selection.on('mousedown', '.select2-selection__clear', function (evt) { self._handleClear(evt); }); container.on('keypress', function (evt) { self._handleKeyboardClear(evt, container); }); }; AllowClear.prototype._handleClear = function (_, evt) { // Ignore the event if it is disabled if (this.options.get('disabled')) { return; } var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected if ($clear.length === 0) { return; } evt.stopPropagation(); var data = $clear.data('data'); for (var d = 0; d < data.length; d++) { var unselectData = { data: data[d] }; // Trigger the `unselect` event, so people can prevent it from being // cleared. this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out. if (unselectData.prevented) { return; } } this.$element.val(this.placeholder.id).trigger('change'); this.trigger('toggle', {}); }; AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { if (container.isOpen()) { return; } if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { this._handleClear(evt); } }; AllowClear.prototype.update = function (decorated, data) { decorated.call(this, data); if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) { return; } var $remove = $( '' + '×' + '' ); $remove.data('data', data); this.$selection.find('.select2-selection__rendered').prepend($remove); }; return AllowClear; }); S2.define('select2/selection/search',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function Search (decorated, $element, options) { decorated.call(this, $element, options); } Search.prototype.render = function (decorated) { var $search = $( '
              • ' + '' + '
              • ' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); container.on('open', function () { self.$search.attr('aria-owns', resultsId); self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = $previousChoice.data('data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { this.$search.focus(); } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting' ]; var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = ''; if (container != null) { id += container.id } else { id += Utils.generateChars(4); } id += '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 $.removeData(this, 'data'); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id !== undefined) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data $.data(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = $.data($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; $.data($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (!$.isPlainObject(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); self.container.focusOnActiveElement(); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ($request.status && $request.status === '0') { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var optionText = (option.text || '').toUpperCase(); var paramsTerm = (params.term || '').toUpperCase(); var checkText = optionText === paramsTerm; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '' + '' + '' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '' + '' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.attr('aria-owns', resultsId); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.val(''); }); container.on('focus', function () { if (container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '
              • ' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $(''); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { $(this).data('select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = $(this).data('select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ ], function () { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = $highlightedResults.data('data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if ($e.data('select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } $e.data('data', $e.data('select2Tags')); $e.data('tags', true); } if ($e.data('ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', $e.data('ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, $e.data()); } else { dataset = $e.data(); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if ($element.data('select2') != null) { $element.data('select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; $element.data('old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('open', function(){ // Focus on the active element when opening dropdown. // Needs 1 ms delay because of other 1 ms setTimeouts when rendering. setTimeout(function(){ self.focusOnActiveElement(); }, 1); }); $(document).on('keydown', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } // Move the focus to the selected element on keyboard navigation. // Required for screen readers to work properly. if (key === KEYS.DOWN || key === KEYS.UP) { self.focusOnActiveElement(); } else { // Focus on the search if user starts typing. var $searchField = self.$dropdown.find('.select2-search__field'); if (! $searchField.length) { $searchField = self.$container.find('.select2-search__field'); } $searchField.focus(); // Focus back to active selection when finished typing. // Small delay so typed character can be read by screen reader. setTimeout(function(){ self.focusOnActiveElement(); }, 1000); } } else if (self.hasFocus()) { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype.focusOnActiveElement = function () { // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards. if (! Utils.isTouchscreen()) { this.$results.find('li.select2-results__option--highlighted').focus(); } }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', this.$element.data('old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '' + '' + '' + '' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); $container.data('element', this.$element); return $container; }; return Select2; }); S2.define('select2/compat/utils',[ 'jquery' ], function ($) { function syncCssClasses ($dest, $src, adapter) { var classes, replacements = [], adapted; classes = $.trim($dest.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Save all Select2 classes if (this.indexOf('select2-') === 0) { replacements.push(this); } }); } classes = $.trim($src.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Only adapt non-Select2 classes if (this.indexOf('select2-') !== 0) { adapted = adapter(this); if (adapted != null) { replacements.push(adapted); } } }); } $dest.attr('class', replacements.join(' ')); } return { syncCssClasses: syncCssClasses }; }); S2.define('select2/compat/containerCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _containerAdapter (clazz) { return null; } function ContainerCSS () { } ContainerCSS.prototype.render = function (decorated) { var $container = decorated.call(this); var containerCssClass = this.options.get('containerCssClass') || ''; if ($.isFunction(containerCssClass)) { containerCssClass = containerCssClass(this.$element); } var containerCssAdapter = this.options.get('adaptContainerCssClass'); containerCssAdapter = containerCssAdapter || _containerAdapter; if (containerCssClass.indexOf(':all:') !== -1) { containerCssClass = containerCssClass.replace(':all:', ''); var _cssAdapter = containerCssAdapter; containerCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var containerCss = this.options.get('containerCss') || {}; if ($.isFunction(containerCss)) { containerCss = containerCss(this.$element); } CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); $container.css(containerCss); $container.addClass(containerCssClass); return $container; }; return ContainerCSS; }); S2.define('select2/compat/dropdownCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _dropdownAdapter (clazz) { return null; } function DropdownCSS () { } DropdownCSS.prototype.render = function (decorated) { var $dropdown = decorated.call(this); var dropdownCssClass = this.options.get('dropdownCssClass') || ''; if ($.isFunction(dropdownCssClass)) { dropdownCssClass = dropdownCssClass(this.$element); } var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; if (dropdownCssClass.indexOf(':all:') !== -1) { dropdownCssClass = dropdownCssClass.replace(':all:', ''); var _cssAdapter = dropdownCssAdapter; dropdownCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var dropdownCss = this.options.get('dropdownCss') || {}; if ($.isFunction(dropdownCss)) { dropdownCss = dropdownCss(this.$element); } CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); $dropdown.css(dropdownCss); $dropdown.addClass(dropdownCssClass); return $dropdown; }; return DropdownCSS; }); S2.define('select2/compat/initSelection',[ 'jquery' ], function ($) { function InitSelection (decorated, $element, options) { if (options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `initSelection` option has been deprecated in favor' + ' of a custom data adapter that overrides the `current` method. ' + 'This method is now called multiple times instead of a single ' + 'time when the instance is initialized. Support will be removed ' + 'for the `initSelection` option in future versions of Select2' ); } this.initSelection = options.get('initSelection'); this._isInitialized = false; decorated.call(this, $element, options); } InitSelection.prototype.current = function (decorated, callback) { var self = this; if (this._isInitialized) { decorated.call(this, callback); return; } this.initSelection.call(null, this.$element, function (data) { self._isInitialized = true; if (!$.isArray(data)) { data = [data]; } callback(data); }); }; return InitSelection; }); S2.define('select2/compat/inputData',[ 'jquery' ], function ($) { function InputData (decorated, $element, options) { this._currentData = []; this._valueSeparator = options.get('valueSeparator') || ','; if ($element.prop('type') === 'hidden') { if (options.get('debug') && console && console.warn) { console.warn( 'Select2: Using a hidden input with Select2 is no longer ' + 'supported and may stop working in the future. It is recommended ' + 'to use a `');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"â’¶":"A","A":"A","À":"A","Ã":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä€":"A","Ä‚":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ä":"A","Çž":"A","Ả":"A","Ã…":"A","Ǻ":"A","Ç":"A","È€":"A","È‚":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ä„":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ç¢":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","â’·":"B","ï¼¢":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Æ‚":"B","Æ":"B","â’¸":"C","ï¼£":"C","Ć":"C","Ĉ":"C","ÄŠ":"C","ÄŒ":"C","Ç":"C","Ḉ":"C","Ƈ":"C","È»":"C","Ꜿ":"C","â’¹":"D","D":"D","Ḋ":"D","ÄŽ":"D","Ḍ":"D","á¸":"D","Ḓ":"D","Ḏ":"D","Ä":"D","Æ‹":"D","ÆŠ":"D","Ɖ":"D","ê¹":"D","DZ":"DZ","Ç„":"DZ","Dz":"Dz","Ç…":"Dz","â’º":"E","ï¼¥":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ä’":"E","Ḕ":"E","Ḗ":"E","Ä”":"E","Ä–":"E","Ë":"E","Ẻ":"E","Äš":"E","È„":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Æ":"E","ÆŽ":"E","â’»":"F","F":"F","Ḟ":"F","Æ‘":"F","ê»":"F","â’¼":"G","ï¼§":"G","Ç´":"G","Äœ":"G","Ḡ":"G","Äž":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ“":"G","êž ":"G","ê½":"G","ê¾":"G","â’½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Èž":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","êž":"H","â’¾":"I","I":"I","ÃŒ":"I","Ã":"I","ÃŽ":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","Ỉ":"I","Ç":"I","Ȉ":"I","ÈŠ":"I","Ị":"I","Ä®":"I","Ḭ":"I","Æ—":"I","â’¿":"J","J":"J","Ä´":"J","Ɉ":"J","â“€":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","ê€":"K","ê‚":"K","ê„":"K","Ꞣ":"K","â“":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","êˆ":"L","ê†":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","â“‚":"M","ï¼­":"M","Ḿ":"M","á¹€":"M","Ṃ":"M","â±®":"M","Æœ":"M","Ⓝ":"N","ï¼®":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Å…":"N","Ṋ":"N","Ṉ":"N","È ":"N","Æ":"N","êž":"N","Ꞥ":"N","ÇŠ":"NJ","Ç‹":"Nj","â“„":"O","O":"O","Ã’":"O","Ó":"O","Ô":"O","á»’":"O","á»":"O","á»–":"O","á»”":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","ÅŒ":"O","á¹":"O","á¹’":"O","ÅŽ":"O","È®":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Å":"O","Ç‘":"O","ÈŒ":"O","ÈŽ":"O","Æ ":"O","Ờ":"O","Ớ":"O","á» ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","ÆŸ":"O","êŠ":"O","êŒ":"O","Æ¢":"OI","êŽ":"OO","È¢":"OU","â“…":"P","ï¼°":"P","á¹”":"P","á¹–":"P","Ƥ":"P","â±£":"P","ê":"P","ê’":"P","ê”":"P","Ⓠ":"Q","ï¼±":"Q","ê–":"Q","ê˜":"Q","ÉŠ":"Q","Ⓡ":"R","ï¼²":"R","Å”":"R","Ṙ":"R","Ř":"R","È":"R","È’":"R","Ṛ":"R","Ṝ":"R","Å–":"R","Ṟ":"R","ÉŒ":"R","Ɽ":"R","êš":"R","Ꞧ":"R","êž‚":"R","Ⓢ":"S","ï¼³":"S","ẞ":"S","Åš":"S","Ṥ":"S","Åœ":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","Ș":"S","Åž":"S","â±¾":"S","Ꞩ":"S","êž„":"S","Ⓣ":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Èš":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","ï¼µ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ç›":"U","Ç—":"U","Ç•":"U","Ç™":"U","Ủ":"U","Å®":"U","Ű":"U","Ç“":"U","È”":"U","È–":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É„":"U","â“‹":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","êž":"V","É…":"V","ê ":"VY","Ⓦ":"W","ï¼·":"W","Ẁ":"W","Ẃ":"W","Å´":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","â±²":"W","â“":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","ÉŽ":"Y","Ỿ":"Y","â“":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â“":"a","ï½":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","ÇŸ":"a","ả":"a","Ã¥":"a","Ç»":"a","ÇŽ":"a","È":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","á¸":"a","Ä…":"a","â±¥":"a","É":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","â“‘":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","Æ€":"b","ƃ":"b","É“":"b","â“’":"c","c":"c","ć":"c","ĉ":"c","Ä‹":"c","Ä":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","â““":"d","d":"d","ḋ":"d","Ä":"d","á¸":"d","ḑ":"d","ḓ":"d","á¸":"d","Ä‘":"d","ÆŒ":"d","É–":"d","É—":"d","êº":"d","dz":"dz","dž":"dz","â“”":"e","ï½…":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»…":"e","ể":"e","ẽ":"e","Ä“":"e","ḕ":"e","ḗ":"e","Ä•":"e","Ä—":"e","ë":"e","ẻ":"e","Ä›":"e","È…":"e","ȇ":"e","ẹ":"e","ệ":"e","È©":"e","á¸":"e","Ä™":"e","ḙ":"e","ḛ":"e","ɇ":"e","É›":"e","Ç":"e","â“•":"f","f":"f","ḟ":"f","Æ’":"f","ê¼":"f","â“–":"g","g":"g","ǵ":"g","Ä":"g","ḡ":"g","ÄŸ":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","êž¡":"g","áµ¹":"g","ê¿":"g","â“—":"h","h":"h","Ä¥":"h","ḣ":"h","ḧ":"h","ÈŸ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ•":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","Ä©":"i","Ä«":"i","Ä­":"i","ï":"i","ḯ":"i","ỉ":"i","Ç":"i","ȉ":"i","È‹":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","â“™":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ™":"k","ⱪ":"k","ê":"k","êƒ":"k","ê…":"k","ꞣ":"k","â“›":"l","l":"l","Å€":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å‚":"l","Æš":"l","É«":"l","ⱡ":"l","ê‰":"l","êž":"l","ê‡":"l","lj":"lj","ⓜ":"m","ï½":"m","ḿ":"m","á¹":"m","ṃ":"m","ɱ":"m","ɯ":"m","â“":"n","n":"n","ǹ":"n","Å„":"n","ñ":"n","á¹…":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","Æž":"n","ɲ":"n","ʼn":"n","êž‘":"n","ꞥ":"n","ÇŒ":"nj","ⓞ":"o","ï½":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","á»—":"o","ổ":"o","õ":"o","á¹":"o","È­":"o","á¹":"o","Å":"o","ṑ":"o","ṓ":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å‘":"o","Ç’":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»›":"o","ỡ":"o","ở":"o","ợ":"o","á»":"o","á»™":"o","Ç«":"o","Ç­":"o","ø":"o","Ç¿":"o","É”":"o","ê‹":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","ⓟ":"p","ï½":"p","ṕ":"p","á¹—":"p","Æ¥":"p","áµ½":"p","ê‘":"p","ê“":"p","ê•":"p","â“ ":"q","q":"q","É‹":"q","ê—":"q","ê™":"q","â“¡":"r","ï½’":"r","Å•":"r","á¹™":"r","Å™":"r","È‘":"r","È“":"r","á¹›":"r","á¹":"r","Å—":"r","ṟ":"r","É":"r","ɽ":"r","ê›":"r","êž§":"r","ꞃ":"r","â“¢":"s","s":"s","ß":"s","Å›":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È™":"s","ÅŸ":"s","È¿":"s","êž©":"s","êž…":"s","ẛ":"s","â“£":"t","ï½”":"t","ṫ":"t","ẗ":"t","Å¥":"t","á¹­":"t","È›":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ­":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å­":"u","ü":"u","Çœ":"u","ǘ":"u","Ç–":"u","Çš":"u","á»§":"u","ů":"u","ű":"u","Ç”":"u","È•":"u","È—":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»­":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","ʉ":"u","â“¥":"v","ï½–":"v","á¹½":"v","ṿ":"v","Ê‹":"v","êŸ":"v","ÊŒ":"v","ê¡":"vy","ⓦ":"w","ï½—":"w","áº":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","â±³":"w","â“§":"x","x":"x","ẋ":"x","áº":"x","ⓨ":"y","ï½™":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","ẙ":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â“©":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","È¥":"z","É€":"z","ⱬ":"z","ê£":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","ÎŒ":"Ο","ÎŽ":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ÏŠ":"ι","Î":"ι","ÏŒ":"ο","Ï":"Ï…","Ï‹":"Ï…","ΰ":"Ï…","ω":"ω","Ï‚":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
              • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); container.on('open', function () { self.$search.attr('aria-owns', resultsId); self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = $previousChoice.data('data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { this.$search.focus(); } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting' ]; var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = ''; if (container != null) { id += container.id } else { id += Utils.generateChars(4); } id += '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 $.removeData(this, 'data'); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id !== undefined) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data $.data(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = $.data($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; $.data($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (!$.isPlainObject(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); self.container.focusOnActiveElement(); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ($request.status && $request.status === '0') { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var optionText = (option.text || '').toUpperCase(); var paramsTerm = (params.term || '').toUpperCase(); var checkText = optionText === paramsTerm; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '' + '' + '' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '' + '' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.attr('aria-owns', resultsId); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.val(''); }); container.on('focus', function () { if (container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '
              • ' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $(''); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { $(this).data('select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = $(this).data('select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ ], function () { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = $highlightedResults.data('data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if ($e.data('select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } $e.data('data', $e.data('select2Tags')); $e.data('tags', true); } if ($e.data('ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', $e.data('ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, $e.data()); } else { dataset = $e.data(); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if ($element.data('select2') != null) { $element.data('select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; $element.data('old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('open', function(){ // Focus on the active element when opening dropdown. // Needs 1 ms delay because of other 1 ms setTimeouts when rendering. setTimeout(function(){ self.focusOnActiveElement(); }, 1); }); $(document).on('keydown', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } // Move the focus to the selected element on keyboard navigation. // Required for screen readers to work properly. if (key === KEYS.DOWN || key === KEYS.UP) { self.focusOnActiveElement(); } else { // Focus on the search if user starts typing. var $searchField = self.$dropdown.find('.select2-search__field'); if (! $searchField.length) { $searchField = self.$container.find('.select2-search__field'); } $searchField.focus(); // Focus back to active selection when finished typing. // Small delay so typed character can be read by screen reader. setTimeout(function(){ self.focusOnActiveElement(); }, 1000); } } else if (self.hasFocus()) { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype.focusOnActiveElement = function () { // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards. if (! Utils.isTouchscreen()) { this.$results.find('li.select2-results__option--highlighted').focus(); } }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', this.$element.data('old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '' + '' + '' + '' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); $container.data('element', this.$element); return $container; }; return Select2; }); S2.define('jquery-mousewheel',[ 'jquery' ], function ($) { // Used to shim jQuery.mousewheel for non-full builds. return $; }); S2.define('jquery.select2',[ 'jquery', 'jquery-mousewheel', './select2/core', './select2/defaults' ], function ($, _, Select2, Defaults) { if ($.fn.selectWoo == null) { // All methods that should return the element var thisMethods = ['open', 'close', 'destroy']; $.fn.selectWoo = function (options) { options = options || {}; if (typeof options === 'object') { this.each(function () { var instanceOptions = $.extend(true, {}, options); var instance = new Select2($(this), instanceOptions); }); return this; } else if (typeof options === 'string') { var ret; var args = Array.prototype.slice.call(arguments, 1); this.each(function () { var instance = $(this).data('select2'); if (instance == null && window.console && console.error) { console.error( 'The select2(\'' + options + '\') method was called on an ' + 'element that is not using Select2.' ); } ret = instance[options].apply(instance, args); }); // Check if we should be returning `this` if ($.inArray(options, thisMethods) > -1) { return this; } return ret; } else { throw new Error('Invalid arguments for Select2: ' + options); } }; } if ($.fn.select2 != null && $.fn.select2.defaults != null) { $.fn.selectWoo.defaults = $.fn.select2.defaults; } if ($.fn.selectWoo.defaults == null) { $.fn.selectWoo.defaults = Defaults; } // Also register selectWoo under select2 if select2 is not already present. $.fn.select2 = $.fn.select2 || $.fn.selectWoo; return Select2; }); // Return the AMD loader configuration so it can be used outside of this file return { define: S2.define, require: S2.require }; }()); // Autoload the jQuery bindings // We know that all of the modules exist above this, so we're safe var select2 = S2.require('jquery.select2'); // Hold the AMD module references on the jQuery function that was just loaded // This allows Select2 to use the internal loader outside of this file, such // as in the language files. jQuery.fn.select2.amd = S2; jQuery.fn.selectWoo.amd = S2; // Return the Select2 instance for anyone who is importing it. return select2; })); kirki/assets/vendor/selectWoo/js/select2.min.js000064400000205504151232236230015522 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
                  ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
                • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
                    '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
                  • ×
                  • ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('
                  • ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"â’¶":"A","A":"A","À":"A","Ã":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä€":"A","Ä‚":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ä":"A","Çž":"A","Ả":"A","Ã…":"A","Ǻ":"A","Ç":"A","È€":"A","È‚":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ä„":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ç¢":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","â’·":"B","ï¼¢":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Æ‚":"B","Æ":"B","â’¸":"C","ï¼£":"C","Ć":"C","Ĉ":"C","ÄŠ":"C","ÄŒ":"C","Ç":"C","Ḉ":"C","Ƈ":"C","È»":"C","Ꜿ":"C","â’¹":"D","D":"D","Ḋ":"D","ÄŽ":"D","Ḍ":"D","á¸":"D","Ḓ":"D","Ḏ":"D","Ä":"D","Æ‹":"D","ÆŠ":"D","Ɖ":"D","ê¹":"D","DZ":"DZ","Ç„":"DZ","Dz":"Dz","Ç…":"Dz","â’º":"E","ï¼¥":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ä’":"E","Ḕ":"E","Ḗ":"E","Ä”":"E","Ä–":"E","Ë":"E","Ẻ":"E","Äš":"E","È„":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Æ":"E","ÆŽ":"E","â’»":"F","F":"F","Ḟ":"F","Æ‘":"F","ê»":"F","â’¼":"G","ï¼§":"G","Ç´":"G","Äœ":"G","Ḡ":"G","Äž":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ“":"G","êž ":"G","ê½":"G","ê¾":"G","â’½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Èž":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","êž":"H","â’¾":"I","I":"I","ÃŒ":"I","Ã":"I","ÃŽ":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","Ỉ":"I","Ç":"I","Ȉ":"I","ÈŠ":"I","Ị":"I","Ä®":"I","Ḭ":"I","Æ—":"I","â’¿":"J","J":"J","Ä´":"J","Ɉ":"J","â“€":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","ê€":"K","ê‚":"K","ê„":"K","Ꞣ":"K","â“":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","êˆ":"L","ê†":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","â“‚":"M","ï¼­":"M","Ḿ":"M","á¹€":"M","Ṃ":"M","â±®":"M","Æœ":"M","Ⓝ":"N","ï¼®":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Å…":"N","Ṋ":"N","Ṉ":"N","È ":"N","Æ":"N","êž":"N","Ꞥ":"N","ÇŠ":"NJ","Ç‹":"Nj","â“„":"O","O":"O","Ã’":"O","Ó":"O","Ô":"O","á»’":"O","á»":"O","á»–":"O","á»”":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","ÅŒ":"O","á¹":"O","á¹’":"O","ÅŽ":"O","È®":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Å":"O","Ç‘":"O","ÈŒ":"O","ÈŽ":"O","Æ ":"O","Ờ":"O","Ớ":"O","á» ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","ÆŸ":"O","êŠ":"O","êŒ":"O","Æ¢":"OI","êŽ":"OO","È¢":"OU","â“…":"P","ï¼°":"P","á¹”":"P","á¹–":"P","Ƥ":"P","â±£":"P","ê":"P","ê’":"P","ê”":"P","Ⓠ":"Q","ï¼±":"Q","ê–":"Q","ê˜":"Q","ÉŠ":"Q","Ⓡ":"R","ï¼²":"R","Å”":"R","Ṙ":"R","Ř":"R","È":"R","È’":"R","Ṛ":"R","Ṝ":"R","Å–":"R","Ṟ":"R","ÉŒ":"R","Ɽ":"R","êš":"R","Ꞧ":"R","êž‚":"R","Ⓢ":"S","ï¼³":"S","ẞ":"S","Åš":"S","Ṥ":"S","Åœ":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","Ș":"S","Åž":"S","â±¾":"S","Ꞩ":"S","êž„":"S","Ⓣ":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Èš":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","ï¼µ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ç›":"U","Ç—":"U","Ç•":"U","Ç™":"U","Ủ":"U","Å®":"U","Ű":"U","Ç“":"U","È”":"U","È–":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É„":"U","â“‹":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","êž":"V","É…":"V","ê ":"VY","Ⓦ":"W","ï¼·":"W","Ẁ":"W","Ẃ":"W","Å´":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","â±²":"W","â“":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","ÉŽ":"Y","Ỿ":"Y","â“":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â“":"a","ï½":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","ÇŸ":"a","ả":"a","Ã¥":"a","Ç»":"a","ÇŽ":"a","È":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","á¸":"a","Ä…":"a","â±¥":"a","É":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","â“‘":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","Æ€":"b","ƃ":"b","É“":"b","â“’":"c","c":"c","ć":"c","ĉ":"c","Ä‹":"c","Ä":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","â““":"d","d":"d","ḋ":"d","Ä":"d","á¸":"d","ḑ":"d","ḓ":"d","á¸":"d","Ä‘":"d","ÆŒ":"d","É–":"d","É—":"d","êº":"d","dz":"dz","dž":"dz","â“”":"e","ï½…":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»…":"e","ể":"e","ẽ":"e","Ä“":"e","ḕ":"e","ḗ":"e","Ä•":"e","Ä—":"e","ë":"e","ẻ":"e","Ä›":"e","È…":"e","ȇ":"e","ẹ":"e","ệ":"e","È©":"e","á¸":"e","Ä™":"e","ḙ":"e","ḛ":"e","ɇ":"e","É›":"e","Ç":"e","â“•":"f","f":"f","ḟ":"f","Æ’":"f","ê¼":"f","â“–":"g","g":"g","ǵ":"g","Ä":"g","ḡ":"g","ÄŸ":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","êž¡":"g","áµ¹":"g","ê¿":"g","â“—":"h","h":"h","Ä¥":"h","ḣ":"h","ḧ":"h","ÈŸ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ•":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","Ä©":"i","Ä«":"i","Ä­":"i","ï":"i","ḯ":"i","ỉ":"i","Ç":"i","ȉ":"i","È‹":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","â“™":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ™":"k","ⱪ":"k","ê":"k","êƒ":"k","ê…":"k","ꞣ":"k","â“›":"l","l":"l","Å€":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å‚":"l","Æš":"l","É«":"l","ⱡ":"l","ê‰":"l","êž":"l","ê‡":"l","lj":"lj","ⓜ":"m","ï½":"m","ḿ":"m","á¹":"m","ṃ":"m","ɱ":"m","ɯ":"m","â“":"n","n":"n","ǹ":"n","Å„":"n","ñ":"n","á¹…":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","Æž":"n","ɲ":"n","ʼn":"n","êž‘":"n","ꞥ":"n","ÇŒ":"nj","ⓞ":"o","ï½":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","á»—":"o","ổ":"o","õ":"o","á¹":"o","È­":"o","á¹":"o","Å":"o","ṑ":"o","ṓ":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å‘":"o","Ç’":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»›":"o","ỡ":"o","ở":"o","ợ":"o","á»":"o","á»™":"o","Ç«":"o","Ç­":"o","ø":"o","Ç¿":"o","É”":"o","ê‹":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","ⓟ":"p","ï½":"p","ṕ":"p","á¹—":"p","Æ¥":"p","áµ½":"p","ê‘":"p","ê“":"p","ê•":"p","â“ ":"q","q":"q","É‹":"q","ê—":"q","ê™":"q","â“¡":"r","ï½’":"r","Å•":"r","á¹™":"r","Å™":"r","È‘":"r","È“":"r","á¹›":"r","á¹":"r","Å—":"r","ṟ":"r","É":"r","ɽ":"r","ê›":"r","êž§":"r","ꞃ":"r","â“¢":"s","s":"s","ß":"s","Å›":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È™":"s","ÅŸ":"s","È¿":"s","êž©":"s","êž…":"s","ẛ":"s","â“£":"t","ï½”":"t","ṫ":"t","ẗ":"t","Å¥":"t","á¹­":"t","È›":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ­":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å­":"u","ü":"u","Çœ":"u","ǘ":"u","Ç–":"u","Çš":"u","á»§":"u","ů":"u","ű":"u","Ç”":"u","È•":"u","È—":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»­":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","ʉ":"u","â“¥":"v","ï½–":"v","á¹½":"v","ṿ":"v","Ê‹":"v","êŸ":"v","ÊŒ":"v","ê¡":"vy","ⓦ":"w","ï½—":"w","áº":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","â±³":"w","â“§":"x","x":"x","ẋ":"x","áº":"x","ⓨ":"y","ï½™":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","ẙ":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â“©":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","È¥":"z","É€":"z","ⱬ":"z","ê£":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","ÎŒ":"Ο","ÎŽ":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ÏŠ":"ι","Î":"ι","ÏŒ":"ο","Ï":"Ï…","Ï‹":"Ï…","ΰ":"Ï…","ω":"ω","Ï‚":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
                  • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});kirki/assets/vendor/selectWoo/js/selectWoo.full.js000064400000505301151232236230016302 0ustar00/*! * SelectWoo 1.0.1 * https://github.com/woocommerce/selectWoo * * Released under the MIT license * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function (root, jQuery) { if (jQuery === undefined) { // require('jQuery') returns a factory that requires window to // build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop // if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } } (function (jQuery) { // This is needed so we can catch the AMD loader configuration and use it // The inner file should be wrapped (by `banner.start.js`) in a function that // returns the AMD loader references. var S2 =(function () { // Restore the Select2 AMD loader so it can be used // Needed mostly in the language files, where the loader is not inserted if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { var S2 = jQuery.fn.select2.amd; } var S2;(function () { if (!S2 || !S2.requirejs) { if (!S2) { S2 = {}; } else { require = S2; } /** * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, handlers, defined = {}, waiting = {}, config = {}, defining = {}, hasOwn = Object.prototype.hasOwnProperty, aps = [].slice, jsSuffixRegExp = /\.js$/; function hasProp(obj, prop) { return hasOwn.call(obj, prop); } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, normalizedBaseParts, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name) { name = name.split('/'); lastIndex = name.length - 1; // If wanting node ID compatibility, strip .js from end // of IDs. Have to do this here, and not in nameToUrl // because node allows either .js or non .js to map // to same file. if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } // Starts with a '.' so need the baseName if (name[0].charAt(0) === '.' && baseParts) { //Convert baseName to array, and lop off the last part, //so that . matches that 'directory' and not name of the baseName's //module. For instance, baseName of 'one/two/three', maps to //'one/two/three.js', but we want the directory, 'one/two' for //this normalization. normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); name = normalizedBaseParts.concat(name); } //start trimDots for (i = 0; i < name.length; i++) { part = name[i]; if (part === '.') { name.splice(i, 1); i -= 1; } else if (part === '..') { // If at the start, or previous value is still .., // keep them so that when converted to a path it may // still work when converted to a path, even though // as an ID it is less than ideal. In larger point // releases, may be better to just kick out an error. if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') { continue; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join('/'); } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only //one arg, it is the array form without a callback. Insert //a null so that the following concat is correct. if (typeof args[0] !== 'string' && args.length === 1) { args.push(null); } return req.apply(undef, args.concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (hasProp(waiting, name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!hasProp(defined, name) && !hasProp(defining, name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } //Creates a parts array for a relName where first part is plugin ID, //second part is resource ID. Assumes relName has already been normalized. function makeRelParts(relName) { return relName ? splitPrefix(relName) : []; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relParts) { var plugin, parts = splitPrefix(name), prefix = parts[0], relResourceName = relParts[1]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relResourceName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relResourceName)); } else { name = normalize(name, relResourceName); } } else { name = normalize(name, relResourceName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } handlers = { require: function (name) { return makeRequire(name); }, exports: function (name) { var e = defined[name]; if (typeof e !== 'undefined') { return e; } else { return (defined[name] = {}); } }, module: function (name) { return { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } }; main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, relParts, args = [], callbackType = typeof callback, usingExports; //Use name if no relName relName = relName || name; relParts = makeRelParts(relName); //Call the callback to define the module, if necessary. if (callbackType === 'undefined' || callbackType === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relParts); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = handlers.require(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = handlers.exports(name); usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = handlers.module(name); } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else { throw new Error(name + ' missing ' + depName); } } ret = callback ? callback.apply(defined[name], args) : undefined; if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { if (handlers[deps]) { //callback in this case is really relName return handlers[deps](callback); } //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, makeRelParts(callback)).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (config.deps) { req(config.deps, config.callback); } if (!callback) { return; } if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { //Using a non-zero value because of concern for what old browsers //do, and latest browsers "upgrade" to 4 if lower value is used: //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: //If want a value immediately, use require('id') instead -- something //that works in almond on the global level, but not guaranteed and //unlikely to work in other AMD implementations. setTimeout(function () { main(undef, deps, callback, relName); }, 4); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { return req(cfg); }; /** * Expose module registry for debugging and tooling */ requirejs._defined = defined; define = function (name, deps, callback) { if (typeof name !== 'string') { throw new Error('See almond README: incorrect module build, no module name'); } //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } if (!hasProp(defined, name) && !hasProp(waiting, name)) { waiting[name] = [name, deps, callback]; } }; define.amd = { jQuery: true }; }()); S2.requirejs = requirejs;S2.require = require;S2.define = define; } }()); S2.define("almond", function(){}); /* global jQuery:false, $:false */ S2.define('jquery',[],function () { var _$ = jQuery || $; if (_$ == null && console && console.error) { console.error( 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.' ); } return _$; }); S2.define('select2/utils',[ 'jquery' ], function ($) { var Utils = {}; Utils.Extend = function (ChildClass, SuperClass) { var __hasProp = {}.hasOwnProperty; function BaseConstructor () { this.constructor = ChildClass; } for (var key in SuperClass) { if (__hasProp.call(SuperClass, key)) { ChildClass[key] = SuperClass[key]; } } BaseConstructor.prototype = SuperClass.prototype; ChildClass.prototype = new BaseConstructor(); ChildClass.__super__ = SuperClass.prototype; return ChildClass; }; function getMethods (theClass) { var proto = theClass.prototype; var methods = []; for (var methodName in proto) { var m = proto[methodName]; if (typeof m !== 'function') { continue; } if (methodName === 'constructor') { continue; } methods.push(methodName); } return methods; } Utils.Decorate = function (SuperClass, DecoratorClass) { var decoratedMethods = getMethods(DecoratorClass); var superMethods = getMethods(SuperClass); function DecoratedClass () { var unshift = Array.prototype.unshift; var argCount = DecoratorClass.prototype.constructor.length; var calledConstructor = SuperClass.prototype.constructor; if (argCount > 0) { unshift.call(arguments, SuperClass.prototype.constructor); calledConstructor = DecoratorClass.prototype.constructor; } calledConstructor.apply(this, arguments); } DecoratorClass.displayName = SuperClass.displayName; function ctr () { this.constructor = DecoratedClass; } DecoratedClass.prototype = new ctr(); for (var m = 0; m < superMethods.length; m++) { var superMethod = superMethods[m]; DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod]; } var calledMethod = function (methodName) { // Stub out the original method if it's not decorating an actual method var originalMethod = function () {}; if (methodName in DecoratedClass.prototype) { originalMethod = DecoratedClass.prototype[methodName]; } var decoratedMethod = DecoratorClass.prototype[methodName]; return function () { var unshift = Array.prototype.unshift; unshift.call(arguments, originalMethod); return decoratedMethod.apply(this, arguments); }; }; for (var d = 0; d < decoratedMethods.length; d++) { var decoratedMethod = decoratedMethods[d]; DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); } return DecoratedClass; }; var Observable = function () { this.listeners = {}; }; Observable.prototype.on = function (event, callback) { this.listeners = this.listeners || {}; if (event in this.listeners) { this.listeners[event].push(callback); } else { this.listeners[event] = [callback]; } }; Observable.prototype.trigger = function (event) { var slice = Array.prototype.slice; var params = slice.call(arguments, 1); this.listeners = this.listeners || {}; // Params should always come in as an array if (params == null) { params = []; } // If there are no arguments to the event, use a temporary object if (params.length === 0) { params.push({}); } // Set the `_type` of the first object to the event params[0]._type = event; if (event in this.listeners) { this.invoke(this.listeners[event], slice.call(arguments, 1)); } if ('*' in this.listeners) { this.invoke(this.listeners['*'], arguments); } }; Observable.prototype.invoke = function (listeners, params) { for (var i = 0, len = listeners.length; i < len; i++) { listeners[i].apply(this, params); } }; Utils.Observable = Observable; Utils.generateChars = function (length) { var chars = ''; for (var i = 0; i < length; i++) { var randomChar = Math.floor(Math.random() * 36); chars += randomChar.toString(36); } return chars; }; Utils.bind = function (func, context) { return function () { func.apply(context, arguments); }; }; Utils._convertData = function (data) { for (var originalKey in data) { var keys = originalKey.split('-'); var dataLevel = data; if (keys.length === 1) { continue; } for (var k = 0; k < keys.length; k++) { var key = keys[k]; // Lowercase the first letter // By default, dash-separated becomes camelCase key = key.substring(0, 1).toLowerCase() + key.substring(1); if (!(key in dataLevel)) { dataLevel[key] = {}; } if (k == keys.length - 1) { dataLevel[key] = data[originalKey]; } dataLevel = dataLevel[key]; } delete data[originalKey]; } return data; }; Utils.hasScroll = function (index, el) { // Adapted from the function created by @ShadowScripter // and adapted by @BillBarry on the Stack Exchange Code Review website. // The original code can be found at // http://codereview.stackexchange.com/q/13338 // and was designed to be used with the Sizzle selector engine. var $el = $(el); var overflowX = el.style.overflowX; var overflowY = el.style.overflowY; //Check both x and y declarations if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) { return false; } if (overflowX === 'scroll' || overflowY === 'scroll') { return true; } return ($el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth); }; Utils.escapeMarkup = function (markup) { var replaceMap = { '\\': '\', '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''', '/': '/' }; // Do not try to escape the markup if it's not a string if (typeof markup !== 'string') { return markup; } return String(markup).replace(/[&<>"'\/\\]/g, function (match) { return replaceMap[match]; }); }; // Append an array of jQuery nodes to a given element. Utils.appendMany = function ($element, $nodes) { // jQuery 1.7.x does not support $.fn.append() with an array // Fall back to a jQuery object collection using $.fn.add() if ($.fn.jquery.substr(0, 3) === '1.7') { var $jqNodes = $(); $.map($nodes, function (node) { $jqNodes = $jqNodes.add(node); }); $nodes = $jqNodes; } $element.append($nodes); }; // Determine whether the browser is on a touchscreen device. Utils.isTouchscreen = function() { if ('undefined' === typeof Utils._isTouchscreenCache) { Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement; } return Utils._isTouchscreenCache; } return Utils; }); S2.define('select2/results',[ 'jquery', './utils' ], function ($, Utils) { function Results ($element, options, dataAdapter) { this.$element = $element; this.data = dataAdapter; this.options = options; Results.__super__.constructor.call(this); } Utils.Extend(Results, Utils.Observable); Results.prototype.render = function () { var $results = $( '
                      ' ); if (this.options.get('multiple')) { $results.attr('aria-multiselectable', 'true'); } this.$results = $results; return $results; }; Results.prototype.clear = function () { this.$results.empty(); }; Results.prototype.displayMessage = function (params) { var escapeMarkup = this.options.get('escapeMarkup'); this.clear(); this.hideLoading(); var $message = $( '
                    • ' ); var message = this.options.get('translations').get(params.message); $message.append( escapeMarkup( message(params.args) ) ); $message[0].className += ' select2-results__message'; this.$results.append($message); }; Results.prototype.hideMessages = function () { this.$results.find('.select2-results__message').remove(); }; Results.prototype.append = function (data) { this.hideLoading(); var $options = []; if (data.results == null || data.results.length === 0) { if (this.$results.children().length === 0) { this.trigger('results:message', { message: 'noResults' }); } return; } data.results = this.sort(data.results); for (var d = 0; d < data.results.length; d++) { var item = data.results[d]; var $option = this.option(item); $options.push($option); } this.$results.append($options); }; Results.prototype.position = function ($results, $dropdown) { var $resultsContainer = $dropdown.find('.select2-results'); $resultsContainer.append($results); }; Results.prototype.sort = function (data) { var sorter = this.options.get('sorter'); return sorter(data); }; Results.prototype.highlightFirstItem = function () { var $options = this.$results .find('.select2-results__option[data-selected]'); var $selected = $options.filter('[data-selected=true]'); // Check if there are any selected options if ($selected.length > 0) { // If there are selected options, highlight the first $selected.first().trigger('mouseenter'); } else { // If there are no selected options, highlight the first option // in the dropdown $options.first().trigger('mouseenter'); } this.ensureHighlightVisible(); }; Results.prototype.setClasses = function () { var self = this; this.data.current(function (selected) { var selectedIds = $.map(selected, function (s) { return s.id.toString(); }); var $options = self.$results .find('.select2-results__option[data-selected]'); $options.each(function () { var $option = $(this); var item = $.data(this, 'data'); // id needs to be converted to a string when comparing var id = '' + item.id; if ((item.element != null && item.element.selected) || (item.element == null && $.inArray(id, selectedIds) > -1)) { $option.attr('data-selected', 'true'); } else { $option.attr('data-selected', 'false'); } }); }); }; Results.prototype.showLoading = function (params) { this.hideLoading(); var loadingMore = this.options.get('translations').get('searching'); var loading = { disabled: true, loading: true, text: loadingMore(params) }; var $loading = this.option(loading); $loading.className += ' loading-results'; this.$results.prepend($loading); }; Results.prototype.hideLoading = function () { this.$results.find('.loading-results').remove(); }; Results.prototype.option = function (data) { var option = document.createElement('li'); option.className = 'select2-results__option'; var attrs = { 'role': 'option', 'data-selected': 'false', 'tabindex': -1 }; if (data.disabled) { delete attrs['data-selected']; attrs['aria-disabled'] = 'true'; } if (data.id == null) { delete attrs['data-selected']; } if (data._resultId != null) { option.id = data._resultId; } if (data.title) { option.title = data.title; } if (data.children) { attrs['aria-label'] = data.text; delete attrs['data-selected']; } for (var attr in attrs) { var val = attrs[attr]; option.setAttribute(attr, val); } if (data.children) { var $option = $(option); var label = document.createElement('strong'); label.className = 'select2-results__group'; var $label = $(label); this.template(data, label); $label.attr('role', 'presentation'); var $children = []; for (var c = 0; c < data.children.length; c++) { var child = data.children[c]; var $child = this.option(child); $children.push($child); } var $childrenContainer = $('
                        ', { 'class': 'select2-results__options select2-results__options--nested', 'role': 'listbox' }); $childrenContainer.append($children); $option.attr('role', 'list'); $option.append(label); $option.append($childrenContainer); } else { this.template(data, option); } $.data(option, 'data', data); return option; }; Results.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-results'; this.$results.attr('id', id); container.on('results:all', function (params) { self.clear(); self.append(params.data); if (container.isOpen()) { self.setClasses(); self.highlightFirstItem(); } }); container.on('results:append', function (params) { self.append(params.data); if (container.isOpen()) { self.setClasses(); } }); container.on('query', function (params) { self.hideMessages(); self.showLoading(params); }); container.on('select', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('unselect', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('open', function () { // When the dropdown is open, aria-expended="true" self.$results.attr('aria-expanded', 'true'); self.$results.attr('aria-hidden', 'false'); self.setClasses(); self.ensureHighlightVisible(); }); container.on('close', function () { // When the dropdown is closed, aria-expended="false" self.$results.attr('aria-expanded', 'false'); self.$results.attr('aria-hidden', 'true'); self.$results.removeAttr('aria-activedescendant'); }); container.on('results:toggle', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } $highlighted.trigger('mouseup'); }); container.on('results:select', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } var data = $highlighted.data('data'); if ($highlighted.attr('data-selected') == 'true') { self.trigger('close', {}); } else { self.trigger('select', { data: data }); } }); container.on('results:previous', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[data-selected]'); var currentIndex = $options.index($highlighted); // If we are already at te top, don't move further if (currentIndex === 0) { return; } var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first if ($highlighted.length === 0) { nextIndex = 0; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top; var nextTop = $next.offset().top; var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextTop - currentOffset < 0) { self.$results.scrollTop(nextOffset); } }); container.on('results:next', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[data-selected]'); var currentIndex = $options.index($highlighted); var nextIndex = currentIndex + 1; // If we are at the last option, stay there if (nextIndex >= $options.length) { return; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var nextBottom = $next.offset().top + $next.outerHeight(false); var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextBottom > currentOffset) { self.$results.scrollTop(nextOffset); } }); container.on('results:focus', function (params) { params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true'); self.$results.attr('aria-activedescendant', params.element.attr('id')); }); container.on('results:message', function (params) { self.displayMessage(params); }); if ($.fn.mousewheel) { this.$results.on('mousewheel', function (e) { var top = self.$results.scrollTop(); var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); if (isAtTop) { self.$results.scrollTop(0); e.preventDefault(); e.stopPropagation(); } else if (isAtBottom) { self.$results.scrollTop( self.$results.get(0).scrollHeight - self.$results.height() ); e.preventDefault(); e.stopPropagation(); } }); } this.$results.on('mouseup', '.select2-results__option[data-selected]', function (evt) { var $this = $(this); var data = $this.data('data'); if ($this.attr('data-selected') === 'true') { if (self.options.get('multiple')) { self.trigger('unselect', { originalEvent: evt, data: data }); } else { self.trigger('close', {}); } return; } self.trigger('select', { originalEvent: evt, data: data }); }); this.$results.on('mouseenter', '.select2-results__option[data-selected]', function (evt) { var data = $(this).data('data'); self.getHighlightedResults() .removeClass('select2-results__option--highlighted') .attr('aria-selected', 'false'); self.trigger('results:focus', { data: data, element: $(this) }); }); }; Results.prototype.getHighlightedResults = function () { var $highlighted = this.$results .find('.select2-results__option--highlighted'); return $highlighted; }; Results.prototype.destroy = function () { this.$results.remove(); }; Results.prototype.ensureHighlightVisible = function () { var $highlighted = this.getHighlightedResults(); if ($highlighted.length === 0) { return; } var $options = this.$results.find('[data-selected]'); var currentIndex = $options.index($highlighted); var currentOffset = this.$results.offset().top; var nextTop = $highlighted.offset().top; var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); var offsetDelta = nextTop - currentOffset; nextOffset -= $highlighted.outerHeight(false) * 2; if (currentIndex <= 2) { this.$results.scrollTop(0); } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { this.$results.scrollTop(nextOffset); } }; Results.prototype.template = function (result, container) { var template = this.options.get('templateResult'); var escapeMarkup = this.options.get('escapeMarkup'); var content = template(result, container); if (content == null) { container.style.display = 'none'; } else if (typeof content === 'string') { container.innerHTML = escapeMarkup(content); } else { $(container).append(content); } }; return Results; }); S2.define('select2/keys',[ ], function () { var KEYS = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }; return KEYS; }); S2.define('select2/selection/base',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function BaseSelection ($element, options) { this.$element = $element; this.options = options; BaseSelection.__super__.constructor.call(this); } Utils.Extend(BaseSelection, Utils.Observable); BaseSelection.prototype.render = function () { var $selection = $( '' + '' ); this._tabindex = 0; if (this.$element.data('old-tabindex') != null) { this._tabindex = this.$element.data('old-tabindex'); } else if (this.$element.attr('tabindex') != null) { this._tabindex = this.$element.attr('tabindex'); } $selection.attr('title', this.$element.attr('title')); $selection.attr('tabindex', this._tabindex); this.$selection = $selection; return $selection; }; BaseSelection.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-container'; var resultsId = container.id + '-results'; var searchHidden = this.options.get('minimumResultsForSearch') === Infinity; this.container = container; this.$selection.on('focus', function (evt) { self.trigger('focus', evt); }); this.$selection.on('blur', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', function (evt) { self.trigger('keypress', evt); if (evt.which === KEYS.SPACE) { evt.preventDefault(); } }); container.on('results:focus', function (params) { self.$selection.attr('aria-activedescendant', params.data._resultId); }); container.on('selection:update', function (params) { self.update(params.data); }); container.on('open', function () { // When the dropdown is open, aria-expanded="true" self.$selection.attr('aria-expanded', 'true'); self.$selection.attr('aria-owns', resultsId); self._attachCloseHandler(container); }); container.on('close', function () { // When the dropdown is closed, aria-expanded="false" self.$selection.attr('aria-expanded', 'false'); self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-owns'); // This needs to be delayed as the active element is the body when the // key is pressed. window.setTimeout(function () { self.$selection.focus(); }, 1); self._detachCloseHandler(container); }); container.on('enable', function () { self.$selection.attr('tabindex', self._tabindex); }); container.on('disable', function () { self.$selection.attr('tabindex', '-1'); }); }; BaseSelection.prototype._handleBlur = function (evt) { var self = this; // This needs to be delayed as the active element is the body when the tab // key is pressed, possibly along with others. window.setTimeout(function () { // Don't trigger `blur` if the focus is still in the selection if ( (document.activeElement == self.$selection[0]) || ($.contains(self.$selection[0], document.activeElement)) ) { return; } self.trigger('blur', evt); }, 1); }; BaseSelection.prototype._attachCloseHandler = function (container) { var self = this; $(document.body).on('mousedown.select2.' + container.id, function (e) { var $target = $(e.target); var $select = $target.closest('.select2'); var $all = $('.select2.select2-container--open'); $all.each(function () { var $this = $(this); if (this == $select[0]) { return; } var $element = $this.data('element'); $element.select2('close'); }); }); }; BaseSelection.prototype._detachCloseHandler = function (container) { $(document.body).off('mousedown.select2.' + container.id); }; BaseSelection.prototype.position = function ($selection, $container) { var $selectionContainer = $container.find('.selection'); $selectionContainer.append($selection); }; BaseSelection.prototype.destroy = function () { this._detachCloseHandler(this.container); }; BaseSelection.prototype.update = function (data) { throw new Error('The `update` method must be defined in child classes.'); }; return BaseSelection; }); S2.define('select2/selection/single',[ 'jquery', './base', '../utils', '../keys' ], function ($, BaseSelection, Utils, KEYS) { function SingleSelection () { SingleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(SingleSelection, BaseSelection); SingleSelection.prototype.render = function () { var $selection = SingleSelection.__super__.render.call(this); $selection.addClass('select2-selection--single'); $selection.html( '' + '' + '' + '' ); return $selection; }; SingleSelection.prototype.bind = function (container, $container) { var self = this; SingleSelection.__super__.bind.apply(this, arguments); var id = container.id + '-container'; this.$selection.find('.select2-selection__rendered') .attr('id', id) .attr('role', 'textbox') .attr('aria-readonly', 'true'); this.$selection.attr('aria-labelledby', id); // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove. this.$selection.attr('role', 'combobox'); this.$selection.on('mousedown', function (evt) { // Only respond to left clicks if (evt.which !== 1) { return; } self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on('focus', function (evt) { // User focuses on the container }); this.$selection.on('keydown', function (evt) { // If user starts typing an alphanumeric key on the keyboard, open if not opened. if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) { container.open(); } }); this.$selection.on('blur', function (evt) { // User exits the container }); container.on('focus', function (evt) { if (!container.isOpen()) { self.$selection.focus(); } }); container.on('selection:update', function (params) { self.update(params.data); }); }; SingleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; SingleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; SingleSelection.prototype.selectionContainer = function () { return $(''); }; SingleSelection.prototype.update = function (data) { if (data.length === 0) { this.clear(); return; } var selection = data[0]; var $rendered = this.$selection.find('.select2-selection__rendered'); var formatted = this.display(selection, $rendered); $rendered.empty().append(formatted); $rendered.prop('title', selection.title || selection.text); }; return SingleSelection; }); S2.define('select2/selection/multiple',[ 'jquery', './base', '../utils' ], function ($, BaseSelection, Utils) { function MultipleSelection ($element, options) { MultipleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(MultipleSelection, BaseSelection); MultipleSelection.prototype.render = function () { var $selection = MultipleSelection.__super__.render.call(this); $selection.addClass('select2-selection--multiple'); $selection.html( '
                          ' ); return $selection; }; MultipleSelection.prototype.bind = function (container, $container) { var self = this; MultipleSelection.__super__.bind.apply(this, arguments); this.$selection.on('click', function (evt) { self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on( 'click', '.select2-selection__choice__remove', function (evt) { // Ignore the event if it is disabled if (self.options.get('disabled')) { return; } var $remove = $(this); var $selection = $remove.parent(); var data = $selection.data('data'); self.trigger('unselect', { originalEvent: evt, data: data }); } ); }; MultipleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; MultipleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; MultipleSelection.prototype.selectionContainer = function () { var $container = $( '
                        • ' + '' + '×' + '' + '
                        • ' ); return $container; }; MultipleSelection.prototype.update = function (data) { var self = this; this.clear(); if (data.length === 0) { return; } var $selections = []; for (var d = 0; d < data.length; d++) { var selection = data[d]; var $selection = this.selectionContainer(); var formatted = this.display(selection, $selection).trim(); $selection.append(formatted); $selection.prop('title', selection.title || selection.text); $selection.data('data', selection); $selections.push($selection); } var $rendered = this.$selection.find('.select2-selection__rendered'); Utils.appendMany($rendered, $selections); // Return cursor to search field after updating. // Needs 1 ms delay because of other 1 ms setTimeouts when rendering. if ('undefined' !== typeof this.$search) { setTimeout(function(){ self.$search.focus(); }, 1); } }; return MultipleSelection; }); S2.define('select2/selection/placeholder',[ '../utils' ], function (Utils) { function Placeholder (decorated, $element, options) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options); } Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { var $placeholder = this.selectionContainer(); $placeholder.html(this.display(placeholder)); $placeholder.addClass('select2-selection__placeholder') .removeClass('select2-selection__choice'); return $placeholder; }; Placeholder.prototype.update = function (decorated, data) { var singlePlaceholder = ( data.length == 1 && data[0].id != this.placeholder.id ); var multipleSelections = data.length > 1; if (multipleSelections || singlePlaceholder) { return decorated.call(this, data); } this.clear(); var $placeholder = this.createPlaceholder(this.placeholder); this.$selection.find('.select2-selection__rendered').append($placeholder); }; return Placeholder; }); S2.define('select2/selection/allowClear',[ 'jquery', '../keys' ], function ($, KEYS) { function AllowClear () { } AllowClear.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); if (this.placeholder == null) { if (this.options.get('debug') && window.console && console.error) { console.error( 'Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.' ); } } this.$selection.on('mousedown', '.select2-selection__clear', function (evt) { self._handleClear(evt); }); container.on('keypress', function (evt) { self._handleKeyboardClear(evt, container); }); }; AllowClear.prototype._handleClear = function (_, evt) { // Ignore the event if it is disabled if (this.options.get('disabled')) { return; } var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected if ($clear.length === 0) { return; } evt.stopPropagation(); var data = $clear.data('data'); for (var d = 0; d < data.length; d++) { var unselectData = { data: data[d] }; // Trigger the `unselect` event, so people can prevent it from being // cleared. this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out. if (unselectData.prevented) { return; } } this.$element.val(this.placeholder.id).trigger('change'); this.trigger('toggle', {}); }; AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { if (container.isOpen()) { return; } if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { this._handleClear(evt); } }; AllowClear.prototype.update = function (decorated, data) { decorated.call(this, data); if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) { return; } var $remove = $( '' + '×' + '' ); $remove.data('data', data); this.$selection.find('.select2-selection__rendered').prepend($remove); }; return AllowClear; }); S2.define('select2/selection/search',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function Search (decorated, $element, options) { decorated.call(this, $element, options); } Search.prototype.render = function (decorated) { var $search = $( '
                        • ' + '' + '
                        • ' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); container.on('open', function () { self.$search.attr('aria-owns', resultsId); self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = $previousChoice.data('data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { this.$search.focus(); } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting' ]; var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = ''; if (container != null) { id += container.id } else { id += Utils.generateChars(4); } id += '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 $.removeData(this, 'data'); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id !== undefined) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data $.data(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = $.data($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; $.data($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (!$.isPlainObject(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); self.container.focusOnActiveElement(); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ($request.status && $request.status === '0') { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var optionText = (option.text || '').toUpperCase(); var paramsTerm = (params.term || '').toUpperCase(); var checkText = optionText === paramsTerm; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '' + '' + '' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '' + '' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.attr('aria-owns', resultsId); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.val(''); }); container.on('focus', function () { if (container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '
                        • ' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $(''); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { $(this).data('select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = $(this).data('select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ ], function () { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = $highlightedResults.data('data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if ($e.data('select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } $e.data('data', $e.data('select2Tags')); $e.data('tags', true); } if ($e.data('ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', $e.data('ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, $e.data()); } else { dataset = $e.data(); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if ($element.data('select2') != null) { $element.data('select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; $element.data('old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('open', function(){ // Focus on the active element when opening dropdown. // Needs 1 ms delay because of other 1 ms setTimeouts when rendering. setTimeout(function(){ self.focusOnActiveElement(); }, 1); }); $(document).on('keydown', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } // Move the focus to the selected element on keyboard navigation. // Required for screen readers to work properly. if (key === KEYS.DOWN || key === KEYS.UP) { self.focusOnActiveElement(); } else { // Focus on the search if user starts typing. var $searchField = self.$dropdown.find('.select2-search__field'); if (! $searchField.length) { $searchField = self.$container.find('.select2-search__field'); } $searchField.focus(); // Focus back to active selection when finished typing. // Small delay so typed character can be read by screen reader. setTimeout(function(){ self.focusOnActiveElement(); }, 1000); } } else if (self.hasFocus()) { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype.focusOnActiveElement = function () { // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards. if (! Utils.isTouchscreen()) { this.$results.find('li.select2-results__option--highlighted').focus(); } }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', this.$element.data('old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '' + '' + '' + '' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); $container.data('element', this.$element); return $container; }; return Select2; }); S2.define('select2/compat/utils',[ 'jquery' ], function ($) { function syncCssClasses ($dest, $src, adapter) { var classes, replacements = [], adapted; classes = $.trim($dest.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Save all Select2 classes if (this.indexOf('select2-') === 0) { replacements.push(this); } }); } classes = $.trim($src.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Only adapt non-Select2 classes if (this.indexOf('select2-') !== 0) { adapted = adapter(this); if (adapted != null) { replacements.push(adapted); } } }); } $dest.attr('class', replacements.join(' ')); } return { syncCssClasses: syncCssClasses }; }); S2.define('select2/compat/containerCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _containerAdapter (clazz) { return null; } function ContainerCSS () { } ContainerCSS.prototype.render = function (decorated) { var $container = decorated.call(this); var containerCssClass = this.options.get('containerCssClass') || ''; if ($.isFunction(containerCssClass)) { containerCssClass = containerCssClass(this.$element); } var containerCssAdapter = this.options.get('adaptContainerCssClass'); containerCssAdapter = containerCssAdapter || _containerAdapter; if (containerCssClass.indexOf(':all:') !== -1) { containerCssClass = containerCssClass.replace(':all:', ''); var _cssAdapter = containerCssAdapter; containerCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var containerCss = this.options.get('containerCss') || {}; if ($.isFunction(containerCss)) { containerCss = containerCss(this.$element); } CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); $container.css(containerCss); $container.addClass(containerCssClass); return $container; }; return ContainerCSS; }); S2.define('select2/compat/dropdownCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _dropdownAdapter (clazz) { return null; } function DropdownCSS () { } DropdownCSS.prototype.render = function (decorated) { var $dropdown = decorated.call(this); var dropdownCssClass = this.options.get('dropdownCssClass') || ''; if ($.isFunction(dropdownCssClass)) { dropdownCssClass = dropdownCssClass(this.$element); } var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; if (dropdownCssClass.indexOf(':all:') !== -1) { dropdownCssClass = dropdownCssClass.replace(':all:', ''); var _cssAdapter = dropdownCssAdapter; dropdownCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var dropdownCss = this.options.get('dropdownCss') || {}; if ($.isFunction(dropdownCss)) { dropdownCss = dropdownCss(this.$element); } CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); $dropdown.css(dropdownCss); $dropdown.addClass(dropdownCssClass); return $dropdown; }; return DropdownCSS; }); S2.define('select2/compat/initSelection',[ 'jquery' ], function ($) { function InitSelection (decorated, $element, options) { if (options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `initSelection` option has been deprecated in favor' + ' of a custom data adapter that overrides the `current` method. ' + 'This method is now called multiple times instead of a single ' + 'time when the instance is initialized. Support will be removed ' + 'for the `initSelection` option in future versions of Select2' ); } this.initSelection = options.get('initSelection'); this._isInitialized = false; decorated.call(this, $element, options); } InitSelection.prototype.current = function (decorated, callback) { var self = this; if (this._isInitialized) { decorated.call(this, callback); return; } this.initSelection.call(null, this.$element, function (data) { self._isInitialized = true; if (!$.isArray(data)) { data = [data]; } callback(data); }); }; return InitSelection; }); S2.define('select2/compat/inputData',[ 'jquery' ], function ($) { function InputData (decorated, $element, options) { this._currentData = []; this._valueSeparator = options.get('valueSeparator') || ','; if ($element.prop('type') === 'hidden') { if (options.get('debug') && console && console.warn) { console.warn( 'Select2: Using a hidden input with Select2 is no longer ' + 'supported and may stop working in the future. It is recommended ' + 'to use a `');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"â’¶":"A","A":"A","À":"A","Ã":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä€":"A","Ä‚":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ä":"A","Çž":"A","Ả":"A","Ã…":"A","Ǻ":"A","Ç":"A","È€":"A","È‚":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ä„":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ç¢":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","â’·":"B","ï¼¢":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Æ‚":"B","Æ":"B","â’¸":"C","ï¼£":"C","Ć":"C","Ĉ":"C","ÄŠ":"C","ÄŒ":"C","Ç":"C","Ḉ":"C","Ƈ":"C","È»":"C","Ꜿ":"C","â’¹":"D","D":"D","Ḋ":"D","ÄŽ":"D","Ḍ":"D","á¸":"D","Ḓ":"D","Ḏ":"D","Ä":"D","Æ‹":"D","ÆŠ":"D","Ɖ":"D","ê¹":"D","DZ":"DZ","Ç„":"DZ","Dz":"Dz","Ç…":"Dz","â’º":"E","ï¼¥":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ä’":"E","Ḕ":"E","Ḗ":"E","Ä”":"E","Ä–":"E","Ë":"E","Ẻ":"E","Äš":"E","È„":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Æ":"E","ÆŽ":"E","â’»":"F","F":"F","Ḟ":"F","Æ‘":"F","ê»":"F","â’¼":"G","ï¼§":"G","Ç´":"G","Äœ":"G","Ḡ":"G","Äž":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ“":"G","êž ":"G","ê½":"G","ê¾":"G","â’½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Èž":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","êž":"H","â’¾":"I","I":"I","ÃŒ":"I","Ã":"I","ÃŽ":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","Ỉ":"I","Ç":"I","Ȉ":"I","ÈŠ":"I","Ị":"I","Ä®":"I","Ḭ":"I","Æ—":"I","â’¿":"J","J":"J","Ä´":"J","Ɉ":"J","â“€":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","ê€":"K","ê‚":"K","ê„":"K","Ꞣ":"K","â“":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","êˆ":"L","ê†":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","â“‚":"M","ï¼­":"M","Ḿ":"M","á¹€":"M","Ṃ":"M","â±®":"M","Æœ":"M","Ⓝ":"N","ï¼®":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Å…":"N","Ṋ":"N","Ṉ":"N","È ":"N","Æ":"N","êž":"N","Ꞥ":"N","ÇŠ":"NJ","Ç‹":"Nj","â“„":"O","O":"O","Ã’":"O","Ó":"O","Ô":"O","á»’":"O","á»":"O","á»–":"O","á»”":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","ÅŒ":"O","á¹":"O","á¹’":"O","ÅŽ":"O","È®":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Å":"O","Ç‘":"O","ÈŒ":"O","ÈŽ":"O","Æ ":"O","Ờ":"O","Ớ":"O","á» ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","ÆŸ":"O","êŠ":"O","êŒ":"O","Æ¢":"OI","êŽ":"OO","È¢":"OU","â“…":"P","ï¼°":"P","á¹”":"P","á¹–":"P","Ƥ":"P","â±£":"P","ê":"P","ê’":"P","ê”":"P","Ⓠ":"Q","ï¼±":"Q","ê–":"Q","ê˜":"Q","ÉŠ":"Q","Ⓡ":"R","ï¼²":"R","Å”":"R","Ṙ":"R","Ř":"R","È":"R","È’":"R","Ṛ":"R","Ṝ":"R","Å–":"R","Ṟ":"R","ÉŒ":"R","Ɽ":"R","êš":"R","Ꞧ":"R","êž‚":"R","Ⓢ":"S","ï¼³":"S","ẞ":"S","Åš":"S","Ṥ":"S","Åœ":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","Ș":"S","Åž":"S","â±¾":"S","Ꞩ":"S","êž„":"S","Ⓣ":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Èš":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","ï¼µ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ç›":"U","Ç—":"U","Ç•":"U","Ç™":"U","Ủ":"U","Å®":"U","Ű":"U","Ç“":"U","È”":"U","È–":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É„":"U","â“‹":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","êž":"V","É…":"V","ê ":"VY","Ⓦ":"W","ï¼·":"W","Ẁ":"W","Ẃ":"W","Å´":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","â±²":"W","â“":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","ÉŽ":"Y","Ỿ":"Y","â“":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â“":"a","ï½":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","ÇŸ":"a","ả":"a","Ã¥":"a","Ç»":"a","ÇŽ":"a","È":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","á¸":"a","Ä…":"a","â±¥":"a","É":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","â“‘":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","Æ€":"b","ƃ":"b","É“":"b","â“’":"c","c":"c","ć":"c","ĉ":"c","Ä‹":"c","Ä":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","â““":"d","d":"d","ḋ":"d","Ä":"d","á¸":"d","ḑ":"d","ḓ":"d","á¸":"d","Ä‘":"d","ÆŒ":"d","É–":"d","É—":"d","êº":"d","dz":"dz","dž":"dz","â“”":"e","ï½…":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»…":"e","ể":"e","ẽ":"e","Ä“":"e","ḕ":"e","ḗ":"e","Ä•":"e","Ä—":"e","ë":"e","ẻ":"e","Ä›":"e","È…":"e","ȇ":"e","ẹ":"e","ệ":"e","È©":"e","á¸":"e","Ä™":"e","ḙ":"e","ḛ":"e","ɇ":"e","É›":"e","Ç":"e","â“•":"f","f":"f","ḟ":"f","Æ’":"f","ê¼":"f","â“–":"g","g":"g","ǵ":"g","Ä":"g","ḡ":"g","ÄŸ":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","êž¡":"g","áµ¹":"g","ê¿":"g","â“—":"h","h":"h","Ä¥":"h","ḣ":"h","ḧ":"h","ÈŸ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ•":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","Ä©":"i","Ä«":"i","Ä­":"i","ï":"i","ḯ":"i","ỉ":"i","Ç":"i","ȉ":"i","È‹":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","â“™":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ™":"k","ⱪ":"k","ê":"k","êƒ":"k","ê…":"k","ꞣ":"k","â“›":"l","l":"l","Å€":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å‚":"l","Æš":"l","É«":"l","ⱡ":"l","ê‰":"l","êž":"l","ê‡":"l","lj":"lj","ⓜ":"m","ï½":"m","ḿ":"m","á¹":"m","ṃ":"m","ɱ":"m","ɯ":"m","â“":"n","n":"n","ǹ":"n","Å„":"n","ñ":"n","á¹…":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","Æž":"n","ɲ":"n","ʼn":"n","êž‘":"n","ꞥ":"n","ÇŒ":"nj","ⓞ":"o","ï½":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","á»—":"o","ổ":"o","õ":"o","á¹":"o","È­":"o","á¹":"o","Å":"o","ṑ":"o","ṓ":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å‘":"o","Ç’":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»›":"o","ỡ":"o","ở":"o","ợ":"o","á»":"o","á»™":"o","Ç«":"o","Ç­":"o","ø":"o","Ç¿":"o","É”":"o","ê‹":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","ⓟ":"p","ï½":"p","ṕ":"p","á¹—":"p","Æ¥":"p","áµ½":"p","ê‘":"p","ê“":"p","ê•":"p","â“ ":"q","q":"q","É‹":"q","ê—":"q","ê™":"q","â“¡":"r","ï½’":"r","Å•":"r","á¹™":"r","Å™":"r","È‘":"r","È“":"r","á¹›":"r","á¹":"r","Å—":"r","ṟ":"r","É":"r","ɽ":"r","ê›":"r","êž§":"r","ꞃ":"r","â“¢":"s","s":"s","ß":"s","Å›":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È™":"s","ÅŸ":"s","È¿":"s","êž©":"s","êž…":"s","ẛ":"s","â“£":"t","ï½”":"t","ṫ":"t","ẗ":"t","Å¥":"t","á¹­":"t","È›":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ­":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å­":"u","ü":"u","Çœ":"u","ǘ":"u","Ç–":"u","Çš":"u","á»§":"u","ů":"u","ű":"u","Ç”":"u","È•":"u","È—":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»­":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","ʉ":"u","â“¥":"v","ï½–":"v","á¹½":"v","ṿ":"v","Ê‹":"v","êŸ":"v","ÊŒ":"v","ê¡":"vy","ⓦ":"w","ï½—":"w","áº":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","â±³":"w","â“§":"x","x":"x","ẋ":"x","áº":"x","ⓨ":"y","ï½™":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","ẙ":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â“©":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","È¥":"z","É€":"z","ⱬ":"z","ê£":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","ÎŒ":"Ο","ÎŽ":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ÏŠ":"ι","Î":"ι","ÏŒ":"ο","Ï":"Ï…","Ï‹":"Ï…","ΰ":"Ï…","ω":"ω","Ï‚":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
                        • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); container.on('open', function () { self.$search.attr('aria-owns', resultsId); self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = $previousChoice.data('data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { this.$search.focus(); } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting' ]; var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = ''; if (container != null) { id += container.id } else { id += Utils.generateChars(4); } id += '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 $.removeData(this, 'data'); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id !== undefined) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data $.data(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = $.data($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; $.data($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (!$.isPlainObject(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); self.container.focusOnActiveElement(); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ($request.status && $request.status === '0') { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var optionText = (option.text || '').toUpperCase(); var paramsTerm = (params.term || '').toUpperCase(); var checkText = optionText === paramsTerm; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '' + '' + '' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '' + '' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; var resultsId = container.id + '-results'; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.attr('aria-owns', resultsId); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-owns'); self.$search.val(''); }); container.on('focus', function () { if (container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.data._resultId); }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '
                        • ' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $(''); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { $(this).data('select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = $(this).data('select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ ], function () { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = $highlightedResults.data('data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if ($e.data('select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } $e.data('data', $e.data('select2Tags')); $e.data('tags', true); } if ($e.data('ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', $e.data('ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, $e.data()); } else { dataset = $e.data(); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if ($element.data('select2') != null) { $element.data('select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; $element.data('old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('open', function(){ // Focus on the active element when opening dropdown. // Needs 1 ms delay because of other 1 ms setTimeouts when rendering. setTimeout(function(){ self.focusOnActiveElement(); }, 1); }); $(document).on('keydown', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } // Move the focus to the selected element on keyboard navigation. // Required for screen readers to work properly. if (key === KEYS.DOWN || key === KEYS.UP) { self.focusOnActiveElement(); } else { // Focus on the search if user starts typing. var $searchField = self.$dropdown.find('.select2-search__field'); if (! $searchField.length) { $searchField = self.$container.find('.select2-search__field'); } $searchField.focus(); // Focus back to active selection when finished typing. // Small delay so typed character can be read by screen reader. setTimeout(function(){ self.focusOnActiveElement(); }, 1000); } } else if (self.hasFocus()) { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype.focusOnActiveElement = function () { // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards. if (! Utils.isTouchscreen()) { this.$results.find('li.select2-results__option--highlighted').focus(); } }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', this.$element.data('old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '' + '' + '' + '' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); $container.data('element', this.$element); return $container; }; return Select2; }); S2.define('jquery-mousewheel',[ 'jquery' ], function ($) { // Used to shim jQuery.mousewheel for non-full builds. return $; }); S2.define('jquery.select2',[ 'jquery', 'jquery-mousewheel', './select2/core', './select2/defaults' ], function ($, _, Select2, Defaults) { if ($.fn.selectWoo == null) { // All methods that should return the element var thisMethods = ['open', 'close', 'destroy']; $.fn.selectWoo = function (options) { options = options || {}; if (typeof options === 'object') { this.each(function () { var instanceOptions = $.extend(true, {}, options); var instance = new Select2($(this), instanceOptions); }); return this; } else if (typeof options === 'string') { var ret; var args = Array.prototype.slice.call(arguments, 1); this.each(function () { var instance = $(this).data('select2'); if (instance == null && window.console && console.error) { console.error( 'The select2(\'' + options + '\') method was called on an ' + 'element that is not using Select2.' ); } ret = instance[options].apply(instance, args); }); // Check if we should be returning `this` if ($.inArray(options, thisMethods) > -1) { return this; } return ret; } else { throw new Error('Invalid arguments for Select2: ' + options); } }; } if ($.fn.select2 != null && $.fn.select2.defaults != null) { $.fn.selectWoo.defaults = $.fn.select2.defaults; } if ($.fn.selectWoo.defaults == null) { $.fn.selectWoo.defaults = Defaults; } // Also register selectWoo under select2 if select2 is not already present. $.fn.select2 = $.fn.select2 || $.fn.selectWoo; return Select2; }); // Return the AMD loader configuration so it can be used outside of this file return { define: S2.define, require: S2.require }; }()); // Autoload the jQuery bindings // We know that all of the modules exist above this, so we're safe var select2 = S2.require('jquery.select2'); // Hold the AMD module references on the jQuery function that was just loaded // This allows Select2 to use the internal loader outside of this file, such // as in the language files. jQuery.fn.select2.amd = S2; jQuery.fn.selectWoo.amd = S2; // Return the Select2 instance for anyone who is importing it. return select2; })); kirki/assets/vendor/selectWoo/js/selectWoo.min.js000064400000205504151232236240016126 0ustar00/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
                            ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
                          • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
                              '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
                            • ×
                            • ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('
                            • ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"â’¶":"A","A":"A","À":"A","Ã":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä€":"A","Ä‚":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ä":"A","Çž":"A","Ả":"A","Ã…":"A","Ǻ":"A","Ç":"A","È€":"A","È‚":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ä„":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ç¢":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","â’·":"B","ï¼¢":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Æ‚":"B","Æ":"B","â’¸":"C","ï¼£":"C","Ć":"C","Ĉ":"C","ÄŠ":"C","ÄŒ":"C","Ç":"C","Ḉ":"C","Ƈ":"C","È»":"C","Ꜿ":"C","â’¹":"D","D":"D","Ḋ":"D","ÄŽ":"D","Ḍ":"D","á¸":"D","Ḓ":"D","Ḏ":"D","Ä":"D","Æ‹":"D","ÆŠ":"D","Ɖ":"D","ê¹":"D","DZ":"DZ","Ç„":"DZ","Dz":"Dz","Ç…":"Dz","â’º":"E","ï¼¥":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ä’":"E","Ḕ":"E","Ḗ":"E","Ä”":"E","Ä–":"E","Ë":"E","Ẻ":"E","Äš":"E","È„":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Æ":"E","ÆŽ":"E","â’»":"F","F":"F","Ḟ":"F","Æ‘":"F","ê»":"F","â’¼":"G","ï¼§":"G","Ç´":"G","Äœ":"G","Ḡ":"G","Äž":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ“":"G","êž ":"G","ê½":"G","ê¾":"G","â’½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Èž":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","êž":"H","â’¾":"I","I":"I","ÃŒ":"I","Ã":"I","ÃŽ":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","Ỉ":"I","Ç":"I","Ȉ":"I","ÈŠ":"I","Ị":"I","Ä®":"I","Ḭ":"I","Æ—":"I","â’¿":"J","J":"J","Ä´":"J","Ɉ":"J","â“€":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","ê€":"K","ê‚":"K","ê„":"K","Ꞣ":"K","â“":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","êˆ":"L","ê†":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","â“‚":"M","ï¼­":"M","Ḿ":"M","á¹€":"M","Ṃ":"M","â±®":"M","Æœ":"M","Ⓝ":"N","ï¼®":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Å…":"N","Ṋ":"N","Ṉ":"N","È ":"N","Æ":"N","êž":"N","Ꞥ":"N","ÇŠ":"NJ","Ç‹":"Nj","â“„":"O","O":"O","Ã’":"O","Ó":"O","Ô":"O","á»’":"O","á»":"O","á»–":"O","á»”":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","ÅŒ":"O","á¹":"O","á¹’":"O","ÅŽ":"O","È®":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Å":"O","Ç‘":"O","ÈŒ":"O","ÈŽ":"O","Æ ":"O","Ờ":"O","Ớ":"O","á» ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","ÆŸ":"O","êŠ":"O","êŒ":"O","Æ¢":"OI","êŽ":"OO","È¢":"OU","â“…":"P","ï¼°":"P","á¹”":"P","á¹–":"P","Ƥ":"P","â±£":"P","ê":"P","ê’":"P","ê”":"P","Ⓠ":"Q","ï¼±":"Q","ê–":"Q","ê˜":"Q","ÉŠ":"Q","Ⓡ":"R","ï¼²":"R","Å”":"R","Ṙ":"R","Ř":"R","È":"R","È’":"R","Ṛ":"R","Ṝ":"R","Å–":"R","Ṟ":"R","ÉŒ":"R","Ɽ":"R","êš":"R","Ꞧ":"R","êž‚":"R","Ⓢ":"S","ï¼³":"S","ẞ":"S","Åš":"S","Ṥ":"S","Åœ":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","Ș":"S","Åž":"S","â±¾":"S","Ꞩ":"S","êž„":"S","Ⓣ":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Èš":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","ï¼µ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ç›":"U","Ç—":"U","Ç•":"U","Ç™":"U","Ủ":"U","Å®":"U","Ű":"U","Ç“":"U","È”":"U","È–":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É„":"U","â“‹":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","êž":"V","É…":"V","ê ":"VY","Ⓦ":"W","ï¼·":"W","Ẁ":"W","Ẃ":"W","Å´":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","â±²":"W","â“":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","ÉŽ":"Y","Ỿ":"Y","â“":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â“":"a","ï½":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","ÇŸ":"a","ả":"a","Ã¥":"a","Ç»":"a","ÇŽ":"a","È":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","á¸":"a","Ä…":"a","â±¥":"a","É":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","â“‘":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","Æ€":"b","ƃ":"b","É“":"b","â“’":"c","c":"c","ć":"c","ĉ":"c","Ä‹":"c","Ä":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","â““":"d","d":"d","ḋ":"d","Ä":"d","á¸":"d","ḑ":"d","ḓ":"d","á¸":"d","Ä‘":"d","ÆŒ":"d","É–":"d","É—":"d","êº":"d","dz":"dz","dž":"dz","â“”":"e","ï½…":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»…":"e","ể":"e","ẽ":"e","Ä“":"e","ḕ":"e","ḗ":"e","Ä•":"e","Ä—":"e","ë":"e","ẻ":"e","Ä›":"e","È…":"e","ȇ":"e","ẹ":"e","ệ":"e","È©":"e","á¸":"e","Ä™":"e","ḙ":"e","ḛ":"e","ɇ":"e","É›":"e","Ç":"e","â“•":"f","f":"f","ḟ":"f","Æ’":"f","ê¼":"f","â“–":"g","g":"g","ǵ":"g","Ä":"g","ḡ":"g","ÄŸ":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","êž¡":"g","áµ¹":"g","ê¿":"g","â“—":"h","h":"h","Ä¥":"h","ḣ":"h","ḧ":"h","ÈŸ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ•":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","Ä©":"i","Ä«":"i","Ä­":"i","ï":"i","ḯ":"i","ỉ":"i","Ç":"i","ȉ":"i","È‹":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","â“™":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ™":"k","ⱪ":"k","ê":"k","êƒ":"k","ê…":"k","ꞣ":"k","â“›":"l","l":"l","Å€":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å‚":"l","Æš":"l","É«":"l","ⱡ":"l","ê‰":"l","êž":"l","ê‡":"l","lj":"lj","ⓜ":"m","ï½":"m","ḿ":"m","á¹":"m","ṃ":"m","ɱ":"m","ɯ":"m","â“":"n","n":"n","ǹ":"n","Å„":"n","ñ":"n","á¹…":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","Æž":"n","ɲ":"n","ʼn":"n","êž‘":"n","ꞥ":"n","ÇŒ":"nj","ⓞ":"o","ï½":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","á»—":"o","ổ":"o","õ":"o","á¹":"o","È­":"o","á¹":"o","Å":"o","ṑ":"o","ṓ":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å‘":"o","Ç’":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»›":"o","ỡ":"o","ở":"o","ợ":"o","á»":"o","á»™":"o","Ç«":"o","Ç­":"o","ø":"o","Ç¿":"o","É”":"o","ê‹":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","ⓟ":"p","ï½":"p","ṕ":"p","á¹—":"p","Æ¥":"p","áµ½":"p","ê‘":"p","ê“":"p","ê•":"p","â“ ":"q","q":"q","É‹":"q","ê—":"q","ê™":"q","â“¡":"r","ï½’":"r","Å•":"r","á¹™":"r","Å™":"r","È‘":"r","È“":"r","á¹›":"r","á¹":"r","Å—":"r","ṟ":"r","É":"r","ɽ":"r","ê›":"r","êž§":"r","ꞃ":"r","â“¢":"s","s":"s","ß":"s","Å›":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È™":"s","ÅŸ":"s","È¿":"s","êž©":"s","êž…":"s","ẛ":"s","â“£":"t","ï½”":"t","ṫ":"t","ẗ":"t","Å¥":"t","á¹­":"t","È›":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ­":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å­":"u","ü":"u","Çœ":"u","ǘ":"u","Ç–":"u","Çš":"u","á»§":"u","ů":"u","ű":"u","Ç”":"u","È•":"u","È—":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»­":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","ʉ":"u","â“¥":"v","ï½–":"v","á¹½":"v","ṿ":"v","Ê‹":"v","êŸ":"v","ÊŒ":"v","ê¡":"vy","ⓦ":"w","ï½—":"w","áº":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","â±³":"w","â“§":"x","x":"x","ẋ":"x","áº":"x","ⓨ":"y","ï½™":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","ẙ":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â“©":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","È¥":"z","É€":"z","ⱬ":"z","ê£":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","ÎŒ":"Ο","ÎŽ":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ÏŠ":"ι","Î":"ι","ÏŒ":"ο","Ï":"Ï…","Ï‹":"Ï…","ΰ":"Ï…","ω":"ω","Ï‚":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
                            • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});kirki/assets/vendor/selectWoo/js/.htaccess000044400000000143151232236240014626 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/selectWoo/kirki.css000064400000001763151232236240014252 0ustar00.select2-dropdown { border-color: rgba(0, 0, 0, 0.1); border-radius: 0; } .select2-container { min-width: 100px; width: 100% !important; } .select2-container--open .select2-dropdown--above, .select2-container--open .select2-dropdown--below { z-index: 9999999; min-width: 100px; } .select2-container--default .select2-search--dropdown .select2-search__field { border-color: rgba(0, 0, 0, 0.1); } .select2-container--default .select2-selection--multiple, .select2-container--default .select2-selection--single { border-color: rgba(0, 0, 0, 0.1); border-radius: 0; } .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: rgba(255, 255, 255, 0); background-color: transparent; border: none; border-radius: 0; } .wp-customizer .select2-container { z-index: 8 !important; } .wp-customizer .select2-container.select2-container--open { z-index: 999999 !important; } /*# sourceMappingURL=kirki.css.map */ kirki/assets/vendor/selectWoo/kirki.css.map000064400000001007151232236240015015 0ustar00{ "version": 3, "mappings": "AAAA,iBAAkB;EAChB,YAAY,EAAE,kBAAc;EAC5B,aAAa,EAAE,CAAC;;AAGlB,kBAAmB;EACjB,SAAS,EAAE,KAAK;EAChB,KAAK,EAAE,eAAe;EAGpB;mDACyB;IACvB,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,KAAK;EAMhB,4EAAuB;IACrB,YAAY,EAAE,kBAAc;EAK9B,gHACU;IACR,YAAY,EAAE,kBAAc;IAC5B,aAAa,EAAE,CAAC;EAIhB,mFAA2B;IACzB,gBAAgB,EAAE,sBAAmB;IACrC,gBAAgB,EAAE,WAAW;IAC7B,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,CAAC;;AAO1B,iCAAkC;EAChC,OAAO,EAAE,YAAY;EAGnB,yDAAQ;IAEN,OAAO,EAAE,iBAAiB", "sources": ["kirki.scss"], "names": [], "file": "kirki.css" } kirki/assets/vendor/selectWoo/kirki.scss000064400000001721151232236240014427 0ustar00.select2-dropdown { border-color: rgba(0,0,0,.1); border-radius: 0; } .select2-container { min-width: 100px; width: 100% !important; &--open { .select2-dropdown--above, .select2-dropdown--below { z-index: 9999999; min-width: 100px; } } &--default { .select2-search--dropdown { .select2-search__field { border-color: rgba(0,0,0,.1); } } .select2-selection { &--multiple, &--single { border-color: rgba(0,0,0,.1); border-radius: 0; } &--multiple { .select2-selection__choice { background-color: rgba(255,255,255,0); background-color: transparent; border: none; border-radius: 0; } } } } } .wp-customizer .select2-container { z-index: 8 !important; &.select2-container { &--open { // @See https://github.com/aristath/kirki/issues/1418 z-index: 999999 !important; } } } kirki/assets/vendor/selectWoo/.htaccess000044400000000143151232236240014212 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js000064400000034304151232236240021216 0ustar00/**! * wp-color-picker-alpha * * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker * Only run in input and is defined data alpha in true * * Version: 2.0 * https://github.com/kallookoo/wp-color-picker-alpha * Licensed under the GPLv2 license. */ ( function( $ ) { // Variable for some backgrounds ( grid ) var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==', // Html stuff for wpColorPicker copy of the original color-picker.js _before = '', _after = '
                              ', _wrap = '
                              ', _button = '', _wrappingLabel = '', _wrappingLabelText = ''; /** * Overwrite Color * for enable support rbga */ Color.fn.toString = function() { if ( this._alpha < 1 ) return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); var hex = parseInt( this._color, 10 ).toString( 16 ); if ( this.error ) return ''; if ( hex.length < 6 ) hex = ( '00000' + hex ).substr( -6 ); return '#' + hex; }; /** * Overwrite wpColorPicker */ $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, { /** * @summary Creates the color picker. * * Creates the color picker, sets default values, css classes and wraps it all in HTML. * * @since 3.5.0 * * @access private * * @returns {void} */ _create: function() { // Return early if Iris support is missing. if ( ! $.support.iris ) { return; } var self = this, el = self.element; // Override default options with options bound to the element. $.extend( self.options, el.data() ); // Create a color picker which only allows adjustments to the hue. if ( self.options.type === 'hue' ) { return self._createHueOnly(); } // Bind the close event. self.close = $.proxy( self.close, self ); self.initialValue = el.val(); // Add a CSS class to the input field. el.addClass( 'wp-color-picker' ); /* * Check if there's already a wrapping label, e.g. in the Customizer. * If there's no label, add a default one to match the Customizer template. */ if ( ! el.parent( 'label' ).length ) { // Wrap the input field in the default label. el.wrap( _wrappingLabel ); // Insert the default label text. self.wrappingLabelText = $( _wrappingLabelText ) .insertBefore( el ) .text( wpColorPickerL10n.defaultLabel ); } /* * At this point, either it's the standalone version or the Customizer * one, we have a wrapping label to use as hook in the DOM, let's store it. */ self.wrappingLabel = el.parent(); // Wrap the label in the main wrapper. self.wrappingLabel.wrap( _wrap ); // Store a reference to the main wrapper. self.wrap = self.wrappingLabel.parent(); // Set up the toggle button and insert it before the wrapping label. self.toggler = $( _before ) .insertBefore( self.wrappingLabel ) .css( { backgroundColor: self.initialValue } ); // Set the toggle button span element text. if ( el.data( 'label' ) ) { self.toggler.find( '.wp-color-result-text' ).text( el.data( 'label' ) ); } else { self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick ); } // Set up the Iris container and insert it after the wrapping label. self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel ); // Store a reference to the Clear/Default button. self.button = $( _button ); // Set up the Clear/Default button. if ( self.options.defaultColor ) { self.button .addClass( 'wp-picker-default' ) .val( wpColorPickerL10n.defaultString ) .attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel ); } else { self.button .addClass( 'wp-picker-clear' ) .val( wpColorPickerL10n.clear ) .attr( 'aria-label', wpColorPickerL10n.clearAriaLabel ); } // Wrap the wrapping label in its wrapper and append the Clear/Default button. self.wrappingLabel .wrap( '' ) .after( self.button ); /* * The input wrapper now contains the label+input+Clear/Default button. * Store a reference to the input wrapper: we'll use this to toggle * the controls visibility. */ self.inputWrapper = el.closest( '.wp-picker-input-wrap' ); /* * CSS for support < 4.9 */ self.toggler.css({ 'height': '24px', 'margin': '0 6px 6px 0', 'padding': '0 0 0 30px', 'font-size': '11px' }); self.toggler.find( '.wp-color-result-text' ).css({ 'background': '#f7f7f7', 'border-radius': '0 2px 2px 0', 'border-left': '1px solid #ccc', 'color': '#555', 'display': 'block', 'line-height': '22px', 'padding': '0 6px', 'text-align': 'center' }); el.iris( { target: self.pickerContainer, hide: self.options.hide, width: self.options.width, mode: self.options.mode, palettes: self.options.palettes, /** * @summary Handles the onChange event if one has been defined in the options. * * Handles the onChange event if one has been defined in the options and additionally * sets the background color for the toggler element. * * @since 3.5.0 * * @param {Event} event The event that's being called. * @param {HTMLElement} ui The HTMLElement containing the color picker. * * @returns {void} */ change: function( event, ui ) { if ( self.options.alpha ) { self.toggler.css( { 'background-image': 'url(' + image + ')', 'position': 'relative' } ); if ( self.toggler.find( 'span.color-alpha' ).length == 0 ) { self.toggler.append( '' ); } self.toggler.find( 'span.color-alpha' ).css( { 'width': '30px', 'height': '24px', 'position': 'absolute', 'top': 0, 'left': 0, 'border-top-left-radius': '2px', 'border-bottom-left-radius': '2px', 'background': ui.color.toString() } ); } else { self.toggler.css( { backgroundColor: ui.color.toString() } ); } if ( $.isFunction( self.options.change ) ) { self.options.change.call( this, event, ui ); } } } ); el.val( self.initialValue ); self._addListeners(); // Force the color picker to always be closed on initial load. if ( ! self.options.hide ) { self.toggler.click(); } }, /** * @summary Binds event listeners to the color picker. * * @since 3.5.0 * * @access private * * @returns {void} */ _addListeners: function() { var self = this; /** * @summary Prevent any clicks inside this widget from leaking to the top and closing it. * * @since 3.5.0 * * @param {Event} event The event that's being called. * * @returs {void} */ self.wrap.on( 'click.wpcolorpicker', function( event ) { event.stopPropagation(); }); /** * @summary Open or close the color picker depending on the class. * * @since 3.5 */ self.toggler.click( function() { if ( self.toggler.hasClass( 'wp-picker-open' ) ) { self.close(); } else { self.open(); } }); /** * @summary Checks if value is empty when changing the color in the color picker. * * Checks if value is empty when changing the color in the color picker. * If so, the background color is cleared. * * @since 3.5.0 * * @param {Event} event The event that's being called. * * @returns {void} */ self.element.on( 'change', function( event ) { // Empty or Error = clear if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) { if ( self.options.alpha ) { self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' ); } else { self.toggler.css( 'backgroundColor', '' ); } // Fire clear callback if we have one if ( $.isFunction( self.options.clear ) ) self.options.clear.call( this, event ); } } ); /** * @summary Enables the user to clear or revert the color in the color picker. * * Enables the user to either clear the color in the color picker or revert back to the default color. * * @since 3.5.0 * * @param {Event} event The event that's being called. * * @returns {void} */ self.button.on( 'click', function( event ) { if ( $( this ).hasClass( 'wp-picker-clear' ) ) { self.element.val( '' ); if ( self.options.alpha ) { self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' ); } else { self.toggler.css( 'backgroundColor', '' ); } if ( $.isFunction( self.options.clear ) ) self.options.clear.call( this, event ); } else if ( $( this ).hasClass( 'wp-picker-default' ) ) { self.element.val( self.options.defaultColor ).change(); } }); } }); /** * Overwrite iris */ $.widget( 'a8c.iris', $.a8c.iris, { _create: function() { this._super(); // Global option for check is mode rbga is enabled this.options.alpha = this.element.data( 'alpha' ) || false; // Is not input disabled if ( ! this.element.is( ':input' ) ) this.options.alpha = false; if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) { var self = this, el = self.element, _html = '
                              ', aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ), aSlider = aContainer.find( '.iris-slider-offset-alpha' ), controls = { aContainer: aContainer, aSlider: aSlider }; if ( typeof el.data( 'custom-width' ) !== 'undefined' ) { self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0; } else { self.options.customWidth = 100; } // Set default width for input reset self.options.defaultWidth = el.width(); // Update width for input if ( self._color._alpha < 1 || self._color.toString().indexOf( 'rgb' ) != -1 ) el.width( parseInt( self.options.defaultWidth + self.options.customWidth ) ); // Push new controls $.each( controls, function( k, v ) { self.controls[k] = v; } ); // Change size strip and add margin for sliders self.controls.square.css( { 'margin-right': '0' } ); var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ), stripsMargin = ( emptyWidth / 6 ), stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin ); $.each( [ 'aContainer', 'strip' ], function( k, v ) { self.controls[v].width( stripsWidth ).css( { 'margin-left': stripsMargin + 'px' } ); } ); // Add new slider self._initControls(); // For updated widget self._change(); } }, _initControls: function() { this._super(); if ( this.options.alpha ) { var self = this, controls = self.controls; controls.aSlider.slider({ orientation: 'vertical', min: 0, max: 100, step: 1, value: parseInt( self._color._alpha * 100 ), slide: function( event, ui ) { // Update alpha value self._color._alpha = parseFloat( ui.value / 100 ); self._change.apply( self, arguments ); } }); } }, _change: function() { this._super(); var self = this, el = self.element; if ( this.options.alpha ) { var controls = self.controls, alpha = parseInt( self._color._alpha * 100 ), color = self._color.toRgb(), gradient = [ 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%', 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%' ], defaultWidth = self.options.defaultWidth, customWidth = self.options.customWidth, target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' ); // Generate background slider alpha, only for CSS3 old browser fuck!! :) controls.aContainer.css( { 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } ); if ( target.hasClass( 'wp-picker-open' ) ) { // Update alpha value controls.aSlider.slider( 'value', alpha ); /** * Disabled change opacity in default slider Saturation ( only is alpha enabled ) * and change input width for view all value */ if ( self._color._alpha < 1 ) { controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) ); el.width( parseInt( defaultWidth + customWidth ) ); } else { el.width( defaultWidth ); } } } var reset = el.data( 'reset-alpha' ) || false; if ( reset ) { self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() { self._color._alpha = 1; self.active = 'external'; self._change(); } ); } }, _addInputListeners: function( input ) { var self = this, debounceTimeout = 100, callback = function( event ) { var color = new Color( input.val() ), val = input.val(); input.removeClass( 'iris-error' ); // We gave a bad color if ( color.error ) { // Don't error on an empty input if ( val !== '' ) input.addClass( 'iris-error' ); } else { if ( color.toString() !== self._color.toString() ) { // Let's not do this on keyup for hex shortcodes if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) self._setOption( 'color', color.toString() ); } } }; input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) ); // If we initialized hidden, show on first focus. The rest is up to you. if ( self.options.hide ) { input.on( 'focus', function() { self.show(); } ); } } } ); }( jQuery ) ); kirki/assets/vendor/wp-color-picker-alpha/.htaccess000044400000000143151232236240016346 0ustar00 Order Allow,Deny Deny from all kirki/assets/vendor/.htaccess000044400000000143151232236240012246 0ustar00 Order Allow,Deny Deny from all kirki/assets/.htaccess000044400000000143151232236240010751 0ustar00 Order Allow,Deny Deny from all kirki/controls/css/styles.css000064400000060463151232236240012356 0ustar00@charset "UTF-8"; .customize-control-kirki-background { position: relative; } .customize-control-kirki-background .background-attachment h4, .customize-control-kirki-background .background-color h4, .customize-control-kirki-background .background-position h4, .customize-control-kirki-background .background-repeat h4, .customize-control-kirki-background .background-size h4 { margin-bottom: 5px; } .customize-control-kirki-background .background-attachment .buttonset, .customize-control-kirki-background .background-size .buttonset { display: flex; flex-wrap: wrap; } .customize-control-kirki-background .background-attachment .buttonset .switch-label, .customize-control-kirki-background .background-size .buttonset .switch-label { background: rgba(0, 0, 0, 0.05); border: 1px solid rgba(0, 0, 0, 0.1); color: #555; padding: 0.5em 1em; margin: 0; text-align: center; flex-grow: 1; } .customize-control-kirki-background .background-attachment .buttonset .switch-input:checked + .switch-label, .customize-control-kirki-background .background-size .buttonset .switch-input:checked + .switch-label { background-color: #3498DB; color: #fff; } .customize-control-kirki-code textarea { width: 100%; min-height: 200px; } .customize-control-kirki-color-palette { position: relative; } .customize-control-kirki-color-palette label { position: relative; display: inline-block; padding: 0; margin: 0; } .customize-control-kirki-color-palette .colors-wrapper { max-height: 300px; overflow-y: auto; padding: 10px; display: flex; flex-wrap: wrap; } .customize-control-kirki-color-palette .colors-wrapper .color-palette-color { color: transparent; display: block; width: 100%; height: 100%; overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.2); } .customize-control-kirki-color-palette .colors-wrapper.round label { padding: 3px; } .customize-control-kirki-color-palette .colors-wrapper.round .color-palette-color { border-radius: 50%; } .customize-control-kirki-color-palette .colors-wrapper.box-shadow .color-palette-color { box-shadow: inset 3px 3px 13px 2px rgba(0, 0, 0, 0.22); } .customize-control-kirki-color-palette .colors-wrapper input:checked + label .color-palette-color { border: 0; width: 150%; height: 150%; position: relative; left: -25%; top: -25%; z-index: 1; } .customize-control-kirki-color-palette .colors-wrapper.with-margin label { margin: 3px; } .customize-control-kirki-color-palette .colors-wrapper input { display: none; } .customize-control-kirki-color-palette .colors-wrapper input:checked + label .color-palette-color { box-shadow: 1px 1px 10px 1px #333333; border: 1px solid rgba(0, 0, 0, 0.3); } .customize-control-kirki-color input[data-type="hue"] + .iris-strip-horiz .iris-slider { background-image: -webkit-linear-gradient(left, red, #ff7f00, yellow, #80ff00, lime, #00ff80, cyan, #007fff, blue, #7f00ff, magenta, #ff0080, red) !important; } .customize-control-kirki-color .iris-picker .iris-square-handle { z-index: 8; } .customize-control-kirki-dashicons { position: relative; } .customize-control-kirki-dashicons label { position: relative; display: inline-block; } .customize-control-kirki-dashicons .icons-wrapper { max-height: 300px; overflow-y: scroll; } .customize-control-kirki-dashicons .icons-wrapper h4 { font-weight: 300; margin: 0.7em 0; } .customize-control-kirki-dashicons .icons-wrapper .dashicons { padding: 3px; font-size: 25px; width: 25px; height: 25px; border: 1px solid transparent; } .customize-control-kirki-dashicons .icons-wrapper input { display: none; } .customize-control-kirki-dashicons .icons-wrapper input:checked + label .dashicons { border: 1px solid #3498DB; color: #000; } .wp-customizer div.ui-datepicker { z-index: 500001 !important; width: 255px; background: #fff; border: 1px solid #dedede; } .wp-customizer div.ui-datepicker .ui-datepicker-header { padding: 10px; background: #e5e5e5; border-bottom: 1px solid #fff; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev { display: block; position: absolute; width: 1em; overflow: hidden; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:before, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:after, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before { font-family: dashicons; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after:hover, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:before:hover, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:after:hover, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before:hover { cursor: pointer; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next .ui-icon, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev .ui-icon { display: none; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev { left: 10px; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before { content: "\f341"; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next { right: 10px; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after { content: "\f345"; } .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-title { text-align: center; } .wp-customizer div.ui-datepicker .ui-datepicker-calendar { border-collapse: collapse; width: 100%; } .wp-customizer div.ui-datepicker .ui-datepicker-calendar thead { background: #e5e5e5; padding: 5px; } .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td { text-align: center; } .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a { display: block; padding: 5px; color: #333; text-decoration: none; } .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a.ui-state-active, .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a:hover { color: #fff; background-color: #0073aa; } .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td.ui-state-disabled a, .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td.ui-state-disabled .ui-state-default a { color: #999; } .customize-control-kirki-dimensions { position: relative; } .customize-control-kirki-dimensions .wrapper { border: 1px solid rgba(0, 0, 0, 0.1); padding: 10px; } .customize-control-kirki-dimensions .wrapper .control { display: flex; flex-wrap: wrap; justify-content: space-between; } .customize-control-kirki-dimensions .wrapper .control > div { width: 48%; } .customize-control-kirki-dimensions .wrapper .control > div h5 { margin: 10px 0 7px; } .customize-control-kirki-dimensions .wrapper .control > div .inner { display: flex; } .customize-control-kirki-editor textarea { width: 100%; } .customize-control-kirki-generic input { width: 100%; } .customize-control-kirki-generic textarea { width: 100%; border: 1px solid rgba(0, 0, 0, 0.1); -webkit-box-shadow: none; box-shadow: none; } .customize-control-kirki-multicolor .multicolor-single-color-wrapper { display: flex; justify-content: space-between; } .customize-control-kirki-multicolor .multicolor-single-label { order: 2; } .customize-control-kirki-multicolor .wp-picker-container { width: 100%; } .customize-control-kirki-multicolor .wp-picker-container > .wp-color-result { width: 100%; } .customize-control-kirki-multicolor .wp-picker-container.wp-picker-active + .multicolor-single-label { display: none; } .customize-control-kirki-number .customize-control-content { display: flex; align-items: stretch; } .customize-control-kirki-number .customize-control-content input { width: 100%; -moz-appearance: textfield; } .customize-control-kirki-number .customize-control-content input::-webkit-inner-spin-button, .customize-control-kirki-number .customize-control-content input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } .customize-control-kirki-number .customize-control-content .quantity { min-width: 2rem; max-width: 2rem; text-align: center; line-height: 24px; } .customize-control-kirki-palette { position: relative; } .customize-control-kirki-palette input[type="radio"] { display: none; } .customize-control-kirki-palette input[type="radio"]:checked + label { border: 3px solid rgba(0, 0, 0, 0.4); } .customize-control-kirki-palette label { background: none; padding: 0; border-top: 3px solid transparent; border-bottom: 3px solid transparent; margin-bottom: 5px; display: flex; } .customize-control-kirki-palette label span { padding: 10px 0; flex-grow: 1; font-size: 0; line-height: 10px; color: rgba(0, 0, 0, 0); -webkit-transition: all 200ms ease-in-out; -moz-transition: all 200ms ease-in-out; -ms-transition: all 200ms ease-in-out; -o-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out; border-top: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1); } .customize-control-kirki-palette label span:first-child { border-left: 1px solid rgba(0, 0, 0, 0.1); } .customize-control-kirki-palette label span:last-child { border-right: 1px solid rgba(0, 0, 0, 0.1); } .customize-control-kirki-palette label span:hover { padding: 10px; flex-grow: 3; min-width: 60px; font-size: 10px; line-height: 10px; color: #000; } .customize-control-kirki-radio-buttonset .buttonset { display: flex; flex-wrap: wrap; } .customize-control-kirki-radio-buttonset .buttonset .switch-label { background: rgba(0, 0, 0, 0.1); border: 1px rgba(0, 0, 0, 0.1); color: #555d66; margin: 0; text-align: center; padding: 0.5em 1em; flex-grow: 1; } .customize-control-kirki-radio-buttonset .buttonset .switch-input:checked + .switch-label { background-color: #00a0d2; color: rgba(255, 255, 255, 0.8); } .customize-control-kirki-radio-image > .image { display: flex; flex-wrap: wrap; } .customize-control-kirki-radio-image label { position: relative; display: inline-block; } .customize-control-kirki-radio-image label .image-label { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.7); font-weight: bold; } .customize-control-kirki-radio-image label .image-label .inner { width: 100%; height: 100%; text-align: center; padding: 0.5em; vertical-align: middle; } .customize-control-kirki-radio-image label:hover .image-label { display: block; } .customize-control-kirki-radio-image input { display: none; } .customize-control-kirki-radio-image input img { border: 1px solid transparent; } .customize-control-kirki-radio-image input:checked + label img { -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); border: 1px solid #3498DB; } .customize-control-kirki-radio-image input + label .image-clickable { position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; } .customize-control-kirki-radio { position: relative; } .customize-control-kirki-radio input[type=radio] { width: 18px; height: 18px; } .customize-control-kirki-radio input[type=radio]:checked:before { width: 10px; height: 10px; margin: 3px; } .customize-control-kirki-radio label { display: list-item; margin-bottom: 7px; } .customize-control-kirki-radio label .option-description { display: block; color: rgba(0, 0, 0, 0.35); font-size: 0.9em; padding-left: 25px; } .customize-control-repeater { position: relative; } .customize-control-repeater .repeater-fields .repeater-row { border: 1px solid #e5e5e5; margin-top: 0.5rem; background: #eee; position: relative; } .customize-control-repeater .repeater-fields .repeater-row.minimized { border: 1px solid #dfdfdf; padding: 0; } .customize-control-repeater .repeater-fields .repeater-row.minimized:hover { border: 1px solid #e5e5e5; } .customize-control-repeater .repeater-fields .repeater-row.minimized .repeater-row-content { display: none; } .customize-control-repeater .repeater-fields .repeater-row label { margin-bottom: 12px; clear: both; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field- { display: none; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input { display: none; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img { border: 1px solid transparent; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked + label img { -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); border: 1px solid #3498DB; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field:last-child { border-bottom: none; padding-bottom: 0; } .customize-control-repeater button.repeater-add { margin-top: 1rem; } .customize-control-repeater .repeater-row-content { padding: 10px 15px; background: #fff; } .customize-control-repeater .repeater-field { margin-bottom: 12px; width: 100%; clear: both; padding-bottom: 12px; border-bottom: 1px dotted #CCC; } .customize-control-repeater .repeater-field .customize-control-title { font-size: 13px; line-height: initial; } .customize-control-repeater .repeater-field .customize-control-description { font-size: 13px; line-height: initial; } .customize-control-repeater .repeater-field.repeater-field-hidden { margin: 0; padding: 0; border: 0; } .customize-control-repeater .repeater-field-select select { margin-left: 0; } .customize-control-repeater .repeater-field-checkbox label { line-height: 28px; } .customize-control-repeater .repeater-field-checkbox input { line-height: 28px; margin-right: 5px; } .customize-control-repeater .repeater-field-textarea textarea { width: 100%; resize: vertical; } .customize-control-repeater .repeater-row-header { background: white; border-bottom: 1px solid #dfdfdf; position: relative; padding: 10px 15px; height: auto; min-height: 20px; line-height: 30px; overflow: hidden; word-wrap: break-word; } .customize-control-repeater .repeater-row-header:hover { cursor: move; } .customize-control-repeater .repeater-row-header .dashicons { font-size: 18px; position: absolute; right: 12px; top: 2px; color: #a0a5aa; } .customize-control-repeater .repeater-row-label { font-size: 13px; font-weight: 600; line-height: 20px; display: block; width: 90%; overflow: hidden; height: 18px; } .customize-control-repeater .repeater-row-remove { color: #a00; } .customize-control-repeater .repeater-row-remove:hover { color: #f00; } .customize-control-repeater .repeater-minimize { line-height: 36px; } .customize-control-repeater .remove-button, .customize-control-repeater .upload-button { width: 48%; } .kirki-image-attachment { margin: 0; text-align: center; margin-bottom: 10px; } .kirki-image-attachment img { display: inline-block; } .kirki-file-attachment { margin: 0; text-align: center; margin-bottom: 10px; } .kirki-file-attachment .file { display: block; padding: 10px 5px; border: 1px dotted #c3c3c3; background: #f9f9f9; } .limit { padding: 3px; border-radius: 3px; } .limit.highlight { background: #D32F2F; color: #fff; } .customize-control-kirki-slider .wrapper { display: flex; align-items: center; padding: 15px 0 7px; position: relative; } .customize-control-kirki-slider .wrapper .slider-reset { position: absolute; top: 0; right: 0; font-size: 12px; transition: 0.3s ease-in-out; color: rgba(0, 0, 0, 0.3); } .customize-control-kirki-slider .wrapper .slider-reset:hover { transform: scale(1.3); color: #DC3232; } .customize-control-kirki-slider .wrapper input[type="range"] { display: block; -webkit-appearance: none; background-color: #bdc3c7; width: 100%; height: 5px; border-radius: 5px; margin: 0 auto; outline: 0; } .customize-control-kirki-slider .wrapper input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; background-color: #0085ba; width: 17px; height: 17px; border-radius: 50%; border: 1px solid #006799; cursor: pointer; transition: 0.3s ease-in-out; } ​ .customize-control-kirki-slider .wrapper input[type="range"]::-webkit-slider-thumb:hover { background-color: #006799; border: 2px solid #0085ba; } .customize-control-kirki-slider .wrapper input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.2); } .customize-control-kirki-slider .wrapper input[type="text"] { font-size: 13px; background: transparent; border: none; box-shadow: none; text-align: right; padding: 0; width: 40px; } .customize-control-kirki-slider .wrapper .value { display: flex; align-items: baseline; } .customize-control-kirki-sortable ul.ui-sortable li { padding: 5px 10px; border: 1px solid #333; background: #fff; } .customize-control-kirki-sortable ul.ui-sortable li .dashicons.dashicons-menu { float: right; } .customize-control-kirki-sortable ul.ui-sortable li .dashicons.visibility { margin-right: 10px; } .customize-control-kirki-sortable ul.ui-sortable li.invisible { color: #aaa; border: 1px dashed #aaa; } .customize-control-kirki-sortable ul.ui-sortable li.invisible .dashicons.visibility { color: #aaa; } .customize-control-kirki-switch { position: relative; } .customize-control-kirki-switch .switch-off, .customize-control-kirki-switch .switch-on { opacity: 1; padding: 8px; font-size: 14px; line-height: 18px; } .customize-control-kirki-switch .switch-on { color: #fff; opacity: 0; } .customize-control-kirki-switch .switch-off { color: #777; } .customize-control-kirki-switch .switch { border: none; margin-bottom: 1.5rem; outline: 0; padding: 0; user-select: none; border-radius: 3rem; } .customize-control-kirki-switch label { background: #b4b9be; float: left; cursor: pointer; display: flex; justify-content: space-between; margin-bottom: 1rem; position: relative; transition: left 0.15s ease-out; border-radius: 3rem; } .customize-control-kirki-switch label:after { background: #FFFFFF; content: ""; display: block; position: absolute; left: 5px; top: 5px; width: calc(.85rem + 10px); height: calc(.85rem + 10px); transition: all 0.25s ease-in-out; border-radius: 3rem; } .customize-control-kirki-switch input + label { margin-left: 0; margin-right: 0; } .customize-control-kirki-switch input:checked + label { background: #0073aa; } .customize-control-kirki-switch input:checked + label:after { left: auto; right: 5px; background: #ffffff; } .customize-control-kirki-switch input:checked + label .switch-on { opacity: 1; } .customize-control-kirki-switch input:checked + label .switch-off { opacity: 0; } .customize-control-kirki-toggle { position: relative; } .customize-control-kirki-toggle label { display: flex; flex-wrap: wrap; } .customize-control-kirki-toggle label .customize-control-title { width: calc(100% - 55px); } .customize-control-kirki-toggle label .description { order: 99; } .customize-control-kirki-toggle .switch { border: 1px solid #b4b9be; display: inline-block; width: 35px; height: 12px; border-radius: 8px; background: #b4b9be; vertical-align: middle; position: relative; top: 4px; cursor: pointer; user-select: none; transition: background 350ms ease; } .customize-control-kirki-toggle .switch:after, .customize-control-kirki-toggle .switch:before { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; position: absolute; top: 50%; left: -3px; transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease; } .customize-control-kirki-toggle .switch:before { background: rgba(0, 0, 0, 0.2); transform: translate3d(0, -50%, 0) scale(0); } .customize-control-kirki-toggle .switch:after { background: #999; border: 1px solid rgba(0, 0, 0, 0.1); transform: translate3d(0, -50%, 0); } .customize-control-kirki-toggle .switch:active:before { transform: translate3d(0, -50%, 0) scale(3); } .customize-control-kirki-toggle input:checked + .switch:before { background: rgba(0, 115, 170, 0.075); transform: translate3d(100%, -50%, 0) scale(1); } .customize-control-kirki-toggle input:checked + .switch:after { background: #0073aa; transform: translate3d(100%, -50%, 0); } .customize-control-kirki-toggle input:checked + .switch:active:before { background: rgba(0, 115, 170, 0.075); transform: translate3d(100%, -50%, 0) scale(3); } .customize-control-kirki-typography { position: relative; } .customize-control-kirki-typography .wrapper { padding: 10px; display: flex; flex-wrap: wrap; justify-content: space-between; border: 1px solid rgba(0, 0, 0, 0.1); } .customize-control-kirki-typography .wrapper h5 { margin: 0.67em 0 0; } .customize-control-kirki-typography .wrapper .color, .customize-control-kirki-typography .wrapper .font-backup, .customize-control-kirki-typography .wrapper .font-family, .customize-control-kirki-typography .wrapper .font-size, .customize-control-kirki-typography .wrapper .letter-spacing, .customize-control-kirki-typography .wrapper .line-height, .customize-control-kirki-typography .wrapper .margin-bottom, .customize-control-kirki-typography .wrapper .margin-top, .customize-control-kirki-typography .wrapper .text-align, .customize-control-kirki-typography .wrapper .text-transform, .customize-control-kirki-typography .wrapper .variant { width: 100%; float: none; clear: both; } .customize-control-kirki-typography .wrapper .font-size, .customize-control-kirki-typography .wrapper .letter-spacing, .customize-control-kirki-typography .wrapper .line-height, .customize-control-kirki-typography .wrapper .margin-bottom, .customize-control-kirki-typography .wrapper .margin-top, .customize-control-kirki-typography .wrapper .text-transform { width: 48%; } .customize-control-kirki-typography .wrapper .text-align .text-align-choices { display: flex; } .customize-control-kirki-typography .wrapper .text-align .text-align-choices label { width: 100%; padding: 5px; text-align: center; border: 1px solid rgba(255, 255, 255, 0); } .customize-control-kirki-typography .wrapper .text-align .text-align-choices input { display: none; } .customize-control-kirki-typography .wrapper .text-align .text-align-choices input:checked + label { border-color: #0085ba; } .customize-control-kirki-typography .wrapper .color { width: auto; } /*# sourceMappingURL=styles.css.map */ kirki/controls/css/.htaccess000044400000000143151232236240012102 0ustar00 Order Allow,Deny Deny from all kirki/controls/js/script.js000064400000314236151232236240012007 0ustar00/* jshint -W079 */ /* jshint unused:false */ if ( _.isUndefined( window.kirkiSetSettingValue ) ) { var kirkiSetSettingValue = { // eslint-disable-line vars-on-top /** * Set the value of the control. * * @since 3.0.0 * @param string setting The setting-ID. * @param mixed value The value. */ set: function( setting, value ) { /** * Get the control of the sub-setting. * This will be used to get properties we need from that control, * and determine if we need to do any further work based on those. */ var $this = this, subControl = wp.customize.settings.controls[ setting ], valueJSON; // If the control doesn't exist then return. if ( _.isUndefined( subControl ) ) { return true; } // First set the value in the wp object. The control type doesn't matter here. $this.setValue( setting, value ); // Process visually changing the value based on the control type. switch ( subControl.type ) { case 'kirki-background': if ( ! _.isUndefined( value['background-color'] ) ) { $this.setColorPicker( $this.findElement( setting, '.kirki-color-control' ), value['background-color'] ); } $this.findElement( setting, '.placeholder, .thumbnail' ).removeClass().addClass( 'placeholder' ).html( 'No file selected' ); _.each( [ 'background-repeat', 'background-position' ], function( subVal ) { if ( ! _.isUndefined( value[ subVal ] ) ) { $this.setSelectWoo( $this.findElement( setting, '.' + subVal + ' select' ), value[ subVal ] ); } } ); _.each( [ 'background-size', 'background-attachment' ], function( subVal ) { jQuery( $this.findElement( setting, '.' + subVal + ' input[value="' + value + '"]' ) ).prop( 'checked', true ); } ); valueJSON = JSON.stringify( value ).replace( /'/g, ''' ); jQuery( $this.findElement( setting, '.background-hidden-value' ).attr( 'value', valueJSON ) ).trigger( 'change' ); break; case 'kirki-code': jQuery( $this.findElement( setting, '.CodeMirror' ) )[0].CodeMirror.setValue( value ); break; case 'checkbox': case 'kirki-switch': case 'kirki-toggle': value = ( 1 === value || '1' === value || true === value ) ? true : false; jQuery( $this.findElement( setting, 'input' ) ).prop( 'checked', value ); wp.customize.instance( setting ).set( value ); break; case 'kirki-select': case 'kirki-fontawesome': $this.setSelectWoo( $this.findElement( setting, 'select' ), value ); break; case 'kirki-slider': jQuery( $this.findElement( setting, 'input' ) ).prop( 'value', value ); jQuery( $this.findElement( setting, '.kirki_range_value .value' ) ).html( value ); break; case 'kirki-generic': if ( _.isUndefined( subControl.choices ) || _.isUndefined( subControl.choices.element ) ) { subControl.choices.element = 'input'; } jQuery( $this.findElement( setting, subControl.choices.element ) ).prop( 'value', value ); break; case 'kirki-color': $this.setColorPicker( $this.findElement( setting, '.kirki-color-control' ), value ); break; case 'kirki-multicheck': $this.findElement( setting, 'input' ).each( function() { jQuery( this ).prop( 'checked', false ); } ); _.each( value, function( subValue, i ) { jQuery( $this.findElement( setting, 'input[value="' + value[ i ] + '"]' ) ).prop( 'checked', true ); } ); break; case 'kirki-multicolor': _.each( value, function( subVal, index ) { $this.setColorPicker( $this.findElement( setting, '.multicolor-index-' + index ), subVal ); } ); break; case 'kirki-radio-buttonset': case 'kirki-radio-image': case 'kirki-radio': case 'kirki-dashicons': case 'kirki-color-palette': case 'kirki-palette': jQuery( $this.findElement( setting, 'input[value="' + value + '"]' ) ).prop( 'checked', true ); break; case 'kirki-typography': _.each( [ 'font-family', 'variant' ], function( subVal ) { if ( ! _.isUndefined( value[ subVal ] ) ) { $this.setSelectWoo( $this.findElement( setting, '.' + subVal + ' select' ), value[ subVal ] ); } } ); _.each( [ 'font-size', 'line-height', 'letter-spacing', 'word-spacing' ], function( subVal ) { if ( ! _.isUndefined( value[ subVal ] ) ) { jQuery( $this.findElement( setting, '.' + subVal + ' input' ) ).prop( 'value', value[ subVal ] ); } } ); if ( ! _.isUndefined( value.color ) ) { $this.setColorPicker( $this.findElement( setting, '.kirki-color-control' ), value.color ); } valueJSON = JSON.stringify( value ).replace( /'/g, ''' ); jQuery( $this.findElement( setting, '.typography-hidden-value' ).attr( 'value', valueJSON ) ).trigger( 'change' ); break; case 'kirki-dimensions': _.each( value, function( subValue, id ) { jQuery( $this.findElement( setting, '.' + id + ' input' ) ).prop( 'value', subValue ); } ); break; case 'kirki-repeater': // Not yet implemented. break; case 'kirki-custom': // Do nothing. break; default: jQuery( $this.findElement( setting, 'input' ) ).prop( 'value', value ); } }, /** * Set the value for colorpickers. * CAUTION: This only sets the value visually, it does not change it in th wp object. * * @since 3.0.0 * @param object selector jQuery object for this element. * @param string value The value we want to set. */ setColorPicker: function( selector, value ) { selector.attr( 'data-default-color', value ).data( 'default-color', value ).wpColorPicker( 'color', value ); }, /** * Sets the value in a selectWoo element. * CAUTION: This only sets the value visually, it does not change it in th wp object. * * @since 3.0.0 * @param string selector The CSS identifier for this selectWoo. * @param string value The value we want to set. */ setSelectWoo: function( selector, value ) { jQuery( selector ).selectWoo().val( value ).trigger( 'change' ); }, /** * Sets the value in textarea elements. * CAUTION: This only sets the value visually, it does not change it in th wp object. * * @since 3.0.0 * @param string selector The CSS identifier for this textarea. * @param string value The value we want to set. */ setTextarea: function( selector, value ) { jQuery( selector ).prop( 'value', value ); }, /** * Finds an element inside this control. * * @since 3.0.0 * @param string setting The setting ID. * @param string element The CSS identifier. */ findElement: function( setting, element ) { return wp.customize.control( setting ).container.find( element ); }, /** * Updates the value in the wp.customize object. * * @since 3.0.0 * @param string setting The setting-ID. * @param mixed value The value. */ setValue: function( setting, value, timeout ) { timeout = ( _.isUndefined( timeout ) ) ? 100 : parseInt( timeout, 10 ); wp.customize.instance( setting ).set( {} ); setTimeout( function() { wp.customize.instance( setting ).set( value ); }, timeout ); } }; } var kirki = { initialized: false, /** * Initialize the object. * * @since 3.0.17 * @returns {null} */ initialize: function() { var self = this; // We only need to initialize once. if ( self.initialized ) { return; } setTimeout( function() { kirki.util.webfonts.standard.initialize(); kirki.util.webfonts.google.initialize(); }, 150 ); // Mark as initialized. self.initialized = true; } }; // Initialize the kirki object. kirki.initialize(); var kirki = kirki || {}; kirki = jQuery.extend( kirki, { /** * An object containing definitions for controls. * * @since 3.0.16 */ control: { /** * The radio control. * * @since 3.0.17 */ 'kirki-radio': { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The customizer control object. * @returns {null} */ init: function( control ) { var self = this; // Render the template. self.template( control ); // Init the control. kirki.input.radio.init( control ); }, /** * Render the template. * * @since 3.0.17 * @param {Object} control - The customizer control object. * @param {Object} control.params - The control parameters. * @param {string} control.params.label - The control label. * @param {string} control.params.description - The control description. * @param {string} control.params.inputAttrs - extra input arguments. * @param {string} control.params.default - The default value. * @param {Object} control.params.choices - Any extra choices we may need. * @param {string} control.id - The setting. * @returns {null} */ template: function( control ) { var template = wp.template( 'kirki-input-radio' ); control.container.html( template( { label: control.params.label, description: control.params.description, 'data-id': control.id, inputAttrs: control.params.inputAttrs, 'default': control.params.default, value: kirki.setting.get( control.id ), choices: control.params.choices } ) ); } }, /** * The color control. * * @since 3.0.16 */ 'kirki-color': { /** * Init the control. * * @since 3.0.16 * @param {Object} control - The customizer control object. * @returns {null} */ init: function( control ) { var self = this; // Render the template. self.template( control ); // Init the control. kirki.input.color.init( control ); }, /** * Render the template. * * @since 3.0.16 * @param {Object} control - The customizer control object. * @param {Object} control.params - The control parameters. * @param {string} control.params.label - The control label. * @param {string} control.params.description - The control description. * @param {string} control.params.mode - The colorpicker mode. Can be 'full' or 'hue'. * @param {bool|array} control.params.palette - false if we don't want a palette, * true to use the default palette, * array of custom hex colors if we want a custom palette. * @param {string} control.params.inputAttrs - extra input arguments. * @param {string} control.params.default - The default value. * @param {Object} control.params.choices - Any extra choices we may need. * @param {boolean} control.params.choices.alpha - should we add an alpha channel? * @param {string} control.id - The setting. * @returns {null} */ template: function( control ) { var template = wp.template( 'kirki-input-color' ); control.container.html( template( { label: control.params.label, description: control.params.description, 'data-id': control.id, mode: control.params.mode, inputAttrs: control.params.inputAttrs, 'data-palette': control.params.palette, 'data-default-color': control.params.default, 'data-alpha': control.params.choices.alpha, value: kirki.setting.get( control.id ) } ) ); } }, /** * The generic control. * * @since 3.0.16 */ 'kirki-generic': { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The customizer control object. * @param {Object} control.params - Control parameters. * @param {Object} control.params.choices - Define the specifics for this input. * @param {string} control.params.choices.element - The HTML element we want to use ('input', 'div', 'span' etc). * @returns {null} */ init: function( control ) { var self = this; // Render the template. self.template( control ); // Init the control. if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.element ) && 'textarea' === control.params.choices.element ) { kirki.input.textarea.init( control ); return; } kirki.input.genericInput.init( control ); }, /** * Render the template. * * @since 3.0.17 * @param {Object} control - The customizer control object. * @param {Object} control.params - The control parameters. * @param {string} control.params.label - The control label. * @param {string} control.params.description - The control description. * @param {string} control.params.inputAttrs - extra input arguments. * @param {string} control.params.default - The default value. * @param {Object} control.params.choices - Any extra choices we may need. * @param {boolean} control.params.choices.alpha - should we add an alpha channel? * @param {string} control.id - The setting. * @returns {null} */ template: function( control ) { var args = { label: control.params.label, description: control.params.description, 'data-id': control.id, inputAttrs: control.params.inputAttrs, choices: control.params.choices, value: kirki.setting.get( control.id ) }, template; if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.element ) && 'textarea' === control.params.choices.element ) { template = wp.template( 'kirki-input-textarea' ); control.container.html( template( args ) ); return; } template = wp.template( 'kirki-input-generic' ); control.container.html( template( args ) ); } }, /** * The number control. * * @since 3.0.26 */ 'kirki-number': { /** * Init the control. * * @since 3.0.26 * @param {Object} control - The customizer control object. * @returns {null} */ init: function( control ) { var self = this; // Render the template. self.template( control ); // Init the control. kirki.input.number.init( control ); }, /** * Render the template. * * @since 3.0.27 * @param {Object} control - The customizer control object. * @param {Object} control.params - The control parameters. * @param {string} control.params.label - The control label. * @param {string} control.params.description - The control description. * @param {string} control.params.inputAttrs - extra input arguments. * @param {string} control.params.default - The default value. * @param {Object} control.params.choices - Any extra choices we may need. * @param {string} control.id - The setting. * @returns {null} */ template: function( control ) { var template = wp.template( 'kirki-input-number' ); control.container.html( template( args = { label: control.params.label, description: control.params.description, 'data-id': control.id, inputAttrs: control.params.inputAttrs, choices: control.params.choices, value: kirki.setting.get( control.id ) } ) ); } }, 'kirki-select': { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The customizer control object. * @returns {null} */ init: function( control ) { var self = this; // Render the template. self.template( control ); // Init the control. kirki.input.select.init( control ); }, /** * Render the template. * * @since 3.0.17 * @param {Object} control - The customizer control object. * @param {Object} control.params - The control parameters. * @param {string} control.params.label - The control label. * @param {string} control.params.description - The control description. * @param {string} control.params.inputAttrs - extra input arguments. * @param {Object} control.params.default - The default value. * @param {Object} control.params.choices - The choices for the select dropdown. * @param {string} control.id - The setting. * @returns {null} */ template: function( control ) { var template = wp.template( 'kirki-input-select' ); control.container.html( template( { label: control.params.label, description: control.params.description, 'data-id': control.id, inputAttrs: control.params.inputAttrs, choices: control.params.choices, value: kirki.setting.get( control.id ), multiple: control.params.multiple || 1, placeholder: control.params.placeholder } ) ); } } } } ); /* global kirkiL10n */ var kirki = kirki || {}; kirki = jQuery.extend( kirki, { /** * An object containing definitions for input fields. * * @since 3.0.16 */ input: { /** * Radio input fields. * * @since 3.0.17 */ radio: { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The control object. * @param {Object} control.id - The setting. * @returns {null} */ init: function( control ) { var input = jQuery( 'input[data-id="' + control.id + '"]' ); // Save the value input.on( 'change keyup paste click', function() { kirki.setting.set( control.id, jQuery( this ).val() ); } ); } }, /** * Color input fields. * * @since 3.0.16 */ color: { /** * Init the control. * * @since 3.0.16 * @param {Object} control - The control object. * @param {Object} control.id - The setting. * @param {Object} control.choices - Additional options for the colorpickers. * @param {Object} control.params - Control parameters. * @param {Object} control.params.choices - alias for control.choices. * @returns {null} */ init: function( control ) { var picker = jQuery( '.kirki-color-control[data-id="' + control.id + '"]' ), clear; control.choices = control.choices || {}; if ( _.isEmpty( control.choices ) && control.params.choices ) { control.choices = control.params.choices; } // If we have defined any extra choices, make sure they are passed-on to Iris. if ( ! _.isEmpty( control.choices ) ) { picker.wpColorPicker( control.choices ); } // Tweaks to make the "clear" buttons work. setTimeout( function() { clear = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .wp-picker-clear' ); if ( clear.length ) { clear.click( function() { kirki.setting.set( control.id, '' ); } ); } }, 200 ); // Saves our settings to the WP API picker.wpColorPicker( { change: function() { // Small hack: the picker needs a small delay setTimeout( function() { kirki.setting.set( control.id, picker.val() ); }, 20 ); } } ); } }, /** * Generic input fields. * * @since 3.0.17 */ genericInput: { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The control object. * @param {Object} control.id - The setting. * @returns {null} */ init: function( control ) { var input = jQuery( 'input[data-id="' + control.id + '"]' ); // Save the value input.on( 'change keyup paste click', function() { kirki.setting.set( control.id, jQuery( this ).val() ); } ); } }, /** * Generic input fields. * * @since 3.0.17 */ textarea: { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The control object. * @param {Object} control.id - The setting. * @returns {null} */ init: function( control ) { var textarea = jQuery( 'textarea[data-id="' + control.id + '"]' ); // Save the value textarea.on( 'change keyup paste click', function() { kirki.setting.set( control.id, jQuery( this ).val() ); } ); } }, select: { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The control object. * @param {Object} control.id - The setting. * @returns {null} */ init: function( control ) { var element = jQuery( 'select[data-id="' + control.id + '"]' ), multiple = parseInt( element.data( 'multiple' ), 10 ), selectValue, selectWooOptions = { escapeMarkup: function( markup ) { return markup; } }; if ( control.params.placeholder ) { selectWooOptions.placeholder = control.params.placeholder; selectWooOptions.allowClear = true; } if ( 1 < multiple ) { selectWooOptions.maximumSelectionLength = multiple; } jQuery( element ).selectWoo( selectWooOptions ).on( 'change', function() { selectValue = jQuery( this ).val(); selectValue = ( null === selectValue && 1 < multiple ) ? [] : selectValue; kirki.setting.set( control.id, selectValue ); } ); } }, /** * Number fields. * * @since 3.0.26 */ number: { /** * Init the control. * * @since 3.0.17 * @param {Object} control - The control object. * @param {Object} control.id - The setting. * @returns {null} */ init: function( control ) { var element = jQuery( 'input[data-id="' + control.id + '"]' ), value = control.setting._value, up, down; // Make sure we use default values if none are define for some arguments. control.params.choices = _.defaults( control.params.choices, { min: 0, max: 100, step: 1 } ); // Make sure we have a valid value. if ( isNaN( value ) || '' === value ) { value = ( 0 > control.params.choices.min && 0 < control.params.choices.max ) ? 0 : control.params.choices.min; } value = parseFloat( value ); // If step is 'any', set to 0.001. control.params.choices.step = ( 'any' === control.params.choices.step ) ? 0.001 : control.params.choices.step; // Make sure choices are properly formtted as numbers. control.params.choices.min = parseFloat( control.params.choices.min ); control.params.choices.max = parseFloat( control.params.choices.max ); control.params.choices.step = parseFloat( control.params.choices.step ); up = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .plus' ); down = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .minus' ); up.click( function() { var oldVal = parseFloat( element.val() ), newVal; newVal = ( oldVal >= control.params.choices.max ) ? oldVal : oldVal + control.params.choices.step; element.val( newVal ); element.trigger( 'change' ); } ); down.click( function() { var oldVal = parseFloat( element.val() ), newVal; newVal = ( oldVal <= control.params.choices.min ) ? oldVal : oldVal - control.params.choices.step; element.val( newVal ); element.trigger( 'change' ); } ); element.on( 'change keyup paste click', function() { kirki.setting.set( control.id, jQuery( this ).val() ); } ); } }, image: { /** * Get the HTML for image inputs. * * @since 3.0.17 * @param {Object} data - The arguments. * @returns {string} */ getTemplate: function( data ) { var html = '', saveAs = 'url', url; data = _.defaults( data, { label: '', description: '', inputAttrs: '', 'data-id': '', choices: {}, value: '' } ); if ( ! _.isUndefined( data.choices ) && ! _.isUndefined( data.choices.save_as ) ) { saveAs = data.choices.save_as; } url = data.value; if ( _.isObject( data.value ) && ! _.isUndefined( data.value.url ) ) { url = data.value.url; } html += ''; html += '
                              '; if ( data.value.url || '' !== url ) { html += '
                              '; } else { html += '
                              ' + kirkiL10n.noFileSelected + '
                              '; } html += '
                              '; html += ''; if ( data.default && '' !== data.default ) { html += ''; html += '
                              '; return '
                              ' + html + '
                              '; }, /** * Init the control. * * @since 3.0.17 * @param {Object} control - The control object. * @returns {null} */ init: function( control ) { } } } } ); var kirki = kirki || {}; kirki = jQuery.extend( kirki, { /** * An object containing definitions for settings. * * @since 3.0.16 */ setting: { /** * Gets the value of a setting. * * This is a helper function that allows us to get the value of * control[key1][key2] for example, when the setting used in the * customizer API is "control". * * @since 3.0.16 * @param {string} setting - The setting for which we're getting the value. * @returns {mixed} Depends on the value. */ get: function( setting ) { var parts = setting.split( '[' ), foundSetting = '', foundInStep = 0, currentVal = ''; _.each( parts, function( part, i ) { part = part.replace( ']', '' ); if ( 0 === i ) { foundSetting = part; } else { foundSetting += '[' + part + ']'; } if ( ! _.isUndefined( wp.customize.instance( foundSetting ) ) ) { currentVal = wp.customize.instance( foundSetting ).get(); foundInStep = i; } if ( foundInStep < i ) { if ( _.isObject( currentVal ) && ! _.isUndefined( currentVal[ part ] ) ) { currentVal = currentVal[ part ]; } } } ); return currentVal; }, /** * Sets the value of a setting. * * This function is a bit complicated because there any many scenarios to consider. * Example: We want to save the value for my_setting[something][3][something-else]. * The control's setting is my_setting[something]. * So we need to find that first, then figure out the remaining parts, * merge the values recursively to avoid destroying my_setting[something][2] * and also take into account any defined "key" arguments which take this even deeper. * * @since 3.0.16 * @param {object|string} element - The DOM element whose value has changed, * or an ID. * @param {mixed} value - Depends on the control-type. * @param {string} key - If we only want to save an item in an object * we can define the key here. * @returns {null} */ set: function( element, value, key ) { var setting, parts, currentNode = '', foundNode = '', subSettingObj = {}, currentVal, subSetting, subSettingParts; // Get the setting from the element. setting = element; if ( _.isObject( element ) ) { if ( jQuery( element ).attr( 'data-id' ) ) { setting = element.attr( 'data-id' ); } else { setting = element.parents( '[data-id]' ).attr( 'data-id' ); } } if ( 'undefined' !== typeof wp.customize.control( setting ) ) { wp.customize.control( setting ).setting.set( value ); return; } parts = setting.split( '[' ); // Find the setting we're using in the control using the customizer API. _.each( parts, function( part, i ) { part = part.replace( ']', '' ); // The current part of the setting. currentNode = ( 0 === i ) ? part : '[' + part + ']'; // When we find the node, get the value from it. // In case of an object we'll need to merge with current values. if ( ! _.isUndefined( wp.customize.instance( currentNode ) ) ) { foundNode = currentNode; currentVal = wp.customize.instance( foundNode ).get(); } } ); // Get the remaining part of the setting that was unused. subSetting = setting.replace( foundNode, '' ); // If subSetting is not empty, then we're dealing with an object // and we need to dig deeper and recursively merge the values. if ( '' !== subSetting ) { if ( ! _.isObject( currentVal ) ) { currentVal = {}; } if ( '[' === subSetting.charAt( 0 ) ) { subSetting = subSetting.replace( '[', '' ); } subSettingParts = subSetting.split( '[' ); _.each( subSettingParts, function( subSettingPart, i ) { subSettingParts[ i ] = subSettingPart.replace( ']', '' ); } ); // If using a key, we need to go 1 level deeper. if ( key ) { subSettingParts.push( key ); } // Converting to a JSON string and then parsing that to an object // may seem a bit hacky and crude but it's efficient and works. subSettingObj = '{"' + subSettingParts.join( '":{"' ) + '":"' + value + '"' + '}'.repeat( subSettingParts.length ); subSettingObj = JSON.parse( subSettingObj ); // Recursively merge with current value. jQuery.extend( true, currentVal, subSettingObj ); value = currentVal; } else { if ( key ) { currentVal = ( ! _.isObject( currentVal ) ) ? {} : currentVal; currentVal[ key ] = value; value = currentVal; } } wp.customize.control( foundNode ).setting.set( value ); } } } ); /* global ajaxurl */ var kirki = kirki || {}; kirki = jQuery.extend( kirki, { /** * A collection of utility methods. * * @since 3.0.17 */ util: { /** * A collection of utility methods for webfonts. * * @since 3.0.17 */ webfonts: { /** * Google-fonts related methods. * * @since 3.0.17 */ google: { /** * An object containing all Google fonts. * * to set this call this.setFonts(); * * @since 3.0.17 */ fonts: {}, /** * Init for google-fonts. * * @since 3.0.17 * @returns {null} */ initialize: function() { var self = this; self.setFonts(); }, /** * Set fonts in this.fonts * * @since 3.0.17 * @returns {null} */ setFonts: function() { var self = this; // No need to run if we already have the fonts. if ( ! _.isEmpty( self.fonts ) ) { return; } // Make an AJAX call to set the fonts object (alpha). jQuery.post( ajaxurl, { 'action': 'kirki_fonts_google_all_get' }, function( response ) { // Get fonts from the JSON array. self.fonts = JSON.parse( response ); } ); }, /** * Gets all properties of a font-family. * * @since 3.0.17 * @param {string} family - The font-family we're interested in. * @returns {Object} */ getFont: function( family ) { var self = this, fonts = self.getFonts(); if ( 'undefined' === typeof fonts[ family ] ) { return false; } return fonts[ family ]; }, /** * Gets all properties of a font-family. * * @since 3.0.17 * @param {string} order - How to order the fonts (alpha|popularity|trending). * @param {int} number - How many to get. 0 for all. * @returns {Object} */ getFonts: function( order, category, number ) { var self = this, ordered = {}, categorized = {}, plucked = {}; // Make sure order is correct. order = order || 'alpha'; order = ( 'alpha' !== order && 'popularity' !== order && 'trending' !== order ) ? 'alpha' : order; // Make sure number is correct. number = number || 0; number = parseInt( number, 10 ); // Order fonts by the 'order' argument. if ( 'alpha' === order ) { ordered = jQuery.extend( {}, self.fonts.items ); } else { _.each( self.fonts.order[ order ], function( family ) { ordered[ family ] = self.fonts.items[ family ]; } ); } // If we have a category defined get only the fonts in that category. if ( '' === category || ! category ) { categorized = ordered; } else { _.each( ordered, function( font, family ) { if ( category === font.category ) { categorized[ family ] = font; } } ); } // If we only want a number of font-families get the 1st items from the results. if ( 0 < number ) { _.each( _.first( _.keys( categorized ), number ), function( family ) { plucked[ family ] = categorized[ family ]; } ); return plucked; } return categorized; }, /** * Gets the variants for a font-family. * * @since 3.0.17 * @param {string} family - The font-family we're interested in. * @returns {Array} */ getVariants: function( family ) { var self = this, font = self.getFont( family ); // Early exit if font was not found. if ( ! font ) { return false; } // Early exit if font doesn't have variants. if ( _.isUndefined( font.variants ) ) { return false; } // Return the variants. return font.variants; } }, /** * Standard fonts related methods. * * @since 3.0.17 */ standard: { /** * An object containing all Standard fonts. * * to set this call this.setFonts(); * * @since 3.0.17 */ fonts: {}, /** * Init for google-fonts. * * @since 3.0.17 * @returns {null} */ initialize: function() { var self = this; self.setFonts(); }, /** * Set fonts in this.fonts * * @since 3.0.17 * @returns {null} */ setFonts: function() { var self = this; // No need to run if we already have the fonts. if ( ! _.isEmpty( self.fonts ) ) { return; } // Make an AJAX call to set the fonts object. jQuery.post( ajaxurl, { 'action': 'kirki_fonts_standard_all_get' }, function( response ) { // Get fonts from the JSON array. self.fonts = JSON.parse( response ); } ); }, /** * Gets the variants for a font-family. * * @since 3.0.17 * @returns {Array} */ getVariants: function() { return [ 'regular', 'italic', '700', '700italic' ]; } }, /** * Figure out what this font-family is (google/standard) * * @since 3.0.20 * @param {string} family - The font-family. * @returns {string|false} - Returns string if found (google|standard) * and false in case the font-family is an arbitrary value * not found anywhere in our font definitions. */ getFontType: function( family ) { var self = this; // Check for standard fonts first. if ( 'undefined' !== typeof self.standard.fonts[ family ] || ( 'undefined' !== typeof self.standard.fonts.stack && 'undefined' !== typeof self.standard.fonts.stack[ family ] ) ) { return 'standard'; } // Check in googlefonts. if ( 'undefined' !== typeof self.google.fonts.items[ family ] ) { return 'google'; } return false; } }, validate: { cssValue: function( value ) { var validUnits = [ 'fr', 'rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax' ], numericValue, unit; // Whitelist values. if ( 0 === value || '0' === value || 'auto' === value || 'inherit' === value || 'initial' === value ) { return true; } // Skip checking if calc(). if ( 0 <= value.indexOf( 'calc(' ) && 0 <= value.indexOf( ')' ) ) { return true; } // Get the numeric value. numericValue = parseFloat( value ); // Get the unit unit = value.replace( numericValue, '' ); // Allow unitless. if ( ! value ) { return; } // Check the validity of the numeric value and units. return ( ! isNaN( numericValue ) && -1 < jQuery.inArray( unit, validUnits ) ); } } } } ); /* global kirki */ /** * The majority of the code in this file * is derived from the wp-customize-posts plugin * and the work of @westonruter to whom I am very grateful. * * @see https://github.com/xwp/wp-customize-posts */ ( function() { 'use strict'; /** * A dynamic color-alpha control. * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ wp.customize.kirkiDynamicControl = wp.customize.Control.extend( { initialize: function( id, options ) { var control = this, args = options || {}; args.params = args.params || {}; if ( ! args.params.type ) { args.params.type = 'kirki-generic'; } if ( ! args.params.content ) { args.params.content = jQuery( '
                            • ' ); args.params.content.attr( 'id', 'customize-control-' + id.replace( /]/g, '' ).replace( /\[/g, '-' ) ); args.params.content.attr( 'class', 'customize-control customize-control-' + args.params.type ); } control.propertyElements = []; wp.customize.Control.prototype.initialize.call( control, id, args ); }, /** * Add bidirectional data binding links between inputs and the setting(s). * * This is copied from wp.customize.Control.prototype.initialize(). It * should be changed in Core to be applied once the control is embedded. * * @private * @returns {null} */ _setUpSettingRootLinks: function() { var control = this, nodes = control.container.find( '[data-customize-setting-link]' ); nodes.each( function() { var node = jQuery( this ); wp.customize( node.data( 'customizeSettingLink' ), function( setting ) { var element = new wp.customize.Element( node ); control.elements.push( element ); element.sync( setting ); element.set( setting() ); } ); } ); }, /** * Add bidirectional data binding links between inputs and the setting properties. * * @private * @returns {null} */ _setUpSettingPropertyLinks: function() { var control = this, nodes; if ( ! control.setting ) { return; } nodes = control.container.find( '[data-customize-setting-property-link]' ); nodes.each( function() { var node = jQuery( this ), element, propertyName = node.data( 'customizeSettingPropertyLink' ); element = new wp.customize.Element( node ); control.propertyElements.push( element ); element.set( control.setting()[ propertyName ] ); element.bind( function( newPropertyValue ) { var newSetting = control.setting(); if ( newPropertyValue === newSetting[ propertyName ] ) { return; } newSetting = _.clone( newSetting ); newSetting[ propertyName ] = newPropertyValue; control.setting.set( newSetting ); } ); control.setting.bind( function( newValue ) { if ( newValue[ propertyName ] !== element.get() ) { element.set( newValue[ propertyName ] ); } } ); } ); }, /** * @inheritdoc */ ready: function() { var control = this; control._setUpSettingRootLinks(); control._setUpSettingPropertyLinks(); wp.customize.Control.prototype.ready.call( control ); control.deferred.embedded.done( function() { control.initKirkiControl( control ); } ); }, /** * Embed the control in the document. * * Override the embed() method to do nothing, * so that the control isn't embedded on load, * unless the containing section is already expanded. * * @returns {null} */ embed: function() { var control = this, sectionId = control.section(); if ( ! sectionId ) { return; } wp.customize.section( sectionId, function( section ) { if ( 'kirki-expanded' === section.params.type || section.expanded() || wp.customize.settings.autofocus.control === control.id ) { control.actuallyEmbed(); } else { section.expanded.bind( function( expanded ) { if ( expanded ) { control.actuallyEmbed(); } } ); } } ); }, /** * Deferred embedding of control when actually * * This function is called in Section.onChangeExpanded() so the control * will only get embedded when the Section is first expanded. * * @returns {null} */ actuallyEmbed: function() { var control = this; if ( 'resolved' === control.deferred.embedded.state() ) { return; } control.renderContent(); control.deferred.embedded.resolve(); // This triggers control.ready(). }, /** * This is not working with autofocus. * * @param {object} [args] Args. * @returns {null} */ focus: function( args ) { var control = this; control.actuallyEmbed(); wp.customize.Control.prototype.focus.call( control, args ); }, /** * Additional actions that run on ready. * * @param {object} [args] Args. * @returns {null} */ initKirkiControl: function( control ) { if ( 'undefined' !== typeof kirki.control[ control.params.type ] ) { kirki.control[ control.params.type ].init( control ); return; } // Save the value this.container.on( 'change keyup paste click', 'input', function() { control.setting.set( jQuery( this ).val() ); } ); } } ); }() ); _.each( kirki.control, function( obj, type ) { wp.customize.controlConstructor[ type ] = wp.customize.kirkiDynamicControl.extend( {} ); } ); /* global kirkiControlLoader */ wp.customize.controlConstructor['kirki-background'] = wp.customize.Control.extend( { // When we're finished loading continue processing ready: function() { 'use strict'; var control = this; // Init the control. if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) { kirkiControlLoader( control ); } else { control.initKirkiControl(); } }, initKirkiControl: function() { var control = this, value = control.setting._value, picker = control.container.find( '.kirki-color-control' ); // Hide unnecessary controls if the value doesn't have an image. if ( _.isUndefined( value['background-image'] ) || '' === value['background-image'] ) { control.container.find( '.background-wrapper > .background-repeat' ).hide(); control.container.find( '.background-wrapper > .background-position' ).hide(); control.container.find( '.background-wrapper > .background-size' ).hide(); control.container.find( '.background-wrapper > .background-attachment' ).hide(); } // Color. picker.wpColorPicker( { change: function() { setTimeout( function() { control.saveValue( 'background-color', picker.val() ); }, 100 ); } } ); // Background-Repeat. control.container.on( 'change', '.background-repeat select', function() { control.saveValue( 'background-repeat', jQuery( this ).val() ); } ); // Background-Size. control.container.on( 'change click', '.background-size input', function() { control.saveValue( 'background-size', jQuery( this ).val() ); } ); // Background-Position. control.container.on( 'change', '.background-position select', function() { control.saveValue( 'background-position', jQuery( this ).val() ); } ); // Background-Attachment. control.container.on( 'change click', '.background-attachment input', function() { control.saveValue( 'background-attachment', jQuery( this ).val() ); } ); // Background-Image. control.container.on( 'click', '.background-image-upload-button', function( e ) { var image = wp.media( { multiple: false } ).open().on( 'select', function() { // This will return the selected image from the Media Uploader, the result is an object. var uploadedImage = image.state().get( 'selection' ).first(), previewImage = uploadedImage.toJSON().sizes.full.url, imageUrl, imageID, imageWidth, imageHeight, preview, removeButton; if ( ! _.isUndefined( uploadedImage.toJSON().sizes.medium ) ) { previewImage = uploadedImage.toJSON().sizes.medium.url; } else if ( ! _.isUndefined( uploadedImage.toJSON().sizes.thumbnail ) ) { previewImage = uploadedImage.toJSON().sizes.thumbnail.url; } imageUrl = uploadedImage.toJSON().sizes.full.url; imageID = uploadedImage.toJSON().id; imageWidth = uploadedImage.toJSON().width; imageHeight = uploadedImage.toJSON().height; // Show extra controls if the value has an image. if ( '' !== imageUrl ) { control.container.find( '.background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment' ).show(); } control.saveValue( 'background-image', imageUrl ); preview = control.container.find( '.placeholder, .thumbnail' ); removeButton = control.container.find( '.background-image-upload-remove-button' ); if ( preview.length ) { preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( '' ); } if ( removeButton.length ) { removeButton.show(); } } ); e.preventDefault(); } ); control.container.on( 'click', '.background-image-upload-remove-button', function( e ) { var preview, removeButton; e.preventDefault(); control.saveValue( 'background-image', '' ); preview = control.container.find( '.placeholder, .thumbnail' ); removeButton = control.container.find( '.background-image-upload-remove-button' ); // Hide unnecessary controls. control.container.find( '.background-wrapper > .background-repeat' ).hide(); control.container.find( '.background-wrapper > .background-position' ).hide(); control.container.find( '.background-wrapper > .background-size' ).hide(); control.container.find( '.background-wrapper > .background-attachment' ).hide(); if ( preview.length ) { preview.removeClass().addClass( 'placeholder' ).html( 'No file selected' ); } if ( removeButton.length ) { removeButton.hide(); } } ); }, /** * Saves the value. */ saveValue: function( property, value ) { var control = this, input = jQuery( '#customize-control-' + control.id.replace( '[', '-' ).replace( ']', '' ) + ' .background-hidden-value' ), val = control.setting._value; val[ property ] = value; jQuery( input ).attr( 'value', JSON.stringify( val ) ).trigger( 'change' ); control.setting.set( val ); } } ); wp.customize.controlConstructor['kirki-color-palette'] = wp.customize.kirkiDynamicControl.extend( {} ); wp.customize.controlConstructor['kirki-dashicons'] = wp.customize.kirkiDynamicControl.extend( {} ); wp.customize.controlConstructor['kirki-date'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, selector = control.selector + ' input.datepicker'; // Init the datepicker jQuery( selector ).datepicker( { dateFormat: 'yy-mm-dd' } ); control.container.find( '.kirki-controls-loading-spinner' ).hide(); // Save the changes this.container.on( 'change keyup paste', 'input.datepicker', function() { control.setting.set( jQuery( this ).val() ); } ); } } ); /* global dimensionkirkiL10n */ wp.customize.controlConstructor['kirki-dimension'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, value; // Notifications. control.kirkiNotifications(); // Save the value this.container.on( 'change keyup paste', 'input', function() { value = jQuery( this ).val(); control.setting.set( value ); } ); }, /** * Handles notifications. */ kirkiNotifications: function() { var control = this; wp.customize( control.id, function( setting ) { setting.bind( function( value ) { var code = 'long_title'; if ( false === kirki.util.validate.cssValue( value ) ) { setting.notifications.add( code, new wp.customize.Notification( code, { type: 'warning', message: dimensionkirkiL10n['invalid-value'] } ) ); } else { setting.notifications.remove( code ); } } ); } ); } } ); /* global dimensionskirkiL10n */ wp.customize.controlConstructor['kirki-dimensions'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, subControls = control.params.choices.controls, value = {}, subsArray = [], i; _.each( subControls, function( v, i ) { if ( true === v ) { subsArray.push( i ); } } ); for ( i = 0; i < subsArray.length; i++ ) { value[ subsArray[ i ] ] = control.setting._value[ subsArray[ i ] ]; control.updateDimensionsValue( subsArray[ i ], value ); } }, /** * Updates the value. */ updateDimensionsValue: function( context, value ) { var control = this; control.container.on( 'change keyup paste', '.' + context + ' input', function() { value[ context ] = jQuery( this ).val(); // Notifications. control.kirkiNotifications(); // Save the value control.saveValue( value ); } ); }, /** * Saves the value. */ saveValue: function( value ) { var control = this, newValue = {}; _.each( value, function( newSubValue, i ) { newValue[ i ] = newSubValue; } ); control.setting.set( newValue ); }, /** * Handles notifications. */ kirkiNotifications: function() { var control = this; wp.customize( control.id, function( setting ) { setting.bind( function( value ) { var code = 'long_title', subs = {}, message; setting.notifications.remove( code ); _.each( value, function( val, direction ) { if ( false === kirki.util.validate.cssValue( val ) ) { subs[ direction ] = val; } else { delete subs[ direction ]; } } ); if ( ! _.isEmpty( subs ) ) { message = dimensionskirkiL10n['invalid-value'] + ' (' + _.values( subs ).toString() + ') '; setting.notifications.add( code, new wp.customize.Notification( code, { type: 'warning', message: message } ) ); return; } setting.notifications.remove( code ); } ); } ); } } ); /* global tinyMCE */ wp.customize.controlConstructor['kirki-editor'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, element = control.container.find( 'textarea' ), id = 'kirki-editor-' + control.id.replace( '[', '' ).replace( ']', '' ), editor; wp.editor.initialize( id, { tinymce: { wpautop: true }, quicktags: true, mediaButtons: true } ); editor = tinyMCE.get( id ); if ( editor ) { editor.onChange.add( function( ed ) { var content; ed.save(); content = editor.getContent(); element.val( content ).trigger( 'change' ); wp.customize.instance( control.id ).set( content ); } ); } } } ); /* global fontAwesomeJSON */ wp.customize.controlConstructor['kirki-fontawesome'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, element = this.container.find( 'select' ), icons = jQuery.parseJSON( fontAwesomeJSON ), selectValue, selectWooOptions = { data: [], escapeMarkup: function( markup ) { return markup; }, templateResult: function( val ) { return '' + ' ' + val.text; }, templateSelection: function( val ) { return '' + ' ' + val.text; } }, select; _.each( icons.icons, function( icon ) { selectWooOptions.data.push( { id: icon.id, text: icon.name } ); } ); select = jQuery( element ).selectWoo( selectWooOptions ); select.on( 'change', function() { selectValue = jQuery( this ).val(); control.setting.set( selectValue ); } ); select.val( control.setting._value ).trigger( 'change' ); } } ); /* global kirkiControlLoader */ wp.customize.controlConstructor['kirki-image'] = wp.customize.Control.extend( { // When we're finished loading continue processing ready: function() { 'use strict'; var control = this; // Init the control. if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) { kirkiControlLoader( control ); } else { control.initKirkiControl(); } }, initKirkiControl: function() { var control = this, value = control.getValue(), saveAs = ( ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.save_as ) ) ? control.params.choices.save_as : 'url', preview = control.container.find( '.placeholder, .thumbnail' ), previewImage = ( 'array' === saveAs ) ? value.url : value, removeButton = control.container.find( '.image-upload-remove-button' ), defaultButton = control.container.find( '.image-default-button' ); control.container.find( '.kirki-controls-loading-spinner' ).hide(); // Tweaks for save_as = id. if ( ( 'id' === saveAs || 'ID' === saveAs ) && '' !== value ) { wp.media.attachment( value ).fetch().then( function() { setTimeout( function() { var url = wp.media.attachment( value ).get( 'url' ); preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( '' ); }, 700 ); } ); } // If value is not empty, hide the "default" button. if ( ( 'url' === saveAs && '' !== value ) || ( 'array' === saveAs && ! _.isUndefined( value.url ) && '' !== value.url ) ) { control.container.find( 'image-default-button' ).hide(); } // If value is empty, hide the "remove" button. if ( ( 'url' === saveAs && '' === value ) || ( 'array' === saveAs && ( _.isUndefined( value.url ) || '' === value.url ) ) ) { removeButton.hide(); } // If value is default, hide the default button. if ( value === control.params.default ) { control.container.find( 'image-default-button' ).hide(); } if ( '' !== previewImage ) { preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( '' ); } control.container.on( 'click', '.image-upload-button', function( e ) { var image = wp.media( { multiple: false } ).open().on( 'select', function() { // This will return the selected image from the Media Uploader, the result is an object. var uploadedImage = image.state().get( 'selection' ).first(), jsonImg = uploadedImage.toJSON(), previewImage = jsonImg.url; if ( ! _.isUndefined( jsonImg.sizes ) ) { previewImg = jsonImg.sizes.full.url; if ( ! _.isUndefined( jsonImg.sizes.medium ) ) { previewImage = jsonImg.sizes.medium.url; } else if ( ! _.isUndefined( jsonImg.sizes.thumbnail ) ) { previewImage = jsonImg.sizes.thumbnail.url; } } if ( 'array' === saveAs ) { control.saveValue( 'id', jsonImg.id ); control.saveValue( 'url', jsonImg.sizes.full.url ); control.saveValue( 'width', jsonImg.width ); control.saveValue( 'height', jsonImg.height ); } else if ( 'id' === saveAs ) { control.saveValue( 'id', jsonImg.id ); } else { control.saveValue( 'url', ( ( ! _.isUndefined( jsonImg.sizes ) ) ? jsonImg.sizes.full.url : jsonImg.url ) ); } if ( preview.length ) { preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( '' ); } if ( removeButton.length ) { removeButton.show(); defaultButton.hide(); } } ); e.preventDefault(); } ); control.container.on( 'click', '.image-upload-remove-button', function( e ) { var preview, removeButton, defaultButton; e.preventDefault(); control.saveValue( 'id', '' ); control.saveValue( 'url', '' ); control.saveValue( 'width', '' ); control.saveValue( 'height', '' ); preview = control.container.find( '.placeholder, .thumbnail' ); removeButton = control.container.find( '.image-upload-remove-button' ); defaultButton = control.container.find( '.image-default-button' ); if ( preview.length ) { preview.removeClass().addClass( 'placeholder' ).html( 'No file selected' ); } if ( removeButton.length ) { removeButton.hide(); if ( jQuery( defaultButton ).hasClass( 'button' ) ) { defaultButton.show(); } } } ); control.container.on( 'click', '.image-default-button', function( e ) { var preview, removeButton, defaultButton; e.preventDefault(); control.saveValue( 'url', control.params.default ); preview = control.container.find( '.placeholder, .thumbnail' ); removeButton = control.container.find( '.image-upload-remove-button' ); defaultButton = control.container.find( '.image-default-button' ); if ( preview.length ) { preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( '' ); } if ( removeButton.length ) { removeButton.show(); defaultButton.hide(); } } ); }, /** * Gets the value. */ getValue: function() { var control = this, value = control.setting._value, saveAs = ( ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.save_as ) ) ? control.params.choices.save_as : 'url'; if ( 'array' === saveAs && _.isString( value ) ) { value = { url: value }; } return value; }, /** * Saves the value. */ saveValue: function( property, value ) { var control = this, valueOld = control.setting._value, saveAs = ( ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.save_as ) ) ? control.params.choices.save_as : 'url'; if ( 'array' === saveAs ) { if ( _.isString( valueOld ) ) { valueOld = {}; } valueOld[ property ] = value; control.setting.set( valueOld ); control.container.find( 'button' ).trigger( 'change' ); return; } control.setting.set( value ); control.container.find( 'button' ).trigger( 'change' ); } } ); wp.customize.controlConstructor['kirki-multicheck'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this; // Save the value control.container.on( 'change', 'input', function() { var value = [], i = 0; // Build the value as an object using the sub-values from individual checkboxes. jQuery.each( control.params.choices, function( key ) { if ( control.container.find( 'input[value="' + key + '"]' ).is( ':checked' ) ) { control.container.find( 'input[value="' + key + '"]' ).parent().addClass( 'checked' ); value[ i ] = key; i++; } else { control.container.find( 'input[value="' + key + '"]' ).parent().removeClass( 'checked' ); } } ); // Update the value in the customizer. control.setting.set( value ); } ); } } ); /* global kirkiControlLoader */ wp.customize.controlConstructor['kirki-multicolor'] = wp.customize.Control.extend( { // When we're finished loading continue processing ready: function() { 'use strict'; var control = this; // Init the control. if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) { kirkiControlLoader( control ); } else { control.initKirkiControl(); } }, initKirkiControl: function() { 'use strict'; var control = this, colors = control.params.choices, keys = Object.keys( colors ), value = this.params.value, i = 0; // Proxy function that handles changing the individual colors function kirkiMulticolorChangeHandler( control, value, subSetting ) { var picker = control.container.find( '.multicolor-index-' + subSetting ), args = { change: function() { // Color controls require a small delay. setTimeout( function() { // Set the value. control.saveValue( subSetting, picker.val() ); // Trigger the change. control.container.find( '.multicolor-index-' + subSetting ).trigger( 'change' ); }, 100 ); } }; if ( _.isObject( colors.irisArgs ) ) { _.each( colors.irisArgs, function( irisValue, irisKey ) { args[ irisKey ] = irisValue; } ); } // Did we change the value? picker.wpColorPicker( args ); } // Colors loop while ( i < Object.keys( colors ).length ) { kirkiMulticolorChangeHandler( this, value, keys[ i ] ); i++; } }, /** * Saves the value. */ saveValue: function( property, value ) { var control = this, input = control.container.find( '.multicolor-hidden-value' ), val = control.setting._value; val[ property ] = value; jQuery( input ).attr( 'value', JSON.stringify( val ) ).trigger( 'change' ); control.setting.set( val ); } } ); wp.customize.controlConstructor['kirki-palette'] = wp.customize.kirkiDynamicControl.extend( {} ); wp.customize.controlConstructor['kirki-radio-buttonset'] = wp.customize.kirkiDynamicControl.extend( {} ); wp.customize.controlConstructor['kirki-radio-image'] = wp.customize.kirkiDynamicControl.extend( {} ); /* global kirkiControlLoader */ var RepeaterRow = function( rowIndex, container, label, control ) { 'use strict'; var self = this; this.rowIndex = rowIndex; this.container = container; this.label = label; this.header = this.container.find( '.repeater-row-header' ); this.header.on( 'click', function() { self.toggleMinimize(); } ); this.container.on( 'click', '.repeater-row-remove', function() { self.remove(); } ); this.header.on( 'mousedown', function() { self.container.trigger( 'row:start-dragging' ); } ); this.container.on( 'keyup change', 'input, select, textarea', function( e ) { self.container.trigger( 'row:update', [ self.rowIndex, jQuery( e.target ).data( 'field' ), e.target ] ); } ); this.setRowIndex = function( rowIndex ) { this.rowIndex = rowIndex; this.container.attr( 'data-row', rowIndex ); this.container.data( 'row', rowIndex ); this.updateLabel(); }; this.toggleMinimize = function() { // Store the previous state. this.container.toggleClass( 'minimized' ); this.header.find( '.dashicons' ).toggleClass( 'dashicons-arrow-up' ).toggleClass( 'dashicons-arrow-down' ); }; this.remove = function() { this.container.slideUp( 300, function() { jQuery( this ).detach(); } ); this.container.trigger( 'row:remove', [ this.rowIndex ] ); }; this.updateLabel = function() { var rowLabelField, rowLabel, rowLabelSelector; if ( 'field' === this.label.type ) { rowLabelField = this.container.find( '.repeater-field [data-field="' + this.label.field + '"]' ); if ( _.isFunction( rowLabelField.val ) ) { rowLabel = rowLabelField.val(); if ( '' !== rowLabel ) { if ( ! _.isUndefined( control.params.fields[ this.label.field ] ) ) { if ( ! _.isUndefined( control.params.fields[ this.label.field ].type ) ) { if ( 'select' === control.params.fields[ this.label.field ].type ) { if ( ! _.isUndefined( control.params.fields[ this.label.field ].choices ) && ! _.isUndefined( control.params.fields[ this.label.field ].choices[ rowLabelField.val() ] ) ) { rowLabel = control.params.fields[ this.label.field ].choices[ rowLabelField.val() ]; } } else if ( 'radio' === control.params.fields[ this.label.field ].type || 'radio-image' === control.params.fields[ this.label.field ].type ) { rowLabelSelector = control.selector + ' [data-row="' + this.rowIndex + '"] .repeater-field [data-field="' + this.label.field + '"]:checked'; rowLabel = jQuery( rowLabelSelector ).val(); } } } this.header.find( '.repeater-row-label' ).text( rowLabel ); return; } } } this.header.find( '.repeater-row-label' ).text( this.label.value + ' ' + ( this.rowIndex + 1 ) ); }; this.updateLabel(); }; wp.customize.controlConstructor.repeater = wp.customize.Control.extend( { // When we're finished loading continue processing ready: function() { 'use strict'; var control = this; // Init the control. if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) { kirkiControlLoader( control ); } else { control.initKirkiControl(); } }, initKirkiControl: function() { 'use strict'; var control = this, limit, theNewRow; // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function) var settingValue = this.params.value; control.container.find( '.kirki-controls-loading-spinner' ).hide(); // The hidden field that keeps the data saved (though we never update it) this.settingField = this.container.find( '[data-customize-setting-link]' ).first(); // Set the field value for the first time, we'll fill it up later this.setValue( [], false ); // The DIV that holds all the rows this.repeaterFieldsContainer = this.container.find( '.repeater-fields' ).first(); // Set number of rows to 0 this.currentIndex = 0; // Save the rows objects this.rows = []; // Default limit choice limit = false; if ( ! _.isUndefined( this.params.choices.limit ) ) { limit = ( 0 >= this.params.choices.limit ) ? false : parseInt( this.params.choices.limit, 10 ); } this.container.on( 'click', 'button.repeater-add', function( e ) { e.preventDefault(); if ( ! limit || control.currentIndex < limit ) { theNewRow = control.addRow(); theNewRow.toggleMinimize(); control.initColorPicker(); control.initSelect( theNewRow ); } else { jQuery( control.selector + ' .limit' ).addClass( 'highlight' ); } } ); this.container.on( 'click', '.repeater-row-remove', function() { control.currentIndex--; if ( ! limit || control.currentIndex < limit ) { jQuery( control.selector + ' .limit' ).removeClass( 'highlight' ); } } ); this.container.on( 'click keypress', '.repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button', function( e ) { e.preventDefault(); control.$thisButton = jQuery( this ); control.openFrame( e ); } ); this.container.on( 'click keypress', '.repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button', function( e ) { e.preventDefault(); control.$thisButton = jQuery( this ); control.removeImage( e ); } ); this.container.on( 'click keypress', '.repeater-field-upload .remove-button', function( e ) { e.preventDefault(); control.$thisButton = jQuery( this ); control.removeFile( e ); } ); /** * Function that loads the Mustache template */ this.repeaterTemplate = _.memoize( function() { var compiled, /* * Underscore's default ERB-style templates are incompatible with PHP * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax. * * @see trac ticket #22344. */ options = { evaluate: /<#([\s\S]+?)#>/g, interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, escape: /\{\{([^\}]+?)\}\}(?!\})/g, variable: 'data' }; return function( data ) { compiled = _.template( control.container.find( '.customize-control-repeater-content' ).first().html(), null, options ); return compiled( data ); }; } ); // When we load the control, the fields have not been filled up // This is the first time that we create all the rows if ( settingValue.length ) { _.each( settingValue, function( subValue ) { theNewRow = control.addRow( subValue ); control.initColorPicker(); control.initSelect( theNewRow, subValue ); } ); } // Once we have displayed the rows, we cleanup the values this.setValue( settingValue, true, true ); this.repeaterFieldsContainer.sortable( { handle: '.repeater-row-header', update: function() { control.sort(); } } ); }, /** * Open the media modal. */ openFrame: function( event ) { 'use strict'; if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) { return; } if ( this.$thisButton.closest( '.repeater-field' ).hasClass( 'repeater-field-cropped_image' ) ) { this.initCropperFrame(); } else { this.initFrame(); } this.frame.open(); }, initFrame: function() { 'use strict'; var libMediaType = this.getMimeType(); this.frame = wp.media( { states: [ new wp.media.controller.Library( { library: wp.media.query( { type: libMediaType } ), multiple: false, date: false } ) ] } ); // When a file is selected, run a callback. this.frame.on( 'select', this.onSelect, this ); }, /** * Create a media modal select frame, and store it so the instance can be reused when needed. * This is mostly a copy/paste of Core api.CroppedImageControl in /wp-admin/js/customize-control.js */ initCropperFrame: function() { 'use strict'; // We get the field id from which this was called var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' ), attrs = [ 'width', 'height', 'flex_width', 'flex_height' ], // A list of attributes to look for libMediaType = this.getMimeType(); // Make sure we got it if ( _.isString( currentFieldId ) && '' !== currentFieldId ) { // Make fields is defined and only do the hack for cropped_image if ( _.isObject( this.params.fields[ currentFieldId ] ) && 'cropped_image' === this.params.fields[ currentFieldId ].type ) { //Iterate over the list of attributes attrs.forEach( function( el ) { // If the attribute exists in the field if ( ! _.isUndefined( this.params.fields[ currentFieldId ][ el ] ) ) { // Set the attribute in the main object this.params[ el ] = this.params.fields[ currentFieldId ][ el ]; } }.bind( this ) ); } } this.frame = wp.media( { button: { text: 'Select and Crop', close: false }, states: [ new wp.media.controller.Library( { library: wp.media.query( { type: libMediaType } ), multiple: false, date: false, suggestedWidth: this.params.width, suggestedHeight: this.params.height } ), new wp.media.controller.CustomizeImageCropper( { imgSelectOptions: this.calculateImageSelectOptions, control: this } ) ] } ); this.frame.on( 'select', this.onSelectForCrop, this ); this.frame.on( 'cropped', this.onCropped, this ); this.frame.on( 'skippedcrop', this.onSkippedCrop, this ); }, onSelect: function() { 'use strict'; var attachment = this.frame.state().get( 'selection' ).first().toJSON(); if ( this.$thisButton.closest( '.repeater-field' ).hasClass( 'repeater-field-upload' ) ) { this.setFileInRepeaterField( attachment ); } else { this.setImageInRepeaterField( attachment ); } }, /** * After an image is selected in the media modal, switch to the cropper * state if the image isn't the right size. */ onSelectForCrop: function() { 'use strict'; var attachment = this.frame.state().get( 'selection' ).first().toJSON(); if ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) { this.setImageInRepeaterField( attachment ); } else { this.frame.setState( 'cropper' ); } }, /** * After the image has been cropped, apply the cropped image data to the setting. * * @param {object} croppedImage Cropped attachment data. */ onCropped: function( croppedImage ) { 'use strict'; this.setImageInRepeaterField( croppedImage ); }, /** * Returns a set of options, computed from the attached image data and * control-specific data, to be fed to the imgAreaSelect plugin in * wp.media.view.Cropper. * * @param {wp.media.model.Attachment} attachment * @param {wp.media.controller.Cropper} controller * @returns {Object} Options */ calculateImageSelectOptions: function( attachment, controller ) { 'use strict'; var control = controller.get( 'control' ), flexWidth = !! parseInt( control.params.flex_width, 10 ), flexHeight = !! parseInt( control.params.flex_height, 10 ), realWidth = attachment.get( 'width' ), realHeight = attachment.get( 'height' ), xInit = parseInt( control.params.width, 10 ), yInit = parseInt( control.params.height, 10 ), ratio = xInit / yInit, xImg = realWidth, yImg = realHeight, x1, y1, imgSelectOptions; controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) ); if ( xImg / yImg > ratio ) { yInit = yImg; xInit = yInit * ratio; } else { xInit = xImg; yInit = xInit / ratio; } x1 = ( xImg - xInit ) / 2; y1 = ( yImg - yInit ) / 2; imgSelectOptions = { handles: true, keys: true, instance: true, persistent: true, imageWidth: realWidth, imageHeight: realHeight, x1: x1, y1: y1, x2: xInit + x1, y2: yInit + y1 }; if ( false === flexHeight && false === flexWidth ) { imgSelectOptions.aspectRatio = xInit + ':' + yInit; } if ( false === flexHeight ) { imgSelectOptions.maxHeight = yInit; } if ( false === flexWidth ) { imgSelectOptions.maxWidth = xInit; } return imgSelectOptions; }, /** * Return whether the image must be cropped, based on required dimensions. * * @param {bool} flexW * @param {bool} flexH * @param {int} dstW * @param {int} dstH * @param {int} imgW * @param {int} imgH * @return {bool} */ mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) { 'use strict'; if ( ( true === flexW && true === flexH ) || ( true === flexW && dstH === imgH ) || ( true === flexH && dstW === imgW ) || ( dstW === imgW && dstH === imgH ) || ( imgW <= dstW ) ) { return false; } return true; }, /** * If cropping was skipped, apply the image data directly to the setting. */ onSkippedCrop: function() { 'use strict'; var attachment = this.frame.state().get( 'selection' ).first().toJSON(); this.setImageInRepeaterField( attachment ); }, /** * Updates the setting and re-renders the control UI. * * @param {object} attachment */ setImageInRepeaterField: function( attachment ) { 'use strict'; var $targetDiv = this.$thisButton.closest( '.repeater-field-image,.repeater-field-cropped_image' ); $targetDiv.find( '.kirki-image-attachment' ).html( '' ).hide().slideDown( 'slow' ); $targetDiv.find( '.hidden-field' ).val( attachment.id ); this.$thisButton.text( this.$thisButton.data( 'alt-label' ) ); $targetDiv.find( '.remove-button' ).show(); //This will activate the save button $targetDiv.find( 'input, textarea, select' ).trigger( 'change' ); this.frame.close(); }, /** * Updates the setting and re-renders the control UI. * * @param {object} attachment */ setFileInRepeaterField: function( attachment ) { 'use strict'; var $targetDiv = this.$thisButton.closest( '.repeater-field-upload' ); $targetDiv.find( '.kirki-file-attachment' ).html( ' ' + attachment.filename + '' ).hide().slideDown( 'slow' ); $targetDiv.find( '.hidden-field' ).val( attachment.id ); this.$thisButton.text( this.$thisButton.data( 'alt-label' ) ); $targetDiv.find( '.upload-button' ).show(); $targetDiv.find( '.remove-button' ).show(); //This will activate the save button $targetDiv.find( 'input, textarea, select' ).trigger( 'change' ); this.frame.close(); }, getMimeType: function() { 'use strict'; // We get the field id from which this was called var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' ); // Make sure we got it if ( _.isString( currentFieldId ) && '' !== currentFieldId ) { // Make fields is defined and only do the hack for cropped_image if ( _.isObject( this.params.fields[ currentFieldId ] ) && 'upload' === this.params.fields[ currentFieldId ].type ) { // If the attribute exists in the field if ( ! _.isUndefined( this.params.fields[ currentFieldId ].mime_type ) ) { // Set the attribute in the main object return this.params.fields[ currentFieldId ].mime_type; } } } return 'image'; }, removeImage: function( event ) { 'use strict'; var $targetDiv, $uploadButton; if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) { return; } $targetDiv = this.$thisButton.closest( '.repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload' ); $uploadButton = $targetDiv.find( '.upload-button' ); $targetDiv.find( '.kirki-image-attachment' ).slideUp( 'fast', function() { jQuery( this ).show().html( jQuery( this ).data( 'placeholder' ) ); } ); $targetDiv.find( '.hidden-field' ).val( '' ); $uploadButton.text( $uploadButton.data( 'label' ) ); this.$thisButton.hide(); $targetDiv.find( 'input, textarea, select' ).trigger( 'change' ); }, removeFile: function( event ) { 'use strict'; var $targetDiv, $uploadButton; if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) { return; } $targetDiv = this.$thisButton.closest( '.repeater-field-upload' ); $uploadButton = $targetDiv.find( '.upload-button' ); $targetDiv.find( '.kirki-file-attachment' ).slideUp( 'fast', function() { jQuery( this ).show().html( jQuery( this ).data( 'placeholder' ) ); } ); $targetDiv.find( '.hidden-field' ).val( '' ); $uploadButton.text( $uploadButton.data( 'label' ) ); this.$thisButton.hide(); $targetDiv.find( 'input, textarea, select' ).trigger( 'change' ); }, /** * Get the current value of the setting * * @return Object */ getValue: function() { 'use strict'; // The setting is saved in JSON return JSON.parse( decodeURI( this.setting.get() ) ); }, /** * Set a new value for the setting * * @param newValue Object * @param refresh If we want to refresh the previewer or not */ setValue: function( newValue, refresh, filtering ) { 'use strict'; // We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB var filteredValue = newValue, filter = []; if ( filtering ) { jQuery.each( this.params.fields, function( index, value ) { if ( 'image' === value.type || 'cropped_image' === value.type || 'upload' === value.type ) { filter.push( index ); } } ); jQuery.each( newValue, function( index, value ) { jQuery.each( filter, function( ind, field ) { if ( ! _.isUndefined( value[ field ] ) && ! _.isUndefined( value[ field ].id ) ) { filteredValue[index][ field ] = value[ field ].id; } } ); } ); } this.setting.set( encodeURI( JSON.stringify( filteredValue ) ) ); if ( refresh ) { // Trigger the change event on the hidden field so // previewer refresh the website on Customizer this.settingField.trigger( 'change' ); } }, /** * Add a new row to repeater settings based on the structure. * * @param data (Optional) Object of field => value pairs (undefined if you want to get the default values) */ addRow: function( data ) { 'use strict'; var control = this, template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ). settingValue = this.getValue(), // Get the current setting value. newRowSetting = {}, // Saves the new setting data. templateData, // Data to pass to the template newRow, i; if ( template ) { // The control structure is going to define the new fields // We need to clone control.params.fields. Assigning it // ould result in a reference assignment. templateData = jQuery.extend( true, {}, control.params.fields ); // But if we have passed data, we'll use the data values instead if ( data ) { for ( i in data ) { if ( data.hasOwnProperty( i ) && templateData.hasOwnProperty( i ) ) { templateData[ i ].default = data[ i ]; } } } templateData.index = this.currentIndex; // Append the template content template = template( templateData ); // Create a new row object and append the element newRow = new RepeaterRow( control.currentIndex, jQuery( template ).appendTo( control.repeaterFieldsContainer ), control.params.row_label, control ); newRow.container.on( 'row:remove', function( e, rowIndex ) { control.deleteRow( rowIndex ); } ); newRow.container.on( 'row:update', function( e, rowIndex, fieldName, element ) { control.updateField.call( control, e, rowIndex, fieldName, element ); newRow.updateLabel(); } ); // Add the row to rows collection this.rows[ this.currentIndex ] = newRow; for ( i in templateData ) { if ( templateData.hasOwnProperty( i ) ) { newRowSetting[ i ] = templateData[ i ].default; } } settingValue[ this.currentIndex ] = newRowSetting; this.setValue( settingValue, true ); this.currentIndex++; return newRow; } }, sort: function() { 'use strict'; var control = this, $rows = this.repeaterFieldsContainer.find( '.repeater-row' ), newOrder = [], settings = control.getValue(), newRows = [], newSettings = []; $rows.each( function( i, element ) { newOrder.push( jQuery( element ).data( 'row' ) ); } ); jQuery.each( newOrder, function( newPosition, oldPosition ) { newRows[ newPosition ] = control.rows[ oldPosition ]; newRows[ newPosition ].setRowIndex( newPosition ); newSettings[ newPosition ] = settings[ oldPosition ]; } ); control.rows = newRows; control.setValue( newSettings ); }, /** * Delete a row in the repeater setting * * @param index Position of the row in the complete Setting Array */ deleteRow: function( index ) { 'use strict'; var currentSettings = this.getValue(), row, i, prop; if ( currentSettings[ index ] ) { // Find the row row = this.rows[ index ]; if ( row ) { // Remove the row settings delete currentSettings[ index ]; // Remove the row from the rows collection delete this.rows[ index ]; // Update the new setting values this.setValue( currentSettings, true ); } } // Remap the row numbers i = 1; for ( prop in this.rows ) { if ( this.rows.hasOwnProperty( prop ) && this.rows[ prop ] ) { this.rows[ prop ].updateLabel(); i++; } } }, /** * Update a single field inside a row. * Triggered when a field has changed * * @param e Event Object */ updateField: function( e, rowIndex, fieldId, element ) { 'use strict'; var type, row, currentSettings; if ( ! this.rows[ rowIndex ] ) { return; } if ( ! this.params.fields[ fieldId ] ) { return; } type = this.params.fields[ fieldId].type; row = this.rows[ rowIndex ]; currentSettings = this.getValue(); element = jQuery( element ); if ( _.isUndefined( currentSettings[ row.rowIndex ][ fieldId ] ) ) { return; } if ( 'checkbox' === type ) { currentSettings[ row.rowIndex ][ fieldId ] = element.is( ':checked' ); } else { // Update the settings currentSettings[ row.rowIndex ][ fieldId ] = element.val(); } this.setValue( currentSettings, true ); }, /** * Init the color picker on color fields * Called after AddRow * */ initColorPicker: function() { 'use strict'; var control = this, colorPicker = control.container.find( '.color-picker-hex' ), options = {}, fieldId = colorPicker.data( 'field' ); // We check if the color palette parameter is defined. if ( ! _.isUndefined( fieldId ) && ! _.isUndefined( control.params.fields[ fieldId ] ) && ! _.isUndefined( control.params.fields[ fieldId ].palettes ) && _.isObject( control.params.fields[ fieldId ].palettes ) ) { options.palettes = control.params.fields[ fieldId ].palettes; } // When the color picker value is changed we update the value of the field options.change = function( event, ui ) { var currentPicker = jQuery( event.target ), row = currentPicker.closest( '.repeater-row' ), rowIndex = row.data( 'row' ), currentSettings = control.getValue(); currentSettings[ rowIndex ][ currentPicker.data( 'field' ) ] = ui.color.toString(); control.setValue( currentSettings, true ); }; // Init the color picker if ( 0 !== colorPicker.length ) { colorPicker.wpColorPicker( options ); } }, /** * Init the dropdown-pages field with selectWoo * Called after AddRow * * @param {object} theNewRow the row that was added to the repeater * @param {object} data the data for the row if we're initializing a pre-existing row * */ initSelect: function( theNewRow, data ) { 'use strict'; var control = this, dropdown = theNewRow.container.find( '.repeater-field select' ), $select, dataField, multiple, selectWooOptions = {}; if ( 0 === dropdown.length ) { return; } dataField = dropdown.data( 'field' ); multiple = jQuery( dropdown ).data( 'multiple' ); if ( 'undefed' !== multiple && jQuery.isNumeric( multiple ) ) { multiple = parseInt( multiple, 10 ); if ( 1 < multiple ) { selectWooOptions.maximumSelectionLength = multiple; } } data = data || {}; data[ dataField ] = data[ dataField ] || ''; $select = jQuery( dropdown ).selectWoo( selectWooOptions ).val( data[ dataField ] || jQuery( dropdown ).val() ); this.container.on( 'change', '.repeater-field select', function( event ) { var currentDropdown = jQuery( event.target ), row = currentDropdown.closest( '.repeater-row' ), rowIndex = row.data( 'row' ), currentSettings = control.getValue(); currentSettings[ rowIndex ][ currentDropdown.data( 'field' ) ] = jQuery( this ).val(); control.setValue( currentSettings ); } ); } } ); wp.customize.controlConstructor['kirki-slider'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, changeAction = ( 'postMessage' === control.setting.transport ) ? 'mousemove change' : 'change', rangeInput = control.container.find( 'input[type="range"]' ), textInput = control.container.find( 'input[type="text"]' ), value = control.setting._value; // Set the initial value in the text input. textInput.attr( 'value', value ); // If the range input value changes copy the value to the text input. rangeInput.on( 'mousemove change', function() { textInput.attr( 'value', rangeInput.val() ); } ); // Save the value when the range input value changes. // This is separate from the above because of the postMessage differences. // If the control refreshes the preview pane, // we don't want a refresh for every change // but 1 final refresh when the value is changed. rangeInput.on( changeAction, function() { control.setting.set( rangeInput.val() ); } ); // If the text input value changes, // copy the value to the range input // and then save. textInput.on( 'input paste change', function() { rangeInput.attr( 'value', textInput.val() ); control.setting.set( textInput.val() ); } ); // If the reset button is clicked, // set slider and text input values to default // and hen save. control.container.find( '.slider-reset' ).on( 'click', function() { textInput.attr( 'value', control.params.default ); rangeInput.attr( 'value', control.params.default ); control.setting.set( textInput.val() ); } ); } } ); /* global kirkiControlLoader */ wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend( { // When we're finished loading continue processing ready: function() { 'use strict'; var control = this; // Init the control. if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) { kirkiControlLoader( control ); } else { control.initKirkiControl(); } }, initKirkiControl: function() { 'use strict'; var control = this; control.container.find( '.kirki-controls-loading-spinner' ).hide(); // Set the sortable container. control.sortableContainer = control.container.find( 'ul.sortable' ).first(); // Init sortable. control.sortableContainer.sortable( { // Update value when we stop sorting. stop: function() { control.updateValue(); } } ).disableSelection().find( 'li' ).each( function() { // Enable/disable options when we click on the eye of Thundera. jQuery( this ).find( 'i.visibility' ).click( function() { jQuery( this ).toggleClass( 'dashicons-visibility-faint' ).parents( 'li:eq(0)' ).toggleClass( 'invisible' ); } ); } ).click( function() { // Update value on click. control.updateValue(); } ); }, /** * Updates the sorting list */ updateValue: function() { 'use strict'; var control = this, newValue = []; this.sortableContainer.find( 'li' ).each( function() { if ( ! jQuery( this ).is( '.invisible' ) ) { newValue.push( jQuery( this ).data( 'value' ) ); } } ); control.setting.set( newValue ); } } ); wp.customize.controlConstructor['kirki-switch'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { 'use strict'; var control = this, checkboxValue = control.setting._value; // Save the value this.container.on( 'change', 'input', function() { checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false; control.setting.set( checkboxValue ); } ); } } ); wp.customize.controlConstructor['kirki-toggle'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { var control = this, checkboxValue = control.setting._value; // Save the value this.container.on( 'change', 'input', function() { checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false; control.setting.set( checkboxValue ); } ); } } ); /* global kirkiL10n, kirki */ wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicControl.extend( { initKirkiControl: function() { 'use strict'; var control = this, value = control.setting._value, picker; control.renderFontSelector(); control.renderBackupFontSelector(); control.renderVariantSelector(); control.localFontsCheckbox(); // Font-size. if ( control.params.default['font-size'] ) { this.container.on( 'change keyup paste', '.font-size input', function() { control.saveValue( 'font-size', jQuery( this ).val() ); } ); } // Line-height. if ( control.params.default['line-height'] ) { this.container.on( 'change keyup paste', '.line-height input', function() { control.saveValue( 'line-height', jQuery( this ).val() ); } ); } // Margin-top. if ( control.params.default['margin-top'] ) { this.container.on( 'change keyup paste', '.margin-top input', function() { control.saveValue( 'margin-top', jQuery( this ).val() ); } ); } // Margin-bottom. if ( control.params.default['margin-bottom'] ) { this.container.on( 'change keyup paste', '.margin-bottom input', function() { control.saveValue( 'margin-bottom', jQuery( this ).val() ); } ); } // Letter-spacing. if ( control.params.default['letter-spacing'] ) { value['letter-spacing'] = ( jQuery.isNumeric( value['letter-spacing'] ) ) ? value['letter-spacing'] + 'px' : value['letter-spacing']; this.container.on( 'change keyup paste', '.letter-spacing input', function() { value['letter-spacing'] = ( jQuery.isNumeric( jQuery( this ).val() ) ) ? jQuery( this ).val() + 'px' : jQuery( this ).val(); control.saveValue( 'letter-spacing', value['letter-spacing'] ); } ); } // Word-spacing. if ( control.params.default['word-spacing'] ) { this.container.on( 'change keyup paste', '.word-spacing input', function() { control.saveValue( 'word-spacing', jQuery( this ).val() ); } ); } // Text-align. if ( control.params.default['text-align'] ) { this.container.on( 'change', '.text-align input', function() { control.saveValue( 'text-align', jQuery( this ).val() ); } ); } // Text-transform. if ( control.params.default['text-transform'] ) { jQuery( control.selector + ' .text-transform select' ).selectWoo().on( 'change', function() { control.saveValue( 'text-transform', jQuery( this ).val() ); } ); } // Text-decoration. if ( control.params.default['text-decoration'] ) { jQuery( control.selector + ' .text-decoration select' ).selectWoo().on( 'change', function() { control.saveValue( 'text-decoration', jQuery( this ).val() ); } ); } // Color. if ( ! _.isUndefined( control.params.default.color ) ) { picker = this.container.find( '.kirki-color-control' ); picker.wpColorPicker( { change: function() { setTimeout( function() { control.saveValue( 'color', picker.val() ); }, 100 ); } } ); } }, /** * Adds the font-families to the font-family dropdown * and instantiates selectWoo. */ renderFontSelector: function() { var control = this, selector = control.selector + ' .font-family select', data = [], standardFonts = [], googleFonts = [], value = control.setting._value, fonts = control.getFonts(), fontSelect, controlFontFamilies; // Format standard fonts as an array. if ( ! _.isUndefined( fonts.standard ) ) { _.each( fonts.standard, function( font ) { standardFonts.push( { id: font.family.replace( /"/g, ''' ), text: font.label } ); } ); } // Format google fonts as an array. if ( ! _.isUndefined( fonts.google ) ) { _.each( fonts.google, function( font ) { googleFonts.push( { id: font.family, text: font.family } ); } ); } // Do we have custom fonts? controlFontFamilies = {}; if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.fonts ) && ! _.isUndefined( control.params.choices.fonts.families ) ) { controlFontFamilies = control.params.choices.fonts.families; } // Combine forces and build the final data. data = jQuery.extend( {}, controlFontFamilies, { default: { text: kirkiL10n.defaultCSSValues, children: [ { id: '', text: kirkiL10n.defaultBrowserFamily }, { id: 'initial', text: 'initial' }, { id: 'inherit', text: 'inherit' } ] }, standard: { text: kirkiL10n.standardFonts, children: standardFonts }, google: { text: kirkiL10n.googleFonts, children: googleFonts } } ); if ( kirkiL10n.isScriptDebug ) { console.info( 'Kirki Debug: Font families for control "' + control.id + '":' ); console.info( data ); } data = _.values( data ); // Instantiate selectWoo with the data. fontSelect = jQuery( selector ).selectWoo( { data: data } ); // Set the initial value. if ( value['font-family'] ) { fontSelect.val( value['font-family'].replace( /'/g, '"' ) ).trigger( 'change' ); } // When the value changes fontSelect.on( 'change', function() { // Set the value. control.saveValue( 'font-family', jQuery( this ).val() ); // Re-init the font-backup selector. control.renderBackupFontSelector(); // Re-init variants selector. control.renderVariantSelector(); } ); }, /** * Adds the font-families to the font-family dropdown * and instantiates selectWoo. */ renderBackupFontSelector: function() { var control = this, selector = control.selector + ' .font-backup select', standardFonts = [], value = control.setting._value, fontFamily = value['font-family'], fonts = control.getFonts(), fontSelect; if ( _.isUndefined( value['font-backup'] ) || null === value['font-backup'] ) { value['font-backup'] = ''; } // Hide if we're not on a google-font. if ( 'inherit' === fontFamily || 'initial' === fontFamily || 'google' !== kirki.util.webfonts.getFontType( fontFamily ) ) { jQuery( control.selector + ' .font-backup' ).hide(); return; } jQuery( control.selector + ' .font-backup' ).show(); // Format standard fonts as an array. if ( ! _.isUndefined( fonts.standard ) ) { _.each( fonts.standard, function( font ) { standardFonts.push( { id: font.family.replace( /"/g, ''' ), text: font.label } ); } ); } // Instantiate selectWoo with the data. fontSelect = jQuery( selector ).selectWoo( { data: standardFonts } ); // Set the initial value. if ( 'undefined' !== typeof value['font-backup'] ) { fontSelect.val( value['font-backup'].replace( /'/g, '"' ) ).trigger( 'change' ); } // When the value changes fontSelect.on( 'change', function() { // Set the value. control.saveValue( 'font-backup', jQuery( this ).val() ); } ); }, /** * Renders the variants selector using selectWoo * Displays font-variants for the currently selected font-family. */ renderVariantSelector: function() { var control = this, value = control.setting._value, fontFamily = value['font-family'], selector = control.selector + ' .variant select', data = [], isValid = false, fontType = kirki.util.webfonts.getFontType( fontFamily ), variants = [ '', 'regular', 'italic', '700', '700italic' ], fontWeight, variantSelector, fontStyle; if ( 'google' === fontType ) { variants = kirki.util.webfonts.google.getVariants( fontFamily ); } // Check if we've got custom variants defined for this font. if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.fonts ) && ! _.isUndefined( control.params.choices.fonts.variants ) ) { // Check if we have variants for this font-family. if ( ! _.isUndefined( control.params.choices.fonts.variants[ fontFamily ] ) ) { variants = control.params.choices.fonts.variants[ fontFamily ]; } } if ( kirkiL10n.isScriptDebug ) { console.info( 'Kirki Debug: Font variants for font-family "' + fontFamily + '":' ); console.info( variants ); } if ( 'inherit' === fontFamily || 'initial' === fontFamily || '' === fontFamily ) { value.variant = 'inherit'; variants = [ '' ]; jQuery( control.selector + ' .variant' ).hide(); } if ( 1 >= variants.length ) { jQuery( control.selector + ' .variant' ).hide(); value.variant = variants[0]; control.saveValue( 'variant', value.variant ); if ( '' === value.variant || ! value.variant ) { fontWeight = ''; fontStyle = ''; } else { fontWeight = ( ! _.isString( value.variant ) ) ? '400' : value.variant.match( /\d/g ); fontWeight = ( ! _.isObject( fontWeight ) ) ? '400' : fontWeight.join( '' ); fontStyle = ( -1 !== value.variant.indexOf( 'italic' ) ) ? 'italic' : 'normal'; } control.saveValue( 'font-weight', fontWeight ); control.saveValue( 'font-style', fontStyle ); return; } jQuery( control.selector + ' .font-backup' ).show(); jQuery( control.selector + ' .variant' ).show(); _.each( variants, function( variant ) { if ( value.variant === variant ) { isValid = true; } data.push( { id: variant, text: variant } ); } ); if ( ! isValid ) { value.variant = 'regular'; } if ( jQuery( selector ).hasClass( 'select2-hidden-accessible' ) ) { jQuery( selector ).selectWoo( 'destroy' ); jQuery( selector ).empty(); } // Instantiate selectWoo with the data. variantSelector = jQuery( selector ).selectWoo( { data: data } ); variantSelector.val( value.variant ).trigger( 'change' ); variantSelector.on( 'change', function() { control.saveValue( 'variant', jQuery( this ).val() ); if ( 'string' !== typeof value.variant ) { value.variant = variants[0]; } fontWeight = ( ! _.isString( value.variant ) ) ? '400' : value.variant.match( /\d/g ); fontWeight = ( ! _.isObject( fontWeight ) ) ? '400' : fontWeight.join( '' ); fontStyle = ( -1 !== value.variant.indexOf( 'italic' ) ) ? 'italic' : 'normal'; control.saveValue( 'font-weight', fontWeight ); control.saveValue( 'font-style', fontStyle ); } ); }, /** * Get fonts. */ getFonts: function() { var control = this, initialGoogleFonts = kirki.util.webfonts.google.getFonts(), googleFonts = {}, googleFontsSort = 'alpha', googleFontsNumber = 0, standardFonts = {}; // Get google fonts. if ( ! _.isEmpty( control.params.choices.fonts.google ) ) { if ( 'alpha' === control.params.choices.fonts.google[0] || 'popularity' === control.params.choices.fonts.google[0] || 'trending' === control.params.choices.fonts.google[0] ) { googleFontsSort = control.params.choices.fonts.google[0]; if ( ! isNaN( control.params.choices.fonts.google[1] ) ) { googleFontsNumber = parseInt( control.params.choices.fonts.google[1], 10 ); } googleFonts = kirki.util.webfonts.google.getFonts( googleFontsSort, '', googleFontsNumber ); } else { _.each( control.params.choices.fonts.google, function( fontName ) { if ( 'undefined' !== typeof initialGoogleFonts[ fontName ] && ! _.isEmpty( initialGoogleFonts[ fontName ] ) ) { googleFonts[ fontName ] = initialGoogleFonts[ fontName ]; } } ); } } else { googleFonts = kirki.util.webfonts.google.getFonts( googleFontsSort, '', googleFontsNumber ); } // Get standard fonts. if ( ! _.isEmpty( control.params.choices.fonts.standard ) ) { _.each( control.params.choices.fonts.standard, function( fontName ) { if ( 'undefined' !== typeof kirki.util.webfonts.standard.fonts[ fontName ] && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ] ) ) { standardFonts[ fontName ] = {}; if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].stack && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].stack ) ) { standardFonts[ fontName ].family = kirki.util.webfonts.standard.fonts[ fontName ].stack; } else { standardFonts[ fontName ].family = googleFonts[ fontName ]; } if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].label && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].label ) ) { standardFonts[ fontName ].label = kirki.util.webfonts.standard.fonts[ fontName ].label; } else if ( ! _.isEmpty( standardFonts[ fontName ] ) ) { standardFonts[ fontName ].label = standardFonts[ fontName ]; } } else { standardFonts[ fontName ] = { family: fontName, label: fontName }; } } ); } else { _.each( kirki.util.webfonts.standard.fonts, function( font, id ) { standardFonts[ id ] = { family: font.stack, label: font.label }; } ); } return { google: googleFonts, standard: standardFonts }; }, localFontsCheckbox: function() { var control = this, checkboxContainer = control.container.find( '.kirki-host-font-locally' ), checkbox = control.container.find( '.kirki-host-font-locally input' ), checked = jQuery( checkbox ).is( ':checked' ); if ( control.setting._value && control.setting._value.downloadFont ) { jQuery( checkbox ).attr( 'checked', 'checked' ); } jQuery( checkbox ).on( 'change', function() { checked = jQuery( checkbox ).is( ':checked' ); control.saveValue( 'downloadFont', checked ); } ); }, /** * Saves the value. */ saveValue: function( property, value ) { var control = this, input = control.container.find( '.typography-hidden-value' ), val = control.setting._value; val[ property ] = value; jQuery( input ).attr( 'value', JSON.stringify( val ) ).trigger( 'change' ); control.setting.set( val ); } } ); kirki/controls/js/script.min.js000064400000133416151232236240012570 0ustar00if(_.isUndefined(window.kirkiSetSettingValue))var kirkiSetSettingValue={set:function(i,n){var e,a=this,t=wp.customize.settings.controls[i];if(_.isUndefined(t))return!0;switch(a.setValue(i,n),t.type){case"kirki-background":_.isUndefined(n["background-color"])||a.setColorPicker(a.findElement(i,".kirki-color-control"),n["background-color"]),a.findElement(i,".placeholder, .thumbnail").removeClass().addClass("placeholder").html("No file selected"),_.each(["background-repeat","background-position"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["background-size","background-attachment"],function(e){jQuery(a.findElement(i,"."+e+' input[value="'+n+'"]')).prop("checked",!0)}),e=JSON.stringify(n).replace(/'/g,"'"),jQuery(a.findElement(i,".background-hidden-value").attr("value",e)).trigger("change");break;case"kirki-code":jQuery(a.findElement(i,".CodeMirror"))[0].CodeMirror.setValue(n);break;case"checkbox":case"kirki-switch":case"kirki-toggle":n=1===n||"1"===n||!0===n,jQuery(a.findElement(i,"input")).prop("checked",n),wp.customize.instance(i).set(n);break;case"kirki-select":case"kirki-fontawesome":a.setSelectWoo(a.findElement(i,"select"),n);break;case"kirki-slider":jQuery(a.findElement(i,"input")).prop("value",n),jQuery(a.findElement(i,".kirki_range_value .value")).html(n);break;case"kirki-generic":(_.isUndefined(t.choices)||_.isUndefined(t.choices.element))&&(t.choices.element="input"),jQuery(a.findElement(i,t.choices.element)).prop("value",n);break;case"kirki-color":a.setColorPicker(a.findElement(i,".kirki-color-control"),n);break;case"kirki-multicheck":a.findElement(i,"input").each(function(){jQuery(this).prop("checked",!1)}),_.each(n,function(e,t){jQuery(a.findElement(i,'input[value="'+n[t]+'"]')).prop("checked",!0)});break;case"kirki-multicolor":_.each(n,function(e,t){a.setColorPicker(a.findElement(i,".multicolor-index-"+t),e)});break;case"kirki-radio-buttonset":case"kirki-radio-image":case"kirki-radio":case"kirki-dashicons":case"kirki-color-palette":case"kirki-palette":jQuery(a.findElement(i,'input[value="'+n+'"]')).prop("checked",!0);break;case"kirki-typography":_.each(["font-family","variant"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["font-size","line-height","letter-spacing","word-spacing"],function(e){_.isUndefined(n[e])||jQuery(a.findElement(i,"."+e+" input")).prop("value",n[e])}),_.isUndefined(n.color)||a.setColorPicker(a.findElement(i,".kirki-color-control"),n.color),e=JSON.stringify(n).replace(/'/g,"'"),jQuery(a.findElement(i,".typography-hidden-value").attr("value",e)).trigger("change");break;case"kirki-dimensions":_.each(n,function(e,t){jQuery(a.findElement(i,"."+t+" input")).prop("value",e)});break;case"kirki-repeater":case"kirki-custom":break;default:jQuery(a.findElement(i,"input")).prop("value",n)}},setColorPicker:function(e,t){e.attr("data-default-color",t).data("default-color",t).wpColorPicker("color",t)},setSelectWoo:function(e,t){jQuery(e).selectWoo().val(t).trigger("change")},setTextarea:function(e,t){jQuery(e).prop("value",t)},findElement:function(e,t){return wp.customize.control(e).container.find(t)},setValue:function(e,t,i){i=_.isUndefined(i)?100:parseInt(i,10),wp.customize.instance(e).set({}),setTimeout(function(){wp.customize.instance(e).set(t)},i)}};(kirki={initialized:!1,initialize:function(){this.initialized||(setTimeout(function(){kirki.util.webfonts.standard.initialize(),kirki.util.webfonts.google.initialize()},150),this.initialized=!0)}}).initialize();var kirki=kirki||{};kirki=(kirki=jQuery.extend(kirki,{control:{"kirki-radio":{init:function(e){this.template(e),kirki.input.radio.init(e)},template:function(e){var t=wp.template("kirki-input-radio");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,default:e.params.default,value:kirki.setting.get(e.id),choices:e.params.choices}))}},"kirki-color":{init:function(e){this.template(e),kirki.input.color.init(e)},template:function(e){var t=wp.template("kirki-input-color");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,mode:e.params.mode,inputAttrs:e.params.inputAttrs,"data-palette":e.params.palette,"data-default-color":e.params.default,"data-alpha":e.params.choices.alpha,value:kirki.setting.get(e.id)}))}},"kirki-generic":{init:function(e){this.template(e),_.isUndefined(e.params)||_.isUndefined(e.params.choices)||_.isUndefined(e.params.choices.element)||"textarea"!==e.params.choices.element?kirki.input.genericInput.init(e):kirki.input.textarea.init(e)},template:function(e){var t,i={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)};if(!_.isUndefined(e.params)&&!_.isUndefined(e.params.choices)&&!_.isUndefined(e.params.choices.element)&&"textarea"===e.params.choices.element)return t=wp.template("kirki-input-textarea"),void e.container.html(t(i));t=wp.template("kirki-input-generic"),e.container.html(t(i))}},"kirki-number":{init:function(e){this.template(e),kirki.input.number.init(e)},template:function(e){var t=wp.template("kirki-input-number");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-select":{init:function(e){this.template(e),kirki.input.select.init(e)},template:function(e){var t=wp.template("kirki-input-select");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id),multiple:e.params.multiple||1,placeholder:e.params.placeholder}))}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{input:{radio:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},color:{init:function(e){var t,i=jQuery('.kirki-color-control[data-id="'+e.id+'"]');e.choices=e.choices||{},_.isEmpty(e.choices)&&e.params.choices&&(e.choices=e.params.choices),_.isEmpty(e.choices)||i.wpColorPicker(e.choices),setTimeout(function(){(t=jQuery('.kirki-input-container[data-id="'+e.id+'"] .wp-picker-clear')).length&&t.click(function(){kirki.setting.set(e.id,"")})},200),i.wpColorPicker({change:function(){setTimeout(function(){kirki.setting.set(e.id,i.val())},20)}})}},genericInput:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},textarea:{init:function(e){jQuery('textarea[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},select:{init:function(e){var t,i=jQuery('select[data-id="'+e.id+'"]'),n=parseInt(i.data("multiple"),10),a={escapeMarkup:function(e){return e}};e.params.placeholder&&(a.placeholder=e.params.placeholder,a.allowClear=!0),1=i.params.choices.max?t:t+i.params.choices.step,n.val(e),n.trigger("change")}),t.click(function(){var e,t=parseFloat(n.val());e=t<=i.params.choices.min?t:t-i.params.choices.step,n.val(e),n.trigger("change")}),n.on("change keyup paste click",function(){kirki.setting.set(i.id,jQuery(this).val())})}},image:{getTemplate:function(e){var t,i="";return e=_.defaults(e,{label:"",description:"",inputAttrs:"","data-id":"",choices:{},value:""}),_.isUndefined(e.choices)||_.isUndefined(e.choices.save_as)||e.choices.save_as,t=e.value,_.isObject(e.value)&&!_.isUndefined(e.value.url)&&(t=e.value.url),i+="",i+='
                              ',e.value.url||""!==t?i+='
                              ':i+='
                              '+kirkiL10n.noFileSelected+"
                              ",i+='
                              ',i+='",e.default&&""!==e.default&&(i+='",i+="
                              ",'
                              '+i+"
                              "},init:function(e){}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{setting:{get:function(e){var t=e.split("["),i="",n=0,a="";return _.each(t,function(e,t){e=e.replace("]",""),0===t?i=e:i+="["+e+"]",_.isUndefined(wp.customize.instance(i))||(a=wp.customize.instance(i).get(),n=t),n"),i.params.content.attr("id","customize-control-"+e.replace(/]/g,"").replace(/\[/g,"-")),i.params.content.attr("class","customize-control customize-control-"+i.params.type)),this.propertyElements=[],wp.customize.Control.prototype.initialize.call(this,e,i)},_setUpSettingRootLinks:function(){var n=this;n.container.find("[data-customize-setting-link]").each(function(){var i=jQuery(this);wp.customize(i.data("customizeSettingLink"),function(e){var t=new wp.customize.Element(i);n.elements.push(t),t.sync(e),t.set(e())})})},_setUpSettingPropertyLinks:function(){var n=this;n.setting&&n.container.find("[data-customize-setting-property-link]").each(function(){var t,e=jQuery(this),i=e.data("customizeSettingPropertyLink");t=new wp.customize.Element(e),n.propertyElements.push(t),t.set(n.setting()[i]),t.bind(function(e){var t=n.setting();e!==t[i]&&((t=_.clone(t))[i]=e,n.setting.set(t))}),n.setting.bind(function(e){e[i]!==t.get()&&t.set(e[i])})})},ready:function(){var e=this;e._setUpSettingRootLinks(),e._setUpSettingPropertyLinks(),wp.customize.Control.prototype.ready.call(e),e.deferred.embedded.done(function(){e.initKirkiControl(e)})},embed:function(){var t=this,e=t.section();e&&wp.customize.section(e,function(e){"kirki-expanded"===e.params.type||e.expanded()||wp.customize.settings.autofocus.control===t.id?t.actuallyEmbed():e.expanded.bind(function(e){e&&t.actuallyEmbed()})})},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},focus:function(e){this.actuallyEmbed(),wp.customize.Control.prototype.focus.call(this,e)},initKirkiControl:function(e){void 0===kirki.control[e.params.type]?this.container.on("change keyup paste click","input",function(){e.setting.set(jQuery(this).val())}):kirki.control[e.params.type].init(e)}})}(),_.each(kirki.control,function(e,t){wp.customize.controlConstructor[t]=wp.customize.kirkiDynamicControl.extend({})}),wp.customize.controlConstructor["kirki-background"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){var o=this,e=o.setting._value,t=o.container.find(".kirki-color-control");(_.isUndefined(e["background-image"])||""===e["background-image"])&&(o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide()),t.wpColorPicker({change:function(){setTimeout(function(){o.saveValue("background-color",t.val())},100)}}),o.container.on("change",".background-repeat select",function(){o.saveValue("background-repeat",jQuery(this).val())}),o.container.on("change click",".background-size input",function(){o.saveValue("background-size",jQuery(this).val())}),o.container.on("change",".background-position select",function(){o.saveValue("background-position",jQuery(this).val())}),o.container.on("change click",".background-attachment input",function(){o.saveValue("background-attachment",jQuery(this).val())}),o.container.on("click",".background-image-upload-button",function(e){var r=wp.media({multiple:!1}).open().on("select",function(){var e,t,i,n=r.state().get("selection").first(),a=n.toJSON().sizes.full.url;_.isUndefined(n.toJSON().sizes.medium)?_.isUndefined(n.toJSON().sizes.thumbnail)||(a=n.toJSON().sizes.thumbnail.url):a=n.toJSON().sizes.medium.url,e=n.toJSON().sizes.full.url,n.toJSON().id,n.toJSON().width,n.toJSON().height,""!==e&&o.container.find(".background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment").show(),o.saveValue("background-image",e),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html(''),i.length&&i.show()});e.preventDefault()}),o.container.on("click",".background-image-upload-remove-button",function(e){var t,i;e.preventDefault(),o.saveValue("background-image",""),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide(),t.length&&t.removeClass().addClass("placeholder").html("No file selected"),i.length&&i.hide()})},saveValue:function(e,t){var i=jQuery("#customize-control-"+this.id.replace("[","-").replace("]","")+" .background-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}}),wp.customize.controlConstructor["kirki-color-palette"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-dashicons"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-date"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.selector+" input.datepicker";jQuery(t).datepicker({dateFormat:"yy-mm-dd"}),e.container.find(".kirki-controls-loading-spinner").hide(),this.container.on("change keyup paste","input.datepicker",function(){e.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["kirki-dimension"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this;t.kirkiNotifications(),this.container.on("change keyup paste","input",function(){e=jQuery(this).val(),t.setting.set(e)})},kirkiNotifications:function(){wp.customize(this.id,function(i){i.bind(function(e){var t="long_title";!1===kirki.util.validate.cssValue(e)?i.notifications.add(t,new wp.customize.Notification(t,{type:"warning",message:dimensionkirkiL10n["invalid-value"]})):i.notifications.remove(t)})})}}),wp.customize.controlConstructor["kirki-dimensions"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this.params.choices.controls,i={},n=[];for(_.each(t,function(e,t){!0===e&&n.push(t)}),e=0;e '+e.text},templateSelection:function(e){return' '+e.text}};_.each(a.icons,function(e){r.data.push({id:e.id,text:e.name})}),(t=jQuery(n).selectWoo(r)).on("change",function(){e=jQuery(this).val(),i.setting.set(e)}),t.val(i.setting._value).trigger("change")}}),wp.customize.controlConstructor["kirki-image"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){var a=this,t=a.getValue(),n=_.isUndefined(a.params.choices)||_.isUndefined(a.params.choices.save_as)?"url":a.params.choices.save_as,r=a.container.find(".placeholder, .thumbnail"),e="array"===n?t.url:t,o=a.container.find(".image-upload-remove-button"),s=a.container.find(".image-default-button");a.container.find(".kirki-controls-loading-spinner").hide(),"id"!==n&&"ID"!==n||""===t||wp.media.attachment(t).fetch().then(function(){setTimeout(function(){var e=wp.media.attachment(t).get("url");r.removeClass().addClass("thumbnail thumbnail-image").html('')},700)}),("url"===n&&""!==t||"array"===n&&!_.isUndefined(t.url)&&""!==t.url)&&a.container.find("image-default-button").hide(),("url"===n&&""===t||"array"===n&&(_.isUndefined(t.url)||""===t.url))&&o.hide(),t===a.params.default&&a.container.find("image-default-button").hide(),""!==e&&r.removeClass().addClass("thumbnail thumbnail-image").html(''),a.container.on("click",".image-upload-button",function(e){var i=wp.media({multiple:!1}).open().on("select",function(){var e=i.state().get("selection").first().toJSON(),t=e.url;_.isUndefined(e.sizes)||(previewImg=e.sizes.full.url,_.isUndefined(e.sizes.medium)?_.isUndefined(e.sizes.thumbnail)||(t=e.sizes.thumbnail.url):t=e.sizes.medium.url),"array"===n?(a.saveValue("id",e.id),a.saveValue("url",e.sizes.full.url),a.saveValue("width",e.width),a.saveValue("height",e.height)):"id"===n?a.saveValue("id",e.id):a.saveValue("url",_.isUndefined(e.sizes)?e.url:e.sizes.full.url),r.length&&r.removeClass().addClass("thumbnail thumbnail-image").html(''),o.length&&(o.show(),s.hide())});e.preventDefault()}),a.container.on("click",".image-upload-remove-button",function(e){var t,i,n;e.preventDefault(),a.saveValue("id",""),a.saveValue("url",""),a.saveValue("width",""),a.saveValue("height",""),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("placeholder").html("No file selected"),i.length&&(i.hide(),jQuery(n).hasClass("button")&&n.show())}),a.container.on("click",".image-default-button",function(e){var t,i,n;e.preventDefault(),a.saveValue("url",a.params.default),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html(''),i.length&&(i.show(),n.hide())})},getValue:function(){var e=this.setting._value;return"array"===(_.isUndefined(this.params.choices)||_.isUndefined(this.params.choices.save_as)?"url":this.params.choices.save_as)&&_.isString(e)&&(e={url:e}),e},saveValue:function(e,t){var i=this,n=i.setting._value;if("array"===(_.isUndefined(i.params.choices)||_.isUndefined(i.params.choices.save_as)?"url":i.params.choices.save_as))return _.isString(n)&&(n={}),n[e]=t,i.setting.set(n),void i.container.find("button").trigger("change");i.setting.set(t),i.container.find("button").trigger("change")}}),wp.customize.controlConstructor["kirki-multicheck"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var n=this;n.container.on("change","input",function(){var t=[],i=0;jQuery.each(n.params.choices,function(e){n.container.find('input[value="'+e+'"]').is(":checked")?(n.container.find('input[value="'+e+'"]').parent().addClass("checked"),t[i]=e,i++):n.container.find('input[value="'+e+'"]').parent().removeClass("checked")}),n.setting.set(t)})}}),wp.customize.controlConstructor["kirki-multicolor"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var r=this.params.choices,e=Object.keys(r),t=(this.params.value,0);function i(e,t,i){var n=e.container.find(".multicolor-index-"+i),a={change:function(){setTimeout(function(){e.saveValue(i,n.val()),e.container.find(".multicolor-index-"+i).trigger("change")},100)}};_.isObject(r.irisArgs)&&_.each(r.irisArgs,function(e,t){a[t]=e}),n.wpColorPicker(a)}for(;t/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return _.template(n.container.find(".customize-control-repeater-content").first().html(),null,t)(e)}}),e.length&&_.each(e,function(e){i=n.addRow(e),n.initColorPicker(),n.initSelect(i,e)}),this.setValue(e,!0,!0),this.repeaterFieldsContainer.sortable({handle:".repeater-row-header",update:function(){n.sort()}})},openFrame:function(e){"use strict";wp.customize.utils.isKeydownButNotEnterEvent(e)||(this.$thisButton.closest(".repeater-field").hasClass("repeater-field-cropped_image")?this.initCropperFrame():this.initFrame(),this.frame.open())},initFrame:function(){"use strict";var e=this.getMimeType();this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1})]}),this.frame.on("select",this.onSelect,this)},initCropperFrame:function(){"use strict";var t=this.$thisButton.siblings("input.hidden-field").attr("data-field"),e=this.getMimeType();_.isString(t)&&""!==t&&_.isObject(this.params.fields[t])&&"cropped_image"===this.params.fields[t].type&&["width","height","flex_width","flex_height"].forEach(function(e){_.isUndefined(this.params.fields[t][e])||(this.params[e]=this.params.fields[t][e])}.bind(this)),this.frame=wp.media({button:{text:"Select and Crop",close:!1},states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelectForCrop,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.$thisButton.closest(".repeater-field").hasClass("repeater-field-upload")?this.setFileInRepeaterField(e):this.setImageInRepeaterField(e)},onSelectForCrop:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):this.setImageInRepeaterField(e)},onCropped:function(e){"use strict";this.setImageInRepeaterField(e)},calculateImageSelectOptions:function(e,t){"use strict";var i,n,a,r=t.get("control"),o=!!parseInt(r.params.flex_width,10),s=!!parseInt(r.params.flex_height,10),c=e.get("width"),l=e.get("height"),u=parseInt(r.params.width,10),d=parseInt(r.params.height,10),p=u/d,h=c,f=l;return t.set("canSkipCrop",!r.mustBeCropped(o,s,u,d,c,l)),p').hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},setFileInRepeaterField:function(e){"use strict";var t=this.$thisButton.closest(".repeater-field-upload");t.find(".kirki-file-attachment").html(' '+e.filename+"").hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".upload-button").show(),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},getMimeType:function(){"use strict";var e=this.$thisButton.siblings("input.hidden-field").attr("data-field");return _.isString(e)&&""!==e&&_.isObject(this.params.fields[e])&&"upload"===this.params.fields[e].type&&!_.isUndefined(this.params.fields[e].mime_type)?this.params.fields[e].mime_type:"image"},removeImage:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload")).find(".upload-button"),t.find(".kirki-image-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},removeFile:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-upload")).find(".upload-button"),t.find(".kirki-file-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},getValue:function(){"use strict";return JSON.parse(decodeURI(this.setting.get()))},setValue:function(e,t,i){"use strict";var a=e,r=[];i&&(jQuery.each(this.params.fields,function(e,t){"image"!==t.type&&"cropped_image"!==t.type&&"upload"!==t.type||r.push(e)}),jQuery.each(e,function(i,n){jQuery.each(r,function(e,t){_.isUndefined(n[t])||_.isUndefined(n[t].id)||(a[i][t]=n[t].id)})})),this.setting.set(encodeURI(JSON.stringify(a))),t&&this.settingField.trigger("change")},addRow:function(e){"use strict";var t,a,i,r=this,n=r.repeaterTemplate(),o=this.getValue(),s={};if(n){if(t=jQuery.extend(!0,{},r.params.fields),e)for(i in e)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(t[i].default=e[i]);for(i in t.index=this.currentIndex,n=n(t),(a=new RepeaterRow(r.currentIndex,jQuery(n).appendTo(r.repeaterFieldsContainer),r.params.row_label,r)).container.on("row:remove",function(e,t){r.deleteRow(t)}),a.container.on("row:update",function(e,t,i,n){r.updateField.call(r,e,t,i,n),a.updateLabel()}),this.rows[this.currentIndex]=a,t)t.hasOwnProperty(i)&&(s[i]=t[i].default);return o[this.currentIndex]=s,this.setValue(o,!0),this.currentIndex++,a}},sort:function(){"use strict";var i=this,e=this.repeaterFieldsContainer.find(".repeater-row"),n=[],a=i.getValue(),r=[],o=[];e.each(function(e,t){n.push(jQuery(t).data("row"))}),jQuery.each(n,function(e,t){r[e]=i.rows[t],r[e].setRowIndex(e),o[e]=a[t]}),i.rows=r,i.setValue(o)},deleteRow:function(e){"use strict";var t,i=this.getValue();for(t in i[e]&&this.rows[e]&&(delete i[e],delete this.rows[e],this.setValue(i,!0)),1,this.rows)this.rows.hasOwnProperty(t)&&this.rows[t]&&(this.rows[t].updateLabel(),0)},updateField:function(e,t,i,n){"use strict";var a,r,o;this.rows[t]&&this.params.fields[i]&&(a=this.params.fields[i].type,r=this.rows[t],o=this.getValue(),n=jQuery(n),_.isUndefined(o[r.rowIndex][i])||(o[r.rowIndex][i]="checkbox"===a?n.is(":checked"):n.val(),this.setValue(o,!0)))},initColorPicker:function(){"use strict";var r=this,e=r.container.find(".color-picker-hex"),t={},i=e.data("field");_.isUndefined(i)||_.isUndefined(r.params.fields[i])||_.isUndefined(r.params.fields[i].palettes)||!_.isObject(r.params.fields[i].palettes)||(t.palettes=r.params.fields[i].palettes),t.change=function(e,t){var i=jQuery(e.target),n=i.closest(".repeater-row").data("row"),a=r.getValue();a[n][i.data("field")]=t.color.toString(),r.setValue(a,!0)},0!==e.length&&e.wpColorPicker(t)},initSelect:function(e,t){"use strict";var i,n,a=this,r=e.container.find(".repeater-field select"),o={};0!==r.length&&(i=r.data("field"),"undefed"!==(n=jQuery(r).data("multiple"))&&jQuery.isNumeric(n)&&1<(n=parseInt(n,10))&&(o.maximumSelectionLength=n),(t=t||{})[i]=t[i]||"",jQuery(r).selectWoo(o).val(t[i]||jQuery(r).val()),this.container.on("change",".repeater-field select",function(e){var t=jQuery(e.target),i=t.closest(".repeater-row").data("row"),n=a.getValue();n[i][t.data("field")]=jQuery(this).val(),a.setValue(n)}))}}),wp.customize.controlConstructor["kirki-slider"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t="postMessage"===e.setting.transport?"mousemove change":"change",i=e.container.find('input[type="range"]'),n=e.container.find('input[type="text"]'),a=e.setting._value;n.attr("value",a),i.on("mousemove change",function(){n.attr("value",i.val())}),i.on(t,function(){e.setting.set(i.val())}),n.on("input paste change",function(){i.attr("value",n.val()),e.setting.set(n.val())}),e.container.find(".slider-reset").on("click",function(){n.attr("value",e.params.default),i.attr("value",e.params.default),e.setting.set(n.val())})}}),wp.customize.controlConstructor["kirki-sortable"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var e=this;e.container.find(".kirki-controls-loading-spinner").hide(),e.sortableContainer=e.container.find("ul.sortable").first(),e.sortableContainer.sortable({stop:function(){e.updateValue()}}).disableSelection().find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){e.updateValue()})},updateValue:function(){"use strict";var e=[];this.sortableContainer.find("li").each(function(){jQuery(this).is(".invisible")||e.push(jQuery(this).data("value"))}),this.setting.set(e)}}),wp.customize.controlConstructor["kirki-switch"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-toggle"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-typography"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e,t=this,i=t.setting._value;t.renderFontSelector(),t.renderBackupFontSelector(),t.renderVariantSelector(),t.localFontsCheckbox(),t.params.default["font-size"]&&this.container.on("change keyup paste",".font-size input",function(){t.saveValue("font-size",jQuery(this).val())}),t.params.default["line-height"]&&this.container.on("change keyup paste",".line-height input",function(){t.saveValue("line-height",jQuery(this).val())}),t.params.default["margin-top"]&&this.container.on("change keyup paste",".margin-top input",function(){t.saveValue("margin-top",jQuery(this).val())}),t.params.default["margin-bottom"]&&this.container.on("change keyup paste",".margin-bottom input",function(){t.saveValue("margin-bottom",jQuery(this).val())}),t.params.default["letter-spacing"]&&(i["letter-spacing"]=jQuery.isNumeric(i["letter-spacing"])?i["letter-spacing"]+"px":i["letter-spacing"],this.container.on("change keyup paste",".letter-spacing input",function(){i["letter-spacing"]=jQuery.isNumeric(jQuery(this).val())?jQuery(this).val()+"px":jQuery(this).val(),t.saveValue("letter-spacing",i["letter-spacing"])})),t.params.default["word-spacing"]&&this.container.on("change keyup paste",".word-spacing input",function(){t.saveValue("word-spacing",jQuery(this).val())}),t.params.default["text-align"]&&this.container.on("change",".text-align input",function(){t.saveValue("text-align",jQuery(this).val())}),t.params.default["text-transform"]&&jQuery(t.selector+" .text-transform select").selectWoo().on("change",function(){t.saveValue("text-transform",jQuery(this).val())}),t.params.default["text-decoration"]&&jQuery(t.selector+" .text-decoration select").selectWoo().on("change",function(){t.saveValue("text-decoration",jQuery(this).val())}),_.isUndefined(t.params.default.color)||(e=this.container.find(".kirki-color-control")).wpColorPicker({change:function(){setTimeout(function(){t.saveValue("color",e.val())},100)}})},renderFontSelector:function(){var e,t,i=this,n=i.selector+" .font-family select",a=[],r=[],o=[],s=i.setting._value,c=i.getFonts();_.isUndefined(c.standard)||_.each(c.standard,function(e){r.push({id:e.family.replace(/"/g,"'"),text:e.label})}),_.isUndefined(c.google)||_.each(c.google,function(e){o.push({id:e.family,text:e.family})}),t={},_.isUndefined(i.params)||_.isUndefined(i.params.choices)||_.isUndefined(i.params.choices.fonts)||_.isUndefined(i.params.choices.fonts.families)||(t=i.params.choices.fonts.families),a=jQuery.extend({},t,{default:{text:kirkiL10n.defaultCSSValues,children:[{id:"",text:kirkiL10n.defaultBrowserFamily},{id:"initial",text:"initial"},{id:"inherit",text:"inherit"}]},standard:{text:kirkiL10n.standardFonts,children:r},google:{text:kirkiL10n.googleFonts,children:o}}),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font families for control "'+i.id+'":'),console.info(a)),a=_.values(a),e=jQuery(n).selectWoo({data:a}),s["font-family"]&&e.val(s["font-family"].replace(/'/g,'"')).trigger("change"),e.on("change",function(){i.saveValue("font-family",jQuery(this).val()),i.renderBackupFontSelector(),i.renderVariantSelector()})},renderBackupFontSelector:function(){var e,t=this,i=t.selector+" .font-backup select",n=[],a=t.setting._value,r=a["font-family"],o=t.getFonts();(_.isUndefined(a["font-backup"])||null===a["font-backup"])&&(a["font-backup"]=""),"inherit"!==r&&"initial"!==r&&"google"===kirki.util.webfonts.getFontType(r)?(jQuery(t.selector+" .font-backup").show(),_.isUndefined(o.standard)||_.each(o.standard,function(e){n.push({id:e.family.replace(/"/g,"'"),text:e.label})}),e=jQuery(i).selectWoo({data:n}),void 0!==a["font-backup"]&&e.val(a["font-backup"].replace(/'/g,'"')).trigger("change"),e.on("change",function(){t.saveValue("font-backup",jQuery(this).val())})):jQuery(t.selector+" .font-backup").hide()},renderVariantSelector:function(){var e,t,i,n=this,a=n.setting._value,r=a["font-family"],o=n.selector+" .variant select",s=[],c=!1,l=kirki.util.webfonts.getFontType(r),u=["","regular","italic","700","700italic"];if("google"===l&&(u=kirki.util.webfonts.google.getVariants(r)),_.isUndefined(n.params)||_.isUndefined(n.params.choices)||_.isUndefined(n.params.choices.fonts)||_.isUndefined(n.params.choices.fonts.variants)||_.isUndefined(n.params.choices.fonts.variants[r])||(u=n.params.choices.fonts.variants[r]),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font variants for font-family "'+r+'":'),console.info(u)),"inherit"!==r&&"initial"!==r&&""!==r||(a.variant="inherit",u=[""],jQuery(n.selector+" .variant").hide()),u.length<=1)return jQuery(n.selector+" .variant").hide(),a.variant=u[0],n.saveValue("variant",a.variant),""!==a.variant&&a.variant?(e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",i=-1!==a.variant.indexOf("italic")?"italic":"normal"):i=e="",n.saveValue("font-weight",e),void n.saveValue("font-style",i);jQuery(n.selector+" .font-backup").show(),jQuery(n.selector+" .variant").show(),_.each(u,function(e){a.variant===e&&(c=!0),s.push({id:e,text:e})}),c||(a.variant="regular"),jQuery(o).hasClass("select2-hidden-accessible")&&(jQuery(o).selectWoo("destroy"),jQuery(o).empty()),(t=jQuery(o).selectWoo({data:s})).val(a.variant).trigger("change"),t.on("change",function(){n.saveValue("variant",jQuery(this).val()),"string"!=typeof a.variant&&(a.variant=u[0]),e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",i=-1!==a.variant.indexOf("italic")?"italic":"normal",n.saveValue("font-weight",e),n.saveValue("font-style",i)})},getFonts:function(){var e=this,t=kirki.util.webfonts.google.getFonts(),i={},n="alpha",a=0,r={};return _.isEmpty(e.params.choices.fonts.google)?i=kirki.util.webfonts.google.getFonts(n,"",a):"alpha"===e.params.choices.fonts.google[0]||"popularity"===e.params.choices.fonts.google[0]||"trending"===e.params.choices.fonts.google[0]?(n=e.params.choices.fonts.google[0],isNaN(e.params.choices.fonts.google[1])||(a=parseInt(e.params.choices.fonts.google[1],10)),i=kirki.util.webfonts.google.getFonts(n,"",a)):_.each(e.params.choices.fonts.google,function(e){void 0===t[e]||_.isEmpty(t[e])||(i[e]=t[e])}),_.isEmpty(e.params.choices.fonts.standard)?_.each(kirki.util.webfonts.standard.fonts,function(e,t){r[t]={family:e.stack,label:e.label}}):_.each(e.params.choices.fonts.standard,function(e){void 0===kirki.util.webfonts.standard.fonts[e]||_.isEmpty(kirki.util.webfonts.standard.fonts[e])?r[e]={family:e,label:e}:(r[e]={},"undefined"===kirki.util.webfonts.standard.fonts[e].stack||_.isEmpty(kirki.util.webfonts.standard.fonts[e].stack)?r[e].family=i[e]:r[e].family=kirki.util.webfonts.standard.fonts[e].stack,"undefined"===kirki.util.webfonts.standard.fonts[e].label||_.isEmpty(kirki.util.webfonts.standard.fonts[e].label)?_.isEmpty(r[e])||(r[e].label=r[e]):r[e].label=kirki.util.webfonts.standard.fonts[e].label)}),{google:i,standard:r}},localFontsCheckbox:function(){var e=this,t=(e.container.find(".kirki-host-font-locally"),e.container.find(".kirki-host-font-locally input")),i=jQuery(t).is(":checked");e.setting._value&&e.setting._value.downloadFont&&jQuery(t).attr("checked","checked"),jQuery(t).on("change",function(){i=jQuery(t).is(":checked"),e.saveValue("downloadFont",i)})},saveValue:function(e,t){var i=this.container.find(".typography-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}});kirki/controls/js/.htaccess000044400000000143151232236240011726 0ustar00 Order Allow,Deny Deny from all kirki/controls/php/class-kirki-control-background.php000064400000017306151232236240017036 0ustar00

                              <# if ( data.value['background-image'] ) { #>
                              <# } else { #>
                              <# } #>

                              checked="checked" <# } #>> checked="checked" <# } #>> checked="checked" <# } #>>

                              checked="checked" <# } #>> checked="checked" <# } #>>
                              ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ), 'noFileSelected' => esc_attr__( 'No File Selected', 'kirki' ), 'remove' => esc_attr__( 'Remove', 'kirki' ), 'default' => esc_attr__( 'Default', 'kirki' ), 'selectFile' => esc_attr__( 'Select File', 'kirki' ), 'standardFonts' => esc_attr__( 'Standard Fonts', 'kirki' ), 'googleFonts' => esc_attr__( 'Google Fonts', 'kirki' ), 'defaultCSSValues' => esc_attr__( 'CSS Defaults', 'kirki' ), 'defaultBrowserFamily' => esc_attr__( 'Default Browser Font-Family', 'kirki' ), ) ); $suffix = str_replace( '.min', '', $suffix ); // Enqueue the style. wp_enqueue_style( 'kirki-styles', "{$kirki_url}controls/css/styles{$suffix}.css", array(), KIRKI_VERSION ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { // Get the basics from the parent class. parent::to_json(); // Default. $this->json['default'] = $this->setting->default; if ( isset( $this->default ) ) { $this->json['default'] = $this->default; } // Required. $this->json['required'] = $this->required; // Output. $this->json['output'] = $this->output; // Value. $this->json['value'] = $this->value(); // Choices. $this->json['choices'] = $this->choices; // The link. $this->json['link'] = $this->get_link(); // The ID. $this->json['id'] = $this->id; // Translation strings. $this->json['l10n'] = $this->l10n(); // The ajaxurl in case we need it. $this->json['ajaxurl'] = admin_url( 'admin-ajax.php' ); // Input attributes. $this->json['inputAttrs'] = ''; foreach ( $this->input_attrs as $attr => $value ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } // The kirki-config. $this->json['kirkiConfig'] = $this->kirki_config; // The option-type. $this->json['kirkiOptionType'] = $this->option_type; // The option-name. $this->json['kirkiOptionName'] = $this->option_name; // The preset. $this->json['preset'] = $this->preset; // The CSS-Variables. $this->json['css-var'] = $this->css_vars; } /** * Render the control's content. * * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`. * * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. * * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template(). * * @since 3.4.0 */ protected function render_content() {} /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() {} /** * Returns an array of translation strings. * * @access protected * @since 3.0.0 * @return array */ protected function l10n() { return array(); } } kirki/controls/php/class-kirki-control-checkbox.php000064400000003113151232236240016474 0ustar00render_content. * * @since 3.0.26 */ protected function render_content() { $input_id = '_customize-input-' . $this->id; $description_id = '_customize-description-' . $this->id; $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; ?> type="checkbox" value="value() ); ?>" link(); ?> value() ); ?> /> description ) ) : ?> description; ?>
                              json['choices']['colors'] ) || empty( $this->json['choices']['colors'] ) ) { $this->json['choices']['colors'] = Kirki_Helper::get_material_design_colors( 'primary' ); } if ( ! isset( $this->json['choices']['size'] ) || empty( $this->json['choices']['size'] ) ) { $this->json['choices']['size'] = 20; } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> <# if ( ! data.choices ) { return; } #> {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
                              <# for ( key in data.choices['colors'] ) { #> checked<# } #>> <# } #>
                              json['palette'] = $this->palette; $this->json['choices']['alpha'] = ( isset( $this->choices['alpha'] ) && $this->choices['alpha'] ) ? 'true' : 'false'; $this->json['mode'] = $this->mode; } } kirki/controls/php/class-kirki-control-cropped-image.php000064400000001400151232236240017417 0ustar00json['required'] = $this->required; } } kirki/controls/php/class-kirki-control-custom.php000064400000003356151232236240016231 0ustar00 json['icons'] = Kirki_Helper::get_dashicons(); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> <# if ( data.label ) { #>{{{ data.label }}}<# } #> <# if ( data.description ) { #>{{{ data.description }}}<# } #>
                              <# if ( ! _.isUndefined( data.choices ) && 1 < _.size( data.choices ) ) { #> <# for ( key in data.choices ) { #> checked="checked"<# } #>> <# } #> <# } else { #>

                              Admin Menu

                              <# for ( key in data.icons['admin-menu'] ) { #> checked="checked"<# } #>> <# } #>

                              Welcome Screen

                              <# for ( key in data.icons['welcome-screen'] ) { #> checked="checked"<# } #>> <# } #>

                              Post Formats

                              <# for ( key in data.icons['post-formats'] ) { #> checked="checked"<# } #>> <# } #>

                              Media

                              <# for ( key in data.icons['media'] ) { #> checked="checked"<# } #>> <# } #>

                              Image Editing

                              <# for ( key in data.icons['image-editing'] ) { #> checked="checked"<# } #>> <# } #>

                              TinyMCE

                              <# for ( key in data.icons['tinymce'] ) { #> checked="checked"<# } #>> <# } #>

                              Posts

                              <# for ( key in data.icons['posts'] ) { #> checked="checked"<# } #>> <# } #>

                              Sorting

                              <# for ( key in data.icons['sorting'] ) { #> checked="checked"<# } #>> <# } #>

                              Social

                              <# for ( key in data.icons['social'] ) { #> checked="checked"<# } #>> <# } #>

                              WordPress

                              <# for ( key in data.icons['wordpress_org'] ) { #> checked="checked"<# } #>> <# } #>

                              Products

                              <# for ( key in data.icons['products'] ) { #> checked="checked"<# } #>> <# } #>

                              Taxonomies

                              <# for ( key in data.icons['taxonomies'] ) { #> checked="checked"<# } #>> <# } #>

                              Widgets

                              <# for ( key in data.icons['widgets'] ) { #> checked="checked"<# } #>> <# } #>

                              Notifications

                              <# for ( key in data.icons['notifications'] ) { #> checked="checked"<# } #>> <# } #>

                              Misc

                              <# for ( key in data.icons['misc'] ) { #> checked="checked"<# } #>> <# } #> <# } #>
                              esc_attr__( 'Invalid Value', 'kirki' ), ) ); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> choices ) ) { foreach ( $this->choices as $choice => $value ) { if ( 'labels' !== $choice && true === $value ) { $this->json['choices'][ $choice ] = true; } } } if ( is_array( $this->json['default'] ) ) { foreach ( $this->json['default'] as $key => $value ) { if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { $this->json['value'][ $key ] = $value; } } } } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { wp_enqueue_style( 'kirki-styles', trailingslashit( Kirki::$url ) . 'controls/css/styles.css', array(), KIRKI_VERSION ); wp_localize_script( 'kirki-script', 'dimensionskirkiL10n', $this->l10n() ); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> esc_attr__( 'Left Top', 'kirki' ), 'left-center' => esc_attr__( 'Left Center', 'kirki' ), 'left-bottom' => esc_attr__( 'Left Bottom', 'kirki' ), 'right-top' => esc_attr__( 'Right Top', 'kirki' ), 'right-center' => esc_attr__( 'Right Center', 'kirki' ), 'right-bottom' => esc_attr__( 'Right Bottom', 'kirki' ), 'center-top' => esc_attr__( 'Center Top', 'kirki' ), 'center-center' => esc_attr__( 'Center Center', 'kirki' ), 'center-bottom' => esc_attr__( 'Center Bottom', 'kirki' ), 'font-size' => esc_attr__( 'Font Size', 'kirki' ), 'font-weight' => esc_attr__( 'Font Weight', 'kirki' ), 'line-height' => esc_attr__( 'Line Height', 'kirki' ), 'font-style' => esc_attr__( 'Font Style', 'kirki' ), 'letter-spacing' => esc_attr__( 'Letter Spacing', 'kirki' ), 'word-spacing' => esc_attr__( 'Word Spacing', 'kirki' ), 'top' => esc_attr__( 'Top', 'kirki' ), 'bottom' => esc_attr__( 'Bottom', 'kirki' ), 'left' => esc_attr__( 'Left', 'kirki' ), 'right' => esc_attr__( 'Right', 'kirki' ), 'center' => esc_attr__( 'Center', 'kirki' ), 'size' => esc_attr__( 'Size', 'kirki' ), 'height' => esc_attr__( 'Height', 'kirki' ), 'spacing' => esc_attr__( 'Spacing', 'kirki' ), 'width' => esc_attr__( 'Width', 'kirki' ), 'height' => esc_attr__( 'Height', 'kirki' ), 'invalid-value' => esc_attr__( 'Invalid Value', 'kirki' ), ); } } kirki/controls/php/class-kirki-control-editor.php000064400000003061151232236250016177 0ustar00 <# var saveAs = 'url'; if ( ! _.isUndefined( data.choices ) && ! _.isUndefined( data.choices.save_as ) ) { saveAs = data.choices.save_as; } url = data.value; if ( _.isObject( data.value ) && ! _.isUndefined( data.value.url ) ) { url = data.value.url; } data.choices.labels = _.isObject( data.choices.labels ) ? data.choices.labels : {}; data.choices.labels = _.defaults( data.choices.labels, { select: '', change: '', 'default': '', remove: '', placeholder: '', frame_title: '', frame_button: '', } ); #>
                              <# if ( data.value['url'] || '' !== url ) { #>
                              <# } else { #>
                              {{ data.choices.labels.placeholder }}
                              <# } #>
                              <# if ( data.default && '' !== data.default ) { #> <# } #>
                              <# if ( ! data.choices ) { return; } #> <# if ( data.label ) { #>{{{ data.label }}}<# } #> <# if ( data.description ) { #>{{{ data.description }}}<# } #>
                                <# for ( key in data.choices ) { #>
                              • class="checked"<# } #>> checked<# } #> />{{ data.choices[ key ] }}
                              • <# } #>
                              json['alpha'] = (bool) $this->alpha; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?> {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
                              <# for ( key in data.choices ) { #> <# if ( 'irisArgs' !== key ) { #>
                              <# } #> <# } #>
                              <# if ( ! data.choices ) { return; } #> {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #>
                              <# for ( key in data.choices ) { #> checked<# } #>> <# } #>
                              <# if ( data.label ) { #>{{{ data.label }}}<# } #> <# if ( data.description ) { #>{{{ data.description }}}<# } #>
                              <# for ( key in data.choices ) { #> checked="checked" <# } #>> <# } #>
                              input_attrs as $attr => $value ) { if ( 'style' !== $attr ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; continue; } $this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" '; } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?>
                              <# for ( key in data.choices ) { #> <# dataAlt = ( _.isObject( data.choices[ key ] ) && ! _.isUndefined( data.choices[ key ].alt ) ) ? data.choices[ key ].alt : '' #> checked="checked"<# } #> data-alt="{{ dataAlt }}"> <# } #>
                              row_label = array( 'type' => 'text', 'value' => esc_attr__( 'row', 'kirki' ), 'field' => false, ); // Validate row-labels. $this->row_label( $args ); if ( empty( $this->button_label ) ) { /* translators: %s represents the label of the row. */ $this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label['value'] ); } if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) { $args['fields'] = array(); } // An array to store keys of fields that need to be filtered. $media_fields_to_filter = array(); foreach ( $args['fields'] as $key => $value ) { if ( ! isset( $value['default'] ) ) { $args['fields'][ $key ]['default'] = ''; } if ( ! isset( $value['label'] ) ) { $args['fields'][ $key ]['label'] = ''; } $args['fields'][ $key ]['id'] = $key; // We check if the filed is an uploaded media ( image , file, video, etc.. ). if ( isset( $value['type'] ) ) { switch ( $value['type'] ) { case 'image': case 'cropped_image': case 'upload': // We add it to the list of fields that need some extra filtering/processing. $media_fields_to_filter[ $key ] = true; break; case 'dropdown-pages': // If the field is a dropdown-pages field then add it to args. $dropdown = wp_dropdown_pages( array( 'name' => '', 'echo' => 0, 'show_option_none' => esc_attr__( 'Select a Page', 'kirki' ), 'option_none_value' => '0', 'selected' => '', ) ); // Hackily add in the data link parameter. $dropdown = str_replace( 'get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning $args['fields'][ $key ]['dropdown'] = $dropdown; break; } } } // End foreach(). $this->fields = $args['fields']; // Now we are going to filter the fields. // First we create a copy of the value that would be used otherwise. $this->filtered_value = $this->value(); if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) { // We iterate over the list of fields. foreach ( $this->filtered_value as &$filtered_value_field ) { if ( is_array( $filtered_value_field ) && ! empty( $filtered_value_field ) ) { // We iterate over the list of properties for this field. foreach ( $filtered_value_field as $key => &$value ) { // We check if this field was marked as requiring extra filtering (in this case image, cropped_images, upload). if ( array_key_exists( $key, $media_fields_to_filter ) ) { // What follows was made this way to preserve backward compatibility. // The repeater control use to store the URL for images instead of the attachment ID. // We check if the value look like an ID (otherwise it's probably a URL so don't filter it). if ( is_numeric( $value ) ) { // "sanitize" the value. $attachment_id = (int) $value; // Try to get the attachment_url. $url = wp_get_attachment_url( $attachment_id ); $filename = basename( get_attached_file( $attachment_id ) ); // If we got a URL. if ( $url ) { // 'id' is needed for form hidden value, URL is needed to display the image. $value = array( 'id' => $attachment_id, 'url' => $url, 'filename' => $filename, ); } } } } } } // End foreach(). } // End if(). } /** * Refresh the parameters passed to the JavaScript via JSON. * * @access public */ public function to_json() { parent::to_json(); $fields = $this->fields; $this->json['fields'] = $fields; $this->json['row_label'] = $this->row_label; // If filtered_value has been set and is not empty we use it instead of the actual value. if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) { $this->json['value'] = $this->filtered_value; } $this->json['value'] = apply_filters( "kirki_controls_repeater_value_{$this->id}", $this->json['value'] ); } /** * Render the control's content. * Allows the content to be overriden without having to rewrite the wrapper in $this->render(). * * @access protected */ protected function render_content() { ?>
                                choices['limit'] ) ) : ?>

                                choices['limit'] ) ); ?>

                                repeater_js_template(); } /** * An Underscore (JS) template for this control's content (but not its container). * Class variables for this control class are available in the `data` JS object. * * @access public */ public function repeater_js_template() { ?> row_label['type'] = $args['row_label']['type']; } // Validating row label type. if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) { $this->row_label['value'] = esc_attr( $args['row_label']['value'] ); } // Validating row label field. if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) { $this->row_label['field'] = esc_attr( $args['row_label']['field'] ); } else { // If from field is not set correctly, making sure standard is set as the type. $this->row_label['type'] = 'text'; } } } } kirki/controls/php/class-kirki-control-select.php000064400000002100151232236250016161 0ustar00json['multiple'] = $this->multiple; $this->json['placeholder'] = $this->placeholder; } } kirki/controls/php/class-kirki-control-slider.php000064400000004033151232236250016173 0ustar00json['choices'] = wp_parse_args( $this->json['choices'], array( 'min' => '0', 'max' => '100', 'step' => '1', 'suffix' => '', ) ); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?>
                                {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #> checked<# } #> />
                                json['value'] ) ) { foreach ( array_keys( $this->json['value'] ) as $key ) { if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][ $key ] ) ) { unset( $this->json['value'][ $key ] ); } // Fix for https://wordpress.org/support/topic/white-font-after-updateing-to-3-0-16. if ( ! isset( $this->json['default'][ $key ] ) ) { unset( $this->json['value'][ $key ] ); } // Fix for https://github.com/aristath/kirki/issues/1405. if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) { unset( $this->json['value'][ $key ] ); } } } $this->json['show_variants'] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected */ protected function content_template() { ?>
                                <# if ( ! _.isUndefined( data.default['font-family'] ) ) { #> <# data.value['font-family'] = data.value['font-family'] || data['default']['font-family']; #> <# if ( data.choices['fonts'] ) { data.fonts = data.choices['fonts']; } #>
                                <# if ( ! _.isUndefined( data.choices['font-backup'] ) && true === data.choices['font-backup'] ) { #>
                                <# } #> <# if ( true === data.show_variants || false !== data.default.variant ) { #>
                                <# } #>
                                <# } #> <# if ( ! _.isUndefined( data.default['font-size'] ) ) { #> <# data.value['font-size'] = data.value['font-size'] || data['default']['font-size']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['line-height'] ) ) { #> <# data.value['line-height'] = data.value['line-height'] || data['default']['line-height']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['letter-spacing'] ) ) { #> <# data.value['letter-spacing'] = data.value['letter-spacing'] || data['default']['letter-spacing']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['word-spacing'] ) ) { #> <# data.value['word-spacing'] = data.value['word-spacing'] || data['default']['word-spacing']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['text-align'] ) ) { #> <# data.value['text-align'] = data.value['text-align'] || data['default']['text-align']; #>
                                checked="checked"<# } #>> checked="checked"<# } #>> checked="checked"<# } #>> checked="checked"<# } #>> checked="checked"<# } #>>
                                <# } #> <# if ( ! _.isUndefined( data.default['text-transform'] ) ) { #> <# data.value['text-transform'] = data.value['text-transform'] || data['default']['text-transform']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['text-decoration'] ) ) { #> <# data.value['text-decoration'] = data.value['text-decoration'] || data['default']['text-decoration']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['margin-top'] ) ) { #> <# data.value['margin-top'] = data.value['margin-top'] || data['default']['margin-top']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['margin-bottom'] ) ) { #> <# data.value['margin-bottom'] = data.value['margin-bottom'] || data['default']['margin-bottom']; #>
                                <# } #> <# if ( ! _.isUndefined( data.default['color'] ) && false !== data.default['color'] ) { #> <# data.value['color'] = data.value['color'] || data['default']['color']; #>
                                <# } #>
                                $variant, 'label' => isset( $all_variants[ $variant ] ) ? $all_variants[ $variant ] : $variant, ); } elseif ( is_array( $variant ) && isset( $variant['id'] ) && isset( $variant['label'] ) ) { $final_variants[] = $variant; } } return $final_variants; } } kirki/controls/php/class-kirki-control-upload.php000064400000001352151232236250016176 0ustar00json['required'] = $this->required; } } kirki/controls/php/class-kirki-settings-repeater-setting.php000064400000004022151232236250020351 0ustar00id}", array( $this, 'sanitize_repeater_setting' ), 10, 1 ); } /** * Fetch the value of the setting. * * @access public * @return mixed The value. */ public function value() { $value = parent::value(); if ( ! is_array( $value ) ) { $value = array(); } return $value; } /** * Convert the JSON encoded setting coming from Customizer to an Array. * * @access public * @param string $value URL Encoded JSON Value. * @return array */ public function sanitize_repeater_setting( $value ) { if ( ! is_array( $value ) ) { $value = json_decode( urldecode( $value ) ); } $sanitized = ( empty( $value ) || ! is_array( $value ) ) ? array() : $value; // Make sure that every row is an array, not an object. foreach ( $sanitized as $key => $_value ) { $sanitized[ $key ] = (array) $_value; if ( empty( $_value ) ) { unset( $sanitized[ $key ] ); } } // Reindex array. if ( is_array( $sanitized ) ) { $sanitized = array_values( $sanitized ); } return $sanitized; } } kirki/controls/php/.htaccess000044400000000143151232236250012102 0ustar00 Order Allow,Deny Deny from all kirki/controls/views/code.php000064400000002010151232236250012272 0ustar00 <# data = _.defaults( data, { id: '', label: '', description: '', input_attrs: {} }); <# var elementIdPrefix = 'el' + String( Math.random() ); #>
                                <# if ( data.label ) { #> <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
                                kirki/controls/views/color.php000064400000002372151232236250012511 0ustar00 <# data = _.defaults( data, { label: '', description: '', mode: 'full', inputAttrs: '', 'data-palette': data['data-palette'] ? data['data-palette'] : true, 'data-default-color': data['data-default-color'] ? data['data-default-color'] : '', 'data-alpha': data['data-alpha'] ? data['data-alpha'] : false, value: '', 'data-id': '' } ); #>
                                kirki/controls/views/generic.php000064400000002220151232236250012777 0ustar00 <# element = ( data.choices.element ) ? data.choices.element : 'input'; data = _.defaults( data, { label: '', description: '', inputAttrs: '', value: '', 'data-id': '', choices: {} } ); #>
                                kirki/controls/views/number.php000064400000001717151232236250012665 0ustar00 <# data = _.defaults( data, { label: '', description: '', inputAttrs: '', value: '', 'data-id': '' } ); #>
                                kirki/controls/views/radio.php000064400000002241151232236250012464 0ustar00 <# data = _.defaults( data, { choices: {}, label: '', description: '', inputAttrs: '', value: '', 'data-id': '', 'default': '' } ); #>
                                <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #> <# _.each( data.choices, function( val, key ) { #> <# } ); #>
                                kirki/controls/views/select.php000064400000004121151232236260012645 0ustar00 <# data = _.defaults( data, { label: '', description: '', inputAttrs: '', 'data-id': '', choices: {}, multiple: 1, value: ( 1 < data.multiple ) ? [] : '', placeholder: false } ); if ( 1 < data.multiple && data.value && _.isString( data.value ) ) { data.value = [ data.value ]; } #>
                                kirki/controls/views/textarea.php000064400000001741151232236260013210 0ustar00 <# data = _.defaults( data, { label: '', description: '', inputAttrs: '', value: '', 'data-id': '', choices: {} } ); #>
                                kirki/controls/views/.htaccess000044400000000143151232236260012451 0ustar00 Order Allow,Deny Deny from all kirki/controls/class-kirki-controls.php000064400000002601151232236260014307 0ustar00views_path ) { $this->views_path = wp_normalize_path( dirname( KIRKI_PLUGIN_FILE ) . '/controls/views/' ); } add_action( 'customize_controls_print_footer_scripts', array( $this, 'underscore_templates' ) ); } /** * Adds underscore.js templates to the footer. * * @access public * @since 3.0.17 */ public function underscore_templates() { foreach ( $this->templates as $template ) { if ( file_exists( $this->views_path . $template . '.php' ) ) { echo ''; } } } } kirki/controls/.htaccess000044400000000143151232236260011314 0ustar00 Order Allow,Deny Deny from all kirki/core/class-kirki-config.php000064400000010204151232236260012774 0ustar00 $value ) { // Is this property whitelisted? if ( property_exists( $this, $key ) ) { $args[ $key ] = $value; } } $this->id = $config_id; $this->config_final = wp_parse_args( array( 'id' => $config_id, ), $args ); } /** * Use this method to get an instance of your config. * Each config has its own instance of this object. * * @static * @access public * @param string $id Config ID. * @param array $args { * Optional. Arguments to override config defaults. * * @type string $capability @see https://codex.wordpress.org/Roles_and_Capabilities * @type string $option_type theme_mod or option. * @type string $option_name If we want to used serialized options, * this is where we'll be adding the option name. * All fields using this config will be items in that array. * @type array $compiler Not yet fully implemented * @type bool $disable_output If set to true, no CSS will be generated * from fields using this configuration. * } * * @return Kirki_Config */ public static function get_instance( $id = 'global', $args = array() ) { $id = trim( esc_attr( $id ) ); $id = ( '' === $id ) ? 'global' : $id; $id_md5 = md5( $id ); if ( ! isset( self::$instances[ $id_md5 ] ) ) { self::$instances[ $id_md5 ] = new self( $id, $args ); } return self::$instances[ $id_md5 ]; } /** * Get the IDs of all current configs. * * @static * @access public * @since 3.0.22 * @return array */ public static function get_config_ids() { $configs = array(); foreach ( self::$instances as $instance ) { $configs[] = $instance->id; } return array_unique( $configs ); } /** * Returns the $config_final property * * @access public * @return array */ public function get_config() { return $this->config_final; } } kirki/core/class-kirki-control.php000064400000005337151232236260013222 0ustar00wp_customize = $wp_customize; // Set the control types. $this->set_control_types(); // Add the control. $this->add_control( $args ); } /** * Get the class name of the class needed to create tis control. * * @access private * @param array $args The field definition as sanitized in Kirki_Field. * * @return string the name of the class that will be used to create this control. */ final private function get_control_class_name( $args ) { // Set a default class name. $class_name = 'WP_Customize_Control'; // Get the classname from the array of control classnames. if ( array_key_exists( $args['type'], self::$control_types ) ) { $class_name = self::$control_types[ $args['type'] ]; } return $class_name; } /** * Adds the control. * * @access protected * @param array $args The field definition as sanitized in Kirki_Field. */ final protected function add_control( $args ) { // Get the name of the class we're going to use. $class_name = $this->get_control_class_name( $args ); // Add the control. $this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) ); } /** * Sets the $control_types property. * Makes sure the kirki_control_types filter is applied * and that the defined classes actually exist. * If a defined class does not exist, it is removed. * * @access private */ final private function set_control_types() { // Early exit if this has already run. if ( ! empty( self::$control_types ) ) { return; } self::$control_types = apply_filters( 'kirki_control_types', array() ); // Make sure the defined classes actually exist. foreach ( self::$control_types as $key => $classname ) { if ( ! class_exists( $classname ) ) { unset( self::$control_types[ $key ] ); } } } } kirki/core/class-kirki-field.php000064400000045502151232236260012623 0ustar00 'auto' * and have already set an array for the 'output' argument. * * @see https://kirki.org/docs/arguments/js_vars * @access protected * @var array */ protected $js_vars = array(); /** * If you want to use a CSS compiler, then use this to set the variable names. * * @see https://kirki.org/docs/arguments/variables * @access protected * @var array */ protected $variables = array(); /** * Text that will be used in a tooltip to provide extra info for this field. * * @access protected * @var string */ protected $tooltip = ''; /** * A custom callback to determine if the field should be visible or not. * * @access protected * @var string|array */ protected $active_callback = '__return_true'; /** * A custom sanitize callback that will be used to properly save the values. * * @access protected * @var string|array */ protected $sanitize_callback = ''; /** * Use 'refresh', 'postMessage' or 'auto'. * 'auto' will automatically geberate any 'js_vars' from the 'output' argument. * * @access protected * @var string */ protected $transport = 'refresh'; /** * Define dependencies to show/hide this field based on the values of other fields. * * @access protected * @var array */ protected $required = array(); /** * Partial Refreshes array. * * @access protected * @var array */ protected $partial_refresh = array(); /** * The class constructor. * Parses and sanitizes all field arguments. * Then it adds the field to Kirki::$fields. * * @access public * @param string $config_id The ID of the config we want to use. * Defaults to "global". * Configs are handled by the Kirki_Config class. * @param array $args The arguments of the field. */ public function __construct( $config_id = 'global', $args = array() ) { if ( isset( $args['setting'] ) && ! empty( $args['setting'] ) && ( ! isset( $args['settings'] ) || empty( $args['settings'] ) ) ) { /* translators: %s represents the field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Typo found in field %s - setting instead of settings.', 'kirki' ), esc_attr( $args['settings'] ) ), '3.0.10' ); $args['settings'] = $args['setting']; unset( $args['setting'] ); } // In case the user only provides 1 argument, // assume that the provided argument is $args and set $config_id = 'global'. if ( is_array( $config_id ) && empty( $args ) ) { /* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_attr( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' ); $args = $config_id; $config_id = 'global'; } $args['kirki_config'] = $config_id; $this->kirki_config = trim( esc_attr( $config_id ) ); if ( '' === $config_id ) { /* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_attr( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' ); $this->kirki_config = 'global'; } // Get defaults from the class. $defaults = get_class_vars( __CLASS__ ); // Get the config arguments, and merge them with the defaults. $config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array(); if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) { $config_defaults = Kirki::$config[ $this->kirki_config ]; } $config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array(); foreach ( $config_defaults as $key => $value ) { if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value !== $defaults[ $key ] ) { $defaults[ $key ] = $value; } } // Merge our args with the defaults. $args = wp_parse_args( $args, $defaults ); // Set the class properties using the parsed args. foreach ( $args as $key => $value ) { $this->$key = $value; } $this->args = $args; $this->set_field(); } /** * Processes the field arguments * * @access protected */ protected function set_field() { $properties = get_class_vars( __CLASS__ ); // Some things must run before the others. $this->set_option_name(); $this->set_option_type(); $this->set_settings(); // Sanitize the properties, skipping the ones that have already run above. foreach ( $properties as $property => $value ) { if ( in_array( $property, array( 'option_name', 'option_type', 'settings' ), true ) ) { continue; } if ( method_exists( $this, 'set_' . $property ) ) { $method_name = 'set_' . $property; $this->$method_name(); } } // Get all arguments with their values. $args = get_object_vars( $this ); foreach ( array_keys( $args ) as $key ) { $args[ $key ] = $this->$key; } // Add the field to the static $fields variable properly indexed. Kirki::$fields[ $this->settings ] = $args; } /** * Escape $kirki_config. * * @access protected */ protected function set_kirki_config() { $this->kirki_config = esc_attr( $this->kirki_config ); } /** * Escape $option_name. * * @access protected */ protected function set_option_name() { $this->option_name = esc_attr( $this->option_name ); } /** * Escape the $section. * * @access protected */ protected function set_section() { $this->section = sanitize_key( $this->section ); } /** * Escape the $section. * * @access protected */ protected function set_input_attrs() { if ( ! is_array( $this->input_attrs ) ) { $this->input_attrs = array(); } } /** * Checks the capability chosen is valid. * If not, then falls back to 'edit_theme_options' * * @access protected */ protected function set_capability() { // Early exit if we're using 'edit_theme_options'. if ( 'edit_theme_options' === $this->capability ) { return; } // Escape & trim the capability. $this->capability = trim( esc_attr( $this->capability ) ); } /** * Make sure we're using the correct option_type * * @access protected */ protected function set_option_type() { // Take care of common typos. if ( 'options' === $this->option_type ) { $this->option_type = 'option'; } // Take care of common typos. if ( 'theme_mods' === $this->option_type ) { /* translators: %1$s represents the field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Typo found in field %s - "theme_mods" vs "theme_mod"', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); $this->option_type = 'theme_mod'; } } /** * Modifications for partial refreshes. * * @access protected */ protected function set_partial_refresh() { if ( ! is_array( $this->partial_refresh ) ) { $this->partial_refresh = array(); } foreach ( $this->partial_refresh as $id => $args ) { if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) { /* translators: %1$s represents the field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); unset( $this->partial_refresh[ $id ] ); continue; } } if ( ! empty( $this->partial_refresh ) ) { $this->transport = 'postMessage'; } } /** * Sets the settings. * If we're using serialized options it makes sure that settings are properly formatted. * We'll also be escaping all setting names here for consistency. * * @access protected */ protected function set_settings() { // If settings is not an array, temporarily convert it to an array. // This is just to allow us to process everything the same way and avoid code duplication. // if settings is not an array then it will not be set as an array in the end. if ( ! is_array( $this->settings ) ) { $this->settings = array( 'kirki_placeholder_setting' => $this->settings, ); } $settings = array(); foreach ( $this->settings as $setting_key => $setting_value ) { $settings[ $setting_key ] = $setting_value; // If we're using serialized options then we need to spice this up. if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) { $settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]"; } } $this->settings = $settings; if ( isset( $this->settings['kirki_placeholder_setting'] ) ) { $this->settings = $this->settings['kirki_placeholder_setting']; } } /** * Sets the active_callback * If we're using the $required argument, * Then this is where the switch is made to our evaluation method. * * @access protected */ protected function set_active_callback() { if ( is_array( $this->active_callback ) && ! is_callable( $this->active_callback ) ) { if ( isset( $this->active_callback[0] ) ) { $this->required = $this->active_callback; } } if ( ! empty( $this->required ) ) { $this->active_callback = '__return_true'; return; } // No need to proceed any further if we're using the default value. if ( '__return_true' === $this->active_callback ) { return; } // Make sure the function is callable, otherwise fallback to __return_true. if ( ! is_callable( $this->active_callback ) ) { $this->active_callback = '__return_true'; } } /** * Sets the control type. * * @access protected */ protected function set_type() { // Escape the control type (it doesn't hurt to be sure). $this->type = esc_attr( $this->type ); } /** * Sets the $id. * Setting the ID should happen after the 'settings' sanitization. * This way we can also properly handle cases where the option_type is set to 'option' * and we're using an array instead of individual options. * * @access protected */ protected function set_id() { $this->id = sanitize_key( str_replace( '[', '-', str_replace( ']', '', $this->settings ) ) ); } /** * Sets the $choices. * * @access protected */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = array(); } } /** * Escapes the $disable_output. * * @access protected */ protected function set_disable_output() { $this->disable_output = (bool) $this->disable_output; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_output() { if ( empty( $this->output ) ) { return; } if ( ! is_array( $this->output ) ) { /* translators: The field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); $this->output = array( array( 'element' => $this->output, ), ); } // Convert to array of arrays if needed. if ( isset( $this->output['element'] ) ) { /* translators: The field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); $this->output = array( $this->output ); } foreach ( $this->output as $key => $output ) { if ( empty( $output ) || ! isset( $output['element'] ) ) { unset( $this->output[ $key ] ); continue; } if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) { $this->output[ $key ]['sanitize_callback'] = $output['callback']; } // Convert element arrays to strings. if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { $this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] ); sort( $this->output[ $key ]['element'] ); // Trim each element in the array. foreach ( $this->output[ $key ]['element'] as $index => $element ) { $this->output[ $key ]['element'][ $index ] = trim( $element ); } $this->output[ $key ]['element'] = implode( ',', $this->output[ $key ]['element'] ); } // Fix for https://github.com/aristath/kirki/issues/1659#issuecomment-346229751. $this->output[ $key ]['element'] = str_replace( array( "\t", "\n", "\r", "\0", "\x0B" ), ' ', $this->output[ $key ]['element'] ); $this->output[ $key ]['element'] = trim( preg_replace( '/\s+/', ' ', $this->output[ $key ]['element'] ) ); } } /** * Sets the $js_vars * * @access protected */ protected function set_js_vars() { if ( ! is_array( $this->js_vars ) ) { $this->js_vars = array(); } // Check if transport is set to auto. // If not, then skip the auto-calculations and exit early. if ( 'auto' !== $this->transport ) { return; } // Set transport to refresh initially. // Serves as a fallback in case we failt to auto-calculate js_vars. $this->transport = 'refresh'; $js_vars = array(); // Try to auto-generate js_vars. // First we need to check if js_vars are empty, and that output is not empty. if ( empty( $this->js_vars ) && ! empty( $this->output ) ) { // Start going through each item in the $output array. foreach ( $this->output as $output ) { $output['function'] = ( isset( $output['function'] ) ) ? $output['function'] : 'style'; // If 'element' or 'property' are not defined, skip this. if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) { continue; } if ( is_array( $output['element'] ) ) { $output['element'] = implode( ',', $output['element'] ); } // If there's a sanitize_callback defined skip this, unless we also have a js_callback defined. if ( isset( $output['sanitize_callback'] ) && ! empty( $output['sanitize_callback'] ) && ! isset( $output['js_callback'] ) ) { continue; } // If we got this far, it's safe to add this. $js_vars[] = $output; } // Did we manage to get all the items from 'output'? // If not, then we're missing something so don't add this. if ( count( $js_vars ) !== count( $this->output ) ) { return; } $this->js_vars = $js_vars; $this->transport = 'postMessage'; } } /** * Sets the $variables * * @access protected */ protected function set_variables() { if ( ! is_array( $this->variables ) ) { $variable = ( is_string( $this->variables ) && ! empty( $this->variables ) ) ? $this->variables : false; $this->variables = array(); if ( $variable && empty( $this->variables ) ) { $this->variables[0]['name'] = $variable; } } } /** * Sets the $transport * * @access protected */ protected function set_transport() { if ( 'postmessage' === trim( strtolower( $this->transport ) ) ) { $this->transport = 'postMessage'; } } /** * Sets the $required * * @access protected */ protected function set_required() { if ( ! is_array( $this->required ) ) { $this->required = array(); } } /** * Sets the $priority * * @access protected */ protected function set_priority() { $this->priority = absint( $this->priority ); } /** * Sets the $css_vars * * @access protected */ protected function set_css_vars() { if ( is_string( $this->css_vars ) ) { $this->css_vars = array( $this->css_vars ); } if ( isset( $this->css_vars[0] ) && is_string( $this->css_vars[0] ) ) { $this->css_vars = array( $this->css_vars ); } foreach ( $this->css_vars as $key => $val ) { if ( ! isset( $val[1] ) ) { $this->css_vars[ $key ][1] = '$'; } } } } kirki/core/class-kirki-helper.php000064400000042655151232236260013025 0ustar00 $value ) { // Create new key in $array, if it is empty or not an array. if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { $array[ $key ] = array(); } // Overwrite the value in the base array. if ( is_array( $value ) ) { $value = self::recurse( $array[ $key ], $value ); } $array[ $key ] = $value; } return $array; } /** * Initialize the WP_Filesystem * * @static * @access public * @return object WP_Filesystem */ public static function init_filesystem() { $credentials = array(); if ( ! defined( 'FS_METHOD' ) ) { define( 'FS_METHOD', 'direct' ); } $method = defined( 'FS_METHOD' ) ? FS_METHOD : false; if ( 'ftpext' === $method ) { // If defined, set it to that, Else, set to NULL. $credentials['hostname'] = defined( 'FTP_HOST' ) ? preg_replace( '|\w+://|', '', FTP_HOST ) : null; $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : null; $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : null; // Set FTP port. if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) { list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 ); if ( ! is_numeric( $credentials['port'] ) ) { unset( $credentials['port'] ); } } else { unset( $credentials['port'] ); } // Set connection type. if ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $method ) { $credentials['connection_type'] = 'ftps'; } elseif ( ! array_filter( $credentials ) ) { $credentials['connection_type'] = null; } else { $credentials['connection_type'] = 'ftp'; } } // The WordPress filesystem. global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem( $credentials ); } return $wp_filesystem; } /** * Returns the attachment object * * @static * @access public * @see https://pippinsplugins.com/retrieve-attachment-id-from-image-url/ * @param string $url URL to the image. * @return int|string Numeric ID of the attachement. */ public static function get_image_id( $url ) { global $wpdb; if ( empty( $url ) ) { return 0; } $attachment = wp_cache_get( 'kirki_image_id_' . md5( $url ), null ); if ( false === $attachment ) { // @codingStandardsIgnoreLine WordPress.VIP.DirectDatabaseQuery.DirectQuery $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid = %s;", $url ) ); // phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery wp_cache_add( 'kirki_image_id_' . md5( $url ), $attachment, null ); } if ( ! empty( $attachment ) ) { return $attachment[0]; } return 0; } /** * Returns an array of the attachment's properties. * * @param string $url URL to the image. * @return array */ public static function get_image_from_url( $url ) { $image_id = self::get_image_id( $url ); $image = wp_get_attachment_image_src( $image_id, 'full' ); return array( 'url' => $image[0], 'width' => $image[1], 'height' => $image[2], 'thumbnail' => $image[3], ); } /** * Get an array of posts. * * @static * @access public * @param array $args Define arguments for the get_posts function. * @return array */ public static function get_posts( $args ) { if ( is_string( $args ) ) { $args = add_query_arg( array( 'suppress_filters' => false, ) ); } elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) { $args['suppress_filters'] = false; } // Get the posts. // TODO: WordPress.VIP.RestrictedFunctions.get_posts_get_posts. $posts = get_posts( $args ); // Properly format the array. $items = array(); foreach ( $posts as $post ) { $items[ $post->ID ] = $post->post_title; } wp_reset_postdata(); return $items; } /** * Get an array of publicly-querable taxonomies. * * @static * @access public * @return array */ public static function get_taxonomies() { $items = array(); // Get the taxonomies. $taxonomies = get_taxonomies( array( 'public' => true, ) ); // Build the array. foreach ( $taxonomies as $taxonomy ) { $id = $taxonomy; $taxonomy = get_taxonomy( $taxonomy ); $items[ $id ] = $taxonomy->labels->name; } return $items; } /** * Get an array of publicly-querable post-types. * * @static * @access public * @return array */ public static function get_post_types() { $items = array(); // Get the post types. $post_types = get_post_types( array( 'public' => true, ), 'objects' ); // Build the array. foreach ( $post_types as $post_type ) { $items[ $post_type->name ] = $post_type->labels->name; } return $items; } /** * Get an array of terms from a taxonomy * * @static * @access public * @param string|array $taxonomies See https://developer.wordpress.org/reference/functions/get_terms/ for details. * @return array */ public static function get_terms( $taxonomies ) { $items = array(); // Get the post types. $terms = get_terms( $taxonomies ); // Build the array. foreach ( $terms as $term ) { $items[ $term->term_id ] = $term->name; } return $items; } /** * Gets an array of material-design colors. * * @static * @access public * @param string $context Allows us to get subsets of the palette. * @return array */ public static function get_material_design_colors( $context = 'primary' ) { $colors = array( 'primary' => array( '#FFFFFF', '#000000', '#F44336', '#E91E63', '#9C27B0', '#673AB7', '#3F51B5', '#2196F3', '#03A9F4', '#00BCD4', '#009688', '#4CAF50', '#8BC34A', '#CDDC39', '#FFEB3B', '#FFC107', '#FF9800', '#FF5722', '#795548', '#9E9E9E', '#607D8B' ), 'red' => array( '#FFEBEE', '#FFCDD2', '#EF9A9A', '#E57373', '#EF5350', '#F44336', '#E53935', '#D32F2F', '#C62828', '#B71C1C', '#FF8A80', '#FF5252', '#FF1744', '#D50000' ), 'pink' => array( '#FCE4EC', '#F8BBD0', '#F48FB1', '#F06292', '#EC407A', '#E91E63', '#D81B60', '#C2185B', '#AD1457', '#880E4F', '#FF80AB', '#FF4081', '#F50057', '#C51162' ), 'purple' => array( '#F3E5F5', '#E1BEE7', '#CE93D8', '#BA68C8', '#AB47BC', '#9C27B0', '#8E24AA', '#7B1FA2', '#6A1B9A', '#4A148C', '#EA80FC', '#E040FB', '#D500F9', '#AA00FF' ), 'deep-purple' => array( '#EDE7F6', '#D1C4E9', '#B39DDB', '#9575CD', '#7E57C2', '#673AB7', '#5E35B1', '#512DA8', '#4527A0', '#311B92', '#B388FF', '#7C4DFF', '#651FFF', '#6200EA' ), 'indigo' => array( '#E8EAF6', '#C5CAE9', '#9FA8DA', '#7986CB', '#5C6BC0', '#3F51B5', '#3949AB', '#303F9F', '#283593', '#1A237E', '#8C9EFF', '#536DFE', '#3D5AFE', '#304FFE' ), 'blue' => array( '#E3F2FD', '#BBDEFB', '#90CAF9', '#64B5F6', '#42A5F5', '#2196F3', '#1E88E5', '#1976D2', '#1565C0', '#0D47A1', '#82B1FF', '#448AFF', '#2979FF', '#2962FF' ), 'light-blue' => array( '#E1F5FE', '#B3E5FC', '#81D4fA', '#4fC3F7', '#29B6FC', '#03A9F4', '#039BE5', '#0288D1', '#0277BD', '#01579B', '#80D8FF', '#40C4FF', '#00B0FF', '#0091EA' ), 'cyan' => array( '#E0F7FA', '#B2EBF2', '#80DEEA', '#4DD0E1', '#26C6DA', '#00BCD4', '#00ACC1', '#0097A7', '#00838F', '#006064', '#84FFFF', '#18FFFF', '#00E5FF', '#00B8D4' ), 'teal' => array( '#E0F2F1', '#B2DFDB', '#80CBC4', '#4DB6AC', '#26A69A', '#009688', '#00897B', '#00796B', '#00695C', '#004D40', '#A7FFEB', '#64FFDA', '#1DE9B6', '#00BFA5' ), 'green' => array( '#E8F5E9', '#C8E6C9', '#A5D6A7', '#81C784', '#66BB6A', '#4CAF50', '#43A047', '#388E3C', '#2E7D32', '#1B5E20', '#B9F6CA', '#69F0AE', '#00E676', '#00C853' ), 'light-green' => array( '#F1F8E9', '#DCEDC8', '#C5E1A5', '#AED581', '#9CCC65', '#8BC34A', '#7CB342', '#689F38', '#558B2F', '#33691E', '#CCFF90', '#B2FF59', '#76FF03', '#64DD17' ), 'lime' => array( '#F9FBE7', '#F0F4C3', '#E6EE9C', '#DCE775', '#D4E157', '#CDDC39', '#C0CA33', '#A4B42B', '#9E9D24', '#827717', '#F4FF81', '#EEFF41', '#C6FF00', '#AEEA00' ), 'yellow' => array( '#FFFDE7', '#FFF9C4', '#FFF590', '#FFF176', '#FFEE58', '#FFEB3B', '#FDD835', '#FBC02D', '#F9A825', '#F57F17', '#FFFF82', '#FFFF00', '#FFEA00', '#FFD600' ), 'amber' => array( '#FFF8E1', '#FFECB3', '#FFE082', '#FFD54F', '#FFCA28', '#FFC107', '#FFB300', '#FFA000', '#FF8F00', '#FF6F00', '#FFE57F', '#FFD740', '#FFC400', '#FFAB00' ), 'orange' => array( '#FFF3E0', '#FFE0B2', '#FFCC80', '#FFB74D', '#FFA726', '#FF9800', '#FB8C00', '#F57C00', '#EF6C00', '#E65100', '#FFD180', '#FFAB40', '#FF9100', '#FF6D00' ), 'deep-orange' => array( '#FBE9A7', '#FFCCBC', '#FFAB91', '#FF8A65', '#FF7043', '#FF5722', '#F4511E', '#E64A19', '#D84315', '#BF360C', '#FF9E80', '#FF6E40', '#FF3D00', '#DD2600' ), 'brown' => array( '#EFEBE9', '#D7CCC8', '#BCAAA4', '#A1887F', '#8D6E63', '#795548', '#6D4C41', '#5D4037', '#4E342E', '#3E2723' ), 'grey' => array( '#FAFAFA', '#F5F5F5', '#EEEEEE', '#E0E0E0', '#BDBDBD', '#9E9E9E', '#757575', '#616161', '#424242', '#212121', '#000000', '#ffffff' ), 'blue-grey' => array( '#ECEFF1', '#CFD8DC', '#B0BBC5', '#90A4AE', '#78909C', '#607D8B', '#546E7A', '#455A64', '#37474F', '#263238' ), ); switch ( $context ) { case '50': case '100': case '200': case '300': case '400': case '500': case '600': case '700': case '800': case '900': case 'A100': case 'A200': case 'A400': case 'A700': $key = absint( $context ) / 100; if ( 'A100' === $context ) { $key = 10; unset( $colors['grey'] ); } elseif ( 'A200' === $context ) { $key = 11; unset( $colors['grey'] ); } elseif ( 'A400' === $context ) { $key = 12; unset( $colors['grey'] ); } elseif ( 'A700' === $context ) { $key = 13; unset( $colors['grey'] ); } unset( $colors['primary'] ); $position_colors = array(); foreach ( $colors as $color_family ) { if ( isset( $color_family[ $key ] ) ) { $position_colors[] = $color_family[ $key ]; } } return $position_colors; case 'all': unset( $colors['primary'] ); $all_colors = array(); foreach ( $colors as $color_family ) { foreach ( $color_family as $color ) { $all_colors[] = $color; } } return $all_colors; case 'primary': return $colors['primary']; default: if ( isset( $colors[ $context ] ) ) { return $colors[ $context ]; } return $colors['primary']; } // End switch(). } /** * Get an array of all available dashicons. * * @static * @access public * @return array */ public static function get_dashicons() { return array( 'admin-menu' => array( 'menu', 'admin-site', 'dashboard', 'admin-post', 'admin-media', 'admin-links', 'admin-page', 'admin-comments', 'admin-appearance', 'admin-plugins', 'admin-users', 'admin-tools', 'admin-settings', 'admin-network', 'admin-home', 'admin-generic', 'admin-collapse', 'filter', 'admin-customizer', 'admin-multisite' ), 'welcome-screen' => array( 'welcome-write-blog', 'welcome-add-page', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-comments', 'welcome-learn-more' ), 'post-formats' => array( 'format-aside', 'format-image', 'format-gallery', 'format-video', 'format-status', 'format-quote', 'format-chat', 'format-audio', 'camera', 'images-alt', 'images-alt2', 'video-alt', 'video-alt2', 'video-alt3' ), 'media' => array( 'media-archive', 'media-audio', 'media-code', 'media-default', 'media-document', 'media-interactive', 'media-spreadsheet', 'media-text', 'media-video', 'playlist-audio', 'playlist-video', 'controls-play', 'controls-pause', 'controls-forward', 'controls-skipforward', 'controls-back', 'controls-skipback', 'controls-repeat', 'controls-volumeon', 'controls-volumeoff' ), 'image-editing' => array( 'image-crop', 'image-rotate', 'image-rotate-left', 'image-rotate-right', 'image-flip-vertical', 'image-flip-horizontal', 'image-filter', 'undo', 'redo' ), 'tinymce' => array( 'editor-bold', 'editor-italic', 'editor-ul', 'editor-ol', 'editor-quote', 'editor-alignleft', 'editor-aligncenter', 'editor-alignright', 'editor-insertmore', 'editor-spellcheck', 'editor-expand', 'editor-contract', 'editor-kitchensink', 'editor-underline', 'editor-justify', 'editor-textcolor', 'editor-paste-word', 'editor-paste-text', 'editor-removeformatting', 'editor-video', 'editor-customchar', 'editor-outdent', 'editor-indent', 'editor-help', 'editor-strikethrough', 'editor-unlink', 'editor-rtl', 'editor-break', 'editor-code', 'editor-paragraph', 'editor-table' ), 'posts' => array( 'align-left', 'align-right', 'align-center', 'align-none', 'lock', 'unlock', 'calendar', 'calendar-alt', 'visibility', 'hidden', 'post-status', 'edit', 'trash', 'sticky' ), 'sorting' => array( 'external', 'arrow-up', 'arrow-down', 'arrow-right', 'arrow-left', 'arrow-up-alt', 'arrow-down-alt', 'arrow-right-alt', 'arrow-left-alt', 'arrow-up-alt2', 'arrow-down-alt2', 'arrow-right-alt2', 'arrow-left-alt2', 'sort', 'leftright', 'randomize', 'list-view', 'exerpt-view', 'grid-view' ), 'social' => array( 'share', 'share-alt', 'share-alt2', 'twitter', 'rss', 'email', 'email-alt', 'facebook', 'facebook-alt', 'googleplus', 'networking' ), 'wordpress_org' => array( 'hammer', 'art', 'migrate', 'performance', 'universal-access', 'universal-access-alt', 'tickets', 'nametag', 'clipboard', 'heart', 'megaphone', 'schedule' ), 'products' => array( 'wordpress', 'wordpress-alt', 'pressthis', 'update', 'screenoptions', 'info', 'cart', 'feedback', 'cloud', 'translation' ), 'taxonomies' => array( 'tag', 'category' ), 'widgets' => array( 'archive', 'tagcloud', 'text' ), 'notifications' => array( 'yes', 'no', 'no-alt', 'plus', 'plus-alt', 'minus', 'dismiss', 'marker', 'star-filled', 'star-half', 'star-empty', 'flag', 'warning' ), 'misc' => array( 'location', 'location-alt', 'vault', 'shield', 'shield-alt', 'sos', 'search', 'slides', 'analytics', 'chart-pie', 'chart-bar', 'chart-line', 'chart-area', 'groups', 'businessman', 'id', 'id-alt', 'products', 'awards', 'forms', 'testimonial', 'portfolio', 'book', 'book-alt', 'download', 'upload', 'backup', 'clock', 'lightbulb', 'microphone', 'desktop', 'tablet', 'smartphone', 'phone', 'index-card', 'carrot', 'building', 'store', 'album', 'palmtree', 'tickets-alt', 'money', 'smiley', 'thumbs-up', 'thumbs-down', 'layout' ), ); } /** * Compares the 2 values given the condition * * @param mixed $value1 The 1st value in the comparison. * @param mixed $value2 The 2nd value in the comparison. * @param string $operator The operator we'll use for the comparison. * @return boolean whether The comparison has succeded (true) or failed (false). */ public static function compare_values( $value1, $value2, $operator ) { if ( '===' === $operator ) { return $value1 === $value2; } if ( '!==' === $operator ) { return $value1 !== $value2; } if ( ( '!=' === $operator || 'not equal' === $operator ) ) { return $value1 != $value2; } if ( ( '>=' === $operator || 'greater or equal' === $operator || 'equal or greater' === $operator ) ) { return $value2 >= $value1; } if ( ( '<=' === $operator || 'smaller or equal' === $operator || 'equal or smaller' === $operator ) ) { return $value2 <= $value1; } if ( ( '>' === $operator || 'greater' === $operator ) ) { return $value2 > $value1; } if ( ( '<' === $operator || 'smaller' === $operator ) ) { return $value2 < $value1; } if ( 'contains' === $operator || 'in' === $operator ) { if ( is_array( $value1 ) && is_array( $value2 ) ) { foreach ( $value2 as $val ) { if ( in_array( $val, $value1 ) ) { return true; } } return false; } if ( is_array( $value1 ) && ! is_array( $value2 ) ) { return in_array( $value2, $value1 ); } if ( is_array( $value2 ) && ! is_array( $value1 ) ) { return in_array( $value1, $value2 ); } return ( false !== strrpos( $value1, $value2 ) || false !== strpos( $value2, $value1 ) ); } return $value1 == $value2; } } kirki/core/class-kirki-init.php000064400000022435151232236260012503 0ustar00control_types = array( 'checkbox' => 'Kirki_Control_Checkbox', 'kirki-background' => 'Kirki_Control_Background', 'code_editor' => 'Kirki_Control_Code', 'kirki-color' => 'Kirki_Control_Color', 'kirki-color-palette' => 'Kirki_Control_Color_Palette', 'kirki-custom' => 'Kirki_Control_Custom', 'kirki-date' => 'Kirki_Control_Date', 'kirki-dashicons' => 'Kirki_Control_Dashicons', 'kirki-dimension' => 'Kirki_Control_Dimension', 'kirki-dimensions' => 'Kirki_Control_Dimensions', 'kirki-editor' => 'Kirki_Control_Editor', 'kirki-fontawesome' => 'Kirki_Control_FontAwesome', 'kirki-image' => 'Kirki_Control_Image', 'kirki-multicolor' => 'Kirki_Control_Multicolor', 'kirki-multicheck' => 'Kirki_Control_MultiCheck', 'kirki-number' => 'Kirki_Control_Number', 'kirki-palette' => 'Kirki_Control_Palette', 'kirki-radio' => 'Kirki_Control_Radio', 'kirki-radio-buttonset' => 'Kirki_Control_Radio_ButtonSet', 'kirki-radio-image' => 'Kirki_Control_Radio_Image', 'repeater' => 'Kirki_Control_Repeater', 'kirki-select' => 'Kirki_Control_Select', 'kirki-slider' => 'Kirki_Control_Slider', 'kirki-sortable' => 'Kirki_Control_Sortable', 'kirki-spacing' => 'Kirki_Control_Dimensions', 'kirki-switch' => 'Kirki_Control_Switch', 'kirki-generic' => 'Kirki_Control_Generic', 'kirki-toggle' => 'Kirki_Control_Toggle', 'kirki-typography' => 'Kirki_Control_Typography', 'image' => 'Kirki_Control_Image', 'cropped_image' => 'Kirki_Control_Cropped_Image', 'upload' => 'Kirki_Control_Upload', ); return array_merge( $this->control_types, $control_types ); } /** * Helper function that adds the fields, sections and panels to the customizer. */ public function add_to_customizer() { $this->fields_from_filters(); add_action( 'customize_register', array( $this, 'register_control_types' ) ); add_action( 'customize_register', array( $this, 'add_panels' ), 97 ); add_action( 'customize_register', array( $this, 'add_sections' ), 98 ); add_action( 'customize_register', array( $this, 'add_fields' ), 99 ); } /** * Register control types */ public function register_control_types() { global $wp_customize; $section_types = apply_filters( 'kirki_section_types', array() ); foreach ( $section_types as $section_type ) { $wp_customize->register_section_type( $section_type ); } $this->control_types = $this->default_control_types(); if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) { unset( $this->control_types['code_editor'] ); } foreach ( $this->control_types as $key => $classname ) { if ( ! class_exists( $classname ) ) { unset( $this->control_types[ $key ] ); } } $skip_control_types = apply_filters( 'kirki_control_types_exclude', array( 'Kirki_Control_Repeater', 'WP_Customize_Control', ) ); foreach ( $this->control_types as $control_type ) { if ( ! in_array( $control_type, $skip_control_types, true ) && class_exists( $control_type ) ) { $wp_customize->register_control_type( $control_type ); } } } /** * Register our panels to the WordPress Customizer. * * @access public */ public function add_panels() { if ( ! empty( Kirki::$panels ) ) { foreach ( Kirki::$panels as $panel_args ) { // Extra checks for nested panels. if ( isset( $panel_args['panel'] ) ) { if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) { // Set the type to nested. $panel_args['type'] = 'kirki-nested'; } } new Kirki_Panel( $panel_args ); } } } /** * Register our sections to the WordPress Customizer. * * @var object The WordPress Customizer object */ public function add_sections() { if ( ! empty( Kirki::$sections ) ) { foreach ( Kirki::$sections as $section_args ) { // Extra checks for nested sections. if ( isset( $section_args['section'] ) ) { if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) { // Set the type to nested. $section_args['type'] = 'kirki-nested'; // We need to check if the parent section is nested inside a panel. $parent_section = Kirki::$sections[ $section_args['section'] ]; if ( isset( $parent_section['panel'] ) ) { $section_args['panel'] = $parent_section['panel']; } } } new Kirki_Section( $section_args ); } } } /** * Create the settings and controls from the $fields array and register them. * * @var object The WordPress Customizer object. */ public function add_fields() { global $wp_customize; foreach ( Kirki::$fields as $args ) { // Create the settings. new Kirki_Settings( $args ); // Check if we're on the customizer. // If we are, then we will create the controls, add the scripts needed for the customizer // and any other tweaks that this field may require. if ( $wp_customize ) { // Create the control. new Kirki_Control( $args ); } } } /** * Process fields added using the 'kirki_fields' and 'kirki_controls' filter. * These filters are no longer used, this is simply for backwards-compatibility. * * @access private * @since 2.0.0 */ private function fields_from_filters() { $fields = apply_filters( 'kirki_controls', array() ); $fields = apply_filters( 'kirki_fields', $fields ); if ( ! empty( $fields ) ) { foreach ( $fields as $field ) { Kirki::add_field( 'global', $field ); } } } /** * Alias for the is_plugin static method in the Kirki_Util class. * This is here for backwards-compatibility purposes. * * @static * @access public * @since 3.0.0 * @return bool */ public static function is_plugin() { // Return result using the Kirki_Util class. return Kirki_Util::is_plugin(); } /** * Alias for the get_variables static method in the Kirki_Util class. * This is here for backwards-compatibility purposes. * * @static * @access public * @since 2.0.0 * @return array Formatted as array( 'variable-name' => value ). */ public static function get_variables() { // Log error for developers. _doing_it_wrong( __METHOD__, esc_attr__( 'We detected you\'re using Kirki_Init::get_variables(). Please use Kirki_Util::get_variables() instead.', 'kirki' ), '3.0.10' ); // Return result using the Kirki_Util class. return Kirki_Util::get_variables(); } /** * Remove panels. * * @since 3.0.17 * @param object $wp_customize The customizer object. * @return void */ public function remove_panels( $wp_customize ) { foreach ( Kirki::$panels_to_remove as $panel ) { $wp_customize->remove_panel( $panel ); } } /** * Remove sections. * * @since 3.0.17 * @param object $wp_customize The customizer object. * @return void */ public function remove_sections( $wp_customize ) { foreach ( Kirki::$sections_to_remove as $section ) { $wp_customize->remove_section( $section ); } } /** * Remove controls. * * @since 3.0.17 * @param object $wp_customize The customizer object. * @return void */ public function remove_controls( $wp_customize ) { foreach ( Kirki::$controls_to_remove as $control ) { $wp_customize->remove_control( $control ); } } } kirki/core/class-kirki-l10n.php000064400000000000151232236260012272 0ustar00kirki/core/class-kirki-modules.php000064400000006277151232236260013216 0ustar00default_modules(); $this->init(); } /** * Set the default modules and apply the 'kirki_modules' filter. * * @access private * @since 3.0.0 */ private function default_modules() { self::$modules = apply_filters( 'kirki_modules', array( 'css' => 'Kirki_Modules_CSS', 'css-vars' => 'Kirki_Modules_CSS_Vars', 'customizer-styling' => 'Kirki_Modules_Customizer_Styling', 'icons' => 'Kirki_Modules_Icons', 'loading' => 'Kirki_Modules_Loading', 'tooltips' => 'Kirki_Modules_Tooltips', 'branding' => 'Kirki_Modules_Customizer_Branding', 'postMessage' => 'Kirki_Modules_PostMessage', 'selective-refresh' => 'Kirki_Modules_Selective_Refresh', 'field-dependencies' => 'Kirki_Modules_Field_Dependencies', 'custom-sections' => 'Kirki_Modules_Custom_Sections', 'webfonts' => 'Kirki_Modules_Webfonts', 'webfont-loader' => 'Kirki_Modules_Webfont_Loader', 'preset' => 'Kirki_Modules_Preset', ) ); } /** * Instantiates the modules. * * @access private * @since 3.0.0 */ private function init() { foreach ( self::$modules as $key => $module_class ) { if ( class_exists( $module_class ) ) { // Use this syntax instead of $module_class::get_instance() // for PHP 5.2 compatibility. self::$active_modules[ $key ] = call_user_func( array( $module_class, 'get_instance' ) ); } } } /** * Add a module. * * @static * @access public * @param string $module The classname of the module to add. * @since 3.0.0 */ public static function add_module( $module ) { if ( ! in_array( $module, self::$modules, true ) ) { self::$modules[] = $module; } } /** * Remove a module. * * @static * @access public * @param string $module The classname of the module to add. * @since 3.0.0 */ public static function remove_module( $module ) { $key = array_search( $module, self::$modules, true ); if ( false !== $key ) { unset( self::$modules[ $key ] ); } } /** * Get the modules array. * * @static * @access public * @since 3.0.0 * @return array */ public static function get_modules() { return self::$modules; } /** * Get the array of active modules (objects). * * @static * @access public * @since 3.0.0 * @return array */ public static function get_active_modules() { return self::$active_modules; } } kirki/core/class-kirki-panel.php000064400000002377151232236260012642 0ustar00 'WP_Customize_Panel', ); /** * The class constructor. * * @access public * @param array $args The panel arguments. */ public function __construct( $args ) { $this->panel_types = apply_filters( 'kirki_panel_types', $this->panel_types ); $this->add_panel( $args ); } /** * Add the panel using the Customizer API. * * @param array $args The panel arguments. */ public function add_panel( $args ) { global $wp_customize; if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) { $args['type'] = 'default'; } $panel_classname = $this->panel_types[ $args['type'] ]; $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) ); } } kirki/core/class-kirki-sanitize-values.php000064400000012175151232236260014663 0ustar00sanitize( $value ); } /** * Sanitize number options. * * @static * @access public * @since 0.5 * @param int|float|double|string $value The value to be sanitized. * @return integer|double|string */ public static function number( $value ) { return ( is_numeric( $value ) ) ? $value : intval( $value ); } /** * Drop-down Pages sanitization callback. * * - Sanitization: dropdown-pages * - Control: dropdown-pages * * Sanitization callback for 'dropdown-pages' type controls. This callback sanitizes `$page_id` * as an absolute integer, and then validates that $input is the ID of a published page. * * @see absint() https://developer.wordpress.org/reference/functions/absint/ * @see get_post_status() https://developer.wordpress.org/reference/functions/get_post_status/ * * @param int $page_id Page ID. * @param WP_Customize_Setting $setting Setting instance. * @return int|string Page ID if the page is published; otherwise, the setting default. */ public static function dropdown_pages( $page_id, $setting ) { // Ensure $input is an absolute integer. $page_id = absint( $page_id ); // If $page_id is an ID of a published page, return it; otherwise, return the default. return ( 'publish' === get_post_status( $page_id ) ? $page_id : $setting->default ); } /** * Sanitizes css dimensions. * * @static * @access public * @since 2.2.0 * @param string $value The value to be sanitized. * @return string */ public static function css_dimension( $value ) { // Trim it. $value = trim( $value ); // If the value is round, then return 50%. if ( 'round' === $value ) { $value = '50%'; } // If the value is empty, return empty. if ( '' === $value ) { return ''; } // If auto, inherit or initial, return the value. if ( 'auto' === $value || 'initial' === $value || 'inherit' === $value || 'normal' === $value ) { return $value; } // Return empty if there are no numbers in the value. if ( ! preg_match( '#[0-9]#', $value ) ) { return ''; } // If we're using calc() then return the value. if ( false !== strpos( $value, 'calc(' ) ) { return $value; } // The raw value without the units. $raw_value = self::filter_number( $value ); $unit_used = ''; // An array of all valid CSS units. Their order was carefully chosen for this evaluation, don't mix it up!!! $units = array( 'fr', 'rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax' ); foreach ( $units as $unit ) { if ( false !== strpos( $value, $unit ) ) { $unit_used = $unit; } } // Hack for rem values. if ( 'em' === $unit_used && false !== strpos( $value, 'rem' ) ) { $unit_used = 'rem'; } return $raw_value . $unit_used; } /** * Filters numeric values. * * @static * @access public * @param string $value The value to be sanitized. * @return int|float */ public static function filter_number( $value ) { return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } /** * Sanitize RGBA colors * * @static * @since 0.8.5 * @param string $value The value to be sanitized. * @return string */ public static function rgba( $value ) { $color = ariColor::newColor( $value ); return $color->toCSS( 'rgba' ); } /** * Sanitize colors. * * @static * @since 0.8.5 * @param string $value The value to be sanitized. * @return string */ public static function color( $value ) { // If the value is empty, then return empty. if ( '' === $value ) { return ''; } // If transparent, then return 'transparent'. if ( is_string( $value ) && 'transparent' === trim( $value ) ) { return 'transparent'; } // Instantiate the object. $color = ariColor::newColor( $value ); // Return a CSS value, using the auto-detected mode. return $color->toCSS( $color->mode ); } /** * DOES NOT SANITIZE ANYTHING. * * @static * @since 0.5 * @param int|string|array $value The value to be sanitized. * @return int|string|array */ public static function unfiltered( $value ) { return $value; } } kirki/core/class-kirki-section.php000064400000003035151232236260013177 0ustar00section_types = apply_filters( 'kirki_section_types', $this->section_types ); $this->add_section( $args ); } /** * Adds the section using the WordPress Customizer API. * * @access public * @param array $args The section parameters. */ public function add_section( $args ) { global $wp_customize; // The default class to be used when creating a section. $section_classname = 'WP_Customize_Section'; if ( isset( $args['type'] ) && array_key_exists( $args['type'], $this->section_types ) ) { $section_classname = $this->section_types[ $args['type'] ]; } if ( isset( $args['type'] ) && 'kirki-outer' === $args['type'] ) { $args['type'] = 'outer'; $section_classname = 'WP_Customize_Section'; } // Add the section. $wp_customize->add_section( new $section_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) ); } } kirki/core/class-kirki-sections.php000064400000002343151232236260013363 0ustar00' . esc_attr( $css ) . ''; } } } kirki/core/class-kirki-setting-site-option.php000064400000003136151232236260015462 0ustar00id_data['base'], $default ); } /** * Set the root value for a setting, especially for multidimensional ones. * * @access protected * @since 3.0.0 * @param mixed $value Value to set as root of multidimensional setting. * @return bool Whether the multidimensional root was updated successfully. */ protected function set_root_value( $value ) { return update_site_option( $this->id_data['base'], $value ); } /** * Save the value of the setting, using the related API. * * @access protected * @since 3.0.0 * @param mixed $value The value to update. * @return bool The result of saving the value. */ protected function update( $value ) { return $this->set_root_value( $value ); } /** * Fetch the value of the setting. * * @access protected * @since 3.0.0 * @return mixed The value. */ public function value() { return $this->get_root_value( $this->default ); } } kirki/core/class-kirki-setting-user-meta.php000064400000004450151232236260015112 0ustar00id_data['base']; // Get all user-meta. // We'll use this to check if the value is set or not, // in order to figure out if we need to return the default value. // @codingStandardsIgnoreLine $user_meta = get_user_meta( get_current_user_id() ); // Get the single meta. // @codingStandardsIgnoreLine $single_meta = get_user_meta( get_current_user_id(), $id_base, true ); if ( isset( $user_meta[ $id_base ] ) ) { return $single_meta; } return $default; } /** * Set the root value for a setting, especially for multidimensional ones. * * @access protected * @since 3.0.0 * @param mixed $value Value to set as root of multidimensional setting. * @return bool Whether the multidimensional root was updated successfully. */ protected function set_root_value( $value ) { $id_base = $this->id_data['base']; // First delete the current user-meta. // We're doing this to avoid duplicate entries. // @codingStandardsIgnoreLine delete_user_meta( get_current_user_id(), $id_base ); // Update the user-meta. // @codingStandardsIgnoreLine return update_user_meta( get_current_user_id(), $id_base, $value ); } /** * Save the value of the setting, using the related API. * * @access protected * @since 3.0.0 * @param mixed $value The value to update. * @return bool The result of saving the value. */ protected function update( $value ) { return $this->set_root_value( $value ); } /** * Fetch the value of the setting. * * @access protected * @since 3.0.0 * @return mixed The value. */ public function value() { return $this->get_root_value( $this->default ); } } kirki/core/class-kirki-settings.php000064400000011457151232236260013402 0ustar00wp_customize = $wp_customize; // Set the setting_types. $this->set_setting_types(); // Add the settings. $this->add_settings( $args ); } /** * Adds the settings for this field. * If settings are defined as an array, then it goes through them * and calls the add_setting method. * If not an array, then it just calls add_setting * * @access private * @param array $args The field definition as sanitized in Kirki_Field. */ final private function add_settings( $args = array() ) { // Get the classname we'll be using to create our setting(s). $classname = false; if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) { $classname = $this->setting_types[ $args['option_type'] ]; } if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) { $args['type'] = 'default'; } $classname = ! $classname ? $this->setting_types[ $args['type'] ] : $classname; // If settings are defined as an array, then we need to go through them // and call add_setting for each one of them separately. if ( isset( $args['settings'] ) && is_array( $args['settings'] ) ) { // Make sure defaults have been defined. if ( ! isset( $args['default'] ) || ! is_array( $args['default'] ) ) { $args['default'] = array(); } foreach ( $args['settings'] as $key => $value ) { $default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : ''; $this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); } } $this->add_setting( $classname, $args['settings'], $args['default'], $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); } /** * This is where we're finally adding the setting to the Customizer. * * @access private * @param string $classname The name of the class that will be used to create this setting. * We're getting this from $this->setting_types. * @param string $setting The setting-name. * If settings is an array, then this method is called per-setting. * @param string|array $default Default value for this setting. * @param string $type The data type we're using. Valid options: theme_mod|option. * @param string $capability @see https://codex.wordpress.org/Roles_and_Capabilities. * @param string $transport Use refresh|postMessage. * @param string|array $sanitize_callback A callable sanitization function or method. */ final private function add_setting( $classname, $setting, $default, $type, $capability, $transport, $sanitize_callback ) { $this->wp_customize->add_setting( new $classname( $this->wp_customize, $setting, array( 'default' => $default, 'type' => $type, 'capability' => $capability, 'transport' => $transport, 'sanitize_callback' => $sanitize_callback, ) ) ); } /** * Sets the $this->setting_types property. * Makes sure the kirki_setting_types filter is applied * and that the defined classes actually exist. * If a defined class does not exist, it is removed. */ final private function set_setting_types() { // Apply the kirki_setting_types filter. $this->setting_types = apply_filters( 'kirki_setting_types', array( 'default' => 'WP_Customize_Setting', 'repeater' => 'Kirki_Settings_Repeater_Setting', 'user_meta' => 'Kirki_Setting_User_Meta', 'site_option' => 'Kirki_Setting_Site_Option', ) ); // Make sure the defined classes actually exist. foreach ( $this->setting_types as $key => $classname ) { if ( ! class_exists( $classname ) ) { unset( $this->setting_types[ $key ] ); } } } } kirki/core/class-kirki-toolkit.php000064400000001505151232236260013220 0ustar00 $args ) { if ( ! $is_plugin && isset( $args['Name'] ) && ( 'Kirki' === $args['Name'] || 'Kirki Toolkit' === $args['Name'] ) ) { $is_plugin = true; $_plugin = $plugin; } } // No need to proceed any further if Kirki wasn't found in the list of plugins. if ( ! $is_plugin ) { return false; } // Make sure the is_plugins_loaded function is loaded. include_once ABSPATH . 'wp-admin/includes/plugin.php'; // Extra logic in case the plugin is installed but not activated. if ( $_plugin && ! is_plugin_active( $_plugin ) ) { return false; } return $is_plugin; } /** * Build the variables. * * @static * @access public * @since 3.0.9 * @return array Formatted as array( 'variable-name' => value ). */ public static function get_variables() { $variables = array(); // Loop through all fields. foreach ( Kirki::$fields as $field ) { // Check if we have variables for this field. if ( isset( $field['variables'] ) && $field['variables'] && ! empty( $field['variables'] ) ) { // Loop through the array of variables. foreach ( $field['variables'] as $field_variable ) { // Is the variable ['name'] defined? If yes, then we can proceed. if ( isset( $field_variable['name'] ) ) { // Sanitize the variable name. $variable_name = esc_attr( $field_variable['name'] ); // Do we have a callback function defined? If not then set $variable_callback to false. $variable_callback = ( isset( $field_variable['callback'] ) && is_callable( $field_variable['callback'] ) ) ? $field_variable['callback'] : false; // If we have a variable_callback defined then get the value of the option // and run it through the callback function. // If no callback is defined (false) then just get the value. $variables[ $variable_name ] = Kirki_Values::get_value( $field['settings'] ); if ( $variable_callback ) { $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki_Values::get_value( $field['settings'] ) ); } } } } } // Pass the variables through a filter ('kirki_variable') and return the array of variables. return apply_filters( 'kirki_variable', $variables ); } /** * HTTP Request injection. * * @access public * @since 3.0.0 * @param array $request The request params. * @param string $url The request URL. * @return array */ public function http_request( $request = array(), $url = '' ) { // Early exit if installed as a plugin or not a request to wordpress.org, // or finally if we don't have everything we need. if ( self::is_plugin() || false === strpos( $url, 'wordpress.org' ) || ( ! isset( $request['body'] ) || ! isset( $request['body']['plugins'] ) || ! isset( $request['body']['translations'] ) || ! isset( $request['body']['locale'] ) || ! isset( $request['body']['all'] ) ) ) { return $request; } $plugins = json_decode( $request['body']['plugins'], true ); if ( ! isset( $plugins['plugins'] ) ) { return $request; } $exists = false; foreach ( $plugins['plugins'] as $plugin ) { if ( isset( $plugin['Name'] ) && 'Kirki Toolkit' === $plugin['Name'] ) { $exists = true; } } // Inject data. if ( ! $exists && defined( 'KIRKI_PLUGIN_FILE' ) ) { $plugins['plugins']['kirki/kirki.php'] = get_plugin_data( KIRKI_PLUGIN_FILE ); } $request['body']['plugins'] = wp_json_encode( $plugins ); return $request; } /** * Returns the $wp_version. * * @static * @access public * @since 3.0.12 * @param string $context Use 'minor' or 'major'. * @param boolean $only_numeric Set to true if you want to skip the alpha/beta etc parts. * @return int|float|string Returns integer when getting the 'major' version. * Returns float when getting the 'minor' version with $only_numeric set to true. * Returns string when getting the 'minor' version with $only_numeric set to false. */ public static function get_wp_version( $context = 'minor', $only_numeric = true ) { global $wp_version; // We only need the major version. if ( 'major' === $context ) { $version_parts = explode( '.', $wp_version ); return ( $only_numeric ) ? absint( $version_parts[0] ) : $version_parts[0]; } // If we got this far, we want the full monty. if ( $only_numeric ) { // Get the numeric part of the version without any beta, alpha etc parts. if ( false !== strpos( $wp_version, '-' ) ) { // We're on a dev version. $version_parts = explode( '-', $wp_version ); return floatval( $version_parts[0] ); } return floatval( $wp_version ); } return $wp_version; } } kirki/core/class-kirki-values.php000064400000012147151232236260013036 0ustar00get_config(); self::$config[ $config_args['id'] ] = $config_args; } /** * Create a new panel. * * @static * @access public * @param string $id The ID for this panel. * @param array $args The panel arguments. */ public static function add_panel( $id = '', $args = array() ) { $args['id'] = esc_attr( $id ); $args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : ''; $args['priority'] = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10; $args['type'] = ( isset( $args['type'] ) ) ? $args['type'] : 'default'; $args['type'] = 'kirki-' . $args['type']; self::$panels[ $args['id'] ] = $args; } /** * Remove a panel. * * @static * @access public * @since 3.0.17 * @param string $id The ID for this panel. */ public static function remove_panel( $id = '' ) { if ( ! in_array( $id, self::$panels_to_remove, true ) ) { self::$panels_to_remove[] = $id; } } /** * Create a new section. * * @static * @access public * @param string $id The ID for this section. * @param array $args The section arguments. */ public static function add_section( $id, $args ) { $args['id'] = esc_attr( $id ); $args['panel'] = ( isset( $args['panel'] ) ) ? esc_attr( $args['panel'] ) : ''; $args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : ''; $args['priority'] = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10; $args['type'] = ( isset( $args['type'] ) ) ? $args['type'] : 'default'; $args['type'] = 'kirki-' . $args['type']; self::$sections[ $args['id'] ] = $args; } /** * Remove a section. * * @static * @access public * @since 3.0.17 * @param string $id The ID for this panel. */ public static function remove_section( $id = '' ) { if ( ! in_array( $id, self::$sections_to_remove, true ) ) { self::$sections_to_remove[] = $id; } } /** * Create a new field. * * @static * @access public * @param string $config_id The configuration ID for this field. * @param array $args The field arguments. */ public static function add_field( $config_id, $args ) { if ( doing_action( 'customize_register' ) ) { _doing_it_wrong( __METHOD__, esc_attr__( 'Kirki fields should not be added on customize_register. Please add them directly, or on init.', 'kirki' ), '3.0.10' ); } // Early exit if 'type' is not defined. if ( ! isset( $args['type'] ) ) { return; } // If the field is font-awesome, enqueue the icons on the frontend. if ( class_exists( 'Kirki_Modules_CSS' ) && ( 'fontawesome' === $args['type'] || 'kirki-fontawesome' === $args['type'] ) ) { Kirki_Modules_CSS::add_fontawesome_script(); } $str = str_replace( array( '-', '_' ), ' ', $args['type'] ); $classname = 'Kirki_Field_' . str_replace( ' ', '_', ucwords( $str ) ); if ( class_exists( $classname ) ) { new $classname( $config_id, $args ); return; } if ( false !== strpos( $classname, 'Kirki_Field_Kirki_' ) ) { $classname = str_replace( 'Kirki_Field_Kirki_', 'Kirki_Field_', $classname ); if ( class_exists( $classname ) ) { new $classname( $config_id, $args ); return; } } new Kirki_Field( $config_id, $args ); } /** * Remove a control. * * @static * @access public * @since 3.0.17 * @param string $id The field ID. */ public static function remove_control( $id ) { if ( ! in_array( $id, self::$controls_to_remove, true ) ) { self::$controls_to_remove[] = $id; } } /** * Gets a parameter for a config-id. * * @static * @access public * @since 3.0.10 * @param string $id The config-ID. * @param string $param The parameter we want. * @return string */ public static function get_config_param( $id, $param ) { if ( ! isset( self::$config[ $id ] ) || ! isset( self::$config[ $id ][ $param ] ) ) { return ''; } return self::$config[ $id ][ $param ]; } } kirki/core/dynamic-css.php000064400000002234151232236270011534 0ustar00 $args ) { if ( true === $args['disable_output'] ) { continue; } $styles = Kirki_Modules_CSS::loop_controls( $config_id ); $styles = apply_filters( "kirki_{$config_id}_dynamic_css", $styles ); // Some people put weird stuff in their CSS, KSES tends to be greedy. $styles = str_replace( '<=', '<=', $styles ); $styles = wp_kses_post( $styles ); // @codingStandardsIgnoreStart // Why both KSES and strip_tags? Because we just added some '>'. // kses replaces lone '>' with >. echo strip_tags( str_replace( '>', '>', $styles ) ); // @codingStandardsIgnoreStop } kirki/core/.htaccess000044400000000143151232236270010402 0ustar00 Order Allow,Deny Deny from all kirki/deprecated/classes.php000064400000001212151232236270012122 0ustar00= 0 ) { require_once wp_normalize_path( dirname( __FILE__ ) . '/filters.php' ); } kirki/deprecated/filters.php000064400000007661151232236270012153 0ustar00toCSS( \'hex\' )' ); return Kirki_Color::sanitize_hex( $color ); } } if ( ! function_exists( 'kirki_get_rgb' ) ) { function kirki_get_rgb( $hex, $implode = false ) { _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgb\' )' ); return Kirki_Color::get_rgb( $hex, $implode ); } } if ( ! function_exists( 'kirki_get_rgba' ) ) { function kirki_get_rgba( $hex = '#fff', $opacity = 100 ) { _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgba\' )' ); return Kirki_Color::get_rgba( $hex, $opacity ); } } if ( ! function_exists( 'kirki_get_brightness' ) ) { function kirki_get_brightness( $hex ) { _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->lightness' ); return Kirki_Color::get_brightness( $hex ); } } if ( ! function_exists( 'Kirki' ) ) { function Kirki() { return kirki(); } } kirki/deprecated/.htaccess000044400000000143151232236270011552 0ustar00 Order Allow,Deny Deny from all kirki/field/class-kirki-field-background.php000064400000006331151232236270015071 0ustar00type = 'kirki-background'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * Sanitizes typography controls * * @since 2.2.0 * @param array $value The value. * @return array */ public function sanitize( $value ) { if ( ! is_array( $value ) ) { return array(); } return array( 'background-color' => ( isset( $value['background-color'] ) ) ? esc_attr( $value['background-color'] ) : '', 'background-image' => ( isset( $value['background-image'] ) ) ? esc_url_raw( $value['background-image'] ) : '', 'background-repeat' => ( isset( $value['background-repeat'] ) ) ? esc_attr( $value['background-repeat'] ) : '', 'background-position' => ( isset( $value['background-position'] ) ) ? esc_attr( $value['background-position'] ) : '', 'background-size' => ( isset( $value['background-size'] ) ) ? esc_attr( $value['background-size'] ) : '', 'background-attachment' => ( isset( $value['background-attachment'] ) ) ? esc_attr( $value['background-attachment'] ) : '', ); } /** * Sets the $js_vars * * @access protected */ protected function set_js_vars() { // Typecast to array. $this->js_vars = (array) $this->js_vars; // Check if transport is set to auto. // If not, then skip the auto-calculations and exit early. if ( 'auto' !== $this->transport ) { return; } // Set transport to refresh initially. // Serves as a fallback in case we failt to auto-calculate js_vars. $this->transport = 'refresh'; $js_vars = array(); // Try to auto-generate js_vars. // First we need to check if js_vars are empty, and that output is not empty. if ( empty( $this->js_vars ) && ! empty( $this->output ) ) { // Start going through each item in the $output array. foreach ( $this->output as $output ) { // If 'element' is not defined, skip this. if ( ! isset( $output['element'] ) ) { continue; } if ( is_array( $output['element'] ) ) { $output['element'] = implode( ',', $output['element'] ); } // If there's a sanitize_callback defined, skip this. if ( isset( $output['sanitize_callback'] ) && ! empty( $output['sanitize_callback'] ) ) { continue; } // If we got this far, it's safe to add this. $js_vars[] = $output; } // Did we manage to get all the items from 'output'? // If not, then we're missing something so don't add this. if ( count( $js_vars ) !== count( $this->output ) ) { return; } $this->js_vars = $js_vars; $this->transport = 'postMessage'; } } } kirki/field/class-kirki-field-checkbox.php000064400000002335151232236270014540 0ustar00type = 'checkbox'; } /** * Sets the $sanitize_callback. * * @access protected */ protected function set_sanitize_callback() { if ( ! $this->sanitize_callback ) { $this->sanitize_callback = array( $this, 'sanitize' ); } } /** * Sanitizes checkbox values. * * @access public * @param boolean|integer|string|null $value The checkbox value. * @return bool */ public function sanitize( $value = null ) { if ( '0' === $value || 'false' === $value ) { return false; } return (bool) $value; } /** * Sets the default value. * * @access protected */ protected function set_default() { $this->default = (bool) ( 1 === $this->default || '1' === $this->default || true === $this->default || 'true' === $this->default || 'on' === $this->default ); } } kirki/field/class-kirki-field-code.php000064400000005266151232236270013672 0ustar00 'kirki-code editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4', ); /** * Sets the control type. * * @access protected */ protected function set_type() { $this->type = 'code_editor'; } /** * Sets the $choices * * @access protected */ protected function set_choices() { if ( ! isset( $this->choices['language'] ) ) { return; } $language = $this->choices['language']; switch ( $language ) { case 'json': case 'xml': $language = 'application/' . $language; break; case 'http': $language = 'message/' . $language; break; case 'js': case 'javascript': $language = 'text/javascript'; break; case 'txt': $language = 'text/plain'; break; case 'css': case 'jsx': case 'html': $language = 'text/' . $language; break; default: $language = ( 'js' === $language ) ? 'javascript' : $language; $language = ( 'htm' === $language ) ? 'html' : $language; $language = ( 'yml' === $language ) ? 'yaml' : $language; $language = 'text/x-' . $language; break; } if ( ! isset( $this->editor_settings['codemirror'] ) ) { $this->editor_settings['codemirror'] = array(); } if ( ! isset( $this->editor_settings['codemirror']['mode'] ) ) { $this->editor_settings['codemirror']['mode'] = $language; } } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } // Code fields must NOT be filtered. Their values usually contain CSS/JS. // It is the responsibility of the theme/plugin that registers this field // to properly apply any necessary filtering. $this->sanitize_callback = array( 'Kirki_Sanitize_Values', 'unfiltered' ); } } kirki/field/class-kirki-field-color-alpha.php000064400000001047151232236270015152 0ustar00choices ) ) { $this->choices = array(); } $this->choices['alpha'] = true; } } kirki/field/class-kirki-field-color-palette.php000064400000000741151232236270015523 0ustar00type = 'kirki-color-palette'; } } kirki/field/class-kirki-field-color.php000064400000003656151232236300014071 0ustar00type = 'kirki-color'; } /** * Sets the $choices * * @access protected */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = array(); } if ( true === $this->alpha ) { _doing_it_wrong( 'Kirki::add_field', esc_attr__( 'Do not use "alpha" as an argument in color controls. Use "choices[alpha]" instead.', 'kirki' ), '3.0.10' ); $this->choices['alpha'] = true; } if ( ! isset( $this->choices['alpha'] ) || true !== $this->choices['alpha'] ) { $this->choices['alpha'] = true; if ( property_exists( $this, 'default' ) && ! empty( $this->default ) && false === strpos( 'rgba', $this->default ) ) { $this->choices['alpha'] = false; } } if ( ( ! isset( $this->choices['mode'] ) ) || ( 'hex' !== $this->choices['mode'] || 'hue' !== $this->choices['mode'] ) ) { $this->choices['mode'] = 'hex'; } } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } if ( 'hue' === $this->mode ) { $this->sanitize_callback = 'absint'; return; } $this->sanitize_callback = array( 'Kirki_Sanitize_Values', 'color' ); } } kirki/field/class-kirki-field-custom.php000064400000001553151232236300014257 0ustar00type = 'kirki-custom'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } // Custom fields don't actually save any value. // just use __return_true. $this->sanitize_callback = '__return_true'; } } kirki/field/class-kirki-field-dashicons.php000064400000001434151232236300014716 0ustar00type = 'kirki-dashicons'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_attr'; } } kirki/field/class-kirki-field-date.php000064400000001427151232236300013662 0ustar00type = 'kirki-date'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_textarea'; } } kirki/field/class-kirki-field-dimension.php000064400000001234151232236300014726 0ustar00type = 'kirki-dimension'; } /** * Sanitizes the value. * * @access public * @param string $value The value. * @return string */ public function sanitize( $value ) { return sanitize_text_field( $value ); } } kirki/field/class-kirki-field-dimensions.php000064400000002710151232236300015111 0ustar00type = 'kirki-dimensions'; } /** * Sets the $sanitize_callback. * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * Sanitizes the value. * * @access public * @param array $value The value. * @return array */ public function sanitize( $value ) { // Sanitize each sub-value separately. foreach ( $value as $key => $sub_value ) { $value[ $key ] = sanitize_text_field( $sub_value ); } return $value; } /** * Set the choices. * Adds a pseudo-element "controls" that helps with the JS API. * * @access protected */ protected function set_choices() { $this->choices['controls'] = array(); if ( is_array( $this->default ) ) { foreach ( $this->default as $key => $value ) { $this->choices['controls'][ $key ] = true; } } } } kirki/field/class-kirki-field-editor.php000064400000002132151232236300014225 0ustar00= 0 ) { $this->type = 'kirki-editor'; return; } // Fallback for older WordPress versions. $this->type = 'kirki-generic'; if ( ! is_array( $this->choices ) ) { $this->choices = array(); } $this->choices['element'] = 'textarea'; $this->choices['rows'] = '5'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'wp_kses_post'; } } kirki/field/class-kirki-field-fontawesome.php000064400000001441151232236300015270 0ustar00type = 'kirki-fontawesome'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_attr'; } } kirki/field/class-kirki-field-generic.php000064400000000613151232236300014355 0ustar00type = 'kirki-image'; } protected function set_button_labels() { $this->button_labels = wp_parse_args( $this->button_labels, array( 'select' => esc_attr__( 'Select image', 'kirki' ), 'change' => esc_attr__( 'Change image', 'kirki' ), 'default' => esc_attr__( 'Default', 'kirki' ), 'remove' => esc_attr__( 'Remove', 'kirki' ), 'placeholder' => esc_attr__( 'No image selected', 'kirki' ), 'frame_title' => esc_attr__( 'Select image', 'kirki' ), 'frame_button' => esc_attr__( 'Choose image', 'kirki' ), ) ); } /** * Set the choices. * Adds a pseudo-element "controls" that helps with the JS API. * * @access protected */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = (array) $this->choices; } if ( ! isset( $this->choices['save_as'] ) ) { $this->choices['save_as'] = 'url'; } if ( ! isset( $this->choices['labels'] ) ) { $this->choices['labels'] = array(); } $this->set_button_labels(); $this->choices['labels'] = wp_parse_args( $this->choices['labels'], $this->button_labels ); } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * The sanitize method that will be used as a falback * * @param string|array $value The control's value. */ public function sanitize( $value ) { if ( isset( $this->choices['save_as'] ) && 'array' === $this->choices['save_as'] ) { return array( 'id' => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '', 'url' => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '', 'width' => ( isset( $value['width'] ) && '' !== $value['width'] ) ? (int) $value['width'] : '', 'height' => ( isset( $value['height'] ) && '' !== $value['height'] ) ? (int) $value['height'] : '', ); } if ( isset( $this->choices['save_as'] ) && 'id' === $this->choices['save_as'] ) { return absint( $value ); } if ( is_string( $value ) ) { return esc_url_raw( $value ); } return $value; } } kirki/field/class-kirki-field-kirki-generic.php000064400000002055151232236300015466 0ustar00type = 'kirki-generic'; } /** * Sets the $choices * * @access protected */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = array(); } if ( ! isset( $this->choices['element'] ) ) { $this->choices['element'] = 'input'; } } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'wp_kses_post'; } } kirki/field/class-kirki-field-link.php000064400000000516151232236300013700 0ustar00type = 'kirki-multicheck'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * The sanitize method that will be used as a falback * * @param string|array $value The control's value. */ public function sanitize( $value ) { $value = ( ! is_array( $value ) ) ? explode( ',', $value ) : $value; return ( ! empty( $value ) ) ? array_map( 'sanitize_text_field', $value ) : array(); } } kirki/field/class-kirki-field-multicolor.php000064400000002342151232236300015133 0ustar00type = 'kirki-multicolor'; } /** * Sets the $choices * * @access protected */ protected function set_choices() { // Make sure choices are defined as an array. if ( ! is_array( $this->choices ) ) { $this->choices = array(); } } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * The method that will be used as a `sanitize_callback`. * * @param array $value The value to be sanitized. * @return array The value. */ public function sanitize( $value ) { return $value; } } kirki/field/class-kirki-field-number.php000064400000003752151232236300014240 0ustar00type = 'kirki-number'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { $this->sanitize_callback = array( $this, 'sanitize' ); } /** * Sets the $choices * * @access protected */ protected function set_choices() { $this->choices = wp_parse_args( $this->choices, array( 'min' => -999999999, 'max' => 999999999, 'step' => 1, ) ); // Make sure min, max & step are all numeric. $this->choices['min'] = filter_var( $this->choices['min'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $this->choices['max'] = filter_var( $this->choices['max'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $this->choices['step'] = filter_var( $this->choices['step'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } /** * Sanitizes numeric values. * * @access public * @param integer|string $value The checkbox value. * @return bool */ public function sanitize( $value = 0 ) { $this->set_choices(); $value = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); // Minimum & maximum value limits. if ( $value < $this->choices['min'] || $value > $this->choices['max'] ) { return max( min( $value, $this->choices['max'] ), $this->choices['min'] ); } // Only multiple of steps. $steps = ( $value - $this->choices['min'] ) / $this->choices['step']; if ( ! is_int( $steps ) ) { $value = $this->choices['min'] + ( round( $steps ) * $this->choices['step'] ); } return $value; } } kirki/field/class-kirki-field-palette.php000064400000000733151232236300014402 0ustar00type = 'kirki-palette'; } } kirki/field/class-kirki-field-preset.php000064400000001421151232236300014241 0ustar00type = 'kirki-select'; } /** * Set the preset. * * @access protected * @since 3.0.28 */ protected function set_preset() { // Set preset from the choices. $this->preset = $this->choices; // We're using a flat select. foreach ( $this->choices as $key => $args ) { $this->choices[ $key ] = $args['label']; } } } kirki/field/class-kirki-field-radio-buttonset.php000064400000000753151232236300016071 0ustar00type = 'kirki-radio-buttonset'; } } kirki/field/class-kirki-field-radio-image.php000064400000000743151232236300015123 0ustar00type = 'kirki-radio-image'; } } kirki/field/class-kirki-field-radio.php000064400000002742151232236300014044 0ustar00type = 'kirki-radio'; // Tweaks for backwards-compatibility: // Prior to version 0.8 radio-buttonset & radio-image were part of the radio control. if ( in_array( $this->mode, array( 'buttonset', 'image' ), true ) ) { /* translators: %1$s represents the field ID where the error occurs. %2%s is buttonset/image. */ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Error in field %1$s. The "mode" argument has been deprecated since Kirki v0.8. Use the "radio-%2$s" type instead.', 'kirki' ), esc_attr( $this->settings ), esc_attr( $this->mode ) ), '3.0.10' ); $this->type = 'radio-' . $this->mode; } } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_attr'; } } kirki/field/class-kirki-field-repeater.php000064400000010733151232236300014554 0ustar00type = 'repeater'; } /** * Sets the $transport * * @access protected */ protected function set_transport() { // Force using refresh mode. // Currently the repeater control does not support postMessage. $this->transport = 'refresh'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * The sanitize method that will be used as a falback * * @param string|array $value The control's value. */ public function sanitize( $value ) { // is the value formatted as a string? if ( is_string( $value ) ) { $value = rawurldecode( $value ); $value = json_decode( $value, true ); } // Nothing to sanitize if we don't have fields. if ( empty( $this->fields ) ) { return $value; } foreach ( $value as $row_id => $row_value ) { // Make sure the row is formatted as an array. if ( ! is_array( $row_value ) ) { $value[ $row_id ] = array(); continue; } // Start parsing sub-fields in rows. foreach ( $row_value as $subfield_id => $subfield_value ) { // Make sure this is a valid subfield. // If it's not, then unset it. if ( ! isset( $this->fields[ $subfield_id ] ) ) { unset( $value[ $row_id ][ $subfield_id ] ); } // Get the subfield-type. if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) { continue; } $subfield_type = $this->fields[ $subfield_id ]['type']; // Allow using a sanitize-callback on a per-field basis. if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) { $subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value ); } else { switch ( $subfield_type ) { case 'image': case 'cropped_image': case 'upload': if ( ! is_numeric( $subfield_value ) && is_string( $subfield_value ) ) { $subfield_value = esc_url_raw( $subfield_value ); } break; case 'dropdown-pages': $subfield_value = (int) $subfield_value; break; case 'color': // Instantiate the object. $color_obj = ariColor::newColor( $subfield_value ); $$subfield_value = $color_obj->toCSS( $color_obj->mode ); break; case 'text': $subfield_value = sanitize_text_field( $subfield_value ); break; case 'url': case 'link': $subfield_value = esc_url_raw( $subfield_value ); break; case 'email': $subfield_value = filter_var( $subfield_value, FILTER_SANITIZE_EMAIL ); break; case 'tel': $subfield_value = esc_attr( $subfield_value ); break; case 'checkbox': $subfield_value = (bool) $subfield_value; break; case 'select': if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) { if ( true === $this->fields[ $subfield_id ]['multiple'] ) { $multiple = 2; } $multiple = (int) $this->fields[ $subfield_id ]['multiple']; if ( 1 < $multiple ) { $subfield_value = (array) $subfield_value; foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) { $subfield_value[ $sub_subfield_key ] = esc_attr( $sub_subfield_value ); } } else { $subfield_value = esc_attr( $subfield_value ); } } break; case 'radio': case 'radio-image': $subfield_value = esc_attr( $subfield_value ); break; case 'textarea': $subfield_value = html_entity_decode( wp_kses_post( $subfield_value ) ); } // End switch(). } // End if(). $value[ $row_id ][ $subfield_id ] = $subfield_value; } // End foreach(). } // End foreach(). return $value; } } kirki/field/class-kirki-field-select.php000064400000004273151232236300014226 0ustar00 1, then the maximum number of selectable options * is the number defined here. * * @access protected * @var integer */ protected $multiple = 1; /** * Placeholder text. * * @access protected * @since 3.0.21 * @var string|false */ protected $placeholder = false; /** * Sets the control type. * * @access protected */ protected function set_type() { $this->type = 'kirki-select'; } /** * Sets the $multiple * * @access protected */ protected function set_multiple() { $this->multiple = absint( $this->multiple ); } /** * The placeholder text. * * @access protected * @since 3.0.21 */ protected function set_placeholder() { $this->placeholder = esc_attr( $this->placeholder ); } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( $this, 'sanitize' ); } /** * Sanitizes select control values. * * @since 2.2.8 * @access public * @param array $value The value. * @return string|array */ public function sanitize( $value ) { if ( is_array( $value ) ) { foreach ( $value as $key => $subvalue ) { if ( '' !== $subvalue || isset( $this->choices[''] ) ) { $key = sanitize_key( $key ); $value[ $key ] = esc_attr( $subvalue ); } } return $value; } return esc_attr( $value ); } /** * Sets the default value. * * @access protected * @since 3.0.0 */ protected function set_default() { if ( 1 < $this->multiple && ! is_array( $this->default ) ) { $this->default = array( $this->default ); } } } kirki/field/class-kirki-field-select2-multiple.php000064400000001212151232236300016127 0ustar00multiple = 999; } } kirki/field/class-kirki-field-select2.php000064400000001001151232236300014272 0ustar00type = 'kirki-slider'; } } kirki/field/class-kirki-field-sortable.php000064400000002161151232236300014554 0ustar00type = 'kirki-sortable'; } /** * Sets the $sanitize_callback. * * @access protected */ protected function set_sanitize_callback() { $this->sanitize_callback = array( $this, 'sanitize' ); } /** * Sanitizes sortable values. * * @access public * @param array $value The checkbox value. * @return array */ public function sanitize( $value = array() ) { if ( is_string( $value ) || is_numeric( $value ) ) { return array( esc_attr( $value ), ); } $sanitized_value = array(); foreach ( $value as $sub_value ) { if ( isset( $this->choices[ $sub_value ] ) ) { $sanitized_value[] = esc_attr( $sub_value ); } } return $sanitized_value; } } kirki/field/class-kirki-field-spacing.php000064400000002051151232236300014363 0ustar00 array( 'top' => ( isset( $this->default['top'] ) ), 'bottom' => ( isset( $this->default['top'] ) ), 'left' => ( isset( $this->default['top'] ) ), 'right' => ( isset( $this->default['top'] ) ), ), 'labels' => array( 'top' => esc_attr__( 'Top', 'kirki' ), 'bottom' => esc_attr__( 'Bottom', 'kirki' ), 'left' => esc_attr__( 'Left', 'kirki' ), 'right' => esc_attr__( 'Right', 'kirki' ), ), ); $this->choices = wp_parse_args( $this->choices, $default_args ); } } kirki/field/class-kirki-field-switch.php000064400000001511151232236310014241 0ustar00type = 'kirki-switch'; } /** * Sets the control choices. * * @access protected */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = array(); } $this->choices = wp_parse_args( $this->choices, array( 'on' => esc_attr__( 'On', 'kirki' ), 'off' => esc_attr__( 'Off', 'kirki' ), 'round' => false, ) ); } } kirki/field/class-kirki-field-text.php000064400000001633151232236310013731 0ustar00choices ) ) { $this->choices = array(); } $this->choices['element'] = 'input'; $this->choices['type'] = 'text'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_textarea'; } } kirki/field/class-kirki-field-textarea.php000064400000001016151232236310014555 0ustar00choices = array( 'element' => 'textarea', 'rows' => 5, ); } } kirki/field/class-kirki-field-toggle.php000064400000000734151232236310014227 0ustar00type = 'kirki-toggle'; } } kirki/field/class-kirki-field-typography.php000064400000013571151232236310015157 0ustar00type = 'kirki-typography'; } /** * The class constructor. * Parses and sanitizes all field arguments. * Then it adds the field to Kirki::$fields. * * @access public * @param string $config_id The ID of the config we want to use. * Defaults to "global". * Configs are handled by the Kirki_Config class. * @param array $args The arguments of the field. */ public function __construct( $config_id = 'global', $args = array() ) { parent::__construct( $config_id, $args ); $this->set_default(); } /** * Sets the default value. * * @access protected */ protected function set_default() { // Accomodate the use of font-weight and convert to variant. if ( isset( $this->default['font-weight'] ) ) { $this->default['variant'] = ( 'regular' === $this->default['font-weight'] ) ? 400 : (string) intval( $this->default['font-weight'] ); } // Make sure letter-spacing has units. if ( isset( $this->default['letter-spacing'] ) && is_numeric( $this->default['letter-spacing'] ) && $this->default['letter-spacing'] ) { $this->default['letter-spacing'] .= 'px'; } } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = array( __CLASS__, 'sanitize' ); } /** * Sets the $js_vars * * @access protected */ protected function set_js_vars() { if ( ! is_array( $this->js_vars ) ) { $this->js_vars = array(); } // Check if transport is set to auto. // If not, then skip the auto-calculations and exit early. if ( 'auto' !== $this->transport ) { return; } // Set transport to refresh initially. // Serves as a fallback in case we failt to auto-calculate js_vars. $this->transport = 'refresh'; $js_vars = array(); // Try to auto-generate js_vars. // First we need to check if js_vars are empty, and that output is not empty. if ( ! empty( $this->output ) ) { // Start going through each item in the $output array. foreach ( $this->output as $output ) { // If 'element' or 'property' are not defined, skip this. if ( ! isset( $output['element'] ) ) { continue; } if ( is_array( $output['element'] ) ) { $output['element'] = implode( ',', $output['element'] ); } // If we got this far, it's safe to add this. $js_vars[] = $output; } // Did we manage to get all the items from 'output'? // If not, then we're missing something so don't add this. if ( count( $js_vars ) !== count( $this->output ) ) { return; } $this->js_vars = $js_vars; $this->transport = 'postMessage'; } } /** * Sanitizes typography controls * * @static * @since 2.2.0 * @param array $value The value. * @return array */ public static function sanitize( $value ) { if ( ! is_array( $value ) ) { return array(); } foreach ( $value as $key => $val ) { switch ( $key ) { case 'font-family': $value['font-family'] = esc_attr( $val ); break; case 'font-weight': if ( isset( $value['variant'] ) ) { break; } $value['variant'] = $val; if ( isset( $value['font-style'] ) && 'italic' === $value['font-style'] ) { $value['variant'] = ( '400' !== $val || 400 !== $val ) ? $value['variant'] . 'italic' : 'italic'; } break; case 'variant': // Use 'regular' instead of 400 for font-variant. $value['variant'] = ( 400 === $val || '400' === $val ) ? 'regular' : $val; // Get font-weight from variant. $value['font-weight'] = filter_var( $value['variant'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $value['font-weight'] = ( 'regular' === $value['variant'] || 'italic' === $value['variant'] ) ? 400 : absint( $value['font-weight'] ); // Get font-style from variant. if ( ! isset( $value['font-style'] ) ) { $value['font-style'] = ( false === strpos( $value['variant'], 'italic' ) ) ? 'normal' : 'italic'; } break; case 'font-size': case 'letter-spacing': case 'word-spacing': case 'line-height': $value[ $key ] = '' === trim( $value[ $key ] ) ? '' : sanitize_text_field( $val ); break; case 'text-align': if ( ! in_array( $val, array( '', 'inherit', 'left', 'center', 'right', 'justify' ), true ) ) { $value['text-align'] = ''; } break; case 'text-transform': if ( ! in_array( $val, array( '', 'none', 'capitalize', 'uppercase', 'lowercase', 'initial', 'inherit' ), true ) ) { $value['text-transform'] = ''; } break; case 'text-decoration': if ( ! in_array( $val, array( ''. 'none', 'underline', 'overline', 'line-through', 'initial', 'inherit' ), true ) ) { $value['text-transform'] = ''; } break; case 'color': $value['color'] = '' === $value['color'] ? '' : ariColor::newColor( $val )->toCSS( 'hex' ); break; } // End switch(). } // End foreach(). return $value; } /** * Sets the $choices * * @access protected * @since 3.0.0 */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = array(); } $this->choices = wp_parse_args( $this->choices, array( 'variant' => array(), 'fonts' => array( 'standard' => array(), 'google' => array(), ), ) ); } } kirki/field/class-kirki-field-upload.php000064400000001424151232236310014227 0ustar00type = 'upload'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_url_raw'; } } kirki/field/class-kirki-field-url.php000064400000001631151232236310013545 0ustar00choices ) ) { $this->choices = array(); } $this->choices['element'] = 'input'; $this->choices['type'] = 'text'; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_sanitize_callback() { // If a custom sanitize_callback has been defined, // then we don't need to proceed any further. if ( ! empty( $this->sanitize_callback ) ) { return; } $this->sanitize_callback = 'esc_url_raw'; } } kirki/field/.htaccess000044400000000143151232236310010530 0ustar00 Order Allow,Deny Deny from all kirki/lib/class-aricolor.php000064400000070070151232236310012053 0ustar00color = $color; if ( is_array( $color ) && isset( $color['fallback'] ) ) { $this->fallback = $color['fallback']; $this->fallback_obj = self::newColor( $this->fallback ); } if ( ! method_exists( $this, 'from_' . $mode ) ) { $mode = $this->get_mode( $color ); } $this->mode = $mode; if ( ! $mode ) { return; } $this->mode = $mode; $method = 'from_' . $mode; // Call the from_{$color_mode} method. $this->$method(); } /** * Gets an instance for this color. * We use a separate instance per color * because there's no need to create a completely new instance each time we call this class. * Instead using instances helps us improve performance & footprint. * * @static * @access public * @since 1.0.0 * @param string|array $color The color. * @param string $mode Mode to be used. * @return ariColor (object) */ public static function newColor( $color, $mode = 'auto' ) { // Get an md5 for this color. $color_md5 = ( is_array( $color ) ) ? md5( wp_json_encode( $color ) . $mode ) : md5( $color . $mode ); // Set the instance if it does not already exist. if ( ! isset( self::$instances[ $color_md5 ] ) ) { self::$instances[ $color_md5 ] = new self( $color, $mode ); } return self::$instances[ $color_md5 ]; } /** * Alias of the newColor method. * * @static * @access public * @since 1.1 * @param string|array $color The color. * @param string $mode Mode to be used. * @return ariColor (object) */ public static function new_color( $color, $mode = 'auto' ) { return self::newColor( $color, $mode ); } /** * Allows us to get a new instance by modifying a property of the existing one. * * @access public * @since 1.0.0 * @param string $property Can be one of the following: * red, * green, * blue, * alpha, * hue, * saturation, * lightness, * brightness. * @param int|float|string $value The new value. * @return ariColor|null */ public function getNew( $property = '', $value = '' ) { if ( in_array( $property, array( 'red', 'green', 'blue', 'alpha' ), true ) ) { // Check if we're changing any of the rgba values. $value = max( 0, min( 255, $value ) ); if ( 'red' === $property ) { return self::new_color( 'rgba(' . $value . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' ); } elseif ( 'green' === $property ) { return self::new_color( 'rgba(' . $this->red . ',' . $value . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' ); } elseif ( 'blue' === $property ) { return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $value . ',' . $this->alpha . ')', 'rgba' ); } elseif ( 'alpha' === $property ) { return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $value . ')', 'rgba' ); } } elseif ( in_array( $property, array( 'hue', 'saturation', 'lightness' ), true ) ) { // Check if we're changing any of the hsl values. $value = ( 'hue' === $property ) ? max( 0, min( 360, $value ) ) : max( 0, min( 100, $value ) ); if ( 'hue' === $property ) { return self::new_color( 'hsla(' . $value . ',' . $this->saturation . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' ); } elseif ( 'saturation' === $property ) { return self::new_color( 'hsla(' . $this->hue . ',' . $value . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' ); } elseif ( 'lightness' === $property ) { return self::new_color( 'hsla(' . $this->hue . ',' . $this->saturation . '%,' . $value . '%,' . $this->alpha . ')', 'hsla' ); } } elseif ( 'brightness' === $property ) { // Check if we're changing the brightness. if ( $value < $this->brightness['total'] ) { $red = max( 0, min( 255, $this->red - ( $this->brightness['total'] - $value ) ) ); $green = max( 0, min( 255, $this->green - ( $this->brightness['total'] - $value ) ) ); $blue = max( 0, min( 255, $this->blue - ( $this->brightness['total'] - $value ) ) ); } elseif ( $value > $this->brightness['total'] ) { $red = max( 0, min( 255, $this->red + ( $value - $this->brightness['total'] ) ) ); $green = max( 0, min( 255, $this->green + ( $value - $this->brightness['total'] ) ) ); $blue = max( 0, min( 255, $this->blue + ( $value - $this->brightness['total'] ) ) ); } else { // If it's not smaller and it's not greater, then it's equal. return $this; } return self::new_color( 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $this->alpha . ')', 'rgba' ); } return null; } /** * Allias for the getNew method. * * @access public * @since 1.1.0 * @param string $property Can be one of the following: * red, * green, * blue, * alpha, * hue, * saturation, * lightness, * brightness. * @param int|float|string $value The new value. * @return ariColor|null */ public function get_new( $property = '', $value = '' ) { return $this->getNew( $property, $value ); } /** * Figure out what mode we're using. * * @access public * @since 1.0.0 * @param string|array $color The color we're querying. * @return string */ public function get_mode( $color ) { // Check if value is an array. if ( is_array( $color ) ) { // Does the array have an 'rgba' key? if ( isset( $color['rgba'] ) ) { $this->color = $color['rgba']; return 'rgba'; } elseif ( isset( $color['color'] ) ) { // Does the array have a 'color' key? $this->color = $color['color']; if ( is_string( $color['color'] ) && false !== strpos( $color['color'], 'rgba' ) ) { return 'rgba'; } return 'hex'; } // Is this a simple array with 4 items? if ( 4 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) && isset( $color[3] ) ) { $this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',' . intval( $color[3] ) . ')'; return 'rgba'; } elseif ( 3 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) ) { // Is this a simple array with 3 items? $this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',1)'; return 'rgba'; } // Check for other keys in the array and get values from there. $finders_keepers = array( 'r' => 'red', 'g' => 'green', 'b' => 'blue', 'a' => 'alpha', 'red' => 'red', 'green' => 'green', 'blue' => 'blue', 'alpha' => 'alpha', 'opacity' => 'alpha', ); $found = false; foreach ( $finders_keepers as $finder => $keeper ) { if ( isset( $color[ $finder ] ) ) { $found = true; $this->$keeper = $color[ $finder ]; } } // We failed, use fallback. if ( ! $found ) { $this->from_fallback(); return $this->mode; } // We did not fail, so use rgba values recovered above. $this->color = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')'; return 'rgba'; } // If a string and 3 or 6 characters long, add # since it's a hex. if ( 3 === strlen( $this->color ) || 6 === strlen( $this->color ) && false === strpos( $this->color, '#' ) ) { $this->color = '#' . $this->color; $color = $this->color; } // If we got this far, it's not an array. // Check for key identifiers in the value. $finders_keepers = array( '#' => 'hex', 'rgba' => 'rgba', 'rgb' => 'rgb', 'hsla' => 'hsla', 'hsl' => 'hsl', ); foreach ( $finders_keepers as $finder => $keeper ) { if ( false !== strrpos( $color, $finder ) ) { // Make sure hex colors have 6 digits and not more. if ( '#' === $finder && 7 < strlen( $color ) ) { $this->color = substr( $color, 0, 7 ); } return $keeper; } } // Perhaps we're using a word like "orange"? $wordcolors = $this->get_word_colors(); if ( is_string( $color ) && array_key_exists( $color, $wordcolors ) ) { $this->color = '#' . $wordcolors[ $color ]; return 'hex'; } // Fallback to hex. $this->color = $this->fallback; return 'hex'; } /** * Starts with a HEX color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_hex() { if ( ! function_exists( 'sanitize_hex_color' ) ) { require_once wp_normalize_path( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); } // Is this perhaps a word-color? $word_colors = $this->get_word_colors(); if ( array_key_exists( $this->color, $word_colors ) ) { $this->color = '#' . $word_colors[ $this->color ]; } // Sanitize color. $this->hex = sanitize_hex_color( maybe_hash_hex_color( $this->color ) ); $hex = ltrim( $this->hex, '#' ); // Fallback if needed. if ( ! $hex || 3 > strlen( $hex ) ) { $this->from_fallback(); return; } // Make sure we have 6 digits for the below calculations. if ( 3 === strlen( $hex ) ) { $hex = ltrim( $this->hex, '#' ); $hex = substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ); } // Set red, green, blue. $this->red = hexdec( substr( $hex, 0, 2 ) ); $this->green = hexdec( substr( $hex, 2, 2 ) ); $this->blue = hexdec( substr( $hex, 4, 2 ) ); $this->alpha = 1; // Set other color properties. $this->set_brightness(); $this->set_hsl(); $this->set_luminance(); } /** * Starts with an RGB color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_rgb() { $value = explode( ',', str_replace( array( ' ', 'rgb', '(', ')' ), '', $this->color ) ); // Set red, green, blue. $this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255; $this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255; $this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255; $this->alpha = 1; // Set the hex. $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue ); // Set other color properties. $this->set_brightness(); $this->set_hsl(); $this->set_luminance(); } /** * Starts with an RGBA color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_rgba() { // Set r, g, b, a properties. $value = explode( ',', str_replace( array( ' ', 'rgba', '(', ')' ), '', $this->color ) ); $this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255; $this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255; $this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255; $this->alpha = ( isset( $value[3] ) ) ? filter_var( $value[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : 1; // Limit values in the range of 0 - 255. $this->red = max( 0, min( 255, $this->red ) ); $this->green = max( 0, min( 255, $this->green ) ); $this->blue = max( 0, min( 255, $this->blue ) ); // Limit values 0 - 1. $this->alpha = max( 0, min( 1, $this->alpha ) ); // Set hex. $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue ); // Set other color properties. $this->set_brightness(); $this->set_hsl(); $this->set_luminance(); } /** * Starts with an HSL color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_hsl() { $value = explode( ',', str_replace( array( ' ', 'hsl', '(', ')', '%' ), '', $this->color ) ); $this->hue = $value[0]; $this->saturation = $value[1]; $this->lightness = $value[2]; $this->from_hsl_array(); } /** * Starts with an HSLA color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_hsla() { $value = explode( ',', str_replace( array( ' ', 'hsla', '(', ')', '%' ), '', $this->color ) ); $this->hue = $value[0]; $this->saturation = $value[1]; $this->lightness = $value[2]; $this->alpha = $value[3]; $this->from_hsl_array(); } /** * Generates the HEX value of a color given values for $red, $green, $blue. * * @access protected * @since 1.0.0 * @param int|string $red The red value of this color. * @param int|string $green The green value of this color. * @param int|string $blue The blue value of this color. * @return string */ protected function rgb_to_hex( $red, $green, $blue ) { // Get hex values properly formatted. $hex_red = $this->dexhex_double_digit( $red ); $hex_green = $this->dexhex_double_digit( $green ); $hex_blue = $this->dexhex_double_digit( $blue ); return '#' . $hex_red . $hex_green . $hex_blue; } /** * Convert a decimal value to hex and make sure it's 2 characters. * * @access protected * @since 1.0.0 * @param int|string $value The value to convert. * @return string */ protected function dexhex_double_digit( $value ) { $value = dechex( $value ); if ( 1 === strlen( $value ) ) { $value = '0' . $value; } return $value; } /** * Calculates the red, green, blue values of an HSL color. * * @access protected * @since 1.0.0 * @see https://gist.github.com/brandonheyer/5254516 */ protected function from_hsl_array() { $h = $this->hue / 360; $s = $this->saturation / 100; $l = $this->lightness / 100; $r = $l; $g = $l; $b = $l; $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s ); if ( $v > 0 ) { $m = $l + $l - $v; $sv = ( $v - $m ) / $v; $h *= 6.0; $sextant = floor( $h ); $fract = $h - $sextant; $vsf = $v * $sv * $fract; $mid1 = $m + $vsf; $mid2 = $v - $vsf; switch ( $sextant ) { case 0: $r = $v; $g = $mid1; $b = $m; break; case 1: $r = $mid2; $g = $v; $b = $m; break; case 2: $r = $m; $g = $v; $b = $mid1; break; case 3: $r = $m; $g = $mid2; $b = $v; break; case 4: $r = $mid1; $g = $m; $b = $v; break; case 5: $r = $v; $g = $m; $b = $mid2; break; } } $this->red = round( $r * 255, 0 ); $this->green = round( $g * 255, 0 ); $this->blue = round( $b * 255, 0 ); $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue ); $this->set_luminance(); } /** * Returns a CSS-formatted value for colors. * * @access public * @since 1.0.0 * @param string $mode The mode we're using. * @return string */ public function toCSS( $mode = 'hex' ) { $value = ''; switch ( $mode ) { case 'hex': $value = strtolower( $this->hex ); break; case 'rgba': $value = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')'; break; case 'rgb': $value = 'rgb(' . $this->red . ',' . $this->green . ',' . $this->blue . ')'; break; case 'hsl': $value = 'hsl(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%)'; break; case 'hsla': $value = 'hsla(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%,' . $this->alpha . ')'; break; } return $value; } /** * Alias for the toCSS method. * * @access public * @since 1.1 * @param string $mode The mode we're using. * @return string */ public function to_css( $mode = 'hex' ) { return $this->toCSS( $mode ); } /** * Sets the HSL values of a color based on the values of red, green, blue. * * @access public * @since 1.0.0 */ protected function set_hsl() { $red = $this->red / 255; $green = $this->green / 255; $blue = $this->blue / 255; $max = max( $red, $green, $blue ); $min = min( $red, $green, $blue ); $lightness = ( $max + $min ) / 2; $difference = $max - $min; if ( ! $difference ) { $hue = $saturation = 0; // Achromatic. } else { $saturation = $difference / ( 1 - abs( 2 * $lightness - 1 ) ); switch ( $max ) { case $red: $hue = 60 * fmod( ( ( $green - $blue ) / $difference ), 6 ); if ( $blue > $green ) { $hue += 360; } break; case $green: $hue = 60 * ( ( $blue - $red ) / $difference + 2 ); break; case $blue: $hue = 60 * ( ( $red - $green ) / $difference + 4 ); break; } } $this->hue = round( $hue ); $this->saturation = round( $saturation * 100 ); $this->lightness = round( $lightness * 100 ); } /** * Sets the brightness of a color based on the values of red, green, blue. * * @access protected * @since 1.0.0 */ protected function set_brightness() { $this->brightness = array( 'red' => round( $this->red * .299 ), 'green' => round( $this->green * .587 ), 'blue' => round( $this->blue * .114 ), 'total' => intval( ( $this->red * .299 ) + ( $this->green * .587 ) + ( $this->blue * .114 ) ), ); } /** * Sets the luminance of a color (range:0-255) based on the values of red, green, blue. * * @access protected * @since 1.0.0 */ protected function set_luminance() { $lum = ( 0.2126 * $this->red ) + ( 0.7152 * $this->green ) + ( 0.0722 * $this->blue ); $this->luminance = round( $lum ); } /** * Gets an array of all the wordcolors. * * @access protected * @since 1.0.0 * @return array */ protected function get_word_colors() { return array( 'aliceblue' => 'F0F8FF', 'antiquewhite' => 'FAEBD7', 'aqua' => '00FFFF', 'aquamarine' => '7FFFD4', 'azure' => 'F0FFFF', 'beige' => 'F5F5DC', 'bisque' => 'FFE4C4', 'black' => '000000', 'blanchedalmond' => 'FFEBCD', 'blue' => '0000FF', 'blueviolet' => '8A2BE2', 'brown' => 'A52A2A', 'burlywood' => 'DEB887', 'cadetblue' => '5F9EA0', 'chartreuse' => '7FFF00', 'chocolate' => 'D2691E', 'coral' => 'FF7F50', 'cornflowerblue' => '6495ED', 'cornsilk' => 'FFF8DC', 'crimson' => 'DC143C', 'cyan' => '00FFFF', 'darkblue' => '00008B', 'darkcyan' => '008B8B', 'darkgoldenrod' => 'B8860B', 'darkgray' => 'A9A9A9', 'darkgreen' => '006400', 'darkgrey' => 'A9A9A9', 'darkkhaki' => 'BDB76B', 'darkmagenta' => '8B008B', 'darkolivegreen' => '556B2F', 'darkorange' => 'FF8C00', 'darkorchid' => '9932CC', 'darkred' => '8B0000', 'darksalmon' => 'E9967A', 'darkseagreen' => '8FBC8F', 'darkslateblue' => '483D8B', 'darkslategray' => '2F4F4F', 'darkslategrey' => '2F4F4F', 'darkturquoise' => '00CED1', 'darkviolet' => '9400D3', 'deeppink' => 'FF1493', 'deepskyblue' => '00BFFF', 'dimgray' => '696969', 'dimgrey' => '696969', 'dodgerblue' => '1E90FF', 'firebrick' => 'B22222', 'floralwhite' => 'FFFAF0', 'forestgreen' => '228B22', 'fuchsia' => 'FF00FF', 'gainsboro' => 'DCDCDC', 'ghostwhite' => 'F8F8FF', 'gold' => 'FFD700', 'goldenrod' => 'DAA520', 'gray' => '808080', 'green' => '008000', 'greenyellow' => 'ADFF2F', 'grey' => '808080', 'honeydew' => 'F0FFF0', 'hotpink' => 'FF69B4', 'indianred' => 'CD5C5C', 'indigo' => '4B0082', 'ivory' => 'FFFFF0', 'khaki' => 'F0E68C', 'lavender' => 'E6E6FA', 'lavenderblush' => 'FFF0F5', 'lawngreen' => '7CFC00', 'lemonchiffon' => 'FFFACD', 'lightblue' => 'ADD8E6', 'lightcoral' => 'F08080', 'lightcyan' => 'E0FFFF', 'lightgoldenrodyellow' => 'FAFAD2', 'lightgray' => 'D3D3D3', 'lightgreen' => '90EE90', 'lightgrey' => 'D3D3D3', 'lightpink' => 'FFB6C1', 'lightsalmon' => 'FFA07A', 'lightseagreen' => '20B2AA', 'lightskyblue' => '87CEFA', 'lightslategray' => '778899', 'lightslategrey' => '778899', 'lightsteelblue' => 'B0C4DE', 'lightyellow' => 'FFFFE0', 'lime' => '00FF00', 'limegreen' => '32CD32', 'linen' => 'FAF0E6', 'magenta' => 'FF00FF', 'maroon' => '800000', 'mediumaquamarine' => '66CDAA', 'mediumblue' => '0000CD', 'mediumorchid' => 'BA55D3', 'mediumpurple' => '9370D0', 'mediumseagreen' => '3CB371', 'mediumslateblue' => '7B68EE', 'mediumspringgreen' => '00FA9A', 'mediumturquoise' => '48D1CC', 'mediumvioletred' => 'C71585', 'midnightblue' => '191970', 'mintcream' => 'F5FFFA', 'mistyrose' => 'FFE4E1', 'moccasin' => 'FFE4B5', 'navajowhite' => 'FFDEAD', 'navy' => '000080', 'oldlace' => 'FDF5E6', 'olive' => '808000', 'olivedrab' => '6B8E23', 'orange' => 'FFA500', 'orangered' => 'FF4500', 'orchid' => 'DA70D6', 'palegoldenrod' => 'EEE8AA', 'palegreen' => '98FB98', 'paleturquoise' => 'AFEEEE', 'palevioletred' => 'DB7093', 'papayawhip' => 'FFEFD5', 'peachpuff' => 'FFDAB9', 'peru' => 'CD853F', 'pink' => 'FFC0CB', 'plum' => 'DDA0DD', 'powderblue' => 'B0E0E6', 'purple' => '800080', 'red' => 'FF0000', 'rosybrown' => 'BC8F8F', 'royalblue' => '4169E1', 'saddlebrown' => '8B4513', 'salmon' => 'FA8072', 'sandybrown' => 'F4A460', 'seagreen' => '2E8B57', 'seashell' => 'FFF5EE', 'sienna' => 'A0522D', 'silver' => 'C0C0C0', 'skyblue' => '87CEEB', 'slateblue' => '6A5ACD', 'slategray' => '708090', 'slategrey' => '708090', 'snow' => 'FFFAFA', 'springgreen' => '00FF7F', 'steelblue' => '4682B4', 'tan' => 'D2B48C', 'teal' => '008080', 'thistle' => 'D8BFD8', 'tomato' => 'FF6347', 'turquoise' => '40E0D0', 'violet' => 'EE82EE', 'wheat' => 'F5DEB3', 'white' => 'FFFFFF', 'whitesmoke' => 'F5F5F5', 'yellow' => 'FFFF00', 'yellowgreen' => '9ACD32', ); } /** * Use fallback object. * * @access protected * @since 1.2.0 */ protected function from_fallback() { $this->color = $this->fallback; if ( ! $this->fallback_obj ) { $this->fallback_obj = self::newColor( $this->fallback ); } $this->color = $this->fallback_obj->color; $this->mode = $this->fallback_obj->mode; $this->red = $this->fallback_obj->red; $this->green = $this->fallback_obj->green; $this->blue = $this->fallback_obj->blue; $this->alpha = $this->fallback_obj->alpha; $this->hue = $this->fallback_obj->hue; $this->saturation = $this->fallback_obj->saturation; $this->lightness = $this->fallback_obj->lightness; $this->luminance = $this->fallback_obj->luminance; $this->hex = $this->fallback_obj->hex; } /** * Handle non-existing public methods. * * @access public * @since 1.1.0 * @param string $name The method name. * @param mixed $arguments The method arguments. * @return mixed */ public function __call( $name, $arguments ) { if ( method_exists( $this, $name ) ) { call_user_func( array( $this, $name ), $arguments ); } else { return $arguments; } } /** * Handle non-existing public static methods. * * @static * @access public * @since 1.1.0 * @param string $name The method name. * @param mixed $arguments The method arguments. * @return mixed */ public static function __callStatic( $name, $arguments ) { if ( method_exists( __CLASS__, $name ) ) { call_user_func( array( __CLASS__, $name ), $arguments ); } else { return $arguments; } } } } kirki/lib/class-kirki-color.php000064400000025353151232236310012472 0ustar00mode; } return $obj->toCSS( $mode ); } /** * Gets the rgb value of a color. * * @static * @access public * @param string $color The color. * @param boolean $implode Whether we want to implode the values or not. * @return array|string */ public static function get_rgb( $color, $implode = false ) { $obj = ariColor::newColor( $color ); if ( $implode ) { return $obj->toCSS( 'rgb' ); } return array( $obj->red, $obj->green, $obj->blue ); } /** * A proxy for the sanitize_color method. * * @static * @access public * @param string|array $color The color to convert. * @return string The hex value of the color. */ public static function rgba2hex( $color ) { return self::sanitize_color( $color, 'hex' ); } /** * Get the alpha channel from an rgba color. * * @static * @access public * @param string $color The rgba color formatted like rgba(r,g,b,a). * @return int|float The alpha value of the color. */ public static function get_alpha_from_rgba( $color ) { $obj = ariColor::newColor( $color ); return $obj->alpha; } /** * Gets the rgba value of the $color. * * @static * @access public * @param string $color The hex value of a color. * @param int|float $alpha Opacity level (0-1). * @return string */ public static function get_rgba( $color = '#fff', $alpha = 1 ) { $obj = ariColor::newColor( $color ); if ( 1 == $alpha ) { return $obj->toCSS( 'rgba' ); } // Make sure that opacity is properly formatted. // Converts 1-100 values to 0-1. if ( $alpha > 1 || $alpha < -1 ) { // Divide by 100. $alpha /= 100; } // Get absolute value. $alpha = abs( $alpha ); // Max 1. if ( 1 < $alpha ) { $alpha = 1; } $new_obj = $obj->getNew( 'alpha', $alpha ); return $new_obj->toCSS( 'rgba' ); } /** * Strips the alpha value from an RGBA color string. * * @static * @access public * @param string $color The RGBA color string. * @return string The corresponding RGB string. */ public static function rgba_to_rgb( $color ) { $obj = ariColor::newColor( $color ); return $obj->toCSS( 'rgb' ); } /** * Gets the brightness of the $hex color. * * @static * @access public * @param string $hex The hex value of a color. * @return int Value between 0 and 255. */ public static function get_brightness( $hex ) { $hex = self::sanitize_hex( $hex, false ); // Returns brightness value from 0 to 255. return intval( ( ( hexdec( substr( $hex, 0, 2 ) ) * 299 ) + ( hexdec( substr( $hex, 2, 2 ) ) * 587 ) + ( hexdec( substr( $hex, 4, 2 ) ) * 114 ) ) / 1000 ); } /** * Adjusts brightness of the $hex color. * * @static * @access public * @param string $hex The hex value of a color. * @param integer $steps Should be between -255 and 255. Negative = darker, positive = lighter. * @return string Returns hex color. */ public static function adjust_brightness( $hex, $steps ) { $hex = self::sanitize_hex( $hex, false ); $steps = max( -255, min( 255, $steps ) ); // Adjust number of steps and keep it inside 0 to 255. $red = max( 0, min( 255, hexdec( substr( $hex, 0, 2 ) ) + $steps ) ); $green = max( 0, min( 255, hexdec( substr( $hex, 2, 2 ) ) + $steps ) ); $blue = max( 0, min( 255, hexdec( substr( $hex, 4, 2 ) ) + $steps ) ); $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT ); $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT ); $blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT ); return self::sanitize_hex( $red_hex . $green_hex . $blue_hex ); } /** * Mixes 2 hex colors. * The "percentage" variable is the percent of the first color. * to be used it the mix. default is 50 (equal mix). * * @static * @access public * @param string|false $hex1 Color. * @param string|false $hex2 Color. * @param int $percentage A value between 0 and 100. * @return string Returns hex color. */ public static function mix_colors( $hex1, $hex2, $percentage ) { $hex1 = self::sanitize_hex( $hex1, false ); $hex2 = self::sanitize_hex( $hex2, false ); $red = ( $percentage * hexdec( substr( $hex1, 0, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 0, 2 ) ) ) / 100; $green = ( $percentage * hexdec( substr( $hex1, 2, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 2, 2 ) ) ) / 100; $blue = ( $percentage * hexdec( substr( $hex1, 4, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 4, 2 ) ) ) / 100; $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT ); $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT ); $blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT ); return self::sanitize_hex( $red_hex . $green_hex . $blue_hex ); } /** * Convert hex color to hsv. * * @static * @access public * @param string $hex The hex value of color 1. * @return array Returns array( 'h', 's', 'v' ). */ public static function hex_to_hsv( $hex ) { $rgb = (array) (array) self::get_rgb( self::sanitize_hex( $hex, false ) ); return self::rgb_to_hsv( $rgb ); } /** * Convert hex color to hsv. * * @static * @access public * @param string $color The rgb color to convert array( 'r', 'g', 'b' ). * @return array Returns array( 'h', 's', 'v' ). */ public static function rgb_to_hsv( $color = array() ) { $var_r = ( $color[0] / 255 ); $var_g = ( $color[1] / 255 ); $var_b = ( $color[2] / 255 ); $var_min = min( $var_r, $var_g, $var_b ); $var_max = max( $var_r, $var_g, $var_b ); $del_max = $var_max - $var_min; $h = 0; $s = 0; $v = $var_max; if ( 0 != $del_max ) { $s = $del_max / $var_max; $del_r = ( ( ( $var_max - $var_r ) / 6 ) + ( $del_max / 2 ) ) / $del_max; $del_g = ( ( ( $var_max - $var_g ) / 6 ) + ( $del_max / 2 ) ) / $del_max; $del_b = ( ( ( $var_max - $var_b ) / 6 ) + ( $del_max / 2 ) ) / $del_max; if ( $var_r == $var_max ) { $h = $del_b - $del_g; } elseif ( $var_g == $var_max ) { $h = ( 1 / 3 ) + $del_r - $del_b; } elseif ( $var_b == $var_max ) { $h = ( 2 / 3 ) + $del_g - $del_r; } if ( $h < 0 ) { $h++; } if ( $h > 1 ) { $h--; } } return array( 'h' => round( $h, 2 ), 's' => round( $s, 2 ), 'v' => round( $v, 2 ), ); } /** * This is a very simple algorithm that works by summing up the differences between the three color components red, green and blue. * A value higher than 500 is recommended for good readability. * * @static * @access public * @param string $color_1 The 1st color. * @param string $color_2 The 2nd color. * @return string */ public static function color_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) { $color_1 = self::sanitize_hex( $color_1, false ); $color_2 = self::sanitize_hex( $color_2, false ); $color_1_rgb = self::get_rgb( $color_1 ); $color_2_rgb = self::get_rgb( $color_2 ); $r_diff = max( $color_1_rgb[0], $color_2_rgb[0] ) - min( $color_1_rgb[0], $color_2_rgb[0] ); $g_diff = max( $color_1_rgb[1], $color_2_rgb[1] ) - min( $color_1_rgb[1], $color_2_rgb[1] ); $b_diff = max( $color_1_rgb[2], $color_2_rgb[2] ) - min( $color_1_rgb[2], $color_2_rgb[2] ); $color_diff = $r_diff + $g_diff + $b_diff; return $color_diff; } /** * This function tries to compare the brightness of the colors. * A return value of more than 125 is recommended. * Combining it with the color_difference function above might make sense. * * @static * @access public * @param string $color_1 The 1st color. * @param string $color_2 The 2nd color. * @return string */ public static function brightness_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) { $color_1 = self::sanitize_hex( $color_1, false ); $color_2 = self::sanitize_hex( $color_2, false ); $color_1_rgb = self::get_rgb( $color_1 ); $color_2_rgb = self::get_rgb( $color_2 ); $br_1 = ( 299 * $color_1_rgb[0] + 587 * $color_1_rgb[1] + 114 * $color_1_rgb[2] ) / 1000; $br_2 = ( 299 * $color_2_rgb[0] + 587 * $color_2_rgb[1] + 114 * $color_2_rgb[2] ) / 1000; return intval( abs( $br_1 - $br_2 ) ); } /** * Uses the luminosity to calculate the difference between the given colors. * The returned value should be bigger than 5 for best readability. * * @static * @access public * @param string $color_1 The 1st color. * @param string $color_2 The 2nd color. * @return string */ public static function lumosity_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) { $color_1 = self::sanitize_hex( $color_1, false ); $color_2 = self::sanitize_hex( $color_2, false ); $color_1_rgb = self::get_rgb( $color_1 ); $color_2_rgb = self::get_rgb( $color_2 ); $l1 = 0.2126 * pow( $color_1_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_1_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_1_rgb[2] / 255, 2.2 ); $l2 = 0.2126 * pow( $color_2_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_2_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_2_rgb[2] / 255, 2.2 ); $lum_diff = ( $l1 > $l2 ) ? ( $l1 + 0.05 ) / ( $l2 + 0.05 ) : ( $l2 + 0.05 ) / ( $l1 + 0.05 ); return round( $lum_diff, 2 ); } } kirki/lib/.htaccess000044400000000143151232236310010213 0ustar00 Order Allow,Deny Deny from all kirki/modules/css/field/class-kirki-output-field-background.php000064400000003064151232236310020662 0ustar00 'global', 'element' => 'body', 'prefix' => '', 'suffix' => '', ) ); foreach ( array( 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ) as $property ) { // See https://github.com/aristath/kirki/issues/1808. if ( 'background-color' === $property && ( ! isset( $value['background-image'] ) || empty( $value['background-image'] ) ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; } if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; } } } } kirki/modules/css/field/class-kirki-output-field-dimensions.php000064400000002672151232236320020720 0ustar00 '', 'property' => '', 'media_query' => 'global', 'prefix' => '', 'suffix' => '', ) ); if ( ! is_array( $value ) ) { return; } foreach ( array_keys( $value ) as $key ) { $property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key; if ( isset( $output['choice'] ) && $output['property'] ) { if ( $key === $output['choice'] ) { $property = $output['property']; } else { continue; } } if ( false !== strpos( $output['property'], '%%' ) ) { $property = str_replace( '%%', $key, $output['property'] ); } $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix']; } } } kirki/modules/css/field/class-kirki-output-field-image.php000064400000003210151232236320017617 0ustar00 'global', 'prefix' => '', 'units' => '', 'suffix' => '', ) ); if ( is_array( $value ) ) { if ( isset( $output['choice'] ) && $output['choice'] ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value[ $output['choice'] ] ) . $output['units'] . $output['suffix']; return; } if ( isset( $value['url'] ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix']; return; } return; } $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; } } kirki/modules/css/field/class-kirki-output-field-multicolor.php000064400000003057151232236320020737 0ustar00 $sub_value ) { // If "element" is not defined, there's no reason to continue. if ( ! isset( $output['element'] ) ) { continue; } // If the "choice" is not the same as the $key in our loop, there's no reason to proceed. if ( isset( $output['choice'] ) && $key !== $output['choice'] ) { continue; } // If "property" is not defined, fallback to the $key. $property = ( ! isset( $output['property'] ) || empty( $output['property'] ) ) ? $key : $output['property']; // If "media_query" is not defined, use "global". if ( ! isset( $output['media_query'] ) || empty( $output['media_query'] ) ) { $output['media_query'] = 'global'; } // If "suffix" is defined, add it to the value. $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; // Create the styles. $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value . $output['suffix']; } } } kirki/modules/css/field/class-kirki-output-field-typography.php000064400000006114151232236320020751 0ustar00field['default'][ $property ] ) ) { continue; } // Early exit if the value is not saved in the values. if ( ! isset( $value[ $property ] ) || ! $value[ $property ] ) { continue; } // Early exit if we use "choice" but not for this property. if ( isset( $output['choice'] ) && $output['choice'] !== $property ) { continue; } // Take care of variants. if ( 'variant' === $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) { // Get the font_weight. $font_weight = str_replace( 'italic', '', $value['variant'] ); $font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight; // Is this italic? $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight; if ( $is_italic ) { $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic'; } continue; } $property_value = $this->process_property_value( $property, $value[ $property ] ); if ( 'font-family' === $property ) { $value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : ''; $property_value = $this->process_property_value( $property, array( $value['font-family'], $value['font-backup'], ) ); } $property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property; $property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value; $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix']; } } } kirki/modules/css/field/.htaccess000044400000000143151232236320012771 0ustar00 Order Allow,Deny Deny from all kirki/modules/css/property/class-kirki-output-property-background-image.php000064400000001725151232236320023347 0ustar00value ) && isset( $this->value['url'] ) ) { $this->value = $this->value['url']; } if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) { if ( empty( $this->value ) ) { return; } if ( preg_match( '/^\d+$/', $this->value ) ) { $this->value = 'url("' . set_url_scheme( wp_get_attachment_url( $this->value ) ) . '")'; } else { $this->value = 'url("' . set_url_scheme( $this->value ) . '")'; } } } } kirki/modules/css/property/class-kirki-output-property-background-position.php000064400000003436151232236320024132 0ustar00value = trim( $this->value ); // If you use calc() there, I suppose you know what you're doing. // No need to process this any further, just exit. if ( false !== strpos( $this->value, 'calc' ) ) { return; } // If the value is initial or inherit, we don't need to do anything. // Just exit. if ( 'initial' === $this->value || 'inherit' === $this->value ) { return; } $x_dimensions = array( 'left', 'center', 'right' ); $y_dimensions = array( 'top', 'center', 'bottom' ); // If there's a space, we have an X and a Y value. if ( false !== strpos( $this->value, ' ' ) ) { $xy = explode( ' ', $this->value ); $x = trim( $xy[0] ); $y = trim( $xy[1] ); // If x is not left/center/right, we need to sanitize it. if ( ! in_array( $x, $x_dimensions, true ) ) { $x = sanitize_text_field( $x ); } if ( ! in_array( $y, $y_dimensions, true ) ) { $y = sanitize_text_field( $y ); } $this->value = $x . ' ' . $y; return; } $x = 'center'; foreach ( $x_dimensions as $x_dimension ) { if ( false !== strpos( $this->value, $x_dimension ) ) { $x = $x_dimension; } } $y = 'center'; foreach ( $y_dimensions as $y_dimension ) { if ( false !== strpos( $this->value, $y_dimension ) ) { $y = $y_dimension; } } $this->value = $x . ' ' . $y; } } kirki/modules/css/property/class-kirki-output-property-font-family.php000064400000003323151232236320022371 0ustar00value; $backup = ''; if ( is_array( $this->value ) && isset( $this->value[0] ) && isset( $this->value[1] ) ) { $family = $this->value[0]; $backup = $this->value[1]; } // Make sure the value is a string. // If not, then early exit. if ( ! is_string( $family ) ) { return; } // Hack for standard fonts. $family = str_replace( '"', '"', $family ); // Add backup font. if ( Kirki_Fonts::is_google_font( $family ) ) { if ( '' === $backup && isset( $google_fonts_array[ $family ] ) && isset( $backup_fonts[ $google_fonts_array[ $family ]['category'] ] ) ) { $backup = $backup_fonts[ $google_fonts_array[ $family ]['category'] ]; } // Add double quotes if needed. if ( false !== strpos( $family, ' ' ) && false === strpos( $family, '"' ) ) { $this->value = '"' . $family . '", ' . $backup; return; } $this->value = $family . ', ' . $backup; return; } // Add double quotes if needed. if ( false !== strpos( $family, ' ' ) && false === strpos( $family, '"' ) ) { $this->value = '"' . $family . '"'; } $this->value = html_entity_decode( $family, ENT_QUOTES ); } } kirki/modules/css/property/class-kirki-output-property.php000064400000002101151232236320020137 0ustar00property = $property; $this->value = $value; $this->process_value(); } /** * Modifies the value. * * @access protected */ protected function process_value() { } /** * Gets the value. * * @access protected */ public function get_value() { return $this->value; } } kirki/modules/css/property/.htaccess000044400000000143151232236320013572 0ustar00 Order Allow,Deny Deny from all kirki/modules/css/class-kirki-css-to-file.php000064400000007317151232236320015174 0ustar00get_path( 'file' ) ) ) { // If the file-write fails, fallback to inline // and cache the failure so we don't try again immediately. $this->write_file(); } add_action( 'customize_save_after', array( $this, 'write_file' ) ); } /** * Gets the path of the CSS file and folder in the filesystem. * * @access protected * @since 3.0.0 * @param string $context Can be "file" or "folder". If empty, returns both as array. * @return string|array */ protected function get_path( $context = '' ) { $upload_dir = wp_upload_dir(); $paths = array( 'file' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css/styles.css' ), 'folder' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css' ), ); if ( 'file' === $context ) { return $paths['file']; } if ( 'folder' === $context ) { return $paths['folder']; } return $paths; } /** * Gets the URL of the CSS file in the filesystem. * * @access public * @since 3.0.0 * @return string */ public function get_url() { $upload_dir = wp_upload_dir(); return esc_url_raw( $upload_dir['baseurl'] . '/kirki-css/styles.css' ); } /** * Gets the timestamp of the file. * This will be used as "version" for cache-busting purposes. * * @access public * @since 3.0.0 * @return integer|false */ public function get_timestamp() { if ( file_exists( $this->get_path( 'file' ) ) ) { return filemtime( $this->get_path( 'file' ) ); } return false; } /** * Writes the file to disk. * * @access public * @since 3.0.0 * @return bool */ public function write_file() { $css = array(); $configs = Kirki::$config; foreach ( $configs as $config_id => $args ) { // Get the CSS we want to write. $css[ $config_id ] = apply_filters( "kirki_{$config_id}_dynamic_css", Kirki_Modules_CSS::loop_controls( $config_id ) ); } $css = implode( $css, '' ); /* WIP: Minimize the CSS a bit. Commented-out because of https://github.com/aristath/kirki/issues/1787 $css = str_replace( array( "\n", "\t", "\r\n" ), '', $css ); $css = str_replace( array( '{ ', '{ ', '{ ' ), '{', $css ); $css = str_replace( ': ', ':', $css ); $css = str_replace( array( '; ', '; ', '; ' ), ';', $css ); $css = explode( '}', $css ); $css = array_unique( $css ); $css = implode( $css, '}' ); */ // If the folder doesn't exist, create it. if ( ! file_exists( $this->get_path( 'folder' ) ) ) { wp_mkdir_p( $this->get_path( 'folder' ) ); } $filesystem = $this->get_filesystem(); $write_file = (bool) $filesystem->put_contents( $this->get_path( 'file' ), $css ); if ( ! $write_file ) { $this->fallback = true; set_transient( 'kirki_css_write_to_file_failed', true, HOUR_IN_SECONDS ); } return $write_file; } /** * Gets the WP_Filesystem object. * * @access protected * @since 3.0.0 * @return object */ protected function get_filesystem() { // The WordPress filesystem. global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem(); } return $wp_filesystem; } } kirki/modules/css/class-kirki-modules-css-generator.php000064400000014457151232236320017274 0ustar00 self::$output, 'sanitize_callback' => null, ), ); } // Get the value of this field. self::$value = Kirki_Values::get_sanitized_field_value( $field ); // Find the class that will handle the outpout for this field. $classname = 'Kirki_Output'; $field_output_classes = apply_filters( "kirki_{$field['kirki_config']}_output_control_classnames", array( 'kirki-background' => 'Kirki_Output_Field_Background', 'kirki-dimensions' => 'Kirki_Output_Field_Dimensions', 'kirki-image' => 'Kirki_Output_Field_Image', 'kirki-typography' => 'Kirki_Output_Field_Typography', 'kirki-multicolor' => 'Kirki_Output_Field_Multicolor', ) ); if ( array_key_exists( self::$field_type, $field_output_classes ) ) { $classname = $field_output_classes[ self::$field_type ]; } $obj = new $classname( $field['kirki_config'], self::$output, self::$value, $field ); return $obj->get_styles(); } /** * Gets the array of generated styles and creates the minimized, inline CSS. * * @static * @access public * @param array $css The CSS definitions array. * @return string The generated CSS. */ public static function styles_parse( $css = array() ) { // Pass our styles from the kirki_styles_array filter. $css = apply_filters( 'kirki_styles_array', $css ); // Process the array of CSS properties and produce the final CSS. $final_css = ''; if ( ! is_array( $css ) || empty( $css ) ) { return ''; } foreach ( $css as $media_query => $styles ) { $final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : ''; foreach ( $styles as $style => $style_array ) { $css_for_style = ''; foreach ( $style_array as $property => $value ) { if ( is_string( $value ) && '' !== $value ) { $css_for_style .= $property . ':' . $value . ';'; } elseif ( is_array( $value ) ) { foreach ( $value as $subvalue ) { if ( is_string( $subvalue ) && '' !== $subvalue ) { $css_for_style .= $property . ':' . $subvalue . ';'; } } } $value = ( is_string( $value ) ) ? $value : ''; } if ( '' !== $css_for_style ) { $final_css .= $style . '{' . $css_for_style . '}'; } } $final_css .= ( 'global' !== $media_query ) ? '}' : ''; } return $final_css; } /** * Add prefixes if necessary. * * @param array $css The CSS definitions array. * @return array */ public static function add_prefixes( $css ) { if ( is_array( $css ) ) { foreach ( $css as $media_query => $elements ) { foreach ( $elements as $element => $style_array ) { foreach ( $style_array as $property => $value ) { // Add -webkit-* and -moz-*. if ( is_string( $property ) && in_array( $property, array( 'border-radius', 'box-shadow', 'box-sizing', 'text-shadow', 'transform', 'background-size', 'transition', 'transition-property', ), true ) ) { unset( $css[ $media_query ][ $element ][ $property ] ); $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; $css[ $media_query ][ $element ][ $property ] = $value; } // Add -ms-* and -o-*. if ( is_string( $property ) && in_array( $property, array( 'transform', 'background-size', 'transition', 'transition-property', ), true ) ) { unset( $css[ $media_query ][ $element ][ $property ] ); $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; $css[ $media_query ][ $element ][ $property ] = $value; } } } } // End foreach(). } // End if(). return $css; } } kirki/modules/css/class-kirki-modules-css.php000064400000021765151232236320015310 0ustar00 '/class-kirki-css-to-file.php', 'Kirki_Modules_CSS_Generator' => '/class-kirki-modules-css-generator.php', 'Kirki_Output' => '/class-kirki-output.php', 'Kirki_Output_Field_Background' => '/field/class-kirki-output-field-background.php', 'Kirki_Output_Field_Image' => '/field/class-kirki-output-field-image.php', 'Kirki_Output_Field_Multicolor' => '/field/class-kirki-output-field-multicolor.php', 'Kirki_Output_Field_Dimensions' => '/field/class-kirki-output-field-dimensions.php', 'Kirki_Output_Field_Typography' => '/field/class-kirki-output-field-typography.php', 'Kirki_Output_Property' => '/property/class-kirki-output-property.php', 'Kirki_Output_Property_Background_Image' => '/property/class-kirki-output-property-background-image.php', 'Kirki_Output_Property_Background_Position' => '/property/class-kirki-output-property-background-position.php', 'Kirki_Output_Property_Font_Family' => '/property/class-kirki-output-property-font-family.php', ); foreach ( $class_files as $class_name => $file ) { if ( ! class_exists( $class_name ) ) { include_once wp_normalize_path( dirname( __FILE__ ) . $file ); } } add_action( 'init', array( $this, 'init' ) ); } /** * Gets an instance of this object. * Prevents duplicate instances which avoid artefacts and improves performance. * * @static * @access public * @since 3.0.0 * @return object */ public static function get_instance() { if ( ! self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Init. * * @access public */ public function init() { Kirki_Modules_Webfonts::get_instance(); global $wp_customize; $config = apply_filters( 'kirki_config', array() ); $priority = 999; if ( isset( $config['styles_priority'] ) ) { $priority = absint( $config['styles_priority'] ); } // Allow completely disabling Kirki CSS output. if ( ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) || ( isset( $config['disable_output'] ) && true === $config['disable_output'] ) ) { return; } $method = apply_filters( 'kirki_dynamic_css_method', 'inline' ); if ( $wp_customize ) { // If we're in the customizer, load inline no matter what. add_action( 'wp_enqueue_scripts', array( $this, 'inline_dynamic_css' ), $priority ); // If we're using file method, on save write the new styles. if ( 'file' === $method ) { $this->css_to_file = new Kirki_CSS_To_File(); add_action( 'customize_save_after', array( $this->css_to_file, 'write_file' ) ); } return; } if ( 'file' === $method ) { // Attempt to write the CSS to file. $this->css_to_file = new Kirki_CSS_To_File(); // If we succesd, load this file. $failed = get_transient( 'kirki_css_write_to_file_failed' ); // If writing CSS to file hasn't failed, just enqueue this file. if ( ! $failed ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_compiled_file' ), $priority ); return; } } // If we are in the customizer, load CSS using inline-styles. // If we are in the frontend AND self::$ajax is true, then load dynamic CSS using AJAX. if ( ( true === self::$ajax ) || ( isset( $config['inline_css'] ) && false === $config['inline_css'] ) ) { add_action( 'wp_enqueue_scripts', array( $this, 'frontend_styles' ), $priority ); add_action( 'wp_ajax_kirki_dynamic_css', array( $this, 'ajax_dynamic_css' ) ); add_action( 'wp_ajax_nopriv_kirki_dynamic_css', array( $this, 'ajax_dynamic_css' ) ); return; } // If we got this far then add styles inline. add_action( 'wp_enqueue_scripts', array( $this, 'inline_dynamic_css' ), $priority ); } /** * Enqueues compiled CSS file. * * @access public * @since 3.0.0 */ public function enqueue_compiled_file() { wp_enqueue_style( 'kirki-styles', $this->css_to_file->get_url(), array(), $this->css_to_file->get_timestamp() ); } /** * Adds inline styles. * * @access public */ public function inline_dynamic_css() { $configs = Kirki::$config; if ( ! $this->processed ) { foreach ( $configs as $config_id => $args ) { if ( isset( $args['disable_output'] ) && true === $args['disable_output'] ) { continue; } $styles = self::loop_controls( $config_id ); $styles = apply_filters( "kirki_{$config_id}_dynamic_css", $styles ); if ( ! empty( $styles ) ) { $stylesheet = apply_filters( "kirki_{$config_id}_stylesheet", false ); if ( $stylesheet ) { wp_add_inline_style( $stylesheet, $styles ); continue; } wp_enqueue_style( 'kirki-styles-' . $config_id, trailingslashit( Kirki::$url ) . 'assets/css/kirki-styles.css', array(), KIRKI_VERSION ); wp_add_inline_style( 'kirki-styles-' . $config_id, $styles ); } } $this->processed = true; } if ( self::$enqueue_fa && apply_filters( 'kirki_load_fontawesome', true ) ) { wp_enqueue_script( 'kirki-fontawesome-font', 'https://use.fontawesome.com/30858dc40a.js', array(), '4.0.7', true ); } } /** * Get the dynamic-css.php file * * @access public */ public function ajax_dynamic_css() { require wp_normalize_path( Kirki::$path . '/modules/css/dynamic-css.php' ); exit; } /** * Enqueues the ajax stylesheet. * * @access public */ public function frontend_styles() { wp_enqueue_style( 'kirki-styles-php', admin_url( 'admin-ajax.php' ) . '?action=kirki_dynamic_css', array(), KIRKI_VERSION ); } /** * Loop through all fields and create an array of style definitions. * * @static * @access public * @param string $config_id The configuration ID. */ public static function loop_controls( $config_id ) { // Get an instance of the Kirki_Modules_CSS_Generator class. // This will make sure google fonts and backup fonts are loaded. Kirki_Modules_CSS_Generator::get_instance(); $fields = Kirki::$fields; $css = array(); // Early exit if no fields are found. if ( empty( $fields ) ) { return; } foreach ( $fields as $field ) { // Only process fields that belong to $config_id. if ( $config_id !== $field['kirki_config'] ) { continue; } if ( true === apply_filters( "kirki_{$config_id}_css_skip_hidden", true ) ) { // Only continue if field dependencies are met. if ( ! empty( $field['required'] ) ) { $valid = true; foreach ( $field['required'] as $requirement ) { if ( isset( $requirement['setting'] ) && isset( $requirement['value'] ) && isset( $requirement['operator'] ) ) { $controller_value = Kirki_Values::get_value( $config_id, $requirement['setting'] ); if ( ! Kirki_Helper::compare_values( $controller_value, $requirement['value'], $requirement['operator'] ) ) { $valid = false; } } } if ( ! $valid ) { continue; } } } // Only continue if $field['output'] is set. if ( isset( $field['output'] ) && ! empty( $field['output'] ) ) { $css = Kirki_Helper::array_replace_recursive( $css, Kirki_Modules_CSS_Generator::css( $field ) ); // Add the globals. if ( isset( self::$css_array[ $config_id ] ) && ! empty( self::$css_array[ $config_id ] ) ) { Kirki_Helper::array_replace_recursive( $css, self::$css_array[ $config_id ] ); } } } $css = apply_filters( "kirki_{$config_id}_styles", $css ); if ( is_array( $css ) ) { return Kirki_Modules_CSS_Generator::styles_parse( Kirki_Modules_CSS_Generator::add_prefixes( $css ) ); } } /** * Runs when we're adding a font-awesome field to allow enqueueing the * fontawesome script on the frontend. * * @static * @since 3.0.26 * @access public * @return void */ public static function add_fontawesome_script() { self::$enqueue_fa = true; } } kirki/modules/css/class-kirki-output.php000064400000024444151232236320014407 0ustar00config_id = $config_id; $this->value = $value; $this->output = $output; $this->field = $field; $this->parse_output(); } /** * If we have a sanitize_callback defined, apply it to the value. * * @param array $output The output args. * @param string|array $value The value. * * @return string|array */ protected function apply_sanitize_callback( $output, $value ) { if ( isset( $output['sanitize_callback'] ) && null !== $output['sanitize_callback'] ) { // If the sanitize_callback is invalid, return the value. if ( ! is_callable( $output['sanitize_callback'] ) ) { return $value; } return call_user_func( $output['sanitize_callback'], $this->value ); } return $value; } /** * If we have a value_pattern defined, apply it to the value. * * @param array $output The output args. * @param string|array $value The value. * @return string|array */ protected function apply_value_pattern( $output, $value ) { if ( isset( $output['value_pattern'] ) && ! empty( $output['value_pattern'] ) && is_string( $output['value_pattern'] ) ) { if ( ! is_array( $value ) ) { $value = str_replace( '$', $value, $output['value_pattern'] ); } if ( is_array( $value ) ) { foreach ( array_keys( $value ) as $value_k ) { if ( ! is_string( $value[ $value_k ] ) ) { continue; } if ( isset( $output['choice'] ) ) { if ( $output['choice'] === $value_k ) { $value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] ); } continue; } $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] ); } } $value = $this->apply_pattern_replace( $output, $value ); } // End if(). return $value; } /** * If we have a value_pattern defined, apply it to the value. * * @param array $output The output args. * @param string|array $value The value. * @return string|array */ protected function apply_pattern_replace( $output, $value ) { if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) { $option_type = ( '' !== Kirki::get_config_param( $this->config_id, 'option_type' ) ) ? Kirki::get_config_param( $this->config_id, 'option_type' ) : 'theme_mod'; $option_name = Kirki::get_config_param( $this->config_id, 'option_name' ); $options = array(); if ( $option_name ) { $options = ( 'site_option' === $option_type ) ? get_site_option( $option_name ) : get_option( $option_name ); } foreach ( $output['pattern_replace'] as $search => $replace ) { $replacement = ''; switch ( $option_type ) { case 'option': if ( is_array( $options ) ) { if ( $option_name ) { $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace ); $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; break; } $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; break; } $replacement = get_option( $replace ); break; case 'site_option': $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); break; case 'user_meta': $user_id = get_current_user_id(); if ( $user_id ) { // @codingStandardsIgnoreLine $replacement = get_user_meta( $user_id, $replace, true ); } break; default: $replacement = get_theme_mod( $replace ); } $replacement = ( false === $replacement ) ? '' : $replacement; if ( is_array( $value ) ) { foreach ( $value as $k => $v ) { $_val = ( isset( $value[ $v ] ) ) ? $value[ $v ] : $v; $value[ $k ] = str_replace( $search, $replacement, $_val ); } return $value; } $value = str_replace( $search, $replacement, $value ); } // End foreach(). } // End if(). return $value; } /** * Parses the output arguments. * Calls the process_output method for each of them. * * @access protected */ protected function parse_output() { foreach ( $this->output as $output ) { $skip = false; // Apply any sanitization callbacks defined. $value = $this->apply_sanitize_callback( $output, $this->value ); // Skip if value is empty. if ( '' === $this->value ) { $skip = true; } // No need to proceed this if the current value is the same as in the "exclude" value. if ( isset( $output['exclude'] ) && is_array( $output['exclude'] ) ) { foreach ( $output['exclude'] as $exclude ) { if ( is_array( $value ) ) { if ( is_array( $exclude ) ) { $diff1 = array_diff( $value, $exclude ); $diff2 = array_diff( $exclude, $value ); if ( empty( $diff1 ) && empty( $diff2 ) ) { $skip = true; } } // If 'choice' is defined check for sub-values too. // Fixes https://github.com/aristath/kirki/issues/1416. // @codingStandardsIgnoreLine WordPress.PHP.StrictComparisons.LooseComparison if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison $skip = true; } } if ( $skip ) { continue; } // Skip if value is defined as excluded. if ( $exclude === $value || ( '' === $exclude && empty( $value ) ) ) { $skip = true; } } } if ( $skip ) { continue; } // Apply any value patterns defined. $value = $this->apply_value_pattern( $output, $value ); if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { $output['element'] = array_unique( $output['element'] ); sort( $output['element'] ); $output['element'] = implode( ',', $output['element'] ); } $value = $this->process_value( $value, $output ); $this->process_output( $output, $value ); } // End foreach(). } /** * Parses an output and creates the styles array for it. * * @access protected * @param array $output The field output. * @param string|array $value The value. * * @return null */ protected function process_output( $output, $value ) { if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) { return; } $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : ''; $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; // Properties that can accept multiple values. // Useful for example for gradients where all browsers use the "background-image" property // and the browser prefixes go in the value_pattern arg. $accepts_multiple = array( 'background-image', 'background', ); if ( in_array( $output['property'], $accepts_multiple, true ) ) { if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; } $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; return; } if ( is_string( $value ) || is_numeric( $value ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; } } /** * Some CSS properties are unique. * We need to tweak the value to make everything works as expected. * * @access protected * @param string $property The CSS property. * @param string|array $value The value. * * @return array */ protected function process_property_value( $property, $value ) { $properties = apply_filters( "kirki_{$this->config_id}_output_property_classnames", array( 'font-family' => 'Kirki_Output_Property_Font_Family', 'background-image' => 'Kirki_Output_Property_Background_Image', 'background-position' => 'Kirki_Output_Property_Background_Position', ) ); if ( array_key_exists( $property, $properties ) ) { $classname = $properties[ $property ]; $obj = new $classname( $property, $value ); return $obj->get_value(); } return $value; } /** * Returns the value. * * @access protected * @param string|array $value The value. * @param array $output The field "output". * @return string|array */ protected function process_value( $value, $output ) { if ( isset( $output['property'] ) ) { return $this->process_property_value( $output['property'], $value ); } return $value; } /** * Exploses the private $styles property to the world * * @access protected * @return array */ public function get_styles() { return $this->styles; } } kirki/modules/css/.htaccess000044400000000143151232236320011706 0ustar00 Order Allow,Deny Deny from all kirki/modules/css-vars/class-kirki-modules-css-vars.php000064400000005274151232236320017227 0ustar00. * * @access public * @since 3.0.28 * @return void */ public function the_style() { // Get an array of all fields. $fields = Kirki::$fields; echo ''; } /** * Enqueues the script that handles postMessage * and adds variables to it using the wp_localize_script function. * The rest is handled via JS. * * @access public * @since 3.0.28 * @return void */ public function postmessage() { wp_enqueue_script( 'kirki_auto_css_vars', trailingslashit( Kirki::$url ) . 'modules/css-vars/script.js', array( 'jquery', 'customize-preview' ), KIRKI_VERSION, true ); $fields = Kirki::$fields; $data = array(); foreach ( $fields as $field ) { if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_vars'] ) && ! empty( $field['css_vars'] ) ) { $data[] = $field; } } wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data ); } } kirki/modules/css-vars/script.js000064400000002572151232236320012735 0ustar00/* global kirkiCssVarFields */ var kirkiCssVars = { /** * Get styles. * * @since 3.0.28 * @returns {Object} */ getStyles: function() { var style = jQuery( '#kirki-css-vars' ), styles = style.html().replace( ':root{', '' ).replace( '}', '' ).split( ';' ), stylesObj = {}; // Format styles as a object we can then tweak. _.each( styles, function( style ) { style = style.split( ':' ); if ( style[0] && style[1] ) { stylesObj[ style[0] ] = style[1]; } } ); return stylesObj; }, /** * Builds the styles from an object. * * @since 3.0.28 * @param {Object} vars - The vars. * @returns {string} */ buildStyle: function( vars ) { var style = ''; _.each( vars, function( val, name ) { style += name + ':' + val + ';'; } ); return ':root{' + style + '}'; } }; jQuery( document ).ready( function() { _.each( kirkiCssVarFields, function( field ) { wp.customize( field.settings, function( value ) { value.bind( function( newVal ) { var val = newVal; styles = kirkiCssVars.getStyles(); _.each( field.css_vars, function( cssVar ) { if ( cssVar[2] && _.isObject( value ) && value[ cssVar[2] ] ) { newVal = value[ cssVar[2] ]; } styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal ); } ); jQuery( '#kirki-css-vars' ).html( kirkiCssVars.buildStyle( styles ) ) ; } ); } ); } ); } ); kirki/modules/css-vars/.htaccess000044400000000143151232236320012657 0ustar00 Order Allow,Deny Deny from all kirki/modules/custom-sections/panels/class-kirki-panels-nested-panel.php000064400000002246151232236320022533 0ustar00title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; return $array; } } kirki/modules/custom-sections/panels/.htaccess000044400000000143151232236320015537 0ustar00 Order Allow,Deny Deny from all kirki/modules/custom-sections/sections/class-kirki-sections-default-section.php000064400000000730151232236320024150 0ustar00title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; $array['customizeAction'] = esc_attr__( 'Customizing', 'kirki' ); if ( $this->panel ) { /* translators: The title. */ $array['customizeAction'] = sprintf( esc_attr__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); } return $array; } } kirki/modules/custom-sections/sections/.htaccess000044400000000143151232236320016104 0ustar00 Order Allow,Deny Deny from all kirki/modules/custom-sections/class-kirki-modules-custom-sections.php000064400000007755151232236320022231 0ustar00 'Kirki_Sections_Default_Section', 'kirki-expanded' => 'Kirki_Sections_Expanded_Section', 'kirki-nested' => 'Kirki_Sections_Nested_Section', ); return array_merge( $section_types, $new_types ); } /** * Add the custom panel types. * * @access public * @since 3.0.0 * @param array $panel_types The registered section-types. * @return array */ public function set_panel_types( $panel_types ) { $new_types = array( 'kirki-nested' => 'Kirki_Panels_Nested_Panel', ); return array_merge( $panel_types, $new_types ); } /** * Include the custom-section classes. * * @access public * @since 3.0.0 */ public function include_sections_and_panels() { // Sections. $folder_path = dirname( __FILE__ ) . '/sections/'; $section_types = apply_filters( 'kirki_section_types', array() ); foreach ( $section_types as $id => $class ) { if ( ! class_exists( $class ) ) { $path = wp_normalize_path( $folder_path . 'class-kirki-sections-' . $id . '-section.php' ); if ( file_exists( $path ) ) { include_once $path; continue; } $path = str_replace( 'class-kirki-sections-kirki-', 'class-kirki-sections-', $path ); if ( file_exists( $path ) ) { include_once $path; } } } // Panels. $folder_path = dirname( __FILE__ ) . '/panels/'; $panel_types = apply_filters( 'kirki_panel_types', array() ); foreach ( $panel_types as $id => $class ) { if ( ! class_exists( $class ) ) { $path = wp_normalize_path( $folder_path . 'class-kirki-panels-' . $id . '-panel.php' ); if ( file_exists( $path ) ) { include_once $path; continue; } $path = str_replace( 'class-kirki-panels-kirki-', 'class-kirki-panels-', $path ); if ( file_exists( $path ) ) { include_once $path; } } } } /** * Enqueues any necessary scripts and styles. * * @access public * @since 3.0.0 */ public function enqueue_scrips() { wp_enqueue_style( 'kirki-custom-sections', trailingslashit( Kirki::$url ) . 'modules/custom-sections/sections.css', array(), KIRKI_VERSION ); wp_enqueue_script( 'kirki-custom-sections', trailingslashit( Kirki::$url ) . 'modules/custom-sections/sections.js', array( 'jquery', 'customize-base', 'customize-controls' ), KIRKI_VERSION ); } } kirki/modules/custom-sections/sections.css000064400000001422151232236320015023 0ustar00#customize-theme-controls .control-section-kirki-expanded .accordion-section-title { display: none; } #customize-theme-controls .control-section-kirki-expanded .customize-section-back { display: none; } #customize-theme-controls .customize-pane-child.control-section-kirki-expanded { position: relative; visibility: visible; height: auto; margin-left: -100%; } #customize-theme-controls .customize-pane-child.control-section-kirki-expanded h3 .customize-action { display: none; } #customize-theme-controls .customize-pane-child.current-section-parent, .in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent { transform: translateX(-100%); } .control-section-kirki-nested { margin: 0 -12px; } /*# sourceMappingURL=sections.css.map */ kirki/modules/custom-sections/sections.css.map000064400000000556151232236320015606 0ustar00{ "version": 3, "mappings": "AAEI,kFAAyB;EACvB,OAAO,EAAE,IAAI;AAGf,iFAAwB;EACtB,OAAO,EAAE,IAAI;AAKf,8EAAiC;EAC/B,QAAQ,EAAE,QAAQ;EAClB,UAAU,EAAE,OAAO;EACnB,MAAM,EAAE,IAAI;EACZ,WAAW,EAAE,KAAK;EAGhB,mGAAkB;IAChB,OAAO,EAAE,IAAI;;AAOvB;kFACmF;EACjF,SAAS,EAAE,iBAAiB;;AAG9B,6BAA8B;EAC5B,MAAM,EAAE,OAAO", "sources": ["sections.scss"], "names": [], "file": "sections.css" } kirki/modules/custom-sections/sections.js000064400000014453151232236320014657 0ustar00jQuery( document ).ready( function() { wp.customize.section.each( function( section ) { // Get the pane element. var pane = jQuery( '#sub-accordion-section-' + section.id ), sectionLi = jQuery( '#accordion-section-' + section.id ); // Check if the section is expanded. if ( sectionLi.hasClass( 'control-section-kirki-expanded' ) ) { // Move element. pane.appendTo( sectionLi ); } } ); } ); /** * @see https://wordpress.stackexchange.com/a/256103/17078 */ ( function() { var _panelEmbed, _panelIsContextuallyActive, _panelAttachEvents, _sectionEmbed, _sectionIsContextuallyActive, _sectionAttachEvents; wp.customize.bind( 'pane-contents-reflowed', function() { var panels = [], sections = []; // Reflow Sections. wp.customize.section.each( function( section ) { if ( 'kirki-nested' !== section.params.type || _.isUndefined( section.params.section ) ) { return; } sections.push( section ); } ); sections.sort( wp.customize.utils.prioritySort ).reverse(); jQuery.each( sections, function( i, section ) { var parentContainer = jQuery( '#sub-accordion-section-' + section.params.section ); parentContainer.children( '.section-meta' ).after( section.headContainer ); } ); // Reflow Panels. wp.customize.panel.each( function( panel ) { if ( 'kirki-nested' !== panel.params.type || _.isUndefined( panel.params.panel ) ) { return; } panels.push( panel ); } ); panels.sort( wp.customize.utils.prioritySort ).reverse(); jQuery.each( panels, function( i, panel ) { var parentContainer = jQuery( '#sub-accordion-panel-' + panel.params.panel ); parentContainer.children( '.panel-meta' ).after( panel.headContainer ); } ); } ); // Extend Panel. _panelEmbed = wp.customize.Panel.prototype.embed; _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive; _panelAttachEvents = wp.customize.Panel.prototype.attachEvents; wp.customize.Panel = wp.customize.Panel.extend( { attachEvents: function() { var panel; if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.panel ) ) { _panelAttachEvents.call( this ); return; } _panelAttachEvents.call( this ); panel = this; panel.expanded.bind( function( expanded ) { var parent = wp.customize.panel( panel.params.panel ); if ( expanded ) { parent.contentContainer.addClass( 'current-panel-parent' ); } else { parent.contentContainer.removeClass( 'current-panel-parent' ); } } ); panel.container.find( '.customize-panel-back' ).off( 'click keydown' ).on( 'click keydown', function( event ) { if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( panel.expanded() ) { wp.customize.panel( panel.params.panel ).expand(); } } ); }, embed: function() { var panel = this, parentContainer; if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.panel ) ) { _panelEmbed.call( this ); return; } _panelEmbed.call( this ); parentContainer = jQuery( '#sub-accordion-panel-' + this.params.panel ); parentContainer.append( panel.headContainer ); }, isContextuallyActive: function() { var panel = this, children, activeCount = 0; if ( 'kirki-nested' !== this.params.type ) { return _panelIsContextuallyActive.call( this ); } children = this._children( 'panel', 'section' ); wp.customize.panel.each( function( child ) { if ( ! child.params.panel ) { return; } if ( child.params.panel !== panel.id ) { return; } children.push( child ); } ); children.sort( wp.customize.utils.prioritySort ); _( children ).each( function( child ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } } ); return ( 0 !== activeCount ); } } ); // Extend Section. _sectionEmbed = wp.customize.Section.prototype.embed; _sectionIsContextuallyActive = wp.customize.Section.prototype.isContextuallyActive; _sectionAttachEvents = wp.customize.Section.prototype.attachEvents; wp.customize.Section = wp.customize.Section.extend( { attachEvents: function() { var section = this; if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.section ) ) { _sectionAttachEvents.call( section ); return; } _sectionAttachEvents.call( section ); section.expanded.bind( function( expanded ) { var parent = wp.customize.section( section.params.section ); if ( expanded ) { parent.contentContainer.addClass( 'current-section-parent' ); } else { parent.contentContainer.removeClass( 'current-section-parent' ); } } ); section.container.find( '.customize-section-back' ).off( 'click keydown' ).on( 'click keydown', function( event ) { if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( section.expanded() ) { wp.customize.section( section.params.section ).expand(); } } ); }, embed: function() { var section = this, parentContainer; if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.section ) ) { _sectionEmbed.call( section ); return; } _sectionEmbed.call( section ); parentContainer = jQuery( '#sub-accordion-section-' + this.params.section ); parentContainer.append( section.headContainer ); }, isContextuallyActive: function() { var section = this, children, activeCount = 0; if ( 'kirki-nested' !== this.params.type ) { return _sectionIsContextuallyActive.call( this ); } children = this._children( 'section', 'control' ); wp.customize.section.each( function( child ) { if ( ! child.params.section ) { return; } if ( child.params.section !== section.id ) { return; } children.push( child ); } ); children.sort( wp.customize.utils.prioritySort ); _( children ).each( function( child ) { if ( 'undefined' !== typeof child.isContextuallyActive ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } } else { if ( child.active() ) { activeCount += 1; } } } ); return ( 0 !== activeCount ); } } ); }( jQuery ) ); kirki/modules/custom-sections/sections.scss000064400000001262151232236320015210 0ustar00#customize-theme-controls { .control-section-kirki-expanded { .accordion-section-title { display: none; } .customize-section-back { display: none; } } .customize-pane-child { &.control-section-kirki-expanded { position: relative; visibility: visible; height: auto; margin-left: -100%; h3 { .customize-action { display: none; } } } } } #customize-theme-controls .customize-pane-child.current-section-parent, .in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent { transform: translateX(-100%); } .control-section-kirki-nested { margin: 0 -12px; } kirki/modules/custom-sections/.htaccess000044400000000143151232236320014255 0ustar00 Order Allow,Deny Deny from all kirki/modules/customizer-branding/branding.js000064400000000706151232236320015437 0ustar00/* global kirkiBranding */ jQuery( document ).ready( function() { 'use strict'; if ( '' !== kirkiBranding.logoImage ) { jQuery( 'div#customize-info .preview-notice' ).replaceWith( '' ); } if ( '' !== kirkiBranding.description ) { jQuery( 'div#customize-info > .customize-panel-description' ).replaceWith( '
                                ' + kirkiBranding.description + '
                                ' ); } } ); kirki/modules/customizer-branding/class-kirki-modules-customizer-branding.php000064400000004324151232236320023674 0ustar00 '', 'description' => '', ); if ( isset( $config['logo_image'] ) && '' !== $config['logo_image'] ) { $vars['logoImage'] = esc_url_raw( $config['logo_image'] ); } if ( isset( $config['description'] ) && '' !== $config['description'] ) { $vars['description'] = esc_textarea( $config['description'] ); } if ( ! empty( $vars['logoImage'] ) || ! empty( $vars['description'] ) ) { wp_register_script( 'kirki-branding', Kirki::$url . '/modules/customizer-branding/branding.js', array(), KIRKI_VERSION ); wp_localize_script( 'kirki-branding', 'kirkiBranding', $vars ); wp_enqueue_script( 'kirki-branding' ); } } } kirki/modules/customizer-branding/.htaccess000044400000000143151232236320015104 0ustar00 Order Allow,Deny Deny from all kirki/modules/customizer-styling/class-kirki-modules-customizer-styling.php000064400000045576151232236320023524 0ustar00 $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness + 60 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness - 60 )->toCSS( $back_obj->mode ); $border_on_back = ( 80 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 13 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 13 )->toCSS( $back_obj->mode ); $back_on_back = ( 90 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 6 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 11 )->toCSS( $back_obj->mode ); $hover_on_back = ( 90 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 3 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 3 )->toCSS( $back_obj->mode ); $arrows_on_back = ( 50 > $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness + 30 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness - 30 )->toCSS( $back_obj->mode ); } $accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false; if ( $accent ) { $accent_obj = ariColor::newColor( $accent ); $text_on_accent = ( 60 > $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness + 60 )->toCSS( $accent_obj->mode ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness - 60 )->toCSS( $accent_obj->mode ); $border_on_accent = ( 50 < $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness - 4 )->toCSS( $accent_obj->mode ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness + 4 )->toCSS( $accent_obj->mode ); $accent_disabled_obj = ( 35 < $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness - 30 ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness + 30 ); $accent_disabled = $accent_disabled_obj->toCSS( $accent_disabled_obj->mode ); $text_on_accent_disabled = ( 60 > $accent_disabled_obj->lightness ) ? $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness + 60 )->toCSS( $accent_disabled_obj->mode ) : $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness - 60 )->toCSS( $accent_disabled_obj->mode ); $border_on_accent_disabled = ( 50 < $accent_disabled_obj->lightness ) ? $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness - 4 )->toCSS( $accent_disabled_obj->mode ) : $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness + 4 )->toCSS( $accent_disabled_obj->mode ); } ?> Order Allow,Deny Deny from all kirki/modules/field-dependencies/class-kirki-modules-field-dependencies.php000064400000003126151232236320023135 0ustar00=' === operator || 'greater or equal' === operator || 'equal or greater' === operator ) { return value2 >= value1; } if ( '<=' === operator || 'smaller or equal' === operator || 'equal or smaller' === operator ) { return value2 <= value1; } if ( '>' === operator || 'greater' === operator ) { return value2 > value1; } if ( '<' === operator || 'smaller' === operator ) { return value2 < value1; } if ( 'contains' === operator || 'in' === operator ) { if ( _.isArray( value1 ) && _.isArray( value2 ) ) { _.each( value2, function( value ) { if ( value1.includes( value ) ) { found = true; return false; } } ); return found; } if ( _.isArray( value2 ) ) { _.each( value2, function( value ) { if ( value == value1 ) { // jshint ignore:line found = true; } } ); return found; } if ( _.isObject( value2 ) ) { if ( ! _.isUndefined( value2[ value1 ] ) ) { found = true; } _.each( value2, function( subValue ) { if ( value1 === subValue ) { found = true; } } ); return found; } if ( _.isString( value2 ) ) { if ( _.isString( value1 ) ) { return ( -1 < value1.indexOf( value2 ) && -1 < value2.indexOf( value1 ) ); } return -1 < value1.indexOf( value2 ); } } return value1 == value2; } }; jQuery( document ).ready( function() { kirkiDependencies.init(); } ); kirki/modules/field-dependencies/.htaccess000044400000000143151232236320014625 0ustar00 Order Allow,Deny Deny from all kirki/modules/icons/class-kirki-modules-icons.php000064400000005020151232236330016141 0ustar00add_icon( $section['id'], $section['icon'], 'section' ); } } // Parse panels and find ones with icons. foreach ( $panels as $panel ) { if ( isset( $panel['icon'] ) ) { $this->add_icon( $panel['id'], $panel['icon'], 'panel' ); } } wp_enqueue_script( 'kirki_panel_and_section_icons', trailingslashit( Kirki::$url ) . 'modules/icons/icons.js', array( 'jquery', 'customize-base', 'customize-controls' ), KIRKI_VERSION, true ); wp_localize_script( 'kirki_panel_and_section_icons', 'kirkiIcons', self::$icons ); } } kirki/modules/icons/icons.js000064400000001616151232236330012115 0ustar00/* global kirkiIcons */ jQuery( document ).ready( function() { 'use strict'; if ( ! _.isUndefined( kirkiIcons.section ) ) { // Parse sections and add icons. _.each( kirkiIcons.section, function( icon, sectionID ) { // Add icons in list. jQuery( '#accordion-section-' + sectionID + ' > h3' ).addClass( 'dashicons-before ' + icon ); // Add icons on titles when a section is open. jQuery( '#sub-accordion-section-' + sectionID + ' .customize-section-title > h3' ).append( '' ); } ); } if ( ! _.isUndefined( kirkiIcons.panel ) ) { _.each( kirkiIcons.panel, function( icon, panelID ) { // Add icons in lists & headers. jQuery( '#accordion-panel-' + panelID + ' > h3, #sub-accordion-panel-' + panelID + ' .panel-title' ).addClass( 'dashicons-before ' + icon ); } ); } } ); kirki/modules/icons/.htaccess000044400000000143151232236330012232 0ustar00 Order Allow,Deny Deny from all kirki/modules/loading/class-kirki-modules-loading.php000064400000007306151232236330016756 0ustar00remove_default_loading_styles(); } /** * Adds a custom "loading" div $ its styles when changes are made to the customizer. * * @access public */ public function add_loader_to_footer() { ?>
                                `. * * @access public */ public function add_loader_styles_to_header() { ?> Order Allow,Deny Deny from all kirki/modules/post-meta/class-kirki-modules-post-meta.php000064400000004244151232236330017544 0ustar00meta = get_post_custom( $queried_post->id ); } $wp_scripts->add_data( 'kirki_post_meta_previewed_preview', 'data', sprintf( 'var _customizePostPreviewedQueriedObject = %s;', wp_json_encode( $queried_post ) ) ); } } kirki/modules/post-meta/customize-controls.js000064400000001037151232236330015460 0ustar00jQuery( document ).ready( function() { var self; self = { queriedPost: new wp.customize.Value() }; // Listen for queried-post messages from the preview. wp.customize.bind( 'ready', function() { wp.customize.previewer.bind( 'queried-post', function( queriedPost ) { self.queriedPost.set( queriedPost || false ); } ); } ); // Listen for post self.queriedPost.bind( function( newPost, oldPost ) { window.kirkiPost = false; if ( newPost || oldPost ) { window.kirkiPost = ( newPost ) ? newPost : oldPost; } } ); } ); kirki/modules/post-meta/customize-preview.js000064400000000750151232236330015277 0ustar00/* global wp, _customizePostPreviewedQueriedObject */ jQuery( document ).ready( function() { var self = { queriedPost: ( ! _.isUndefined( _customizePostPreviewedQueriedObject ) ) ? _customizePostPreviewedQueriedObject : null }; // Send the queried post object to the Customizer pane when ready. wp.customize.bind( 'preview-ready', function() { wp.customize.preview.bind( 'active', function() { wp.customize.preview.send( 'queried-post', self.queriedPost ); } ); } ); } ); kirki/modules/post-meta/.htaccess000044400000000143151232236330013030 0ustar00 Order Allow,Deny Deny from all kirki/modules/postmessage/class-kirki-modules-postmessage.php000064400000044172151232236330020612 0ustar00script .= $this->script( $field ); } } $this->script = apply_filters( 'kirki_postmessage_script', $this->script ); wp_add_inline_script( 'kirki_auto_postmessage', $this->script, 'after' ); } /** * Generates script for a single field. * * @access protected * @since 3.0.0 * @param array $args The arguments. */ protected function script( $args ) { $script = 'wp.customize(\'' . $args['settings'] . '\',function(value){value.bind(function(newval){'; $add_css = false; foreach ( $args['js_vars'] as $js_var ) { if ( ! isset( $js_var['function'] ) || 'html' !== $js_var['function'] ) { $add_css = true; } } if ( $add_css ) { // append unique style tag if not exist // The style ID. $style_id = 'kirki-postmessage-' . str_replace( array( '[', ']' ), '', $args['settings'] ); $script .= 'if(null===document.getElementById(\'' . $style_id . '\')||\'undefined\'===typeof document.getElementById(\'' . $style_id . '\')){jQuery(\'head\').append(\'\');}'; } // Add anything we need before the main script. $script .= $this->before_script( $args ); $field = array( 'scripts' => array(), ); // Loop through the js_vars and generate the script. foreach ( $args['js_vars'] as $key => $js_var ) { // Skip styles if "exclude" is defined and value is excluded. if ( isset( $js_var['exclude'] ) ) { $js_var['exclude'] = (array) $js_var['exclude']; $script .= 'exclude=false;'; foreach ( $js_var['exclude'] as $exclussion ) { $script .= "if(newval=='{$exclussion}'||(''==='{$exclussion}'&&_.isObject(newval)&&_.isEmpty(newval))){exclude=true;}"; } } if ( isset( $js_var['element'] ) ) { // Array to string. if ( is_array( $js_var['element'] ) ) { $js_var['element'] = implode( ',', $js_var['element'] ); } // Replace single quotes with double quotes to avoid issues with the compiled JS. $js_var['element'] = str_replace( '\'', '"', $js_var['element'] ); } if ( isset( $js_var['function'] ) && 'html' === $js_var['function'] ) { $script .= $this->script_html_var( $js_var ); continue; } $js_var['index_key'] = $key; $callback = $this->get_callback( $args ); if ( is_callable( $callback ) ) { $field['scripts'][ $key ] = call_user_func_array( $callback, array( $js_var, $args ) ); continue; } $field['scripts'][ $key ] = $this->script_var( $js_var ); } $combo_extra_script = ''; $combo_css_script = ''; foreach ( $field['scripts'] as $script_array ) { $combo_extra_script .= $script_array['script']; $combo_css_script .= ( 'css' !== $combo_css_script ) ? $script_array['css'] : ''; } $text = ( 'css' === $combo_css_script ) ? 'css' : '\'' . $combo_css_script . '\''; $script .= $combo_extra_script . "var cssContent={$text};"; if ( isset( $js_var['exclude'] ) ) { $script .= 'if(true===exclude){cssContent="";}'; } if ( $add_css ) { $script .= "jQuery('#{$style_id}').text(cssContent);jQuery('#{$style_id}').appendTo('head');"; } $script .= '});});'; return $script; } /** * Generates script for a single js_var when using "html" as function. * * @access protected * @since 3.0.0 * @param array $args The arguments for this js_var. */ protected function script_html_var( $args ) { $script = ( isset( $args['choice'] ) ) ? "newval=newval['{$args['choice']}'];" : ''; // Apply the value_pattern. if ( isset( $args['value_pattern'] ) && '' !== $args['value_pattern'] ) { $script .= $this->value_pattern_replacements( 'newval', $args ); } if ( isset( $args['attr'] ) ) { $script .= "jQuery('{$args['element']}').attr('{$args['attr']}',newval);"; return $script; } $script .= "jQuery('{$args['element']}').html(newval);"; return $script; } /** * Generates script for a single js_var. * * @access protected * @since 3.0.0 * @param array $args The arguments for this js_var. */ protected function script_var( $args ) { $script = ''; $property_script = ''; $value_key = 'newval' . $args['index_key']; $property_script .= $value_key . '=newval;'; $args = $this->get_args( $args ); // Apply callback to the value if a callback is defined. if ( ! empty( $args['js_callback'] ) && is_array( $args['js_callback'] ) && isset( $args['js_callback'][0] ) && ! empty( $args['js_callback'][0] ) ) { $script .= $value_key . '=' . $args['js_callback'][0] . '(' . $value_key . ',' . $args['js_callback'][1] . ');'; } // Apply the value_pattern. if ( '' !== $args['value_pattern'] ) { $script .= $this->value_pattern_replacements( $value_key, $args ); } // Tweak to add url() for background-images. if ( 'background-image' === $args['property'] && ( ! isset( $args['value_pattern'] ) || false === strpos( $args['value_pattern'], 'gradient' ) ) ) { $script .= 'if(-1===' . $value_key . '.indexOf(\'url(\')){' . $value_key . '=\'url("\'+' . $value_key . '+\'")\';}'; } // Apply prefix. $value = $value_key; if ( '' !== $args['prefix'] ) { $value = "'" . $args['prefix'] . "'+" . $value_key; } $css = $args['element'] . '{' . $args['property'] . ':\'+' . $value . '+\'' . $args['units'] . $args['suffix'] . ';}'; if ( isset( $args['media_query'] ) ) { $css = $args['media_query'] . '{' . $css . '}'; } return array( 'script' => $property_script . $script, 'css' => $css, ); } /** * Processes script generation for fields that save an array. * * @access protected * @since 3.0.0 * @param array $args The arguments for this js_var. */ protected function script_var_array( $args ) { $script = ( 0 === $args['index_key'] ) ? 'css=\'\';' : ''; $property_script = ''; // Define choice. $choice = ( isset( $args['choice'] ) && '' !== $args['choice'] ) ? $args['choice'] : ''; $value_key = 'newval' . $args['index_key']; $property_script .= $value_key . '=newval;'; $args = $this->get_args( $args ); // Apply callback to the value if a callback is defined. if ( ! empty( $args['js_callback'] ) && is_array( $args['js_callback'] ) && isset( $args['js_callback'][0] ) && ! empty( $args['js_callback'][0] ) ) { $script .= $value_key . '=' . $args['js_callback'][0] . '(' . $value_key . ',' . $args['js_callback'][1] . ');'; } $script .= '_.each(' . $value_key . ', function(subValue,subKey){'; // Apply the value_pattern. if ( '' !== $args['value_pattern'] ) { $script .= $this->value_pattern_replacements( 'subValue', $args ); } // Tweak to add url() for background-images. if ( '' === $choice || 'background-image' === $choice ) { $script .= 'if(\'background-image\'===\'' . $args['property'] . '\'||\'background-image\'===subKey){if(-1===subValue.indexOf(\'url(\')){subValue=\'url("\'+subValue+\'")\';}}'; } // Apply prefix. $value = $value_key; if ( '' !== $args['prefix'] ) { $value = '\'' . $args['prefix'] . '\'+subValue'; } // Mostly used for padding, margin & position properties. $direction_script = 'if(_.contains([\'top\',\'bottom\',\'left\',\'right\'],subKey)){'; $direction_script .= 'css+=\'' . $args['element'] . '{' . $args['property'] . '-\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';}'; // Allows us to apply this just for a specific choice in the array of the values. if ( '' !== $choice ) { $choice_is_direction = ( false !== strpos( $choice, 'top' ) || false !== strpos( $choice, 'bottom' ) || false !== strpos( $choice, 'left' ) || false !== strpos( $choice, 'right' ) ); // The script. $script .= 'if(\'' . $choice . '\'===subKey){'; $script .= ( $choice_is_direction ) ? $direction_script . 'else{' : ''; $script .= 'css+=\'' . $args['element'] . '{' . $args['property'] . ':\'+subValue+\';}\';'; $script .= ( $choice_is_direction ) ? '}' : ''; $script .= '}'; } else { // This is where most object-based fields will go. $script .= $direction_script . 'else{css+=\'' . $args['element'] . '{\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';}'; } $script .= '});'; if ( isset( $args['media_query'] ) ) { $script .= 'css=\'' . $args['media_query'] . '{\'+css+\'}\';'; } return array( 'script' => $property_script . $script, 'css' => 'css', ); } /** * Processes script generation for typography fields. * * @access protected * @since 3.0.0 * @param array $args The arguments for this js_var. * @param array $field The field arguments. */ protected function script_var_typography( $args, $field ) { $args = $this->get_args( $args ); $script = ''; $css = ''; // Load the font using WenFontloader. // This is a bit ugly because wp_add_inline_script doesn't allow adding