diff --git a/.editorconfig b/.editorconfig index c951f002..a154caf1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,7 +13,7 @@ insert_final_newline = true trim_trailing_whitespace = true indent_style = tab -[{.jshintrc,*.json,*.yml}] +[{.jshintrc,*.json,*.yml,*.sass}] indent_style = space indent_size = 2 diff --git a/assets/css/admin/_colors.sass b/assets/css/admin/_colors.sass new file mode 100644 index 00000000..6a3f1fb4 --- /dev/null +++ b/assets/css/admin/_colors.sass @@ -0,0 +1,109 @@ +$um-base: #0085ba +$um-base-hover: #008ec2 +$delete-link: #a00 +$delete-link-hover: #f00 + +$tooltip-back: #333 +$tooltip-color: #eee + +$admin-ok: #7acf58 +$admin-warning: #c74a4a + +$border: #ddd +$hover: #ccc +$shadow1: rgba(50,50,93,.1) +$shadow2: rgba(0,0,0,.07) + + +$wp-background: #f1f1f1 +//$overlay: #333 +$grey-text: #eee +$border-color: #eee + + +$white: #fff +$sub-color: #a3a3a3 +$preloader-base: #c6c6c6 +$preloader-second: fade-out( $preloader-base, .8 ) +$sub-color-hover: darken( $sub-color, 15% ) +$link: #000 +$active-link: fade-out( $link,.2 ) +$visited-link: #999 +$overlay: fade-out( $link,.15 ) +$like: #f13a37 +$active-like: fade-out( $like,.2 ) +$active-unlike: fade-out( $sub-color,.2 ) +$border-color: #dddddd +$icon-color: #909090 +$child-sub: #f6f8fc +$child-line: #ebecf0 +$shadow1: rgba(50,50,93,.1) +$shadow2: rgba(0,0,0,.07) +$trashed-row: #ff787b +$pending-row: #ffd096 + +$notice-text: #3f7cc7 + + + +// NEW COLORS since v3 +$required-asterisk: #a00 +$error-text: var(--um-blocks-error-color, #d92d20) + +$um-font-size: 14px + +$um-white: #fff +$um-black: #000 +$wp-admin-primary: #2271b1 +$wp-admin-text: #3c434a + +$um-primary: var(--um-blocks-button-bg-color, #eee) +$um-primary-hover: var(--um-blocks-button-bg-hover-color, #ddd) +$um-text: var(--um-blocks-button-fg-color, #333) + +$button-bg: var(--um-blocks-button-bg-color, #eee) +$button-bg-hover: var(--um-blocks-button-bg-hover-color, #ddd) +$button-color: var(--um-blocks-button-fg-color, #333) +$button-border-radius: 8px +$button-line-height: 22px + +// Figma shades of gray colors +$gray-25: var(--um-gray-25, #fcfcfd) +$gray-50: var(--um-gray-50, #f9fafb) +$gray-100: var(--um-gray-100, #f2f4f7) +$gray-200: var(--um-gray-200, #eaecf0) +$gray-300: var(--um-gray-300, #d0d5dd) +$gray-400: var(--um-gray-400, #98a2b3) +$gray-500: var(--um-gray-500, #667085) +$gray-600: var(--um-gray-600, #475467) +$gray-700: var(--um-gray-700, #344054) +$gray-800: var(--um-gray-800, #1d2939) +$gray-900: var(--um-gray-900, #101828) + +// Figma shades of error colors +$error-25: var(--um-error-25, #fcfcfd) +$error-50: var(--um-error-50, #f9fafb) +$error-100: var(--um-error-100, #fee4e2) +$error-200: var(--um-error-200, #eaecf0) +$error-300: var(--um-error-300, #d0d5dd) +$error-400: var(--um-error-400, #98a2b3) +$error-500: var(--um-error-500, #667085) +$error-600: var(--um-error-600, #475467) +$error-700: var(--um-error-700, #b42318) +$error-800: var(--um-error-800, #1d2939) +$error-900: var(--um-error-900, #101828) + +// Text input variables +$text-input-border-radius: 6px +$text-input-bg: $um-white +$text-input-color: $um-black +$text-input-border-color: $gray-300 +$text-input-border-color-focus: $gray-400 + +$semi-bold-weight: 500 +$bold-weight: 600 // CSS bold = 700, so it will be applied if there aren't 600 weight for the font +$label-size: 15px + +// Links variables +$link-color: $um-primary +$link-hover-color: $um-primary-hover diff --git a/assets/css/admin/_mixins.sass b/assets/css/admin/_mixins.sass new file mode 100644 index 00000000..36351f04 --- /dev/null +++ b/assets/css/admin/_mixins.sass @@ -0,0 +1,44 @@ +=flex ($direction, $justify, $align, $wrap) + display: flex + flex-direction: $direction + justify-content: $justify + align-items: $align + flex-wrap: $wrap + +=border-box + box-sizing: border-box + -moz-box-sizing: border-box + -webkit-box-sizing: border-box + +// Figma xs shadow +=box-shadow-xs + box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.05 ) +// Figma lg shadow +=box-shadow-lg + box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03) +// Figma md shadow +=box-shadow-md + box-shadow: 0 4px 8px -2px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.06) + +=transition ($time, $action) + -webkit-transition: $time $action + -moz-transition: $time $action + -ms-transition: $time $action + -o-transition: $time $action + transition: $time $action + + +=keyframes ($name) + @-webkit-keyframes #{$name} + @content + @-moz-keyframes #{$name} + @content + @-ms-keyframes #{$name} + @content + @keyframes #{$name} + @content + +=border-radius ($tl, $tr, $br, $bl) + border-radius: $tl $tr $br $bl + -moz-border-radius: $tl $tr $br $bl + -webkit-border-radius: $tl $tr $br $bl diff --git a/assets/css/admin/_selectors.sass b/assets/css/admin/_selectors.sass new file mode 100644 index 00000000..f3681247 --- /dev/null +++ b/assets/css/admin/_selectors.sass @@ -0,0 +1,7 @@ +$prefix: um- +$helptip: um_tooltip + +$pr: primary- +$button: #{$prefix}button +$primary-button: #{$prefix}#{$pr}button +$avatar: #{$prefix}user-avatar diff --git a/assets/css/admin/block.css b/assets/css/admin/block.css new file mode 100644 index 00000000..dde7bc4b --- /dev/null +++ b/assets/css/admin/block.css @@ -0,0 +1,7 @@ +.um_block_settings .um_block_settings_hide { + display: none; } + +.um_block_settings .components-select-control .components-select-control__input[multiple] { + height: auto; } + .um_block_settings .components-select-control .components-select-control__input[multiple] + .components-input-control__suffix { + display: none; } diff --git a/assets/css/admin/block.min.css b/assets/css/admin/block.min.css new file mode 100644 index 00000000..4bfa1495 --- /dev/null +++ b/assets/css/admin/block.min.css @@ -0,0 +1 @@ +.um_block_settings .um_block_settings_hide{display:none}.um_block_settings .components-select-control .components-select-control__input[multiple]{height:auto}.um_block_settings .components-select-control .components-select-control__input[multiple]+.components-input-control__suffix{display:none} \ No newline at end of file diff --git a/assets/css/admin/block.sass b/assets/css/admin/block.sass new file mode 100644 index 00000000..332f0fb6 --- /dev/null +++ b/assets/css/admin/block.sass @@ -0,0 +1,10 @@ +// Block restriction settings. + +.um_block_settings + .um_block_settings_hide + display: none + .components-select-control + .components-select-control__input[multiple] + height: auto + & + .components-input-control__suffix + display: none diff --git a/includes/admin/assets/css/um-admin-builder.css b/assets/css/admin/builder.css similarity index 82% rename from includes/admin/assets/css/um-admin-builder.css rename to assets/css/admin/builder.css index 6a6e4201..40317bbb 100644 --- a/includes/admin/assets/css/um-admin-builder.css +++ b/assets/css/admin/builder.css @@ -30,6 +30,13 @@ -webkit-transform: rotate(360deg); transform: rotate(360deg); } } +.um-admin a.um-admin-activebg, +.um-admin a.um-admin-activebg:hover { + /*background: #3ba1da;*/ + background: #0085ba; + color: #fff; +} + /* - General */ @@ -106,13 +113,13 @@ color: #fff; } -.um-admin-drag-ctrls.columns a {width: 30px !important;background-image: url(../img/1-column.gif); background-repeat: no-repeat; background-position: center;} -.um-admin-drag-ctrls.columns a:nth-child(2) {background-image: url(../img/2-columns.gif);} -.um-admin-drag-ctrls.columns a:last-child {background-image: url(../img/3-columns.gif);} +.um-admin-drag-ctrls.columns a {width: 30px !important;background-image: url(../../img/builder/1-column.gif); background-repeat: no-repeat; background-position: center;} +.um-admin-drag-ctrls.columns a:nth-child(2) {background-image: url(../../img/builder/2-columns.gif);} +.um-admin-drag-ctrls.columns a:last-child {background-image: url(../../img/builder/3-columns.gif);} -.um-admin-drag-ctrls.columns a.active {background-image: url(../img/1-column-active.gif)} -.um-admin-drag-ctrls.columns a.active:nth-child(2) {background-image: url(../img/2-columns-active.gif);} -.um-admin-drag-ctrls.columns a.active:last-child {background-image: url(../img/3-columns-active.gif);} +.um-admin-drag-ctrls.columns a.active {background-image: url(../../img/builder/1-column-active.gif)} +.um-admin-drag-ctrls.columns a.active:nth-child(2) {background-image: url(../../img/builder/2-columns-active.gif);} +.um-admin-drag-ctrls.columns a.active:last-child {background-image: url(../../img/builder/3-columns-active.gif);} /* - Drag Area @@ -388,3 +395,85 @@ #UM_preview_form .um-admin-modal-body { position: relative; } + +.um-admin-half { + float: left; + width: 48%; +} + +.um-admin-tri { + float: left; + width: 33%; +} + +.um-admin-left { + float: left; +} + +.um-admin-right { + float: right; +} + +/* Select form type links */ + +.um-admin-boxed-links { + width: 100%; + text-align: center; +} + +.um-admin-boxed-links a { + width: 33.3%; + float: left; + border-left: 1px solid #fff; + border-right: 1px solid #fff; + padding: 30px 25px !important; + background: #f8f8f8; + text-align: center; + display: inline-block !important; + font-size: 14px; + transition: all .2s linear; + text-decoration: none; + color: #666; + margin: 0 !important; + box-sizing: border-box !important; + border-radius: 2px; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-weight: 600; +} + +.um-admin-boxed-links i { + font-size: 28px; + vertical-align: middle; + margin: 0 10px 0 0; +} + +.um-admin-boxed-links a:hover { + background: #eee; +} + +/* + - Error blocks +*/ + +.um-admin-error-block, .um-admin-success-block{ + display: none; + width: 100%; + background: #C74A4A; + border-radius: 3px; + color: #fff; + box-sizing: border-box; + position: relative; + padding: 12px; + font-size: 13px; + line-height: 1em !important; + margin: 0 0 16px 0; +} + +.um-admin-success-block { + background: #7ACF58; +} + +.um-admin-cur-condition-template { + display: none; +} diff --git a/assets/css/admin/builder.min.css b/assets/css/admin/builder.min.css new file mode 100644 index 00000000..58b08c75 --- /dev/null +++ b/assets/css/admin/builder.min.css @@ -0,0 +1 @@ +@-webkit-keyframes um-ajax-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes um-ajax-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes um-ajax-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes um-ajax-spinning{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.um-admin a.um-admin-activebg,.um-admin a.um-admin-activebg:hover{background:#0085ba;color:#fff}.um-admin-builder *{-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}.um-admin-builder i{font-size:15px!important;height:100%!important;line-height:100%!important;margin:0 5px 0 0!important}.um-admin-builder .um-admin-drag{margin-top:40px}.um-admin-drag-add-field{display:block;width:100%;height:30px;line-height:30px;text-align:center;color:#aaa;text-decoration:none}.um-admin-drag-add-field:hover{color:#0085ba}.um-admin-drag-add-field i{font-size:23px!important;margin:0!important}.um-admin-drag-ctrls-demo.um-admin-drag-ctrls{position:absolute;right:7px;top:-30px;left:auto}.um-admin-drag-ctrls{position:absolute;top:-30px;left:0}.um-admin-drag-ctrls a{float:left;margin:0 5px 0 0;height:30px;line-height:30px;background:#eee;color:#888;padding:0 8px;text-decoration:none;border-radius:2px 2px 0 0}.um-admin-drag-ctrls a:hover{background-color:#e5e5e5}.um-admin-drag-ctrls a.active,.um-admin-drag-ctrls a.active:hover{background-color:#0085ba;color:#fff}.um-admin-drag-ctrls.columns a{width:30px!important;background-image:url(../../img/builder/1-column.gif);background-repeat:no-repeat;background-position:center}.um-admin-drag-ctrls.columns a:nth-child(2){background-image:url(../../img/builder/2-columns.gif)}.um-admin-drag-ctrls.columns a:last-child{background-image:url(../../img/builder/3-columns.gif)}.um-admin-drag-ctrls.columns a.active{background-image:url(../../img/builder/1-column-active.gif)}.um-admin-drag-ctrls.columns a.active:nth-child(2){background-image:url(../../img/builder/2-columns-active.gif)}.um-admin-drag-ctrls.columns a.active:last-child{background-image:url(../../img/builder/3-columns-active.gif)}.um-admin-drag{width:100%;background:#f1f1f1;box-sizing:border-box;position:relative;padding:60px 20px 20px 20px}.um-admin-drag-row{width:100%;background:#fefefe;box-sizing:border-box;position:relative;padding:60px 20px 20px 20px;margin:0 0 60px 0;position:relative}.um-admin-drag-row:last-child{margin-bottom:0}.um-admin-drag-row-icons{position:absolute;right:0;top:-30px;height:30px}.um-admin-drag-rowsub{position:relative;box-sizing:border-box;background:#f1f1f1;padding:20px;margin:0 0 60px 0}.um-admin-drag-rowsub:last-child{margin-bottom:0}.um-admin-drag-rowsub-icons{position:absolute;right:0;top:-30px;height:30px}.um-admin-drag-col{float:left;width:100%;background:#fff;border:1px dashed #bbb;box-sizing:border-box;padding:20px}.um-admin-drag-col.cols-3{width:32%}.um-admin-drag-col.cols-3.cols-last{width:32%}.um-admin-drag-col.cols-3.cols-middle{width:32%;margin:0 2%}.um-admin-drag-col.cols-1{width:100%}.um-admin-drag-col.cols-1.cols-last{width:100%}.um-admin-drag-col.cols-2{width:49%;margin:0 1% 0 0}.um-admin-drag-col.cols-2.cols-last{width:49%;margin:0 0 0 1%}.um-admin-drag-addrow{text-align:center;font-size:14px;color:#888;cursor:pointer;border:1px dashed #bbb;padding:10px 0;margin:20px 0 0 0}.um-admin-drag-addrow i{font-size:23px!important;margin:0!important}.um-admin-drag-addrow:hover{color:#0085ba}.um-admin-drag-fld{display:block;position:relative;border:1px solid #ddd;margin:0 0 15px 0;background:#f5f5f5;cursor:move!important}.um-admin-drag-fld-title i{width:24px;display:inline-block;text-align:center}.um-admin-drag-fld.um-field-type-group{background:#555;border:0}.um-admin-drag-fld-title.um-field-type-group,.um-admin-drag-fld-type.um-field-type-group{color:#fff}.um-admin-drag-group{background:#fcfcfc;cursor:default;padding:20px;border:1px dashed #bbb}.um-admin-drag-col.cols-3 .um-admin-drag-fld-icons.um-field-type-group{float:left;position:relative;bottom:auto;right:auto;height:30px;display:block}.um-admin-drag-fld-icons.um-field-type-group a.um_admin_duplicate_field{display:none!important}.um-admin-drag-fld-title,.um-admin-drag-fld-type{float:left;font-weight:700;font-size:13px;color:#666;height:30px;line-height:30px;margin:0 0 0 20px}.um-admin-drag-fld-type{font-weight:400;color:#999}.um-admin-drag-fld-icons{float:right}.um-admin-drag-col.cols-3 .um-admin-drag-fld-title,.um-admin-drag-col.cols-3 .um-admin-drag-fld-type{height:auto;line-height:18px;margin:10px;margin-bottom:0}.um-admin-drag-col.cols-3 .um-admin-drag-fld-type{margin:10px}.um-admin-drag-col.cols-3 .um-admin-drag-fld-icons{float:none;position:absolute;bottom:0;right:0;height:30px;display:none}.um-admin-drag-col.cols-3 .um-admin-drag-fld:hover .um-admin-drag-fld-icons{display:block}.um-admin-drag-fld-icons a,.um-admin-drag-row-icons a,.um-admin-drag-row-icons span,.um-admin-drag-rowsub-icons a,.um-admin-drag-rowsub-icons span{text-decoration:none;color:#fff;width:40px;height:30px;line-height:30px;text-align:center;display:block!important;float:left;background:#0085ba;padding:0 4px;transition:all .2s linear;border-left:1px solid #379dd5}.um-admin-drag-row-icons span,.um-admin-drag-rowsub-icons span{cursor:move!important}.um-admin-drag-fld-icons a:hover,.um-admin-drag-row-icons a:hover,.um-admin-drag-row-icons span:hover,.um-admin-drag-rowsub-icons a:hover,.um-admin-drag-rowsub-icons span:hover{background:#008ec2}.um-admin-drag-fld-icons i,.um-admin-drag-row-icons i,.um-admin-drag-rowsub-icons i{font-size:18px!important;margin:0!important;top:2px;position:relative}.um-admin-row-loading{position:absolute;width:100%;height:calc(100% + 30px);top:-30px;left:0;background:rgba(241,241,241,.6);z-index:999;display:none}.um-admin-row-loading>span{display:block;-webkit-transition:.1s opacity;-moz-transition:.1s opacity;-ms-transition:.1s opacity;-o-transition:.1s opacity;transition:.1s opacity;color:#c6c6c6!important;-webkit-animation:um-ajax-spinning 1.1s infinite linear;animation:um-ajax-spinning 1.1s infinite linear;border-top:.2em solid #000;border-right:.2em solid #000;border-bottom:.2em solid #000;border-left:.2em solid #c6c6c6;font-size:1.75em;-ms-transform:translateZ(0);transform:translateZ(0);border-radius:50%;width:40px;height:40px;margin:-20px 0 0 -20px;outline:0;padding:0;vertical-align:baseline;position:absolute;left:50%;top:50%}.um-row-placeholder{width:100%;border:2px dashed #aaa;box-sizing:border-box}.um-rowsub-placeholder{width:100%;border:2px dashed #ccc;box-sizing:border-box;display:block}.um-fld-placeholder{display:block;border:1px dashed #ddd;background:#fff;box-sizing:border-box;width:100%}.um-admin-preview-overlay{position:absolute;top:0;bottom:0;left:0;right:0;background-color:rgba(255,255,255,0);z-index:100}#UM_preview_form .um-admin-modal-body{position:relative}.um-admin-half{float:left;width:48%}.um-admin-tri{float:left;width:33%}.um-admin-left{float:left}.um-admin-right{float:right}.um-admin-boxed-links{width:100%;text-align:center}.um-admin-boxed-links a{width:33.3%;float:left;border-left:1px solid #fff;border-right:1px solid #fff;padding:30px 25px!important;background:#f8f8f8;text-align:center;display:inline-block!important;font-size:14px;transition:all .2s linear;text-decoration:none;color:#666;margin:0!important;box-sizing:border-box!important;border-radius:2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:600}.um-admin-boxed-links i{font-size:28px;vertical-align:middle;margin:0 10px 0 0}.um-admin-boxed-links a:hover{background:#eee}.um-admin-error-block,.um-admin-success-block{display:none;width:100%;background:#c74a4a;border-radius:3px;color:#fff;box-sizing:border-box;position:relative;padding:12px;font-size:13px;line-height:1em!important;margin:0 0 16px 0}.um-admin-success-block{background:#7acf58}.um-admin-cur-condition-template{display:none} \ No newline at end of file diff --git a/assets/css/admin/common.css b/assets/css/admin/common.css new file mode 100644 index 00000000..d17ec651 --- /dev/null +++ b/assets/css/admin/common.css @@ -0,0 +1,91 @@ +.um-adm-ico { + font-size: 18px; + width: 18px; + text-align: center; + display: inline-block; + color: #7acf58; } + .um-adm-ico.inactive { + color: #c74a4a; } + .um-adm-ico.pointer { + cursor: pointer; } + +body.um-admin-modal-open { + overflow: hidden; } + +.um-admin #major-publishing-actions { + background-color: #fff !important; + border-top: 0; } + +.um-admin a.button i, +.um-admin a.button-primary i { + font-size: 15px !important; + height: 15px !important; + width: 15px !important; + text-align: center !important; + margin: 0 5px 0 0 !important; + display: inline-block; } + .um-admin a.button i:before, + .um-admin a.button-primary i:before { + position: relative; + top: 1px; } + +.um-admin-metabox * { + -webkit-font-smoothing: antialiased !important; + -moz-osx-font-smoothing: grayscale !important; } + +.um-admin-metabox h6 { + font-size: 14px; + margin: 12px 0 0 0; } + +.um-admin-metabox h3 { + padding-left: 0 !important; } + +.um-admin-metabox h4 { + font-size: 14px; + background: #f5f5f5; + padding: 8px 4px; + color: #333; } + +.um-admin-metabox p { + margin: 10px 0 0 0; } + +.um-admin-metabox label { + display: block; + cursor: default; + padding: 0 !important; + font-size: 13px; + color: #666; } + +.um-admin-metabox input[type="text"] { + height: auto !important; + width: 100%; + max-width: 100%; + display: block; + box-sizing: border-box !important; + font-size: 13px !important; + line-height: 1.4em !important; + padding: 4px 10px !important; } + .um-admin-metabox input[type="text"]:disabled { + opacity: 0.7 !important; + color: #aaa !important; } + .um-admin-metabox input[type="text"].small { + width: 54px; } + .um-admin-metabox input[type="text"].um-admin-error { + border-color: #c74a4a !important; } + +.um-admin-metabox textarea { + width: 100%; + max-width: 100%; + display: block; + box-sizing: border-box !important; + font-size: 13px !important; + line-height: 1.4em !important; + padding: 8px !important; + color: #888 !important; + min-height: 100px; + height: 100px; } + .um-admin-metabox textarea.tall { + min-height: 200px; + height: 200px; } + .um-admin-metabox textarea.um-admin-error { + border-color: #c74a4a !important; } diff --git a/assets/css/admin/common.min.css b/assets/css/admin/common.min.css new file mode 100644 index 00000000..79d73b76 --- /dev/null +++ b/assets/css/admin/common.min.css @@ -0,0 +1 @@ +.um-adm-ico{font-size:18px;width:18px;text-align:center;display:inline-block;color:#7acf58}.um-adm-ico.inactive{color:#c74a4a}.um-adm-ico.pointer{cursor:pointer}body.um-admin-modal-open{overflow:hidden}.um-admin #major-publishing-actions{background-color:#fff!important;border-top:0}.um-admin a.button i,.um-admin a.button-primary i{font-size:15px!important;height:15px!important;width:15px!important;text-align:center!important;margin:0 5px 0 0!important;display:inline-block}.um-admin a.button i:before,.um-admin a.button-primary i:before{position:relative;top:1px}.um-admin-metabox *{-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale!important}.um-admin-metabox h6{font-size:14px;margin:12px 0 0 0}.um-admin-metabox h3{padding-left:0!important}.um-admin-metabox h4{font-size:14px;background:#f5f5f5;padding:8px 4px;color:#333}.um-admin-metabox p{margin:10px 0 0 0}.um-admin-metabox label{display:block;cursor:default;padding:0!important;font-size:13px;color:#666}.um-admin-metabox input[type=text]{height:auto!important;width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:4px 10px!important}.um-admin-metabox input[type=text]:disabled{opacity:.7!important;color:#aaa!important}.um-admin-metabox input[type=text].small{width:54px}.um-admin-metabox input[type=text].um-admin-error{border-color:#c74a4a!important}.um-admin-metabox textarea{width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:8px!important;color:#888!important;min-height:100px;height:100px}.um-admin-metabox textarea.tall{min-height:200px;height:200px}.um-admin-metabox textarea.um-admin-error{border-color:#c74a4a!important} \ No newline at end of file diff --git a/assets/css/admin/common.sass b/assets/css/admin/common.sass new file mode 100644 index 00000000..c4dbc60c --- /dev/null +++ b/assets/css/admin/common.sass @@ -0,0 +1,90 @@ +@import "selectors" +@import "colors" + +.#{$prefix}adm-ico + font-size: 18px + width: 18px + text-align: center + display: inline-block + color: #{$admin-ok} + &.inactive + color: #{$admin-warning} + &.pointer + cursor: pointer + +body.#{$prefix}admin-modal-open + overflow: hidden + +.#{$prefix}admin + #major-publishing-actions + background-color: #fff !important + border-top: 0 + a.button, + a.button-primary + i + font-size: 15px !important + height: 15px !important + width: 15px !important + text-align: center !important + margin: 0 5px 0 0 !important + display: inline-block + &:before + position: relative + top: 1px + +.#{$prefix}admin-metabox + * + -webkit-font-smoothing: antialiased !important + -moz-osx-font-smoothing: grayscale !important + h6 + font-size: 14px + margin: 12px 0 0 0 + h3 + padding-left: 0 !important + h4 + font-size: 14px + background: #f5f5f5 + padding: 8px 4px + color: #333 + p + margin: 10px 0 0 0 + label + display: block + cursor: default + padding: 0 !important + font-size: 13px + color: #666 + + input[type="text"] + height: auto !important + width: 100% + max-width: 100% + display: block + box-sizing: border-box !important + font-size: 13px !important + line-height: 1.4em !important + padding: 4px 10px !important + &:disabled + opacity: 0.7 !important + color: #aaa !important + &.small + width: 54px + &.#{$prefix}admin-error + border-color: #{$admin-warning} !important + + textarea + width: 100% + max-width: 100% + display: block + box-sizing: border-box !important + font-size: 13px !important + line-height: 1.4em !important + padding: 8px !important + color: #888 !important + min-height: 100px + height: 100px + &.tall + min-height: 200px + height: 200px + &.#{$prefix}admin-error + border-color: #{$admin-warning} !important diff --git a/assets/css/admin/dashboard.css b/assets/css/admin/dashboard.css new file mode 100644 index 00000000..0504fde1 --- /dev/null +++ b/assets/css/admin/dashboard.css @@ -0,0 +1,67 @@ +#um-metaboxes-general h1 sup { + font-size: 14px; + position: relative; + font-weight: 400; + background: #0085ba; + color: #fff !important; + padding: 2px 4px !important; + border-radius: 3px; + top: 5px; + left: 3px; + border: none !important; } + +#um-metaboxes-general.wrap a.red, +#um-metaboxes-general.wrap span.red { + color: #c74a4a; } + +#um-metaboxes-general.wrap span.ok { + color: #7acf58; } + +.um-metabox-holder p.sub { + padding: 0 4px 2px 4px; + margin: 0 0 8px 0; + color: #8F8F8F; + font-size: 14px; + border-bottom: 1px solid #ECECEC; } + +.um-metabox-holder .table { + float: left; + width: 45%; } + .um-metabox-holder .table td { + white-space: nowrap; + font-size: 12px; } + +.um-metabox-holder a.warning { + color: #c74a4a !important; + background: transparent !important; + border: 0; } + +.um-metabox-holder .table_right { + float: right; + width: 45%; } + +.um-metabox-holder td.b { + padding-right: 6px; + text-align: right; + font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; + font-size: 14px; + width: 1%; } + .um-metabox-holder td.b a { + font-size: 18px; } + +.um-metabox-holder .norm i { + display: inline-block; + width: 30px; + text-align: center; } + +.um-metabox-holder .norm p { + margin: 5px 0; } + +.um-metabox-holder .norm .count { + font-size: 16px; + font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; + color: #999; + width: 40px; + display: inline-block; + text-align: right; + margin-right: 10px; } diff --git a/assets/css/admin/dashboard.min.css b/assets/css/admin/dashboard.min.css new file mode 100644 index 00000000..121b1a39 --- /dev/null +++ b/assets/css/admin/dashboard.min.css @@ -0,0 +1 @@ +#um-metaboxes-general h1 sup{font-size:14px;position:relative;font-weight:400;background:#0085ba;color:#fff!important;padding:2px 4px!important;border-radius:3px;top:5px;left:3px;border:none!important}#um-metaboxes-general.wrap a.red,#um-metaboxes-general.wrap span.red{color:#c74a4a}#um-metaboxes-general.wrap span.ok{color:#7acf58}.um-metabox-holder p.sub{padding:0 4px 2px 4px;margin:0 0 8px 0;color:#8f8f8f;font-size:14px;border-bottom:1px solid #ececec}.um-metabox-holder .table{float:left;width:45%}.um-metabox-holder .table td{white-space:nowrap;font-size:12px}.um-metabox-holder a.warning{color:#c74a4a!important;background:0 0!important;border:0}.um-metabox-holder .table_right{float:right;width:45%}.um-metabox-holder td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;width:1%}.um-metabox-holder td.b a{font-size:18px}.um-metabox-holder .norm i{display:inline-block;width:30px;text-align:center}.um-metabox-holder .norm p{margin:5px 0}.um-metabox-holder .norm .count{font-size:16px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;color:#999;width:40px;display:inline-block;text-align:right;margin-right:10px} \ No newline at end of file diff --git a/assets/css/admin/dashboard.sass b/assets/css/admin/dashboard.sass new file mode 100644 index 00000000..63702151 --- /dev/null +++ b/assets/css/admin/dashboard.sass @@ -0,0 +1,74 @@ +@import "colors" +@import "selectors" +@import "mixins" + +#um-metaboxes-general + h1 + sup + font-size: 14px + position: relative + font-weight: 400 + background: #{$um-base} + color: #fff !important + padding: 2px 4px !important + border-radius: 3px + top: 5px + left: 3px + border: none !important + &.wrap + a.red, + span.red + color: #{$admin-warning} + span.ok + color: #{$admin-ok} + +.um-metabox-holder + p.sub + padding: 0 4px 2px 4px + margin: 0 0 8px 0 + color: #8F8F8F + font-size: 14px + border-bottom: 1px solid #ECECEC + + .table + float: left + width: 45% + td + white-space: nowrap + font-size: 12px + + a.warning + color: #{$admin-warning} !important + background: transparent !important + border: 0 + + .table_right + float: right + width: 45% + + td.b + padding-right: 6px + text-align: right + font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif + font-size: 14px + width: 1% + a + font-size: 18px + + .norm + i + display: inline-block + width: 30px + text-align: center + + p + margin: 5px 0 + + .count + font-size: 16px + font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif + color: #999 + width: 40px + display: inline-block + text-align: right + margin-right: 10px diff --git a/assets/css/admin/directories-screen.css b/assets/css/admin/directories-screen.css new file mode 100644 index 00000000..0f801ad2 --- /dev/null +++ b/assets/css/admin/directories-screen.css @@ -0,0 +1,13 @@ +.um-admin.post-type-um_directory .wp-list-table.posts .manage-column.column-id { + width: 60px; } + +.um-admin.post-type-um_directory .wp-list-table.posts .manage-column.column-shortcode { + width: 35%; } + +.um-admin.post-type-um_directory .wp-list-table.posts .column-is_default { + width: 120px; + text-align: center !important; } + +@media screen and (max-width: 782px) { + .um-admin.post-type-um_directory .wp-list-table.posts td.column-is_default { + text-align: left !important; } } diff --git a/assets/css/admin/directories-screen.min.css b/assets/css/admin/directories-screen.min.css new file mode 100644 index 00000000..84f8cc90 --- /dev/null +++ b/assets/css/admin/directories-screen.min.css @@ -0,0 +1 @@ +.um-admin.post-type-um_directory .wp-list-table.posts .manage-column.column-id{width:60px}.um-admin.post-type-um_directory .wp-list-table.posts .manage-column.column-shortcode{width:35%}.um-admin.post-type-um_directory .wp-list-table.posts .column-is_default{width:120px;text-align:center!important}@media screen and (max-width:782px){.um-admin.post-type-um_directory .wp-list-table.posts td.column-is_default{text-align:left!important}} \ No newline at end of file diff --git a/assets/css/admin/directories-screen.sass b/assets/css/admin/directories-screen.sass new file mode 100644 index 00000000..c652abb7 --- /dev/null +++ b/assets/css/admin/directories-screen.sass @@ -0,0 +1,18 @@ +@import "selectors" + +.#{$prefix}admin.post-type-um_directory + .wp-list-table.posts + .manage-column + &.column-id + width: 60px + &.column-shortcode + width: 35% + .column-is_default + width: 120px + text-align: center !important + +@media screen and (max-width: 782px) + .#{$prefix}admin.post-type-um_directory + .wp-list-table.posts + td.column-is_default + text-align: left !important diff --git a/assets/css/admin/extensions.css b/assets/css/admin/extensions.css new file mode 100644 index 00000000..791e3607 --- /dev/null +++ b/assets/css/admin/extensions.css @@ -0,0 +1,146 @@ +#um-extensions-wrap #the-list { + margin: 0; + width: 100%; + display: grid; + grid-template-rows: auto 1fr; + grid-template-columns: repeat(3, 1fr); + grid-gap: 10px; + grid-auto-rows: minmax(max-content, auto); + -ms-grid-template-rows: auto 1fr; + -ms-grid-template-columns: repeat(3, 1fr); + -ms-grid-gap: 10px; + -ms-grid-auto-rows: minmax(max-content, auto); + align-items: center; } + +#um-extensions-wrap .plugin-card { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + flex-wrap: nowrap; + width: 100%; + margin: 0; + padding: 20px; } + +#um-extensions-wrap .plugin-image-wrapper { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + flex-wrap: nowrap; + color: #fff; + height: 70px; + width: 70px; + margin: 0 auto; + border-radius: 60px; + box-shadow: 0 2px 9px rgba(50, 50, 93, 0.21); + border: solid 4px #fff; + overflow: hidden; } + #um-extensions-wrap .plugin-image-wrapper a { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + background-color: #7856ff; } + +#um-extensions-wrap a.plugin-image { + display: block; } + #um-extensions-wrap a.plugin-image img { + display: block; } + #um-extensions-wrap a.plugin-image.svg-image { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + flex-wrap: nowrap; } + #um-extensions-wrap a.plugin-image.svg-image img { + filter: invert(1); + background-color: transparent; + width: 38px; + height: auto; } + #um-extensions-wrap a.plugin-image:not(.svg-image) img { + width: 70px; + margin: 0; + height: 70px; + padding: 0; } + +#um-extensions-wrap #um_bbpress_image { + background-color: #fff !important; + filter: none !important; + width: 70px !important; } + +#um-extensions-wrap #um_mycred_image { + background-color: #fff; } + +#um-extensions-wrap #um_groups_image, +#um-extensions-wrap #um_profile-tabs_image, +#um-extensions-wrap #um_user-tags_image, +#um-extensions-wrap #um_friends_image, +#um-extensions-wrap #um_user-reviews_image, +#um-extensions-wrap #um_verified-users_image, +#um-extensions-wrap #um_private-content_image, +#um-extensions-wrap #um_online-users_image { + width: 36px !important; } + +#um-extensions-wrap #um_notices_image, +#um-extensions-wrap #um_social-activity_image, +#um-extensions-wrap #um_profile-completeness_image, +#um-extensions-wrap #um_private-messages_image, +#um-extensions-wrap #um_user-photos_image, +#um-extensions-wrap #um_terms-conditions_image { + width: 29px !important; } + +#um-extensions-wrap #um_social-login_image { + width: 28px !important; } + +#um-extensions-wrap #um_real-time-notifications_image, +#um-extensions-wrap #um_user-notes_image { + width: 26px !important; } + +#um-extensions-wrap #um_followers_image, +#um-extensions-wrap #um_user-locations_image { + width: 32px !important; } + +#um-extensions-wrap #um_user-bookmarks_image { + width: 23px !important; } + +#um-extensions-wrap .plugin-card-top { + margin: 0; + padding: 20px 0 0 0; + width: 100%; + min-height: 100px; } + #um-extensions-wrap .plugin-card-top h3 { + text-align: center; + margin: 0 0 20px 0; + padding: 0; } + #um-extensions-wrap .plugin-card-top .desc { + text-align: center; + margin: 0 !important; + padding: 0 !important; } + +#um-extensions-wrap .plugin-action-links { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: baseline; + flex-wrap: nowrap; + width: 100%; + padding: 20px 0 0 0; } + +@media (max-width: 1152px) { + #um-extensions-wrap .plugin-card-top { + min-height: 120px; } } + +@media (max-width: 992px) { + #um-extensions-wrap #the-list { + grid-template-columns: repeat(2, 1fr); + -ms-grid-template-columns: repeat(2, 1fr); } } + +@media (max-width: 782px) { + #um-extensions-wrap #the-list { + grid-template-columns: repeat(1, 1fr); + -ms-grid-template-columns: repeat(1, 1fr); } } + +@media screen and (max-width: 782px) { + #um-extensions-wrap .plugin-card-top { + min-height: 80px; } } diff --git a/assets/css/admin/extensions.min.css b/assets/css/admin/extensions.min.css new file mode 100644 index 00000000..a0b437f9 --- /dev/null +++ b/assets/css/admin/extensions.min.css @@ -0,0 +1 @@ +#um-extensions-wrap #the-list{margin:0;width:100%;display:grid;grid-template-rows:auto 1fr;grid-template-columns:repeat(3,1fr);grid-gap:10px;grid-auto-rows:minmax(max-content,auto);-ms-grid-template-rows:auto 1fr;-ms-grid-template-columns:repeat(3,1fr);-ms-grid-gap:10px;-ms-grid-auto-rows:minmax(max-content,auto);align-items:center}#um-extensions-wrap .plugin-card{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;flex-wrap:nowrap;width:100%;margin:0;padding:20px}#um-extensions-wrap .plugin-image-wrapper{display:flex;flex-direction:row;justify-content:center;align-items:center;flex-wrap:nowrap;color:#fff;height:70px;width:70px;margin:0 auto;border-radius:60px;box-shadow:0 2px 9px rgba(50,50,93,.21);border:solid 4px #fff;overflow:hidden}#um-extensions-wrap .plugin-image-wrapper a{width:100%;height:100%;margin:0;padding:0;background-color:#7856ff}#um-extensions-wrap a.plugin-image{display:block}#um-extensions-wrap a.plugin-image img{display:block}#um-extensions-wrap a.plugin-image.svg-image{display:flex;flex-direction:row;justify-content:center;align-items:center;flex-wrap:nowrap}#um-extensions-wrap a.plugin-image.svg-image img{filter:invert(1);background-color:transparent;width:38px;height:auto}#um-extensions-wrap a.plugin-image:not(.svg-image) img{width:70px;margin:0;height:70px;padding:0}#um-extensions-wrap #um_bbpress_image{background-color:#fff!important;filter:none!important;width:70px!important}#um-extensions-wrap #um_mycred_image{background-color:#fff}#um-extensions-wrap #um_friends_image,#um-extensions-wrap #um_groups_image,#um-extensions-wrap #um_online-users_image,#um-extensions-wrap #um_private-content_image,#um-extensions-wrap #um_profile-tabs_image,#um-extensions-wrap #um_user-reviews_image,#um-extensions-wrap #um_user-tags_image,#um-extensions-wrap #um_verified-users_image{width:36px!important}#um-extensions-wrap #um_notices_image,#um-extensions-wrap #um_private-messages_image,#um-extensions-wrap #um_profile-completeness_image,#um-extensions-wrap #um_social-activity_image,#um-extensions-wrap #um_terms-conditions_image,#um-extensions-wrap #um_user-photos_image{width:29px!important}#um-extensions-wrap #um_social-login_image{width:28px!important}#um-extensions-wrap #um_real-time-notifications_image,#um-extensions-wrap #um_user-notes_image{width:26px!important}#um-extensions-wrap #um_followers_image,#um-extensions-wrap #um_user-locations_image{width:32px!important}#um-extensions-wrap #um_user-bookmarks_image{width:23px!important}#um-extensions-wrap .plugin-card-top{margin:0;padding:20px 0 0 0;width:100%;min-height:100px}#um-extensions-wrap .plugin-card-top h3{text-align:center;margin:0 0 20px 0;padding:0}#um-extensions-wrap .plugin-card-top .desc{text-align:center;margin:0!important;padding:0!important}#um-extensions-wrap .plugin-action-links{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline;flex-wrap:nowrap;width:100%;padding:20px 0 0 0}@media (max-width:1152px){#um-extensions-wrap .plugin-card-top{min-height:120px}}@media (max-width:992px){#um-extensions-wrap #the-list{grid-template-columns:repeat(2,1fr);-ms-grid-template-columns:repeat(2,1fr)}}@media (max-width:782px){#um-extensions-wrap #the-list{grid-template-columns:repeat(1,1fr);-ms-grid-template-columns:repeat(1,1fr)}}@media screen and (max-width:782px){#um-extensions-wrap .plugin-card-top{min-height:80px}} \ No newline at end of file diff --git a/assets/css/admin/extensions.sass b/assets/css/admin/extensions.sass new file mode 100644 index 00000000..339ed89f --- /dev/null +++ b/assets/css/admin/extensions.sass @@ -0,0 +1,138 @@ +@import "selectors" +@import "mixins" + +#um-extensions-wrap + #the-list + margin: 0 + width: 100% + display: grid + grid-template-rows: auto 1fr + grid-template-columns: repeat(3, 1fr) + grid-gap: 10px + grid-auto-rows: minmax(max-content, auto) + -ms-grid-template-rows: auto 1fr + -ms-grid-template-columns: repeat(3, 1fr) + -ms-grid-gap: 10px + -ms-grid-auto-rows: minmax(max-content, auto) + align-items: center + .plugin-card + +flex( column, flex-start, stretch, nowrap ) + width: 100% + margin: 0 + padding: 20px + .plugin-image-wrapper + +flex( row, center, center, nowrap ) + color: #fff + height: 70px + width: 70px + margin: 0 auto + border-radius: 60px + box-shadow: 0 2px 9px rgba(50,50,93,0.21) + border: solid 4px #fff + overflow: hidden + a + width: 100% + height: 100% + margin: 0 + padding: 0 + background-color: #7856ff + + a.plugin-image + display: block + img + display: block + &.svg-image + +flex( row, center, center, nowrap ) + img + filter: invert(1) + background-color: transparent + width: 38px + height: auto + &:not(.svg-image) + img + width: 70px + margin: 0 + height: 70px + padding: 0 + + #um_bbpress_image + background-color: #fff !important + filter: none !important + width: 70px !important + + #um_mycred_image + background-color: #fff + + #um_groups_image, + #um_profile-tabs_image, + #um_user-tags_image, + #um_friends_image, + #um_user-reviews_image, + #um_verified-users_image, + #um_private-content_image, + #um_online-users_image + width: 36px !important + + #um_notices_image, + #um_social-activity_image, + #um_profile-completeness_image, + #um_private-messages_image, + #um_user-photos_image, + #um_terms-conditions_image + width: 29px !important + + #um_social-login_image + width: 28px !important + + #um_real-time-notifications_image, + #um_user-notes_image + width: 26px !important + + #um_followers_image, + #um_user-locations_image + width: 32px !important + + #um_user-bookmarks_image + width: 23px !important + + .plugin-card-top + margin: 0 + padding: 20px 0 0 0 + width: 100% + min-height: 100px + h3 + text-align: center + margin: 0 0 20px 0 + padding: 0 + .desc + text-align: center + margin: 0 !important + padding: 0 !important + + .plugin-action-links + +flex( row, space-between, baseline, nowrap ) + width: 100% + padding: 20px 0 0 0 + + +@media (max-width: 1152px) + #um-extensions-wrap + .plugin-card-top + min-height: 120px + +@media (max-width: 992px) + #um-extensions-wrap + #the-list + grid-template-columns: repeat(2, 1fr) + -ms-grid-template-columns: repeat(2, 1fr) + +@media (max-width: 782px) + #um-extensions-wrap + #the-list + grid-template-columns: repeat(1, 1fr) + -ms-grid-template-columns: repeat(1, 1fr) + +@media screen and (max-width: 782px) + #um-extensions-wrap + .plugin-card-top + min-height: 80px diff --git a/assets/css/admin/forms-screen.css b/assets/css/admin/forms-screen.css new file mode 100644 index 00000000..ccc42f00 --- /dev/null +++ b/assets/css/admin/forms-screen.css @@ -0,0 +1,17 @@ +.um-admin.post-type-um_form .manage-column.column-id { + width: 60px; } + +.um-admin.post-type-um_form .manage-column.column-mode { + width: 100px; } + +.um-admin.post-type-um_form .manage-column.column-is_default { + width: 60px; } + +.um-admin.post-type-um_form .manage-column.column-title { + width: 200px; } + +.um-admin.post-type-um_form .manage-column.column-shortcode { + width: 200px; } + +.um-admin.post-type-um_form td.column-shortcode, .um-admin.post-type-um_form td.column-id { + font-size: 14px; } diff --git a/assets/css/admin/forms-screen.min.css b/assets/css/admin/forms-screen.min.css new file mode 100644 index 00000000..e2fc75ef --- /dev/null +++ b/assets/css/admin/forms-screen.min.css @@ -0,0 +1 @@ +.um-admin.post-type-um_form .manage-column.column-id{width:60px}.um-admin.post-type-um_form .manage-column.column-mode{width:100px}.um-admin.post-type-um_form .manage-column.column-is_default{width:60px}.um-admin.post-type-um_form .manage-column.column-title{width:200px}.um-admin.post-type-um_form .manage-column.column-shortcode{width:200px}.um-admin.post-type-um_form td.column-id,.um-admin.post-type-um_form td.column-shortcode{font-size:14px} \ No newline at end of file diff --git a/assets/css/admin/forms-screen.sass b/assets/css/admin/forms-screen.sass new file mode 100644 index 00000000..12129634 --- /dev/null +++ b/assets/css/admin/forms-screen.sass @@ -0,0 +1,18 @@ +@import "selectors" + +.#{$prefix}admin.post-type-um_form + .manage-column + &.column-id + width: 60px + &.column-mode + width: 100px + &.column-is_default + width: 60px + &.column-title + width: 200px + &.column-shortcode + width: 200px + td + &.column-shortcode, + &.column-id + font-size: 14px diff --git a/assets/css/admin/global.css b/assets/css/admin/global.css new file mode 100644 index 00000000..2744e0df --- /dev/null +++ b/assets/css/admin/global.css @@ -0,0 +1,59 @@ +ul#adminmenu li#toplevel_page_ultimatemember a.wp-has-current-submenu:after { + display: none !important; } + +ul#adminmenu li#toplevel_page_ultimatemember.wp-has-submenu.wp-not-current-submenu:hover:after { + right: -9999999px; } + +ul#adminmenu > li#toplevel_page_ultimatemember.current > a.current:after { + display: none !important; } + +.um-admin-notice { + border-color: #0085ba; + color: #555; } + .um-admin-notice.error { + border-color: #dc3232; } + .um-admin-notice.notice-warning { + border-color: #dba617; } + .um-admin-notice a { + text-decoration: none; + color: #0085ba; } + .um-admin-notice a:hover { + color: #44b0ec; } + .um-admin-notice a.button-primary { + background-color: #0085ba; + border-color: #0085ba; } + .um-admin-notice a.button-primary:hover { + background-color: #008ec2; + border-color: #008ec2; } + .um-admin-notice a.button-secondary { + opacity: 0.7; } + .um-admin-notice a.button-secondary:hover { + opacity: 0.9; } + +/* UM Tooltip ( future helptip ) */ +.ui-tooltip.um_tooltip { + padding: 8px; + color: #eee !important; + background: rgba(0, 0, 0, 0.85) !important; + position: absolute; + z-index: 1000000; + max-width: 300px; + font-size: 12px; + border-radius: 5px; + border: none !important; + text-shadow: none !important; } + +.um_tooltip { + cursor: pointer; + vertical-align: middle; } + .um_tooltip:hover { + opacity: 1; } + .um_tooltip:hover:before { + opacity: 0.8; } + .um_tooltip.dashicons, .um_tooltip.dashicons:before { + height: 22px; } + .um_tooltip.dashicons-editor-help:before { + float: left; + font-size: 20px; + line-height: 20px; + color: rgba(0, 0, 0, 0.85) !important; } diff --git a/assets/css/admin/global.min.css b/assets/css/admin/global.min.css new file mode 100644 index 00000000..aca911fc --- /dev/null +++ b/assets/css/admin/global.min.css @@ -0,0 +1 @@ +ul#adminmenu li#toplevel_page_ultimatemember a.wp-has-current-submenu:after{display:none!important}ul#adminmenu li#toplevel_page_ultimatemember.wp-has-submenu.wp-not-current-submenu:hover:after{right:-9999999px}ul#adminmenu>li#toplevel_page_ultimatemember.current>a.current:after{display:none!important}.um-admin-notice{border-color:#0085ba;color:#555}.um-admin-notice.error{border-color:#dc3232}.um-admin-notice.notice-warning{border-color:#dba617}.um-admin-notice a{text-decoration:none;color:#0085ba}.um-admin-notice a:hover{color:#44b0ec}.um-admin-notice a.button-primary{background-color:#0085ba;border-color:#0085ba}.um-admin-notice a.button-primary:hover{background-color:#008ec2;border-color:#008ec2}.um-admin-notice a.button-secondary{opacity:.7}.um-admin-notice a.button-secondary:hover{opacity:.9}.ui-tooltip.um_tooltip{padding:8px;color:#eee!important;background:rgba(0,0,0,.85)!important;position:absolute;z-index:1000000;max-width:300px;font-size:12px;border-radius:5px;border:none!important;text-shadow:none!important}.um_tooltip{cursor:pointer;vertical-align:middle}.um_tooltip:hover{opacity:1}.um_tooltip:hover:before{opacity:.8}.um_tooltip.dashicons,.um_tooltip.dashicons:before{height:22px}.um_tooltip.dashicons-editor-help:before{float:left;font-size:20px;line-height:20px;color:rgba(0,0,0,.85)!important} \ No newline at end of file diff --git a/assets/css/admin/global.sass b/assets/css/admin/global.sass new file mode 100644 index 00000000..880027ea --- /dev/null +++ b/assets/css/admin/global.sass @@ -0,0 +1,69 @@ +@import "selectors" +@import "colors" + +ul#adminmenu + li#toplevel_page_ultimatemember + a.wp-has-current-submenu:after + display: none !important + &.wp-has-submenu.wp-not-current-submenu:hover:after + right: -9999999px + & > li#toplevel_page_ultimatemember.current > a.current:after + display: none !important + +.#{$prefix}admin-notice + border-color: #{$um-base} + color: #555 + &.error + border-color: #dc3232 + &.notice-warning + border-color: #dba617 + a + text-decoration: none + color: #{$um-base} + &:hover + color: #44b0ec + &.button-primary + background-color: #{$um-base} + border-color: #{$um-base} + &:hover + background-color: #{$um-base-hover} + border-color: #{$um-base-hover} + &.button-secondary + opacity: 0.7 + &:hover + opacity: 0.9 + +/* UM Tooltip ( future helptip ) */ +.ui-tooltip + &.#{$helptip} + padding: 8px + color: $grey-text !important + background: $overlay !important + position: absolute + z-index: 1000000 + max-width: 300px + font-size: 12px + border-radius: 5px + border: none !important + text-shadow: none !important + +.#{$helptip} + cursor: pointer + vertical-align: middle + &:hover + opacity: 1 + &:before + opacity: 0.8 + &.dashicons + height: 22px + &:before + @extend .#{$helptip}.dashicons + &.dashicons-editor-help:before + float: left + font-size: 20px + line-height: 20px + color: $overlay !important + +// wp.org reviews admin notice: Removed for now to avoid the bad reviews +//.#{$prefix}hidden-notice +// display: none diff --git a/assets/css/admin/nav-menu.css b/assets/css/admin/nav-menu.css new file mode 100644 index 00000000..e1c369b3 --- /dev/null +++ b/assets/css/admin/nav-menu.css @@ -0,0 +1,11 @@ +.wp-admin p.um-nav-roles { + display: none; + margin-top: 5px; } + .wp-admin p.um-nav-roles label { + margin-top: 2px !important; + margin-bottom: 2px !important; } + .wp-admin p.um-nav-roles label input[type="checkbox"] { + margin-top: 2px !important; } + +.wp-admin p.um-nav-mode { + margin-top: 10px; } diff --git a/assets/css/admin/nav-menu.min.css b/assets/css/admin/nav-menu.min.css new file mode 100644 index 00000000..c9181550 --- /dev/null +++ b/assets/css/admin/nav-menu.min.css @@ -0,0 +1 @@ +.wp-admin p.um-nav-roles{display:none;margin-top:5px}.wp-admin p.um-nav-roles label{margin-top:2px!important;margin-bottom:2px!important}.wp-admin p.um-nav-roles label input[type=checkbox]{margin-top:2px!important}.wp-admin p.um-nav-mode{margin-top:10px} \ No newline at end of file diff --git a/assets/css/admin/nav-menu.sass b/assets/css/admin/nav-menu.sass new file mode 100644 index 00000000..0a099243 --- /dev/null +++ b/assets/css/admin/nav-menu.sass @@ -0,0 +1,13 @@ +@import "selectors" + +.wp-admin + p.#{$prefix}nav-roles + display: none + margin-top: 5px + label + margin-top: 2px !important + margin-bottom: 2px !important + input[type="checkbox"] + margin-top: 2px !important + p.#{$prefix}nav-mode + margin-top: 10px diff --git a/assets/css/admin/roles.css b/assets/css/admin/roles.css new file mode 100644 index 00000000..a6bc71a9 --- /dev/null +++ b/assets/css/admin/roles.css @@ -0,0 +1,34 @@ +#um-roles .row-actions .reset a { + color: #a00; } + #um-roles .row-actions .reset a:hover { + color: red; } + +.wp-list-table.roles .column-core, +.wp-list-table.roles .column-users { + width: 15%; + text-align: center !important; } + +.wp-list-table.roles .column-admin_access, +.wp-list-table.roles .column-priority { + width: 10%; + text-align: center !important; } + +@media screen and (max-width: 782px) { + .wp-list-table.roles .column-core, + .wp-list-table.roles .column-users, + .wp-list-table.roles .column-admin_access, + .wp-list-table.roles .column-priority { + text-align: left !important; } } + +#um-admin-form-wp-capabilities .um-metadata-line th { + width: auto; } + +#um-admin-form-wp-capabilities .um-metadata-line td { + width: 20px; } + +#um_edit_role #titlewrap > span { + width: 40px; + font-size: 24px; + float: left; + display: block; + line-height: 37px; } diff --git a/assets/css/admin/roles.min.css b/assets/css/admin/roles.min.css new file mode 100644 index 00000000..8343788a --- /dev/null +++ b/assets/css/admin/roles.min.css @@ -0,0 +1 @@ +#um-roles .row-actions .reset a{color:#a00}#um-roles .row-actions .reset a:hover{color:red}.wp-list-table.roles .column-core,.wp-list-table.roles .column-users{width:15%;text-align:center!important}.wp-list-table.roles .column-admin_access,.wp-list-table.roles .column-priority{width:10%;text-align:center!important}@media screen and (max-width:782px){.wp-list-table.roles .column-admin_access,.wp-list-table.roles .column-core,.wp-list-table.roles .column-priority,.wp-list-table.roles .column-users{text-align:left!important}}#um-admin-form-wp-capabilities .um-metadata-line th{width:auto}#um-admin-form-wp-capabilities .um-metadata-line td{width:20px}#um_edit_role #titlewrap>span{width:40px;font-size:24px;float:left;display:block;line-height:37px} \ No newline at end of file diff --git a/assets/css/admin/roles.sass b/assets/css/admin/roles.sass new file mode 100644 index 00000000..08869811 --- /dev/null +++ b/assets/css/admin/roles.sass @@ -0,0 +1,44 @@ +@import "selectors" +@import "colors" + +##{$prefix}roles + .row-actions + .reset + a + color: #{$delete-link} + &:hover + color: red + + +.wp-list-table.roles + .column-core, + .column-users + width: 15% + text-align: center !important + .column-admin_access, + .column-priority + width: 10% + text-align: center !important + +@media screen and (max-width: 782px) + .wp-list-table.roles + .column-core, + .column-users, + .column-admin_access, + .column-priority + text-align: left !important + +##{$prefix}admin-form-wp-capabilities + .#{$prefix}metadata-line + th + width: auto + td + width: 20px + +#um_edit_role + #titlewrap > span + width: 40px + font-size: 24px + float: left + display: block + line-height: 37px diff --git a/assets/css/admin/users.css b/assets/css/admin/users.css new file mode 100644 index 00000000..a3cb3bbb --- /dev/null +++ b/assets/css/admin/users.css @@ -0,0 +1,4 @@ +.um-admin.users-php .subsubsub li.subsep { + display: block; + visibility: hidden; + height: 0; } diff --git a/assets/css/admin/users.min.css b/assets/css/admin/users.min.css new file mode 100644 index 00000000..dc8d9757 --- /dev/null +++ b/assets/css/admin/users.min.css @@ -0,0 +1 @@ +.um-admin.users-php .subsubsub li.subsep{display:block;visibility:hidden;height:0} \ No newline at end of file diff --git a/assets/css/admin/users.sass b/assets/css/admin/users.sass new file mode 100644 index 00000000..31008f91 --- /dev/null +++ b/assets/css/admin/users.sass @@ -0,0 +1,8 @@ +@import "selectors" + +.#{$prefix}admin.users-php + .subsubsub + li.subsep + display: block + visibility: hidden + height: 0 diff --git a/assets/css/common.css b/assets/css/common.css new file mode 100644 index 00000000..fccbf7b2 --- /dev/null +++ b/assets/css/common.css @@ -0,0 +1,28 @@ +/* Tipsy customizations */ +.um .tipsy { + z-index: 9999999999; + font-size: inherit; } + +.um .tipsy-inner { + background-color: #333333; + color: #fff; + max-width: 250px; + padding: 6px 10px; + text-align: left; + font-size: 13px; + line-height: 17px; + word-wrap: break-word; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + +.um .tipsy-arrow-n { + border-bottom-color: #333; } + +.um .tipsy-arrow-s { + border-top-color: #333; } + +.um .tipsy-arrow-e { + border-left-color: #333; } + +.um .tipsy-arrow-w { + border-right-color: #333; } diff --git a/assets/css/common.min.css b/assets/css/common.min.css new file mode 100644 index 00000000..9647cd95 --- /dev/null +++ b/assets/css/common.min.css @@ -0,0 +1 @@ +.um .tipsy{z-index:9999999999;font-size:inherit}.um .tipsy-inner{background-color:#333;color:#fff;max-width:250px;padding:6px 10px;text-align:left;font-size:13px;line-height:17px;word-wrap:break-word;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.um .tipsy-arrow-n{border-bottom-color:#333}.um .tipsy-arrow-s{border-top-color:#333}.um .tipsy-arrow-e{border-left-color:#333}.um .tipsy-arrow-w{border-right-color:#333} \ No newline at end of file diff --git a/assets/css/common.sass b/assets/css/common.sass new file mode 100644 index 00000000..96611800 --- /dev/null +++ b/assets/css/common.sass @@ -0,0 +1,26 @@ +/* Tipsy customizations */ +.um + .tipsy + z-index: 9999999999 + font-size: inherit + + .tipsy-inner + background-color: #333333 + color: #fff + max-width: 250px + padding: 6px 10px + text-align: left + font-size: 13px + line-height: 17px + word-wrap: break-word + -webkit-font-smoothing: antialiased + -moz-osx-font-smoothing: grayscale + + .tipsy-arrow-n + border-bottom-color: #333 + .tipsy-arrow-s + border-top-color: #333 + .tipsy-arrow-e + border-left-color: #333 + .tipsy-arrow-w + border-right-color: #333 diff --git a/assets/css/simplebar.css b/assets/css/simplebar.css deleted file mode 100644 index 49061205..00000000 --- a/assets/css/simplebar.css +++ /dev/null @@ -1,190 +0,0 @@ -[data-simplebar] { - position: relative; - flex-direction: column; - flex-wrap: wrap; - justify-content: flex-start; - align-content: flex-start; - align-items: flex-start; -} - -.simplebar-wrapper { - overflow: hidden; - width: inherit; - height: inherit; - max-width: inherit; - max-height: inherit; -} - -.simplebar-mask { - direction: inherit; - position: absolute; - overflow: hidden; - padding: 0; - margin: 0; - left: 0; - top: 0; - bottom: 0; - right: 0; - width: auto !important; - height: auto !important; - z-index: 0; -} - -.simplebar-offset { - direction: inherit !important; - box-sizing: inherit !important; - resize: none !important; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - padding: 0; - margin: 0; - -webkit-overflow-scrolling: touch; -} - -.simplebar-content-wrapper { - direction: inherit; - box-sizing: border-box !important; - position: relative; - display: block; - height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */ - width: auto; - visibility: visible; - overflow: auto; /* Scroll on this element otherwise element can't have a padding applied properly */ - max-width: 100%; /* Not required for horizontal scroll to trigger */ - max-height: 100%; /* Needed for vertical scroll to trigger */ -} - -.simplebar-content:before, -.simplebar-content:after { - content: " "; - display: table; -} - -.simplebar-placeholder { - max-height: 100%; - max-width: 100%; - width: 100%; - pointer-events: none; -} - -.simplebar-height-auto-observer-wrapper { - box-sizing: inherit !important; - height: 100%; - width: inherit; - max-width: 1px; - position: relative; - float: left; - max-height: 1px; - overflow: hidden; - z-index: -1; - padding: 0; - margin: 0; - pointer-events: none; - flex-grow: inherit; - flex-shrink: 0; - flex-basis: 0; -} - -.simplebar-height-auto-observer { - box-sizing: inherit; - display: block; - opacity: 0; - position: absolute; - top: 0; - left: 0; - height: 1000%; - width: 1000%; - min-height: 1px; - min-width: 1px; - overflow: hidden; - pointer-events: none; - z-index: -1; -} - -.simplebar-track { - z-index: 1; - position: absolute; - right: 0; - bottom: 0; - pointer-events: none; - overflow: hidden; -} - -[data-simplebar].simplebar-dragging .simplebar-track { - pointer-events: all; -} - -.simplebar-scrollbar { - position: absolute; - right: 2px; - width: 7px; - min-height: 10px; -} - -.simplebar-scrollbar:before { - position: absolute; - content: ""; - background: black; - border-radius: 7px; - left: 0; - right: 0; - opacity: 0; - transition: opacity 0.2s linear; -} - -.simplebar-track .simplebar-scrollbar.simplebar-visible:before { - /* When hovered, remove all transitions from drag handle */ - opacity: 0.5; - transition: opacity 0s linear; -} - -.simplebar-track.simplebar-vertical { - top: 0; - width: 11px; -} - -.simplebar-track.simplebar-vertical .simplebar-scrollbar:before { - top: 2px; - bottom: 2px; -} - -.simplebar-track.simplebar-horizontal { - left: 0; - height: 11px; -} - -.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before { - height: 100%; - left: 2px; - right: 2px; -} - -.simplebar-track.simplebar-horizontal .simplebar-scrollbar { - right: auto; - left: 0; - top: 2px; - height: 7px; - min-height: 0; - min-width: 10px; - width: auto; -} - -/* Rtl support */ -[data-simplebar-direction="rtl"] .simplebar-track.simplebar-vertical { - right: auto; - left: 0; -} - -.hs-dummy-scrollbar-size { - direction: rtl; - position: fixed; - opacity: 0; - visibility: hidden; - height: 500px; - width: 500px; - overflow-y: hidden; - overflow-x: scroll; -} diff --git a/assets/css/um-crop.css b/assets/css/um-crop.css deleted file mode 100644 index d3f5e186..00000000 --- a/assets/css/um-crop.css +++ /dev/null @@ -1,294 +0,0 @@ -.cropper-container { - direction: ltr; - font-size: 0; - line-height: 0; - position: relative; - -ms-touch-action: none; - touch-action: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.cropper-container img { - display: block; - height: 100%; - image-orientation: 0deg; - max-height: none !important; - max-width: none !important; - min-height: 0 !important; - min-width: 0 !important; - width: 100%; -} - -.cropper-wrap-box, -.cropper-canvas, -.cropper-drag-box, -.cropper-crop-box, -.cropper-modal { - bottom: 0; - left: 0; - position: absolute; - right: 0; - top: 0; -} - -.cropper-wrap-box, -.cropper-canvas { - overflow: hidden; -} - -.cropper-drag-box { - background-color: #fff; - opacity: 0; -} - -.cropper-modal { - background-color: #000; - opacity: 0.5; -} - -.cropper-view-box { - display: block; - height: 100%; - outline: 1px solid #39f; - outline-color: rgba(51, 153, 255, 0.75); - overflow: hidden; - width: 100%; -} - -.cropper-dashed { - border: 0 dashed #eee; - display: block; - opacity: 0.5; - position: absolute; -} - -.cropper-dashed.dashed-h { - border-bottom-width: 1px; - border-top-width: 1px; - height: calc(100% / 3); - left: 0; - top: calc(100% / 3); - width: 100%; -} - -.cropper-dashed.dashed-v { - border-left-width: 1px; - border-right-width: 1px; - height: 100%; - left: calc(100% / 3); - top: 0; - width: calc(100% / 3); -} - -.cropper-center { - display: block; - height: 0; - left: 50%; - opacity: 0.75; - position: absolute; - top: 50%; - width: 0; -} - -.cropper-center::before, -.cropper-center::after { - background-color: #eee; - content: ' '; - display: block; - position: absolute; -} - -.cropper-center::before { - height: 1px; - left: -3px; - top: 0; - width: 7px; -} - -.cropper-center::after { - height: 7px; - left: 0; - top: -3px; - width: 1px; -} - -.cropper-face, -.cropper-line, -.cropper-point { - display: block; - height: 100%; - opacity: 0.1; - position: absolute; - width: 100%; -} - -.cropper-face { - background-color: #fff; - left: 0; - top: 0; -} - -.cropper-line { - background-color: #39f; -} - -.cropper-line.line-e { - cursor: ew-resize; - right: -3px; - top: 0; - width: 5px; -} - -.cropper-line.line-n { - cursor: ns-resize; - height: 5px; - left: 0; - top: -3px; -} - -.cropper-line.line-w { - cursor: ew-resize; - left: -3px; - top: 0; - width: 5px; -} - -.cropper-line.line-s { - bottom: -3px; - cursor: ns-resize; - height: 5px; - left: 0; -} - -.cropper-point { - background-color: #39f; - height: 5px; - opacity: 0.75; - width: 5px; -} - -.cropper-point.point-e { - cursor: ew-resize; - margin-top: -3px; - right: -3px; - top: 50%; -} - -.cropper-point.point-n { - cursor: ns-resize; - left: 50%; - margin-left: -3px; - top: -3px; -} - -.cropper-point.point-w { - cursor: ew-resize; - left: -3px; - margin-top: -3px; - top: 50%; -} - -.cropper-point.point-s { - bottom: -3px; - cursor: s-resize; - left: 50%; - margin-left: -3px; -} - -.cropper-point.point-ne { - cursor: nesw-resize; - right: -3px; - top: -3px; -} - -.cropper-point.point-nw { - cursor: nwse-resize; - left: -3px; - top: -3px; -} - -.cropper-point.point-sw { - bottom: -3px; - cursor: nesw-resize; - left: -3px; -} - -.cropper-point.point-se { - bottom: -3px; - cursor: nwse-resize; - height: 20px; - opacity: 1; - right: -3px; - width: 20px; -} - -@media (min-width: 768px) { - .cropper-point.point-se { - height: 15px; - width: 15px; - } -} - -@media (min-width: 992px) { - .cropper-point.point-se { - height: 10px; - width: 10px; - } -} - -@media (min-width: 1200px) { - .cropper-point.point-se { - height: 5px; - opacity: 0.75; - width: 5px; - } -} - -.cropper-point.point-se::before { - background-color: #39f; - bottom: -50%; - content: ' '; - display: block; - height: 200%; - opacity: 0; - position: absolute; - right: -50%; - width: 200%; -} - -.cropper-invisible { - opacity: 0; -} - -.cropper-bg { - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC'); -} - -.cropper-hide { - display: block; - height: 0; - position: absolute; - width: 0; -} - -.cropper-hidden { - display: none !important; -} - -.cropper-move { - cursor: move; -} - -.cropper-crop { - cursor: crosshair; -} - -.cropper-disabled .cropper-drag-box, -.cropper-disabled .cropper-face, -.cropper-disabled .cropper-line, -.cropper-disabled .cropper-point { - cursor: not-allowed; -} diff --git a/assets/css/um-modal.css b/assets/css/um-modal.css index 7ddda9eb..54a7cad2 100644 --- a/assets/css/um-modal.css +++ b/assets/css/um-modal.css @@ -98,7 +98,7 @@ .um-modal-body { min-height: 3px; padding: 20px; - box-sizing: border-box; + box-sizing: border-box !important; width: 100%; background: #fff; -moz-border-radius: 0 0 3px 3px; @@ -201,4 +201,4 @@ a.um-modal-btn:visited { .um-modal .um-single-image-preview.crop img{ float:left; -} \ No newline at end of file +} diff --git a/assets/css/um-styles.css b/assets/css/um-styles.css index d107dea4..a4eedaae 100644 --- a/assets/css/um-styles.css +++ b/assets/css/um-styles.css @@ -2,7 +2,7 @@ - Layout */ -.um { +.um:not(.um-admin) { width: 100%; text-align: left; box-sizing: border-box; @@ -19,9 +19,9 @@ display: none; } -.um *, -.um *:before, -.um *:after { +.um:not(.um-admin) *, +.um:not(.um-admin) *:before, +.um:not(.um-admin) *:after { box-sizing: content-box; } @@ -40,14 +40,14 @@ border-bottom: 0 !important; } -.um a:focus, +.um:not(.um-admin) a:focus, .um-modal a:focus { outline: 0 !important; } -.um a .image-overlay, -.um a:hover .image-overlay, -.um a:hover .image-overlay * { +.um:not(.um-admin) a .image-overlay, +.um:not(.um-admin) a:hover .image-overlay, +.um:not(.um-admin) a:hover .image-overlay * { display: none !important; width: 0 !important; height: 0 !important; @@ -60,13 +60,13 @@ } .um.um-in-admin .um-tip {display: none !important} -.um:not(.um-directory) input, -.um:not(.um-directory) select, -.um:not(.um-directory) textarea{ +.um:not(.um-admin):not(.um-directory) input, +.um:not(.um-admin):not(.um-directory) select, +.um:not(.um-admin):not(.um-directory) textarea{ font-size: 15px; } -.um * { +.um:not(.um-admin) * { -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; } diff --git a/includes/admin/assets/img/1-column-active.gif b/assets/img/builder/1-column-active.gif similarity index 100% rename from includes/admin/assets/img/1-column-active.gif rename to assets/img/builder/1-column-active.gif diff --git a/includes/admin/assets/img/1-column.gif b/assets/img/builder/1-column.gif similarity index 100% rename from includes/admin/assets/img/1-column.gif rename to assets/img/builder/1-column.gif diff --git a/includes/admin/assets/img/2-columns-active.gif b/assets/img/builder/2-columns-active.gif similarity index 100% rename from includes/admin/assets/img/2-columns-active.gif rename to assets/img/builder/2-columns-active.gif diff --git a/includes/admin/assets/img/2-columns.gif b/assets/img/builder/2-columns.gif similarity index 100% rename from includes/admin/assets/img/2-columns.gif rename to assets/img/builder/2-columns.gif diff --git a/includes/admin/assets/img/3-columns-active.gif b/assets/img/builder/3-columns-active.gif similarity index 100% rename from includes/admin/assets/img/3-columns-active.gif rename to assets/img/builder/3-columns-active.gif diff --git a/includes/admin/assets/img/3-columns.gif b/assets/img/builder/3-columns.gif similarity index 100% rename from includes/admin/assets/img/3-columns.gif rename to assets/img/builder/3-columns.gif diff --git a/assets/js/admin/blocks.js b/assets/js/admin/block.js similarity index 100% rename from assets/js/admin/blocks.js rename to assets/js/admin/block.js diff --git a/assets/js/admin/block.min.js b/assets/js/admin/block.min.js new file mode 100644 index 00000000..50daef62 --- /dev/null +++ b/assets/js/admin/block.min.js @@ -0,0 +1 @@ +"use strict";var um_components=wp.components,umSelectControl=um_components.SelectControl,umTextareaControl=um_components.TextareaControl;function um_admin_blocks_custom_fields(e,t){return wp.hooks.applyFilters("um_admin_blocks_custom_fields",[],e,t)}var um_block_restriction=wp.compose.createHigherOrderComponent(function(s){var _={um_who_access:"um_block_settings_hide",um_roles_access:"um_block_settings_hide",um_message_type:"um_block_settings_hide",um_message_content:"um_block_settings_hide"},_=wp.hooks.applyFilters("um_admin_blocks_condition_fields_default",_);return function(t){var e=void 0!==t.attributes.um_is_restrict&&t.attributes.um_is_restrict;return!0!==t.attributes.um_is_restrict?(_.um_who_access="um_block_settings_hide",_.um_roles_access="um_block_settings_hide",_.um_message_type="um_block_settings_hide",_.um_message_content="um_block_settings_hide"):(_.um_who_access="",0===parseInt(t.attributes.um_who_access)||void 0===t.attributes.um_who_access?(_.um_roles_access="um_block_settings_hide",_.um_message_type="um_block_settings_hide",_.um_message_content="um_block_settings_hide"):(1===parseInt(t.attributes.um_who_access)&&(_.um_roles_access=""),_.um_message_type="",2===parseInt(t.attributes.um_message_type)?_.um_message_content="":_.um_message_content="um_block_settings_hide")),_=wp.hooks.applyFilters("um_admin_blocks_condition_fields",_,t),wp.element.createElement(wp.element.Fragment,{},wp.element.createElement(s,t),wp.element.createElement(wp.blockEditor.InspectorControls,{},wp.element.createElement(wp.components.PanelBody,{title:wp.i18n.__("Ultimate Member: Content Restriction","ultimate-member"),className:"um_block_settings"},wp.element.createElement(wp.components.ToggleControl,{label:wp.i18n.__("Restrict access?","ultimate-member"),checked:e,onChange:function(e){t.setAttributes({um_is_restrict:e}),!1===e?(_.um_who_access="um_block_settings_hide",_.um_roles_access="um_block_settings_hide",_.um_message_type="um_block_settings_hide",_.um_message_content="um_block_settings_hide"):_.um_who_access="",_=wp.hooks.applyFilters("um_admin_blocks_condition_fields_on_change",_,"um_is_restrict",e)}}),wp.element.createElement(umSelectControl,{type:"number",className:_.um_who_access,label:wp.i18n.__("Who can access this block?","ultimate-member"),value:t.attributes.um_who_access,options:[{label:wp.i18n.__("Everyone","ultimate-member"),value:0},{label:wp.i18n.__("Logged in users","ultimate-member"),value:1},{label:wp.i18n.__("Logged out users","ultimate-member"),value:2}],onChange:function(e){t.setAttributes({um_who_access:e}),0===parseInt(e)?(_.um_message_type="um_block_settings_hide",_.um_message_content="um_block_settings_hide",_.um_roles_access="um_block_settings_hide"):1===parseInt(e)?(_.um_message_type="",_.um_roles_access=""):(_.um_message_type="",_.um_roles_access="um_block_settings_hide"),_=wp.hooks.applyFilters("um_admin_blocks_condition_fields_on_change",_,"um_who_access",e)}}),wp.element.createElement(umSelectControl,{multiple:!0,className:_.um_roles_access,label:wp.i18n.__("What roles can access this block?","ultimate-member"),value:t.attributes.um_roles_access,options:um_restrict_roles,onChange:function(e){t.setAttributes({um_roles_access:e})}}),wp.element.createElement(umSelectControl,{type:"number",className:_.um_message_type,label:wp.i18n.__("Restriction action","ultimate-member"),value:t.attributes.um_message_type,options:[{label:wp.i18n.__("Hide block","ultimate-member"),value:0},{label:wp.i18n.__("Show global default message","ultimate-member"),value:1},{label:wp.i18n.__("Show custom message","ultimate-member"),value:2}],onChange:function(e){t.setAttributes({um_message_type:e}),2===parseInt(e)?_.um_message_content="":_.um_message_content="um_block_settings_hide"}}),wp.element.createElement(umTextareaControl,{type:"number",className:_.um_message_content,label:wp.i18n.__("Custom restricted access message","ultimate-member"),value:t.attributes.um_message_content,onChange:function(e){t.setAttributes({um_message_content:e})}}),um_admin_blocks_custom_fields(_,t))))}},"um_block_restriction");wp.hooks.addFilter("editor.BlockEdit","um-block/um_block_restriction",um_block_restriction); \ No newline at end of file diff --git a/assets/js/admin/builder.js b/assets/js/admin/builder.js new file mode 100644 index 00000000..db52e55e --- /dev/null +++ b/assets/js/admin/builder.js @@ -0,0 +1,128 @@ +function um_form_select_tab( tab, set_val ) { + var mode_block = jQuery('input#form__um_mode'); + tab.parents('.um-admin-boxed-links').find('a').removeClass('um-admin-activebg'); + tab.addClass('um-admin-activebg'); + + jQuery('.um-admin div#side-sortables').show(); + jQuery('div[id^="um-admin-form"]').hide(); + jQuery('#submitdiv').show(); + jQuery('div#um-admin-form-mode,div#um-admin-form-title,div#um-admin-form-builder,div#um-admin-form-shortcode').show(); + jQuery('div[id^="um-admin-form-' + tab.data('role') + '"]').show(); + + if ( set_val ) { + mode_block.val( tab.data('role') ); + } + + jQuery('.empty-container').css({'border' : 'none'}); + jQuery('.um-admin-builder').removeClass().addClass( 'um-admin-builder ' + mode_block.val() ); +} + +/** + * This function updates the builder area with fields + * + * @returns {boolean} + */ +function um_admin_update_builder() { + var form_id = jQuery('.um-admin-builder').data('form_id'); + + + jQuery.ajax({ + url: wp.ajax.settings.url, + type: 'POST', + data: { + action:'um_update_builder', + form_id: form_id, + nonce: um_admin_scripts.nonce + }, + success: function( data ) { + jQuery('.um-admin-drag-ajax').html( data ); + UM.common.tipsy.hide(); + + /* trigger columns at start */ + allow_update_via_col_click = false; + jQuery('.um-admin-drag-ctrls.columns a.active').each( function() { + jQuery(this).trigger('click'); + }).promise().done( function(){ + allow_update_via_col_click = true; + }); + + UM_Rows_Refresh(); + }, + error: function( data ) { + + } + }); + + return false; +} + +jQuery( document ).ready( function() { + /* Default form tab */ + if ( jQuery('.um-admin-boxed-links').length > 0 ) { + var tab = jQuery('.um-admin-boxed-links a[data-role="'+jQuery('input#form__um_mode').val()+'"]'); + um_form_select_tab( tab, false ); + } + + + /* Creating new form button */ + jQuery('.um-admin-boxed-links:not(.is-core-form) a').on( 'click', function() { + um_form_select_tab( jQuery(this), true ); + }); + + jQuery('#wpfooter').hide(); + + /** + * Conditional fields in Add/Edit form field modal. + */ + jQuery( document.body ).on('change', '.um-adm-conditional', function(){ + + var value; + if ( jQuery(this).attr("type") == 'checkbox' ) { + value = jQuery(this).is(':checked') ? 1 : 0; + } else { + value = jQuery(this).val(); + } + + if ( jQuery(this).data('cond1') ) { + if ( value == jQuery(this).data('cond1') ) { + jQuery('.' + jQuery(this).data('cond1-show') ).show(); + jQuery('.' + jQuery(this).data('cond1-hide') ).hide(); + + if ( jQuery(this).data('cond1-show') == '_roles' ) { + return false; + } + + } else { + jQuery('.' + jQuery(this).data('cond1-show') ).hide(); + jQuery('.' + jQuery(this).data('cond1-hide') ).show(); + } + } + + if ( jQuery(this).data('cond2') ) { + if ( value == jQuery(this).data('cond2') ) { + jQuery('.' + jQuery(this).data('cond2-show') ).show(); + jQuery('.' + jQuery(this).data('cond2-hide') ).hide(); + + if ( jQuery(this).data('cond2-show') == '_roles' ) { + return false; + } + + } else { + jQuery('.' + jQuery(this).data('cond2-show') ).hide(); + jQuery('.' + jQuery(this).data('cond2-hide') ).show(); + } + } + + if ( jQuery(this).data('cond3') ) { + if ( value == jQuery(this).data('cond3') ) { + jQuery('.' + jQuery(this).data('cond3-show') ).show(); + jQuery('.' + jQuery(this).data('cond3-hide') ).hide(); + } else { + jQuery('.' + jQuery(this).data('cond3-show') ).hide(); + jQuery('.' + jQuery(this).data('cond3-hide') ).show(); + } + } + + }); + jQuery('.um-adm-conditional').each(function(){jQuery(this).trigger('change');}); +}); diff --git a/assets/js/admin/builder.min.js b/assets/js/admin/builder.min.js new file mode 100644 index 00000000..755ccba7 --- /dev/null +++ b/assets/js/admin/builder.min.js @@ -0,0 +1 @@ +function um_form_select_tab(e,d){var i=jQuery("input#form__um_mode");e.parents(".um-admin-boxed-links").find("a").removeClass("um-admin-activebg"),e.addClass("um-admin-activebg"),jQuery(".um-admin div#side-sortables").show(),jQuery('div[id^="um-admin-form"]').hide(),jQuery("#submitdiv").show(),jQuery("div#um-admin-form-mode,div#um-admin-form-title,div#um-admin-form-builder,div#um-admin-form-shortcode").show(),jQuery('div[id^="um-admin-form-'+e.data("role")+'"]').show(),d&&i.val(e.data("role")),jQuery(".empty-container").css({border:"none"}),jQuery(".um-admin-builder").removeClass().addClass("um-admin-builder "+i.val())}function um_admin_update_builder(){var e=jQuery(".um-admin-builder").data("form_id");return jQuery.ajax({url:wp.ajax.settings.url,type:"POST",data:{action:"um_update_builder",form_id:e,nonce:um_admin_scripts.nonce},success:function(e){jQuery(".um-admin-drag-ajax").html(e),UM.common.tipsy.hide(),allow_update_via_col_click=!1,jQuery(".um-admin-drag-ctrls.columns a.active").each(function(){jQuery(this).trigger("click")}).promise().done(function(){allow_update_via_col_click=!0}),UM_Rows_Refresh()},error:function(e){}}),!1}jQuery(document).ready(function(){0 0 ) { + UM.admin.tooltip.all = $tooltip.tooltip({ + tooltipClass: "um_tooltip", + content: function () { + return jQuery( this ).attr( 'title' ); + } + }); + } + }, + close: function () { + if ( null !== UM.admin.tooltip.all && UM.admin.tooltip.all > 0 && 'function' === typeof UM.admin.tooltip.all.tooltip ) { + UM.admin.tooltip.all.tooltip('close'); + } + } + }, + colorPicker: { + init: function () { + let $colorPicker = jQuery('.um-admin-colorpicker'); + if ( $colorPicker.length ) { + $colorPicker.wpColorPicker(); + } + } + }, + datetimePicker: { + init: function () { + jQuery('.um-datepicker:not(.picker__input)').each(function(){ + elem = jQuery(this); + + if ( typeof elem.attr('data-disabled_weekdays') != 'undefined' && elem.attr('data-disabled_weekdays') != '' ) { + var disable = JSON.parse( elem.attr('data-disabled_weekdays') ); + } else { + var disable = false; + } + + var years_n = null; + if ( typeof elem.attr('data-years') != 'undefined' ) { + years_n = elem.attr('data-years'); + } + + var minRange = elem.attr('data-date_min'); + var maxRange = elem.attr('data-date_max'); + + var minSplit = [], maxSplit = []; + if ( typeof minRange != 'undefined' ) { + minSplit = minRange.split(","); + } + if ( typeof maxRange != 'undefined' ) { + maxSplit = maxRange.split(","); + } + + var min = minSplit.length ? new Date(minSplit) : null; + var max = minSplit.length ? new Date(maxSplit) : null; + + // fix min date for safari + if ( min && min.toString() == 'Invalid Date' && minSplit.length == 3 ) { + var minDateString = minSplit[1] + '/' + minSplit[2] + '/' + minSplit[0]; + min = new Date(Date.parse(minDateString)); + } + + // fix max date for safari + if ( max && max.toString() == 'Invalid Date' && maxSplit.length == 3 ) { + var maxDateString = maxSplit[1] + '/' + maxSplit[2] + '/' + maxSplit[0]; + max = new Date(Date.parse(maxDateString)); + } + + var data = { + disable: disable, + format: elem.attr( 'data-format' ), + formatSubmit: 'yyyy/mm/dd', + hiddenName: true, + onOpen: function() { elem.blur(); }, + onClose: function() { elem.blur(); } + }; + + if ( years_n !== null ) { + data.selectYears = years_n; + } + + if ( min !== null ) { + data.min = min; + } + + if ( max !== null ) { + data.max = max; + } + + elem.pickadate( data ); + }); + + jQuery('.um-timepicker:not(.picker__input)').each(function(){ + elem = jQuery(this); + + elem.pickatime({ + format: elem.attr('data-format'), + interval: parseInt( elem.attr('data-intervals') ), + formatSubmit: 'HH:i', + hiddenName: true, + onOpen: function() { elem.blur(); }, + onClose: function() { elem.blur(); } + }); + }); + } + } +} + +jQuery(document).ready(function() { + UM.admin.tooltip.init(); + UM.admin.colorPicker.init(); + UM.admin.datetimePicker.init(); +}); diff --git a/assets/js/admin/common.min.js b/assets/js/admin/common.min.js new file mode 100644 index 00000000..4d963ec2 --- /dev/null +++ b/assets/js/admin/common.min.js @@ -0,0 +1 @@ +"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var t=jQuery(".um_tooltip");0 -1 ) { + href_index = window.location.href + '&'; + } else { + href_index = window.location.href + '?'; + } + window.location.href = href_index + 'um_dismiss_notice=' + notice_key + '&um_admin_nonce=' + um_admin_scripts.nonce; + + return false; + } + }); + }); +}); diff --git a/assets/js/admin/global.min.js b/assets/js/admin/global.min.js new file mode 100644 index 00000000..4bd32469 --- /dev/null +++ b/assets/js/admin/global.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){jQuery(document.body).on("click",".um_secondary_dismiss",function(){jQuery(this).parents(".um-admin-notice").find(".notice-dismiss").trigger("click")}),jQuery(document.body).on("click",".um-admin-notice.is-dismissible .notice-dismiss",function(){let i=jQuery(this).parents(".um-admin-notice").data("key");wp.ajax.send("um_dismiss_notice",{data:{key:i,nonce:um_admin_scripts.nonce},success:function(){return!0},error:function(){let n;return n=-1 li").each(function(){var e=i(this).attr("id").substr(10),e=u({menuItemID:e,restriction_data:um_menu_restriction_data[e]});(0'+wp.i18n.__("You can start the scan now but you must save the settings to apply the selected capabilities after the scan is complete.","ultimate-member")+""),e.off("change")})},ajax:function(e){let a=[];n.parents(".um-form-table").find('input[type="checkbox"][data-field_id^="banned_capabilities_"]:checked').each(function(){a.push(jQuery(this).data("field_id").replace("banned_capabilities_",""))});e={nonce:um_admin_scripts.nonce,capabilities:a,last_scanned_capability:e};wp.ajax.send("um_secure_scan_affected_users",{data:e,success:function(e){e.completed?e.completed&&(n.empty(),c.log(e.recommendations),n.find(".current").removeClass("current"),t.prop("disabled",!1)):(c.ajax(e.last_scanned_capability),c.log(e.message))}})},log:function(e){n.find(".current").removeClass("current"),n.append(''+e+"
")},effect:function(){setInterval(function(){n.find(".current").fadeTo(100,.1).fadeTo(200,1)},1e3)}};c.init()}); \ No newline at end of file diff --git a/assets/js/admin/settings.js b/assets/js/admin/settings.js new file mode 100644 index 00000000..e4f027c2 --- /dev/null +++ b/assets/js/admin/settings.js @@ -0,0 +1,49 @@ +jQuery( document ).ready( function() { + + + /** + * Licenses + */ + jQuery( document.body ).on( 'click', '.um_license_deactivate', function() { + jQuery(this).siblings('.um-option-field').val(''); + if ( jQuery(this).siblings('#submit').length ) { + // clear = true for passing the empty field value to the license form submission + jQuery(this).siblings('#submit').trigger('click',[ true ]); + } else { + jQuery(this).parents('form.um-settings-form').trigger('submit'); + } + }); + + + jQuery( document.body ).on( 'click', '.um-settings-form #submit', function( e, clear ) { + if ( ! clear && '' === jQuery(this).siblings('.um-option-field').val() ) { + return false; + } + }); + + + /** + * Not licenses page + */ + if ( jQuery( '#licenses_settings' ).length === 0 ) { + var changed = false; + + jQuery( 'input, textarea, select' ).on('change', function() { + changed = true; + }); + + jQuery( '#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a' ).on( 'click', function() { + if ( changed ) { + window.onbeforeunload = function() { + return wp.i18n.__( 'Are sure, maybe some settings not saved', 'ultimate-member' ); + }; + } else { + window.onbeforeunload = ''; + } + }); + + jQuery( '.submit input' ).on( 'click', function() { + window.onbeforeunload = ''; + }); + } +}); diff --git a/includes/admin/assets/js/um-admin-role-wrapper.js b/assets/js/admin/user.js similarity index 100% rename from includes/admin/assets/js/um-admin-role-wrapper.js rename to assets/js/admin/user.js diff --git a/assets/js/admin/user.min.js b/assets/js/admin/user.min.js new file mode 100644 index 00000000..a99ee9d6 --- /dev/null +++ b/assets/js/admin/user.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){jQuery("#role").on("change",function(){"object"==typeof um_roles&&(um_roles=Object.keys(um_roles).map(function(e){return um_roles[e]})),-1!==jQuery.inArray(jQuery(this).val().substr(3),um_roles)?(jQuery("#um_role_selector_wrapper").hide(),jQuery("#um-role").val(""),wp.hooks.applyFilters("um_user_screen_block_hiding",!0)&&jQuery("#um_user_screen_block").hide()):(jQuery("#um_role_selector_wrapper").show(),jQuery("#um_user_screen_block").show())}).trigger("change"),jQuery("#adduser-role").on("change",function(){"object"==typeof um_roles&&(um_roles=Object.keys(um_roles).map(function(e){return um_roles[e]})),-1!==jQuery.inArray(jQuery(this).val().substr(3),um_roles)?(jQuery("#um_role_existing_selector_wrapper").hide(),jQuery("#um-role").val(""),wp.hooks.applyFilters("um_user_screen_block_hiding",!0)&&jQuery("#um_user_screen_block").hide()):(jQuery("#um_role_existing_selector_wrapper").show(),jQuery("#um_user_screen_block").show())}).trigger("change")}); \ No newline at end of file diff --git a/assets/js/common-frontend.js b/assets/js/common-frontend.js new file mode 100644 index 00000000..767cf64f --- /dev/null +++ b/assets/js/common-frontend.js @@ -0,0 +1,112 @@ +if ( typeof ( window.UM ) !== 'object' ) { + window.UM = {}; +} + +if ( typeof ( UM.frontend ) !== 'object' ) { + UM.frontend = {}; +} + +UM.frontend = { + cropper: { + /** + * @type ?Cropper + */ + obj: null, + init: function() { + let target_img = jQuery('.um-modal .um-single-image-preview img').first(); + if ( ! target_img.length || '' === target_img.attr('src') ) { + return; + } + + if ( UM.frontend.cropper.obj ) { + // If Cropper object exists then destroy before re-init. + UM.frontend.cropper.destroy(); + } + + var target_img_parent = jQuery('.um-modal .um-single-image-preview'); + + var crop_data = target_img.parent().data('crop'); + var min_width = target_img.parent().data('min_width'); + var min_height= target_img.parent().data('min_height'); + var ratio = target_img.parent().data('ratio'); + + let singleUploadRatio = jQuery('.um-modal').find('#um_upload_single').data('ratio'); + if ( singleUploadRatio ) { + let ratioSplit = singleUploadRatio.split(':'); + ratio = ratioSplit[0]; + } + + var max_height = jQuery(window).height() - ( jQuery('.um-modal-footer a').height() + 20 ) - 50 - ( jQuery('.um-modal-header:visible').height() ); + target_img.css({'height' : 'auto'}); + target_img_parent.css({'height' : 'auto'}); + if ( jQuery(window).height() <= 400 ) { + target_img_parent.css({ 'height': max_height +'px', 'max-height' : max_height + 'px' }); + target_img.css({ 'height' : 'auto' }); + } else { + target_img.css({ 'height': 'auto', 'max-height' : max_height + 'px' }); + target_img_parent.css({ 'height': target_img.height(), 'max-height' : max_height + 'px' }); + } + + let opts; + if ( 'square' === crop_data ) { + opts = { + minWidth: min_width, + minHeight: min_height, + dragCrop: false, + aspectRatio: 1.0, + zoomable: false, + rotatable: false, + dashed: false, + }; + } else if ( 'cover' === crop_data ) { + if ( Math.round( min_width / ratio ) > 0 ) { + min_height = Math.round( min_width / ratio ) + } + opts = { + minWidth: min_width, + minHeight: min_height, + dragCrop: false, + aspectRatio: ratio, + zoomable: false, + rotatable: false, + dashed: false, + }; + } else if ( 'user' === crop_data ) { + opts = { + minWidth: min_width, + minHeight: min_height, + dragCrop: true, + aspectRatio: "auto", + zoomable: false, + rotatable: false, + dashed: false, + }; + } + + if ( opts ) { + UM.frontend.cropper.obj = new Cropper(target_img[0], opts); + // The commented lines below are maybe unnecessary. Wait for feedback and probably permanently delete. + // jQuery('.um-single-image-preview img.lazyloaded').addClass('cropper-hidden').removeClass('lazyloaded'); + // jQuery('.um-single-image-preview .cropper-container').append('
'); + } + }, + destroy: function() { + if ( jQuery('.cropper-container').length > 0 ) { + UM.frontend.cropper.obj.destroy(); // destroy Cropper.JS method + UM.frontend.cropper.obj = null; // flush our own object + } + } + } +} + +wp.hooks.addAction( 'um_remove_modal', 'um_common_frontend', function() { + UM.frontend.cropper.destroy(); +}); + +wp.hooks.addAction( 'um_after_removing_preview', 'um_common_frontend', function() { + UM.frontend.cropper.destroy(); +}); + +wp.hooks.addAction( 'um_window_resize', 'um_common_frontend', function() { + UM.frontend.cropper.destroy(); +}); diff --git a/assets/js/common-frontend.min.js b/assets/js/common-frontend.min.js new file mode 100644 index 00000000..8748e4ea --- /dev/null +++ b/assets/js/common-frontend.min.js @@ -0,0 +1 @@ +"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.frontend&&(UM.frontend={}),UM.frontend={cropper:{obj:null,init:function(){var o=jQuery(".um-modal .um-single-image-preview img").first();if(o.length&&""!==o.attr("src")){UM.frontend.cropper.obj&&UM.frontend.cropper.destroy();var t=jQuery(".um-modal .um-single-image-preview"),r=o.parent().data("crop"),n=o.parent().data("min_width"),i=o.parent().data("min_height"),a=o.parent().data("ratio"),d=jQuery(".um-modal").find("#um_upload_single").data("ratio"),d=(d&&(a=d.split(":")[0]),jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height());o.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),o.css({height:"auto"})):(o.css({height:"auto","max-height":d+"px"}),t.css({height:o.height(),"max-height":d+"px"}));let e;"square"===r?e={minWidth:n,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1}:"cover"===r?(0 0 ? floor : ceil)(argument); - }; - - var min = Math.min; - - // `ToLength` abstract operation - // https://tc39.github.io/ecma262/#sec-tolength - var toLength = function (argument) { - return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 - }; - - var isObject = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - - // `IsArray` abstract operation - // https://tc39.github.io/ecma262/#sec-isarray - var isArray = Array.isArray || function isArray(arg) { - return classofRaw(arg) == 'Array'; - }; - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - var global$1 = typeof window == 'object' && window && window.Math == Math ? window - : typeof self == 'object' && self && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); - - // Thank's IE8 for his funny defineProperty - var descriptors = !fails(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; - }); - - var document$1 = global$1.document; - // typeof document.createElement is 'object' in old IE - var exist = isObject(document$1) && isObject(document$1.createElement); - - var documentCreateElement = function (it) { - return exist ? document$1.createElement(it) : {}; - }; - - // Thank's IE8 for his funny defineProperty - var ie8DomDefine = !descriptors && !fails(function () { - return Object.defineProperty(documentCreateElement('div'), 'a', { - get: function () { return 7; } - }).a != 7; - }); - - var anObject = function (it) { - if (!isObject(it)) { - throw TypeError(String(it) + ' is not an object'); - } return it; - }; - - // 7.1.1 ToPrimitive(input [, PreferredType]) - - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - var toPrimitive = function (it, S) { - if (!isObject(it)) return it; - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; - if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - throw TypeError("Can't convert object to primitive value"); - }; - - var nativeDefineProperty = Object.defineProperty; - - var f = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (ie8DomDefine) try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; - }; - - var objectDefineProperty = { - f: f - }; - - var createPropertyDescriptor = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; - }; - - var hide = descriptors ? function (object, key, value) { - return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value)); - } : function (object, key, value) { - object[key] = value; - return object; - }; - - var setGlobal = function (key, value) { - try { - hide(global$1, key, value); - } catch (error) { - global$1[key] = value; - } return value; - }; - - var shared = createCommonjsModule(function (module) { - var SHARED = '__core-js_shared__'; - var store = global$1[SHARED] || setGlobal(SHARED, {}); - - (module.exports = function (key, value) { - return store[key] || (store[key] = value !== undefined ? value : {}); - })('versions', []).push({ - version: '3.0.1', - mode: 'global', - copyright: '© 2019 Denis Pushkarev (zloirock.ru)' - }); - }); - - var id = 0; - var postfix = Math.random(); - - var uid = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + postfix).toString(36)); - }; - - // Chrome 38 Symbol has incorrect toString conversion - var nativeSymbol = !fails(function () { - // eslint-disable-next-line no-undef - return !String(Symbol()); - }); - - var store = shared('wks'); - - var Symbol$1 = global$1.Symbol; - - - var wellKnownSymbol = function (name) { - return store[name] || (store[name] = nativeSymbol && Symbol$1[name] - || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name)); - }; - - var SPECIES = wellKnownSymbol('species'); - - // `ArraySpeciesCreate` abstract operation - // https://tc39.github.io/ecma262/#sec-arrayspeciescreate - var arraySpeciesCreate = function (originalArray, length) { - var C; - if (isArray(originalArray)) { - C = originalArray.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); - }; - - // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation - // 0 -> Array#forEach - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - // 1 -> Array#map - // https://tc39.github.io/ecma262/#sec-array.prototype.map - // 2 -> Array#filter - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - // 3 -> Array#some - // https://tc39.github.io/ecma262/#sec-array.prototype.some - // 4 -> Array#every - // https://tc39.github.io/ecma262/#sec-array.prototype.every - // 5 -> Array#find - // https://tc39.github.io/ecma262/#sec-array.prototype.find - // 6 -> Array#findIndex - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - var arrayMethods = function (TYPE, specificCreate) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - var create = specificCreate || arraySpeciesCreate; - return function ($this, callbackfn, that) { - var O = toObject($this); - var self = indexedObject(O); - var boundFunction = bindContext(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var value, result; - for (;length > index; index++) if (NO_HOLES || index in self) { - value = self[index]; - result = boundFunction(value, index, O); - if (TYPE) { - if (IS_MAP) target[index] = result; // map - else if (result) switch (TYPE) { - case 3: return true; // some - case 5: return value; // find - case 6: return index; // findIndex - case 2: target.push(value); // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; - }; - }; - - var SPECIES$1 = wellKnownSymbol('species'); - - var arrayMethodHasSpeciesSupport = function (METHOD_NAME) { - return !fails(function () { - var array = []; - var constructor = array.constructor = {}; - constructor[SPECIES$1] = function () { - return { foo: 1 }; - }; - return array[METHOD_NAME](Boolean).foo !== 1; - }); - }; - - var nativePropertyIsEnumerable = {}.propertyIsEnumerable; - var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - - // Nashorn ~ JDK8 bug - var NASHORN_BUG = nativeGetOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); - - var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = nativeGetOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } : nativePropertyIsEnumerable; - - var objectPropertyIsEnumerable = { - f: f$1 - }; - - // toObject with fallback for non-array-like ES3 strings - - - - var toIndexedObject = function (it) { - return indexedObject(requireObjectCoercible(it)); - }; - - var hasOwnProperty = {}.hasOwnProperty; - - var has = function (it, key) { - return hasOwnProperty.call(it, key); - }; - - var nativeGetOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; - - var f$2 = descriptors ? nativeGetOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (ie8DomDefine) try { - return nativeGetOwnPropertyDescriptor$1(O, P); - } catch (error) { /* empty */ } - if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]); - }; - - var objectGetOwnPropertyDescriptor = { - f: f$2 - }; - - var functionToString = shared('native-function-to-string', Function.toString); - - var WeakMap$1 = global$1.WeakMap; - - var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(functionToString.call(WeakMap$1)); - - var shared$1 = shared('keys'); - - - var sharedKey = function (key) { - return shared$1[key] || (shared$1[key] = uid(key)); - }; - - var hiddenKeys = {}; - - var WeakMap$2 = global$1.WeakMap; - var set, get, has$1; - - var enforce = function (it) { - return has$1(it) ? get(it) : set(it, {}); - }; - - var getterFor = function (TYPE) { - return function (it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError('Incompatible receiver, ' + TYPE + ' required'); - } return state; - }; - }; - - if (nativeWeakMap) { - var store$1 = new WeakMap$2(); - var wmget = store$1.get; - var wmhas = store$1.has; - var wmset = store$1.set; - set = function (it, metadata) { - wmset.call(store$1, it, metadata); - return metadata; - }; - get = function (it) { - return wmget.call(store$1, it) || {}; - }; - has$1 = function (it) { - return wmhas.call(store$1, it); - }; - } else { - var STATE = sharedKey('state'); - hiddenKeys[STATE] = true; - set = function (it, metadata) { - hide(it, STATE, metadata); - return metadata; - }; - get = function (it) { - return has(it, STATE) ? it[STATE] : {}; - }; - has$1 = function (it) { - return has(it, STATE); - }; - } - - var internalState = { - set: set, - get: get, - has: has$1, - enforce: enforce, - getterFor: getterFor - }; - - var redefine = createCommonjsModule(function (module) { - var getInternalState = internalState.get; - var enforceInternalState = internalState.enforce; - var TEMPLATE = String(functionToString).split('toString'); - - shared('inspectSource', function (it) { - return functionToString.call(it); - }); - - (module.exports = function (O, key, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - if (typeof value == 'function') { - if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key); - enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); - } - if (O === global$1) { - if (simple) O[key] = value; - else setGlobal(key, value); - return; - } else if (!unsafe) { - delete O[key]; - } else if (!noTargetGet && O[key]) { - simple = true; - } - if (simple) O[key] = value; - else hide(O, key, value); - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - })(Function.prototype, 'toString', function toString() { - return typeof this == 'function' && getInternalState(this).source || functionToString.call(this); - }); - }); - - var max = Math.max; - var min$1 = Math.min; - - // Helper for a popular repeating case of the spec: - // Let integer be ? ToInteger(index). - // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). - var toAbsoluteIndex = function (index, length) { - var integer = toInteger(index); - return integer < 0 ? max(integer + length, 0) : min$1(integer, length); - }; - - // `Array.prototype.{ indexOf, includes }` methods implementation - // false -> Array#indexOf - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - // true -> Array#includes - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - var arrayIncludes = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; - }; - - var arrayIndexOf = arrayIncludes(false); - - - var objectKeysInternal = function (object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; - }; - - // IE8- don't enum bug keys - var enumBugKeys = [ - 'constructor', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'toLocaleString', - 'toString', - 'valueOf' - ]; - - // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) - - var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); - - var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return objectKeysInternal(O, hiddenKeys$1); - }; - - var objectGetOwnPropertyNames = { - f: f$3 - }; - - var f$4 = Object.getOwnPropertySymbols; - - var objectGetOwnPropertySymbols = { - f: f$4 - }; - - var Reflect = global$1.Reflect; - - // all object keys, includes non-enumerable and symbols - var ownKeys = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = objectGetOwnPropertyNames.f(anObject(it)); - var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; - }; - - var copyConstructorProperties = function (target, source) { - var keys = ownKeys(source); - var defineProperty = objectDefineProperty.f; - var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); - } - }; - - var replacement = /#|\.prototype\./; - - var isForced = function (feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL ? true - : value == NATIVE ? false - : typeof detection == 'function' ? fails(detection) - : !!detection; - }; - - var normalize = isForced.normalize = function (string) { - return String(string).replace(replacement, '.').toLowerCase(); - }; - - var data = isForced.data = {}; - var NATIVE = isForced.NATIVE = 'N'; - var POLYFILL = isForced.POLYFILL = 'P'; - - var isForced_1 = isForced; - - var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; - - - - - - - /* - options.target - name of the target object - options.global - target is the global object - options.stat - export as static methods of target - options.proto - export as prototype methods of target - options.real - real prototype method for the `pure` version - options.forced - export even if the native feature is available - options.bind - bind methods to the target, required for the `pure` version - options.wrap - wrap constructors to preventing global pollution, required for the `pure` version - options.unsafe - use the simple assignment of property instead of delete + defineProperty - options.sham - add a flag to not completely full polyfills - options.enumerable - export as enumerable property - options.noTargetGet - prevent calling a getter on target - */ - var _export = function (options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global$1; - } else if (STATIC) { - target = global$1[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global$1[TARGET] || {}).prototype; - } - if (target) for (key in source) { - sourceProperty = source[key]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key); - targetProperty = descriptor && descriptor.value; - } else targetProperty = target[key]; - FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); - // contained in target - if (!FORCED && targetProperty !== undefined) { - if (typeof sourceProperty === typeof targetProperty) continue; - copyConstructorProperties(sourceProperty, targetProperty); - } - // add a flag to not completely full polyfills - if (options.sham || (targetProperty && targetProperty.sham)) { - hide(sourceProperty, 'sham', true); - } - // extend global - redefine(target, key, sourceProperty, options); - } - }; - - var internalFilter = arrayMethods(2); - - var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); - - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - // with adding support of @@species - _export({ target: 'Array', proto: true, forced: !SPECIES_SUPPORT }, { - filter: function filter(callbackfn /* , thisArg */) { - return internalFilter(this, callbackfn, arguments[1]); - } - }); - - var sloppyArrayMethod = function (METHOD_NAME, argument) { - var method = [][METHOD_NAME]; - return !method || !fails(function () { - // eslint-disable-next-line no-useless-call,no-throw-literal - method.call(null, argument || function () { throw 1; }, 1); - }); - }; - - var nativeForEach = [].forEach; - var internalForEach = arrayMethods(0); - - var SLOPPY_METHOD = sloppyArrayMethod('forEach'); - - // `Array.prototype.forEach` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - var arrayForEach = SLOPPY_METHOD ? function forEach(callbackfn /* , thisArg */) { - return internalForEach(this, callbackfn, arguments[1]); - } : nativeForEach; - - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { forEach: arrayForEach }); - - // `Array.prototype.{ reduce, reduceRight }` methods implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright - var arrayReduce = function (that, callbackfn, argumentsLength, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = indexedObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (argumentsLength < 2) while (true) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; - }; - - var SLOPPY_METHOD$1 = sloppyArrayMethod('reduce'); - - // `Array.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - _export({ target: 'Array', proto: true, forced: SLOPPY_METHOD$1 }, { - reduce: function reduce(callbackfn /* , initialValue */) { - return arrayReduce(this, callbackfn, arguments.length, arguments[1], false); - } - }); - - var defineProperty = objectDefineProperty.f; - var FunctionPrototype = Function.prototype; - var FunctionPrototypeToString = FunctionPrototype.toString; - var nameRE = /^\s*function ([^ (]*)/; - var NAME = 'name'; - - // Function instances `.name` property - // https://tc39.github.io/ecma262/#sec-function-instances-name - if (descriptors && !(NAME in FunctionPrototype)) { - defineProperty(FunctionPrototype, NAME, { - configurable: true, - get: function () { - try { - return FunctionPrototypeToString.call(this).match(nameRE)[1]; - } catch (error) { - return ''; - } - } - }); - } - - // 19.1.2.14 / 15.2.3.14 Object.keys(O) - - - - var objectKeys = Object.keys || function keys(O) { - return objectKeysInternal(O, enumBugKeys); - }; - - // 19.1.2.1 Object.assign(target, source, ...) - - - - - - var nativeAssign = Object.assign; - - // should work with symbols and should have deterministic property order (V8 bug) - var objectAssign = !nativeAssign || fails(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var symbol = Symbol(); - var alphabet = 'abcdefghijklmnopqrst'; - A[symbol] = 7; - alphabet.split('').forEach(function (chr) { B[chr] = chr; }); - return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; - }) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var argumentsLength = arguments.length; - var index = 1; - var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; - var propertyIsEnumerable = objectPropertyIsEnumerable.f; - while (argumentsLength > index) { - var S = indexedObject(arguments[index++]); - var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) if (propertyIsEnumerable.call(S, key = keys[j++])) T[key] = S[key]; - } return T; - } : nativeAssign; - - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, { assign: objectAssign }); - - // a string of all valid unicode whitespaces - // eslint-disable-next-line max-len - var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - - var whitespace = '[' + whitespaces + ']'; - var ltrim = RegExp('^' + whitespace + whitespace + '*'); - var rtrim = RegExp(whitespace + whitespace + '*$'); - - // 1 -> String#trimStart - // 2 -> String#trimEnd - // 3 -> String#trim - var stringTrim = function (string, TYPE) { - string = String(requireObjectCoercible(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; - }; - - var nativeParseInt = global$1.parseInt; - - - var hex = /^[-+]?0[xX]/; - var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; - - var _parseInt = FORCED ? function parseInt(str, radix) { - var string = stringTrim(String(str), 3); - return nativeParseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); - } : nativeParseInt; - - // `parseInt` method - // https://tc39.github.io/ecma262/#sec-parseint-string-radix - _export({ global: true, forced: parseInt != _parseInt }, { - parseInt: _parseInt - }); - - // `RegExp.prototype.flags` getter implementation - // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags - var regexpFlags = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; - }; - - var nativeExec = RegExp.prototype.exec; - // This always refers to the native implementation, because the - // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, - // which loads this file before patching the method. - var nativeReplace = String.prototype.replace; - - var patchedExec = nativeExec; - - var UPDATES_LAST_INDEX_WRONG = (function () { - var re1 = /a/; - var re2 = /b*/g; - nativeExec.call(re1, 'a'); - nativeExec.call(re2, 'a'); - return re1.lastIndex !== 0 || re2.lastIndex !== 0; - })(); - - // nonparticipating capturing group, copied from es5-shim's String#split patch. - var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; - - var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; - - if (PATCH) { - patchedExec = function exec(str) { - var re = this; - var lastIndex, reCopy, match, i; - - if (NPCG_INCLUDED) { - reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); - } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; - - match = nativeExec.call(re, str); - - if (UPDATES_LAST_INDEX_WRONG && match) { - re.lastIndex = re.global ? match.index + match[0].length : lastIndex; - } - if (NPCG_INCLUDED && match && match.length > 1) { - // Fix browsers whose `exec` methods don't consistently return `undefined` - // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ - nativeReplace.call(match[0], reCopy, function () { - for (i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) match[i] = undefined; - } - }); - } - - return match; - }; - } - - var regexpExec = patchedExec; - - _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, { - exec: regexpExec - }); - - // CONVERT_TO_STRING: true -> String#at - // CONVERT_TO_STRING: false -> String#codePointAt - var stringAt = function (that, pos, CONVERT_TO_STRING) { - var S = String(requireObjectCoercible(that)); - var position = toInteger(pos); - var size = S.length; - var first, second; - if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; - first = S.charCodeAt(position); - return first < 0xD800 || first > 0xDBFF || position + 1 === size - || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF - ? CONVERT_TO_STRING ? S.charAt(position) : first - : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; - }; - - // `AdvanceStringIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-advancestringindex - var advanceStringIndex = function (S, index, unicode) { - return index + (unicode ? stringAt(S, index, true).length : 1); - }; - - // `RegExpExec` abstract operation - // https://tc39.github.io/ecma262/#sec-regexpexec - var regexpExecAbstract = function (R, S) { - var exec = R.exec; - if (typeof exec === 'function') { - var result = exec.call(R, S); - if (typeof result !== 'object') { - throw TypeError('RegExp exec method returned something other than an Object or null'); - } - return result; - } - - if (classofRaw(R) !== 'RegExp') { - throw TypeError('RegExp#exec called on incompatible receiver'); - } - - return regexpExec.call(R, S); - }; - - var SPECIES$2 = wellKnownSymbol('species'); - - var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { - // #replace needs built-in support for named groups. - // #match works fine because it just return the exec results, even if it has - // a "grops" property. - var re = /./; - re.exec = function () { - var result = []; - result.groups = { a: '7' }; - return result; - }; - return ''.replace(re, '$') !== '7'; - }); - - // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec - // Weex JS has frozen built-in prototypes, so use try / catch wrapper - var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { - var re = /(?:)/; - var originalExec = re.exec; - re.exec = function () { return originalExec.apply(this, arguments); }; - var result = 'ab'.split(re); - return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; - }); - - var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) { - var SYMBOL = wellKnownSymbol(KEY); - - var DELEGATES_TO_SYMBOL = !fails(function () { - // String methods call symbol-named RegEp methods - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - }); - - var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { - // Symbol-named RegExp methods call .exec - var execCalled = false; - var re = /a/; - re.exec = function () { execCalled = true; return null; }; - - if (KEY === 'split') { - // RegExp[@@split] doesn't call the regex's exec method, but first creates - // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES$2] = function () { return re; }; - } - - re[SYMBOL](''); - return !execCalled; - }); - - if ( - !DELEGATES_TO_SYMBOL || - !DELEGATES_TO_EXEC || - (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || - (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) - ) { - var nativeRegExpMethod = /./[SYMBOL]; - var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { - if (regexp.exec === regexpExec) { - if (DELEGATES_TO_SYMBOL && !forceStringMethod) { - // The native String method already delegates to @@method (this - // polyfilled function), leasing to infinite recursion. - // We avoid it by directly calling the native @@method method. - return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; - } - return { done: true, value: nativeMethod.call(str, regexp, arg2) }; - } - return { done: false }; - }); - var stringMethod = methods[0]; - var regexMethod = methods[1]; - - redefine(String.prototype, KEY, stringMethod); - redefine(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return regexMethod.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return regexMethod.call(string, this); } - ); - if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true); - } - }; - - // @@match logic - fixRegexpWellKnownSymbolLogic( - 'match', - 1, - function (MATCH, nativeMatch, maybeCallNative) { - return [ - // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match - function match(regexp) { - var O = requireObjectCoercible(this); - var matcher = regexp == undefined ? undefined : regexp[MATCH]; - return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, - // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match - function (regexp) { - var res = maybeCallNative(nativeMatch, regexp, this); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - - if (!rx.global) return regexpExecAbstract(rx, S); - - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - var A = []; - var n = 0; - var result; - while ((result = regexpExecAbstract(rx, S)) !== null) { - var matchStr = String(result[0]); - A[n] = matchStr; - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - n++; - } - return n === 0 ? null : A; - } - ]; - } - ); - - var max$1 = Math.max; - var min$2 = Math.min; - var floor$1 = Math.floor; - var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; - var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; - - var maybeToString = function (it) { - return it === undefined ? it : String(it); - }; - - // @@replace logic - fixRegexpWellKnownSymbolLogic( - 'replace', - 2, - function (REPLACE, nativeReplace, maybeCallNative) { - return [ - // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace - function replace(searchValue, replaceValue) { - var O = requireObjectCoercible(this); - var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; - return replacer !== undefined - ? replacer.call(searchValue, O, replaceValue) - : nativeReplace.call(String(O), searchValue, replaceValue); - }, - // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace - function (regexp, replaceValue) { - var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); - if (res.done) return res.value; - - var rx = anObject(regexp); - var S = String(this); - - var functionalReplace = typeof replaceValue === 'function'; - if (!functionalReplace) replaceValue = String(replaceValue); - - var global = rx.global; - if (global) { - var fullUnicode = rx.unicode; - rx.lastIndex = 0; - } - var results = []; - while (true) { - var result = regexpExecAbstract(rx, S); - if (result === null) break; - - results.push(result); - if (!global) break; - - var matchStr = String(result[0]); - if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); - } - - var accumulatedResult = ''; - var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { - result = results[i]; - - var matched = String(result[0]); - var position = max$1(min$2(toInteger(result.index), S.length), 0); - var captures = []; - // NOTE: This is equivalent to - // captures = result.slice(1).map(maybeToString) - // but for some reason `nativeSlice.call(result, 1, result.length)` (called in - // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and - // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { - var replacerArgs = [matched].concat(captures, position, S); - if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); - var replacement = String(replaceValue.apply(undefined, replacerArgs)); - } else { - replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); - } - if (position >= nextSourcePosition) { - accumulatedResult += S.slice(nextSourcePosition, position) + replacement; - nextSourcePosition = position + matched.length; - } - } - return accumulatedResult + S.slice(nextSourcePosition); - } - ]; - - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return nativeReplace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': return '$'; - case '&': return matched; - case '`': return str.slice(0, position); - case "'": return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: // \d\d? - var n = +ch; - if (n === 0) return match; - if (n > m) { - var f = floor$1(n / 10); - if (f === 0) return match; - if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } - } - ); - - // iterable DOM collections - // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods - var domIterables = { - CSSRuleList: 0, - CSSStyleDeclaration: 0, - CSSValueList: 0, - ClientRectList: 0, - DOMRectList: 0, - DOMStringList: 0, - DOMTokenList: 1, - DataTransferItemList: 0, - FileList: 0, - HTMLAllCollection: 0, - HTMLCollection: 0, - HTMLFormElement: 0, - HTMLSelectElement: 0, - MediaList: 0, - MimeTypeArray: 0, - NamedNodeMap: 0, - NodeList: 1, - PaintRequestList: 0, - Plugin: 0, - PluginArray: 0, - SVGLengthList: 0, - SVGNumberList: 0, - SVGPathSegList: 0, - SVGPointList: 0, - SVGStringList: 0, - SVGTransformList: 0, - SourceBufferList: 0, - StyleSheetList: 0, - TextTrackCueList: 0, - TextTrackList: 0, - TouchList: 0 - }; - - for (var COLLECTION_NAME in domIterables) { - var Collection = global$1[COLLECTION_NAME]; - var CollectionPrototype = Collection && Collection.prototype; - // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try { - hide(CollectionPrototype, 'forEach', arrayForEach); - } catch (error) { - CollectionPrototype.forEach = arrayForEach; - } - } - - var scrollbarWidth = createCommonjsModule(function (module, exports) { - /*! scrollbarWidth.js v0.1.3 | felixexter | MIT | https://github.com/felixexter/scrollbarWidth */ - (function (root, factory) { - { - module.exports = factory(); - } - }(commonjsGlobal, function () { - - function scrollbarWidth() { - if (typeof document === 'undefined') { - return 0 - } - - var - body = document.body, - box = document.createElement('div'), - boxStyle = box.style, - width; - - boxStyle.position = 'absolute'; - boxStyle.top = boxStyle.left = '-9999px'; - boxStyle.width = boxStyle.height = '100px'; - boxStyle.overflow = 'scroll'; - - body.appendChild(box); - - width = box.offsetWidth - box.clientWidth; - - body.removeChild(box); - - return width; - } - - return scrollbarWidth; - })); - }); - - /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as references for various `Number` constants. */ - var NAN = 0 / 0; - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max, - nativeMin = Math.min; - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = function() { - return root.Date.now(); - }; - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject$1(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject$1(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject$1(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject$1(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject$1(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - var lodash_throttle = throttle; - - /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT$1 = 'Expected a function'; - - /** Used as references for various `Number` constants. */ - var NAN$1 = 0 / 0; - - /** `Object#toString` result references. */ - var symbolTag$1 = '[object Symbol]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim$1 = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary$1 = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal$1 = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt$1 = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); - - /** Used for built-in method references. */ - var objectProto$1 = Object.prototype; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString$1 = objectProto$1.toString; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax$1 = Math.max, - nativeMin$1 = Math.min; - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now$1 = function() { - return root$1.Date.now(); - }; - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce$1(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT$1); - } - wait = toNumber$1(wait) || 0; - if (isObject$2(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax$1(toNumber$1(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin$1(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now$1(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now$1()); - } - - function debounced() { - var time = now$1(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject$2(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike$1(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol$1(value) { - return typeof value == 'symbol' || - (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1); - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber$1(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol$1(value)) { - return NAN$1; - } - if (isObject$2(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject$2(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim$1, ''); - var isBinary = reIsBinary$1.test(value); - return (isBinary || reIsOctal$1.test(value)) - ? freeParseInt$1(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex$1.test(value) ? NAN$1 : +value); - } - - var lodash_debounce = debounce$1; - - /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT$2 = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal$2 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf$2 = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root$2 = freeGlobal$2 || freeSelf$2 || Function('return this')(); - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto$2 = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = root$2['__core-js_shared__']; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty$1 = objectProto$2.hasOwnProperty; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString$2 = objectProto$2.toString; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var splice = arrayProto.splice; - - /* Built-in method references that are verified to be native. */ - var Map$1 = getNative(root$2, 'Map'), - nativeCreate = getNative(Object, 'create'); - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty$1.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty$1.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map$1 || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject$3(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT$2); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Assign cache to `_.memoize`. - memoize.Cache = MapCache; - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject$3(value) ? objectToString$2.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject$3(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - var lodash_memoize = memoize; - - /** - * A collection of shims that provide minimal functionality of the ES6 collections. - * - * These implementations are not meant to be used outside of the ResizeObserver - * modules as they cover only a limited range of use cases. - */ - /* eslint-disable require-jsdoc, valid-jsdoc */ - var MapShim = (function () { - if (typeof Map !== 'undefined') { - return Map; - } - /** - * Returns index in provided array that matches the specified key. - * - * @param {Array} arr - * @param {*} key - * @returns {number} - */ - function getIndex(arr, key) { - var result = -1; - arr.some(function (entry, index) { - if (entry[0] === key) { - result = index; - return true; - } - return false; - }); - return result; - } - return /** @class */ (function () { - function class_1() { - this.__entries__ = []; - } - Object.defineProperty(class_1.prototype, "size", { - /** - * @returns {boolean} - */ - get: function () { - return this.__entries__.length; - }, - enumerable: true, - configurable: true - }); - /** - * @param {*} key - * @returns {*} - */ - class_1.prototype.get = function (key) { - var index = getIndex(this.__entries__, key); - var entry = this.__entries__[index]; - return entry && entry[1]; - }; - /** - * @param {*} key - * @param {*} value - * @returns {void} - */ - class_1.prototype.set = function (key, value) { - var index = getIndex(this.__entries__, key); - if (~index) { - this.__entries__[index][1] = value; - } - else { - this.__entries__.push([key, value]); - } - }; - /** - * @param {*} key - * @returns {void} - */ - class_1.prototype.delete = function (key) { - var entries = this.__entries__; - var index = getIndex(entries, key); - if (~index) { - entries.splice(index, 1); - } - }; - /** - * @param {*} key - * @returns {void} - */ - class_1.prototype.has = function (key) { - return !!~getIndex(this.__entries__, key); - }; - /** - * @returns {void} - */ - class_1.prototype.clear = function () { - this.__entries__.splice(0); - }; - /** - * @param {Function} callback - * @param {*} [ctx=null] - * @returns {void} - */ - class_1.prototype.forEach = function (callback, ctx) { - if (ctx === void 0) { ctx = null; } - for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { - var entry = _a[_i]; - callback.call(ctx, entry[1], entry[0]); - } - }; - return class_1; - }()); - })(); - - /** - * Detects whether window and document objects are available in current environment. - */ - var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document; - - // Returns global object of a current environment. - var global$1$1 = (function () { - if (typeof global !== 'undefined' && global.Math === Math) { - return global; - } - if (typeof self !== 'undefined' && self.Math === Math) { - return self; - } - if (typeof window !== 'undefined' && window.Math === Math) { - return window; - } - // eslint-disable-next-line no-new-func - return Function('return this')(); - })(); - - /** - * A shim for the requestAnimationFrame which falls back to the setTimeout if - * first one is not supported. - * - * @returns {number} Requests' identifier. - */ - var requestAnimationFrame$1 = (function () { - if (typeof requestAnimationFrame === 'function') { - // It's required to use a bounded function because IE sometimes throws - // an "Invalid calling object" error if rAF is invoked without the global - // object on the left hand side. - return requestAnimationFrame.bind(global$1$1); - } - return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); }; - })(); - - // Defines minimum timeout before adding a trailing call. - var trailingTimeout = 2; - /** - * Creates a wrapper function which ensures that provided callback will be - * invoked only once during the specified delay period. - * - * @param {Function} callback - Function to be invoked after the delay period. - * @param {number} delay - Delay after which to invoke callback. - * @returns {Function} - */ - function throttle$1 (callback, delay) { - var leadingCall = false, trailingCall = false, lastCallTime = 0; - /** - * Invokes the original callback function and schedules new invocation if - * the "proxy" was called during current request. - * - * @returns {void} - */ - function resolvePending() { - if (leadingCall) { - leadingCall = false; - callback(); - } - if (trailingCall) { - proxy(); - } - } - /** - * Callback invoked after the specified delay. It will further postpone - * invocation of the original function delegating it to the - * requestAnimationFrame. - * - * @returns {void} - */ - function timeoutCallback() { - requestAnimationFrame$1(resolvePending); - } - /** - * Schedules invocation of the original function. - * - * @returns {void} - */ - function proxy() { - var timeStamp = Date.now(); - if (leadingCall) { - // Reject immediately following calls. - if (timeStamp - lastCallTime < trailingTimeout) { - return; - } - // Schedule new call to be in invoked when the pending one is resolved. - // This is important for "transitions" which never actually start - // immediately so there is a chance that we might miss one if change - // happens amids the pending invocation. - trailingCall = true; - } - else { - leadingCall = true; - trailingCall = false; - setTimeout(timeoutCallback, delay); - } - lastCallTime = timeStamp; - } - return proxy; - } - - // Minimum delay before invoking the update of observers. - var REFRESH_DELAY = 20; - // A list of substrings of CSS properties used to find transition events that - // might affect dimensions of observed elements. - var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight']; - // Check if MutationObserver is available. - var mutationObserverSupported = typeof MutationObserver !== 'undefined'; - /** - * Singleton controller class which handles updates of ResizeObserver instances. - */ - var ResizeObserverController = /** @class */ (function () { - /** - * Creates a new instance of ResizeObserverController. - * - * @private - */ - function ResizeObserverController() { - /** - * Indicates whether DOM listeners have been added. - * - * @private {boolean} - */ - this.connected_ = false; - /** - * Tells that controller has subscribed for Mutation Events. - * - * @private {boolean} - */ - this.mutationEventsAdded_ = false; - /** - * Keeps reference to the instance of MutationObserver. - * - * @private {MutationObserver} - */ - this.mutationsObserver_ = null; - /** - * A list of connected observers. - * - * @private {Array} - */ - this.observers_ = []; - this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); - this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY); - } - /** - * Adds observer to observers list. - * - * @param {ResizeObserverSPI} observer - Observer to be added. - * @returns {void} - */ - ResizeObserverController.prototype.addObserver = function (observer) { - if (!~this.observers_.indexOf(observer)) { - this.observers_.push(observer); - } - // Add listeners if they haven't been added yet. - if (!this.connected_) { - this.connect_(); - } - }; - /** - * Removes observer from observers list. - * - * @param {ResizeObserverSPI} observer - Observer to be removed. - * @returns {void} - */ - ResizeObserverController.prototype.removeObserver = function (observer) { - var observers = this.observers_; - var index = observers.indexOf(observer); - // Remove observer if it's present in registry. - if (~index) { - observers.splice(index, 1); - } - // Remove listeners if controller has no connected observers. - if (!observers.length && this.connected_) { - this.disconnect_(); - } - }; - /** - * Invokes the update of observers. It will continue running updates insofar - * it detects changes. - * - * @returns {void} - */ - ResizeObserverController.prototype.refresh = function () { - var changesDetected = this.updateObservers_(); - // Continue running updates if changes have been detected as there might - // be future ones caused by CSS transitions. - if (changesDetected) { - this.refresh(); - } - }; - /** - * Updates every observer from observers list and notifies them of queued - * entries. - * - * @private - * @returns {boolean} Returns "true" if any observer has detected changes in - * dimensions of it's elements. - */ - ResizeObserverController.prototype.updateObservers_ = function () { - // Collect observers that have active observations. - var activeObservers = this.observers_.filter(function (observer) { - return observer.gatherActive(), observer.hasActive(); - }); - // Deliver notifications in a separate cycle in order to avoid any - // collisions between observers, e.g. when multiple instances of - // ResizeObserver are tracking the same element and the callback of one - // of them changes content dimensions of the observed target. Sometimes - // this may result in notifications being blocked for the rest of observers. - activeObservers.forEach(function (observer) { return observer.broadcastActive(); }); - return activeObservers.length > 0; - }; - /** - * Initializes DOM listeners. - * - * @private - * @returns {void} - */ - ResizeObserverController.prototype.connect_ = function () { - // Do nothing if running in a non-browser environment or if listeners - // have been already added. - if (!isBrowser || this.connected_) { - return; - } - // Subscription to the "Transitionend" event is used as a workaround for - // delayed transitions. This way it's possible to capture at least the - // final state of an element. - document.addEventListener('transitionend', this.onTransitionEnd_); - window.addEventListener('resize', this.refresh); - if (mutationObserverSupported) { - this.mutationsObserver_ = new MutationObserver(this.refresh); - this.mutationsObserver_.observe(document, { - attributes: true, - childList: true, - characterData: true, - subtree: true - }); - } - else { - document.addEventListener('DOMSubtreeModified', this.refresh); - this.mutationEventsAdded_ = true; - } - this.connected_ = true; - }; - /** - * Removes DOM listeners. - * - * @private - * @returns {void} - */ - ResizeObserverController.prototype.disconnect_ = function () { - // Do nothing if running in a non-browser environment or if listeners - // have been already removed. - if (!isBrowser || !this.connected_) { - return; - } - document.removeEventListener('transitionend', this.onTransitionEnd_); - window.removeEventListener('resize', this.refresh); - if (this.mutationsObserver_) { - this.mutationsObserver_.disconnect(); - } - if (this.mutationEventsAdded_) { - document.removeEventListener('DOMSubtreeModified', this.refresh); - } - this.mutationsObserver_ = null; - this.mutationEventsAdded_ = false; - this.connected_ = false; - }; - /** - * "Transitionend" event handler. - * - * @private - * @param {TransitionEvent} event - * @returns {void} - */ - ResizeObserverController.prototype.onTransitionEnd_ = function (_a) { - var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b; - // Detect whether transition may affect dimensions of an element. - var isReflowProperty = transitionKeys.some(function (key) { - return !!~propertyName.indexOf(key); - }); - if (isReflowProperty) { - this.refresh(); - } - }; - /** - * Returns instance of the ResizeObserverController. - * - * @returns {ResizeObserverController} - */ - ResizeObserverController.getInstance = function () { - if (!this.instance_) { - this.instance_ = new ResizeObserverController(); - } - return this.instance_; - }; - /** - * Holds reference to the controller's instance. - * - * @private {ResizeObserverController} - */ - ResizeObserverController.instance_ = null; - return ResizeObserverController; - }()); - - /** - * Defines non-writable/enumerable properties of the provided target object. - * - * @param {Object} target - Object for which to define properties. - * @param {Object} props - Properties to be defined. - * @returns {Object} Target object. - */ - var defineConfigurable = (function (target, props) { - for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { - var key = _a[_i]; - Object.defineProperty(target, key, { - value: props[key], - enumerable: false, - writable: false, - configurable: true - }); - } - return target; - }); - - /** - * Returns the global object associated with provided element. - * - * @param {Object} target - * @returns {Object} - */ - var getWindowOf = (function (target) { - // Assume that the element is an instance of Node, which means that it - // has the "ownerDocument" property from which we can retrieve a - // corresponding global object. - var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; - // Return the local global object if it's not possible extract one from - // provided element. - return ownerGlobal || global$1$1; - }); - - // Placeholder of an empty content rectangle. - var emptyRect = createRectInit(0, 0, 0, 0); - /** - * Converts provided string to a number. - * - * @param {number|string} value - * @returns {number} - */ - function toFloat(value) { - return parseFloat(value) || 0; - } - /** - * Extracts borders size from provided styles. - * - * @param {CSSStyleDeclaration} styles - * @param {...string} positions - Borders positions (top, right, ...) - * @returns {number} - */ - function getBordersSize(styles) { - var positions = []; - for (var _i = 1; _i < arguments.length; _i++) { - positions[_i - 1] = arguments[_i]; - } - return positions.reduce(function (size, position) { - var value = styles['border-' + position + '-width']; - return size + toFloat(value); - }, 0); - } - /** - * Extracts paddings sizes from provided styles. - * - * @param {CSSStyleDeclaration} styles - * @returns {Object} Paddings box. - */ - function getPaddings(styles) { - var positions = ['top', 'right', 'bottom', 'left']; - var paddings = {}; - for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { - var position = positions_1[_i]; - var value = styles['padding-' + position]; - paddings[position] = toFloat(value); - } - return paddings; - } - /** - * Calculates content rectangle of provided SVG element. - * - * @param {SVGGraphicsElement} target - Element content rectangle of which needs - * to be calculated. - * @returns {DOMRectInit} - */ - function getSVGContentRect(target) { - var bbox = target.getBBox(); - return createRectInit(0, 0, bbox.width, bbox.height); - } - /** - * Calculates content rectangle of provided HTMLElement. - * - * @param {HTMLElement} target - Element for which to calculate the content rectangle. - * @returns {DOMRectInit} - */ - function getHTMLElementContentRect(target) { - // Client width & height properties can't be - // used exclusively as they provide rounded values. - var clientWidth = target.clientWidth, clientHeight = target.clientHeight; - // By this condition we can catch all non-replaced inline, hidden and - // detached elements. Though elements with width & height properties less - // than 0.5 will be discarded as well. - // - // Without it we would need to implement separate methods for each of - // those cases and it's not possible to perform a precise and performance - // effective test for hidden elements. E.g. even jQuery's ':visible' filter - // gives wrong results for elements with width & height less than 0.5. - if (!clientWidth && !clientHeight) { - return emptyRect; - } - var styles = getWindowOf(target).getComputedStyle(target); - var paddings = getPaddings(styles); - var horizPad = paddings.left + paddings.right; - var vertPad = paddings.top + paddings.bottom; - // Computed styles of width & height are being used because they are the - // only dimensions available to JS that contain non-rounded values. It could - // be possible to utilize the getBoundingClientRect if only it's data wasn't - // affected by CSS transformations let alone paddings, borders and scroll bars. - var width = toFloat(styles.width), height = toFloat(styles.height); - // Width & height include paddings and borders when the 'border-box' box - // model is applied (except for IE). - if (styles.boxSizing === 'border-box') { - // Following conditions are required to handle Internet Explorer which - // doesn't include paddings and borders to computed CSS dimensions. - // - // We can say that if CSS dimensions + paddings are equal to the "client" - // properties then it's either IE, and thus we don't need to subtract - // anything, or an element merely doesn't have paddings/borders styles. - if (Math.round(width + horizPad) !== clientWidth) { - width -= getBordersSize(styles, 'left', 'right') + horizPad; - } - if (Math.round(height + vertPad) !== clientHeight) { - height -= getBordersSize(styles, 'top', 'bottom') + vertPad; - } - } - // Following steps can't be applied to the document's root element as its - // client[Width/Height] properties represent viewport area of the window. - // Besides, it's as well not necessary as the itself neither has - // rendered scroll bars nor it can be clipped. - if (!isDocumentElement(target)) { - // In some browsers (only in Firefox, actually) CSS width & height - // include scroll bars size which can be removed at this step as scroll - // bars are the only difference between rounded dimensions + paddings - // and "client" properties, though that is not always true in Chrome. - var vertScrollbar = Math.round(width + horizPad) - clientWidth; - var horizScrollbar = Math.round(height + vertPad) - clientHeight; - // Chrome has a rather weird rounding of "client" properties. - // E.g. for an element with content width of 314.2px it sometimes gives - // the client width of 315px and for the width of 314.7px it may give - // 314px. And it doesn't happen all the time. So just ignore this delta - // as a non-relevant. - if (Math.abs(vertScrollbar) !== 1) { - width -= vertScrollbar; - } - if (Math.abs(horizScrollbar) !== 1) { - height -= horizScrollbar; - } - } - return createRectInit(paddings.left, paddings.top, width, height); - } - /** - * Checks whether provided element is an instance of the SVGGraphicsElement. - * - * @param {Element} target - Element to be checked. - * @returns {boolean} - */ - var isSVGGraphicsElement = (function () { - // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement - // interface. - if (typeof SVGGraphicsElement !== 'undefined') { - return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; - } - // If it's so, then check that element is at least an instance of the - // SVGElement and that it has the "getBBox" method. - // eslint-disable-next-line no-extra-parens - return function (target) { return (target instanceof getWindowOf(target).SVGElement && - typeof target.getBBox === 'function'); }; - })(); - /** - * Checks whether provided element is a document element (). - * - * @param {Element} target - Element to be checked. - * @returns {boolean} - */ - function isDocumentElement(target) { - return target === getWindowOf(target).document.documentElement; - } - /** - * Calculates an appropriate content rectangle for provided html or svg element. - * - * @param {Element} target - Element content rectangle of which needs to be calculated. - * @returns {DOMRectInit} - */ - function getContentRect(target) { - if (!isBrowser) { - return emptyRect; - } - if (isSVGGraphicsElement(target)) { - return getSVGContentRect(target); - } - return getHTMLElementContentRect(target); - } - /** - * Creates rectangle with an interface of the DOMRectReadOnly. - * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly - * - * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions. - * @returns {DOMRectReadOnly} - */ - function createReadOnlyRect(_a) { - var x = _a.x, y = _a.y, width = _a.width, height = _a.height; - // If DOMRectReadOnly is available use it as a prototype for the rectangle. - var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object; - var rect = Object.create(Constr.prototype); - // Rectangle's properties are not writable and non-enumerable. - defineConfigurable(rect, { - x: x, y: y, width: width, height: height, - top: y, - right: x + width, - bottom: height + y, - left: x - }); - return rect; - } - /** - * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates. - * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit - * - * @param {number} x - X coordinate. - * @param {number} y - Y coordinate. - * @param {number} width - Rectangle's width. - * @param {number} height - Rectangle's height. - * @returns {DOMRectInit} - */ - function createRectInit(x, y, width, height) { - return { x: x, y: y, width: width, height: height }; - } - - /** - * Class that is responsible for computations of the content rectangle of - * provided DOM element and for keeping track of it's changes. - */ - var ResizeObservation = /** @class */ (function () { - /** - * Creates an instance of ResizeObservation. - * - * @param {Element} target - Element to be observed. - */ - function ResizeObservation(target) { - /** - * Broadcasted width of content rectangle. - * - * @type {number} - */ - this.broadcastWidth = 0; - /** - * Broadcasted height of content rectangle. - * - * @type {number} - */ - this.broadcastHeight = 0; - /** - * Reference to the last observed content rectangle. - * - * @private {DOMRectInit} - */ - this.contentRect_ = createRectInit(0, 0, 0, 0); - this.target = target; - } - /** - * Updates content rectangle and tells whether it's width or height properties - * have changed since the last broadcast. - * - * @returns {boolean} - */ - ResizeObservation.prototype.isActive = function () { - var rect = getContentRect(this.target); - this.contentRect_ = rect; - return (rect.width !== this.broadcastWidth || - rect.height !== this.broadcastHeight); - }; - /** - * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data - * from the corresponding properties of the last observed content rectangle. - * - * @returns {DOMRectInit} Last observed content rectangle. - */ - ResizeObservation.prototype.broadcastRect = function () { - var rect = this.contentRect_; - this.broadcastWidth = rect.width; - this.broadcastHeight = rect.height; - return rect; - }; - return ResizeObservation; - }()); - - var ResizeObserverEntry = /** @class */ (function () { - /** - * Creates an instance of ResizeObserverEntry. - * - * @param {Element} target - Element that is being observed. - * @param {DOMRectInit} rectInit - Data of the element's content rectangle. - */ - function ResizeObserverEntry(target, rectInit) { - var contentRect = createReadOnlyRect(rectInit); - // According to the specification following properties are not writable - // and are also not enumerable in the native implementation. - // - // Property accessors are not being used as they'd require to define a - // private WeakMap storage which may cause memory leaks in browsers that - // don't support this type of collections. - defineConfigurable(this, { target: target, contentRect: contentRect }); - } - return ResizeObserverEntry; - }()); - - var ResizeObserverSPI = /** @class */ (function () { - /** - * Creates a new instance of ResizeObserver. - * - * @param {ResizeObserverCallback} callback - Callback function that is invoked - * when one of the observed elements changes it's content dimensions. - * @param {ResizeObserverController} controller - Controller instance which - * is responsible for the updates of observer. - * @param {ResizeObserver} callbackCtx - Reference to the public - * ResizeObserver instance which will be passed to callback function. - */ - function ResizeObserverSPI(callback, controller, callbackCtx) { - /** - * Collection of resize observations that have detected changes in dimensions - * of elements. - * - * @private {Array} - */ - this.activeObservations_ = []; - /** - * Registry of the ResizeObservation instances. - * - * @private {Map} - */ - this.observations_ = new MapShim(); - if (typeof callback !== 'function') { - throw new TypeError('The callback provided as parameter 1 is not a function.'); - } - this.callback_ = callback; - this.controller_ = controller; - this.callbackCtx_ = callbackCtx; - } - /** - * Starts observing provided element. - * - * @param {Element} target - Element to be observed. - * @returns {void} - */ - ResizeObserverSPI.prototype.observe = function (target) { - if (!arguments.length) { - throw new TypeError('1 argument required, but only 0 present.'); - } - // Do nothing if current environment doesn't have the Element interface. - if (typeof Element === 'undefined' || !(Element instanceof Object)) { - return; - } - if (!(target instanceof getWindowOf(target).Element)) { - throw new TypeError('parameter 1 is not of type "Element".'); - } - var observations = this.observations_; - // Do nothing if element is already being observed. - if (observations.has(target)) { - return; - } - observations.set(target, new ResizeObservation(target)); - this.controller_.addObserver(this); - // Force the update of observations. - this.controller_.refresh(); - }; - /** - * Stops observing provided element. - * - * @param {Element} target - Element to stop observing. - * @returns {void} - */ - ResizeObserverSPI.prototype.unobserve = function (target) { - if (!arguments.length) { - throw new TypeError('1 argument required, but only 0 present.'); - } - // Do nothing if current environment doesn't have the Element interface. - if (typeof Element === 'undefined' || !(Element instanceof Object)) { - return; - } - if (!(target instanceof getWindowOf(target).Element)) { - throw new TypeError('parameter 1 is not of type "Element".'); - } - var observations = this.observations_; - // Do nothing if element is not being observed. - if (!observations.has(target)) { - return; - } - observations.delete(target); - if (!observations.size) { - this.controller_.removeObserver(this); - } - }; - /** - * Stops observing all elements. - * - * @returns {void} - */ - ResizeObserverSPI.prototype.disconnect = function () { - this.clearActive(); - this.observations_.clear(); - this.controller_.removeObserver(this); - }; - /** - * Collects observation instances the associated element of which has changed - * it's content rectangle. - * - * @returns {void} - */ - ResizeObserverSPI.prototype.gatherActive = function () { - var _this = this; - this.clearActive(); - this.observations_.forEach(function (observation) { - if (observation.isActive()) { - _this.activeObservations_.push(observation); - } - }); - }; - /** - * Invokes initial callback function with a list of ResizeObserverEntry - * instances collected from active resize observations. - * - * @returns {void} - */ - ResizeObserverSPI.prototype.broadcastActive = function () { - // Do nothing if observer doesn't have active observations. - if (!this.hasActive()) { - return; - } - var ctx = this.callbackCtx_; - // Create ResizeObserverEntry instance for every active observation. - var entries = this.activeObservations_.map(function (observation) { - return new ResizeObserverEntry(observation.target, observation.broadcastRect()); - }); - this.callback_.call(ctx, entries, ctx); - this.clearActive(); - }; - /** - * Clears the collection of active observations. - * - * @returns {void} - */ - ResizeObserverSPI.prototype.clearActive = function () { - this.activeObservations_.splice(0); - }; - /** - * Tells whether observer has active observations. - * - * @returns {boolean} - */ - ResizeObserverSPI.prototype.hasActive = function () { - return this.activeObservations_.length > 0; - }; - return ResizeObserverSPI; - }()); - - // Registry of internal observers. If WeakMap is not available use current shim - // for the Map collection as it has all required methods and because WeakMap - // can't be fully polyfilled anyway. - var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim(); - /** - * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation - * exposing only those methods and properties that are defined in the spec. - */ - var ResizeObserver = /** @class */ (function () { - /** - * Creates a new instance of ResizeObserver. - * - * @param {ResizeObserverCallback} callback - Callback that is invoked when - * dimensions of the observed elements change. - */ - function ResizeObserver(callback) { - if (!(this instanceof ResizeObserver)) { - throw new TypeError('Cannot call a class as a function.'); - } - if (!arguments.length) { - throw new TypeError('1 argument required, but only 0 present.'); - } - var controller = ResizeObserverController.getInstance(); - var observer = new ResizeObserverSPI(callback, controller, this); - observers.set(this, observer); - } - return ResizeObserver; - }()); - // Expose public methods of ResizeObserver. - [ - 'observe', - 'unobserve', - 'disconnect' - ].forEach(function (method) { - ResizeObserver.prototype[method] = function () { - var _a; - return (_a = observers.get(this))[method].apply(_a, arguments); - }; - }); - - var index = (function () { - // Export existing implementation if available. - if (typeof global$1$1.ResizeObserver !== 'undefined') { - return global$1$1.ResizeObserver; - } - return ResizeObserver; - })(); - - var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement - ); - - var canUseDom = canUseDOM; - - var SimpleBar = - /*#__PURE__*/ - function () { - function SimpleBar(element, options) { - var _this = this; - - this.onScroll = function () { - if (!_this.scrollXTicking) { - window.requestAnimationFrame(_this.scrollX); - _this.scrollXTicking = true; - } - - if (!_this.scrollYTicking) { - window.requestAnimationFrame(_this.scrollY); - _this.scrollYTicking = true; - } - }; - - this.scrollX = function () { - if (_this.axis.x.isOverflowing) { - _this.showScrollbar('x'); - - _this.positionScrollbar('x'); - } - - _this.scrollXTicking = false; - }; - - this.scrollY = function () { - if (_this.axis.y.isOverflowing) { - _this.showScrollbar('y'); - - _this.positionScrollbar('y'); - } - - _this.scrollYTicking = false; - }; - - this.onMouseEnter = function () { - _this.showScrollbar('x'); - - _this.showScrollbar('y'); - }; - - this.onMouseMove = function (e) { - _this.mouseX = e.clientX; - _this.mouseY = e.clientY; - - if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { - _this.onMouseMoveForAxis('x'); - } - - if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { - _this.onMouseMoveForAxis('y'); - } - }; - - this.onMouseLeave = function () { - _this.onMouseMove.cancel(); - - if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { - _this.onMouseLeaveForAxis('x'); - } - - if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { - _this.onMouseLeaveForAxis('y'); - } - - _this.mouseX = -1; - _this.mouseY = -1; - }; - - this.onWindowResize = function () { - // Recalculate scrollbarWidth in case it's a zoom - _this.scrollbarWidth = scrollbarWidth(); - - _this.hideNativeScrollbar(); - }; - - this.hideScrollbars = function () { - _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); - _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); - - if (!_this.isWithinBounds(_this.axis.y.track.rect)) { - _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible); - - _this.axis.y.isVisible = false; - } - - if (!_this.isWithinBounds(_this.axis.x.track.rect)) { - _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible); - - _this.axis.x.isVisible = false; - } - }; - - this.onPointerEvent = function (e) { - var isWithinBoundsY, isWithinBoundsX; - _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect(); - _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect(); - - if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { - isWithinBoundsX = _this.isWithinBounds(_this.axis.x.scrollbar.rect); - } - - if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { - isWithinBoundsY = _this.isWithinBounds(_this.axis.y.scrollbar.rect); - } // If any pointer event is called on the scrollbar - - - if (isWithinBoundsY || isWithinBoundsX) { - // Preventing the event's default action stops text being - // selectable during the drag. - e.preventDefault(); // Prevent event leaking - - e.stopPropagation(); - - if (e.type === 'mousedown') { - if (isWithinBoundsY) { - _this.onDragStart(e, 'y'); - } - - if (isWithinBoundsX) { - _this.onDragStart(e, 'x'); - } - } - } - }; - - this.drag = function (e) { - var eventOffset; - var track = _this.axis[_this.draggedAxis].track; - var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr]; - var scrollbar = _this.axis[_this.draggedAxis].scrollbar; - e.preventDefault(); - e.stopPropagation(); - - if (_this.draggedAxis === 'y') { - eventOffset = e.pageY; - } else { - eventOffset = e.pageX; - } // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset). - - - var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; // Convert the mouse position into a percentage of the scrollbar height/width. - - var dragPerc = dragPos / track.rect[_this.axis[_this.draggedAxis].sizeAttr]; // Scroll the content by the same percentage. - - var scrollPos = dragPerc * _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr]; // Fix browsers inconsistency on RTL - - if (_this.draggedAxis === 'x') { - scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos; - scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos; - } - - _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos; - }; - - this.onEndDrag = function (e) { - e.preventDefault(); - e.stopPropagation(); - - _this.el.classList.remove(_this.classNames.dragging); - - document.removeEventListener('mousemove', _this.drag); - document.removeEventListener('mouseup', _this.onEndDrag); - }; - - this.el = element; - this.flashTimeout; - this.contentEl; - this.contentWrapperEl; - this.offsetEl; - this.maskEl; - this.globalObserver; - this.mutationObserver; - this.resizeObserver; - this.scrollbarWidth; - this.minScrollbarWidth = 20; - this.options = Object.assign({}, SimpleBar.defaultOptions, options); - this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, this.options.classNames); - this.isRtl; - this.axis = { - x: { - scrollOffsetAttr: 'scrollLeft', - sizeAttr: 'width', - scrollSizeAttr: 'scrollWidth', - offsetAttr: 'left', - overflowAttr: 'overflowX', - dragOffset: 0, - isOverflowing: true, - isVisible: false, - forceVisible: false, - track: {}, - scrollbar: {} - }, - y: { - scrollOffsetAttr: 'scrollTop', - sizeAttr: 'height', - scrollSizeAttr: 'scrollHeight', - offsetAttr: 'top', - overflowAttr: 'overflowY', - dragOffset: 0, - isOverflowing: true, - isVisible: false, - forceVisible: false, - track: {}, - scrollbar: {} - } - }; // Don't re-instantiate over an existing one - - if (this.el.SimpleBar) { - return; - } - - this.recalculate = lodash_throttle(this.recalculate.bind(this), 64); - this.onMouseMove = lodash_throttle(this.onMouseMove.bind(this), 64); - this.hideScrollbars = lodash_debounce(this.hideScrollbars.bind(this), this.options.timeout); - this.onWindowResize = lodash_debounce(this.onWindowResize.bind(this), 64, { - leading: true - }); - SimpleBar.getRtlHelpers = lodash_memoize(SimpleBar.getRtlHelpers); - this.init(); - } - /** - * Static properties - */ - - /** - * Helper to fix browsers inconsistency on RTL: - * - Firefox inverts the scrollbar initial position - * - IE11 inverts both scrollbar position and scrolling offset - * Directly inspired by @KingSora's OverlayScrollbars https://github.com/KingSora/OverlayScrollbars/blob/master/js/OverlayScrollbars.js#L1634 - */ - - - SimpleBar.getRtlHelpers = function getRtlHelpers() { - var dummyDiv = document.createElement('div'); - dummyDiv.innerHTML = '
'; - var scrollbarDummyEl = dummyDiv.firstElementChild; - document.body.appendChild(scrollbarDummyEl); - var dummyContainerChild = scrollbarDummyEl.firstElementChild; - scrollbarDummyEl.scrollLeft = 0; - var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl); - var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild); - scrollbarDummyEl.scrollLeft = 999; - var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild); - return { - // determines if the scrolling is responding with negative values - isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0, - // determines if the origin scrollbar position is inverted or not (positioned on left or right) - isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left - }; - }; - - SimpleBar.initHtmlApi = function initHtmlApi() { - this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this); // MutationObserver is IE11+ - - if (typeof MutationObserver !== 'undefined') { - // Mutation observer to observe dynamically added elements - this.globalObserver = new MutationObserver(function (mutations) { - mutations.forEach(function (mutation) { - Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) { - if (addedNode.nodeType === 1) { - if (addedNode.hasAttribute('data-simplebar')) { - !addedNode.SimpleBar && new SimpleBar(addedNode, SimpleBar.getElOptions(addedNode)); - } else { - Array.prototype.forEach.call(addedNode.querySelectorAll('[data-simplebar]'), function (el) { - !el.SimpleBar && new SimpleBar(el, SimpleBar.getElOptions(el)); - }); - } - } - }); - Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) { - if (removedNode.nodeType === 1) { - if (removedNode.hasAttribute('data-simplebar')) { - removedNode.SimpleBar && removedNode.SimpleBar.unMount(); - } else { - Array.prototype.forEach.call(removedNode.querySelectorAll('[data-simplebar]'), function (el) { - el.SimpleBar && el.SimpleBar.unMount(); - }); - } - } - }); - }); - }); - this.globalObserver.observe(document, { - childList: true, - subtree: true - }); - } // Taken from jQuery `ready` function - // Instantiate elements already present on the page - - - if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) { - // Handle it asynchronously to allow scripts the opportunity to delay init - window.setTimeout(this.initDOMLoadedElements); - } else { - document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements); - window.addEventListener('load', this.initDOMLoadedElements); - } - } // Helper function to retrieve options from element attributes - ; - - SimpleBar.getElOptions = function getElOptions(el) { - var options = Array.prototype.reduce.call(el.attributes, function (acc, attribute) { - var option = attribute.name.match(/data-simplebar-(.+)/); - - if (option) { - var key = option[1].replace(/\W+(.)/g, function (x, chr) { - return chr.toUpperCase(); - }); - - switch (attribute.value) { - case 'true': - acc[key] = true; - break; - - case 'false': - acc[key] = false; - break; - - case undefined: - acc[key] = true; - break; - - default: - acc[key] = attribute.value; - } - } - - return acc; - }, {}); - return options; - }; - - SimpleBar.removeObserver = function removeObserver() { - this.globalObserver.disconnect(); - }; - - SimpleBar.initDOMLoadedElements = function initDOMLoadedElements() { - document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements); - window.removeEventListener('load', this.initDOMLoadedElements); - Array.prototype.forEach.call(document.querySelectorAll('[data-simplebar]'), function (el) { - if (!el.SimpleBar) new SimpleBar(el, SimpleBar.getElOptions(el)); - }); - }; - - SimpleBar.getOffset = function getOffset(el) { - var rect = el.getBoundingClientRect(); - return { - top: rect.top + (window.pageYOffset || document.documentElement.scrollTop), - left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft) - }; - }; - - var _proto = SimpleBar.prototype; - - _proto.init = function init() { - // Save a reference to the instance, so we know this DOM node has already been instancied - this.el.SimpleBar = this; // We stop here on server-side - - if (canUseDom) { - this.initDOM(); - this.scrollbarWidth = scrollbarWidth(); - this.recalculate(); - this.initListeners(); - } - }; - - _proto.initDOM = function initDOM() { - var _this2 = this; - - // make sure this element doesn't have the elements yet - if (Array.prototype.filter.call(this.el.children, function (child) { - return child.classList.contains(_this2.classNames.wrapper); - }).length) { - // assume that element has his DOM already initiated - this.wrapperEl = this.el.querySelector("." + this.classNames.wrapper); - this.contentWrapperEl = this.el.querySelector("." + this.classNames.contentWrapper); - this.offsetEl = this.el.querySelector("." + this.classNames.offset); - this.maskEl = this.el.querySelector("." + this.classNames.mask); - this.contentEl = this.el.querySelector("." + this.classNames.contentEl); - this.placeholderEl = this.el.querySelector("." + this.classNames.placeholder); - this.heightAutoObserverWrapperEl = this.el.querySelector("." + this.classNames.heightAutoObserverWrapperEl); - this.heightAutoObserverEl = this.el.querySelector("." + this.classNames.heightAutoObserverEl); - this.axis.x.track.el = this.el.querySelector("." + this.classNames.track + "." + this.classNames.horizontal); - this.axis.y.track.el = this.el.querySelector("." + this.classNames.track + "." + this.classNames.vertical); - } else { - // Prepare DOM - this.wrapperEl = document.createElement('div'); - this.contentWrapperEl = document.createElement('div'); - this.offsetEl = document.createElement('div'); - this.maskEl = document.createElement('div'); - this.contentEl = document.createElement('div'); - this.placeholderEl = document.createElement('div'); - this.heightAutoObserverWrapperEl = document.createElement('div'); - this.heightAutoObserverEl = document.createElement('div'); - this.wrapperEl.classList.add(this.classNames.wrapper); - this.contentWrapperEl.classList.add(this.classNames.contentWrapper); - this.offsetEl.classList.add(this.classNames.offset); - this.maskEl.classList.add(this.classNames.mask); - this.contentEl.classList.add(this.classNames.contentEl); - this.placeholderEl.classList.add(this.classNames.placeholder); - this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl); - this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl); - - while (this.el.firstChild) { - this.contentEl.appendChild(this.el.firstChild); - } - - this.contentWrapperEl.appendChild(this.contentEl); - this.offsetEl.appendChild(this.contentWrapperEl); - this.maskEl.appendChild(this.offsetEl); - this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl); - this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl); - this.wrapperEl.appendChild(this.maskEl); - this.wrapperEl.appendChild(this.placeholderEl); - this.el.appendChild(this.wrapperEl); - } - - if (!this.axis.x.track.el || !this.axis.y.track.el) { - var track = document.createElement('div'); - var scrollbar = document.createElement('div'); - track.classList.add(this.classNames.track); - scrollbar.classList.add(this.classNames.scrollbar); - track.appendChild(scrollbar); - this.axis.x.track.el = track.cloneNode(true); - this.axis.x.track.el.classList.add(this.classNames.horizontal); - this.axis.y.track.el = track.cloneNode(true); - this.axis.y.track.el.classList.add(this.classNames.vertical); - this.el.appendChild(this.axis.x.track.el); - this.el.appendChild(this.axis.y.track.el); - } - - this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector("." + this.classNames.scrollbar); - this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector("." + this.classNames.scrollbar); - - if (!this.options.autoHide) { - this.axis.x.scrollbar.el.classList.add(this.classNames.visible); - this.axis.y.scrollbar.el.classList.add(this.classNames.visible); - } - - this.el.setAttribute('data-simplebar', 'init'); - }; - - _proto.initListeners = function initListeners() { - var _this3 = this; - - // Event listeners - if (this.options.autoHide) { - this.el.addEventListener('mouseenter', this.onMouseEnter); - } - - ['mousedown', 'click', 'dblclick', 'touchstart', 'touchend', 'touchmove'].forEach(function (e) { - _this3.el.addEventListener(e, _this3.onPointerEvent, true); - }); - this.el.addEventListener('mousemove', this.onMouseMove); - this.el.addEventListener('mouseleave', this.onMouseLeave); - this.contentWrapperEl.addEventListener('scroll', this.onScroll); // Browser zoom triggers a window resize - - window.addEventListener('resize', this.onWindowResize); - this.resizeObserver = new index(this.recalculate); - this.resizeObserver.observe(this.el); - this.resizeObserver.observe(this.contentEl); - }; - - _proto.recalculate = function recalculate() { - var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1; - var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1; - this.elStyles = window.getComputedStyle(this.el); - this.isRtl = this.elStyles.direction === 'rtl'; - this.contentEl.style.padding = this.elStyles.paddingTop + " " + this.elStyles.paddingRight + " " + this.elStyles.paddingBottom + " " + this.elStyles.paddingLeft; - this.wrapperEl.style.margin = "-" + this.elStyles.paddingTop + " -" + this.elStyles.paddingRight + " -" + this.elStyles.paddingBottom + " -" + this.elStyles.paddingLeft; - this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%'; // Determine placeholder size - - this.placeholderEl.style.width = isWidthAuto ? this.contentEl.offsetWidth + "px" : 'auto'; - this.placeholderEl.style.height = this.contentEl.scrollHeight + "px"; // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset) - - this.axis.x.isOverflowing = this.contentWrapperEl.scrollWidth > this.contentWrapperEl.offsetWidth; - this.axis.y.isOverflowing = this.contentWrapperEl.scrollHeight > this.contentWrapperEl.offsetHeight; // Set isOverflowing to false if user explicitely set hidden overflow - - this.axis.x.isOverflowing = this.elStyles.overflowX === 'hidden' ? false : this.axis.x.isOverflowing; - this.axis.y.isOverflowing = this.elStyles.overflowY === 'hidden' ? false : this.axis.y.isOverflowing; - this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true; - this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true; - this.hideNativeScrollbar(); - this.axis.x.track.rect = this.axis.x.track.el.getBoundingClientRect(); - this.axis.y.track.rect = this.axis.y.track.el.getBoundingClientRect(); - this.axis.x.scrollbar.size = this.getScrollbarSize('x'); - this.axis.y.scrollbar.size = this.getScrollbarSize('y'); - this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + "px"; - this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + "px"; - this.positionScrollbar('x'); - this.positionScrollbar('y'); - this.toggleTrackVisibility('x'); - this.toggleTrackVisibility('y'); - } - /** - * Calculate scrollbar size - */ - ; - - _proto.getScrollbarSize = function getScrollbarSize(axis) { - if (axis === void 0) { - axis = 'y'; - } - - var contentSize = this.scrollbarWidth ? this.contentWrapperEl[this.axis[axis].scrollSizeAttr] : this.contentWrapperEl[this.axis[axis].scrollSizeAttr] - this.minScrollbarWidth; - var trackSize = this.axis[axis].track.rect[this.axis[axis].sizeAttr]; - var scrollbarSize; - - if (!this.axis[axis].isOverflowing) { - return; - } - - var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle. - - scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize); - - if (this.options.scrollbarMaxSize) { - scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize); - } - - return scrollbarSize; - }; - - _proto.positionScrollbar = function positionScrollbar(axis) { - if (axis === void 0) { - axis = 'y'; - } - - var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr]; - var trackSize = this.axis[axis].track.rect[this.axis[axis].sizeAttr]; - var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); - var scrollbar = this.axis[axis].scrollbar; - var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; - scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset; - var scrollPourcent = scrollOffset / (contentSize - hostSize); - var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent); - handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset; - scrollbar.el.style.transform = axis === 'x' ? "translate3d(" + handleOffset + "px, 0, 0)" : "translate3d(0, " + handleOffset + "px, 0)"; - }; - - _proto.toggleTrackVisibility = function toggleTrackVisibility(axis) { - if (axis === void 0) { - axis = 'y'; - } - - var track = this.axis[axis].track.el; - var scrollbar = this.axis[axis].scrollbar.el; - - if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) { - track.style.visibility = 'visible'; - this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll'; - } else { - track.style.visibility = 'hidden'; - this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden'; - } // Even if forceVisible is enabled, scrollbar itself should be hidden - - - if (this.axis[axis].isOverflowing) { - scrollbar.style.display = 'block'; - } else { - scrollbar.style.display = 'none'; - } - }; - - _proto.hideNativeScrollbar = function hideNativeScrollbar() { - this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-" + (this.scrollbarWidth || this.minScrollbarWidth) + "px" : 0; - this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-" + (this.scrollbarWidth || this.minScrollbarWidth) + "px" : 0; // If floating scrollbar - - if (!this.scrollbarWidth) { - var paddingDirection = [this.isRtl ? 'paddingLeft' : 'paddingRight']; - this.contentWrapperEl.style[paddingDirection] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? this.minScrollbarWidth + "px" : 0; - this.contentWrapperEl.style.paddingBottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? this.minScrollbarWidth + "px" : 0; - } - } - /** - * On scroll event handling - */ - ; - - _proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) { - if (axis === void 0) { - axis = 'y'; - } - - this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect(); - this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); - var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect); - - if (isWithinScrollbarBoundsX) { - this.axis[axis].scrollbar.el.classList.add(this.classNames.hover); - } else { - this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); - } - - if (this.isWithinBounds(this.axis[axis].track.rect)) { - this.showScrollbar(axis); - this.axis[axis].track.el.classList.add(this.classNames.hover); - } else { - this.axis[axis].track.el.classList.remove(this.classNames.hover); - } - }; - - _proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) { - if (axis === void 0) { - axis = 'y'; - } - - this.axis[axis].track.el.classList.remove(this.classNames.hover); - this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); - }; - - /** - * Show scrollbar - */ - _proto.showScrollbar = function showScrollbar(axis) { - if (axis === void 0) { - axis = 'y'; - } - - var scrollbar = this.axis[axis].scrollbar.el; - - if (!this.axis[axis].isVisible) { - scrollbar.classList.add(this.classNames.visible); - this.axis[axis].isVisible = true; - } - - if (this.options.autoHide) { - this.hideScrollbars(); - } - } - /** - * Hide Scrollbar - */ - ; - - /** - * on scrollbar handle drag movement starts - */ - _proto.onDragStart = function onDragStart(e, axis) { - if (axis === void 0) { - axis = 'y'; - } - - var scrollbar = this.axis[axis].scrollbar.el; // Measure how far the user's mouse is from the top of the scrollbar drag handle. - - var eventOffset = axis === 'y' ? e.pageY : e.pageX; - this.axis[axis].dragOffset = eventOffset - scrollbar.getBoundingClientRect()[this.axis[axis].offsetAttr]; - this.draggedAxis = axis; - this.el.classList.add(this.classNames.dragging); - document.addEventListener('mousemove', this.drag); - document.addEventListener('mouseup', this.onEndDrag); - } - /** - * Drag scrollbar handle - */ - ; - - /** - * Getter for content element - */ - _proto.getContentElement = function getContentElement() { - return this.contentEl; - } - /** - * Getter for original scrolling element - */ - ; - - _proto.getScrollElement = function getScrollElement() { - return this.contentWrapperEl; - }; - - _proto.removeListeners = function removeListeners() { - var _this4 = this; - - // Event listeners - if (this.options.autoHide) { - this.el.removeEventListener('mouseenter', this.onMouseEnter); - } - - ['mousedown', 'click', 'dblclick', 'touchstart', 'touchend', 'touchmove'].forEach(function (e) { - _this4.el.removeEventListener(e, _this4.onPointerEvent); - }); - this.el.removeEventListener('mousemove', this.onMouseMove); - this.el.removeEventListener('mouseleave', this.onMouseLeave); - this.contentWrapperEl.removeEventListener('scroll', this.onScroll); - window.removeEventListener('resize', this.onWindowResize); - this.mutationObserver && this.mutationObserver.disconnect(); - this.resizeObserver.disconnect(); // Cancel all debounced functions - - this.recalculate.cancel(); - this.onMouseMove.cancel(); - this.hideScrollbars.cancel(); - this.onWindowResize.cancel(); - } - /** - * UnMount mutation observer and delete SimpleBar instance from DOM element - */ - ; - - _proto.unMount = function unMount() { - this.removeListeners(); - this.el.SimpleBar = null; - } - /** - * Recursively walks up the parent nodes looking for this.el - */ - ; - - _proto.isChildNode = function isChildNode(el) { - if (el === null) return false; - if (el === this.el) return true; - return this.isChildNode(el.parentNode); - } - /** - * Check if mouse is within bounds - */ - ; - - _proto.isWithinBounds = function isWithinBounds(bbox) { - return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height; - }; - - return SimpleBar; - }(); - /** - * HTML API - * Called only in a browser env. - */ - - - SimpleBar.defaultOptions = { - autoHide: true, - forceVisible: false, - classNames: { - contentEl: 'simplebar-content', - contentWrapper: 'simplebar-content-wrapper', - offset: 'simplebar-offset', - mask: 'simplebar-mask', - wrapper: 'simplebar-wrapper', - placeholder: 'simplebar-placeholder', - scrollbar: 'simplebar-scrollbar', - track: 'simplebar-track', - heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper', - heightAutoObserverEl: 'simplebar-height-auto-observer', - visible: 'simplebar-visible', - horizontal: 'simplebar-horizontal', - vertical: 'simplebar-vertical', - hover: 'simplebar-hover', - dragging: 'simplebar-dragging' - }, - scrollbarMinSize: 25, - scrollbarMaxSize: 0, - timeout: 1000 - }; - - if (canUseDom) { - SimpleBar.initHtmlApi(); - } - - return SimpleBar; - -})); diff --git a/assets/js/simplebar.min.js b/assets/js/simplebar.min.js deleted file mode 100644 index 52cf1706..00000000 --- a/assets/js/simplebar.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).SimpleBar=e()}(this,function(){"use strict";function c(t){try{return!!t()}catch(t){return!0}}function C(t){return D.call(t).slice(8,-1)}function w(t){return Object(s(t))}function O(t){return 0n;)!m(r,i=e[n++])||~St(s,i)||s.push(i);return s}function e(t,e){return(t=jt[Rt(t)])==zt||t!=Nt&&("function"==typeof e?c(e):!!e)}function i(t,e){var i,r,n,s=t.target,o=t.global,a=t.stat,l=o?g:a?g[s]||Y(s,{}):(g[s]||{}).prototype;if(l)for(i in e){if(r=e[i],n=t.noTargetGet?(n=Vt(l,i))&&n.value:l[i],!Ct(o?i:s+(a?".":"#")+i,t.forced)&&void 0!==n){if(typeof r==typeof n)continue;v=p=d=f=u=void 0;for(var c=r,h=n,u=Wt(h),f=ot.f,d=yt.f,p=0;p>>0||(Zt.test(i)?16:10))}:Qt,te=(i({global:!0,forced:parseInt!=E},{parseInt:E}),RegExp.prototype.exec),ee=String.prototype.replace,x=te,ie=(p=/a/,f=/b*/g,te.call(p,"a"),te.call(f,"a"),0!==p.lastIndex||0!==f.lastIndex),re=void 0!==/()??/.exec("")[1],ne=x=ie||re?function(t){var e,i,r,n,s=this;return re&&(i=new RegExp("^"+s.source+"$(?!\\s)",function(){var t=S(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}.call(s))),ie&&(e=s.lastIndex),r=te.call(s,t),ie&&r&&(s.lastIndex=s.global?r.index+r[0].length:e),re&&r&&1")}),ae=!c(function(){var t=/(?:)/,e=t.exec,t=(t.exec=function(){return e.apply(this,arguments)},"ab".split(t));return 2!==t.length||"a"!==t[0]||"b"!==t[1]}),le=(Ht("match",1,function(r,l,c){return[function(t){var e=s(this),i=null==t?void 0:t[r];return void 0!==i?i.call(t,e):new RegExp(t)[r](String(e))},function(t){var e=c(l,t,this);if(e.done)return e.value;var i=S(t),r=String(this);if(!i.global)return Pt(i,r);for(var n=i.unicode,s=[],o=i.lastIndex=0;null!==(a=Pt(i,r));){var a=String(a[0]);""===(s[o]=a)&&(i.lastIndex=It(r,O(i.lastIndex),n)),o++}return 0===o?null:s}]}),Math.max),ce=Math.min,he=Math.floor,ue=/\$([$&`']|\d\d?|<[^>]*>)/g,fe=/\$([$&`']|\d\d?)/g;Ht("replace",2,function(n,x,E){return[function(t,e){var i=s(this),r=null==t?void 0:t[n];return void 0!==r?r.call(t,i,e):x.call(String(i),t,e)},function(t,e){var i=E(x,t,this,e);if(i.done)return i.value;for(var r,n=S(t),s=String(this),o="function"==typeof e,a=(o||(e=String(e)),n.global),l=(a&&(r=n.unicode,n.lastIndex=0),[]);null!==(d=Pt(n,s))&&(l.push(d),a);)""===String(d[0])&&(n.lastIndex=It(s,O(n.lastIndex),r));for(var c,h="",u=0,f=0;f
',t.firstElementChild),e=(document.body.appendChild(t),t.firstElementChild),i=(t.scrollLeft=0,o.getOffset(t)),r=o.getOffset(e),t=(t.scrollLeft=999,o.getOffset(e));return{isRtlScrollingInverted:i.left!==r.left&&r.left-t.left!=0,isRtlScrollbarInverted:i.left!==r.left}},o.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(function(t){t.forEach(function(t){Array.prototype.forEach.call(t.addedNodes,function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?t.SimpleBar||new o(t,o.getElOptions(t)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(t){t.SimpleBar||new o(t,o.getElOptions(t))}))}),Array.prototype.forEach.call(t.removedNodes,function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?t.SimpleBar&&t.SimpleBar.unMount():Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(t){t.SimpleBar&&t.SimpleBar.unMount()}))})})}),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},o.getElOptions=function(t){return Array.prototype.reduce.call(t.attributes,function(t,e){var i=e.name.match(/data-simplebar-(.+)/);if(i){var r=i[1].replace(/\W+(.)/g,function(t,e){return e.toUpperCase()});switch(e.value){case"true":t[r]=!0;break;case"false":t[r]=!1;break;case void 0:t[r]=!0;break;default:t[r]=e.value}}return t},{})},o.removeObserver=function(){this.globalObserver.disconnect()},o.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),function(t){t.SimpleBar||new o(t,o.getElOptions(t))})},o.getOffset=function(t){t=t.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft)}};var t=o.prototype;return t.init=function(){this.el.SimpleBar=this,ji&&(this.initDOM(),this.scrollbarWidth=de(),this.recalculate(),this.initListeners())},t.initDOM=function(){var t,e,i=this;if(Array.prototype.filter.call(this.el.children,function(t){return t.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.el.querySelector("."+this.classNames.contentWrapper),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.contentEl=this.el.querySelector("."+this.classNames.contentEl),this.placeholderEl=this.el.querySelector("."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.el.querySelector("."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.el.querySelector("."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}this.axis.x.track.el&&this.axis.y.track.el||(t=document.createElement("div"),e=document.createElement("div"),t.classList.add(this.classNames.track),e.classList.add(this.classNames.scrollbar),t.appendChild(e),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)),this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.initListeners=function(){var e=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick","touchstart","touchend","touchmove"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,!0)}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),window.addEventListener("resize",this.onWindowResize),this.resizeObserver=new Ri(this.recalculate),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl)},t.recalculate=function(){var t=this.heightAutoObserverEl.offsetHeight<=1,e=this.heightAutoObserverEl.offsetWidth<=1;this.elStyles=window.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction,this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft,this.contentWrapperEl.style.height=t?"auto":"100%",this.placeholderEl.style.width=e?this.contentEl.offsetWidth+"px":"auto",this.placeholderEl.style.height=this.contentEl.scrollHeight+"px",this.axis.x.isOverflowing=this.contentWrapperEl.scrollWidth>this.contentWrapperEl.offsetWidth,this.axis.y.isOverflowing=this.contentWrapperEl.scrollHeight>this.contentWrapperEl.offsetHeight,this.axis.x.isOverflowing="hidden"!==this.elStyles.overflowX&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==this.elStyles.overflowY&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar(),this.axis.x.track.rect=this.axis.x.track.el.getBoundingClientRect(),this.axis.y.track.rect=this.axis.y.track.el.getBoundingClientRect(),this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(t){void 0===t&&(t="y");var e=this.scrollbarWidth?this.contentWrapperEl[this.axis[t].scrollSizeAttr]:this.contentWrapperEl[this.axis[t].scrollSizeAttr]-this.minScrollbarWidth,i=this.axis[t].track.rect[this.axis[t].sizeAttr];if(this.axis[t].isOverflowing)return t=Math.max(~~(i/e*i),this.options.scrollbarMinSize),this.options.scrollbarMaxSize?Math.min(t,this.options.scrollbarMaxSize):t},t.positionScrollbar=function(t){var e=this.contentWrapperEl[this.axis[t=void 0===t?"y":t].scrollSizeAttr],i=this.axis[t].track.rect[this.axis[t].sizeAttr],r=parseInt(this.elStyles[this.axis[t].sizeAttr],10),n=this.axis[t].scrollbar,s=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],s="x"===t&&this.isRtl&&o.getRtlHelpers().isRtlScrollingInverted?-s:s,s=~~((i-n.size)*(s/(e-r))),s="x"===t&&this.isRtl&&o.getRtlHelpers().isRtlScrollbarInverted?s+(i-n.size):s;n.el.style.transform="x"===t?"translate3d("+s+"px, 0, 0)":"translate3d(0, "+s+"px, 0)"},t.toggleTrackVisibility=function(t){var e=this.axis[t=void 0===t?"y":t].track.el,i=this.axis[t].scrollbar.el;this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll"):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden"),this.axis[t].isOverflowing?i.style.display="block":i.style.display="none"},t.hideNativeScrollbar=function(){var t;this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+(this.scrollbarWidth||this.minScrollbarWidth)+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+(this.scrollbarWidth||this.minScrollbarWidth)+"px":0,this.scrollbarWidth||(t=[this.isRtl?"paddingLeft":"paddingRight"],this.contentWrapperEl.style[t]=this.axis.y.isOverflowing||this.axis.y.forceVisible?this.minScrollbarWidth+"px":0,this.contentWrapperEl.style.paddingBottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?this.minScrollbarWidth+"px":0)},t.onMouseMoveForAxis=function(t){this.axis[t=void 0===t?"y":t].track.rect=this.axis[t].track.el.getBoundingClientRect(),this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[t].scrollbar.rect)?this.axis[t].scrollbar.el.classList.add(this.classNames.hover):this.axis[t].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[t].track.rect)?(this.showScrollbar(t),this.axis[t].track.el.classList.add(this.classNames.hover)):this.axis[t].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(t){this.axis[t=void 0===t?"y":t].track.el.classList.remove(this.classNames.hover),this.axis[t].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(t){var e=this.axis[t=void 0===t?"y":t].scrollbar.el;this.axis[t].isVisible||(e.classList.add(this.classNames.visible),this.axis[t].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(t,e){var i=this.axis[e=void 0===e?"y":e].scrollbar.el,t="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=t-i.getBoundingClientRect()[this.axis[e].offsetAttr],this.draggedAxis=e,this.el.classList.add(this.classNames.dragging),document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.onEndDrag)},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.removeListeners=function(){var e=this;this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick","touchstart","touchend","touchmove"].forEach(function(t){e.el.removeEventListener(t,e.onPointerEvent)}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),this.el.SimpleBar=null},t.isChildNode=function(t){return null!==t&&(t===this.el||this.isChildNode(t.parentNode))},t.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},o}();return p.defaultOptions={autoHide:!0,forceVisible:!1,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},ji&&p.initHtmlApi(),p}); \ No newline at end of file diff --git a/assets/js/um-crop.js b/assets/js/um-crop.js deleted file mode 100644 index 550c0d52..00000000 --- a/assets/js/um-crop.js +++ /dev/null @@ -1,3274 +0,0 @@ -/*! - * Cropper.js v1.6.1 - * https://fengyuanchen.github.io/cropperjs - * - * Copyright 2015-present Chen Fengyuan - * Released under the MIT license - * - * Date: 2023-09-17T03:44:19.860Z - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory()); -})(this, (function () { 'use strict'; - - function ownKeys(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function (r) { - return Object.getOwnPropertyDescriptor(e, r).enumerable; - })), t.push.apply(t, o); - } - return t; - } - function _objectSpread2(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { - _defineProperty(e, r, t[r]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); - }); - } - return e; - } - function _typeof(o) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, _typeof(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - return typeof key === "symbol" ? key : String(key); - } - - var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined'; - var WINDOW = IS_BROWSER ? window : {}; - var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false; - var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false; - var NAMESPACE = 'cropper'; - - // Actions - var ACTION_ALL = 'all'; - var ACTION_CROP = 'crop'; - var ACTION_MOVE = 'move'; - var ACTION_ZOOM = 'zoom'; - var ACTION_EAST = 'e'; - var ACTION_WEST = 'w'; - var ACTION_SOUTH = 's'; - var ACTION_NORTH = 'n'; - var ACTION_NORTH_EAST = 'ne'; - var ACTION_NORTH_WEST = 'nw'; - var ACTION_SOUTH_EAST = 'se'; - var ACTION_SOUTH_WEST = 'sw'; - - // Classes - var CLASS_CROP = "".concat(NAMESPACE, "-crop"); - var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled"); - var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden"); - var CLASS_HIDE = "".concat(NAMESPACE, "-hide"); - var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible"); - var CLASS_MODAL = "".concat(NAMESPACE, "-modal"); - var CLASS_MOVE = "".concat(NAMESPACE, "-move"); - - // Data keys - var DATA_ACTION = "".concat(NAMESPACE, "Action"); - var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); - - // Drag modes - var DRAG_MODE_CROP = 'crop'; - var DRAG_MODE_MOVE = 'move'; - var DRAG_MODE_NONE = 'none'; - - // Events - var EVENT_CROP = 'crop'; - var EVENT_CROP_END = 'cropend'; - var EVENT_CROP_MOVE = 'cropmove'; - var EVENT_CROP_START = 'cropstart'; - var EVENT_DBLCLICK = 'dblclick'; - var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown'; - var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove'; - var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup'; - var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START; - var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE; - var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END; - var EVENT_READY = 'ready'; - var EVENT_RESIZE = 'resize'; - var EVENT_WHEEL = 'wheel'; - var EVENT_ZOOM = 'zoom'; - - // Mime types - var MIME_TYPE_JPEG = 'image/jpeg'; - - // RegExps - var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/; - var REGEXP_DATA_URL = /^data:/; - var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; - var REGEXP_TAG_NAME = /^img|canvas$/i; - - // Misc - // Inspired by the default width and height of a canvas element. - var MIN_CONTAINER_WIDTH = 200; - var MIN_CONTAINER_HEIGHT = 100; - - var DEFAULTS = { - // Define the view mode of the cropper - viewMode: 0, - // 0, 1, 2, 3 - - // Define the dragging mode of the cropper - dragMode: DRAG_MODE_CROP, - // 'crop', 'move' or 'none' - - // Define the initial aspect ratio of the crop box - initialAspectRatio: NaN, - // Define the aspect ratio of the crop box - aspectRatio: NaN, - // An object with the previous cropping result data - data: null, - // A selector for adding extra containers to preview - preview: '', - // Re-render the cropper when resize the window - responsive: true, - // Restore the cropped area after resize the window - restore: true, - // Check if the current image is a cross-origin image - checkCrossOrigin: true, - // Check the current image's Exif Orientation information - checkOrientation: true, - // Show the black modal - modal: true, - // Show the dashed lines for guiding - guides: true, - // Show the center indicator for guiding - center: true, - // Show the white modal to highlight the crop box - highlight: true, - // Show the grid background - background: true, - // Enable to crop the image automatically when initialize - autoCrop: true, - // Define the percentage of automatic cropping area when initializes - autoCropArea: 0.8, - // Enable to move the image - movable: true, - // Enable to rotate the image - rotatable: true, - // Enable to scale the image - scalable: true, - // Enable to zoom the image - zoomable: true, - // Enable to zoom the image by dragging touch - zoomOnTouch: true, - // Enable to zoom the image by wheeling mouse - zoomOnWheel: true, - // Define zoom ratio when zoom the image by wheeling mouse - wheelZoomRatio: 0.1, - // Enable to move the crop box - cropBoxMovable: true, - // Enable to resize the crop box - cropBoxResizable: true, - // Toggle drag mode between "crop" and "move" when click twice on the cropper - toggleDragModeOnDblclick: true, - // Size limitation - minCanvasWidth: 0, - minCanvasHeight: 0, - minCropBoxWidth: 0, - minCropBoxHeight: 0, - minContainerWidth: MIN_CONTAINER_WIDTH, - minContainerHeight: MIN_CONTAINER_HEIGHT, - // Shortcuts of events - ready: null, - cropstart: null, - cropmove: null, - cropend: null, - crop: null, - zoom: null - }; - - var TEMPLATE = '
' + '
' + '
' + '
' + '
' + '
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + '
'; - - /** - * Check if the given value is not a number. - */ - var isNaN = Number.isNaN || WINDOW.isNaN; - - /** - * Check if the given value is a number. - * @param {*} value - The value to check. - * @returns {boolean} Returns `true` if the given value is a number, else `false`. - */ - function isNumber(value) { - return typeof value === 'number' && !isNaN(value); - } - - /** - * Check if the given value is a positive number. - * @param {*} value - The value to check. - * @returns {boolean} Returns `true` if the given value is a positive number, else `false`. - */ - var isPositiveNumber = function isPositiveNumber(value) { - return value > 0 && value < Infinity; - }; - - /** - * Check if the given value is undefined. - * @param {*} value - The value to check. - * @returns {boolean} Returns `true` if the given value is undefined, else `false`. - */ - function isUndefined(value) { - return typeof value === 'undefined'; - } - - /** - * Check if the given value is an object. - * @param {*} value - The value to check. - * @returns {boolean} Returns `true` if the given value is an object, else `false`. - */ - function isObject(value) { - return _typeof(value) === 'object' && value !== null; - } - var hasOwnProperty = Object.prototype.hasOwnProperty; - - /** - * Check if the given value is a plain object. - * @param {*} value - The value to check. - * @returns {boolean} Returns `true` if the given value is a plain object, else `false`. - */ - function isPlainObject(value) { - if (!isObject(value)) { - return false; - } - try { - var _constructor = value.constructor; - var prototype = _constructor.prototype; - return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf'); - } catch (error) { - return false; - } - } - - /** - * Check if the given value is a function. - * @param {*} value - The value to check. - * @returns {boolean} Returns `true` if the given value is a function, else `false`. - */ - function isFunction(value) { - return typeof value === 'function'; - } - var slice = Array.prototype.slice; - - /** - * Convert array-like or iterable object to an array. - * @param {*} value - The value to convert. - * @returns {Array} Returns a new array. - */ - function toArray(value) { - return Array.from ? Array.from(value) : slice.call(value); - } - - /** - * Iterate the given data. - * @param {*} data - The data to iterate. - * @param {Function} callback - The process function for each element. - * @returns {*} The original data. - */ - function forEach(data, callback) { - if (data && isFunction(callback)) { - if (Array.isArray(data) || isNumber(data.length) /* array-like */) { - toArray(data).forEach(function (value, key) { - callback.call(data, value, key, data); - }); - } else if (isObject(data)) { - Object.keys(data).forEach(function (key) { - callback.call(data, data[key], key, data); - }); - } - } - return data; - } - - /** - * Extend the given object. - * @param {*} target - The target object to extend. - * @param {*} args - The rest objects for merging to the target object. - * @returns {Object} The extended object. - */ - var assign = Object.assign || function assign(target) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - if (isObject(target) && args.length > 0) { - args.forEach(function (arg) { - if (isObject(arg)) { - Object.keys(arg).forEach(function (key) { - target[key] = arg[key]; - }); - } - }); - } - return target; - }; - var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/; - - /** - * Normalize decimal number. - * Check out {@link https://0.30000000000000004.com/} - * @param {number} value - The value to normalize. - * @param {number} [times=100000000000] - The times for normalizing. - * @returns {number} Returns the normalized number. - */ - function normalizeDecimalNumber(value) { - var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000; - return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value; - } - var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/; - - /** - * Apply styles to the given element. - * @param {Element} element - The target element. - * @param {Object} styles - The styles for applying. - */ - function setStyle(element, styles) { - var style = element.style; - forEach(styles, function (value, property) { - if (REGEXP_SUFFIX.test(property) && isNumber(value)) { - value = "".concat(value, "px"); - } - style[property] = value; - }); - } - - /** - * Check if the given element has a special class. - * @param {Element} element - The element to check. - * @param {string} value - The class to search. - * @returns {boolean} Returns `true` if the special class was found. - */ - function hasClass(element, value) { - return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1; - } - - /** - * Add classes to the given element. - * @param {Element} element - The target element. - * @param {string} value - The classes to be added. - */ - function addClass(element, value) { - if (!value) { - return; - } - if (isNumber(element.length)) { - forEach(element, function (elem) { - addClass(elem, value); - }); - return; - } - if (element.classList) { - element.classList.add(value); - return; - } - var className = element.className.trim(); - if (!className) { - element.className = value; - } else if (className.indexOf(value) < 0) { - element.className = "".concat(className, " ").concat(value); - } - } - - /** - * Remove classes from the given element. - * @param {Element} element - The target element. - * @param {string} value - The classes to be removed. - */ - function removeClass(element, value) { - if (!value) { - return; - } - if (isNumber(element.length)) { - forEach(element, function (elem) { - removeClass(elem, value); - }); - return; - } - if (element.classList) { - element.classList.remove(value); - return; - } - if (element.className.indexOf(value) >= 0) { - element.className = element.className.replace(value, ''); - } - } - - /** - * Add or remove classes from the given element. - * @param {Element} element - The target element. - * @param {string} value - The classes to be toggled. - * @param {boolean} added - Add only. - */ - function toggleClass(element, value, added) { - if (!value) { - return; - } - if (isNumber(element.length)) { - forEach(element, function (elem) { - toggleClass(elem, value, added); - }); - return; - } - - // IE10-11 doesn't support the second parameter of `classList.toggle` - if (added) { - addClass(element, value); - } else { - removeClass(element, value); - } - } - var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g; - - /** - * Transform the given string from camelCase to kebab-case - * @param {string} value - The value to transform. - * @returns {string} The transformed value. - */ - function toParamCase(value) { - return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase(); - } - - /** - * Get data from the given element. - * @param {Element} element - The target element. - * @param {string} name - The data key to get. - * @returns {string} The data value. - */ - function getData(element, name) { - if (isObject(element[name])) { - return element[name]; - } - if (element.dataset) { - return element.dataset[name]; - } - return element.getAttribute("data-".concat(toParamCase(name))); - } - - /** - * Set data to the given element. - * @param {Element} element - The target element. - * @param {string} name - The data key to set. - * @param {string} data - The data value. - */ - function setData(element, name, data) { - if (isObject(data)) { - element[name] = data; - } else if (element.dataset) { - element.dataset[name] = data; - } else { - element.setAttribute("data-".concat(toParamCase(name)), data); - } - } - - /** - * Remove data from the given element. - * @param {Element} element - The target element. - * @param {string} name - The data key to remove. - */ - function removeData(element, name) { - if (isObject(element[name])) { - try { - delete element[name]; - } catch (error) { - element[name] = undefined; - } - } else if (element.dataset) { - // #128 Safari not allows to delete dataset property - try { - delete element.dataset[name]; - } catch (error) { - element.dataset[name] = undefined; - } - } else { - element.removeAttribute("data-".concat(toParamCase(name))); - } - } - var REGEXP_SPACES = /\s\s*/; - var onceSupported = function () { - var supported = false; - if (IS_BROWSER) { - var once = false; - var listener = function listener() {}; - var options = Object.defineProperty({}, 'once', { - get: function get() { - supported = true; - return once; - }, - /** - * This setter can fix a `TypeError` in strict mode - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only} - * @param {boolean} value - The value to set - */ - set: function set(value) { - once = value; - } - }); - WINDOW.addEventListener('test', listener, options); - WINDOW.removeEventListener('test', listener, options); - } - return supported; - }(); - - /** - * Remove event listener from the target element. - * @param {Element} element - The event target. - * @param {string} type - The event type(s). - * @param {Function} listener - The event listener. - * @param {Object} options - The event options. - */ - function removeListener(element, type, listener) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var handler = listener; - type.trim().split(REGEXP_SPACES).forEach(function (event) { - if (!onceSupported) { - var listeners = element.listeners; - if (listeners && listeners[event] && listeners[event][listener]) { - handler = listeners[event][listener]; - delete listeners[event][listener]; - if (Object.keys(listeners[event]).length === 0) { - delete listeners[event]; - } - if (Object.keys(listeners).length === 0) { - delete element.listeners; - } - } - } - element.removeEventListener(event, handler, options); - }); - } - - /** - * Add event listener to the target element. - * @param {Element} element - The event target. - * @param {string} type - The event type(s). - * @param {Function} listener - The event listener. - * @param {Object} options - The event options. - */ - function addListener(element, type, listener) { - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var _handler = listener; - type.trim().split(REGEXP_SPACES).forEach(function (event) { - if (options.once && !onceSupported) { - var _element$listeners = element.listeners, - listeners = _element$listeners === void 0 ? {} : _element$listeners; - _handler = function handler() { - delete listeners[event][listener]; - element.removeEventListener(event, _handler, options); - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - listener.apply(element, args); - }; - if (!listeners[event]) { - listeners[event] = {}; - } - if (listeners[event][listener]) { - element.removeEventListener(event, listeners[event][listener], options); - } - listeners[event][listener] = _handler; - element.listeners = listeners; - } - element.addEventListener(event, _handler, options); - }); - } - - /** - * Dispatch event on the target element. - * @param {Element} element - The event target. - * @param {string} type - The event type(s). - * @param {Object} data - The additional event data. - * @returns {boolean} Indicate if the event is default prevented or not. - */ - function dispatchEvent(element, type, data) { - var event; - - // Event and CustomEvent on IE9-11 are global objects, not constructors - if (isFunction(Event) && isFunction(CustomEvent)) { - event = new CustomEvent(type, { - detail: data, - bubbles: true, - cancelable: true - }); - } else { - event = document.createEvent('CustomEvent'); - event.initCustomEvent(type, true, true, data); - } - return element.dispatchEvent(event); - } - - /** - * Get the offset base on the document. - * @param {Element} element - The target element. - * @returns {Object} The offset data. - */ - function getOffset(element) { - var box = element.getBoundingClientRect(); - return { - left: box.left + (window.pageXOffset - document.documentElement.clientLeft), - top: box.top + (window.pageYOffset - document.documentElement.clientTop) - }; - } - var location = WINDOW.location; - var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i; - - /** - * Check if the given URL is a cross origin URL. - * @param {string} url - The target URL. - * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`. - */ - function isCrossOriginURL(url) { - var parts = url.match(REGEXP_ORIGINS); - return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port); - } - - /** - * Add timestamp to the given URL. - * @param {string} url - The target URL. - * @returns {string} The result URL. - */ - function addTimestamp(url) { - var timestamp = "timestamp=".concat(new Date().getTime()); - return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp; - } - - /** - * Get transforms base on the given object. - * @param {Object} obj - The target object. - * @returns {string} A string contains transform values. - */ - function getTransforms(_ref) { - var rotate = _ref.rotate, - scaleX = _ref.scaleX, - scaleY = _ref.scaleY, - translateX = _ref.translateX, - translateY = _ref.translateY; - var values = []; - if (isNumber(translateX) && translateX !== 0) { - values.push("translateX(".concat(translateX, "px)")); - } - if (isNumber(translateY) && translateY !== 0) { - values.push("translateY(".concat(translateY, "px)")); - } - - // Rotate should come first before scale to match orientation transform - if (isNumber(rotate) && rotate !== 0) { - values.push("rotate(".concat(rotate, "deg)")); - } - if (isNumber(scaleX) && scaleX !== 1) { - values.push("scaleX(".concat(scaleX, ")")); - } - if (isNumber(scaleY) && scaleY !== 1) { - values.push("scaleY(".concat(scaleY, ")")); - } - var transform = values.length ? values.join(' ') : 'none'; - return { - WebkitTransform: transform, - msTransform: transform, - transform: transform - }; - } - - /** - * Get the max ratio of a group of pointers. - * @param {string} pointers - The target pointers. - * @returns {number} The result ratio. - */ - function getMaxZoomRatio(pointers) { - var pointers2 = _objectSpread2({}, pointers); - var maxRatio = 0; - forEach(pointers, function (pointer, pointerId) { - delete pointers2[pointerId]; - forEach(pointers2, function (pointer2) { - var x1 = Math.abs(pointer.startX - pointer2.startX); - var y1 = Math.abs(pointer.startY - pointer2.startY); - var x2 = Math.abs(pointer.endX - pointer2.endX); - var y2 = Math.abs(pointer.endY - pointer2.endY); - var z1 = Math.sqrt(x1 * x1 + y1 * y1); - var z2 = Math.sqrt(x2 * x2 + y2 * y2); - var ratio = (z2 - z1) / z1; - if (Math.abs(ratio) > Math.abs(maxRatio)) { - maxRatio = ratio; - } - }); - }); - return maxRatio; - } - - /** - * Get a pointer from an event object. - * @param {Object} event - The target event object. - * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not. - * @returns {Object} The result pointer contains start and/or end point coordinates. - */ - function getPointer(_ref2, endOnly) { - var pageX = _ref2.pageX, - pageY = _ref2.pageY; - var end = { - endX: pageX, - endY: pageY - }; - return endOnly ? end : _objectSpread2({ - startX: pageX, - startY: pageY - }, end); - } - - /** - * Get the center point coordinate of a group of pointers. - * @param {Object} pointers - The target pointers. - * @returns {Object} The center point coordinate. - */ - function getPointersCenter(pointers) { - var pageX = 0; - var pageY = 0; - var count = 0; - forEach(pointers, function (_ref3) { - var startX = _ref3.startX, - startY = _ref3.startY; - pageX += startX; - pageY += startY; - count += 1; - }); - pageX /= count; - pageY /= count; - return { - pageX: pageX, - pageY: pageY - }; - } - - /** - * Get the max sizes in a rectangle under the given aspect ratio. - * @param {Object} data - The original sizes. - * @param {string} [type='contain'] - The adjust type. - * @returns {Object} The result sizes. - */ - function getAdjustedSizes(_ref4) { - var aspectRatio = _ref4.aspectRatio, - height = _ref4.height, - width = _ref4.width; - var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain'; - var isValidWidth = isPositiveNumber(width); - var isValidHeight = isPositiveNumber(height); - if (isValidWidth && isValidHeight) { - var adjustedWidth = height * aspectRatio; - if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) { - height = width / aspectRatio; - } else { - width = height * aspectRatio; - } - } else if (isValidWidth) { - height = width / aspectRatio; - } else if (isValidHeight) { - width = height * aspectRatio; - } - return { - width: width, - height: height - }; - } - - /** - * Get the new sizes of a rectangle after rotated. - * @param {Object} data - The original sizes. - * @returns {Object} The result sizes. - */ - function getRotatedSizes(_ref5) { - var width = _ref5.width, - height = _ref5.height, - degree = _ref5.degree; - degree = Math.abs(degree) % 180; - if (degree === 90) { - return { - width: height, - height: width - }; - } - var arc = degree % 90 * Math.PI / 180; - var sinArc = Math.sin(arc); - var cosArc = Math.cos(arc); - var newWidth = width * cosArc + height * sinArc; - var newHeight = width * sinArc + height * cosArc; - return degree > 90 ? { - width: newHeight, - height: newWidth - } : { - width: newWidth, - height: newHeight - }; - } - - /** - * Get a canvas which drew the given image. - * @param {HTMLImageElement} image - The image for drawing. - * @param {Object} imageData - The image data. - * @param {Object} canvasData - The canvas data. - * @param {Object} options - The options. - * @returns {HTMLCanvasElement} The result canvas. - */ - function getSourceCanvas(image, _ref6, _ref7, _ref8) { - var imageAspectRatio = _ref6.aspectRatio, - imageNaturalWidth = _ref6.naturalWidth, - imageNaturalHeight = _ref6.naturalHeight, - _ref6$rotate = _ref6.rotate, - rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate, - _ref6$scaleX = _ref6.scaleX, - scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX, - _ref6$scaleY = _ref6.scaleY, - scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY; - var aspectRatio = _ref7.aspectRatio, - naturalWidth = _ref7.naturalWidth, - naturalHeight = _ref7.naturalHeight; - var _ref8$fillColor = _ref8.fillColor, - fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor, - _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled, - imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE, - _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality, - imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ, - _ref8$maxWidth = _ref8.maxWidth, - maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth, - _ref8$maxHeight = _ref8.maxHeight, - maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight, - _ref8$minWidth = _ref8.minWidth, - minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth, - _ref8$minHeight = _ref8.minHeight, - minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight; - var canvas = document.createElement('canvas'); - var context = canvas.getContext('2d'); - var maxSizes = getAdjustedSizes({ - aspectRatio: aspectRatio, - width: maxWidth, - height: maxHeight - }); - var minSizes = getAdjustedSizes({ - aspectRatio: aspectRatio, - width: minWidth, - height: minHeight - }, 'cover'); - var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth)); - var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); - - // Note: should always use image's natural sizes for drawing as - // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90 - var destMaxSizes = getAdjustedSizes({ - aspectRatio: imageAspectRatio, - width: maxWidth, - height: maxHeight - }); - var destMinSizes = getAdjustedSizes({ - aspectRatio: imageAspectRatio, - width: minWidth, - height: minHeight - }, 'cover'); - var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth)); - var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight)); - var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight]; - canvas.width = normalizeDecimalNumber(width); - canvas.height = normalizeDecimalNumber(height); - context.fillStyle = fillColor; - context.fillRect(0, 0, width, height); - context.save(); - context.translate(width / 2, height / 2); - context.rotate(rotate * Math.PI / 180); - context.scale(scaleX, scaleY); - context.imageSmoothingEnabled = imageSmoothingEnabled; - context.imageSmoothingQuality = imageSmoothingQuality; - context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) { - return Math.floor(normalizeDecimalNumber(param)); - })))); - context.restore(); - return canvas; - } - var fromCharCode = String.fromCharCode; - - /** - * Get string from char code in data view. - * @param {DataView} dataView - The data view for read. - * @param {number} start - The start index. - * @param {number} length - The read length. - * @returns {string} The read result. - */ - function getStringFromCharCode(dataView, start, length) { - var str = ''; - length += start; - for (var i = start; i < length; i += 1) { - str += fromCharCode(dataView.getUint8(i)); - } - return str; - } - var REGEXP_DATA_URL_HEAD = /^data:.*,/; - - /** - * Transform Data URL to array buffer. - * @param {string} dataURL - The Data URL to transform. - * @returns {ArrayBuffer} The result array buffer. - */ - function dataURLToArrayBuffer(dataURL) { - var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, ''); - var binary = atob(base64); - var arrayBuffer = new ArrayBuffer(binary.length); - var uint8 = new Uint8Array(arrayBuffer); - forEach(uint8, function (value, i) { - uint8[i] = binary.charCodeAt(i); - }); - return arrayBuffer; - } - - /** - * Transform array buffer to Data URL. - * @param {ArrayBuffer} arrayBuffer - The array buffer to transform. - * @param {string} mimeType - The mime type of the Data URL. - * @returns {string} The result Data URL. - */ - function arrayBufferToDataURL(arrayBuffer, mimeType) { - var chunks = []; - - // Chunk Typed Array for better performance (#435) - var chunkSize = 8192; - var uint8 = new Uint8Array(arrayBuffer); - while (uint8.length > 0) { - // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9 - // eslint-disable-next-line prefer-spread - chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize)))); - uint8 = uint8.subarray(chunkSize); - } - return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join(''))); - } - - /** - * Get orientation value from given array buffer. - * @param {ArrayBuffer} arrayBuffer - The array buffer to read. - * @returns {number} The read orientation value. - */ - function resetAndGetOrientation(arrayBuffer) { - var dataView = new DataView(arrayBuffer); - var orientation; - - // Ignores range error when the image does not have correct Exif information - try { - var littleEndian; - var app1Start; - var ifdStart; - - // Only handle JPEG image (start by 0xFFD8) - if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) { - var length = dataView.byteLength; - var offset = 2; - while (offset + 1 < length) { - if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) { - app1Start = offset; - break; - } - offset += 1; - } - } - if (app1Start) { - var exifIDCode = app1Start + 4; - var tiffOffset = app1Start + 10; - if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') { - var endianness = dataView.getUint16(tiffOffset); - littleEndian = endianness === 0x4949; - if (littleEndian || endianness === 0x4D4D /* bigEndian */) { - if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) { - var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian); - if (firstIFDOffset >= 0x00000008) { - ifdStart = tiffOffset + firstIFDOffset; - } - } - } - } - } - if (ifdStart) { - var _length = dataView.getUint16(ifdStart, littleEndian); - var _offset; - var i; - for (i = 0; i < _length; i += 1) { - _offset = ifdStart + i * 12 + 2; - if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) { - // 8 is the offset of the current tag's value - _offset += 8; - - // Get the original orientation value - orientation = dataView.getUint16(_offset, littleEndian); - - // Override the orientation with its default value - dataView.setUint16(_offset, 1, littleEndian); - break; - } - } - } - } catch (error) { - orientation = 1; - } - return orientation; - } - - /** - * Parse Exif Orientation value. - * @param {number} orientation - The orientation to parse. - * @returns {Object} The parsed result. - */ - function parseOrientation(orientation) { - var rotate = 0; - var scaleX = 1; - var scaleY = 1; - switch (orientation) { - // Flip horizontal - case 2: - scaleX = -1; - break; - - // Rotate left 180° - case 3: - rotate = -180; - break; - - // Flip vertical - case 4: - scaleY = -1; - break; - - // Flip vertical and rotate right 90° - case 5: - rotate = 90; - scaleY = -1; - break; - - // Rotate right 90° - case 6: - rotate = 90; - break; - - // Flip horizontal and rotate right 90° - case 7: - rotate = 90; - scaleX = -1; - break; - - // Rotate left 90° - case 8: - rotate = -90; - break; - } - return { - rotate: rotate, - scaleX: scaleX, - scaleY: scaleY - }; - } - - var render = { - render: function render() { - this.initContainer(); - this.initCanvas(); - this.initCropBox(); - this.renderCanvas(); - if (this.cropped) { - this.renderCropBox(); - } - }, - initContainer: function initContainer() { - var element = this.element, - options = this.options, - container = this.container, - cropper = this.cropper; - var minWidth = Number(options.minContainerWidth); - var minHeight = Number(options.minContainerHeight); - addClass(cropper, CLASS_HIDDEN); - removeClass(element, CLASS_HIDDEN); - var containerData = { - width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH), - height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT) - }; - this.containerData = containerData; - setStyle(cropper, { - width: containerData.width, - height: containerData.height - }); - addClass(element, CLASS_HIDDEN); - removeClass(cropper, CLASS_HIDDEN); - }, - // Canvas (image wrapper) - initCanvas: function initCanvas() { - var containerData = this.containerData, - imageData = this.imageData; - var viewMode = this.options.viewMode; - var rotated = Math.abs(imageData.rotate) % 180 === 90; - var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth; - var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight; - var aspectRatio = naturalWidth / naturalHeight; - var canvasWidth = containerData.width; - var canvasHeight = containerData.height; - if (containerData.height * aspectRatio > containerData.width) { - if (viewMode === 3) { - canvasWidth = containerData.height * aspectRatio; - } else { - canvasHeight = containerData.width / aspectRatio; - } - } else if (viewMode === 3) { - canvasHeight = containerData.width / aspectRatio; - } else { - canvasWidth = containerData.height * aspectRatio; - } - var canvasData = { - aspectRatio: aspectRatio, - naturalWidth: naturalWidth, - naturalHeight: naturalHeight, - width: canvasWidth, - height: canvasHeight - }; - this.canvasData = canvasData; - this.limited = viewMode === 1 || viewMode === 2; - this.limitCanvas(true, true); - canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); - canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); - canvasData.left = (containerData.width - canvasData.width) / 2; - canvasData.top = (containerData.height - canvasData.height) / 2; - canvasData.oldLeft = canvasData.left; - canvasData.oldTop = canvasData.top; - this.initialCanvasData = assign({}, canvasData); - }, - limitCanvas: function limitCanvas(sizeLimited, positionLimited) { - var options = this.options, - containerData = this.containerData, - canvasData = this.canvasData, - cropBoxData = this.cropBoxData; - var viewMode = options.viewMode; - var aspectRatio = canvasData.aspectRatio; - var cropped = this.cropped && cropBoxData; - if (sizeLimited) { - var minCanvasWidth = Number(options.minCanvasWidth) || 0; - var minCanvasHeight = Number(options.minCanvasHeight) || 0; - if (viewMode > 1) { - minCanvasWidth = Math.max(minCanvasWidth, containerData.width); - minCanvasHeight = Math.max(minCanvasHeight, containerData.height); - if (viewMode === 3) { - if (minCanvasHeight * aspectRatio > minCanvasWidth) { - minCanvasWidth = minCanvasHeight * aspectRatio; - } else { - minCanvasHeight = minCanvasWidth / aspectRatio; - } - } - } else if (viewMode > 0) { - if (minCanvasWidth) { - minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0); - } else if (minCanvasHeight) { - minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0); - } else if (cropped) { - minCanvasWidth = cropBoxData.width; - minCanvasHeight = cropBoxData.height; - if (minCanvasHeight * aspectRatio > minCanvasWidth) { - minCanvasWidth = minCanvasHeight * aspectRatio; - } else { - minCanvasHeight = minCanvasWidth / aspectRatio; - } - } - } - var _getAdjustedSizes = getAdjustedSizes({ - aspectRatio: aspectRatio, - width: minCanvasWidth, - height: minCanvasHeight - }); - minCanvasWidth = _getAdjustedSizes.width; - minCanvasHeight = _getAdjustedSizes.height; - canvasData.minWidth = minCanvasWidth; - canvasData.minHeight = minCanvasHeight; - canvasData.maxWidth = Infinity; - canvasData.maxHeight = Infinity; - } - if (positionLimited) { - if (viewMode > (cropped ? 0 : 1)) { - var newCanvasLeft = containerData.width - canvasData.width; - var newCanvasTop = containerData.height - canvasData.height; - canvasData.minLeft = Math.min(0, newCanvasLeft); - canvasData.minTop = Math.min(0, newCanvasTop); - canvasData.maxLeft = Math.max(0, newCanvasLeft); - canvasData.maxTop = Math.max(0, newCanvasTop); - if (cropped && this.limited) { - canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width)); - canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height)); - canvasData.maxLeft = cropBoxData.left; - canvasData.maxTop = cropBoxData.top; - if (viewMode === 2) { - if (canvasData.width >= containerData.width) { - canvasData.minLeft = Math.min(0, newCanvasLeft); - canvasData.maxLeft = Math.max(0, newCanvasLeft); - } - if (canvasData.height >= containerData.height) { - canvasData.minTop = Math.min(0, newCanvasTop); - canvasData.maxTop = Math.max(0, newCanvasTop); - } - } - } - } else { - canvasData.minLeft = -canvasData.width; - canvasData.minTop = -canvasData.height; - canvasData.maxLeft = containerData.width; - canvasData.maxTop = containerData.height; - } - } - }, - renderCanvas: function renderCanvas(changed, transformed) { - var canvasData = this.canvasData, - imageData = this.imageData; - if (transformed) { - var _getRotatedSizes = getRotatedSizes({ - width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1), - height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1), - degree: imageData.rotate || 0 - }), - naturalWidth = _getRotatedSizes.width, - naturalHeight = _getRotatedSizes.height; - var width = canvasData.width * (naturalWidth / canvasData.naturalWidth); - var height = canvasData.height * (naturalHeight / canvasData.naturalHeight); - canvasData.left -= (width - canvasData.width) / 2; - canvasData.top -= (height - canvasData.height) / 2; - canvasData.width = width; - canvasData.height = height; - canvasData.aspectRatio = naturalWidth / naturalHeight; - canvasData.naturalWidth = naturalWidth; - canvasData.naturalHeight = naturalHeight; - this.limitCanvas(true, false); - } - if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) { - canvasData.left = canvasData.oldLeft; - } - if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) { - canvasData.top = canvasData.oldTop; - } - canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); - canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); - this.limitCanvas(false, true); - canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft); - canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop); - canvasData.oldLeft = canvasData.left; - canvasData.oldTop = canvasData.top; - setStyle(this.canvas, assign({ - width: canvasData.width, - height: canvasData.height - }, getTransforms({ - translateX: canvasData.left, - translateY: canvasData.top - }))); - this.renderImage(changed); - if (this.cropped && this.limited) { - this.limitCropBox(true, true); - } - }, - renderImage: function renderImage(changed) { - var canvasData = this.canvasData, - imageData = this.imageData; - var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth); - var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight); - assign(imageData, { - width: width, - height: height, - left: (canvasData.width - width) / 2, - top: (canvasData.height - height) / 2 - }); - setStyle(this.image, assign({ - width: imageData.width, - height: imageData.height - }, getTransforms(assign({ - translateX: imageData.left, - translateY: imageData.top - }, imageData)))); - if (changed) { - this.output(); - } - }, - initCropBox: function initCropBox() { - var options = this.options, - canvasData = this.canvasData; - var aspectRatio = options.aspectRatio || options.initialAspectRatio; - var autoCropArea = Number(options.autoCropArea) || 0.8; - var cropBoxData = { - width: canvasData.width, - height: canvasData.height - }; - if (aspectRatio) { - if (canvasData.height * aspectRatio > canvasData.width) { - cropBoxData.height = cropBoxData.width / aspectRatio; - } else { - cropBoxData.width = cropBoxData.height * aspectRatio; - } - } - this.cropBoxData = cropBoxData; - this.limitCropBox(true, true); - - // Initialize auto crop area - cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); - cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); - - // The width/height of auto crop area must large than "minWidth/Height" - cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea); - cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea); - cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2; - cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2; - cropBoxData.oldLeft = cropBoxData.left; - cropBoxData.oldTop = cropBoxData.top; - this.initialCropBoxData = assign({}, cropBoxData); - }, - limitCropBox: function limitCropBox(sizeLimited, positionLimited) { - var options = this.options, - containerData = this.containerData, - canvasData = this.canvasData, - cropBoxData = this.cropBoxData, - limited = this.limited; - var aspectRatio = options.aspectRatio; - if (sizeLimited) { - var minCropBoxWidth = Number(options.minCropBoxWidth) || 0; - var minCropBoxHeight = Number(options.minCropBoxHeight) || 0; - var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width; - var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; - - // The min/maxCropBoxWidth/Height must be less than container's width/height - minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width); - minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height); - if (aspectRatio) { - if (minCropBoxWidth && minCropBoxHeight) { - if (minCropBoxHeight * aspectRatio > minCropBoxWidth) { - minCropBoxHeight = minCropBoxWidth / aspectRatio; - } else { - minCropBoxWidth = minCropBoxHeight * aspectRatio; - } - } else if (minCropBoxWidth) { - minCropBoxHeight = minCropBoxWidth / aspectRatio; - } else if (minCropBoxHeight) { - minCropBoxWidth = minCropBoxHeight * aspectRatio; - } - if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) { - maxCropBoxHeight = maxCropBoxWidth / aspectRatio; - } else { - maxCropBoxWidth = maxCropBoxHeight * aspectRatio; - } - } - - // The minWidth/Height must be less than maxWidth/Height - cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth); - cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight); - cropBoxData.maxWidth = maxCropBoxWidth; - cropBoxData.maxHeight = maxCropBoxHeight; - } - if (positionLimited) { - if (limited) { - cropBoxData.minLeft = Math.max(0, canvasData.left); - cropBoxData.minTop = Math.max(0, canvasData.top); - cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width; - cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height; - } else { - cropBoxData.minLeft = 0; - cropBoxData.minTop = 0; - cropBoxData.maxLeft = containerData.width - cropBoxData.width; - cropBoxData.maxTop = containerData.height - cropBoxData.height; - } - } - }, - renderCropBox: function renderCropBox() { - var options = this.options, - containerData = this.containerData, - cropBoxData = this.cropBoxData; - if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) { - cropBoxData.left = cropBoxData.oldLeft; - } - if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) { - cropBoxData.top = cropBoxData.oldTop; - } - cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); - cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); - this.limitCropBox(false, true); - cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft); - cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop); - cropBoxData.oldLeft = cropBoxData.left; - cropBoxData.oldTop = cropBoxData.top; - if (options.movable && options.cropBoxMovable) { - // Turn to move the canvas when the crop box is equal to the container - setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL); - } - setStyle(this.cropBox, assign({ - width: cropBoxData.width, - height: cropBoxData.height - }, getTransforms({ - translateX: cropBoxData.left, - translateY: cropBoxData.top - }))); - if (this.cropped && this.limited) { - this.limitCanvas(true, true); - } - if (!this.disabled) { - this.output(); - } - }, - output: function output() { - this.preview(); - dispatchEvent(this.element, EVENT_CROP, this.getData()); - } - }; - - var preview = { - initPreview: function initPreview() { - var element = this.element, - crossOrigin = this.crossOrigin; - var preview = this.options.preview; - var url = crossOrigin ? this.crossOriginUrl : this.url; - var alt = element.alt || 'The image to preview'; - var image = document.createElement('img'); - if (crossOrigin) { - image.crossOrigin = crossOrigin; - } - image.src = url; - image.alt = alt; - this.viewBox.appendChild(image); - this.viewBoxImage = image; - if (!preview) { - return; - } - var previews = preview; - if (typeof preview === 'string') { - previews = element.ownerDocument.querySelectorAll(preview); - } else if (preview.querySelector) { - previews = [preview]; - } - this.previews = previews; - forEach(previews, function (el) { - var img = document.createElement('img'); - - // Save the original size for recover - setData(el, DATA_PREVIEW, { - width: el.offsetWidth, - height: el.offsetHeight, - html: el.innerHTML - }); - if (crossOrigin) { - img.crossOrigin = crossOrigin; - } - img.src = url; - img.alt = alt; - - /** - * Override img element styles - * Add `display:block` to avoid margin top issue - * Add `height:auto` to override `height` attribute on IE8 - * (Occur only when margin-top <= -height) - */ - img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"'; - el.innerHTML = ''; - el.appendChild(img); - }); - }, - resetPreview: function resetPreview() { - forEach(this.previews, function (element) { - var data = getData(element, DATA_PREVIEW); - setStyle(element, { - width: data.width, - height: data.height - }); - element.innerHTML = data.html; - removeData(element, DATA_PREVIEW); - }); - }, - preview: function preview() { - var imageData = this.imageData, - canvasData = this.canvasData, - cropBoxData = this.cropBoxData; - var cropBoxWidth = cropBoxData.width, - cropBoxHeight = cropBoxData.height; - var width = imageData.width, - height = imageData.height; - var left = cropBoxData.left - canvasData.left - imageData.left; - var top = cropBoxData.top - canvasData.top - imageData.top; - if (!this.cropped || this.disabled) { - return; - } - setStyle(this.viewBoxImage, assign({ - width: width, - height: height - }, getTransforms(assign({ - translateX: -left, - translateY: -top - }, imageData)))); - forEach(this.previews, function (element) { - var data = getData(element, DATA_PREVIEW); - var originalWidth = data.width; - var originalHeight = data.height; - var newWidth = originalWidth; - var newHeight = originalHeight; - var ratio = 1; - if (cropBoxWidth) { - ratio = originalWidth / cropBoxWidth; - newHeight = cropBoxHeight * ratio; - } - if (cropBoxHeight && newHeight > originalHeight) { - ratio = originalHeight / cropBoxHeight; - newWidth = cropBoxWidth * ratio; - newHeight = originalHeight; - } - setStyle(element, { - width: newWidth, - height: newHeight - }); - setStyle(element.getElementsByTagName('img')[0], assign({ - width: width * ratio, - height: height * ratio - }, getTransforms(assign({ - translateX: -left * ratio, - translateY: -top * ratio - }, imageData)))); - }); - } - }; - - var events = { - bind: function bind() { - var element = this.element, - options = this.options, - cropper = this.cropper; - if (isFunction(options.cropstart)) { - addListener(element, EVENT_CROP_START, options.cropstart); - } - if (isFunction(options.cropmove)) { - addListener(element, EVENT_CROP_MOVE, options.cropmove); - } - if (isFunction(options.cropend)) { - addListener(element, EVENT_CROP_END, options.cropend); - } - if (isFunction(options.crop)) { - addListener(element, EVENT_CROP, options.crop); - } - if (isFunction(options.zoom)) { - addListener(element, EVENT_ZOOM, options.zoom); - } - addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this)); - if (options.zoomable && options.zoomOnWheel) { - addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), { - passive: false, - capture: true - }); - } - if (options.toggleDragModeOnDblclick) { - addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this)); - } - addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this)); - addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this)); - if (options.responsive) { - addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this)); - } - }, - unbind: function unbind() { - var element = this.element, - options = this.options, - cropper = this.cropper; - if (isFunction(options.cropstart)) { - removeListener(element, EVENT_CROP_START, options.cropstart); - } - if (isFunction(options.cropmove)) { - removeListener(element, EVENT_CROP_MOVE, options.cropmove); - } - if (isFunction(options.cropend)) { - removeListener(element, EVENT_CROP_END, options.cropend); - } - if (isFunction(options.crop)) { - removeListener(element, EVENT_CROP, options.crop); - } - if (isFunction(options.zoom)) { - removeListener(element, EVENT_ZOOM, options.zoom); - } - removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart); - if (options.zoomable && options.zoomOnWheel) { - removeListener(cropper, EVENT_WHEEL, this.onWheel, { - passive: false, - capture: true - }); - } - if (options.toggleDragModeOnDblclick) { - removeListener(cropper, EVENT_DBLCLICK, this.onDblclick); - } - removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove); - removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd); - if (options.responsive) { - removeListener(window, EVENT_RESIZE, this.onResize); - } - } - }; - - var handlers = { - resize: function resize() { - if (this.disabled) { - return; - } - var options = this.options, - container = this.container, - containerData = this.containerData; - var ratioX = container.offsetWidth / containerData.width; - var ratioY = container.offsetHeight / containerData.height; - var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; - - // Resize when width changed or height changed - if (ratio !== 1) { - var canvasData; - var cropBoxData; - if (options.restore) { - canvasData = this.getCanvasData(); - cropBoxData = this.getCropBoxData(); - } - this.render(); - if (options.restore) { - this.setCanvasData(forEach(canvasData, function (n, i) { - canvasData[i] = n * ratio; - })); - this.setCropBoxData(forEach(cropBoxData, function (n, i) { - cropBoxData[i] = n * ratio; - })); - } - } - }, - dblclick: function dblclick() { - if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) { - return; - } - this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP); - }, - wheel: function wheel(event) { - var _this = this; - var ratio = Number(this.options.wheelZoomRatio) || 0.1; - var delta = 1; - if (this.disabled) { - return; - } - event.preventDefault(); - - // Limit wheel speed to prevent zoom too fast (#21) - if (this.wheeling) { - return; - } - this.wheeling = true; - setTimeout(function () { - _this.wheeling = false; - }, 50); - if (event.deltaY) { - delta = event.deltaY > 0 ? 1 : -1; - } else if (event.wheelDelta) { - delta = -event.wheelDelta / 120; - } else if (event.detail) { - delta = event.detail > 0 ? 1 : -1; - } - this.zoom(-delta * ratio, event); - }, - cropStart: function cropStart(event) { - var buttons = event.buttons, - button = event.button; - if (this.disabled - - // Handle mouse event and pointer event and ignore touch event - || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( - // No primary button (Usually the left button) - isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 - - // Open context menu - || event.ctrlKey)) { - return; - } - var options = this.options, - pointers = this.pointers; - var action; - if (event.changedTouches) { - // Handle touch event - forEach(event.changedTouches, function (touch) { - pointers[touch.identifier] = getPointer(touch); - }); - } else { - // Handle mouse event and pointer event - pointers[event.pointerId || 0] = getPointer(event); - } - if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) { - action = ACTION_ZOOM; - } else { - action = getData(event.target, DATA_ACTION); - } - if (!REGEXP_ACTIONS.test(action)) { - return; - } - if (dispatchEvent(this.element, EVENT_CROP_START, { - originalEvent: event, - action: action - }) === false) { - return; - } - - // This line is required for preventing page zooming in iOS browsers - event.preventDefault(); - this.action = action; - this.cropping = false; - if (action === ACTION_CROP) { - this.cropping = true; - addClass(this.dragBox, CLASS_MODAL); - } - }, - cropMove: function cropMove(event) { - var action = this.action; - if (this.disabled || !action) { - return; - } - var pointers = this.pointers; - event.preventDefault(); - if (dispatchEvent(this.element, EVENT_CROP_MOVE, { - originalEvent: event, - action: action - }) === false) { - return; - } - if (event.changedTouches) { - forEach(event.changedTouches, function (touch) { - // The first parameter should not be undefined (#432) - assign(pointers[touch.identifier] || {}, getPointer(touch, true)); - }); - } else { - assign(pointers[event.pointerId || 0] || {}, getPointer(event, true)); - } - this.change(event); - }, - cropEnd: function cropEnd(event) { - if (this.disabled) { - return; - } - var action = this.action, - pointers = this.pointers; - if (event.changedTouches) { - forEach(event.changedTouches, function (touch) { - delete pointers[touch.identifier]; - }); - } else { - delete pointers[event.pointerId || 0]; - } - if (!action) { - return; - } - event.preventDefault(); - if (!Object.keys(pointers).length) { - this.action = ''; - } - if (this.cropping) { - this.cropping = false; - toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal); - } - dispatchEvent(this.element, EVENT_CROP_END, { - originalEvent: event, - action: action - }); - } - }; - - var change = { - change: function change(event) { - var options = this.options, - canvasData = this.canvasData, - containerData = this.containerData, - cropBoxData = this.cropBoxData, - pointers = this.pointers; - var action = this.action; - var aspectRatio = options.aspectRatio; - var left = cropBoxData.left, - top = cropBoxData.top, - width = cropBoxData.width, - height = cropBoxData.height; - var right = left + width; - var bottom = top + height; - var minLeft = 0; - var minTop = 0; - var maxWidth = containerData.width; - var maxHeight = containerData.height; - var renderable = true; - var offset; - - // Locking aspect ratio in "free mode" by holding shift key - if (!aspectRatio && event.shiftKey) { - aspectRatio = width && height ? width / height : 1; - } - if (this.limited) { - minLeft = cropBoxData.minLeft; - minTop = cropBoxData.minTop; - maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width); - maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height); - } - var pointer = pointers[Object.keys(pointers)[0]]; - var range = { - x: pointer.endX - pointer.startX, - y: pointer.endY - pointer.startY - }; - var check = function check(side) { - switch (side) { - case ACTION_EAST: - if (right + range.x > maxWidth) { - range.x = maxWidth - right; - } - break; - case ACTION_WEST: - if (left + range.x < minLeft) { - range.x = minLeft - left; - } - break; - case ACTION_NORTH: - if (top + range.y < minTop) { - range.y = minTop - top; - } - break; - case ACTION_SOUTH: - if (bottom + range.y > maxHeight) { - range.y = maxHeight - bottom; - } - break; - } - }; - switch (action) { - // Move crop box - case ACTION_ALL: - left += range.x; - top += range.y; - break; - - // Resize crop box - case ACTION_EAST: - if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) { - renderable = false; - break; - } - check(ACTION_EAST); - width += range.x; - if (width < 0) { - action = ACTION_WEST; - width = -width; - left -= width; - } - if (aspectRatio) { - height = width / aspectRatio; - top += (cropBoxData.height - height) / 2; - } - break; - case ACTION_NORTH: - if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) { - renderable = false; - break; - } - check(ACTION_NORTH); - height -= range.y; - top += range.y; - if (height < 0) { - action = ACTION_SOUTH; - height = -height; - top -= height; - } - if (aspectRatio) { - width = height * aspectRatio; - left += (cropBoxData.width - width) / 2; - } - break; - case ACTION_WEST: - if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) { - renderable = false; - break; - } - check(ACTION_WEST); - width -= range.x; - left += range.x; - if (width < 0) { - action = ACTION_EAST; - width = -width; - left -= width; - } - if (aspectRatio) { - height = width / aspectRatio; - top += (cropBoxData.height - height) / 2; - } - break; - case ACTION_SOUTH: - if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) { - renderable = false; - break; - } - check(ACTION_SOUTH); - height += range.y; - if (height < 0) { - action = ACTION_NORTH; - height = -height; - top -= height; - } - if (aspectRatio) { - width = height * aspectRatio; - left += (cropBoxData.width - width) / 2; - } - break; - case ACTION_NORTH_EAST: - if (aspectRatio) { - if (range.y <= 0 && (top <= minTop || right >= maxWidth)) { - renderable = false; - break; - } - check(ACTION_NORTH); - height -= range.y; - top += range.y; - width = height * aspectRatio; - } else { - check(ACTION_NORTH); - check(ACTION_EAST); - if (range.x >= 0) { - if (right < maxWidth) { - width += range.x; - } else if (range.y <= 0 && top <= minTop) { - renderable = false; - } - } else { - width += range.x; - } - if (range.y <= 0) { - if (top > minTop) { - height -= range.y; - top += range.y; - } - } else { - height -= range.y; - top += range.y; - } - } - if (width < 0 && height < 0) { - action = ACTION_SOUTH_WEST; - height = -height; - width = -width; - top -= height; - left -= width; - } else if (width < 0) { - action = ACTION_NORTH_WEST; - width = -width; - left -= width; - } else if (height < 0) { - action = ACTION_SOUTH_EAST; - height = -height; - top -= height; - } - break; - case ACTION_NORTH_WEST: - if (aspectRatio) { - if (range.y <= 0 && (top <= minTop || left <= minLeft)) { - renderable = false; - break; - } - check(ACTION_NORTH); - height -= range.y; - top += range.y; - width = height * aspectRatio; - left += cropBoxData.width - width; - } else { - check(ACTION_NORTH); - check(ACTION_WEST); - if (range.x <= 0) { - if (left > minLeft) { - width -= range.x; - left += range.x; - } else if (range.y <= 0 && top <= minTop) { - renderable = false; - } - } else { - width -= range.x; - left += range.x; - } - if (range.y <= 0) { - if (top > minTop) { - height -= range.y; - top += range.y; - } - } else { - height -= range.y; - top += range.y; - } - } - if (width < 0 && height < 0) { - action = ACTION_SOUTH_EAST; - height = -height; - width = -width; - top -= height; - left -= width; - } else if (width < 0) { - action = ACTION_NORTH_EAST; - width = -width; - left -= width; - } else if (height < 0) { - action = ACTION_SOUTH_WEST; - height = -height; - top -= height; - } - break; - case ACTION_SOUTH_WEST: - if (aspectRatio) { - if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) { - renderable = false; - break; - } - check(ACTION_WEST); - width -= range.x; - left += range.x; - height = width / aspectRatio; - } else { - check(ACTION_SOUTH); - check(ACTION_WEST); - if (range.x <= 0) { - if (left > minLeft) { - width -= range.x; - left += range.x; - } else if (range.y >= 0 && bottom >= maxHeight) { - renderable = false; - } - } else { - width -= range.x; - left += range.x; - } - if (range.y >= 0) { - if (bottom < maxHeight) { - height += range.y; - } - } else { - height += range.y; - } - } - if (width < 0 && height < 0) { - action = ACTION_NORTH_EAST; - height = -height; - width = -width; - top -= height; - left -= width; - } else if (width < 0) { - action = ACTION_SOUTH_EAST; - width = -width; - left -= width; - } else if (height < 0) { - action = ACTION_NORTH_WEST; - height = -height; - top -= height; - } - break; - case ACTION_SOUTH_EAST: - if (aspectRatio) { - if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) { - renderable = false; - break; - } - check(ACTION_EAST); - width += range.x; - height = width / aspectRatio; - } else { - check(ACTION_SOUTH); - check(ACTION_EAST); - if (range.x >= 0) { - if (right < maxWidth) { - width += range.x; - } else if (range.y >= 0 && bottom >= maxHeight) { - renderable = false; - } - } else { - width += range.x; - } - if (range.y >= 0) { - if (bottom < maxHeight) { - height += range.y; - } - } else { - height += range.y; - } - } - if (width < 0 && height < 0) { - action = ACTION_NORTH_WEST; - height = -height; - width = -width; - top -= height; - left -= width; - } else if (width < 0) { - action = ACTION_SOUTH_WEST; - width = -width; - left -= width; - } else if (height < 0) { - action = ACTION_NORTH_EAST; - height = -height; - top -= height; - } - break; - - // Move canvas - case ACTION_MOVE: - this.move(range.x, range.y); - renderable = false; - break; - - // Zoom canvas - case ACTION_ZOOM: - this.zoom(getMaxZoomRatio(pointers), event); - renderable = false; - break; - - // Create crop box - case ACTION_CROP: - if (!range.x || !range.y) { - renderable = false; - break; - } - offset = getOffset(this.cropper); - left = pointer.startX - offset.left; - top = pointer.startY - offset.top; - width = cropBoxData.minWidth; - height = cropBoxData.minHeight; - if (range.x > 0) { - action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST; - } else if (range.x < 0) { - left -= width; - action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST; - } - if (range.y < 0) { - top -= height; - } - - // Show the crop box if is hidden - if (!this.cropped) { - removeClass(this.cropBox, CLASS_HIDDEN); - this.cropped = true; - if (this.limited) { - this.limitCropBox(true, true); - } - } - break; - } - if (renderable) { - cropBoxData.width = width; - cropBoxData.height = height; - cropBoxData.left = left; - cropBoxData.top = top; - this.action = action; - this.renderCropBox(); - } - - // Override - forEach(pointers, function (p) { - p.startX = p.endX; - p.startY = p.endY; - }); - } - }; - - var methods = { - // Show the crop box manually - crop: function crop() { - if (this.ready && !this.cropped && !this.disabled) { - this.cropped = true; - this.limitCropBox(true, true); - if (this.options.modal) { - addClass(this.dragBox, CLASS_MODAL); - } - removeClass(this.cropBox, CLASS_HIDDEN); - this.setCropBoxData(this.initialCropBoxData); - } - return this; - }, - // Reset the image and crop box to their initial states - reset: function reset() { - if (this.ready && !this.disabled) { - this.imageData = assign({}, this.initialImageData); - this.canvasData = assign({}, this.initialCanvasData); - this.cropBoxData = assign({}, this.initialCropBoxData); - this.renderCanvas(); - if (this.cropped) { - this.renderCropBox(); - } - } - return this; - }, - // Clear the crop box - clear: function clear() { - if (this.cropped && !this.disabled) { - assign(this.cropBoxData, { - left: 0, - top: 0, - width: 0, - height: 0 - }); - this.cropped = false; - this.renderCropBox(); - this.limitCanvas(true, true); - - // Render canvas after crop box rendered - this.renderCanvas(); - removeClass(this.dragBox, CLASS_MODAL); - addClass(this.cropBox, CLASS_HIDDEN); - } - return this; - }, - /** - * Replace the image's src and rebuild the cropper - * @param {string} url - The new URL. - * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one. - * @returns {Cropper} this - */ - replace: function replace(url) { - var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - if (!this.disabled && url) { - if (this.isImg) { - this.element.src = url; - } - if (hasSameSize) { - this.url = url; - this.image.src = url; - if (this.ready) { - this.viewBoxImage.src = url; - forEach(this.previews, function (element) { - element.getElementsByTagName('img')[0].src = url; - }); - } - } else { - if (this.isImg) { - this.replaced = true; - } - this.options.data = null; - this.uncreate(); - this.load(url); - } - } - return this; - }, - // Enable (unfreeze) the cropper - enable: function enable() { - if (this.ready && this.disabled) { - this.disabled = false; - removeClass(this.cropper, CLASS_DISABLED); - } - return this; - }, - // Disable (freeze) the cropper - disable: function disable() { - if (this.ready && !this.disabled) { - this.disabled = true; - addClass(this.cropper, CLASS_DISABLED); - } - return this; - }, - /** - * Destroy the cropper and remove the instance from the image - * @returns {Cropper} this - */ - destroy: function destroy() { - var element = this.element; - if (!element[NAMESPACE]) { - return this; - } - element[NAMESPACE] = undefined; - if (this.isImg && this.replaced) { - element.src = this.originalUrl; - } - this.uncreate(); - return this; - }, - /** - * Move the canvas with relative offsets - * @param {number} offsetX - The relative offset distance on the x-axis. - * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis. - * @returns {Cropper} this - */ - move: function move(offsetX) { - var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX; - var _this$canvasData = this.canvasData, - left = _this$canvasData.left, - top = _this$canvasData.top; - return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY)); - }, - /** - * Move the canvas to an absolute point - * @param {number} x - The x-axis coordinate. - * @param {number} [y=x] - The y-axis coordinate. - * @returns {Cropper} this - */ - moveTo: function moveTo(x) { - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; - var canvasData = this.canvasData; - var changed = false; - x = Number(x); - y = Number(y); - if (this.ready && !this.disabled && this.options.movable) { - if (isNumber(x)) { - canvasData.left = x; - changed = true; - } - if (isNumber(y)) { - canvasData.top = y; - changed = true; - } - if (changed) { - this.renderCanvas(true); - } - } - return this; - }, - /** - * Zoom the canvas with a relative ratio - * @param {number} ratio - The target ratio. - * @param {Event} _originalEvent - The original event if any. - * @returns {Cropper} this - */ - zoom: function zoom(ratio, _originalEvent) { - var canvasData = this.canvasData; - ratio = Number(ratio); - if (ratio < 0) { - ratio = 1 / (1 - ratio); - } else { - ratio = 1 + ratio; - } - return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent); - }, - /** - * Zoom the canvas to an absolute ratio - * @param {number} ratio - The target ratio. - * @param {Object} pivot - The zoom pivot point coordinate. - * @param {Event} _originalEvent - The original event if any. - * @returns {Cropper} this - */ - zoomTo: function zoomTo(ratio, pivot, _originalEvent) { - var options = this.options, - canvasData = this.canvasData; - var width = canvasData.width, - height = canvasData.height, - naturalWidth = canvasData.naturalWidth, - naturalHeight = canvasData.naturalHeight; - ratio = Number(ratio); - if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) { - var newWidth = naturalWidth * ratio; - var newHeight = naturalHeight * ratio; - if (dispatchEvent(this.element, EVENT_ZOOM, { - ratio: ratio, - oldRatio: width / naturalWidth, - originalEvent: _originalEvent - }) === false) { - return this; - } - if (_originalEvent) { - var pointers = this.pointers; - var offset = getOffset(this.cropper); - var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : { - pageX: _originalEvent.pageX, - pageY: _originalEvent.pageY - }; - - // Zoom from the triggering point of the event - canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width); - canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height); - } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) { - canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width); - canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height); - } else { - // Zoom from the center of the canvas - canvasData.left -= (newWidth - width) / 2; - canvasData.top -= (newHeight - height) / 2; - } - canvasData.width = newWidth; - canvasData.height = newHeight; - this.renderCanvas(true); - } - return this; - }, - /** - * Rotate the canvas with a relative degree - * @param {number} degree - The rotate degree. - * @returns {Cropper} this - */ - rotate: function rotate(degree) { - return this.rotateTo((this.imageData.rotate || 0) + Number(degree)); - }, - /** - * Rotate the canvas to an absolute degree - * @param {number} degree - The rotate degree. - * @returns {Cropper} this - */ - rotateTo: function rotateTo(degree) { - degree = Number(degree); - if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) { - this.imageData.rotate = degree % 360; - this.renderCanvas(true, true); - } - return this; - }, - /** - * Scale the image on the x-axis. - * @param {number} scaleX - The scale ratio on the x-axis. - * @returns {Cropper} this - */ - scaleX: function scaleX(_scaleX) { - var scaleY = this.imageData.scaleY; - return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1); - }, - /** - * Scale the image on the y-axis. - * @param {number} scaleY - The scale ratio on the y-axis. - * @returns {Cropper} this - */ - scaleY: function scaleY(_scaleY) { - var scaleX = this.imageData.scaleX; - return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY); - }, - /** - * Scale the image - * @param {number} scaleX - The scale ratio on the x-axis. - * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis. - * @returns {Cropper} this - */ - scale: function scale(scaleX) { - var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX; - var imageData = this.imageData; - var transformed = false; - scaleX = Number(scaleX); - scaleY = Number(scaleY); - if (this.ready && !this.disabled && this.options.scalable) { - if (isNumber(scaleX)) { - imageData.scaleX = scaleX; - transformed = true; - } - if (isNumber(scaleY)) { - imageData.scaleY = scaleY; - transformed = true; - } - if (transformed) { - this.renderCanvas(true, true); - } - } - return this; - }, - /** - * Get the cropped area position and size data (base on the original image) - * @param {boolean} [rounded=false] - Indicate if round the data values or not. - * @returns {Object} The result cropped data. - */ - getData: function getData() { - var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var options = this.options, - imageData = this.imageData, - canvasData = this.canvasData, - cropBoxData = this.cropBoxData; - var data; - if (this.ready && this.cropped) { - data = { - x: cropBoxData.left - canvasData.left, - y: cropBoxData.top - canvasData.top, - width: cropBoxData.width, - height: cropBoxData.height - }; - var ratio = imageData.width / imageData.naturalWidth; - forEach(data, function (n, i) { - data[i] = n / ratio; - }); - if (rounded) { - // In case rounding off leads to extra 1px in right or bottom border - // we should round the top-left corner and the dimension (#343). - var bottom = Math.round(data.y + data.height); - var right = Math.round(data.x + data.width); - data.x = Math.round(data.x); - data.y = Math.round(data.y); - data.width = right - data.x; - data.height = bottom - data.y; - } - } else { - data = { - x: 0, - y: 0, - width: 0, - height: 0 - }; - } - if (options.rotatable) { - data.rotate = imageData.rotate || 0; - } - if (options.scalable) { - data.scaleX = imageData.scaleX || 1; - data.scaleY = imageData.scaleY || 1; - } - return data; - }, - /** - * Set the cropped area position and size with new data - * @param {Object} data - The new data. - * @returns {Cropper} this - */ - setData: function setData(data) { - var options = this.options, - imageData = this.imageData, - canvasData = this.canvasData; - var cropBoxData = {}; - if (this.ready && !this.disabled && isPlainObject(data)) { - var transformed = false; - if (options.rotatable) { - if (isNumber(data.rotate) && data.rotate !== imageData.rotate) { - imageData.rotate = data.rotate; - transformed = true; - } - } - if (options.scalable) { - if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) { - imageData.scaleX = data.scaleX; - transformed = true; - } - if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) { - imageData.scaleY = data.scaleY; - transformed = true; - } - } - if (transformed) { - this.renderCanvas(true, true); - } - var ratio = imageData.width / imageData.naturalWidth; - if (isNumber(data.x)) { - cropBoxData.left = data.x * ratio + canvasData.left; - } - if (isNumber(data.y)) { - cropBoxData.top = data.y * ratio + canvasData.top; - } - if (isNumber(data.width)) { - cropBoxData.width = data.width * ratio; - } - if (isNumber(data.height)) { - cropBoxData.height = data.height * ratio; - } - this.setCropBoxData(cropBoxData); - } - return this; - }, - /** - * Get the container size data. - * @returns {Object} The result container data. - */ - getContainerData: function getContainerData() { - return this.ready ? assign({}, this.containerData) : {}; - }, - /** - * Get the image position and size data. - * @returns {Object} The result image data. - */ - getImageData: function getImageData() { - return this.sized ? assign({}, this.imageData) : {}; - }, - /** - * Get the canvas position and size data. - * @returns {Object} The result canvas data. - */ - getCanvasData: function getCanvasData() { - var canvasData = this.canvasData; - var data = {}; - if (this.ready) { - forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) { - data[n] = canvasData[n]; - }); - } - return data; - }, - /** - * Set the canvas position and size with new data. - * @param {Object} data - The new canvas data. - * @returns {Cropper} this - */ - setCanvasData: function setCanvasData(data) { - var canvasData = this.canvasData; - var aspectRatio = canvasData.aspectRatio; - if (this.ready && !this.disabled && isPlainObject(data)) { - if (isNumber(data.left)) { - canvasData.left = data.left; - } - if (isNumber(data.top)) { - canvasData.top = data.top; - } - if (isNumber(data.width)) { - canvasData.width = data.width; - canvasData.height = data.width / aspectRatio; - } else if (isNumber(data.height)) { - canvasData.height = data.height; - canvasData.width = data.height * aspectRatio; - } - this.renderCanvas(true); - } - return this; - }, - /** - * Get the crop box position and size data. - * @returns {Object} The result crop box data. - */ - getCropBoxData: function getCropBoxData() { - var cropBoxData = this.cropBoxData; - var data; - if (this.ready && this.cropped) { - data = { - left: cropBoxData.left, - top: cropBoxData.top, - width: cropBoxData.width, - height: cropBoxData.height - }; - } - return data || {}; - }, - /** - * Set the crop box position and size with new data. - * @param {Object} data - The new crop box data. - * @returns {Cropper} this - */ - setCropBoxData: function setCropBoxData(data) { - var cropBoxData = this.cropBoxData; - var aspectRatio = this.options.aspectRatio; - var widthChanged; - var heightChanged; - if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) { - if (isNumber(data.left)) { - cropBoxData.left = data.left; - } - if (isNumber(data.top)) { - cropBoxData.top = data.top; - } - if (isNumber(data.width) && data.width !== cropBoxData.width) { - widthChanged = true; - cropBoxData.width = data.width; - } - if (isNumber(data.height) && data.height !== cropBoxData.height) { - heightChanged = true; - cropBoxData.height = data.height; - } - if (aspectRatio) { - if (widthChanged) { - cropBoxData.height = cropBoxData.width / aspectRatio; - } else if (heightChanged) { - cropBoxData.width = cropBoxData.height * aspectRatio; - } - } - this.renderCropBox(); - } - return this; - }, - /** - * Get a canvas drawn the cropped image. - * @param {Object} [options={}] - The config options. - * @returns {HTMLCanvasElement} - The result canvas. - */ - getCroppedCanvas: function getCroppedCanvas() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - if (!this.ready || !window.HTMLCanvasElement) { - return null; - } - var canvasData = this.canvasData; - var source = getSourceCanvas(this.image, this.imageData, canvasData, options); - - // Returns the source canvas if it is not cropped. - if (!this.cropped) { - return source; - } - var _this$getData = this.getData(options.rounded), - initialX = _this$getData.x, - initialY = _this$getData.y, - initialWidth = _this$getData.width, - initialHeight = _this$getData.height; - var ratio = source.width / Math.floor(canvasData.naturalWidth); - if (ratio !== 1) { - initialX *= ratio; - initialY *= ratio; - initialWidth *= ratio; - initialHeight *= ratio; - } - var aspectRatio = initialWidth / initialHeight; - var maxSizes = getAdjustedSizes({ - aspectRatio: aspectRatio, - width: options.maxWidth || Infinity, - height: options.maxHeight || Infinity - }); - var minSizes = getAdjustedSizes({ - aspectRatio: aspectRatio, - width: options.minWidth || 0, - height: options.minHeight || 0 - }, 'cover'); - var _getAdjustedSizes = getAdjustedSizes({ - aspectRatio: aspectRatio, - width: options.width || (ratio !== 1 ? source.width : initialWidth), - height: options.height || (ratio !== 1 ? source.height : initialHeight) - }), - width = _getAdjustedSizes.width, - height = _getAdjustedSizes.height; - width = Math.min(maxSizes.width, Math.max(minSizes.width, width)); - height = Math.min(maxSizes.height, Math.max(minSizes.height, height)); - var canvas = document.createElement('canvas'); - var context = canvas.getContext('2d'); - canvas.width = normalizeDecimalNumber(width); - canvas.height = normalizeDecimalNumber(height); - context.fillStyle = options.fillColor || 'transparent'; - context.fillRect(0, 0, width, height); - var _options$imageSmoothi = options.imageSmoothingEnabled, - imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi, - imageSmoothingQuality = options.imageSmoothingQuality; - context.imageSmoothingEnabled = imageSmoothingEnabled; - if (imageSmoothingQuality) { - context.imageSmoothingQuality = imageSmoothingQuality; - } - - // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage - var sourceWidth = source.width; - var sourceHeight = source.height; - - // Source canvas parameters - var srcX = initialX; - var srcY = initialY; - var srcWidth; - var srcHeight; - - // Destination canvas parameters - var dstX; - var dstY; - var dstWidth; - var dstHeight; - if (srcX <= -initialWidth || srcX > sourceWidth) { - srcX = 0; - srcWidth = 0; - dstX = 0; - dstWidth = 0; - } else if (srcX <= 0) { - dstX = -srcX; - srcX = 0; - srcWidth = Math.min(sourceWidth, initialWidth + srcX); - dstWidth = srcWidth; - } else if (srcX <= sourceWidth) { - dstX = 0; - srcWidth = Math.min(initialWidth, sourceWidth - srcX); - dstWidth = srcWidth; - } - if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) { - srcY = 0; - srcHeight = 0; - dstY = 0; - dstHeight = 0; - } else if (srcY <= 0) { - dstY = -srcY; - srcY = 0; - srcHeight = Math.min(sourceHeight, initialHeight + srcY); - dstHeight = srcHeight; - } else if (srcY <= sourceHeight) { - dstY = 0; - srcHeight = Math.min(initialHeight, sourceHeight - srcY); - dstHeight = srcHeight; - } - var params = [srcX, srcY, srcWidth, srcHeight]; - - // Avoid "IndexSizeError" - if (dstWidth > 0 && dstHeight > 0) { - var scale = width / initialWidth; - params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale); - } - - // All the numerical parameters should be integer for `drawImage` - // https://github.com/fengyuanchen/cropper/issues/476 - context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) { - return Math.floor(normalizeDecimalNumber(param)); - })))); - return canvas; - }, - /** - * Change the aspect ratio of the crop box. - * @param {number} aspectRatio - The new aspect ratio. - * @returns {Cropper} this - */ - setAspectRatio: function setAspectRatio(aspectRatio) { - var options = this.options; - if (!this.disabled && !isUndefined(aspectRatio)) { - // 0 -> NaN - options.aspectRatio = Math.max(0, aspectRatio) || NaN; - if (this.ready) { - this.initCropBox(); - if (this.cropped) { - this.renderCropBox(); - } - } - } - return this; - }, - /** - * Change the drag mode. - * @param {string} mode - The new drag mode. - * @returns {Cropper} this - */ - setDragMode: function setDragMode(mode) { - var options = this.options, - dragBox = this.dragBox, - face = this.face; - if (this.ready && !this.disabled) { - var croppable = mode === DRAG_MODE_CROP; - var movable = options.movable && mode === DRAG_MODE_MOVE; - mode = croppable || movable ? mode : DRAG_MODE_NONE; - options.dragMode = mode; - setData(dragBox, DATA_ACTION, mode); - toggleClass(dragBox, CLASS_CROP, croppable); - toggleClass(dragBox, CLASS_MOVE, movable); - if (!options.cropBoxMovable) { - // Sync drag mode to crop box when it is not movable - setData(face, DATA_ACTION, mode); - toggleClass(face, CLASS_CROP, croppable); - toggleClass(face, CLASS_MOVE, movable); - } - } - return this; - } - }; - - var AnotherCropper = WINDOW.Cropper; - var Cropper = /*#__PURE__*/function () { - /** - * Create a new Cropper. - * @param {Element} element - The target element for cropping. - * @param {Object} [options={}] - The configuration options. - */ - function Cropper(element) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - _classCallCheck(this, Cropper); - if (!element || !REGEXP_TAG_NAME.test(element.tagName)) { - throw new Error('The first argument is required and must be an or element.'); - } - this.element = element; - this.options = assign({}, DEFAULTS, isPlainObject(options) && options); - this.cropped = false; - this.disabled = false; - this.pointers = {}; - this.ready = false; - this.reloading = false; - this.replaced = false; - this.sized = false; - this.sizing = false; - this.init(); - } - _createClass(Cropper, [{ - key: "init", - value: function init() { - var element = this.element; - var tagName = element.tagName.toLowerCase(); - var url; - if (element[NAMESPACE]) { - return; - } - element[NAMESPACE] = this; - if (tagName === 'img') { - this.isImg = true; - - // e.g.: "img/picture.jpg" - url = element.getAttribute('src') || ''; - this.originalUrl = url; - - // Stop when it's a blank image - if (!url) { - return; - } - - // e.g.: "https://example.com/img/picture.jpg" - url = element.src; - } else if (tagName === 'canvas' && window.HTMLCanvasElement) { - url = element.toDataURL(); - } - this.load(url); - } - }, { - key: "load", - value: function load(url) { - var _this = this; - if (!url) { - return; - } - this.url = url; - this.imageData = {}; - var element = this.element, - options = this.options; - if (!options.rotatable && !options.scalable) { - options.checkOrientation = false; - } - - // Only IE10+ supports Typed Arrays - if (!options.checkOrientation || !window.ArrayBuffer) { - this.clone(); - return; - } - - // Detect the mime type of the image directly if it is a Data URL - if (REGEXP_DATA_URL.test(url)) { - // Read ArrayBuffer from Data URL of JPEG images directly for better performance - if (REGEXP_DATA_URL_JPEG.test(url)) { - this.read(dataURLToArrayBuffer(url)); - } else { - // Only a JPEG image may contains Exif Orientation information, - // the rest types of Data URLs are not necessary to check orientation at all. - this.clone(); - } - return; - } - - // 1. Detect the mime type of the image by a XMLHttpRequest. - // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image. - var xhr = new XMLHttpRequest(); - var clone = this.clone.bind(this); - this.reloading = true; - this.xhr = xhr; - - // 1. Cross origin requests are only supported for protocol schemes: - // http, https, data, chrome, chrome-extension. - // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy - // in some browsers as IE11 and Safari. - xhr.onabort = clone; - xhr.onerror = clone; - xhr.ontimeout = clone; - xhr.onprogress = function () { - // Abort the request directly if it not a JPEG image for better performance - if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) { - xhr.abort(); - } - }; - xhr.onload = function () { - _this.read(xhr.response); - }; - xhr.onloadend = function () { - _this.reloading = false; - _this.xhr = null; - }; - - // Bust cache when there is a "crossOrigin" property to avoid browser cache error - if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) { - url = addTimestamp(url); - } - - // The third parameter is required for avoiding side-effect (#682) - xhr.open('GET', url, true); - xhr.responseType = 'arraybuffer'; - xhr.withCredentials = element.crossOrigin === 'use-credentials'; - xhr.send(); - } - }, { - key: "read", - value: function read(arrayBuffer) { - var options = this.options, - imageData = this.imageData; - - // Reset the orientation value to its default value 1 - // as some iOS browsers will render image with its orientation - var orientation = resetAndGetOrientation(arrayBuffer); - var rotate = 0; - var scaleX = 1; - var scaleY = 1; - if (orientation > 1) { - // Generate a new URL which has the default orientation value - this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG); - var _parseOrientation = parseOrientation(orientation); - rotate = _parseOrientation.rotate; - scaleX = _parseOrientation.scaleX; - scaleY = _parseOrientation.scaleY; - } - if (options.rotatable) { - imageData.rotate = rotate; - } - if (options.scalable) { - imageData.scaleX = scaleX; - imageData.scaleY = scaleY; - } - this.clone(); - } - }, { - key: "clone", - value: function clone() { - var element = this.element, - url = this.url; - var crossOrigin = element.crossOrigin; - var crossOriginUrl = url; - if (this.options.checkCrossOrigin && isCrossOriginURL(url)) { - if (!crossOrigin) { - crossOrigin = 'anonymous'; - } - - // Bust cache when there is not a "crossOrigin" property (#519) - crossOriginUrl = addTimestamp(url); - } - this.crossOrigin = crossOrigin; - this.crossOriginUrl = crossOriginUrl; - var image = document.createElement('img'); - if (crossOrigin) { - image.crossOrigin = crossOrigin; - } - image.src = crossOriginUrl || url; - image.alt = element.alt || 'The image to crop'; - this.image = image; - image.onload = this.start.bind(this); - image.onerror = this.stop.bind(this); - addClass(image, CLASS_HIDE); - element.parentNode.insertBefore(image, element.nextSibling); - } - }, { - key: "start", - value: function start() { - var _this2 = this; - var image = this.image; - image.onload = null; - image.onerror = null; - this.sizing = true; - - // Match all browsers that use WebKit as the layout engine in iOS devices, - // such as Safari for iOS, Chrome for iOS, and in-app browsers. - var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent); - var done = function done(naturalWidth, naturalHeight) { - assign(_this2.imageData, { - naturalWidth: naturalWidth, - naturalHeight: naturalHeight, - aspectRatio: naturalWidth / naturalHeight - }); - _this2.initialImageData = assign({}, _this2.imageData); - _this2.sizing = false; - _this2.sized = true; - _this2.build(); - }; - - // Most modern browsers (excepts iOS WebKit) - if (image.naturalWidth && !isIOSWebKit) { - done(image.naturalWidth, image.naturalHeight); - return; - } - var sizingImage = document.createElement('img'); - var body = document.body || document.documentElement; - this.sizingImage = sizingImage; - sizingImage.onload = function () { - done(sizingImage.width, sizingImage.height); - if (!isIOSWebKit) { - body.removeChild(sizingImage); - } - }; - sizingImage.src = image.src; - - // iOS WebKit will convert the image automatically - // with its orientation once append it into DOM (#279) - if (!isIOSWebKit) { - sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;'; - body.appendChild(sizingImage); - } - } - }, { - key: "stop", - value: function stop() { - var image = this.image; - image.onload = null; - image.onerror = null; - image.parentNode.removeChild(image); - this.image = null; - } - }, { - key: "build", - value: function build() { - if (!this.sized || this.ready) { - return; - } - var element = this.element, - options = this.options, - image = this.image; - - // Create cropper elements - var container = element.parentNode; - var template = document.createElement('div'); - template.innerHTML = TEMPLATE; - var cropper = template.querySelector(".".concat(NAMESPACE, "-container")); - var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas")); - var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box")); - var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box")); - var face = cropBox.querySelector(".".concat(NAMESPACE, "-face")); - this.container = container; - this.cropper = cropper; - this.canvas = canvas; - this.dragBox = dragBox; - this.cropBox = cropBox; - this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box")); - this.face = face; - canvas.appendChild(image); - - // Hide the original image - addClass(element, CLASS_HIDDEN); - - // Inserts the cropper after to the current image - container.insertBefore(cropper, element.nextSibling); - - // Show the hidden image - removeClass(image, CLASS_HIDE); - this.initPreview(); - this.bind(); - options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN; - options.aspectRatio = Math.max(0, options.aspectRatio) || NaN; - options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0; - addClass(cropBox, CLASS_HIDDEN); - if (!options.guides) { - addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN); - } - if (!options.center) { - addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN); - } - if (options.background) { - addClass(cropper, "".concat(NAMESPACE, "-bg")); - } - if (!options.highlight) { - addClass(face, CLASS_INVISIBLE); - } - if (options.cropBoxMovable) { - addClass(face, CLASS_MOVE); - setData(face, DATA_ACTION, ACTION_ALL); - } - if (!options.cropBoxResizable) { - addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN); - addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN); - } - this.render(); - this.ready = true; - this.setDragMode(options.dragMode); - if (options.autoCrop) { - this.crop(); - } - this.setData(options.data); - if (isFunction(options.ready)) { - addListener(element, EVENT_READY, options.ready, { - once: true - }); - } - dispatchEvent(element, EVENT_READY); - } - }, { - key: "unbuild", - value: function unbuild() { - if (!this.ready) { - return; - } - this.ready = false; - this.unbind(); - this.resetPreview(); - var parentNode = this.cropper.parentNode; - if (parentNode) { - parentNode.removeChild(this.cropper); - } - removeClass(this.element, CLASS_HIDDEN); - } - }, { - key: "uncreate", - value: function uncreate() { - if (this.ready) { - this.unbuild(); - this.ready = false; - this.cropped = false; - } else if (this.sizing) { - this.sizingImage.onload = null; - this.sizing = false; - this.sized = false; - } else if (this.reloading) { - this.xhr.onabort = null; - this.xhr.abort(); - } else if (this.image) { - this.stop(); - } - } - - /** - * Get the no conflict cropper class. - * @returns {Cropper} The cropper class. - */ - }], [{ - key: "noConflict", - value: function noConflict() { - window.Cropper = AnotherCropper; - return Cropper; - } - - /** - * Change the default options. - * @param {Object} options - The new default options. - */ - }, { - key: "setDefaults", - value: function setDefaults(options) { - assign(DEFAULTS, isPlainObject(options) && options); - } - }]); - return Cropper; - }(); - assign(Cropper.prototype, render, preview, events, handlers, change, methods); - - return Cropper; - -})); diff --git a/assets/js/um-crop.min.js b/assets/js/um-crop.min.js deleted file mode 100644 index 3a8ae9f4..00000000 --- a/assets/js/um-crop.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(n){"use strict";function r(t){return"number"==typeof t}function s(t,i){var e=[];return"number"==typeof i&&e.push(i),e.slice.apply(t,e)}function i(t,i){var e=s(arguments,2);return function(){return t.apply(i,e.concat(s(arguments)))}}function o(t,i){this.element=t,this.$element=n(t),this.defaults=n.extend({},o.DEFAULTS,n.isPlainObject(i)?i:{}),this.$original=g,this.ready=D,this.built=D,this.cropped=D,this.rotated=D,this.disabled=D,this.replaced=D,this.init()}var e,h=n(window),a=n(document),d=window.location,$=!0,D=!1,g=null,l="undefined",p="directive",t=".cropper",E=/^(e|n|w|s|ne|nw|sw|se|all|crop|move|zoom)$/,_=/^(x|y|width|height)$/,P=/^(naturalWidth|naturalHeight|width|height|aspectRatio|ratio|rotate)$/,c="cropper-modal",W="cropper-hidden",m="cropper-invisible",f="cropper-crop",u="cropper-disabled",w="mousedown touchstart",v="mousemove touchmove",x="mouseup mouseleave touchend touchleave touchcancel",b="wheel mousewheel DOMMouseScroll",y="resize"+t,H="dblclick",C="build"+t,k="built"+t,R="dragstart"+t,z="dragmove"+t,L="dragend"+t,Y=Math.sqrt,X=Math.min,M=Math.max,T=Math.abs,O=Math.sin,U=Math.cos,I=parseFloat;o.prototype={constructor:o,support:{canvas:n.isFunction(n("")[0].getContext)},init:function(){var e=this.defaults;n.each(e,function(t,i){switch(t){case"aspectRatio":e[t]=T(I(i))||NaN;break;case"autoCropArea":e[t]=T(I(i))||.8;break;case"minWidth":case"minHeight":e[t]=T(I(i))||0;break;case"maxWidth":case"maxHeight":e[t]=T(I(i))||1/0}}),this.image={rotate:0},this.load()},load:function(){var t,i,e=this,h=this.$element,a=this.element,s=this.image,r="";h.is("img")?i=h.prop("src"):h.is("canvas")&&this.support.canvas&&(i=a.toDataURL()),i&&(this.replaced&&(s.rotate=0),this.defaults.checkImageOrigin&&(h.prop("crossOrigin")||this.isCrossOriginURL(i))&&(r=" crossOrigin"),this.$clone=t=n("'),t.one("load",function(){s.naturalWidth=this.naturalWidth||t.width(),s.naturalHeight=this.naturalHeight||t.height(),s.aspectRatio=s.naturalWidth/s.naturalHeight,e.url=i,e.ready=$,e.build()}),t.addClass(m).prependTo("body"))},isCrossOriginURL:function(t){t=t.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return!t||t[1]===d.protocol&&t[2]===d.hostname&&t[3]===d.port?D:$},build:function(){var t,i=this.$element,e=this.defaults;this.ready&&(this.built&&this.unbuild(),i.one(C,e.build),t=n.Event(C),i.trigger(t),t.isDefaultPrevented()||(this.$cropper=t=n(o.TEMPLATE),i.addClass(W),this.$clone.removeClass(m).prependTo(t),this.rotated||(this.$original=this.$clone.clone(),this.$original.addClass(W).prependTo(this.$cropper),this.originalImage=n.extend({},this.image)),this.$container=i.parent(),this.$container.append(t),this.$canvas=t.find(".cropper-canvas"),this.$dragger=t.find(".cropper-dragger"),this.$viewer=t.find(".cropper-viewer"),e.autoCrop?this.cropped=$:this.$dragger.addClass(W),e.dragCrop&&this.setDragMode("crop"),e.modal&&this.$canvas.addClass(c),e.dashed||this.$dragger.find(".cropper-dashed").addClass(W),e.movable||this.$dragger.find(".cropper-face").data(p,"move"),e.resizable||this.$dragger.find(".cropper-line, .cropper-point").addClass(W),this.addListeners(),this.initPreview(),this.built=$,this.update(),this.replaced=D,i.one(k,e.built),i.trigger(k)))},unbuild:function(){this.built&&(this.built=D,this.removeListeners(),this.$preview.empty(),this.$preview=g,this.$dragger=g,this.$canvas=g,this.$container=g,this.$cropper.remove(),this.$cropper=g)},update:function(t){this.initContainer(),this.initCropper(),this.initImage(),this.initDragger(),t?(this.setData(t,$),this.setDragMode("crop")):this.setData(this.defaults.data)},resize:function(){clearTimeout(this.resizing),this.resizing=setTimeout(n.proxy(this.update,this,this.getData()),200)},preview:function(){var t=this.image,e=this.dragger,h=t.width,a=t.height,s=e.left-t.left,r=e.top-t.top;this.$viewer.find("img").css({width:h,height:a,marginLeft:-s,marginTop:-r}),this.$preview.each(function(){var t=n(this),i=t.width()/e.width;t.find("img").css({width:h*i,height:a*i,marginLeft:-s*i,marginTop:-r*i})})},addListeners:function(){var t=this.defaults;this.$element.on(R,t.dragstart).on(z,t.dragmove).on(L,t.dragend),this.$cropper.on(w,n.proxy(this.dragstart,this)).on(H,n.proxy(this.dblclick,this)),t.zoomable&&this.$cropper.on(b,n.proxy(this.wheel,this)),t.multiple?this.$cropper.on(v,n.proxy(this.dragmove,this)).on(x,n.proxy(this.dragend,this)):a.on(v,this._dragmove=i(this.dragmove,this)).on(x,this._dragend=i(this.dragend,this)),h.on(y,this._resize=i(this.resize,this))},removeListeners:function(){var t=this.defaults;this.$element.off(R,t.dragstart).off(z,t.dragmove).off(L,t.dragend),this.$cropper.off(w,this.dragstart).off(H,this.dblclick),t.zoomable&&this.$cropper.off(b,this.wheel),t.multiple?this.$cropper.off(v,this.dragmove).off(x,this.dragend):a.off(v,this._dragmove).off(x,this._dragend),h.off(y,this._resize)},initPreview:function(){var t='';this.$preview=n(this.defaults.preview),this.$viewer.html(t),this.$preview.html(t).find("img").css("cssText","min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;")},initContainer:function(){var t=this.$container;t!==g&&(this.container={width:M(t.width(),300),height:M(t.height(),150)})},initCropper:function(){var t,i=this.container,e=this.image;0<=e.naturalWidth*i.height/e.naturalHeight-i.width?(t={width:i.width,height:i.width/e.aspectRatio,left:0}).top=(i.height-t.height)/2:(t={width:i.height*e.aspectRatio,height:i.height,top:0}).left=(i.width-t.width)/2,this.$cropper&&this.$cropper.css({width:t.width,height:t.height,left:t.left,top:t.top}),this.cropper=t},initImage:function(){var t=this.image,i=this.cropper,e={_width:i.width,_height:i.height,width:i.width,height:i.height,left:0,top:0,ratio:i.width/t.naturalWidth};this.defaultImage=n.extend({},t,e),t._width!==i.width||t._height!==i.height?n.extend(t,e):(t=n.extend({},e,t),this.replaced&&(t.ratio=e.ratio)),this.image=t,this.renderImage()},renderImage:function(t){var i=this.image;"zoom"===t&&(i.left-=(i.width-i.oldWidth)/2,i.top-=(i.height-i.oldHeight)/2),i.left=X(M(i.left,i._width-i.width),0),i.top=X(M(i.top,i._height-i.height),0),this.$clone.css({width:i.width,height:i.height,marginLeft:i.left,marginTop:i.top}),t&&(this.defaults.done(this.getData()),this.preview())},initDragger:function(){var t=this.defaults,i=this.cropper,e=t.aspectRatio||this.image.aspectRatio,h=this.image.ratio,a=0<=i.height*e-i.width?{height:i.width/e,width:i.width,left:0,top:(i.height-i.width/e)/2,maxWidth:i.width,maxHeight:i.width/e}:{height:i.height,width:i.height*e,left:(i.width-i.height*e)/2,top:0,maxWidth:i.height*e,maxHeight:i.height};a.minWidth=0,a.minHeight=0,t.aspectRatio?(isFinite(t.maxWidth)?(a.maxWidth=X(a.maxWidth,t.maxWidth*h),a.maxHeight=a.maxWidth/e):isFinite(t.maxHeight)&&(a.maxHeight=X(a.maxHeight,t.maxHeight*h),a.maxWidth=a.maxHeight*e),0t.maxWidth?(t.width=t.maxWidth,t.left=t.oldLeft):t.widtht.maxHeight?(t.height=t.maxHeight,t.top=t.oldTop):t.height').one("load",function(){s.width=this.width,s.height=this.height,e.clearRect(0,0,s.width,s.height),e.drawImage(this,0,0),h.load()})))},setData:function(t,i){var e=this.cropper,h=this.dragger,a=this.image,s=this.defaults.aspectRatio;this.built&&typeof t!=l&&(t!==g&&!n.isEmptyObject(t)||(h=n.extend({},this.defaultDragger)),n.isPlainObject(t)&&!n.isEmptyObject(t)&&(i||(this.defaults.data=t),t=this.transformData(t),r(t.x)&&t.x<=e.width-a.left&&(h.left=t.x+a.left),r(t.y)&&t.y<=e.height-a.top&&(h.top=t.y+a.top),s?r(t.width)&&t.width<=h.maxWidth&&t.width>=h.minWidth?(h.width=t.width,h.height=h.width/s):r(t.height)&&t.height<=h.maxHeight&&t.height>=h.minHeight&&(h.height=t.height,h.width=h.height*s):(r(t.width)&&t.width<=h.maxWidth&&t.width>=h.minWidth&&(h.width=t.width),r(t.height)&&t.height<=h.maxHeight&&t.height>=h.minHeight&&(h.height=t.height))),this.dragger=h,this.renderDragger())},getData:function(t){var i=this.dragger,e=this.image,h={};return this.built&&(h={x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height},h=this.transformData(h,$,t)),h},transformData:function(t,e,h){var a=this.image.ratio,s={};return n.each(t,function(t,i){i=I(i),_.test(t)&&!isNaN(i)&&(s[t]=e?h?Math.round(i/a):i/a:i*a)}),s},setAspectRatio:function(t){var i="auto"===t;t=I(t),(i||!isNaN(t)&&0")[0],s=this.getData(),r="";return n.isPlainObject(t)||(e=i,i=t,t={}),t=n.extend({width:s.width,height:s.height},t),this.cropped&&this.support.canvas&&(a.width=t.width,a.height=t.height,h=a.getContext("2d"),"image/jpeg"===i&&(h.fillStyle="#fff",h.fillRect(0,0,t.width,t.height)),h.drawImage(this.$clone[0],s.x,s.y,s.width,s.height,0,0,t.width,t.height),r=a.toDataURL(i,e)),r},setDragMode:function(t){var i=this.$canvas,e=this.defaults,h=D,a=D;if(this.built&&!this.disabled){switch(t){case"crop":e.dragCrop&&(h=$,i.data(p,t));break;case"move":a=$,i.data(p,t);break;default:i.removeData(p)}i.toggleClass(f,h).toggleClass("cropper-move",a)}},enable:function(){this.built&&(this.disabled=D,this.$cropper.removeClass(u))},disable:function(){this.built&&(this.disabled=$,this.$cropper.addClass(u))},rotate:function(t){var i=this.image;t=I(t)||0,this.built&&0!==t&&!this.disabled&&this.defaults.rotatable&&this.support.canvas&&(this.rotated=$,t=i.rotate=(i.rotate+t)%360,this.replace(this.getRotatedDataURL(t),!0))},getRotatedDataURL:function(t){var i=n("")[0],e=i.getContext("2d"),h=t*Math.PI/180,t=T(t)%180,t=(90<0 6="5-canvas"><0 6="5-dragger"><1 6="5-viewer"><1 6="5-8 8-h"><1 6="5-8 8-v"><1 6="5-face" 3-2="all"><1 6="5-7 7-e" 3-2="e"><1 6="5-7 7-n" 3-2="n"><1 6="5-7 7-w" 3-2="w"><1 6="5-7 7-s" 3-2="s"><1 6="5-4 4-e" 3-2="e"><1 6="5-4 4-n" 3-2="n"><1 6="5-4 4-w" 3-2="w"><1 6="5-4 4-s" 3-2="s"><1 6="5-4 4-ne" 3-2="ne"><1 6="5-4 4-nw" 3-2="nw"><1 6="5-4 4-sw" 3-2="sw"><1 6="5-4 4-se" 3-2="se">'.replace(/\d+/g,function(t){return e[t]})),o.DEFAULTS={aspectRatio:"auto",autoCropArea:.8,data:{},done:n.noop,preview:"",multiple:D,autoCrop:$,dragCrop:$,dashed:$,modal:$,movable:$,resizable:$,zoomable:$,rotatable:$,checkImageOrigin:$,minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,build:g,built:g,dragstart:g,dragmove:g,dragend:g},o.setDefaults=function(t){n.extend(o.DEFAULTS,t)},o.other=n.fn.cropper,n.fn.cropper=function(e){var h,a=s(arguments,1);return this.each(function(){var t=n(this),i=t.data("cropper");i||t.data("cropper",i=new o(this,e)),"string"==typeof e&&n.isFunction(t=i[e])&&(h=t.apply(i,a))}),typeof h!=l?h:this},n.fn.cropper.Constructor=o,n.fn.cropper.setDefaults=o.setDefaults,n.fn.cropper.noConflict=function(){return n.fn.cropper=o.other,this}}); \ No newline at end of file diff --git a/assets/js/um-functions.js b/assets/js/um-functions.js index 8ea4d3bd..f3e0fb54 100644 --- a/assets/js/um-functions.js +++ b/assets/js/um-functions.js @@ -498,90 +498,6 @@ function initFileUpload_UM( trigger ) { } -function initCrop_UM() { - - var target_img = jQuery('.um-modal .um-single-image-preview img').first(); - var target_img_parent = jQuery('.um-modal .um-single-image-preview'); - - var crop_data = target_img.parent().attr('data-crop'); - var min_width = target_img.parent().attr('data-min_width'); - var min_height = target_img.parent().attr('data-min_height'); - var ratio = target_img.parent().attr('data-ratio'); - - if ( jQuery('.um-modal').find('#um_upload_single').attr('data-ratio') ) { - var ratio = jQuery('.um-modal').find('#um_upload_single').attr('data-ratio'); - var ratio_split = ratio.split(':'); - var ratio = ratio_split[0]; - } - - if ( target_img.length ) { - - if ( target_img.attr('src') != '' ) { - - var max_height = jQuery(window).height() - ( jQuery('.um-modal-footer a').height() + 20 ) - 50 - ( jQuery('.um-modal-header:visible').height() ); - target_img.css({'height' : 'auto'}); - target_img_parent.css({'height' : 'auto'}); - if ( jQuery(window).height() <= 400 ) { - target_img_parent.css({ 'height': max_height +'px', 'max-height' : max_height + 'px' }); - target_img.css({ 'height' : 'auto' }); - } else { - target_img.css({ 'height': 'auto', 'max-height' : max_height + 'px' }); - target_img_parent.css({ 'height': target_img.height(), 'max-height' : max_height + 'px' }); - } - - if ( crop_data == 'square' ) { - - var opts = { - minWidth: min_width, - minHeight: min_height, - dragCrop: false, - aspectRatio: 1.0, - zoomable: false, - rotatable: false, - dashed: false, - }; - - } else if ( crop_data == 'cover' ) { - if( Math.round( min_width / ratio ) > 0 ){ - min_height = Math.round( min_width / ratio ) - } - var opts = { - minWidth: min_width, - minHeight: min_height, - dragCrop: false, - aspectRatio: ratio, - zoomable: false, - rotatable: false, - dashed: false, - }; - - } else if ( crop_data == 'user' ) { - - var opts = { - minWidth: min_width, - minHeight: min_height, - dragCrop: true, - aspectRatio: "auto", - zoomable: false, - rotatable: false, - dashed: false, - }; - - } - - if ( crop_data != 0 ) { - cropper = new Cropper(target_img[0], opts); - - jQuery('.um-single-image-preview img.lazyloaded').addClass('cropper-hidden'); - jQuery('.um-single-image-preview img.lazyloaded').removeClass('lazyloaded'); - jQuery('.um-single-image-preview .cropper-container').append('
'); - } - - } - } - -} - function um_new_modal( id, size, isPhoto, source ) { var modalOverlay = jQuery('.um-modal-overlay'); if ( modalOverlay.length !== 0 ) { @@ -589,7 +505,7 @@ function um_new_modal( id, size, isPhoto, source ) { modalOverlay.next('.um-modal').hide(); } - jQuery('.tipsy').hide(); + UM.common.tipsy.hide(); UM.dropdown.hideAll(); @@ -641,7 +557,6 @@ function um_new_modal( id, size, isPhoto, source ) { } function um_modal_responsive() { - var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; @@ -653,11 +568,15 @@ function um_modal_responsive() { var modal = jQuery('.um-modal:visible').not('.um-modal-hidden'); var photo_modal = modal.find('.um-modal-body.photo:visible'); + if ( ! photo_modal.length && ! modal.length ) { + return; + } + + let half_gap = ( h - modal.innerHeight() ) / 2 + 'px'; + + modal.removeClass('uimob340').removeClass('uimob500'); + if ( photo_modal.length ) { - - modal.removeClass('uimob340'); - modal.removeClass('uimob500'); - var photo_ = jQuery('.um-modal-photo img'); var photo_maxw = w - 60; var photo_maxh = h - ( h * 0.25 ); @@ -673,54 +592,25 @@ function um_modal_responsive() { photo_.animate({'opacity' : 1}, 1000); - var half_gap = ( h - modal.innerHeight() ) / 2 + 'px'; modal.animate({ 'bottom' : half_gap }, 300); } else if ( modal.length ) { - - modal.removeClass('uimob340'); - modal.removeClass('uimob500'); - if ( w <= 340 ) { - modal.addClass('uimob340'); - initCrop_UM(); - modal.animate({ 'bottom' : 0 }, 300); - } else if ( w <= 500 ) { - modal.addClass('uimob500'); - initCrop_UM(); - modal.animate({ 'bottom' : 0 }, 300); - - } else if ( w <= 800 ) { - - initCrop_UM(); - var half_gap = ( h - modal.innerHeight() ) / 2 + 'px'; - modal.animate({ 'bottom' : half_gap }, 300); - - } else if ( w <= 960 ) { - - initCrop_UM(); - var half_gap = ( h - modal.innerHeight() ) / 2 + 'px'; - modal.animate({ 'bottom' : half_gap }, 300); - - } else if ( w > 960 ) { - - initCrop_UM(); - var half_gap = ( h - modal.innerHeight() ) / 2 + 'px'; - modal.animate({ 'bottom' : half_gap }, 300); - } - + UM.frontend.cropper.init(); + if ( w <= 500 ) { + modal.animate({ 'bottom' : 0 }, 300); + } else { + modal.animate({ 'bottom' : half_gap }, 300); + } } - } function um_remove_modal() { - if ( jQuery('.cropper-hidden').length > 0 ) { - cropper.destroy(); - } + wp.hooks.doAction( 'um_remove_modal' ); jQuery('body,html,textarea').css("overflow", "auto"); @@ -760,7 +650,7 @@ function remove_Modal() { if ( jQuery('.um-popup-overlay').length ) { wp.hooks.doAction( 'um_before_modal_removed', jQuery('.um-popup') ); - jQuery('.tipsy').remove(); + UM.common.tipsy.hide(); jQuery('.um-popup').empty().remove(); jQuery('.um-popup-overlay').empty().remove(); jQuery("body,html").css({ overflow: 'auto' }); @@ -770,10 +660,7 @@ function remove_Modal() { function show_Modal( contents ) { if ( jQuery('.um-popup-overlay').length ) { jQuery('.um-popup').removeClass('loading').html( contents ); - jQuery('.um-tip-n').tipsy({gravity: 'n', opacity: 1, offset: 3 }); - jQuery('.um-tip-w').tipsy({gravity: 'w', opacity: 1, offset: 3 }); - jQuery('.um-tip-e').tipsy({gravity: 'e', opacity: 1, offset: 3 }); - jQuery('.um-tip-s').tipsy({gravity: 's', opacity: 1, offset: 3 }); + UM.common.tipsy.init(); } } diff --git a/assets/js/um-functions.min.js b/assets/js/um-functions.min.js index d735ad75..934757c6 100644 --- a/assets/js/um-functions.min.js +++ b/assets/js/um-functions.min.js @@ -1 +1 @@ -function UM_hide_menus(){UM.dropdown.hideAll()}function UM_domenus(){jQuery(".um-dropdown").each(function(e,t){UM.dropdown.setPosition(t)})}function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),a=jQuery("input[data-key=confirm_user_password]").val(),o=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||a?t!==a?o.removeClass("um-validate-matched").addClass("um-validate-not-matched"):o.removeClass("um-validate-not-matched").addClass("um-validate-matched"):o.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function um_responsive(){jQuery(".um").each(function(){(element_width=jQuery(this).width())<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):960'+r.data("upload_help_text")+"":"",icon=r.data("icon")?'':"",upload_text=r.data("upload_text")?''+r.data("upload_text")+"":"";var e=0;jQuery("#um_upload_single:visible").data("user_id")&&(e=jQuery("#um_upload_single:visible").data("user_id")),r.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:r.data("key"),set_id:r.data("set_id"),set_mode:r.data("set_mode"),_wpnonce:r.data("nonce"),timestamp:r.data("timestamp"),user_id:e},fileName:r.data("key"),allowedTypes:r.data("allowed_types"),maxFileSize:r.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:r.data("max_size_error"),extErrorStr:r.data("extension_error"),maxFileCountErrorStr:r.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(e){r.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,t,a){r.selectedFiles=0,t.success&&0==t.success||void 0!==t.data.error?(r.parents(".um-modal-body").append('
'+t.data.error+"
"),r.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(t.data,function(e,t){var a=r.parents(".um-modal-body").find(".um-single-image-preview img"),o=r.parents(".um-modal-body").find(".um-single-image-preview"),i=new Date;a.attr("src",t.url+"?"+i.getTime()),a.data("file",t.file),a.on("load",function(){r.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),r.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),o.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(o){upload_help_text=o.data("upload_help_text")?''+o.data("upload_help_text")+"":"",icon=o.data("icon")?'':"",upload_text=o.data("upload_text")?''+o.data("upload_text")+"":"",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),o.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:o.data("key"),set_id:o.data("set_id"),user_id:o.data("user_id"),set_mode:o.data("set_mode"),_wpnonce:o.data("nonce"),timestamp:o.data("timestamp")},fileName:o.data("key"),allowedTypes:o.data("allowed_types"),maxFileSize:o.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:o.data("max_size_error"),extErrorStr:o.data("extension_error"),maxFileCountErrorStr:o.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(e){o.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,t,a){o.selectedFiles=0,t.success&&0==t.success||void 0!==t.data.error?(o.parents(".um-modal-body").append('
'+t.data.error+"
"),o.parents(".um-modal-body").find(".upload-statusbar").hide(0)):jQuery.each(t.data,function(e,t){o.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),o.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),o.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==e?o.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(t):"icon_bg"==e?o.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":t}):"filename"==e?o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",t):"original_name"==e?(o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",t),o.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(t)):"url"==e&&o.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",t)}),setTimeout(function(){um_modal_responsive()},1e3)},onError:function(e){console.log(e)}})}function initCrop_UM(){var e,t,a=jQuery(".um-modal .um-single-image-preview img").first(),o=jQuery(".um-modal .um-single-image-preview"),i=a.parent().attr("data-crop"),r=a.parent().attr("data-min_width"),d=a.parent().attr("data-min_height"),u=a.parent().attr("data-ratio");jQuery(".um-modal").find("#um_upload_single").attr("data-ratio")&&(u=(u=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio")).split(":")[0]),a.length&&""!=a.attr("src")&&(e=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height(),a.css({height:"auto"}),o.css({height:"auto"}),jQuery(window).height()<=400?(o.css({height:e+"px","max-height":e+"px"}),a.css({height:"auto"})):(a.css({height:"auto","max-height":e+"px"}),o.css({height:a.height(),"max-height":e+"px"})),"square"==i?t={minWidth:r,minHeight:d,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(e){a.parent().attr("data-coord",Math.round(e.x)+","+Math.round(e.y)+","+Math.round(e.width)+","+Math.round(e.height))}}:"cover"==i?t={minWidth:r,minHeight:d=0'))}function um_new_modal(e,t,a,o){var i,r,d,u=jQuery(".um-modal-overlay"),u=(0!==u.length&&(u.hide(),u.next(".um-modal").hide()),jQuery(".tipsy").hide(),UM.dropdown.hideAll(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),jQuery('
')),s=u.filter(".um-modal");s.append(jQuery("#"+e)),jQuery("body").append(u),a?(i=jQuery(''),r=jQuery(window).width()-60,d=jQuery(window).height()-.25*jQuery(window).height(),i.on("load",function(){s.find(".um-modal-photo").html(i),s.addClass("is-photo").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}).show().children().show(),i.css({opacity:0,"max-width":r,"max-height":d}).animate({opacity:1},1e3),um_modal_responsive()})):(s.addClass("no-photo").show().children().show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible .um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible .um-single-file-upload")),um_modal_responsive())}function um_modal_responsive(){var e,t,a,o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=jQuery(".um-modal:visible").not(".um-modal-hidden");r.find(".um-modal-body.photo:visible").length?(r.removeClass("uimob340"),r.removeClass("uimob500"),a=o-60,t=i-.25*i,(e=jQuery(".um-modal-photo img")).css({opacity:0}),e.css({"max-width":a}),e.css({"max-height":t}),r.css({width:e.width(),"margin-left":"-"+e.width()/2+"px"}),e.animate({opacity:1},1e3),a=(i-r.innerHeight())/2+"px",r.animate({bottom:a},300)):r.length&&(r.removeClass("uimob340"),r.removeClass("uimob500"),o<=340?(r.addClass("uimob340"),initCrop_UM(),r.animate({bottom:0},300)):o<=500?(r.addClass("uimob500"),initCrop_UM(),r.animate({bottom:0},300)):(o<=800||o<=960||960 .um-modal div[id^="um_"]').hide().appendTo("body"),jQuery("body > .um-modal, body > .um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").not(".um-modal-hidden").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").not(".um-modal-hidden").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('
'),jQuery("body").append('
'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(wp.hooks.doAction("um_before_modal_removed",jQuery(".um-popup")),jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(350<(ag_height=jQuery(window).height()-jQuery(".um-popup .um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80)&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").prop("checked",!1).prop("selected",!1)}function um_selected(e,t){if(e==t)return"selected='selected'"}"object"!=typeof window.UM&&(window.UM={}),UM.dropdown={hide:function(e){e=jQuery(e);e.parents("div").find("a").removeClass("active"),e.hide()},hideAll:function(){var e=jQuery(".um-dropdown");e.parents("div").find("a").removeClass("active"),e.hide()},setPosition:function(e){var t,a=jQuery(e),o=200,e=jQuery("html").attr("dir"),i=a.attr("data-element"),r=a.attr("data-position"),d=a.attr("data-trigger"),u=i&&jQuery(i).length?jQuery(i):a.siblings("a").length?a.siblings("a").first():a.parent(),s=(u.addClass("um-trigger-menu-on-"+d),0),n=(u.outerWidth()-o)/2,m=u.outerHeight(),i=u.offset();switch(u.is(".um-profile-photo")&&(t=u.find(".um-profile-photo-img"),m=u.closest("div.uimob500").length?u.outerHeight()-t.outerHeight()/4:(n=(t.outerWidth()-o)/2,t.outerHeight()/4)),u.is(".um-cover")&&(t=u.find(".um-cover-e"),m=u.closest("div.uimob500").length?(n=(t.outerWidth()-o)/2,t.outerHeight()/2+24):(n=(t.outerWidth()-o)/2,t.outerHeight()/2+46)),"lc"===r&&"rtl"===e&&(r="rc"),u.outerWidth()'+d.data("upload_help_text")+"":"",icon=d.data("icon")?'':"",upload_text=d.data("upload_text")?''+d.data("upload_text")+"":"";var e=0;jQuery("#um_upload_single:visible").data("user_id")&&(e=jQuery("#um_upload_single:visible").data("user_id")),d.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:d.data("key"),set_id:d.data("set_id"),set_mode:d.data("set_mode"),_wpnonce:d.data("nonce"),timestamp:d.data("timestamp"),user_id:e},fileName:d.data("key"),allowedTypes:d.data("allowed_types"),maxFileSize:d.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:d.data("max_size_error"),extErrorStr:d.data("extension_error"),maxFileCountErrorStr:d.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(e){d.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,o,t){d.selectedFiles=0,o.success&&0==o.success||void 0!==o.data.error?(d.parents(".um-modal-body").append('
'+o.data.error+"
"),d.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(o.data,function(e,o){var t=d.parents(".um-modal-body").find(".um-single-image-preview img"),a=d.parents(".um-modal-body").find(".um-single-image-preview"),i=new Date;t.attr("src",o.url+"?"+i.getTime()),t.data("file",o.file),t.on("load",function(){d.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),d.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),a.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(a){upload_help_text=a.data("upload_help_text")?''+a.data("upload_help_text")+"":"",icon=a.data("icon")?'':"",upload_text=a.data("upload_text")?''+a.data("upload_text")+"":"",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),a.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:a.data("key"),set_id:a.data("set_id"),user_id:a.data("user_id"),set_mode:a.data("set_mode"),_wpnonce:a.data("nonce"),timestamp:a.data("timestamp")},fileName:a.data("key"),allowedTypes:a.data("allowed_types"),maxFileSize:a.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:a.data("max_size_error"),extErrorStr:a.data("extension_error"),maxFileCountErrorStr:a.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(e){a.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,o,t){a.selectedFiles=0,o.success&&0==o.success||void 0!==o.data.error?(a.parents(".um-modal-body").append('
'+o.data.error+"
"),a.parents(".um-modal-body").find(".upload-statusbar").hide(0)):jQuery.each(o.data,function(e,o){a.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),a.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),a.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==e?a.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(o):"icon_bg"==e?a.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":o}):"filename"==e?a.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",o):"original_name"==e?(a.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",o),a.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(o)):"url"==e&&a.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",o)}),setTimeout(function(){um_modal_responsive()},1e3)},onError:function(e){console.log(e)}})}function um_new_modal(e,o,t,a){var i,d,u,s=jQuery(".um-modal-overlay"),s=(0!==s.length&&(s.hide(),s.next(".um-modal").hide()),UM.common.tipsy.hide(),UM.dropdown.hideAll(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),jQuery('
')),r=s.filter(".um-modal");r.append(jQuery("#"+e)),jQuery("body").append(s),t?(i=jQuery(''),d=jQuery(window).width()-60,u=jQuery(window).height()-.25*jQuery(window).height(),i.on("load",function(){r.find(".um-modal-photo").html(i),r.addClass("is-photo").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}).show().children().show(),i.css({opacity:0,"max-width":d,"max-height":u}).animate({opacity:1},1e3),um_modal_responsive()})):(r.addClass("no-photo").show().children().show(),um_modal_size(o),initImageUpload_UM(jQuery(".um-modal:visible .um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible .um-single-file-upload")),um_modal_responsive())}function um_modal_responsive(){var e,o,t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=jQuery(".um-modal:visible").not(".um-modal-hidden"),d=i.find(".um-modal-body.photo:visible");(d.length||i.length)&&(e=(a-i.innerHeight())/2+"px",i.removeClass("uimob340").removeClass("uimob500"),d.length?(d=t-60,a=a-.25*a,(o=jQuery(".um-modal-photo img")).css({opacity:0}),o.css({"max-width":d}),o.css({"max-height":a}),i.css({width:o.width(),"margin-left":"-"+o.width()/2+"px"}),o.animate({opacity:1},1e3),i.animate({bottom:e},300)):i.length&&(t<=340?i.addClass("uimob340"):t<=500&&i.addClass("uimob500"),UM.frontend.cropper.init(),t<=500?i.animate({bottom:0},300):i.animate({bottom:e},300)))}function um_remove_modal(){wp.hooks.doAction("um_remove_modal"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('body > .um-modal div[id^="um_"]').hide().appendTo("body"),jQuery("body > .um-modal, body > .um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").not(".um-modal-hidden").addClass(e)}function um_modal_add_attr(e,o){jQuery(".um-modal:visible").not(".um-modal-hidden").data(e,o)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('
'),jQuery("body").append('
'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(wp.hooks.doAction("um_before_modal_removed",jQuery(".um-popup")),UM.common.tipsy.hide(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),UM.common.tipsy.init())}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(350<(ag_height=jQuery(window).height()-jQuery(".um-popup .um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80)&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").prop("checked",!1).prop("selected",!1)}function um_selected(e,o){if(e==o)return"selected='selected'"}"object"!=typeof window.UM&&(window.UM={}),UM.dropdown={hide:function(e){e=jQuery(e);e.parents("div").find("a").removeClass("active"),e.hide()},hideAll:function(){var e=jQuery(".um-dropdown");e.parents("div").find("a").removeClass("active"),e.hide()},setPosition:function(e){var o,t=jQuery(e),a=200,e=jQuery("html").attr("dir"),i=t.attr("data-element"),d=t.attr("data-position"),u=t.attr("data-trigger"),s=i&&jQuery(i).length?jQuery(i):t.siblings("a").length?t.siblings("a").first():t.parent(),r=(s.addClass("um-trigger-menu-on-"+u),0),n=(s.outerWidth()-a)/2,l=s.outerHeight(),i=s.offset();switch(s.is(".um-profile-photo")&&(o=s.find(".um-profile-photo-img"),l=s.closest("div.uimob500").length?s.outerHeight()-o.outerHeight()/4:(n=(o.outerWidth()-a)/2,o.outerHeight()/4)),s.is(".um-cover")&&(o=s.find(".um-cover-e"),l=s.closest("div.uimob500").length?(n=(o.outerWidth()-a)/2,o.outerHeight()/2+24):(n=(o.outerWidth()-a)/2,o.outerHeight()/2+46)),"lc"===d&&"rtl"===e&&(d="rc"),s.outerWidth() a").html(r))}),jQuery(document.body).on("click",".um-directory .pagi:not(.current)",function(){var e,r;jQuery(this).hasClass("disabled")||um_is_directory_busy(e=jQuery(this).parents(".um-directory"))||(um_members_show_preloader(e),(1===(r="first"===jQuery(this).data("page")?1:"prev"===jQuery(this).data("page")?+e.data("page")-1:"next"===jQuery(this).data("page")?+e.data("page")+1:"last"===jQuery(this).data("page")?parseInt(e.data("total_pages")):parseInt(jQuery(this).data("page")))?(e.find('.pagi[data-page="first"], .pagi[data-page="prev"]').addClass("disabled"),e.find('.pagi[data-page="prev"], .pagi[data-page="last"]')):(r===parseInt(e.data("total_pages"))?e.find('.pagi[data-page="prev"], .pagi[data-page="last"]').addClass("disabled"):e.find('.pagi[data-page="prev"], .pagi[data-page="last"]').removeClass("disabled"),e.find('.pagi[data-page="first"], .pagi[data-page="prev"]'))).removeClass("disabled"),e.find(".pagi").removeClass("current"),e.find('.pagi[data-page="'+r+'"]').addClass("current"),e.data("page",r),um_set_url_from_data(e,"page",1===r?"":r),um_ajax_get_members(e))}),jQuery(document.body).on("change",".um-directory .um-members-pagi-dropdown",function(){var e,r=jQuery(this).parents(".um-directory");um_is_directory_busy(r)||(um_members_show_preloader(r),e=jQuery(this).val(),r.find(".pagi").removeClass("current"),r.find('.pagi[data-page="'+e+'"]').addClass("current"),r.data("page",e),um_set_url_from_data(r,"page",1===e?"":e),um_ajax_get_members(r))}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-more a",function(e){e.preventDefault();e=jQuery(this).parents(".um-member");return e.find(".um-member-more").hide(),e.find(".um-member-meta-main").slideDown(),e.find(".um-member-less").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-less a",function(e){e.preventDefault();e=jQuery(this).parents(".um-member");return e.find(".um-member-less").hide(),e.find(".um-member-meta-main").slideUp(),e.find(".um-member-more").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-more a",function(e){e.preventDefault();var e=jQuery(this).parents(".um-member"),r=jQuery(this).parents(".um-members");return e.find(".um-member-more").hide(),e.find(".um-member-meta").slideDown(function(){UM_Member_Grid(r)}),e.find(".um-member-less").fadeIn(),setTimeout(function(){UM_Member_Grid(r)},100),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-less a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member"),t=jQuery(this).parents(".um-members");return r.find(".um-member-less").hide(),r.find(".um-member-meta").slideUp(function(){r.find(".um-member-more").fadeIn(),UM_Member_Grid(t)}),!1}),jQuery(".um-member-directory-filters-a").on("click",function(){var e=jQuery(this),r=e.parents(".um-directory").find(".um-search");r.is(":visible")?r.slideUp(250,function(){e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}):r.slideDown({duration:250,start:function(){jQuery(this).css({display:"grid"}),e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}})}),jQuery(document.body).on("change",".um-directory .um-search-filter select",function(){var e,r,t,a=jQuery(this).val(),i=um_sanitize_value(a);""===i||um_is_directory_busy(e=jQuery(this).parents(".um-directory"))||(um_members_show_preloader(e),t=void 0===(t=um_get_data_for_directory(e,"filter_"+(r=jQuery(this).prop("name"))))?[]:t.split("||"),-1===jQuery.inArray(i,t)&&(t.push(i),um_set_url_from_data(e,"filter_"+r,t=t.join("||")),e.data("page",1),um_set_url_from_data(e,"page","")),jQuery(this).find('option[value="'+a+'"]').prop("disabled",!0).hide(),1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0),(i=jQuery(this)).select2("destroy").select2({dropdownParent:i.parent()}),i.val("").trigger("change"),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"))}),jQuery(document.body).on("blur",'.um-directory .um-search-filter.um-text-filter-type input[type="text"]',function(){var e,r,t,a=jQuery(this).parents(".um-directory");um_is_directory_busy(a)||(e=um_sanitize_value(jQuery(this).val()))!==(t=void 0===(t=um_get_data_for_directory(a,"filter_"+(r=jQuery(this).prop("name"))))?"":t)&&(um_members_show_preloader(a),um_set_url_from_data(a,"filter_"+r,e),a.data("page",1),um_set_url_from_data(a,"page",""),um_ajax_get_members(a),um_change_tag(a),a.data("searched",1),a.find(".um-member-directory-sorting-options").prop("disabled",!1),a.find(".um-member-directory-view-type").removeClass("um-disabled"))}),jQuery(document.body).on("keypress",'.um-directory .um-search-filter.um-text-filter-type input[type="text"]',function(e){var r,t,a;13!==e.which||um_is_directory_busy(e=jQuery(this).parents(".um-directory"))||(r=um_sanitize_value(jQuery(this).val()))!==(a=void 0===(a=um_get_data_for_directory(e,"filter_"+(t=jQuery(this).prop("name"))))?"":a)&&(um_members_show_preloader(e),um_set_url_from_data(e,"filter_"+t,r),e.data("page",1),um_set_url_from_data(e,"page",""),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"))}),jQuery(document.body).on("click",".um-directory .um-members-filter-remove",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)&&e){um_members_show_preloader(e);var r=jQuery(this).data("value"),t=jQuery(this).data("name"),a=jQuery(this).data("type"),i=("text"===a?(um_set_url_from_data(e,"filter_"+t,""),jQuery('.um-search-filter input[name="'+t+'"]').val("")):"select"===a?(m=void 0===(m=um_get_data_for_directory(e,"filter_"+t))?[]:(m=um_unsanitize_value(m)).split("||"),um_set_url_from_data(e,"filter_"+t,m=(m=-1!==jQuery.inArray(r.toString(),m)?jQuery.grep(m,function(e){return e!==r.toString()}):m).length?m:""),(m=jQuery('.um-search-filter select[name="'+t+'"]')).find('option[value="'+r+'"]').prop("disabled",!1).show(),1a.data("total_pages")&&(t=a.data("total_pages")),a.data("page",t).attr("data-page",t),a.find(".um-member-directory-sorting").length&&(void 0===(t=um_get_data_for_directory(a,"sort"))&&(t=a.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]').find('a[data-default="1"]').data("value")),a.data("sorting",t),(e=a.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]')).find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),e.find('a[data-value="'+t+'"]').data("selected",1).prop("data-selected",1).attr("data-selected",1),a.find(".um-member-directory-sorting-a").find("> a").html(e.find('a[data-value="'+t+'"]').html())),a.find(".um-member-directory-view-type").length&&(void 0===(e=um_get_data_for_directory(a,"view_type"))&&(e=a.find('.um-member-directory-view-type-a[data-default="1"]').data("type")),a.data("view_type",e),a.find(".um-member-directory-view-type .um-member-directory-view-type-a").hide(),a.find('.um-member-directory-view-type .um-member-directory-view-type-a[data-type="'+e+'"]').show()),a.find(".um-datepicker-filter").each(function(){var e=jQuery(this),r=e.pickadate("picker"),t=e.data("filter_name"),e=e.data("range"),t=um_get_data_for_directory(a,"filter_"+t+"_"+e);void 0!==t?r.set("select",1e3*t):r.clear()}),a.find(".um-slider").each(function(){var e=jQuery(this),r=e.data("field_name"),t=um_get_data_for_directory(a,"filter_"+r+"_from"),r=um_get_data_for_directory(a,"filter_"+r+"_to");void 0===t&&(t=e.data("min")),t=parseInt(t),void 0===r&&(r=e.data("max")),r=parseInt(r),e.slider("values",[t,r]),um_set_range_label(e)}),a.find(".um-timepicker-filter").each(function(){var e=jQuery(this),r=e.pickatime("picker"),t=e.data("filter_name"),e=e.data("range"),t=um_get_data_for_directory(a,"filter_"+t+"_"+e);void 0!==t?(e=t.split(":"),r.set("select",60*e[0])):r.clear()}),wp.hooks.applyFilters("um_member_directory_ignore_after_search",!1,a));if(!t&&1===a.data("must-search")){var i=um_get_search(a);if(!um_get_filters_data(a).length&&!i)return a.data("searched",0),void um_members_hide_preloader(a);a.data("searched",1)}wp.hooks.applyFilters("um_member_directory_prevent_default_first_loading",!1,a,r)||(um_ajax_get_members(a),um_change_tag(a))})})}); \ No newline at end of file +var um_members_directory_busy=[],um_member_directories=[],um_member_directory_last_data=[];function um_parse_current_url(){var r={},t=window.location.search.substring(1).split("&");return jQuery.each(t,function(e){e=t[e].split("=");r[e[0]]=e[1]}),r}function um_get_data_for_directory(e,r){var t=um_members_get_hash(e),a={},i=um_parse_current_url();if(jQuery.each(i,function(e){-1!==e.indexOf("_"+t)&&""!==i[e]&&(a[e.replace("_"+t,"")]=i[e])}),r){if(void 0!==a[r])try{a[r]=decodeURIComponent(a[r])}catch(e){console.error(e)}return a[r]}return a}function um_set_url_from_data(e,r,t){var a=um_members_get_hash(e),i=um_get_data_for_directory(e),m={},d=(Array.isArray(t)?(jQuery.each(t,function(e){t[e]=encodeURIComponent(t[e])}),t=t.join("||")):jQuery.isNumeric(t)||(t=t.split("||"),jQuery.each(t,function(e){t[e]=encodeURIComponent(t[e])}),t=t.join("||")),""!==t&&(m[r+"_"+a]=t),jQuery.each(i,function(e){r===e?""!==t&&(m[e+"_"+a]=t):m[e+"_"+a]=i[e]}),jQuery.each(um_member_directories,function(e){var r,t=um_member_directories[e];t!==a&&(r=um_get_data_for_directory(jQuery('.um-directory[data-hash="'+t+'"]')),jQuery.each(r,function(e){m[e+"_"+t]=r[e]}))}),[]),e=(jQuery.each(m,function(e){d.push(e+"="+m[e])}),"?"+(d=wp.hooks.applyFilters("um_member_directory_url_attrs",d)).join("&"));"?"===e&&(e=""),window.history.pushState("string","UM Member Directory",window.location.origin+window.location.pathname+e)}function um_members_get_hash(e){return e.data("hash")}function um_is_directory_busy(e){e=um_members_get_hash(e);return void 0!==um_members_directory_busy[e]&&um_members_directory_busy[e]}function um_members_show_preloader(e){um_members_directory_busy[um_members_get_hash(e)]=!0,e.find(".um-members-overlay").show()}function um_members_hide_preloader(e){um_members_directory_busy[um_members_get_hash(e)]=!1,e.find(".um-members-overlay").hide()}function um_set_range_label(e,r){var t,a="",i=e.siblings(".um-slider-range").data("placeholder-s"),m=e.siblings(".um-slider-range").data("placeholder-p"),r=r?(a=(r.values[0]===r.values[1]?i.replace("{value}",r.values[0]):m.replace("{min_range}",r.values[0]).replace("{max_range}",r.values[1])).replace("{field_label}",e.siblings(".um-slider-range").data("label")),t=r.values[0],r.values[1]):(a=(e.slider("values",0)===e.slider("values",1)?i.replace("{value}",e.slider("values",0)):m.replace("{min_range}",e.slider("values",0)).replace("{max_range}",e.slider("values",1))).replace("{field_label}",e.siblings(".um-slider-range").data("label")),t=e.slider("values",0),e.slider("values",1));e.siblings(".um-slider-range").html(a),e.siblings(".um_range_min").val(t),e.siblings(".um_range_max").val(r)}function um_get_search(e){return e.find(".um-search-line").length?e.find(".um-search-line").val():""}function um_get_sort(e){return e.data("sorting")}function um_get_current_page(e){e=e.data("page");return e=e&&void 0!==e?e:1}function um_time_convert(e,r){var t=Math.floor(e/60),e=e%60;return(t=60<=e&&(e=0,24<=(t+=1))?0:t)+":"+(e=e<10?"0"+e:e)}function um_ajax_get_members(_,e){var r,t,a,i,s,m=um_members_get_hash(_);wp.hooks.applyFilters("um_member_directory_get_members_allow",!0,m,_)?(r=um_get_current_page(_),t=um_get_search(_),a=um_get_sort(_),i=-(new Date).getTimezoneOffset()/60,s={directory_id:m,page:r,search:t,sorting:a,gmt_offset:i,post_refferer:_.data("base-post"),nonce:um_scripts.nonce},_.find(".um-search-filter").length&&_.find(".um-search-filter").each(function(){var e,r,t,a,i,m,d,u=jQuery(this);u.find(".um-slider").length?(m=u.find(".um-slider").data("field_name"),r=um_get_data_for_directory(_,"filter_"+m+"_from"),e=um_get_data_for_directory(_,"filter_"+m+"_to"),void 0===r&&void 0===e||(s[m]=[r,e])):u.find(".um-datepicker-filter").length?(m=u.find(".um-datepicker-filter").data("filter_name"),r=um_get_data_for_directory(_,"filter_"+m+"_from"),e=um_get_data_for_directory(_,"filter_"+m+"_to"),void 0===r&&void 0===e||(s[m]=[r,e])):u.find(".um-timepicker-filter").length?(m=u.find(".um-timepicker-filter").data("filter_name"),r=um_get_data_for_directory(_,"filter_"+m+"_from"),e=um_get_data_for_directory(_,"filter_"+m+"_to"),void 0!==r&&(r=(i=(i=+(r=r.split(":"))[0])<10?"0"+i:i)+":"+(a=(a=+r[1])<10?"0"+a:a)+":00"),void 0!==e&&(a=+(t=e.split(":"))[1],e=(i=(i=+t[0])<10?"0"+i:i)+":"+(a=a<10?"0"+a:a)+":59"),void 0===r&&void 0===e||(s[m]=[r,e])):u.find("select").length?(m=u.find("select").attr("name"),void 0!==(d=um_get_data_for_directory(_,"filter_"+m))&&(d=um_unsanitize_value(d),s[m]=d.split("||"))):u.hasClass("um-text-filter-type")&&u.find('input[type="text"]').length?(m=u.find('input[type="text"]').attr("name"),void 0!==(d=um_get_data_for_directory(_,"filter_"+m))&&(d=um_unsanitize_value(d),s[m]=d)):s=wp.hooks.applyFilters("um_member_directory_custom_filter_handler",s,u,_)}),s=wp.hooks.applyFilters("um_member_directory_filter_request",s),wp.ajax.send("um_get_members",{data:s,success:function(e){um_member_directory_last_data[m]=e,um_build_template(_,e);var r=wp.template("um-members-pagination");_.find(".um-members-pagination-box").html(r(e)),_.data("total_pages",e.pagination.total_pages),e.pagination.total_pages?(_.find(".um-member-directory-sorting-options").prop("disabled",!1),_.find(".um-member-directory-view-type").removeClass("um-disabled")):(_.find(".um-member-directory-sorting-options").prop("disabled",!0),_.find(".um-member-directory-view-type").addClass("um-disabled")),wp.hooks.doAction("um_member_directory_loaded",_,e),um_init_new_dropdown(),um_members_hide_preloader(_)},error:function(e){console.log(e),um_members_hide_preloader(_)}})):setTimeout(um_ajax_get_members,600,_,e)}function um_build_template(e,r){var t=e.data("view_type"),t=wp.template("um-member-"+t+"-"+um_members_get_hash(e)),t=(e.find(".um-members-grid, .um-members-list").remove(),e.find(".um-members-wrapper").prepend(t(r.users)),wp.template("um-members-header")),a=(e.find(".um-members-intro").remove(),wp.hooks.applyFilters("um_member_directory_generate_header",!1,e));(void 0!==r.is_search&&r.is_search||a)&&e.find(".um-members-wrapper").prepend(t(r)),e.addClass("um-loaded"),e.find(".um-members.um-members-grid").length&&UM_Member_Grid(e.find(".um-members.um-members-grid")),jQuery(document).trigger("um_build_template",[e,r]),jQuery(window).trigger("resize"),UM.common.tipsy.init()}function UM_Member_Grid(r){r.find(".um-member").length&&r.imagesLoaded(function(){var e=wp.hooks.applyFilters("um_member_directory_grid_masonry_attrs",{itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"},r);r.masonry(e).on("layoutComplete",function(e,r){jQuery(document).trigger("um_grid_initialized",[e,r])})})}function um_get_filters_data(_){var s=[];return _.find(".um-search-filter").each(function(){var d,t,a,i,e,r,m,u=jQuery(this);u.find("input.um-datepicker-filter").length?(d="datepicker",u.find("input.um-datepicker-filter").each(function(){var e,r,t,a,i,m;"to"!==jQuery(this).data("range")&&(e=jQuery(this).data("filter_name"),r=um_get_data_for_directory(_,"filter_"+e+"_from"),t=um_get_data_for_directory(_,"filter_"+e+"_to"),void 0!==r||void 0!==t)&&((a=jQuery(this).val())===(i=_.find('input.um-datepicker-filter[data-range="to"][data-filter_name="'+e+'"]').val())?m=i:""!==a&&""!==i?m=a+" - "+i:""===a?m="before "+i:""===i&&(m="since "+a),s.push({name:e,label:jQuery(this).data("filter-label"),value_label:m,value:[r,t],type:d}))})):u.find("input.um-timepicker-filter").length?(d="timepicker",u.find("input.um-timepicker-filter").each(function(){var e,r,t,a,i,m;"to"!==jQuery(this).data("range")&&(e=jQuery(this).data("filter_name"),r=um_get_data_for_directory(_,"filter_"+e+"_from"),t=um_get_data_for_directory(_,"filter_"+e+"_to"),void 0!==r||void 0!==t)&&((a=jQuery(this).val())===(i=_.find('input.um-timepicker-filter[data-range="to"][data-filter_name="'+e+'"]').val())?m=i:""!==a&&""!==i?m=a+" - "+i:""===a?m="before "+i:""===i&&(m="since "+a),s.push({name:e,label:jQuery(this).data("filter-label"),value_label:m,value:[r,t],type:d}))})):u.find("select").length?(d="select",t=u.find("select").attr("name"),a=u.find("select").data("placeholder"),i=void 0===(i=um_get_data_for_directory(_,"filter_"+t))?[]:(i=um_unsanitize_value(i)).split("||"),jQuery.each(i,function(e){var r=u.find('select option[value="'+i[e]+'"]').data("value_label");s.push({name:t,label:a,value_label:r,value:i[e],type:d})})):u.hasClass("um-text-filter-type")&&u.find('input[type="text"]').length?(d="text",t=u.find('input[type="text"]').attr("name"),a=u.find('input[type="text"]').attr("placeholder"),""!=(i=void 0===(i=um_get_data_for_directory(_,"filter_"+t))?"":i)&&s.push({name:t,label:a,value_label:i,value:i,type:d})):u.find("div.ui-slider").length?(d="slider",t=u.find("div.ui-slider").data("field_name"),e=um_get_data_for_directory(_,"filter_"+t+"_from"),r=um_get_data_for_directory(_,"filter_"+t+"_to"),void 0===e&&void 0===r||(m=(e===r?u.find("div.um-slider-range").data("placeholder-s").replace("{value}",e):u.find("div.um-slider-range").data("placeholder-p").replace("{min_range}",e).replace("{max_range}",r)).replace("{field_label}",u.find("div.um-slider-range").data("label")),a=u.find("div.um-slider-range").data("label"),s.push({name:t,label:a,value_label:m,value:[e,r],type:d}))):s=wp.hooks.applyFilters("um_member_directory_get_filter_data",s,_,u)}),s}function um_change_tag(e){var r,t=um_get_filters_data(e),a=(e.find(".um-members-filter-tag").remove(),e.find(".um-filtered-line"));a.length&&(r=wp.template("um-members-filtered-line"),a.prepend(r({filters:t})),0===e.find(".um-members-filter-remove").length?(e.find(".um-clear-filters").hide(),e.find(".um-clear-filters").parents(".um-member-directory-header-row").addClass("um-header-row-invisible")):(e.find(".um-clear-filters").show(),e.find(".um-clear-filters").parents(".um-member-directory-header-row").removeClass("um-header-row-invisible")))}function um_run_search(e){if(!um_is_directory_busy(e)){um_members_show_preloader(e);var r=um_get_data_for_directory(e,"search"),t=um_sanitize_value(e.find(".um-search-line").val());if(t===r||""===t&&void 0===r)um_members_hide_preloader(e);else{e.data("general_search",t),um_set_url_from_data(e,"search",t),e.data("page",1),um_set_url_from_data(e,"page","");if(!wp.hooks.applyFilters("um_member_directory_ignore_after_search",!1,e)){r=e.data("must-search");if(1===r&&(t=um_get_search(e),0===e.find(".um-members-filter-remove").length)&&!t)return e.data("searched",0),e.find(".um-members-grid, .um-members-list, .um-members-intro").remove(),e.find(".um-member-directory-sorting-options").prop("disabled",!0),e.find(".um-member-directory-view-type").addClass("um-disabled"),wp.hooks.doAction("um_member_directory_clear_not_searched",e),void um_members_hide_preloader(e)}e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"),um_ajax_get_members(e)}}}function um_slider_filter_init(e){e.find(".um-slider").each(function(){var e=jQuery(this),t=e.parents(".um-directory"),a=e.data("field_name"),r=um_get_data_for_directory(t,"filter_"+a+"_from"),i=um_get_data_for_directory(t,"filter_"+a+"_to"),r=[r=void 0===r?parseInt(e.data("min")):r,i=void 0===i?parseInt(e.data("max")):i];e.slider({range:!0,min:parseInt(e.data("min")),max:parseInt(e.data("max")),values:r,create:function(e,r){},step:1,slide:function(e,r){um_set_range_label(jQuery(this),r)},stop:function(e,r){um_is_directory_busy(t)||(um_members_show_preloader(t),um_set_url_from_data(t,"filter_"+a+"_from",r.values[0]),um_set_url_from_data(t,"filter_"+a+"_to",r.values[1]),t.data("page",1),um_set_url_from_data(t,"page",""),um_ajax_get_members(t),um_change_tag(t),t.data("searched",1),t.find(".um-member-directory-sorting-options").prop("disabled",!1),t.find(".um-member-directory-view-type").removeClass("um-disabled"))}}),um_set_range_label(e)})}jQuery(document.body).ready(function(){jQuery(".um-directory .um-search-filter select").each(function(){1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0);var e=jQuery(this);e.select2("destroy").select2({dropdownParent:e.parent()})}),jQuery(document.body).on("mouseover",".um-directory .um-member-directory-view-type",function(){var e;jQuery(this).hasClass("um-disabled")||((e=jQuery(this).find(".um-member-directory-view-type-a:visible")).hide(),(e.next().length?e.next():jQuery(this).find(".um-member-directory-view-type-a:first")).show().tipsy("show"))}).on("mouseout",".um-directory .um-member-directory-view-type",function(){jQuery(this).hasClass("um-disabled")||(jQuery(this).find(".um-member-directory-view-type-a").hide().tipsy("hide"),jQuery(this).find('.um-member-directory-view-type-a[data-type="'+jQuery(this).parents(".um-directory").data("view_type")+'"]').show())}),jQuery(document.body).on("click",".um-directory .um-member-directory-view-type-a",function(){var e=jQuery(this).parents(".um-directory");if(um_is_directory_busy(e))return!1;var r,t=jQuery(this),a=t.parents(".um-member-directory-view-type");a.hasClass("um-disabled")||(um_members_show_preloader(e),(r=a.find(".um-member-directory-view-type-a:visible")).hide(),(r.next().length?r.next():a.find(".um-member-directory-view-type-a:first")).show().tipsy("show"),null!==(r=um_member_directory_last_data[um_members_get_hash(e)])&&(um_set_url_from_data(e,"view_type",a=t.data("type")),e.data("view_type",a),um_build_template(e,r),um_init_new_dropdown()),um_members_hide_preloader(e))}),jQuery(document.body).on("click",".um-directory .um-do-search",function(){um_run_search(jQuery(this).parents(".um-directory"))}),jQuery(document.body).on("keypress",".um-directory .um-search-line",function(e){13===e.which&&um_run_search(jQuery(this).parents(".um-directory"))}),jQuery(document.body).on("click",'.um-new-dropdown[data-element=".um-member-directory-sorting-a"] li a',function(){var e,r,t;1===jQuery(this).data("selected")||(e=jQuery(this).data("directory-hash"),um_is_directory_busy(e=jQuery('.um-directory[data-hash="'+e+'"]')))||(um_members_show_preloader(e),r=jQuery(this).html(),t=jQuery(this).data("value"),e.data("sorting",t),um_set_url_from_data(e,"sort",t),um_ajax_get_members(e),e.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]').find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),e.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"] a[data-value="'+t+'"]').data("selected",1).prop("data-selected",1).attr("data-selected",1),e.find(".um-member-directory-sorting-a").find("> a").html(r))}),jQuery(document.body).on("click",".um-directory .pagi:not(.current)",function(){var e,r;jQuery(this).hasClass("disabled")||um_is_directory_busy(e=jQuery(this).parents(".um-directory"))||(um_members_show_preloader(e),(1===(r="first"===jQuery(this).data("page")?1:"prev"===jQuery(this).data("page")?+e.data("page")-1:"next"===jQuery(this).data("page")?+e.data("page")+1:"last"===jQuery(this).data("page")?parseInt(e.data("total_pages")):parseInt(jQuery(this).data("page")))?(e.find('.pagi[data-page="first"], .pagi[data-page="prev"]').addClass("disabled"),e.find('.pagi[data-page="prev"], .pagi[data-page="last"]')):(r===parseInt(e.data("total_pages"))?e.find('.pagi[data-page="prev"], .pagi[data-page="last"]').addClass("disabled"):e.find('.pagi[data-page="prev"], .pagi[data-page="last"]').removeClass("disabled"),e.find('.pagi[data-page="first"], .pagi[data-page="prev"]'))).removeClass("disabled"),e.find(".pagi").removeClass("current"),e.find('.pagi[data-page="'+r+'"]').addClass("current"),e.data("page",r),um_set_url_from_data(e,"page",1===r?"":r),um_ajax_get_members(e))}),jQuery(document.body).on("change",".um-directory .um-members-pagi-dropdown",function(){var e,r=jQuery(this).parents(".um-directory");um_is_directory_busy(r)||(um_members_show_preloader(r),e=jQuery(this).val(),r.find(".pagi").removeClass("current"),r.find('.pagi[data-page="'+e+'"]').addClass("current"),r.data("page",e),um_set_url_from_data(r,"page",1===e?"":e),um_ajax_get_members(r))}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-more a",function(e){e.preventDefault();e=jQuery(this).parents(".um-member");return e.find(".um-member-more").hide(),e.find(".um-member-meta-main").slideDown(),e.find(".um-member-less").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-list .um-member-less a",function(e){e.preventDefault();e=jQuery(this).parents(".um-member");return e.find(".um-member-less").hide(),e.find(".um-member-meta-main").slideUp(),e.find(".um-member-more").fadeIn(),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-more a",function(e){e.preventDefault();var e=jQuery(this).parents(".um-member"),r=jQuery(this).parents(".um-members");return e.find(".um-member-more").hide(),e.find(".um-member-meta").slideDown(function(){UM_Member_Grid(r)}),e.find(".um-member-less").fadeIn(),setTimeout(function(){UM_Member_Grid(r)},100),!1}),jQuery(document.body).on("click",".um-directory .um-members.um-members-grid .um-member-less a",function(e){e.preventDefault();var r=jQuery(this).parents(".um-member"),t=jQuery(this).parents(".um-members");return r.find(".um-member-less").hide(),r.find(".um-member-meta").slideUp(function(){r.find(".um-member-more").fadeIn(),UM_Member_Grid(t)}),!1}),jQuery(".um-member-directory-filters-a").on("click",function(){var e=jQuery(this),r=e.parents(".um-directory").find(".um-search");r.is(":visible")?r.slideUp(250,function(){e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}):r.slideDown({duration:250,start:function(){jQuery(this).css({display:"grid"}),e.toggleClass("um-member-directory-filters-visible"),r.parents(".um-member-directory-header-row").toggleClass("um-header-row-invisible")}})}),jQuery(document.body).on("change",".um-directory .um-search-filter select",function(){var e,r,t,a=jQuery(this).val(),i=um_sanitize_value(a);""===i||um_is_directory_busy(e=jQuery(this).parents(".um-directory"))||(um_members_show_preloader(e),t=void 0===(t=um_get_data_for_directory(e,"filter_"+(r=jQuery(this).prop("name"))))?[]:t.split("||"),-1===jQuery.inArray(i,t)&&(t.push(i),um_set_url_from_data(e,"filter_"+r,t=t.join("||")),e.data("page",1),um_set_url_from_data(e,"page","")),jQuery(this).find('option[value="'+a+'"]').prop("disabled",!0).hide(),1===jQuery(this).find("option:not(:disabled)").length&&jQuery(this).prop("disabled",!0),(i=jQuery(this)).select2("destroy").select2({dropdownParent:i.parent()}),i.val("").trigger("change"),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"))}),jQuery(document.body).on("blur",'.um-directory .um-search-filter.um-text-filter-type input[type="text"]',function(){var e,r,t,a=jQuery(this).parents(".um-directory");um_is_directory_busy(a)||(e=um_sanitize_value(jQuery(this).val()))!==(t=void 0===(t=um_get_data_for_directory(a,"filter_"+(r=jQuery(this).prop("name"))))?"":t)&&(um_members_show_preloader(a),um_set_url_from_data(a,"filter_"+r,e),a.data("page",1),um_set_url_from_data(a,"page",""),um_ajax_get_members(a),um_change_tag(a),a.data("searched",1),a.find(".um-member-directory-sorting-options").prop("disabled",!1),a.find(".um-member-directory-view-type").removeClass("um-disabled"))}),jQuery(document.body).on("keypress",'.um-directory .um-search-filter.um-text-filter-type input[type="text"]',function(e){var r,t,a;13!==e.which||um_is_directory_busy(e=jQuery(this).parents(".um-directory"))||(r=um_sanitize_value(jQuery(this).val()))!==(a=void 0===(a=um_get_data_for_directory(e,"filter_"+(t=jQuery(this).prop("name"))))?"":a)&&(um_members_show_preloader(e),um_set_url_from_data(e,"filter_"+t,r),e.data("page",1),um_set_url_from_data(e,"page",""),um_ajax_get_members(e),um_change_tag(e),e.data("searched",1),e.find(".um-member-directory-sorting-options").prop("disabled",!1),e.find(".um-member-directory-view-type").removeClass("um-disabled"))}),jQuery(document.body).on("click",".um-directory .um-members-filter-remove",function(){var e=jQuery(this).parents(".um-directory");if(!um_is_directory_busy(e)&&e){um_members_show_preloader(e);var r=jQuery(this).data("value"),t=jQuery(this).data("name"),a=jQuery(this).data("type"),i=("text"===a?(um_set_url_from_data(e,"filter_"+t,""),jQuery('.um-search-filter input[name="'+t+'"]').val("")):"select"===a?(m=void 0===(m=um_get_data_for_directory(e,"filter_"+t))?[]:(m=um_unsanitize_value(m)).split("||"),um_set_url_from_data(e,"filter_"+t,m=(m=-1!==jQuery.inArray(r.toString(),m)?jQuery.grep(m,function(e){return e!==r.toString()}):m).length?m:""),(m=jQuery('.um-search-filter select[name="'+t+'"]')).find('option[value="'+r+'"]').prop("disabled",!1).show(),1a.data("total_pages")&&(t=a.data("total_pages")),a.data("page",t).attr("data-page",t),a.find(".um-member-directory-sorting").length&&(void 0===(t=um_get_data_for_directory(a,"sort"))&&(t=a.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]').find('a[data-default="1"]').data("value")),a.data("sorting",t),(e=a.find('.um-new-dropdown[data-element=".um-member-directory-sorting-a"]')).find("a").data("selected",0).prop("data-selected",0).attr("data-selected",0),e.find('a[data-value="'+t+'"]').data("selected",1).prop("data-selected",1).attr("data-selected",1),a.find(".um-member-directory-sorting-a").find("> a").html(e.find('a[data-value="'+t+'"]').html())),a.find(".um-member-directory-view-type").length&&(void 0===(e=um_get_data_for_directory(a,"view_type"))&&(e=a.find('.um-member-directory-view-type-a[data-default="1"]').data("type")),a.data("view_type",e),a.find(".um-member-directory-view-type .um-member-directory-view-type-a").hide(),a.find('.um-member-directory-view-type .um-member-directory-view-type-a[data-type="'+e+'"]').show()),a.find(".um-datepicker-filter").each(function(){var e=jQuery(this),r=e.pickadate("picker"),t=e.data("filter_name"),e=e.data("range"),t=um_get_data_for_directory(a,"filter_"+t+"_"+e);void 0!==t?r.set("select",1e3*t):r.clear()}),a.find(".um-slider").each(function(){var e=jQuery(this),r=e.data("field_name"),t=um_get_data_for_directory(a,"filter_"+r+"_from"),r=um_get_data_for_directory(a,"filter_"+r+"_to");void 0===t&&(t=e.data("min")),t=parseInt(t),void 0===r&&(r=e.data("max")),r=parseInt(r),e.slider("values",[t,r]),um_set_range_label(e)}),a.find(".um-timepicker-filter").each(function(){var e=jQuery(this),r=e.pickatime("picker"),t=e.data("filter_name"),e=e.data("range"),t=um_get_data_for_directory(a,"filter_"+t+"_"+e);void 0!==t?(e=t.split(":"),r.set("select",60*e[0])):r.clear()}),wp.hooks.applyFilters("um_member_directory_ignore_after_search",!1,a));if(!t&&1===a.data("must-search")){var i=um_get_search(a);if(!um_get_filters_data(a).length&&!i)return a.data("searched",0),void um_members_hide_preloader(a);a.data("searched",1)}wp.hooks.applyFilters("um_member_directory_prevent_default_first_loading",!1,a,r)||(um_ajax_get_members(a),um_change_tag(a))})})}); \ No newline at end of file diff --git a/assets/js/um-modal.js b/assets/js/um-modal.js index 6aff8591..dc46251e 100644 --- a/assets/js/um-modal.js +++ b/assets/js/um-modal.js @@ -14,62 +14,63 @@ jQuery(document).ready(function() { return false; }); - jQuery(document).on('click', '.um-modal .um-single-file-preview a.cancel', function(e){ - e.preventDefault(); + // jQuery(document).on('click', '.um-modal .um-single-file-preview a.cancel', function(e){ + // e.preventDefault(); + // + // var parent = jQuery(this).parents('.um-modal-body'); + // var src = jQuery(this).parents('.um-modal-body').find('.um-single-fileinfo a').attr('href'); + // var mode = parent.find('.um-single-file-upload').data('set_mode'); + // + // jQuery.ajax({ + // url: wp.ajax.settings.url, + // type: 'post', + // data: { + // action: 'um_remove_file', + // src: src, + // mode: mode, + // nonce: um_scripts.nonce + // }, + // success: function() { + // parent.find('.um-single-file-preview').hide(); + // parent.find('.ajax-upload-dragdrop').show(); + // parent.find('.um-modal-btn.um-finish-upload').addClass('disabled'); + // um_modal_responsive(); + // } + // }); + // + // return false; + // }); - var parent = jQuery(this).parents('.um-modal-body'); - var src = jQuery(this).parents('.um-modal-body').find('.um-single-fileinfo a').attr('href'); - var mode = parent.find('.um-single-file-upload').data('set_mode'); - - jQuery.ajax({ - url: wp.ajax.settings.url, - type: 'post', - data: { - action: 'um_remove_file', - src: src, - mode: mode, - nonce: um_scripts.nonce - }, - success: function() { - parent.find('.um-single-file-preview').hide(); - parent.find('.ajax-upload-dragdrop').show(); - parent.find('.um-modal-btn.um-finish-upload').addClass('disabled'); - um_modal_responsive(); - } - }); - - return false; - }); - - jQuery(document).on('click', '.um-modal .um-single-image-preview a.cancel', function(e){ - e.preventDefault(); - - var parent = jQuery(this).parents('.um-modal-body'); - var src = jQuery(this).parents('.um-modal-body').find('.um-single-image-preview img').attr('src'); - var mode = parent.find('.um-single-image-upload').data('set_mode'); - - jQuery.ajax({ - url: wp.ajax.settings.url, - type: 'post', - data: { - action: 'um_remove_file', - src: src, - mode: mode, - nonce: um_scripts.nonce - }, - success: function() { - jQuery('img.cropper-hidden').cropper( 'destroy' ); - parent.find('.um-single-image-preview img').attr( 'src', '' ); - parent.find('.um-single-image-preview').hide(); - parent.find('.ajax-upload-dragdrop').show(); - parent.find('.um-modal-btn.um-finish-upload').addClass( 'disabled' ); - - um_modal_responsive(); - } - }); - - return false; - }); + // jQuery(document).on('click', '.um-modal .um-single-image-preview a.cancel', function(e){ + // e.preventDefault(); + // + // var parent = jQuery(this).parents('.um-modal-body'); + // var src = jQuery(this).parents('.um-modal-body').find('.um-single-image-preview img').attr('src'); + // var mode = parent.find('.um-single-image-upload').data('set_mode'); + // + // jQuery.ajax({ + // url: wp.ajax.settings.url, + // type: 'post', + // data: { + // action: 'um_remove_file', + // src: src, + // mode: mode, + // nonce: um_scripts.nonce + // }, + // success: function() { + // wp.hooks.doAction( 'um_after_removing_preview' ); + // + // parent.find('.um-single-image-preview img').attr( 'src', '' ); + // parent.find('.um-single-image-preview').hide(); + // parent.find('.ajax-upload-dragdrop').show(); + // parent.find('.um-modal-btn.um-finish-upload').addClass( 'disabled' ); + // + // um_modal_responsive(); + // } + // }); + // + // return false; + // }); jQuery(document).on('click', '.um-finish-upload.file:not(.disabled)', function(){ @@ -112,10 +113,8 @@ jQuery(document).ready(function() { } if ( jQuery('.cropper-hidden').length > 0 ) { - var data = cropper.getData(); + var data = UM.frontend.cropper.obj.getData(); var coord = Math.round(data.x) + ',' + Math.round(data.y) + ',' + Math.round(data.width) + ',' + Math.round(data.height); - } - if ( coord ) { jQuery(this).html( jQuery(this).attr('data-processing') ).addClass('disabled'); @@ -163,18 +162,15 @@ jQuery(document).ready(function() { }); } else { + d = new Date(); - d = new Date(); + jQuery('.um-single-image-preview[data-key='+key+']').fadeIn().find('img').attr('src', src + "?"+d.getTime()); - jQuery('.um-single-image-preview[data-key='+key+']').fadeIn().find('img').attr('src', src + "?"+d.getTime()); - - um_remove_modal(); - - jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('.um-btn-auto-width').html( elem.attr('data-change') ); - - jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('input[type=hidden]').val( file ); + um_remove_modal(); + jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('.um-btn-auto-width').html( elem.attr('data-change') ); + jQuery('.um-single-image-preview[data-key='+key+']').parents('.um-field').find('input[type=hidden]').val( file ); } }); diff --git a/assets/js/um-modal.min.js b/assets/js/um-modal.min.js index 0d29bf7a..38ea26ad 100644 --- a/assets/js/um-modal.min.js +++ b/assets/js/um-modal.min.js @@ -1 +1 @@ -jQuery(document).ready(function(){jQuery(document).on("click",".um-popup-overlay",function(){remove_Modal()}),jQuery(document).on("click",'.um-modal-overlay, a[data-action="um_remove_modal"]',function(){um_remove_modal()}),jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"], .um-modal:not(:has(.um-form)) a',function(e){return e.preventDefault(),!1}),jQuery(document).on("click",".um-modal .um-single-file-preview a.cancel",function(e){e.preventDefault();var a=jQuery(this).parents(".um-modal-body"),e=jQuery(this).parents(".um-modal-body").find(".um-single-fileinfo a").attr("href"),t=a.find(".um-single-file-upload").data("set_mode");return jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:e,mode:t,nonce:um_scripts.nonce},success:function(){a.find(".um-single-file-preview").hide(),a.find(".ajax-upload-dragdrop").show(),a.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive()}}),!1}),jQuery(document).on("click",".um-modal .um-single-image-preview a.cancel",function(e){e.preventDefault();var a=jQuery(this).parents(".um-modal-body"),e=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview img").attr("src"),t=a.find(".um-single-image-upload").data("set_mode");return jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_remove_file",src:e,mode:t,nonce:um_scripts.nonce},success:function(){jQuery("img.cropper-hidden").cropper("destroy"),a.find(".um-single-image-preview img").attr("src",""),a.find(".um-single-image-preview").hide(),a.find(".ajax-upload-dragdrop").show(),a.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive()}}),!1}),jQuery(document).on("click",".um-finish-upload.file:not(.disabled)",function(){var e=jQuery(this).attr("data-key"),a=jQuery(this).parents(".um-modal-body").find(".um-single-file-preview").html(),a=(um_remove_modal(),jQuery(".um-single-file-preview[data-key="+e+"]").fadeIn().html(a),jQuery(".um-field[data-key="+e+"]").find(".um-single-fileinfo a").data("file"));jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find(".um-btn-auto-width").html(jQuery(this).attr("data-change")),jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find('input[type="hidden"]').val(a)}),jQuery(document).on("click",".um-finish-upload.image:not(.disabled)",function(){var a,e,t=jQuery(this),i=jQuery(this).attr("data-key"),r=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview"),u=r.find("img").attr("src"),d=r.attr("data-coord"),r=r.find("img").data("file"),m=0,n=(jQuery(this).parents("#um_upload_single").data("user_id")&&(m=jQuery(this).parents("#um_upload_single").data("user_id")),0),o="";1===jQuery('div.um-field-image[data-key="'+i+'"]').length&&(n=(e=jQuery('div.um-field-image[data-key="'+i+'"]').closest(".um-form")).find('input[name="form_id"]').val(),o=e.attr("data-mode")),d?(jQuery(this).html(jQuery(this).attr("data-processing")).addClass("disabled"),jQuery.ajax({url:wp.ajax.settings.url,type:"POST",dataType:"json",data:{action:"um_resize_image",src:u,coord:d,user_id:m,key:i,set_id:n,set_mode:o,nonce:um_scripts.nonce},success:function(e){e.success&&(a=new Date,"profile_photo"===i?jQuery(".um-profile-photo-img img").attr("src",e.data.image.source_url+"?"+a.getTime()):"cover_photo"===i&&(jQuery(".um-cover-e").empty().html(''),jQuery(".um").hasClass("um-editing"))&&jQuery(".um-cover-overlay").show(),jQuery(".um-single-image-preview[data-key="+i+"]").fadeIn().find("img").attr("src",e.data.image.source_url+"?"+a.getTime()),um_remove_modal(),jQuery("img.cropper-invisible").remove(),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find(".um-btn-auto-width").html(t.attr("data-change")),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find('input[type="hidden"]').val(e.data.image.filename))}})):(a=new Date,jQuery(".um-single-image-preview[data-key="+i+"]").fadeIn().find("img").attr("src",u+"?"+a.getTime()),um_remove_modal(),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find(".um-btn-auto-width").html(t.attr("data-change")),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find("input[type=hidden]").val(r))}),jQuery(document.body).on("click",'a[data-modal^="um_"], span[data-modal^="um_"]',function(e){var a=jQuery(this).attr("data-modal"),t="normal";jQuery(this).data("modal-size")&&(t=jQuery(this).data("modal-size")),jQuery(this).data("modal-copy")&&(jQuery("#"+a).html(jQuery(this).parents(".um-field").find(".um-modal-hidden-content").html()),jQuery(this).parents(".um-profile-photo").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-profile-photo").attr("data-user_id")),jQuery(this).parents(".um-cover").attr("data-ratio")&&jQuery("#"+a).attr("data-ratio",jQuery(this).parents(".um-cover").attr("data-ratio")),jQuery(this).parents(".um-cover").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-cover").attr("data-user_id")),0'),jQuery(".um").hasClass("um-editing"))&&jQuery(".um-cover-overlay").show(),jQuery(".um-single-image-preview[data-key="+i+"]").fadeIn().find("img").attr("src",e.data.image.source_url+"?"+a.getTime()),um_remove_modal(),jQuery("img.cropper-invisible").remove(),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find(".um-btn-auto-width").html(t.attr("data-change")),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find('input[type="hidden"]').val(e.data.image.filename))}})):(a=new Date,jQuery(".um-single-image-preview[data-key="+i+"]").fadeIn().find("img").attr("src",u+"?"+a.getTime()),um_remove_modal(),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find(".um-btn-auto-width").html(t.attr("data-change")),jQuery(".um-single-image-preview[data-key="+i+"]").parents(".um-field").find("input[type=hidden]").val(r))}),jQuery(document.body).on("click",'a[data-modal^="um_"], span[data-modal^="um_"]',function(e){var a=jQuery(this).attr("data-modal"),t="normal";jQuery(this).data("modal-size")&&(t=jQuery(this).data("modal-size")),jQuery(this).data("modal-copy")&&(jQuery("#"+a).html(jQuery(this).parents(".um-field").find(".um-modal-hidden-content").html()),jQuery(this).parents(".um-profile-photo").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-profile-photo").attr("data-user_id")),jQuery(this).parents(".um-cover").attr("data-ratio")&&jQuery("#"+a).attr("data-ratio",jQuery(this).parents(".um-cover").attr("data-ratio")),jQuery(this).parents(".um-cover").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-cover").attr("data-user_id")),0
'); + jQuery('.um-cover-e').html(''); um_responsive(); diff --git a/assets/js/um-profile.min.js b/assets/js/um-profile.min.js index 557d45b8..f51b2566 100644 --- a/assets/js/um-profile.min.js +++ b/assets/js/um-profile.min.js @@ -1 +1 @@ -jQuery(document).ready(function(){jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&&(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&&0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&&(jQuery(".um-profile.um-viewing .um-profile-body").find(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document.body).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").trigger("submit"),!1}),jQuery(document.body).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document.body).on("click",".um-cover a.um-cover-add, .um-photo a",function(e){e.preventDefault()}),jQuery(document.body).on("click",".um-photo-modal",function(e){e.preventDefault();e=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,e),!1}),jQuery(document.body).on("click",".um-reset-profile-photo",function(e){return jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",UM.dropdown.hideAll(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_profile_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce}}),jQuery(this).parents("li").hide(),!1}),jQuery(document.body).on("click",".um-reset-cover-photo",function(e){var t=jQuery(this);return jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html(''),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_cover_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce},success:function(e){t.hide()}}),UM.dropdown.hideAll(),!1}),jQuery(document.body).on("change keyup","#um-meta-bio",function(){if(void 0!==jQuery(this).val()){var t=jQuery(this).data("character-limit"),r=jQuery(this).data("html");let e=t-jQuery(this).val().length;e=(e=1===parseInt(r)?t-jQuery(this).val().replace(/(<([^>]+)>)/gi,"").length:e)<0?0:e,jQuery("span.um-meta-bio-character span.um-bio-limit").text(e);r=e<5?"red":"";jQuery("span.um-meta-bio-character").css("color",r)}}),jQuery("#um-meta-bio").trigger("change"),jQuery(".um-profile form").each(function(){let t=jQuery(this).data("description_key");jQuery(this).find('textarea[name="'+t+'"]').length&&jQuery(document.body).on("change input",'textarea[name="'+t+'"]',function(e){jQuery(this).parents("form").find('textarea[name="'+t+'"]').each(function(){jQuery(this).val(e.currentTarget.value),jQuery("#um-meta-bio")[0]!==e.currentTarget&&jQuery("#um-meta-bio")[0]===jQuery(this)[0]&&jQuery(this).trigger("change")})})}),jQuery(".um-profile-edit a.um_delete-item").on("click",function(e){if(e.preventDefault(),!confirm(wp.i18n.__("Are you sure that you want to delete this user?","ultimate-member")))return!1}),jQuery(".um-profile-nav a").on("touchend",function(e){jQuery(e.currentTarget).trigger("click")})}); \ No newline at end of file +jQuery(document).ready(function(){jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&&(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&&0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&&(jQuery(".um-profile.um-viewing .um-profile-body").find(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document.body).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").trigger("submit"),!1}),jQuery(document.body).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document.body).on("click",".um-cover a.um-cover-add, .um-photo a",function(e){e.preventDefault()}),jQuery(document.body).on("click",".um-photo-modal",function(e){e.preventDefault();e=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,e),!1}),jQuery(document.body).on("click",".um-reset-profile-photo",function(e){return jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",UM.dropdown.hideAll(),jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_profile_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce}}),jQuery(this).parents("li").hide(),!1}),jQuery(document.body).on("click",".um-reset-cover-photo",function(e){var t=jQuery(this);return jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html(''),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:wp.ajax.settings.url,type:"post",data:{action:"um_delete_cover_photo",metakey:metakey,user_id:user_id,nonce:um_scripts.nonce},success:function(e){t.hide()}}),UM.dropdown.hideAll(),!1}),jQuery(document.body).on("change keyup","#um-meta-bio",function(){if(void 0!==jQuery(this).val()){var t=jQuery(this).data("character-limit"),r=jQuery(this).data("html");let e=t-jQuery(this).val().length;e=(e=1===parseInt(r)?t-jQuery(this).val().replace(/(<([^>]+)>)/gi,"").length:e)<0?0:e,jQuery("span.um-meta-bio-character span.um-bio-limit").text(e);r=e<5?"red":"";jQuery("span.um-meta-bio-character").css("color",r)}}),jQuery("#um-meta-bio").trigger("change"),jQuery(".um-profile form").each(function(){let t=jQuery(this).data("description_key");jQuery(this).find('textarea[name="'+t+'"]').length&&jQuery(document.body).on("change input",'textarea[name="'+t+'"]',function(e){jQuery(this).parents("form").find('textarea[name="'+t+'"]').each(function(){jQuery(this).val(e.currentTarget.value),jQuery("#um-meta-bio")[0]!==e.currentTarget&&jQuery("#um-meta-bio")[0]===jQuery(this)[0]&&jQuery(this).trigger("change")})})}),jQuery(".um-profile-edit a.um_delete-item").on("click",function(e){if(e.preventDefault(),!confirm(wp.i18n.__("Are you sure that you want to delete this user?","ultimate-member")))return!1}),jQuery(".um-profile-nav a").on("touchend",function(e){jQuery(e.currentTarget).trigger("click")})}); \ No newline at end of file diff --git a/assets/js/um-responsive.js b/assets/js/um-responsive.js index 9e9b2cfe..ace4e1fe 100644 --- a/assets/js/um-responsive.js +++ b/assets/js/um-responsive.js @@ -6,8 +6,8 @@ jQuery( window ).on( 'load',function() { jQuery(window).on( 'resize', function() { responsive_Modal(); - jQuery('img.cropper-hidden').cropper('destroy'); + wp.hooks.doAction( 'um_window_resize' ); um_responsive(); um_modal_responsive(); -}); \ No newline at end of file +}); diff --git a/assets/js/um-responsive.min.js b/assets/js/um-responsive.min.js index 469e2354..270f6742 100644 --- a/assets/js/um-responsive.min.js +++ b/assets/js/um-responsive.min.js @@ -1 +1 @@ -jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",function(){responsive_Modal(),jQuery("img.cropper-hidden").cropper("destroy"),um_responsive(),um_modal_responsive()}); \ No newline at end of file +jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()}); \ No newline at end of file diff --git a/assets/js/um-scripts.js b/assets/js/um-scripts.js index bef7697a..4f41a742 100644 --- a/assets/js/um-scripts.js +++ b/assets/js/um-scripts.js @@ -95,17 +95,6 @@ function um_init_datetimepicker() { }); } - - -function init_tipsy() { - if ( typeof( jQuery.fn.tipsy ) === 'function' ) { - jQuery('.um-tip-n').tipsy({gravity: 'n', opacity: 1, live: 'a.live', offset: 3 }); - jQuery('.um-tip-w').tipsy({gravity: 'w', opacity: 1, live: 'a.live', offset: 3 }); - jQuery('.um-tip-e').tipsy({gravity: 'e', opacity: 1, live: 'a.live', offset: 3 }); - jQuery('.um-tip-s').tipsy({gravity: 's', opacity: 1, live: 'a.live', offset: 3 }); - } -} - jQuery(document).ready(function() { jQuery( document.body ).on('click', '.um-dropdown a.real_url', function() { @@ -195,8 +184,6 @@ jQuery(document).ready(function() { } ); } - init_tipsy(); - if ( typeof( jQuery.fn.um_raty ) === 'function' ) { jQuery('.um-rating').um_raty({ half: false, @@ -258,67 +245,122 @@ jQuery(document).ready(function() { um_init_datetimepicker(); - jQuery(document).on('click', '.um .um-single-image-preview a.cancel', function( e ) { + jQuery(document.body).on('click', '.um-single-image-preview a.cancel', function(e) { e.preventDefault(); - var parent = jQuery(this).parents('.um-field'); - var filename = parent.find( 'input[type="hidden"]#' + parent.data('key') + '-' + jQuery(this).parents('form').find('input[type="hidden"][name="form_id"]').val() ).val(); + let isModal = false; + if ( jQuery(this).parents('.um-modal-body').length > 0 ) { + isModal = true; + } - var src = jQuery(this).parents('.um-field').find('.um-single-image-preview img').attr('src'); - var mode = parent.data('mode'); + let parent, mode, src, args; - var args = { - data: { - mode: mode, - filename: filename, - src: src, - nonce: um_scripts.nonce - }, - success: function() { - parent.find('.um-single-image-preview img').attr( 'src', '' ); - parent.find('.um-single-image-preview').hide(); - parent.find('.um-btn-auto-width').html( parent.data('upload-label') ); - parent.find('input[type="hidden"]').val( 'empty_file' ); + if ( ! isModal ) { + parent = jQuery(this).parents('.um-field'); + mode = parent.data('mode'); + src = parent.find('.um-single-image-preview img').attr('src'); + + let filename = parent.find( 'input[type="hidden"]#' + parent.data('key') + '-' + jQuery(this).parents('form').find('input[type="hidden"][name="form_id"]').val() ).val(); + + args = { + data: { + mode: mode, + filename: filename, + src: src, + nonce: um_scripts.nonce + }, + success: function() { + parent.find('.um-single-image-preview img').replaceWith(''); + parent.find('.um-single-image-preview').removeAttr('style').hide(); + parent.find('.um-btn-auto-width').html( parent.data('upload-label') ); + parent.find('input[type="hidden"]').val( 'empty_file' ); + } + }; + + if ( mode !== 'register' ) { + args.data.user_id = jQuery(this).parents('form').find('#user_id').val(); } - }; + } else { + parent = jQuery(this).parents('.um-modal-body'); + mode = parent.find('.um-single-image-upload').data('set_mode'); + src = parent.find('.um-single-image-preview img').attr('src'); - if ( mode !== 'register' ) { - args.data.user_id = jQuery(this).parents('form' ).find( '#user_id' ).val(); + args = { + data: { + src: src, + mode: mode, + nonce: um_scripts.nonce + }, + success: function() { + wp.hooks.doAction( 'um_after_removing_preview' ); + + parent.find('.um-single-image-preview img').replaceWith(''); // required replaceWith for flushing DOM before re-init Cropper. + parent.find('.um-single-image-preview').removeAttr('style').hide(); + parent.find('.ajax-upload-dragdrop').show(); + parent.find('.um-modal-btn.um-finish-upload').addClass( 'disabled' ); + + um_modal_responsive(); + } + }; } wp.ajax.send( 'um_remove_file', args ); - - return false; }); - jQuery(document).on('click', '.um .um-single-file-preview a.cancel', function( e ) { + jQuery(document.body).on('click', '.um-single-file-preview a.cancel', function(e) { e.preventDefault(); - var parent = jQuery(this).parents('.um-field'); - var filename = parent.find( 'input[type="hidden"]#' + parent.data('key') + '-' + jQuery(this).parents('form').find('input[type="hidden"][name="form_id"]').val() ).val(); - var src = jQuery(this).parents('.um-field').find('.um-single-fileinfo a').attr('href'); - var mode = parent.data('mode'); - var args = { - data: { - mode: mode, - filename: filename, - src: src, - nonce: um_scripts.nonce - }, - success: function() { - parent.find('.um-single-file-preview').hide(); - parent.find('.um-btn-auto-width').html( parent.data('upload-label') ); - parent.find('input[type=hidden]').val( 'empty_file' ); - } - }; - - if ( mode !== 'register' ) { - args.data.user_id = jQuery(this).parents('form' ).find( '#user_id' ).val(); + let isModal = false; + if ( jQuery(this).parents('.um-modal-body').length > 0 ) { + isModal = true; } - wp.ajax.send( 'um_remove_file', args ); + let parent, mode, src, args; - return false; + if ( ! isModal ) { + parent = jQuery(this).parents('.um-field'); + src = parent.find('.um-single-fileinfo a').attr('href'); + mode = parent.data('mode'); + + let filename = parent.find( 'input[type="hidden"]#' + parent.data('key') + '-' + jQuery(this).parents('form').find('input[type="hidden"][name="form_id"]').val() ).val(); + + args = { + data: { + mode: mode, + filename: filename, + src: src, + nonce: um_scripts.nonce + }, + success: function() { + parent.find('.um-single-file-preview').hide(); + parent.find('.um-btn-auto-width').html( parent.data('upload-label') ); + parent.find('input[type=hidden]').val( 'empty_file' ); + } + }; + + if ( mode !== 'register' ) { + args.data.user_id = jQuery(this).parents('form' ).find( '#user_id' ).val(); + } + } else { + parent = jQuery(this).parents('.um-modal-body'); + src = parent.find('.um-single-fileinfo a').attr('href'); + mode = parent.find('.um-single-file-upload').data('set_mode'); + + args = { + data: { + src: src, + mode: mode, + nonce: um_scripts.nonce + }, + success: function() { + parent.find('.um-single-file-preview').hide(); + parent.find('.ajax-upload-dragdrop').show(); + parent.find('.um-modal-btn.um-finish-upload').addClass('disabled'); + um_modal_responsive(); + } + }; + } + wp.ajax.send( 'um_remove_file', args ); }); jQuery(document).on('click', '.um-field-group-head:not(.disabled)', function() { diff --git a/assets/js/um-scripts.min.js b/assets/js/um-scripts.min.js index f04939b9..e6611f78 100644 --- a/assets/js/um-scripts.min.js +++ b/assets/js/um-scripts.min.js @@ -1 +1 @@ -function um_sanitize_value(e,t){var a=document.createElement("div"),e=(a.innerText=e,a.innerHTML);return t&&jQuery(t).val(e),e}function um_unsanitize_value(e){var t=document.createElement("textarea");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}function um_init_datetimepicker(){jQuery(".um-datepicker:not(.picker__input)").each(function(){var e=jQuery(this),t=!1,a=(void 0!==e.attr("data-disabled_weekdays")&&""!==e.attr("data-disabled_weekdays")&&(t=JSON.parse(e.attr("data-disabled_weekdays"))),null),i=(void 0!==e.attr("data-years")&&(a=e.attr("data-years")),e.attr("data-date_min")),n=e.attr("data-date_max"),r=[],u=[],i=(void 0!==i&&(r=i.split(",")),void 0!==n&&(u=n.split(",")),r.length?new Date(r):null),n=r.length?new Date(u):null,u=(i&&"Invalid Date"==i.toString()&&3==r.length&&(r=r[1]+"/"+r[2]+"/"+r[0],i=new Date(Date.parse(r))),n&&"Invalid Date"==n.toString()&&3==u.length&&(r=u[1]+"/"+u[2]+"/"+u[0],n=new Date(Date.parse(r))),{disable:t,format:e.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){e.blur()},onClose:function(){e.blur()}});null!==a&&(u.selectYears=a),null!==i&&(u.min=i),null!==n&&(u.max=n),e.pickadate(u)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){var e=jQuery(this);e.pickatime({format:e.attr("data-format"),interval:parseInt(e.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){e.blur()},onClose:function(){e.blur()}})})}function init_tipsy(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))}jQuery(document).ready(function(){function i(e){var a=jQuery(e.currentTarget),e=a.find(":selected");1'),a.find(".um-single-image-preview").removeAttr("style").hide(),a.find(".ajax-upload-dragdrop").show(),a.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive()}}):(a=jQuery(this).parents(".um-field"),n=a.data("mode"),i=a.find(".um-single-image-preview img").attr("src"),e=a.find('input[type="hidden"]#'+a.data("key")+"-"+jQuery(this).parents("form").find('input[type="hidden"][name="form_id"]').val()).val(),r={data:{mode:n,filename:e,src:i,nonce:um_scripts.nonce},success:function(){a.find(".um-single-image-preview img").replaceWith(''),a.find(".um-single-image-preview").removeAttr("style").hide(),a.find(".um-btn-auto-width").html(a.data("upload-label")),a.find('input[type="hidden"]').val("empty_file")}},"register"!==n&&(r.data.user_id=jQuery(this).parents("form").find("#user_id").val())),wp.ajax.send("um_remove_file",r)}),jQuery(document.body).on("click",".um-single-file-preview a.cancel",function(e){e.preventDefault();let t=!1;0 arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + + var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined'; + var WINDOW = IS_BROWSER ? window : {}; + var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false; + var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false; + var NAMESPACE = 'cropper'; + + // Actions + var ACTION_ALL = 'all'; + var ACTION_CROP = 'crop'; + var ACTION_MOVE = 'move'; + var ACTION_ZOOM = 'zoom'; + var ACTION_EAST = 'e'; + var ACTION_WEST = 'w'; + var ACTION_SOUTH = 's'; + var ACTION_NORTH = 'n'; + var ACTION_NORTH_EAST = 'ne'; + var ACTION_NORTH_WEST = 'nw'; + var ACTION_SOUTH_EAST = 'se'; + var ACTION_SOUTH_WEST = 'sw'; + + // Classes + var CLASS_CROP = "".concat(NAMESPACE, "-crop"); + var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled"); + var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden"); + var CLASS_HIDE = "".concat(NAMESPACE, "-hide"); + var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible"); + var CLASS_MODAL = "".concat(NAMESPACE, "-modal"); + var CLASS_MOVE = "".concat(NAMESPACE, "-move"); + + // Data keys + var DATA_ACTION = "".concat(NAMESPACE, "Action"); + var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); + + // Drag modes + var DRAG_MODE_CROP = 'crop'; + var DRAG_MODE_MOVE = 'move'; + var DRAG_MODE_NONE = 'none'; + + // Events + var EVENT_CROP = 'crop'; + var EVENT_CROP_END = 'cropend'; + var EVENT_CROP_MOVE = 'cropmove'; + var EVENT_CROP_START = 'cropstart'; + var EVENT_DBLCLICK = 'dblclick'; + var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown'; + var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove'; + var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup'; + var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START; + var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE; + var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END; + var EVENT_READY = 'ready'; + var EVENT_RESIZE = 'resize'; + var EVENT_WHEEL = 'wheel'; + var EVENT_ZOOM = 'zoom'; + + // Mime types + var MIME_TYPE_JPEG = 'image/jpeg'; + + // RegExps + var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/; + var REGEXP_DATA_URL = /^data:/; + var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; + var REGEXP_TAG_NAME = /^img|canvas$/i; + + // Misc + // Inspired by the default width and height of a canvas element. + var MIN_CONTAINER_WIDTH = 200; + var MIN_CONTAINER_HEIGHT = 100; + + var DEFAULTS = { + // Define the view mode of the cropper + viewMode: 0, + // 0, 1, 2, 3 + + // Define the dragging mode of the cropper + dragMode: DRAG_MODE_CROP, + // 'crop', 'move' or 'none' + + // Define the initial aspect ratio of the crop box + initialAspectRatio: NaN, + // Define the aspect ratio of the crop box + aspectRatio: NaN, + // An object with the previous cropping result data + data: null, + // A selector for adding extra containers to preview + preview: '', + // Re-render the cropper when resize the window + responsive: true, + // Restore the cropped area after resize the window + restore: true, + // Check if the current image is a cross-origin image + checkCrossOrigin: true, + // Check the current image's Exif Orientation information + checkOrientation: true, + // Show the black modal + modal: true, + // Show the dashed lines for guiding + guides: true, + // Show the center indicator for guiding + center: true, + // Show the white modal to highlight the crop box + highlight: true, + // Show the grid background + background: true, + // Enable to crop the image automatically when initialize + autoCrop: true, + // Define the percentage of automatic cropping area when initializes + autoCropArea: 0.8, + // Enable to move the image + movable: true, + // Enable to rotate the image + rotatable: true, + // Enable to scale the image + scalable: true, + // Enable to zoom the image + zoomable: true, + // Enable to zoom the image by dragging touch + zoomOnTouch: true, + // Enable to zoom the image by wheeling mouse + zoomOnWheel: true, + // Define zoom ratio when zoom the image by wheeling mouse + wheelZoomRatio: 0.1, + // Enable to move the crop box + cropBoxMovable: true, + // Enable to resize the crop box + cropBoxResizable: true, + // Toggle drag mode between "crop" and "move" when click twice on the cropper + toggleDragModeOnDblclick: true, + // Size limitation + minCanvasWidth: 0, + minCanvasHeight: 0, + minCropBoxWidth: 0, + minCropBoxHeight: 0, + minContainerWidth: MIN_CONTAINER_WIDTH, + minContainerHeight: MIN_CONTAINER_HEIGHT, + // Shortcuts of events + ready: null, + cropstart: null, + cropmove: null, + cropend: null, + crop: null, + zoom: null + }; + + var TEMPLATE = '
' + '
' + '
' + '
' + '
' + '
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + '
'; + + /** + * Check if the given value is not a number. + */ + var isNaN = Number.isNaN || WINDOW.isNaN; + + /** + * Check if the given value is a number. + * @param {*} value - The value to check. + * @returns {boolean} Returns `true` if the given value is a number, else `false`. + */ + function isNumber(value) { + return typeof value === 'number' && !isNaN(value); + } + + /** + * Check if the given value is a positive number. + * @param {*} value - The value to check. + * @returns {boolean} Returns `true` if the given value is a positive number, else `false`. + */ + var isPositiveNumber = function isPositiveNumber(value) { + return value > 0 && value < Infinity; + }; + + /** + * Check if the given value is undefined. + * @param {*} value - The value to check. + * @returns {boolean} Returns `true` if the given value is undefined, else `false`. + */ + function isUndefined(value) { + return typeof value === 'undefined'; + } + + /** + * Check if the given value is an object. + * @param {*} value - The value to check. + * @returns {boolean} Returns `true` if the given value is an object, else `false`. + */ + function isObject(value) { + return _typeof(value) === 'object' && value !== null; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /** + * Check if the given value is a plain object. + * @param {*} value - The value to check. + * @returns {boolean} Returns `true` if the given value is a plain object, else `false`. + */ + function isPlainObject(value) { + if (!isObject(value)) { + return false; + } + try { + var _constructor = value.constructor; + var prototype = _constructor.prototype; + return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf'); + } catch (error) { + return false; + } + } + + /** + * Check if the given value is a function. + * @param {*} value - The value to check. + * @returns {boolean} Returns `true` if the given value is a function, else `false`. + */ + function isFunction(value) { + return typeof value === 'function'; + } + var slice = Array.prototype.slice; + + /** + * Convert array-like or iterable object to an array. + * @param {*} value - The value to convert. + * @returns {Array} Returns a new array. + */ + function toArray(value) { + return Array.from ? Array.from(value) : slice.call(value); + } + + /** + * Iterate the given data. + * @param {*} data - The data to iterate. + * @param {Function} callback - The process function for each element. + * @returns {*} The original data. + */ + function forEach(data, callback) { + if (data && isFunction(callback)) { + if (Array.isArray(data) || isNumber(data.length) /* array-like */) { + toArray(data).forEach(function (value, key) { + callback.call(data, value, key, data); + }); + } else if (isObject(data)) { + Object.keys(data).forEach(function (key) { + callback.call(data, data[key], key, data); + }); + } + } + return data; + } + + /** + * Extend the given object. + * @param {*} target - The target object to extend. + * @param {*} args - The rest objects for merging to the target object. + * @returns {Object} The extended object. + */ + var assign = Object.assign || function assign(target) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + if (isObject(target) && args.length > 0) { + args.forEach(function (arg) { + if (isObject(arg)) { + Object.keys(arg).forEach(function (key) { + target[key] = arg[key]; + }); + } + }); + } + return target; + }; + var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/; + + /** + * Normalize decimal number. + * Check out {@link https://0.30000000000000004.com/} + * @param {number} value - The value to normalize. + * @param {number} [times=100000000000] - The times for normalizing. + * @returns {number} Returns the normalized number. + */ + function normalizeDecimalNumber(value) { + var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000; + return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value; + } + var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/; + + /** + * Apply styles to the given element. + * @param {Element} element - The target element. + * @param {Object} styles - The styles for applying. + */ + function setStyle(element, styles) { + var style = element.style; + forEach(styles, function (value, property) { + if (REGEXP_SUFFIX.test(property) && isNumber(value)) { + value = "".concat(value, "px"); + } + style[property] = value; + }); + } + + /** + * Check if the given element has a special class. + * @param {Element} element - The element to check. + * @param {string} value - The class to search. + * @returns {boolean} Returns `true` if the special class was found. + */ + function hasClass(element, value) { + return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1; + } + + /** + * Add classes to the given element. + * @param {Element} element - The target element. + * @param {string} value - The classes to be added. + */ + function addClass(element, value) { + if (!value) { + return; + } + if (isNumber(element.length)) { + forEach(element, function (elem) { + addClass(elem, value); + }); + return; + } + if (element.classList) { + element.classList.add(value); + return; + } + var className = element.className.trim(); + if (!className) { + element.className = value; + } else if (className.indexOf(value) < 0) { + element.className = "".concat(className, " ").concat(value); + } + } + + /** + * Remove classes from the given element. + * @param {Element} element - The target element. + * @param {string} value - The classes to be removed. + */ + function removeClass(element, value) { + if (!value) { + return; + } + if (isNumber(element.length)) { + forEach(element, function (elem) { + removeClass(elem, value); + }); + return; + } + if (element.classList) { + element.classList.remove(value); + return; + } + if (element.className.indexOf(value) >= 0) { + element.className = element.className.replace(value, ''); + } + } + + /** + * Add or remove classes from the given element. + * @param {Element} element - The target element. + * @param {string} value - The classes to be toggled. + * @param {boolean} added - Add only. + */ + function toggleClass(element, value, added) { + if (!value) { + return; + } + if (isNumber(element.length)) { + forEach(element, function (elem) { + toggleClass(elem, value, added); + }); + return; + } + + // IE10-11 doesn't support the second parameter of `classList.toggle` + if (added) { + addClass(element, value); + } else { + removeClass(element, value); + } + } + var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g; + + /** + * Transform the given string from camelCase to kebab-case + * @param {string} value - The value to transform. + * @returns {string} The transformed value. + */ + function toParamCase(value) { + return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase(); + } + + /** + * Get data from the given element. + * @param {Element} element - The target element. + * @param {string} name - The data key to get. + * @returns {string} The data value. + */ + function getData(element, name) { + if (isObject(element[name])) { + return element[name]; + } + if (element.dataset) { + return element.dataset[name]; + } + return element.getAttribute("data-".concat(toParamCase(name))); + } + + /** + * Set data to the given element. + * @param {Element} element - The target element. + * @param {string} name - The data key to set. + * @param {string} data - The data value. + */ + function setData(element, name, data) { + if (isObject(data)) { + element[name] = data; + } else if (element.dataset) { + element.dataset[name] = data; + } else { + element.setAttribute("data-".concat(toParamCase(name)), data); + } + } + + /** + * Remove data from the given element. + * @param {Element} element - The target element. + * @param {string} name - The data key to remove. + */ + function removeData(element, name) { + if (isObject(element[name])) { + try { + delete element[name]; + } catch (error) { + element[name] = undefined; + } + } else if (element.dataset) { + // #128 Safari not allows to delete dataset property + try { + delete element.dataset[name]; + } catch (error) { + element.dataset[name] = undefined; + } + } else { + element.removeAttribute("data-".concat(toParamCase(name))); + } + } + var REGEXP_SPACES = /\s\s*/; + var onceSupported = function () { + var supported = false; + if (IS_BROWSER) { + var once = false; + var listener = function listener() {}; + var options = Object.defineProperty({}, 'once', { + get: function get() { + supported = true; + return once; + }, + /** + * This setter can fix a `TypeError` in strict mode + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only} + * @param {boolean} value - The value to set + */ + set: function set(value) { + once = value; + } + }); + WINDOW.addEventListener('test', listener, options); + WINDOW.removeEventListener('test', listener, options); + } + return supported; + }(); + + /** + * Remove event listener from the target element. + * @param {Element} element - The event target. + * @param {string} type - The event type(s). + * @param {Function} listener - The event listener. + * @param {Object} options - The event options. + */ + function removeListener(element, type, listener) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var handler = listener; + type.trim().split(REGEXP_SPACES).forEach(function (event) { + if (!onceSupported) { + var listeners = element.listeners; + if (listeners && listeners[event] && listeners[event][listener]) { + handler = listeners[event][listener]; + delete listeners[event][listener]; + if (Object.keys(listeners[event]).length === 0) { + delete listeners[event]; + } + if (Object.keys(listeners).length === 0) { + delete element.listeners; + } + } + } + element.removeEventListener(event, handler, options); + }); + } + + /** + * Add event listener to the target element. + * @param {Element} element - The event target. + * @param {string} type - The event type(s). + * @param {Function} listener - The event listener. + * @param {Object} options - The event options. + */ + function addListener(element, type, listener) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var _handler = listener; + type.trim().split(REGEXP_SPACES).forEach(function (event) { + if (options.once && !onceSupported) { + var _element$listeners = element.listeners, + listeners = _element$listeners === void 0 ? {} : _element$listeners; + _handler = function handler() { + delete listeners[event][listener]; + element.removeEventListener(event, _handler, options); + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + listener.apply(element, args); + }; + if (!listeners[event]) { + listeners[event] = {}; + } + if (listeners[event][listener]) { + element.removeEventListener(event, listeners[event][listener], options); + } + listeners[event][listener] = _handler; + element.listeners = listeners; + } + element.addEventListener(event, _handler, options); + }); + } + + /** + * Dispatch event on the target element. + * @param {Element} element - The event target. + * @param {string} type - The event type(s). + * @param {Object} data - The additional event data. + * @returns {boolean} Indicate if the event is default prevented or not. + */ + function dispatchEvent(element, type, data) { + var event; + + // Event and CustomEvent on IE9-11 are global objects, not constructors + if (isFunction(Event) && isFunction(CustomEvent)) { + event = new CustomEvent(type, { + detail: data, + bubbles: true, + cancelable: true + }); + } else { + event = document.createEvent('CustomEvent'); + event.initCustomEvent(type, true, true, data); + } + return element.dispatchEvent(event); + } + + /** + * Get the offset base on the document. + * @param {Element} element - The target element. + * @returns {Object} The offset data. + */ + function getOffset(element) { + var box = element.getBoundingClientRect(); + return { + left: box.left + (window.pageXOffset - document.documentElement.clientLeft), + top: box.top + (window.pageYOffset - document.documentElement.clientTop) + }; + } + var location = WINDOW.location; + var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i; + + /** + * Check if the given URL is a cross origin URL. + * @param {string} url - The target URL. + * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`. + */ + function isCrossOriginURL(url) { + var parts = url.match(REGEXP_ORIGINS); + return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port); + } + + /** + * Add timestamp to the given URL. + * @param {string} url - The target URL. + * @returns {string} The result URL. + */ + function addTimestamp(url) { + var timestamp = "timestamp=".concat(new Date().getTime()); + return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp; + } + + /** + * Get transforms base on the given object. + * @param {Object} obj - The target object. + * @returns {string} A string contains transform values. + */ + function getTransforms(_ref) { + var rotate = _ref.rotate, + scaleX = _ref.scaleX, + scaleY = _ref.scaleY, + translateX = _ref.translateX, + translateY = _ref.translateY; + var values = []; + if (isNumber(translateX) && translateX !== 0) { + values.push("translateX(".concat(translateX, "px)")); + } + if (isNumber(translateY) && translateY !== 0) { + values.push("translateY(".concat(translateY, "px)")); + } + + // Rotate should come first before scale to match orientation transform + if (isNumber(rotate) && rotate !== 0) { + values.push("rotate(".concat(rotate, "deg)")); + } + if (isNumber(scaleX) && scaleX !== 1) { + values.push("scaleX(".concat(scaleX, ")")); + } + if (isNumber(scaleY) && scaleY !== 1) { + values.push("scaleY(".concat(scaleY, ")")); + } + var transform = values.length ? values.join(' ') : 'none'; + return { + WebkitTransform: transform, + msTransform: transform, + transform: transform + }; + } + + /** + * Get the max ratio of a group of pointers. + * @param {string} pointers - The target pointers. + * @returns {number} The result ratio. + */ + function getMaxZoomRatio(pointers) { + var pointers2 = _objectSpread2({}, pointers); + var maxRatio = 0; + forEach(pointers, function (pointer, pointerId) { + delete pointers2[pointerId]; + forEach(pointers2, function (pointer2) { + var x1 = Math.abs(pointer.startX - pointer2.startX); + var y1 = Math.abs(pointer.startY - pointer2.startY); + var x2 = Math.abs(pointer.endX - pointer2.endX); + var y2 = Math.abs(pointer.endY - pointer2.endY); + var z1 = Math.sqrt(x1 * x1 + y1 * y1); + var z2 = Math.sqrt(x2 * x2 + y2 * y2); + var ratio = (z2 - z1) / z1; + if (Math.abs(ratio) > Math.abs(maxRatio)) { + maxRatio = ratio; + } + }); + }); + return maxRatio; + } + + /** + * Get a pointer from an event object. + * @param {Object} event - The target event object. + * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not. + * @returns {Object} The result pointer contains start and/or end point coordinates. + */ + function getPointer(_ref2, endOnly) { + var pageX = _ref2.pageX, + pageY = _ref2.pageY; + var end = { + endX: pageX, + endY: pageY + }; + return endOnly ? end : _objectSpread2({ + startX: pageX, + startY: pageY + }, end); + } + + /** + * Get the center point coordinate of a group of pointers. + * @param {Object} pointers - The target pointers. + * @returns {Object} The center point coordinate. + */ + function getPointersCenter(pointers) { + var pageX = 0; + var pageY = 0; + var count = 0; + forEach(pointers, function (_ref3) { + var startX = _ref3.startX, + startY = _ref3.startY; + pageX += startX; + pageY += startY; + count += 1; + }); + pageX /= count; + pageY /= count; + return { + pageX: pageX, + pageY: pageY + }; + } + + /** + * Get the max sizes in a rectangle under the given aspect ratio. + * @param {Object} data - The original sizes. + * @param {string} [type='contain'] - The adjust type. + * @returns {Object} The result sizes. + */ + function getAdjustedSizes(_ref4) { + var aspectRatio = _ref4.aspectRatio, + height = _ref4.height, + width = _ref4.width; + var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain'; + var isValidWidth = isPositiveNumber(width); + var isValidHeight = isPositiveNumber(height); + if (isValidWidth && isValidHeight) { + var adjustedWidth = height * aspectRatio; + if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) { + height = width / aspectRatio; + } else { + width = height * aspectRatio; + } + } else if (isValidWidth) { + height = width / aspectRatio; + } else if (isValidHeight) { + width = height * aspectRatio; + } + return { + width: width, + height: height + }; + } + + /** + * Get the new sizes of a rectangle after rotated. + * @param {Object} data - The original sizes. + * @returns {Object} The result sizes. + */ + function getRotatedSizes(_ref5) { + var width = _ref5.width, + height = _ref5.height, + degree = _ref5.degree; + degree = Math.abs(degree) % 180; + if (degree === 90) { + return { + width: height, + height: width + }; + } + var arc = degree % 90 * Math.PI / 180; + var sinArc = Math.sin(arc); + var cosArc = Math.cos(arc); + var newWidth = width * cosArc + height * sinArc; + var newHeight = width * sinArc + height * cosArc; + return degree > 90 ? { + width: newHeight, + height: newWidth + } : { + width: newWidth, + height: newHeight + }; + } + + /** + * Get a canvas which drew the given image. + * @param {HTMLImageElement} image - The image for drawing. + * @param {Object} imageData - The image data. + * @param {Object} canvasData - The canvas data. + * @param {Object} options - The options. + * @returns {HTMLCanvasElement} The result canvas. + */ + function getSourceCanvas(image, _ref6, _ref7, _ref8) { + var imageAspectRatio = _ref6.aspectRatio, + imageNaturalWidth = _ref6.naturalWidth, + imageNaturalHeight = _ref6.naturalHeight, + _ref6$rotate = _ref6.rotate, + rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate, + _ref6$scaleX = _ref6.scaleX, + scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX, + _ref6$scaleY = _ref6.scaleY, + scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY; + var aspectRatio = _ref7.aspectRatio, + naturalWidth = _ref7.naturalWidth, + naturalHeight = _ref7.naturalHeight; + var _ref8$fillColor = _ref8.fillColor, + fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor, + _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled, + imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE, + _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality, + imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ, + _ref8$maxWidth = _ref8.maxWidth, + maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth, + _ref8$maxHeight = _ref8.maxHeight, + maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight, + _ref8$minWidth = _ref8.minWidth, + minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth, + _ref8$minHeight = _ref8.minHeight, + minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight; + var canvas = document.createElement('canvas'); + var context = canvas.getContext('2d'); + var maxSizes = getAdjustedSizes({ + aspectRatio: aspectRatio, + width: maxWidth, + height: maxHeight + }); + var minSizes = getAdjustedSizes({ + aspectRatio: aspectRatio, + width: minWidth, + height: minHeight + }, 'cover'); + var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth)); + var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); + + // Note: should always use image's natural sizes for drawing as + // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90 + var destMaxSizes = getAdjustedSizes({ + aspectRatio: imageAspectRatio, + width: maxWidth, + height: maxHeight + }); + var destMinSizes = getAdjustedSizes({ + aspectRatio: imageAspectRatio, + width: minWidth, + height: minHeight + }, 'cover'); + var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth)); + var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight)); + var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight]; + canvas.width = normalizeDecimalNumber(width); + canvas.height = normalizeDecimalNumber(height); + context.fillStyle = fillColor; + context.fillRect(0, 0, width, height); + context.save(); + context.translate(width / 2, height / 2); + context.rotate(rotate * Math.PI / 180); + context.scale(scaleX, scaleY); + context.imageSmoothingEnabled = imageSmoothingEnabled; + context.imageSmoothingQuality = imageSmoothingQuality; + context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) { + return Math.floor(normalizeDecimalNumber(param)); + })))); + context.restore(); + return canvas; + } + var fromCharCode = String.fromCharCode; + + /** + * Get string from char code in data view. + * @param {DataView} dataView - The data view for read. + * @param {number} start - The start index. + * @param {number} length - The read length. + * @returns {string} The read result. + */ + function getStringFromCharCode(dataView, start, length) { + var str = ''; + length += start; + for (var i = start; i < length; i += 1) { + str += fromCharCode(dataView.getUint8(i)); + } + return str; + } + var REGEXP_DATA_URL_HEAD = /^data:.*,/; + + /** + * Transform Data URL to array buffer. + * @param {string} dataURL - The Data URL to transform. + * @returns {ArrayBuffer} The result array buffer. + */ + function dataURLToArrayBuffer(dataURL) { + var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, ''); + var binary = atob(base64); + var arrayBuffer = new ArrayBuffer(binary.length); + var uint8 = new Uint8Array(arrayBuffer); + forEach(uint8, function (value, i) { + uint8[i] = binary.charCodeAt(i); + }); + return arrayBuffer; + } + + /** + * Transform array buffer to Data URL. + * @param {ArrayBuffer} arrayBuffer - The array buffer to transform. + * @param {string} mimeType - The mime type of the Data URL. + * @returns {string} The result Data URL. + */ + function arrayBufferToDataURL(arrayBuffer, mimeType) { + var chunks = []; + + // Chunk Typed Array for better performance (#435) + var chunkSize = 8192; + var uint8 = new Uint8Array(arrayBuffer); + while (uint8.length > 0) { + // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9 + // eslint-disable-next-line prefer-spread + chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize)))); + uint8 = uint8.subarray(chunkSize); + } + return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join(''))); + } + + /** + * Get orientation value from given array buffer. + * @param {ArrayBuffer} arrayBuffer - The array buffer to read. + * @returns {number} The read orientation value. + */ + function resetAndGetOrientation(arrayBuffer) { + var dataView = new DataView(arrayBuffer); + var orientation; + + // Ignores range error when the image does not have correct Exif information + try { + var littleEndian; + var app1Start; + var ifdStart; + + // Only handle JPEG image (start by 0xFFD8) + if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) { + var length = dataView.byteLength; + var offset = 2; + while (offset + 1 < length) { + if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) { + app1Start = offset; + break; + } + offset += 1; + } + } + if (app1Start) { + var exifIDCode = app1Start + 4; + var tiffOffset = app1Start + 10; + if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') { + var endianness = dataView.getUint16(tiffOffset); + littleEndian = endianness === 0x4949; + if (littleEndian || endianness === 0x4D4D /* bigEndian */) { + if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) { + var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian); + if (firstIFDOffset >= 0x00000008) { + ifdStart = tiffOffset + firstIFDOffset; + } + } + } + } + } + if (ifdStart) { + var _length = dataView.getUint16(ifdStart, littleEndian); + var _offset; + var i; + for (i = 0; i < _length; i += 1) { + _offset = ifdStart + i * 12 + 2; + if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) { + // 8 is the offset of the current tag's value + _offset += 8; + + // Get the original orientation value + orientation = dataView.getUint16(_offset, littleEndian); + + // Override the orientation with its default value + dataView.setUint16(_offset, 1, littleEndian); + break; + } + } + } + } catch (error) { + orientation = 1; + } + return orientation; + } + + /** + * Parse Exif Orientation value. + * @param {number} orientation - The orientation to parse. + * @returns {Object} The parsed result. + */ + function parseOrientation(orientation) { + var rotate = 0; + var scaleX = 1; + var scaleY = 1; + switch (orientation) { + // Flip horizontal + case 2: + scaleX = -1; + break; + + // Rotate left 180° + case 3: + rotate = -180; + break; + + // Flip vertical + case 4: + scaleY = -1; + break; + + // Flip vertical and rotate right 90° + case 5: + rotate = 90; + scaleY = -1; + break; + + // Rotate right 90° + case 6: + rotate = 90; + break; + + // Flip horizontal and rotate right 90° + case 7: + rotate = 90; + scaleX = -1; + break; + + // Rotate left 90° + case 8: + rotate = -90; + break; + } + return { + rotate: rotate, + scaleX: scaleX, + scaleY: scaleY + }; + } + + var render = { + render: function render() { + this.initContainer(); + this.initCanvas(); + this.initCropBox(); + this.renderCanvas(); + if (this.cropped) { + this.renderCropBox(); + } + }, + initContainer: function initContainer() { + var element = this.element, + options = this.options, + container = this.container, + cropper = this.cropper; + var minWidth = Number(options.minContainerWidth); + var minHeight = Number(options.minContainerHeight); + addClass(cropper, CLASS_HIDDEN); + removeClass(element, CLASS_HIDDEN); + var containerData = { + width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH), + height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT) + }; + this.containerData = containerData; + setStyle(cropper, { + width: containerData.width, + height: containerData.height + }); + addClass(element, CLASS_HIDDEN); + removeClass(cropper, CLASS_HIDDEN); + }, + // Canvas (image wrapper) + initCanvas: function initCanvas() { + var containerData = this.containerData, + imageData = this.imageData; + var viewMode = this.options.viewMode; + var rotated = Math.abs(imageData.rotate) % 180 === 90; + var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth; + var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight; + var aspectRatio = naturalWidth / naturalHeight; + var canvasWidth = containerData.width; + var canvasHeight = containerData.height; + if (containerData.height * aspectRatio > containerData.width) { + if (viewMode === 3) { + canvasWidth = containerData.height * aspectRatio; + } else { + canvasHeight = containerData.width / aspectRatio; + } + } else if (viewMode === 3) { + canvasHeight = containerData.width / aspectRatio; + } else { + canvasWidth = containerData.height * aspectRatio; + } + var canvasData = { + aspectRatio: aspectRatio, + naturalWidth: naturalWidth, + naturalHeight: naturalHeight, + width: canvasWidth, + height: canvasHeight + }; + this.canvasData = canvasData; + this.limited = viewMode === 1 || viewMode === 2; + this.limitCanvas(true, true); + canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); + canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); + canvasData.left = (containerData.width - canvasData.width) / 2; + canvasData.top = (containerData.height - canvasData.height) / 2; + canvasData.oldLeft = canvasData.left; + canvasData.oldTop = canvasData.top; + this.initialCanvasData = assign({}, canvasData); + }, + limitCanvas: function limitCanvas(sizeLimited, positionLimited) { + var options = this.options, + containerData = this.containerData, + canvasData = this.canvasData, + cropBoxData = this.cropBoxData; + var viewMode = options.viewMode; + var aspectRatio = canvasData.aspectRatio; + var cropped = this.cropped && cropBoxData; + if (sizeLimited) { + var minCanvasWidth = Number(options.minCanvasWidth) || 0; + var minCanvasHeight = Number(options.minCanvasHeight) || 0; + if (viewMode > 1) { + minCanvasWidth = Math.max(minCanvasWidth, containerData.width); + minCanvasHeight = Math.max(minCanvasHeight, containerData.height); + if (viewMode === 3) { + if (minCanvasHeight * aspectRatio > minCanvasWidth) { + minCanvasWidth = minCanvasHeight * aspectRatio; + } else { + minCanvasHeight = minCanvasWidth / aspectRatio; + } + } + } else if (viewMode > 0) { + if (minCanvasWidth) { + minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0); + } else if (minCanvasHeight) { + minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0); + } else if (cropped) { + minCanvasWidth = cropBoxData.width; + minCanvasHeight = cropBoxData.height; + if (minCanvasHeight * aspectRatio > minCanvasWidth) { + minCanvasWidth = minCanvasHeight * aspectRatio; + } else { + minCanvasHeight = minCanvasWidth / aspectRatio; + } + } + } + var _getAdjustedSizes = getAdjustedSizes({ + aspectRatio: aspectRatio, + width: minCanvasWidth, + height: minCanvasHeight + }); + minCanvasWidth = _getAdjustedSizes.width; + minCanvasHeight = _getAdjustedSizes.height; + canvasData.minWidth = minCanvasWidth; + canvasData.minHeight = minCanvasHeight; + canvasData.maxWidth = Infinity; + canvasData.maxHeight = Infinity; + } + if (positionLimited) { + if (viewMode > (cropped ? 0 : 1)) { + var newCanvasLeft = containerData.width - canvasData.width; + var newCanvasTop = containerData.height - canvasData.height; + canvasData.minLeft = Math.min(0, newCanvasLeft); + canvasData.minTop = Math.min(0, newCanvasTop); + canvasData.maxLeft = Math.max(0, newCanvasLeft); + canvasData.maxTop = Math.max(0, newCanvasTop); + if (cropped && this.limited) { + canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width)); + canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height)); + canvasData.maxLeft = cropBoxData.left; + canvasData.maxTop = cropBoxData.top; + if (viewMode === 2) { + if (canvasData.width >= containerData.width) { + canvasData.minLeft = Math.min(0, newCanvasLeft); + canvasData.maxLeft = Math.max(0, newCanvasLeft); + } + if (canvasData.height >= containerData.height) { + canvasData.minTop = Math.min(0, newCanvasTop); + canvasData.maxTop = Math.max(0, newCanvasTop); + } + } + } + } else { + canvasData.minLeft = -canvasData.width; + canvasData.minTop = -canvasData.height; + canvasData.maxLeft = containerData.width; + canvasData.maxTop = containerData.height; + } + } + }, + renderCanvas: function renderCanvas(changed, transformed) { + var canvasData = this.canvasData, + imageData = this.imageData; + if (transformed) { + var _getRotatedSizes = getRotatedSizes({ + width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1), + height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1), + degree: imageData.rotate || 0 + }), + naturalWidth = _getRotatedSizes.width, + naturalHeight = _getRotatedSizes.height; + var width = canvasData.width * (naturalWidth / canvasData.naturalWidth); + var height = canvasData.height * (naturalHeight / canvasData.naturalHeight); + canvasData.left -= (width - canvasData.width) / 2; + canvasData.top -= (height - canvasData.height) / 2; + canvasData.width = width; + canvasData.height = height; + canvasData.aspectRatio = naturalWidth / naturalHeight; + canvasData.naturalWidth = naturalWidth; + canvasData.naturalHeight = naturalHeight; + this.limitCanvas(true, false); + } + if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) { + canvasData.left = canvasData.oldLeft; + } + if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) { + canvasData.top = canvasData.oldTop; + } + canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); + canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); + this.limitCanvas(false, true); + canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft); + canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop); + canvasData.oldLeft = canvasData.left; + canvasData.oldTop = canvasData.top; + setStyle(this.canvas, assign({ + width: canvasData.width, + height: canvasData.height + }, getTransforms({ + translateX: canvasData.left, + translateY: canvasData.top + }))); + this.renderImage(changed); + if (this.cropped && this.limited) { + this.limitCropBox(true, true); + } + }, + renderImage: function renderImage(changed) { + var canvasData = this.canvasData, + imageData = this.imageData; + var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth); + var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight); + assign(imageData, { + width: width, + height: height, + left: (canvasData.width - width) / 2, + top: (canvasData.height - height) / 2 + }); + setStyle(this.image, assign({ + width: imageData.width, + height: imageData.height + }, getTransforms(assign({ + translateX: imageData.left, + translateY: imageData.top + }, imageData)))); + if (changed) { + this.output(); + } + }, + initCropBox: function initCropBox() { + var options = this.options, + canvasData = this.canvasData; + var aspectRatio = options.aspectRatio || options.initialAspectRatio; + var autoCropArea = Number(options.autoCropArea) || 0.8; + var cropBoxData = { + width: canvasData.width, + height: canvasData.height + }; + if (aspectRatio) { + if (canvasData.height * aspectRatio > canvasData.width) { + cropBoxData.height = cropBoxData.width / aspectRatio; + } else { + cropBoxData.width = cropBoxData.height * aspectRatio; + } + } + this.cropBoxData = cropBoxData; + this.limitCropBox(true, true); + + // Initialize auto crop area + cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); + cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); + + // The width/height of auto crop area must large than "minWidth/Height" + cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea); + cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea); + cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2; + cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2; + cropBoxData.oldLeft = cropBoxData.left; + cropBoxData.oldTop = cropBoxData.top; + this.initialCropBoxData = assign({}, cropBoxData); + }, + limitCropBox: function limitCropBox(sizeLimited, positionLimited) { + var options = this.options, + containerData = this.containerData, + canvasData = this.canvasData, + cropBoxData = this.cropBoxData, + limited = this.limited; + var aspectRatio = options.aspectRatio; + if (sizeLimited) { + var minCropBoxWidth = Number(options.minCropBoxWidth) || 0; + var minCropBoxHeight = Number(options.minCropBoxHeight) || 0; + var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width; + var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; + + // The min/maxCropBoxWidth/Height must be less than container's width/height + minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width); + minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height); + if (aspectRatio) { + if (minCropBoxWidth && minCropBoxHeight) { + if (minCropBoxHeight * aspectRatio > minCropBoxWidth) { + minCropBoxHeight = minCropBoxWidth / aspectRatio; + } else { + minCropBoxWidth = minCropBoxHeight * aspectRatio; + } + } else if (minCropBoxWidth) { + minCropBoxHeight = minCropBoxWidth / aspectRatio; + } else if (minCropBoxHeight) { + minCropBoxWidth = minCropBoxHeight * aspectRatio; + } + if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) { + maxCropBoxHeight = maxCropBoxWidth / aspectRatio; + } else { + maxCropBoxWidth = maxCropBoxHeight * aspectRatio; + } + } + + // The minWidth/Height must be less than maxWidth/Height + cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth); + cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight); + cropBoxData.maxWidth = maxCropBoxWidth; + cropBoxData.maxHeight = maxCropBoxHeight; + } + if (positionLimited) { + if (limited) { + cropBoxData.minLeft = Math.max(0, canvasData.left); + cropBoxData.minTop = Math.max(0, canvasData.top); + cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width; + cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height; + } else { + cropBoxData.minLeft = 0; + cropBoxData.minTop = 0; + cropBoxData.maxLeft = containerData.width - cropBoxData.width; + cropBoxData.maxTop = containerData.height - cropBoxData.height; + } + } + }, + renderCropBox: function renderCropBox() { + var options = this.options, + containerData = this.containerData, + cropBoxData = this.cropBoxData; + if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) { + cropBoxData.left = cropBoxData.oldLeft; + } + if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) { + cropBoxData.top = cropBoxData.oldTop; + } + cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth); + cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); + this.limitCropBox(false, true); + cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft); + cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop); + cropBoxData.oldLeft = cropBoxData.left; + cropBoxData.oldTop = cropBoxData.top; + if (options.movable && options.cropBoxMovable) { + // Turn to move the canvas when the crop box is equal to the container + setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL); + } + setStyle(this.cropBox, assign({ + width: cropBoxData.width, + height: cropBoxData.height + }, getTransforms({ + translateX: cropBoxData.left, + translateY: cropBoxData.top + }))); + if (this.cropped && this.limited) { + this.limitCanvas(true, true); + } + if (!this.disabled) { + this.output(); + } + }, + output: function output() { + this.preview(); + dispatchEvent(this.element, EVENT_CROP, this.getData()); + } + }; + + var preview = { + initPreview: function initPreview() { + var element = this.element, + crossOrigin = this.crossOrigin; + var preview = this.options.preview; + var url = crossOrigin ? this.crossOriginUrl : this.url; + var alt = element.alt || 'The image to preview'; + var image = document.createElement('img'); + if (crossOrigin) { + image.crossOrigin = crossOrigin; + } + image.src = url; + image.alt = alt; + this.viewBox.appendChild(image); + this.viewBoxImage = image; + if (!preview) { + return; + } + var previews = preview; + if (typeof preview === 'string') { + previews = element.ownerDocument.querySelectorAll(preview); + } else if (preview.querySelector) { + previews = [preview]; + } + this.previews = previews; + forEach(previews, function (el) { + var img = document.createElement('img'); + + // Save the original size for recover + setData(el, DATA_PREVIEW, { + width: el.offsetWidth, + height: el.offsetHeight, + html: el.innerHTML + }); + if (crossOrigin) { + img.crossOrigin = crossOrigin; + } + img.src = url; + img.alt = alt; + + /** + * Override img element styles + * Add `display:block` to avoid margin top issue + * Add `height:auto` to override `height` attribute on IE8 + * (Occur only when margin-top <= -height) + */ + img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"'; + el.innerHTML = ''; + el.appendChild(img); + }); + }, + resetPreview: function resetPreview() { + forEach(this.previews, function (element) { + var data = getData(element, DATA_PREVIEW); + setStyle(element, { + width: data.width, + height: data.height + }); + element.innerHTML = data.html; + removeData(element, DATA_PREVIEW); + }); + }, + preview: function preview() { + var imageData = this.imageData, + canvasData = this.canvasData, + cropBoxData = this.cropBoxData; + var cropBoxWidth = cropBoxData.width, + cropBoxHeight = cropBoxData.height; + var width = imageData.width, + height = imageData.height; + var left = cropBoxData.left - canvasData.left - imageData.left; + var top = cropBoxData.top - canvasData.top - imageData.top; + if (!this.cropped || this.disabled) { + return; + } + setStyle(this.viewBoxImage, assign({ + width: width, + height: height + }, getTransforms(assign({ + translateX: -left, + translateY: -top + }, imageData)))); + forEach(this.previews, function (element) { + var data = getData(element, DATA_PREVIEW); + var originalWidth = data.width; + var originalHeight = data.height; + var newWidth = originalWidth; + var newHeight = originalHeight; + var ratio = 1; + if (cropBoxWidth) { + ratio = originalWidth / cropBoxWidth; + newHeight = cropBoxHeight * ratio; + } + if (cropBoxHeight && newHeight > originalHeight) { + ratio = originalHeight / cropBoxHeight; + newWidth = cropBoxWidth * ratio; + newHeight = originalHeight; + } + setStyle(element, { + width: newWidth, + height: newHeight + }); + setStyle(element.getElementsByTagName('img')[0], assign({ + width: width * ratio, + height: height * ratio + }, getTransforms(assign({ + translateX: -left * ratio, + translateY: -top * ratio + }, imageData)))); + }); + } + }; + + var events = { + bind: function bind() { + var element = this.element, + options = this.options, + cropper = this.cropper; + if (isFunction(options.cropstart)) { + addListener(element, EVENT_CROP_START, options.cropstart); + } + if (isFunction(options.cropmove)) { + addListener(element, EVENT_CROP_MOVE, options.cropmove); + } + if (isFunction(options.cropend)) { + addListener(element, EVENT_CROP_END, options.cropend); + } + if (isFunction(options.crop)) { + addListener(element, EVENT_CROP, options.crop); + } + if (isFunction(options.zoom)) { + addListener(element, EVENT_ZOOM, options.zoom); + } + addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this)); + if (options.zoomable && options.zoomOnWheel) { + addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), { + passive: false, + capture: true + }); + } + if (options.toggleDragModeOnDblclick) { + addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this)); + } + addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this)); + addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this)); + if (options.responsive) { + addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this)); + } + }, + unbind: function unbind() { + var element = this.element, + options = this.options, + cropper = this.cropper; + if (isFunction(options.cropstart)) { + removeListener(element, EVENT_CROP_START, options.cropstart); + } + if (isFunction(options.cropmove)) { + removeListener(element, EVENT_CROP_MOVE, options.cropmove); + } + if (isFunction(options.cropend)) { + removeListener(element, EVENT_CROP_END, options.cropend); + } + if (isFunction(options.crop)) { + removeListener(element, EVENT_CROP, options.crop); + } + if (isFunction(options.zoom)) { + removeListener(element, EVENT_ZOOM, options.zoom); + } + removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart); + if (options.zoomable && options.zoomOnWheel) { + removeListener(cropper, EVENT_WHEEL, this.onWheel, { + passive: false, + capture: true + }); + } + if (options.toggleDragModeOnDblclick) { + removeListener(cropper, EVENT_DBLCLICK, this.onDblclick); + } + removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove); + removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd); + if (options.responsive) { + removeListener(window, EVENT_RESIZE, this.onResize); + } + } + }; + + var handlers = { + resize: function resize() { + if (this.disabled) { + return; + } + var options = this.options, + container = this.container, + containerData = this.containerData; + var ratioX = container.offsetWidth / containerData.width; + var ratioY = container.offsetHeight / containerData.height; + var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; + + // Resize when width changed or height changed + if (ratio !== 1) { + var canvasData; + var cropBoxData; + if (options.restore) { + canvasData = this.getCanvasData(); + cropBoxData = this.getCropBoxData(); + } + this.render(); + if (options.restore) { + this.setCanvasData(forEach(canvasData, function (n, i) { + canvasData[i] = n * ratio; + })); + this.setCropBoxData(forEach(cropBoxData, function (n, i) { + cropBoxData[i] = n * ratio; + })); + } + } + }, + dblclick: function dblclick() { + if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) { + return; + } + this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP); + }, + wheel: function wheel(event) { + var _this = this; + var ratio = Number(this.options.wheelZoomRatio) || 0.1; + var delta = 1; + if (this.disabled) { + return; + } + event.preventDefault(); + + // Limit wheel speed to prevent zoom too fast (#21) + if (this.wheeling) { + return; + } + this.wheeling = true; + setTimeout(function () { + _this.wheeling = false; + }, 50); + if (event.deltaY) { + delta = event.deltaY > 0 ? 1 : -1; + } else if (event.wheelDelta) { + delta = -event.wheelDelta / 120; + } else if (event.detail) { + delta = event.detail > 0 ? 1 : -1; + } + this.zoom(-delta * ratio, event); + }, + cropStart: function cropStart(event) { + var buttons = event.buttons, + button = event.button; + if (this.disabled + + // Handle mouse event and pointer event and ignore touch event + || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( + // No primary button (Usually the left button) + isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 + + // Open context menu + || event.ctrlKey)) { + return; + } + var options = this.options, + pointers = this.pointers; + var action; + if (event.changedTouches) { + // Handle touch event + forEach(event.changedTouches, function (touch) { + pointers[touch.identifier] = getPointer(touch); + }); + } else { + // Handle mouse event and pointer event + pointers[event.pointerId || 0] = getPointer(event); + } + if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) { + action = ACTION_ZOOM; + } else { + action = getData(event.target, DATA_ACTION); + } + if (!REGEXP_ACTIONS.test(action)) { + return; + } + if (dispatchEvent(this.element, EVENT_CROP_START, { + originalEvent: event, + action: action + }) === false) { + return; + } + + // This line is required for preventing page zooming in iOS browsers + event.preventDefault(); + this.action = action; + this.cropping = false; + if (action === ACTION_CROP) { + this.cropping = true; + addClass(this.dragBox, CLASS_MODAL); + } + }, + cropMove: function cropMove(event) { + var action = this.action; + if (this.disabled || !action) { + return; + } + var pointers = this.pointers; + event.preventDefault(); + if (dispatchEvent(this.element, EVENT_CROP_MOVE, { + originalEvent: event, + action: action + }) === false) { + return; + } + if (event.changedTouches) { + forEach(event.changedTouches, function (touch) { + // The first parameter should not be undefined (#432) + assign(pointers[touch.identifier] || {}, getPointer(touch, true)); + }); + } else { + assign(pointers[event.pointerId || 0] || {}, getPointer(event, true)); + } + this.change(event); + }, + cropEnd: function cropEnd(event) { + if (this.disabled) { + return; + } + var action = this.action, + pointers = this.pointers; + if (event.changedTouches) { + forEach(event.changedTouches, function (touch) { + delete pointers[touch.identifier]; + }); + } else { + delete pointers[event.pointerId || 0]; + } + if (!action) { + return; + } + event.preventDefault(); + if (!Object.keys(pointers).length) { + this.action = ''; + } + if (this.cropping) { + this.cropping = false; + toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal); + } + dispatchEvent(this.element, EVENT_CROP_END, { + originalEvent: event, + action: action + }); + } + }; + + var change = { + change: function change(event) { + var options = this.options, + canvasData = this.canvasData, + containerData = this.containerData, + cropBoxData = this.cropBoxData, + pointers = this.pointers; + var action = this.action; + var aspectRatio = options.aspectRatio; + var left = cropBoxData.left, + top = cropBoxData.top, + width = cropBoxData.width, + height = cropBoxData.height; + var right = left + width; + var bottom = top + height; + var minLeft = 0; + var minTop = 0; + var maxWidth = containerData.width; + var maxHeight = containerData.height; + var renderable = true; + var offset; + + // Locking aspect ratio in "free mode" by holding shift key + if (!aspectRatio && event.shiftKey) { + aspectRatio = width && height ? width / height : 1; + } + if (this.limited) { + minLeft = cropBoxData.minLeft; + minTop = cropBoxData.minTop; + maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width); + maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height); + } + var pointer = pointers[Object.keys(pointers)[0]]; + var range = { + x: pointer.endX - pointer.startX, + y: pointer.endY - pointer.startY + }; + var check = function check(side) { + switch (side) { + case ACTION_EAST: + if (right + range.x > maxWidth) { + range.x = maxWidth - right; + } + break; + case ACTION_WEST: + if (left + range.x < minLeft) { + range.x = minLeft - left; + } + break; + case ACTION_NORTH: + if (top + range.y < minTop) { + range.y = minTop - top; + } + break; + case ACTION_SOUTH: + if (bottom + range.y > maxHeight) { + range.y = maxHeight - bottom; + } + break; + } + }; + switch (action) { + // Move crop box + case ACTION_ALL: + left += range.x; + top += range.y; + break; + + // Resize crop box + case ACTION_EAST: + if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) { + renderable = false; + break; + } + check(ACTION_EAST); + width += range.x; + if (width < 0) { + action = ACTION_WEST; + width = -width; + left -= width; + } + if (aspectRatio) { + height = width / aspectRatio; + top += (cropBoxData.height - height) / 2; + } + break; + case ACTION_NORTH: + if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) { + renderable = false; + break; + } + check(ACTION_NORTH); + height -= range.y; + top += range.y; + if (height < 0) { + action = ACTION_SOUTH; + height = -height; + top -= height; + } + if (aspectRatio) { + width = height * aspectRatio; + left += (cropBoxData.width - width) / 2; + } + break; + case ACTION_WEST: + if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) { + renderable = false; + break; + } + check(ACTION_WEST); + width -= range.x; + left += range.x; + if (width < 0) { + action = ACTION_EAST; + width = -width; + left -= width; + } + if (aspectRatio) { + height = width / aspectRatio; + top += (cropBoxData.height - height) / 2; + } + break; + case ACTION_SOUTH: + if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) { + renderable = false; + break; + } + check(ACTION_SOUTH); + height += range.y; + if (height < 0) { + action = ACTION_NORTH; + height = -height; + top -= height; + } + if (aspectRatio) { + width = height * aspectRatio; + left += (cropBoxData.width - width) / 2; + } + break; + case ACTION_NORTH_EAST: + if (aspectRatio) { + if (range.y <= 0 && (top <= minTop || right >= maxWidth)) { + renderable = false; + break; + } + check(ACTION_NORTH); + height -= range.y; + top += range.y; + width = height * aspectRatio; + } else { + check(ACTION_NORTH); + check(ACTION_EAST); + if (range.x >= 0) { + if (right < maxWidth) { + width += range.x; + } else if (range.y <= 0 && top <= minTop) { + renderable = false; + } + } else { + width += range.x; + } + if (range.y <= 0) { + if (top > minTop) { + height -= range.y; + top += range.y; + } + } else { + height -= range.y; + top += range.y; + } + } + if (width < 0 && height < 0) { + action = ACTION_SOUTH_WEST; + height = -height; + width = -width; + top -= height; + left -= width; + } else if (width < 0) { + action = ACTION_NORTH_WEST; + width = -width; + left -= width; + } else if (height < 0) { + action = ACTION_SOUTH_EAST; + height = -height; + top -= height; + } + break; + case ACTION_NORTH_WEST: + if (aspectRatio) { + if (range.y <= 0 && (top <= minTop || left <= minLeft)) { + renderable = false; + break; + } + check(ACTION_NORTH); + height -= range.y; + top += range.y; + width = height * aspectRatio; + left += cropBoxData.width - width; + } else { + check(ACTION_NORTH); + check(ACTION_WEST); + if (range.x <= 0) { + if (left > minLeft) { + width -= range.x; + left += range.x; + } else if (range.y <= 0 && top <= minTop) { + renderable = false; + } + } else { + width -= range.x; + left += range.x; + } + if (range.y <= 0) { + if (top > minTop) { + height -= range.y; + top += range.y; + } + } else { + height -= range.y; + top += range.y; + } + } + if (width < 0 && height < 0) { + action = ACTION_SOUTH_EAST; + height = -height; + width = -width; + top -= height; + left -= width; + } else if (width < 0) { + action = ACTION_NORTH_EAST; + width = -width; + left -= width; + } else if (height < 0) { + action = ACTION_SOUTH_WEST; + height = -height; + top -= height; + } + break; + case ACTION_SOUTH_WEST: + if (aspectRatio) { + if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) { + renderable = false; + break; + } + check(ACTION_WEST); + width -= range.x; + left += range.x; + height = width / aspectRatio; + } else { + check(ACTION_SOUTH); + check(ACTION_WEST); + if (range.x <= 0) { + if (left > minLeft) { + width -= range.x; + left += range.x; + } else if (range.y >= 0 && bottom >= maxHeight) { + renderable = false; + } + } else { + width -= range.x; + left += range.x; + } + if (range.y >= 0) { + if (bottom < maxHeight) { + height += range.y; + } + } else { + height += range.y; + } + } + if (width < 0 && height < 0) { + action = ACTION_NORTH_EAST; + height = -height; + width = -width; + top -= height; + left -= width; + } else if (width < 0) { + action = ACTION_SOUTH_EAST; + width = -width; + left -= width; + } else if (height < 0) { + action = ACTION_NORTH_WEST; + height = -height; + top -= height; + } + break; + case ACTION_SOUTH_EAST: + if (aspectRatio) { + if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) { + renderable = false; + break; + } + check(ACTION_EAST); + width += range.x; + height = width / aspectRatio; + } else { + check(ACTION_SOUTH); + check(ACTION_EAST); + if (range.x >= 0) { + if (right < maxWidth) { + width += range.x; + } else if (range.y >= 0 && bottom >= maxHeight) { + renderable = false; + } + } else { + width += range.x; + } + if (range.y >= 0) { + if (bottom < maxHeight) { + height += range.y; + } + } else { + height += range.y; + } + } + if (width < 0 && height < 0) { + action = ACTION_NORTH_WEST; + height = -height; + width = -width; + top -= height; + left -= width; + } else if (width < 0) { + action = ACTION_SOUTH_WEST; + width = -width; + left -= width; + } else if (height < 0) { + action = ACTION_NORTH_EAST; + height = -height; + top -= height; + } + break; + + // Move canvas + case ACTION_MOVE: + this.move(range.x, range.y); + renderable = false; + break; + + // Zoom canvas + case ACTION_ZOOM: + this.zoom(getMaxZoomRatio(pointers), event); + renderable = false; + break; + + // Create crop box + case ACTION_CROP: + if (!range.x || !range.y) { + renderable = false; + break; + } + offset = getOffset(this.cropper); + left = pointer.startX - offset.left; + top = pointer.startY - offset.top; + width = cropBoxData.minWidth; + height = cropBoxData.minHeight; + if (range.x > 0) { + action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST; + } else if (range.x < 0) { + left -= width; + action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST; + } + if (range.y < 0) { + top -= height; + } + + // Show the crop box if is hidden + if (!this.cropped) { + removeClass(this.cropBox, CLASS_HIDDEN); + this.cropped = true; + if (this.limited) { + this.limitCropBox(true, true); + } + } + break; + } + if (renderable) { + cropBoxData.width = width; + cropBoxData.height = height; + cropBoxData.left = left; + cropBoxData.top = top; + this.action = action; + this.renderCropBox(); + } + + // Override + forEach(pointers, function (p) { + p.startX = p.endX; + p.startY = p.endY; + }); + } + }; + + var methods = { + // Show the crop box manually + crop: function crop() { + if (this.ready && !this.cropped && !this.disabled) { + this.cropped = true; + this.limitCropBox(true, true); + if (this.options.modal) { + addClass(this.dragBox, CLASS_MODAL); + } + removeClass(this.cropBox, CLASS_HIDDEN); + this.setCropBoxData(this.initialCropBoxData); + } + return this; + }, + // Reset the image and crop box to their initial states + reset: function reset() { + if (this.ready && !this.disabled) { + this.imageData = assign({}, this.initialImageData); + this.canvasData = assign({}, this.initialCanvasData); + this.cropBoxData = assign({}, this.initialCropBoxData); + this.renderCanvas(); + if (this.cropped) { + this.renderCropBox(); + } + } + return this; + }, + // Clear the crop box + clear: function clear() { + if (this.cropped && !this.disabled) { + assign(this.cropBoxData, { + left: 0, + top: 0, + width: 0, + height: 0 + }); + this.cropped = false; + this.renderCropBox(); + this.limitCanvas(true, true); + + // Render canvas after crop box rendered + this.renderCanvas(); + removeClass(this.dragBox, CLASS_MODAL); + addClass(this.cropBox, CLASS_HIDDEN); + } + return this; + }, + /** + * Replace the image's src and rebuild the cropper + * @param {string} url - The new URL. + * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one. + * @returns {Cropper} this + */ + replace: function replace(url) { + var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (!this.disabled && url) { + if (this.isImg) { + this.element.src = url; + } + if (hasSameSize) { + this.url = url; + this.image.src = url; + if (this.ready) { + this.viewBoxImage.src = url; + forEach(this.previews, function (element) { + element.getElementsByTagName('img')[0].src = url; + }); + } + } else { + if (this.isImg) { + this.replaced = true; + } + this.options.data = null; + this.uncreate(); + this.load(url); + } + } + return this; + }, + // Enable (unfreeze) the cropper + enable: function enable() { + if (this.ready && this.disabled) { + this.disabled = false; + removeClass(this.cropper, CLASS_DISABLED); + } + return this; + }, + // Disable (freeze) the cropper + disable: function disable() { + if (this.ready && !this.disabled) { + this.disabled = true; + addClass(this.cropper, CLASS_DISABLED); + } + return this; + }, + /** + * Destroy the cropper and remove the instance from the image + * @returns {Cropper} this + */ + destroy: function destroy() { + var element = this.element; + if (!element[NAMESPACE]) { + return this; + } + element[NAMESPACE] = undefined; + if (this.isImg && this.replaced) { + element.src = this.originalUrl; + } + this.uncreate(); + return this; + }, + /** + * Move the canvas with relative offsets + * @param {number} offsetX - The relative offset distance on the x-axis. + * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis. + * @returns {Cropper} this + */ + move: function move(offsetX) { + var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX; + var _this$canvasData = this.canvasData, + left = _this$canvasData.left, + top = _this$canvasData.top; + return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY)); + }, + /** + * Move the canvas to an absolute point + * @param {number} x - The x-axis coordinate. + * @param {number} [y=x] - The y-axis coordinate. + * @returns {Cropper} this + */ + moveTo: function moveTo(x) { + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; + var canvasData = this.canvasData; + var changed = false; + x = Number(x); + y = Number(y); + if (this.ready && !this.disabled && this.options.movable) { + if (isNumber(x)) { + canvasData.left = x; + changed = true; + } + if (isNumber(y)) { + canvasData.top = y; + changed = true; + } + if (changed) { + this.renderCanvas(true); + } + } + return this; + }, + /** + * Zoom the canvas with a relative ratio + * @param {number} ratio - The target ratio. + * @param {Event} _originalEvent - The original event if any. + * @returns {Cropper} this + */ + zoom: function zoom(ratio, _originalEvent) { + var canvasData = this.canvasData; + ratio = Number(ratio); + if (ratio < 0) { + ratio = 1 / (1 - ratio); + } else { + ratio = 1 + ratio; + } + return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent); + }, + /** + * Zoom the canvas to an absolute ratio + * @param {number} ratio - The target ratio. + * @param {Object} pivot - The zoom pivot point coordinate. + * @param {Event} _originalEvent - The original event if any. + * @returns {Cropper} this + */ + zoomTo: function zoomTo(ratio, pivot, _originalEvent) { + var options = this.options, + canvasData = this.canvasData; + var width = canvasData.width, + height = canvasData.height, + naturalWidth = canvasData.naturalWidth, + naturalHeight = canvasData.naturalHeight; + ratio = Number(ratio); + if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) { + var newWidth = naturalWidth * ratio; + var newHeight = naturalHeight * ratio; + if (dispatchEvent(this.element, EVENT_ZOOM, { + ratio: ratio, + oldRatio: width / naturalWidth, + originalEvent: _originalEvent + }) === false) { + return this; + } + if (_originalEvent) { + var pointers = this.pointers; + var offset = getOffset(this.cropper); + var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : { + pageX: _originalEvent.pageX, + pageY: _originalEvent.pageY + }; + + // Zoom from the triggering point of the event + canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width); + canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height); + } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) { + canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width); + canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height); + } else { + // Zoom from the center of the canvas + canvasData.left -= (newWidth - width) / 2; + canvasData.top -= (newHeight - height) / 2; + } + canvasData.width = newWidth; + canvasData.height = newHeight; + this.renderCanvas(true); + } + return this; + }, + /** + * Rotate the canvas with a relative degree + * @param {number} degree - The rotate degree. + * @returns {Cropper} this + */ + rotate: function rotate(degree) { + return this.rotateTo((this.imageData.rotate || 0) + Number(degree)); + }, + /** + * Rotate the canvas to an absolute degree + * @param {number} degree - The rotate degree. + * @returns {Cropper} this + */ + rotateTo: function rotateTo(degree) { + degree = Number(degree); + if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) { + this.imageData.rotate = degree % 360; + this.renderCanvas(true, true); + } + return this; + }, + /** + * Scale the image on the x-axis. + * @param {number} scaleX - The scale ratio on the x-axis. + * @returns {Cropper} this + */ + scaleX: function scaleX(_scaleX) { + var scaleY = this.imageData.scaleY; + return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1); + }, + /** + * Scale the image on the y-axis. + * @param {number} scaleY - The scale ratio on the y-axis. + * @returns {Cropper} this + */ + scaleY: function scaleY(_scaleY) { + var scaleX = this.imageData.scaleX; + return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY); + }, + /** + * Scale the image + * @param {number} scaleX - The scale ratio on the x-axis. + * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis. + * @returns {Cropper} this + */ + scale: function scale(scaleX) { + var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX; + var imageData = this.imageData; + var transformed = false; + scaleX = Number(scaleX); + scaleY = Number(scaleY); + if (this.ready && !this.disabled && this.options.scalable) { + if (isNumber(scaleX)) { + imageData.scaleX = scaleX; + transformed = true; + } + if (isNumber(scaleY)) { + imageData.scaleY = scaleY; + transformed = true; + } + if (transformed) { + this.renderCanvas(true, true); + } + } + return this; + }, + /** + * Get the cropped area position and size data (base on the original image) + * @param {boolean} [rounded=false] - Indicate if round the data values or not. + * @returns {Object} The result cropped data. + */ + getData: function getData() { + var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var options = this.options, + imageData = this.imageData, + canvasData = this.canvasData, + cropBoxData = this.cropBoxData; + var data; + if (this.ready && this.cropped) { + data = { + x: cropBoxData.left - canvasData.left, + y: cropBoxData.top - canvasData.top, + width: cropBoxData.width, + height: cropBoxData.height + }; + var ratio = imageData.width / imageData.naturalWidth; + forEach(data, function (n, i) { + data[i] = n / ratio; + }); + if (rounded) { + // In case rounding off leads to extra 1px in right or bottom border + // we should round the top-left corner and the dimension (#343). + var bottom = Math.round(data.y + data.height); + var right = Math.round(data.x + data.width); + data.x = Math.round(data.x); + data.y = Math.round(data.y); + data.width = right - data.x; + data.height = bottom - data.y; + } + } else { + data = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + if (options.rotatable) { + data.rotate = imageData.rotate || 0; + } + if (options.scalable) { + data.scaleX = imageData.scaleX || 1; + data.scaleY = imageData.scaleY || 1; + } + return data; + }, + /** + * Set the cropped area position and size with new data + * @param {Object} data - The new data. + * @returns {Cropper} this + */ + setData: function setData(data) { + var options = this.options, + imageData = this.imageData, + canvasData = this.canvasData; + var cropBoxData = {}; + if (this.ready && !this.disabled && isPlainObject(data)) { + var transformed = false; + if (options.rotatable) { + if (isNumber(data.rotate) && data.rotate !== imageData.rotate) { + imageData.rotate = data.rotate; + transformed = true; + } + } + if (options.scalable) { + if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) { + imageData.scaleX = data.scaleX; + transformed = true; + } + if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) { + imageData.scaleY = data.scaleY; + transformed = true; + } + } + if (transformed) { + this.renderCanvas(true, true); + } + var ratio = imageData.width / imageData.naturalWidth; + if (isNumber(data.x)) { + cropBoxData.left = data.x * ratio + canvasData.left; + } + if (isNumber(data.y)) { + cropBoxData.top = data.y * ratio + canvasData.top; + } + if (isNumber(data.width)) { + cropBoxData.width = data.width * ratio; + } + if (isNumber(data.height)) { + cropBoxData.height = data.height * ratio; + } + this.setCropBoxData(cropBoxData); + } + return this; + }, + /** + * Get the container size data. + * @returns {Object} The result container data. + */ + getContainerData: function getContainerData() { + return this.ready ? assign({}, this.containerData) : {}; + }, + /** + * Get the image position and size data. + * @returns {Object} The result image data. + */ + getImageData: function getImageData() { + return this.sized ? assign({}, this.imageData) : {}; + }, + /** + * Get the canvas position and size data. + * @returns {Object} The result canvas data. + */ + getCanvasData: function getCanvasData() { + var canvasData = this.canvasData; + var data = {}; + if (this.ready) { + forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) { + data[n] = canvasData[n]; + }); + } + return data; + }, + /** + * Set the canvas position and size with new data. + * @param {Object} data - The new canvas data. + * @returns {Cropper} this + */ + setCanvasData: function setCanvasData(data) { + var canvasData = this.canvasData; + var aspectRatio = canvasData.aspectRatio; + if (this.ready && !this.disabled && isPlainObject(data)) { + if (isNumber(data.left)) { + canvasData.left = data.left; + } + if (isNumber(data.top)) { + canvasData.top = data.top; + } + if (isNumber(data.width)) { + canvasData.width = data.width; + canvasData.height = data.width / aspectRatio; + } else if (isNumber(data.height)) { + canvasData.height = data.height; + canvasData.width = data.height * aspectRatio; + } + this.renderCanvas(true); + } + return this; + }, + /** + * Get the crop box position and size data. + * @returns {Object} The result crop box data. + */ + getCropBoxData: function getCropBoxData() { + var cropBoxData = this.cropBoxData; + var data; + if (this.ready && this.cropped) { + data = { + left: cropBoxData.left, + top: cropBoxData.top, + width: cropBoxData.width, + height: cropBoxData.height + }; + } + return data || {}; + }, + /** + * Set the crop box position and size with new data. + * @param {Object} data - The new crop box data. + * @returns {Cropper} this + */ + setCropBoxData: function setCropBoxData(data) { + var cropBoxData = this.cropBoxData; + var aspectRatio = this.options.aspectRatio; + var widthChanged; + var heightChanged; + if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) { + if (isNumber(data.left)) { + cropBoxData.left = data.left; + } + if (isNumber(data.top)) { + cropBoxData.top = data.top; + } + if (isNumber(data.width) && data.width !== cropBoxData.width) { + widthChanged = true; + cropBoxData.width = data.width; + } + if (isNumber(data.height) && data.height !== cropBoxData.height) { + heightChanged = true; + cropBoxData.height = data.height; + } + if (aspectRatio) { + if (widthChanged) { + cropBoxData.height = cropBoxData.width / aspectRatio; + } else if (heightChanged) { + cropBoxData.width = cropBoxData.height * aspectRatio; + } + } + this.renderCropBox(); + } + return this; + }, + /** + * Get a canvas drawn the cropped image. + * @param {Object} [options={}] - The config options. + * @returns {HTMLCanvasElement} - The result canvas. + */ + getCroppedCanvas: function getCroppedCanvas() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (!this.ready || !window.HTMLCanvasElement) { + return null; + } + var canvasData = this.canvasData; + var source = getSourceCanvas(this.image, this.imageData, canvasData, options); + + // Returns the source canvas if it is not cropped. + if (!this.cropped) { + return source; + } + var _this$getData = this.getData(options.rounded), + initialX = _this$getData.x, + initialY = _this$getData.y, + initialWidth = _this$getData.width, + initialHeight = _this$getData.height; + var ratio = source.width / Math.floor(canvasData.naturalWidth); + if (ratio !== 1) { + initialX *= ratio; + initialY *= ratio; + initialWidth *= ratio; + initialHeight *= ratio; + } + var aspectRatio = initialWidth / initialHeight; + var maxSizes = getAdjustedSizes({ + aspectRatio: aspectRatio, + width: options.maxWidth || Infinity, + height: options.maxHeight || Infinity + }); + var minSizes = getAdjustedSizes({ + aspectRatio: aspectRatio, + width: options.minWidth || 0, + height: options.minHeight || 0 + }, 'cover'); + var _getAdjustedSizes = getAdjustedSizes({ + aspectRatio: aspectRatio, + width: options.width || (ratio !== 1 ? source.width : initialWidth), + height: options.height || (ratio !== 1 ? source.height : initialHeight) + }), + width = _getAdjustedSizes.width, + height = _getAdjustedSizes.height; + width = Math.min(maxSizes.width, Math.max(minSizes.width, width)); + height = Math.min(maxSizes.height, Math.max(minSizes.height, height)); + var canvas = document.createElement('canvas'); + var context = canvas.getContext('2d'); + canvas.width = normalizeDecimalNumber(width); + canvas.height = normalizeDecimalNumber(height); + context.fillStyle = options.fillColor || 'transparent'; + context.fillRect(0, 0, width, height); + var _options$imageSmoothi = options.imageSmoothingEnabled, + imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi, + imageSmoothingQuality = options.imageSmoothingQuality; + context.imageSmoothingEnabled = imageSmoothingEnabled; + if (imageSmoothingQuality) { + context.imageSmoothingQuality = imageSmoothingQuality; + } + + // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage + var sourceWidth = source.width; + var sourceHeight = source.height; + + // Source canvas parameters + var srcX = initialX; + var srcY = initialY; + var srcWidth; + var srcHeight; + + // Destination canvas parameters + var dstX; + var dstY; + var dstWidth; + var dstHeight; + if (srcX <= -initialWidth || srcX > sourceWidth) { + srcX = 0; + srcWidth = 0; + dstX = 0; + dstWidth = 0; + } else if (srcX <= 0) { + dstX = -srcX; + srcX = 0; + srcWidth = Math.min(sourceWidth, initialWidth + srcX); + dstWidth = srcWidth; + } else if (srcX <= sourceWidth) { + dstX = 0; + srcWidth = Math.min(initialWidth, sourceWidth - srcX); + dstWidth = srcWidth; + } + if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) { + srcY = 0; + srcHeight = 0; + dstY = 0; + dstHeight = 0; + } else if (srcY <= 0) { + dstY = -srcY; + srcY = 0; + srcHeight = Math.min(sourceHeight, initialHeight + srcY); + dstHeight = srcHeight; + } else if (srcY <= sourceHeight) { + dstY = 0; + srcHeight = Math.min(initialHeight, sourceHeight - srcY); + dstHeight = srcHeight; + } + var params = [srcX, srcY, srcWidth, srcHeight]; + + // Avoid "IndexSizeError" + if (dstWidth > 0 && dstHeight > 0) { + var scale = width / initialWidth; + params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale); + } + + // All the numerical parameters should be integer for `drawImage` + // https://github.com/fengyuanchen/cropper/issues/476 + context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) { + return Math.floor(normalizeDecimalNumber(param)); + })))); + return canvas; + }, + /** + * Change the aspect ratio of the crop box. + * @param {number} aspectRatio - The new aspect ratio. + * @returns {Cropper} this + */ + setAspectRatio: function setAspectRatio(aspectRatio) { + var options = this.options; + if (!this.disabled && !isUndefined(aspectRatio)) { + // 0 -> NaN + options.aspectRatio = Math.max(0, aspectRatio) || NaN; + if (this.ready) { + this.initCropBox(); + if (this.cropped) { + this.renderCropBox(); + } + } + } + return this; + }, + /** + * Change the drag mode. + * @param {string} mode - The new drag mode. + * @returns {Cropper} this + */ + setDragMode: function setDragMode(mode) { + var options = this.options, + dragBox = this.dragBox, + face = this.face; + if (this.ready && !this.disabled) { + var croppable = mode === DRAG_MODE_CROP; + var movable = options.movable && mode === DRAG_MODE_MOVE; + mode = croppable || movable ? mode : DRAG_MODE_NONE; + options.dragMode = mode; + setData(dragBox, DATA_ACTION, mode); + toggleClass(dragBox, CLASS_CROP, croppable); + toggleClass(dragBox, CLASS_MOVE, movable); + if (!options.cropBoxMovable) { + // Sync drag mode to crop box when it is not movable + setData(face, DATA_ACTION, mode); + toggleClass(face, CLASS_CROP, croppable); + toggleClass(face, CLASS_MOVE, movable); + } + } + return this; + } + }; + + var AnotherCropper = WINDOW.Cropper; + var Cropper = /*#__PURE__*/function () { + /** + * Create a new Cropper. + * @param {Element} element - The target element for cropping. + * @param {Object} [options={}] - The configuration options. + */ + function Cropper(element) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + _classCallCheck(this, Cropper); + if (!element || !REGEXP_TAG_NAME.test(element.tagName)) { + throw new Error('The first argument is required and must be an or element.'); + } + this.element = element; + this.options = assign({}, DEFAULTS, isPlainObject(options) && options); + this.cropped = false; + this.disabled = false; + this.pointers = {}; + this.ready = false; + this.reloading = false; + this.replaced = false; + this.sized = false; + this.sizing = false; + this.init(); + } + _createClass(Cropper, [{ + key: "init", + value: function init() { + var element = this.element; + var tagName = element.tagName.toLowerCase(); + var url; + if (element[NAMESPACE]) { + return; + } + element[NAMESPACE] = this; + if (tagName === 'img') { + this.isImg = true; + + // e.g.: "img/picture.jpg" + url = element.getAttribute('src') || ''; + this.originalUrl = url; + + // Stop when it's a blank image + if (!url) { + return; + } + + // e.g.: "https://example.com/img/picture.jpg" + url = element.src; + } else if (tagName === 'canvas' && window.HTMLCanvasElement) { + url = element.toDataURL(); + } + this.load(url); + } + }, { + key: "load", + value: function load(url) { + var _this = this; + if (!url) { + return; + } + this.url = url; + this.imageData = {}; + var element = this.element, + options = this.options; + if (!options.rotatable && !options.scalable) { + options.checkOrientation = false; + } + + // Only IE10+ supports Typed Arrays + if (!options.checkOrientation || !window.ArrayBuffer) { + this.clone(); + return; + } + + // Detect the mime type of the image directly if it is a Data URL + if (REGEXP_DATA_URL.test(url)) { + // Read ArrayBuffer from Data URL of JPEG images directly for better performance + if (REGEXP_DATA_URL_JPEG.test(url)) { + this.read(dataURLToArrayBuffer(url)); + } else { + // Only a JPEG image may contains Exif Orientation information, + // the rest types of Data URLs are not necessary to check orientation at all. + this.clone(); + } + return; + } + + // 1. Detect the mime type of the image by a XMLHttpRequest. + // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image. + var xhr = new XMLHttpRequest(); + var clone = this.clone.bind(this); + this.reloading = true; + this.xhr = xhr; + + // 1. Cross origin requests are only supported for protocol schemes: + // http, https, data, chrome, chrome-extension. + // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy + // in some browsers as IE11 and Safari. + xhr.onabort = clone; + xhr.onerror = clone; + xhr.ontimeout = clone; + xhr.onprogress = function () { + // Abort the request directly if it not a JPEG image for better performance + if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) { + xhr.abort(); + } + }; + xhr.onload = function () { + _this.read(xhr.response); + }; + xhr.onloadend = function () { + _this.reloading = false; + _this.xhr = null; + }; + + // Bust cache when there is a "crossOrigin" property to avoid browser cache error + if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) { + url = addTimestamp(url); + } + + // The third parameter is required for avoiding side-effect (#682) + xhr.open('GET', url, true); + xhr.responseType = 'arraybuffer'; + xhr.withCredentials = element.crossOrigin === 'use-credentials'; + xhr.send(); + } + }, { + key: "read", + value: function read(arrayBuffer) { + var options = this.options, + imageData = this.imageData; + + // Reset the orientation value to its default value 1 + // as some iOS browsers will render image with its orientation + var orientation = resetAndGetOrientation(arrayBuffer); + var rotate = 0; + var scaleX = 1; + var scaleY = 1; + if (orientation > 1) { + // Generate a new URL which has the default orientation value + this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG); + var _parseOrientation = parseOrientation(orientation); + rotate = _parseOrientation.rotate; + scaleX = _parseOrientation.scaleX; + scaleY = _parseOrientation.scaleY; + } + if (options.rotatable) { + imageData.rotate = rotate; + } + if (options.scalable) { + imageData.scaleX = scaleX; + imageData.scaleY = scaleY; + } + this.clone(); + } + }, { + key: "clone", + value: function clone() { + var element = this.element, + url = this.url; + var crossOrigin = element.crossOrigin; + var crossOriginUrl = url; + if (this.options.checkCrossOrigin && isCrossOriginURL(url)) { + if (!crossOrigin) { + crossOrigin = 'anonymous'; + } + + // Bust cache when there is not a "crossOrigin" property (#519) + crossOriginUrl = addTimestamp(url); + } + this.crossOrigin = crossOrigin; + this.crossOriginUrl = crossOriginUrl; + var image = document.createElement('img'); + if (crossOrigin) { + image.crossOrigin = crossOrigin; + } + image.src = crossOriginUrl || url; + image.alt = element.alt || 'The image to crop'; + this.image = image; + image.onload = this.start.bind(this); + image.onerror = this.stop.bind(this); + addClass(image, CLASS_HIDE); + element.parentNode.insertBefore(image, element.nextSibling); + } + }, { + key: "start", + value: function start() { + var _this2 = this; + var image = this.image; + image.onload = null; + image.onerror = null; + this.sizing = true; + + // Match all browsers that use WebKit as the layout engine in iOS devices, + // such as Safari for iOS, Chrome for iOS, and in-app browsers. + var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent); + var done = function done(naturalWidth, naturalHeight) { + assign(_this2.imageData, { + naturalWidth: naturalWidth, + naturalHeight: naturalHeight, + aspectRatio: naturalWidth / naturalHeight + }); + _this2.initialImageData = assign({}, _this2.imageData); + _this2.sizing = false; + _this2.sized = true; + _this2.build(); + }; + + // Most modern browsers (excepts iOS WebKit) + if (image.naturalWidth && !isIOSWebKit) { + done(image.naturalWidth, image.naturalHeight); + return; + } + var sizingImage = document.createElement('img'); + var body = document.body || document.documentElement; + this.sizingImage = sizingImage; + sizingImage.onload = function () { + done(sizingImage.width, sizingImage.height); + if (!isIOSWebKit) { + body.removeChild(sizingImage); + } + }; + sizingImage.src = image.src; + + // iOS WebKit will convert the image automatically + // with its orientation once append it into DOM (#279) + if (!isIOSWebKit) { + sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;'; + body.appendChild(sizingImage); + } + } + }, { + key: "stop", + value: function stop() { + var image = this.image; + image.onload = null; + image.onerror = null; + image.parentNode.removeChild(image); + this.image = null; + } + }, { + key: "build", + value: function build() { + if (!this.sized || this.ready) { + return; + } + var element = this.element, + options = this.options, + image = this.image; + + // Create cropper elements + var container = element.parentNode; + var template = document.createElement('div'); + template.innerHTML = TEMPLATE; + var cropper = template.querySelector(".".concat(NAMESPACE, "-container")); + var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas")); + var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box")); + var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box")); + var face = cropBox.querySelector(".".concat(NAMESPACE, "-face")); + this.container = container; + this.cropper = cropper; + this.canvas = canvas; + this.dragBox = dragBox; + this.cropBox = cropBox; + this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box")); + this.face = face; + canvas.appendChild(image); + + // Hide the original image + addClass(element, CLASS_HIDDEN); + + // Inserts the cropper after to the current image + container.insertBefore(cropper, element.nextSibling); + + // Show the hidden image + removeClass(image, CLASS_HIDE); + this.initPreview(); + this.bind(); + options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN; + options.aspectRatio = Math.max(0, options.aspectRatio) || NaN; + options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0; + addClass(cropBox, CLASS_HIDDEN); + if (!options.guides) { + addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN); + } + if (!options.center) { + addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN); + } + if (options.background) { + addClass(cropper, "".concat(NAMESPACE, "-bg")); + } + if (!options.highlight) { + addClass(face, CLASS_INVISIBLE); + } + if (options.cropBoxMovable) { + addClass(face, CLASS_MOVE); + setData(face, DATA_ACTION, ACTION_ALL); + } + if (!options.cropBoxResizable) { + addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN); + addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN); + } + this.render(); + this.ready = true; + this.setDragMode(options.dragMode); + if (options.autoCrop) { + this.crop(); + } + this.setData(options.data); + if (isFunction(options.ready)) { + addListener(element, EVENT_READY, options.ready, { + once: true + }); + } + dispatchEvent(element, EVENT_READY); + } + }, { + key: "unbuild", + value: function unbuild() { + if (!this.ready) { + return; + } + this.ready = false; + this.unbind(); + this.resetPreview(); + var parentNode = this.cropper.parentNode; + if (parentNode) { + parentNode.removeChild(this.cropper); + } + removeClass(this.element, CLASS_HIDDEN); + } + }, { + key: "uncreate", + value: function uncreate() { + if (this.ready) { + this.unbuild(); + this.ready = false; + this.cropped = false; + } else if (this.sizing) { + this.sizingImage.onload = null; + this.sizing = false; + this.sized = false; + } else if (this.reloading) { + this.xhr.onabort = null; + this.xhr.abort(); + } else if (this.image) { + this.stop(); + } + } + + /** + * Get the no conflict cropper class. + * @returns {Cropper} The cropper class. + */ + }], [{ + key: "noConflict", + value: function noConflict() { + window.Cropper = AnotherCropper; + return Cropper; + } + + /** + * Change the default options. + * @param {Object} options - The new default options. + */ + }, { + key: "setDefaults", + value: function setDefaults(options) { + assign(DEFAULTS, isPlainObject(options) && options); + } + }]); + return Cropper; + }(); + assign(Cropper.prototype, render, preview, events, handlers, change, methods); + + return Cropper; + +})); diff --git a/assets/libs/cropper/cropper.min.css b/assets/libs/cropper/cropper.min.css new file mode 100644 index 00000000..049cab58 --- /dev/null +++ b/assets/libs/cropper/cropper.min.css @@ -0,0 +1,9 @@ +/*! + * Cropper.js v1.6.1 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2023-09-17T03:44:17.565Z + */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{backface-visibility:hidden;display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed} \ No newline at end of file diff --git a/assets/libs/cropper/cropper.min.js b/assets/libs/cropper/cropper.min.js new file mode 100644 index 00000000..959d89fe --- /dev/null +++ b/assets/libs/cropper/cropper.min.js @@ -0,0 +1,10 @@ +/*! + * Cropper.js v1.6.1 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2023-09-17T03:44:19.860Z + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cropper=e()}(this,function(){"use strict";function C(e,t){var i,a=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,i)),a}function S(a){for(var t=1;tt.length)&&(e=t.length);for(var i=0,a=new Array(e);it.width?3===i?o=t.height*e:h=t.width/e:3===i?h=t.width/e:o=t.height*e,{aspectRatio:e,naturalWidth:n,naturalHeight:a,width:o,height:h});this.canvasData=e,this.limited=1===i||2===i,this.limitCanvas(!0,!0),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),e.left=(t.width-e.width)/2,e.top=(t.height-e.height)/2,e.oldLeft=e.left,e.oldTop=e.top,this.initialCanvasData=g({},e)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=i.viewMode,r=n.aspectRatio,s=this.cropped&&o;t&&(t=Number(i.minCanvasWidth)||0,i=Number(i.minCanvasHeight)||0,1=a.width&&(n.minLeft=Math.min(0,r),n.maxLeft=Math.max(0,r)),n.height>=a.height)&&(n.minTop=Math.min(0,t),n.maxTop=Math.max(0,t))):(n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height))},renderCanvas:function(t,e){var i,a,n,o,h=this.canvasData,r=this.imageData;e&&(e={width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0},r=e.width,o=e.height,e=e.degree,i=90==(e=Math.abs(e)%180)?{width:o,height:r}:(a=e%90*Math.PI/180,i=Math.sin(a),n=r*(a=Math.cos(a))+o*i,r=r*i+o*a,90h.maxWidth||h.widthh.maxHeight||h.heighte.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*t),a.height=Math.max(a.minHeight,a.height*t),a.left=e.left+(e.width-a.width)/2,a.top=e.top+(e.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=g({},a)},limitCropBox:function(t,e){var i,a,n=this.options,o=this.containerData,h=this.canvasData,r=this.cropBoxData,s=this.limited,c=n.aspectRatio;t&&(t=Number(n.minCropBoxWidth)||0,n=Number(n.minCropBoxHeight)||0,i=s?Math.min(o.width,h.width,h.width+h.left,o.width-h.left):o.width,a=s?Math.min(o.height,h.height,h.height+h.top,o.height-h.top):o.height,t=Math.min(t,o.width),n=Math.min(n,o.height),c&&(t&&n?ti.maxWidth||i.widthi.maxHeight||i.height=e.width&&i.height>=e.height?q:I),f(this.cropBox,g({width:i.width,height:i.height},x({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),y(this.element,tt,this.getData())}},i={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e&&("string"==typeof(o=e)?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),z(this.previews=o,function(t){var e=document.createElement("img");w(t,m,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e)}))},resetPreview:function(){z(this.previews,function(e){var i=Bt(e,m),i=(f(e,{width:i.width,height:i.height}),e.innerHTML=i.html,e),e=m;if(o(i[e]))try{delete i[e]}catch(t){i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch(t){i.dataset[e]=void 0}else i.removeAttribute("data-".concat(Dt(e)))})},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,r=e.width,s=e.height,c=h.width,d=h.height,l=e.left-t.left-h.left,p=e.top-t.top-h.top;this.cropped&&!this.disabled&&(f(this.viewBoxImage,g({width:c,height:d},x(g({translateX:-l,translateY:-p},h)))),z(this.previews,function(t){var e=Bt(t,m),i=e.width,e=e.height,a=i,n=e,o=1;r&&(n=s*(o=i/r)),s&&eMath.abs(a-1)?i:a)&&(t.restore&&(o=this.getCanvasData(),h=this.getCropBoxData()),this.render(),t.restore)&&(this.setCanvasData(z(o,function(t,e){o[e]=t*n})),this.setCropBoxData(z(h,function(t,e){h[e]=t*n}))))},dblclick:function(){var t,e;this.disabled||this.options.dragMode===_||this.setDragMode((t=this.dragBox,e=Q,(t.classList?t.classList.contains(e):-1y&&(D.x=y-f);break;case k:p+D.xx&&(D.y=x-v)}}var i,a,o,n=this.options,h=this.canvasData,r=this.containerData,s=this.cropBoxData,c=this.pointers,d=this.action,l=n.aspectRatio,p=s.left,m=s.top,u=s.width,g=s.height,f=p+u,v=m+g,w=0,b=0,y=r.width,x=r.height,M=!0,C=(!l&&t.shiftKey&&(l=u&&g?u/g:1),this.limited&&(w=s.minLeft,b=s.minTop,y=w+Math.min(r.width,h.width,h.left+h.width),x=b+Math.min(r.height,h.height,h.top+h.height)),c[Object.keys(c)[0]]),D={x:C.endX-C.startX,y:C.endY-C.startY};switch(d){case I:p+=D.x,m+=D.y;break;case B:0<=D.x&&(y<=f||l&&(m<=b||x<=v))?M=!1:(e(B),(u+=D.x)<0&&(d=k,p-=u=-u),l&&(m+=(s.height-(g=u/l))/2));break;case T:D.y<=0&&(m<=b||l&&(p<=w||y<=f))?M=!1:(e(T),g-=D.y,m+=D.y,g<0&&(d=O,m-=g=-g),l&&(p+=(s.width-(u=g*l))/2));break;case k:D.x<=0&&(p<=w||l&&(m<=b||x<=v))?M=!1:(e(k),u-=D.x,p+=D.x,u<0&&(d=B,p-=u=-u),l&&(m+=(s.height-(g=u/l))/2));break;case O:0<=D.y&&(x<=v||l&&(p<=w||y<=f))?M=!1:(e(O),(g+=D.y)<0&&(d=T,m-=g=-g),l&&(p+=(s.width-(u=g*l))/2));break;case E:if(l){if(D.y<=0&&(m<=b||y<=f)){M=!1;break}e(T),g-=D.y,m+=D.y,u=g*l}else e(T),e(B),!(0<=D.x)||fMath.abs(o)&&(o=i)})}),o),t),M=!1;break;case U:D.x&&D.y?(i=Wt(this.cropper),p=C.startX-i.left,m=C.startY-i.top,u=s.minWidth,g=s.minHeight,0 or element.");this.element=t,this.options=g({},ut,u(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,e,i;return t=n,i=[{key:"noConflict",value:function(){return window.Cropper=Pt,n}},{key:"setDefaults",value:function(t){g(ut,u(t)&&t)}}],(e=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[c]){if(e[c]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,a,n,o,h,r=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?lt.test(t)?pt.test(t)?this.read((h=(h=t).replace(Xt,""),a=atob(h),h=new ArrayBuffer(a.length),z(n=new Uint8Array(h),function(t,e){n[e]=a.charCodeAt(e)}),h)):this.clone():(o=new XMLHttpRequest,h=this.clone.bind(this),this.reloading=!0,(this.xhr=o).onabort=h,o.onerror=h,o.ontimeout=h,o.onprogress=function(){o.getResponseHeader("content-type")!==ct&&o.abort()},o.onload=function(){r.read(o.response)},o.onloadend=function(){r.reloading=!1,r.xhr=null},i.checkCrossOrigin&&Lt(t)&&e.crossOrigin&&(t=zt(t)),o.open("GET",t,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===e.crossOrigin,o.send()):this.clone())}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=Rt(t),n=0,o=1,h=1;1
',o=(n=n.querySelector(".".concat(c,"-container"))).querySelector(".".concat(c,"-canvas")),h=n.querySelector(".".concat(c,"-drag-box")),s=(r=n.querySelector(".".concat(c,"-crop-box"))).querySelector(".".concat(c,"-face")),this.container=a,this.cropper=n,this.canvas=o,this.dragBox=h,this.cropBox=r,this.viewBox=n.querySelector(".".concat(c,"-view-box")),this.face=s,o.appendChild(i),v(t,L),a.insertBefore(n,t.nextSibling),X(i,Z),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,v(r,L),e.guides||v(r.getElementsByClassName("".concat(c,"-dashed")),L),e.center||v(r.getElementsByClassName("".concat(c,"-center")),L),e.background&&v(n,"".concat(c,"-bg")),e.highlight||v(s,G),e.cropBoxMovable&&(v(s,V),w(s,d,I)),e.cropBoxResizable||(v(r.getElementsByClassName("".concat(c,"-line")),L),v(r.getElementsByClassName("".concat(c,"-point")),L)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),l(e.ready)&&b(t,"ready",e.ready,{once:!0}),y(t,"ready"))}},{key:"unbuild",value:function(){var t;this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),(t=this.cropper.parentNode)&&t.removeChild(this.cropper),X(this.element,L))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&j(t.prototype,e),i&&j(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}();return g(It.prototype,t,i,e,St,jt,At),It}); \ No newline at end of file diff --git a/assets/libs/jquery-ui/images/readme.txt b/assets/libs/jquery-ui/images/readme.txt deleted file mode 100644 index 351f3426..00000000 --- a/assets/libs/jquery-ui/images/readme.txt +++ /dev/null @@ -1 +0,0 @@ -These images are part of the jquery-ui library and used in the file jquery-ui.css \ No newline at end of file diff --git a/assets/libs/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png b/assets/libs/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png deleted file mode 100644 index f4335d5a..00000000 Binary files a/assets/libs/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png b/assets/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 7b76dd03..00000000 Binary files a/assets/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png b/assets/libs/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png deleted file mode 100644 index ed24d3d2..00000000 Binary files a/assets/libs/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png b/assets/libs/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png deleted file mode 100644 index b705c3ed..00000000 Binary files a/assets/libs/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png b/assets/libs/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100644 index 919083bb..00000000 Binary files a/assets/libs/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/assets/libs/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100644 index 5ac0a23a..00000000 Binary files a/assets/libs/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-icons_222222_256x240.png b/assets/libs/jquery-ui/images/ui-icons_222222_256x240.png deleted file mode 100644 index 92410d3d..00000000 Binary files a/assets/libs/jquery-ui/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-icons_444444_256x240.png b/assets/libs/jquery-ui/images/ui-icons_444444_256x240.png new file mode 100644 index 00000000..4cc611b7 Binary files /dev/null and b/assets/libs/jquery-ui/images/ui-icons_444444_256x240.png differ diff --git a/assets/libs/jquery-ui/images/ui-icons_454545_256x240.png b/assets/libs/jquery-ui/images/ui-icons_454545_256x240.png deleted file mode 100644 index d79f2ef7..00000000 Binary files a/assets/libs/jquery-ui/images/ui-icons_454545_256x240.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-icons_555555_256x240.png b/assets/libs/jquery-ui/images/ui-icons_555555_256x240.png new file mode 100644 index 00000000..7d8634cc Binary files /dev/null and b/assets/libs/jquery-ui/images/ui-icons_555555_256x240.png differ diff --git a/assets/libs/jquery-ui/images/ui-icons_2e83ff_256x240.png b/assets/libs/jquery-ui/images/ui-icons_777620_256x240.png similarity index 82% rename from assets/libs/jquery-ui/images/ui-icons_2e83ff_256x240.png rename to assets/libs/jquery-ui/images/ui-icons_777620_256x240.png index f44b9cee..fce72322 100644 Binary files a/assets/libs/jquery-ui/images/ui-icons_2e83ff_256x240.png and b/assets/libs/jquery-ui/images/ui-icons_777620_256x240.png differ diff --git a/assets/libs/jquery-ui/images/ui-icons_777777_256x240.png b/assets/libs/jquery-ui/images/ui-icons_777777_256x240.png new file mode 100644 index 00000000..e9a50855 Binary files /dev/null and b/assets/libs/jquery-ui/images/ui-icons_777777_256x240.png differ diff --git a/assets/libs/jquery-ui/images/ui-icons_888888_256x240.png b/assets/libs/jquery-ui/images/ui-icons_888888_256x240.png deleted file mode 100644 index cd4a75c6..00000000 Binary files a/assets/libs/jquery-ui/images/ui-icons_888888_256x240.png and /dev/null differ diff --git a/assets/libs/jquery-ui/images/ui-icons_cd0a0a_256x240.png b/assets/libs/jquery-ui/images/ui-icons_cc0000_256x240.png similarity index 82% rename from assets/libs/jquery-ui/images/ui-icons_cd0a0a_256x240.png rename to assets/libs/jquery-ui/images/ui-icons_cc0000_256x240.png index a8e162d3..604b8166 100644 Binary files a/assets/libs/jquery-ui/images/ui-icons_cd0a0a_256x240.png and b/assets/libs/jquery-ui/images/ui-icons_cc0000_256x240.png differ diff --git a/assets/libs/jquery-ui/images/ui-icons_ffffff_256x240.png b/assets/libs/jquery-ui/images/ui-icons_ffffff_256x240.png new file mode 100644 index 00000000..47704729 Binary files /dev/null and b/assets/libs/jquery-ui/images/ui-icons_ffffff_256x240.png differ diff --git a/assets/libs/jquery-ui/jquery-ui.css b/assets/libs/jquery-ui/jquery-ui.css index 294452f1..6fb607c7 100644 --- a/assets/libs/jquery-ui/jquery-ui.css +++ b/assets/libs/jquery-ui/jquery-ui.css @@ -1,15 +1,19 @@ -/*! jQuery UI - v1.12.1 - 2016-09-14 +/*! jQuery UI - v1.13.2 - 2023-10-18 * http://jqueryui.com -* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=.um&folderName=um-&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif * Copyright jQuery Foundation and other contributors; Licensed MIT */ +.um .ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} /* Layout helpers ----------------------------------*/ -.ui-helper-hidden { +.um .ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { +.um .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; @@ -19,7 +23,7 @@ position: absolute; width: 1px; } -.ui-helper-reset { +.um .ui-helper-reset { margin: 0; padding: 0; border: 0; @@ -29,33 +33,33 @@ font-size: 100%; list-style: none; } -.ui-helper-clearfix:before, -.ui-helper-clearfix:after { +.um .ui-helper-clearfix:before, +.um .ui-helper-clearfix:after { content: ""; display: table; border-collapse: collapse; } -.ui-helper-clearfix:after { +.um .ui-helper-clearfix:after { clear: both; } -.ui-helper-zfix { +.um .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; - filter:Alpha(Opacity=0); /* support: IE8 */ + -ms-filter: "alpha(opacity=0)"; /* support: IE8 */ } -.ui-front { +.um .ui-front { z-index: 100; } /* Interaction Cues ----------------------------------*/ -.ui-state-disabled { +.um .ui-state-disabled { cursor: default !important; pointer-events: none; } @@ -63,7 +67,7 @@ /* Icons ----------------------------------*/ -.ui-icon { +.um .ui-icon { display: inline-block; vertical-align: middle; margin-top: -.25em; @@ -73,7 +77,7 @@ background-repeat: no-repeat; } -.ui-widget-icon-block { +.um .ui-widget-icon-block { left: 50%; margin-left: -8px; display: block; @@ -83,14 +87,97 @@ ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { +.um .ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; } -.ui-accordion .ui-accordion-header { +.um .ui-resizable { + position: relative; +} +.um .ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.um .ui-resizable-disabled .ui-resizable-handle, +.um .ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.um .ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.um .ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.um .ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.um .ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.um .ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.um .ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.um .ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.um .ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.um .ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.um .ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.um .ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.um .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; @@ -98,59 +185,59 @@ padding: .5em .5em .5em .7em; font-size: 100%; } -.ui-accordion .ui-accordion-content { +.um .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; } -.ui-autocomplete { +.um .ui-autocomplete { position: absolute; top: 0; left: 0; cursor: default; } -.ui-menu { +.um .ui-menu { list-style: none; padding: 0; margin: 0; display: block; outline: 0; } -.ui-menu .ui-menu { +.um .ui-menu .ui-menu { position: absolute; } -.ui-menu .ui-menu-item { +.um .ui-menu .ui-menu-item { margin: 0; cursor: pointer; /* support: IE10, see #8844 */ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); } -.ui-menu .ui-menu-item-wrapper { +.um .ui-menu .ui-menu-item-wrapper { position: relative; padding: 3px 1em 3px .4em; } -.ui-menu .ui-menu-divider { +.um .ui-menu .ui-menu-divider { margin: 5px 0; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } -.ui-menu .ui-state-focus, -.ui-menu .ui-state-active { +.um .ui-menu .ui-state-focus, +.um .ui-menu .ui-state-active { margin: -1px; } /* icon support */ -.ui-menu-icons { +.um .ui-menu-icons { position: relative; } -.ui-menu-icons .ui-menu-item-wrapper { +.um .ui-menu-icons .ui-menu-item-wrapper { padding-left: 2em; } /* left-aligned */ -.ui-menu .ui-icon { +.um .ui-menu .ui-icon { position: absolute; top: 0; bottom: 0; @@ -159,11 +246,11 @@ } /* right-aligned */ -.ui-menu .ui-menu-icon { +.um .ui-menu .ui-menu-icon { left: auto; right: 0; } -.ui-button { +.um .ui-button { padding: .4em 1em; display: inline-block; position: relative; @@ -181,16 +268,16 @@ overflow: visible; } -.ui-button, -.ui-button:link, -.ui-button:visited, -.ui-button:hover, -.ui-button:active { +.um .ui-button, +.um .ui-button:link, +.um .ui-button:visited, +.um .ui-button:hover, +.um .ui-button:active { text-decoration: none; } /* to make room for the icon, a width needs to be set here */ -.ui-button-icon-only { +.um .ui-button-icon-only { width: 2em; box-sizing: border-box; text-indent: -9999px; @@ -198,12 +285,12 @@ } /* no icon support for input elements */ -input.ui-button.ui-button-icon-only { +input.um .ui-button.ui-button-icon-only { text-indent: 0; } /* button icon element(s) */ -.ui-button-icon-only .ui-icon { +.um .ui-button-icon-only .ui-icon { position: absolute; top: 50%; left: 50%; @@ -211,7 +298,7 @@ input.ui-button.ui-button-icon-only { margin-left: -8px; } -.ui-button.ui-icon-notext .ui-icon { +.um .ui-button.ui-icon-notext .ui-icon { padding: 0; width: 2.1em; height: 2.1em; @@ -220,7 +307,7 @@ input.ui-button.ui-button-icon-only { } -input.ui-button.ui-icon-notext .ui-icon { +input.um .ui-button.ui-icon-notext .ui-icon { width: auto; height: auto; text-indent: 0; @@ -230,25 +317,25 @@ input.ui-button.ui-icon-notext .ui-icon { /* workarounds */ /* Support: Firefox 5 - 40 */ -input.ui-button::-moz-focus-inner, -button.ui-button::-moz-focus-inner { +input.um .ui-button::-moz-focus-inner, +button.um .ui-button::-moz-focus-inner { border: 0; padding: 0; } -.ui-controlgroup { +.um .ui-controlgroup { vertical-align: middle; display: inline-block; } -.ui-controlgroup > .ui-controlgroup-item { +.um .ui-controlgroup > .ui-controlgroup-item { float: left; margin-left: 0; margin-right: 0; } -.ui-controlgroup > .ui-controlgroup-item:focus, -.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { +.um .ui-controlgroup > .ui-controlgroup-item:focus, +.um .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { z-index: 9999; } -.ui-controlgroup-vertical > .ui-controlgroup-item { +.um .ui-controlgroup-vertical > .ui-controlgroup-item { display: block; float: none; width: 100%; @@ -256,96 +343,96 @@ button.ui-button::-moz-focus-inner { margin-bottom: 0; text-align: left; } -.ui-controlgroup-vertical .ui-controlgroup-item { +.um .ui-controlgroup-vertical .ui-controlgroup-item { box-sizing: border-box; } -.ui-controlgroup .ui-controlgroup-label { +.um .ui-controlgroup .ui-controlgroup-label { padding: .4em 1em; } -.ui-controlgroup .ui-controlgroup-label span { +.um .ui-controlgroup .ui-controlgroup-label span { font-size: 80%; } -.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { +.um .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { border-left: none; } -.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { +.um .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { border-top: none; } -.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { +.um .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { border-right: none; } -.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { +.um .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { border-bottom: none; } /* Spinner specific style fixes */ -.ui-controlgroup-vertical .ui-spinner-input { +.um .ui-controlgroup-vertical .ui-spinner-input { /* Support: IE8 only, Android < 4.4 only */ width: 75%; width: calc( 100% - 2.4em ); } -.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { +.um .ui-controlgroup-vertical .ui-spinner .ui-spinner-up { border-top-style: solid; } -.ui-checkboxradio-label .ui-icon-background { +.um .ui-checkboxradio-label .ui-icon-background { box-shadow: inset 1px 1px 1px #ccc; border-radius: .12em; border: none; } -.ui-checkboxradio-radio-label .ui-icon-background { +.um .ui-checkboxradio-radio-label .ui-icon-background { width: 16px; height: 16px; border-radius: 1em; overflow: visible; border: none; } -.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, -.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { +.um .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, +.um .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { background-image: none; width: 8px; height: 8px; border-width: 4px; border-style: solid; } -.ui-checkboxradio-disabled { +.um .ui-checkboxradio-disabled { pointer-events: none; } -.ui-datepicker { +.um .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { +.um .ui-datepicker .ui-datepicker-header { position: relative; padding: .2em 0; } -.ui-datepicker .ui-datepicker-prev, -.ui-datepicker .ui-datepicker-next { +.um .ui-datepicker .ui-datepicker-prev, +.um .ui-datepicker .ui-datepicker-next { position: absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, -.ui-datepicker .ui-datepicker-next-hover { +.um .ui-datepicker .ui-datepicker-prev-hover, +.um .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { +.um .ui-datepicker .ui-datepicker-prev { left: 2px; } -.ui-datepicker .ui-datepicker-next { +.um .ui-datepicker .ui-datepicker-next { right: 2px; } -.ui-datepicker .ui-datepicker-prev-hover { +.um .ui-datepicker .ui-datepicker-prev-hover { left: 1px; } -.ui-datepicker .ui-datepicker-next-hover { +.um .ui-datepicker .ui-datepicker-next-hover { right: 1px; } -.ui-datepicker .ui-datepicker-prev span, -.ui-datepicker .ui-datepicker-next span { +.um .ui-datepicker .ui-datepicker-prev span, +.um .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; @@ -353,43 +440,43 @@ button.ui-button::-moz-focus-inner { top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { +.um .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { +.um .ui-datepicker .ui-datepicker-title select { font-size: 1em; margin: 1px 0; } -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { +.um .ui-datepicker select.ui-datepicker-month, +.um .ui-datepicker select.ui-datepicker-year { width: 45%; } -.ui-datepicker table { +.um .ui-datepicker table { width: 100%; font-size: .9em; border-collapse: collapse; margin: 0 0 .4em; } -.ui-datepicker th { +.um .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { +.um .ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, -.ui-datepicker td a { +.um .ui-datepicker td span, +.um .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { +.um .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding: 0 .2em; @@ -397,7 +484,7 @@ button.ui-button::-moz-focus-inner { border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { +.um .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; @@ -405,81 +492,81 @@ button.ui-button::-moz-focus-inner { width: auto; overflow: visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { +.um .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float: left; } /* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { +.um .ui-datepicker.ui-datepicker-multi { width: auto; } -.ui-datepicker-multi .ui-datepicker-group { +.um .ui-datepicker-multi .ui-datepicker-group { float: left; } -.ui-datepicker-multi .ui-datepicker-group table { +.um .ui-datepicker-multi .ui-datepicker-group table { width: 95%; margin: 0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { +.um .ui-datepicker-multi-2 .ui-datepicker-group { width: 50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { +.um .ui-datepicker-multi-3 .ui-datepicker-group { width: 33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { +.um .ui-datepicker-multi-4 .ui-datepicker-group { width: 25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { +.um .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.um .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width: 0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { +.um .ui-datepicker-multi .ui-datepicker-buttonpane { clear: left; } -.ui-datepicker-row-break { +.um .ui-datepicker-row-break { clear: both; width: 100%; font-size: 0; } /* RTL support */ -.ui-datepicker-rtl { +.um .ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { +.um .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { +.um .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { +.um .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { +.um .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { +.um .ui-datepicker-rtl .ui-datepicker-buttonpane { clear: right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { +.um .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, -.ui-datepicker-rtl .ui-datepicker-group { +.um .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.um .ui-datepicker-rtl .ui-datepicker-group { float: right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { +.um .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.um .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width: 0; border-left-width: 1px; } /* Icons */ -.ui-datepicker .ui-icon { +.um .ui-datepicker .ui-icon { display: block; text-indent: -99999px; overflow: hidden; @@ -487,18 +574,18 @@ button.ui-button::-moz-focus-inner { left: .5em; top: .3em; } -.ui-dialog { +.um .ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; outline: 0; } -.ui-dialog .ui-dialog-titlebar { +.um .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { +.um .ui-dialog .ui-dialog-title { float: left; margin: .1em 0; white-space: nowrap; @@ -506,7 +593,7 @@ button.ui-button::-moz-focus-inner { overflow: hidden; text-overflow: ellipsis; } -.ui-dialog .ui-dialog-titlebar-close { +.um .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; @@ -515,171 +602,88 @@ button.ui-button::-moz-focus-inner { padding: 1px; height: 20px; } -.ui-dialog .ui-dialog-content { +.um .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; } -.ui-dialog .ui-dialog-buttonpane { +.um .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin-top: .5em; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { +.um .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { +.um .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-n { +.um .ui-dialog .ui-resizable-n { height: 2px; top: 0; } -.ui-dialog .ui-resizable-e { +.um .ui-dialog .ui-resizable-e { width: 2px; right: 0; } -.ui-dialog .ui-resizable-s { +.um .ui-dialog .ui-resizable-s { height: 2px; bottom: 0; } -.ui-dialog .ui-resizable-w { +.um .ui-dialog .ui-resizable-w { width: 2px; left: 0; } -.ui-dialog .ui-resizable-se, -.ui-dialog .ui-resizable-sw, -.ui-dialog .ui-resizable-ne, -.ui-dialog .ui-resizable-nw { +.um .ui-dialog .ui-resizable-se, +.um .ui-dialog .ui-resizable-sw, +.um .ui-dialog .ui-resizable-ne, +.um .ui-dialog .ui-resizable-nw { width: 7px; height: 7px; } -.ui-dialog .ui-resizable-se { +.um .ui-dialog .ui-resizable-se { right: 0; bottom: 0; } -.ui-dialog .ui-resizable-sw { +.um .ui-dialog .ui-resizable-sw { left: 0; bottom: 0; } -.ui-dialog .ui-resizable-ne { +.um .ui-dialog .ui-resizable-ne { right: 0; top: 0; } -.ui-dialog .ui-resizable-nw { +.um .ui-dialog .ui-resizable-nw { left: 0; top: 0; } -.ui-draggable .ui-dialog-titlebar { +.um .ui-draggable .ui-dialog-titlebar { cursor: move; } -.ui-draggable-handle { - -ms-touch-action: none; - touch-action: none; -} -.ui-resizable { - position: relative; -} -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - -ms-touch-action: none; - touch-action: none; -} -.ui-resizable-disabled .ui-resizable-handle, -.ui-resizable-autohide .ui-resizable-handle { - display: none; -} -.ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0; -} -.ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0; -} -.ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0; - height: 100%; -} -.ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0; - height: 100%; -} -.ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; -} -.ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; -} -.ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; -} -.ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} -.ui-progressbar { +.um .ui-progressbar { height: 2em; text-align: left; overflow: hidden; } -.ui-progressbar .ui-progressbar-value { +.um .ui-progressbar .ui-progressbar-value { margin: -1px; height: 100%; } -.ui-progressbar .ui-progressbar-overlay { +.um .ui-progressbar .ui-progressbar-overlay { background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); height: 100%; - filter: alpha(opacity=25); /* support: IE8 */ + -ms-filter: "alpha(opacity=25)"; /* support: IE8 */ opacity: 0.25; } -.ui-progressbar-indeterminate .ui-progressbar-value { +.um .ui-progressbar-indeterminate .ui-progressbar-value { background-image: none; } -.ui-selectable { - -ms-touch-action: none; - touch-action: none; -} -.ui-selectable-helper { - position: absolute; - z-index: 100; - border: 1px dotted black; -} -.ui-selectmenu-menu { +.um .ui-selectmenu-menu { padding: 0; margin: 0; position: absolute; @@ -687,12 +691,12 @@ button.ui-button::-moz-focus-inner { left: 0; display: none; } -.ui-selectmenu-menu .ui-menu { +.um .ui-selectmenu-menu .ui-menu { overflow: auto; overflow-x: hidden; padding-bottom: 1px; } -.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { +.um .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { font-size: 1em; font-weight: bold; line-height: 1.5; @@ -701,38 +705,38 @@ button.ui-button::-moz-focus-inner { height: auto; border: 0; } -.ui-selectmenu-open { +.um .ui-selectmenu-open { display: block; } -.ui-selectmenu-text { +.um .ui-selectmenu-text { display: block; margin-right: 20px; overflow: hidden; text-overflow: ellipsis; } -.ui-selectmenu-button.ui-button { +.um .ui-selectmenu-button.ui-button { text-align: left; white-space: nowrap; width: 14em; } -.ui-selectmenu-icon.ui-icon { +.um .ui-selectmenu-icon.ui-icon { float: right; margin-top: 0; } -.ui-slider { +.um .ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { +.um .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; - cursor: default; + cursor: pointer; -ms-touch-action: none; touch-action: none; } -.ui-slider .ui-slider-range { +.um .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; @@ -742,60 +746,56 @@ button.ui-button::-moz-focus-inner { } /* support: IE8 - See #6727 */ -.ui-slider.ui-state-disabled .ui-slider-handle, -.ui-slider.ui-state-disabled .ui-slider-range { +.um .ui-slider.ui-state-disabled .ui-slider-handle, +.um .ui-slider.ui-state-disabled .ui-slider-range { filter: inherit; } -.ui-slider-horizontal { +.um .ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { +.um .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { +.um .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { +.um .ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { +.um .ui-slider-horizontal .ui-slider-range-max { right: 0; } -.ui-slider-vertical { +.um .ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { +.um .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { +.um .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { +.um .ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { +.um .ui-slider-vertical .ui-slider-range-max { top: 0; } -.ui-sortable-handle { - -ms-touch-action: none; - touch-action: none; -} -.ui-spinner { +.um .ui-spinner { position: relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } -.ui-spinner-input { +.um .ui-spinner-input { border: none; background: none; color: inherit; @@ -805,7 +805,7 @@ button.ui-button::-moz-focus-inner { margin-left: .4em; margin-right: 2em; } -.ui-spinner-button { +.um .ui-spinner-button { width: 1.6em; height: 50%; font-size: .5em; @@ -819,26 +819,26 @@ button.ui-button::-moz-focus-inner { right: 0; } /* more specificity required here to override default borders */ -.ui-spinner a.ui-spinner-button { +.um .ui-spinner a.ui-spinner-button { border-top-style: none; border-bottom-style: none; border-right-style: none; } -.ui-spinner-up { +.um .ui-spinner-up { top: 0; } -.ui-spinner-down { +.um .ui-spinner-down { bottom: 0; } -.ui-tabs { +.um .ui-tabs { position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ padding: .2em; } -.ui-tabs .ui-tabs-nav { +.um .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { +.um .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; @@ -848,464 +848,468 @@ button.ui-button::-moz-focus-inner { padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav .ui-tabs-anchor { +.um .ui-tabs .ui-tabs-nav .ui-tabs-anchor { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-active { +.um .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, -.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, -.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { +.um .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.um .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.um .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { cursor: text; } -.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { +.um .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { cursor: pointer; } -.ui-tabs .ui-tabs-panel { +.um .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tooltip { +.um .ui-tooltip { padding: 8px; position: absolute; z-index: 9999; max-width: 300px; } -body .ui-tooltip { +body .um .ui-tooltip { border-width: 2px; } + /* Component containers ----------------------------------*/ -.ui-widget { - font-family: Verdana,Arial,sans-serif; - font-size: 1.1em; -} -.ui-widget .ui-widget { +.um .ui-widget { + font-family: Arial,Helvetica,sans-serif; font-size: 1em; } -.ui-widget input, -.ui-widget select, -.ui-widget textarea, -.ui-widget button { - font-family: Verdana,Arial,sans-serif; +.um .ui-widget .ui-widget { font-size: 1em; } -.ui-widget.ui-widget-content { - border: 1px solid #d3d3d3; +.um .ui-widget input, +.um .ui-widget select, +.um .ui-widget textarea, +.um .ui-widget button { + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; } -.ui-widget-content { - border: 1px solid #aaaaaa; +.um .ui-widget.ui-widget-content { + border: 1px solid #c5c5c5; +} +.um .ui-widget-content { + border: 1px solid #dddddd; background: #ffffff; - color: #222222; + color: #333333; } -.ui-widget-content a { - color: #222222; +.um .ui-widget-content a { + color: #333333; } -.ui-widget-header { - border: 1px solid #aaaaaa; - background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; - color: #222222; +.um .ui-widget-header { + border: 1px solid #dddddd; + background: #e9e9e9; + color: #333333; font-weight: bold; } -.ui-widget-header a { - color: #222222; +.um .ui-widget-header a { + color: #333333; } /* Interaction states ----------------------------------*/ -.ui-state-default, -.ui-widget-content .ui-state-default, -.ui-widget-header .ui-state-default, -.ui-button, +.um .ui-state-default, +.um .ui-widget-content .ui-state-default, +.um .ui-widget-header .ui-state-default, +.um .ui-button, /* We use html here because we need a greater specificity to make sure disabled works properly when clicked or hovered */ -html .ui-button.ui-state-disabled:hover, -html .ui-button.ui-state-disabled:active { - border: 1px solid #d3d3d3; - background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; +html .um .ui-button.ui-state-disabled:hover, +html .um .ui-button.ui-state-disabled:active { + border: 1px solid #c5c5c5; + background: #f6f6f6; font-weight: normal; - color: #555555; + color: #454545; } -.ui-state-default a, -.ui-state-default a:link, -.ui-state-default a:visited, -a.ui-button, -a:link.ui-button, -a:visited.ui-button, -.ui-button { - color: #555555; +.um .ui-state-default a, +.um .ui-state-default a:link, +.um .ui-state-default a:visited, +a.um .ui-button, +a:link.um .ui-button, +a:visited.um .ui-button, +.um .ui-button { + color: #454545; text-decoration: none; } -.ui-state-hover, -.ui-widget-content .ui-state-hover, -.ui-widget-header .ui-state-hover, -.ui-state-focus, -.ui-widget-content .ui-state-focus, -.ui-widget-header .ui-state-focus, -.ui-button:hover, -.ui-button:focus { - border: 1px solid #999999; - background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; +.um .ui-state-hover, +.um .ui-widget-content .ui-state-hover, +.um .ui-widget-header .ui-state-hover, +.um .ui-state-focus, +.um .ui-widget-content .ui-state-focus, +.um .ui-widget-header .ui-state-focus, +.um .ui-button:hover, +.um .ui-button:focus { + border: 1px solid #cccccc; + background: #ededed; font-weight: normal; - color: #212121; + color: #2b2b2b; } -.ui-state-hover a, -.ui-state-hover a:hover, -.ui-state-hover a:link, -.ui-state-hover a:visited, -.ui-state-focus a, -.ui-state-focus a:hover, -.ui-state-focus a:link, -.ui-state-focus a:visited, -a.ui-button:hover, -a.ui-button:focus { - color: #212121; +.um .ui-state-hover a, +.um .ui-state-hover a:hover, +.um .ui-state-hover a:link, +.um .ui-state-hover a:visited, +.um .ui-state-focus a, +.um .ui-state-focus a:hover, +.um .ui-state-focus a:link, +.um .ui-state-focus a:visited, +a.um .ui-button:hover, +a.um .ui-button:focus { + color: #2b2b2b; text-decoration: none; } -.ui-visual-focus { +.um .ui-visual-focus { box-shadow: 0 0 3px 1px rgb(94, 158, 214); } -.ui-state-active, -.ui-widget-content .ui-state-active, -.ui-widget-header .ui-state-active, -a.ui-button:active, -.ui-button:active, -.ui-button.ui-state-active:hover { - border: 1px solid #aaaaaa; - background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; +.um .ui-state-active, +.um .ui-widget-content .ui-state-active, +.um .ui-widget-header .ui-state-active, +a.um .ui-button:active, +.um .ui-button:active, +.um .ui-button.ui-state-active:hover { + border: 1px solid #003eff; + background: #007fff; font-weight: normal; - color: #212121; + color: #ffffff; } -.ui-icon-background, -.ui-state-active .ui-icon-background { - border: #aaaaaa; - background-color: #212121; +.um .ui-icon-background, +.um .ui-state-active .ui-icon-background { + border: #003eff; + background-color: #ffffff; } -.ui-state-active a, -.ui-state-active a:link, -.ui-state-active a:visited { - color: #212121; +.um .ui-state-active a, +.um .ui-state-active a:link, +.um .ui-state-active a:visited { + color: #ffffff; text-decoration: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, -.ui-widget-content .ui-state-highlight, -.ui-widget-header .ui-state-highlight { - border: 1px solid #fcefa1; - background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; - color: #363636; +.um .ui-state-highlight, +.um .ui-widget-content .ui-state-highlight, +.um .ui-widget-header .ui-state-highlight { + border: 1px solid #dad55e; + background: #fffa90; + color: #777620; } -.ui-state-checked { - border: 1px solid #fcefa1; - background: #fbf9ee; +.um .ui-state-checked { + border: 1px solid #dad55e; + background: #fffa90; } -.ui-state-highlight a, -.ui-widget-content .ui-state-highlight a, -.ui-widget-header .ui-state-highlight a { - color: #363636; +.um .ui-state-highlight a, +.um .ui-widget-content .ui-state-highlight a, +.um .ui-widget-header .ui-state-highlight a { + color: #777620; } -.ui-state-error, -.ui-widget-content .ui-state-error, -.ui-widget-header .ui-state-error { - border: 1px solid #cd0a0a; - background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; - color: #cd0a0a; +.um .ui-state-error, +.um .ui-widget-content .ui-state-error, +.um .ui-widget-header .ui-state-error { + border: 1px solid #f1a899; + background: #fddfdf; + color: #5f3f3f; } -.ui-state-error a, -.ui-widget-content .ui-state-error a, -.ui-widget-header .ui-state-error a { - color: #cd0a0a; +.um .ui-state-error a, +.um .ui-widget-content .ui-state-error a, +.um .ui-widget-header .ui-state-error a { + color: #5f3f3f; } -.ui-state-error-text, -.ui-widget-content .ui-state-error-text, -.ui-widget-header .ui-state-error-text { - color: #cd0a0a; +.um .ui-state-error-text, +.um .ui-widget-content .ui-state-error-text, +.um .ui-widget-header .ui-state-error-text { + color: #5f3f3f; } -.ui-priority-primary, -.ui-widget-content .ui-priority-primary, -.ui-widget-header .ui-priority-primary { +.um .ui-priority-primary, +.um .ui-widget-content .ui-priority-primary, +.um .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, -.ui-widget-content .ui-priority-secondary, -.ui-widget-header .ui-priority-secondary { +.um .ui-priority-secondary, +.um .ui-widget-content .ui-priority-secondary, +.um .ui-widget-header .ui-priority-secondary { opacity: .7; - filter:Alpha(Opacity=70); /* support: IE8 */ + -ms-filter: "alpha(opacity=70)"; /* support: IE8 */ font-weight: normal; } -.ui-state-disabled, -.ui-widget-content .ui-state-disabled, -.ui-widget-header .ui-state-disabled { +.um .ui-state-disabled, +.um .ui-widget-content .ui-state-disabled, +.um .ui-widget-header .ui-state-disabled { opacity: .35; - filter:Alpha(Opacity=35); /* support: IE8 */ + -ms-filter: "alpha(opacity=35)"; /* support: IE8 */ background-image: none; } -.ui-state-disabled .ui-icon { - filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ +.um .ui-state-disabled .ui-icon { + -ms-filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */ } /* Icons ----------------------------------*/ /* states and images */ -.ui-icon { +.um .ui-icon { width: 16px; height: 16px; } -.ui-icon, -.ui-widget-content .ui-icon { - background-image: url("images/ui-icons_222222_256x240.png"); +.um .ui-icon, +.um .ui-widget-content .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png"); } -.ui-widget-header .ui-icon { - background-image: url("images/ui-icons_222222_256x240.png"); +.um .ui-widget-header .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png"); } -.ui-state-hover .ui-icon, -.ui-state-focus .ui-icon, -.ui-button:hover .ui-icon, -.ui-button:focus .ui-icon { - background-image: url("images/ui-icons_454545_256x240.png"); +.um .ui-state-hover .ui-icon, +.um .ui-state-focus .ui-icon, +.um .ui-button:hover .ui-icon, +.um .ui-button:focus .ui-icon { + background-image: url("images/ui-icons_555555_256x240.png"); } -.ui-state-active .ui-icon, -.ui-button:active .ui-icon { - background-image: url("images/ui-icons_454545_256x240.png"); +.um .ui-state-active .ui-icon, +.um .ui-button:active .ui-icon { + background-image: url("images/ui-icons_ffffff_256x240.png"); } -.ui-state-highlight .ui-icon, -.ui-button .ui-state-highlight.ui-icon { - background-image: url("images/ui-icons_2e83ff_256x240.png"); +.um .ui-state-highlight .ui-icon, +.um .ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_777620_256x240.png"); } -.ui-state-error .ui-icon, -.ui-state-error-text .ui-icon { - background-image: url("images/ui-icons_cd0a0a_256x240.png"); +.um .ui-state-error .ui-icon, +.um .ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cc0000_256x240.png"); } -.ui-button .ui-icon { - background-image: url("images/ui-icons_888888_256x240.png"); +.um .ui-button .ui-icon { + background-image: url("images/ui-icons_777777_256x240.png"); } /* positioning */ -.ui-icon-blank { background-position: 16px 16px; } -.ui-icon-caret-1-n { background-position: 0 0; } -.ui-icon-caret-1-ne { background-position: -16px 0; } -.ui-icon-caret-1-e { background-position: -32px 0; } -.ui-icon-caret-1-se { background-position: -48px 0; } -.ui-icon-caret-1-s { background-position: -65px 0; } -.ui-icon-caret-1-sw { background-position: -80px 0; } -.ui-icon-caret-1-w { background-position: -96px 0; } -.ui-icon-caret-1-nw { background-position: -112px 0; } -.ui-icon-caret-2-n-s { background-position: -128px 0; } -.ui-icon-caret-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -65px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -65px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 1px -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-on { background-position: -96px -144px; } -.ui-icon-radio-off { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } +/* Three classes needed to override `.um .ui-button:hover .ui-icon` */ +.um .ui-icon-blank.ui-icon-blank.ui-icon-blank { + background-image: none; +} +.um .ui-icon-caret-1-n { background-position: 0 0; } +.um .ui-icon-caret-1-ne { background-position: -16px 0; } +.um .ui-icon-caret-1-e { background-position: -32px 0; } +.um .ui-icon-caret-1-se { background-position: -48px 0; } +.um .ui-icon-caret-1-s { background-position: -65px 0; } +.um .ui-icon-caret-1-sw { background-position: -80px 0; } +.um .ui-icon-caret-1-w { background-position: -96px 0; } +.um .ui-icon-caret-1-nw { background-position: -112px 0; } +.um .ui-icon-caret-2-n-s { background-position: -128px 0; } +.um .ui-icon-caret-2-e-w { background-position: -144px 0; } +.um .ui-icon-triangle-1-n { background-position: 0 -16px; } +.um .ui-icon-triangle-1-ne { background-position: -16px -16px; } +.um .ui-icon-triangle-1-e { background-position: -32px -16px; } +.um .ui-icon-triangle-1-se { background-position: -48px -16px; } +.um .ui-icon-triangle-1-s { background-position: -65px -16px; } +.um .ui-icon-triangle-1-sw { background-position: -80px -16px; } +.um .ui-icon-triangle-1-w { background-position: -96px -16px; } +.um .ui-icon-triangle-1-nw { background-position: -112px -16px; } +.um .ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.um .ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.um .ui-icon-arrow-1-n { background-position: 0 -32px; } +.um .ui-icon-arrow-1-ne { background-position: -16px -32px; } +.um .ui-icon-arrow-1-e { background-position: -32px -32px; } +.um .ui-icon-arrow-1-se { background-position: -48px -32px; } +.um .ui-icon-arrow-1-s { background-position: -65px -32px; } +.um .ui-icon-arrow-1-sw { background-position: -80px -32px; } +.um .ui-icon-arrow-1-w { background-position: -96px -32px; } +.um .ui-icon-arrow-1-nw { background-position: -112px -32px; } +.um .ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.um .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.um .ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.um .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.um .ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.um .ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.um .ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.um .ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.um .ui-icon-arrowthick-1-n { background-position: 1px -48px; } +.um .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.um .ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.um .ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.um .ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.um .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.um .ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.um .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.um .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.um .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.um .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.um .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.um .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.um .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.um .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.um .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.um .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.um .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.um .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.um .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.um .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.um .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.um .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.um .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.um .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.um .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.um .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.um .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.um .ui-icon-arrow-4 { background-position: 0 -80px; } +.um .ui-icon-arrow-4-diag { background-position: -16px -80px; } +.um .ui-icon-extlink { background-position: -32px -80px; } +.um .ui-icon-newwin { background-position: -48px -80px; } +.um .ui-icon-refresh { background-position: -64px -80px; } +.um .ui-icon-shuffle { background-position: -80px -80px; } +.um .ui-icon-transfer-e-w { background-position: -96px -80px; } +.um .ui-icon-transferthick-e-w { background-position: -112px -80px; } +.um .ui-icon-folder-collapsed { background-position: 0 -96px; } +.um .ui-icon-folder-open { background-position: -16px -96px; } +.um .ui-icon-document { background-position: -32px -96px; } +.um .ui-icon-document-b { background-position: -48px -96px; } +.um .ui-icon-note { background-position: -64px -96px; } +.um .ui-icon-mail-closed { background-position: -80px -96px; } +.um .ui-icon-mail-open { background-position: -96px -96px; } +.um .ui-icon-suitcase { background-position: -112px -96px; } +.um .ui-icon-comment { background-position: -128px -96px; } +.um .ui-icon-person { background-position: -144px -96px; } +.um .ui-icon-print { background-position: -160px -96px; } +.um .ui-icon-trash { background-position: -176px -96px; } +.um .ui-icon-locked { background-position: -192px -96px; } +.um .ui-icon-unlocked { background-position: -208px -96px; } +.um .ui-icon-bookmark { background-position: -224px -96px; } +.um .ui-icon-tag { background-position: -240px -96px; } +.um .ui-icon-home { background-position: 0 -112px; } +.um .ui-icon-flag { background-position: -16px -112px; } +.um .ui-icon-calendar { background-position: -32px -112px; } +.um .ui-icon-cart { background-position: -48px -112px; } +.um .ui-icon-pencil { background-position: -64px -112px; } +.um .ui-icon-clock { background-position: -80px -112px; } +.um .ui-icon-disk { background-position: -96px -112px; } +.um .ui-icon-calculator { background-position: -112px -112px; } +.um .ui-icon-zoomin { background-position: -128px -112px; } +.um .ui-icon-zoomout { background-position: -144px -112px; } +.um .ui-icon-search { background-position: -160px -112px; } +.um .ui-icon-wrench { background-position: -176px -112px; } +.um .ui-icon-gear { background-position: -192px -112px; } +.um .ui-icon-heart { background-position: -208px -112px; } +.um .ui-icon-star { background-position: -224px -112px; } +.um .ui-icon-link { background-position: -240px -112px; } +.um .ui-icon-cancel { background-position: 0 -128px; } +.um .ui-icon-plus { background-position: -16px -128px; } +.um .ui-icon-plusthick { background-position: -32px -128px; } +.um .ui-icon-minus { background-position: -48px -128px; } +.um .ui-icon-minusthick { background-position: -64px -128px; } +.um .ui-icon-close { background-position: -80px -128px; } +.um .ui-icon-closethick { background-position: -96px -128px; } +.um .ui-icon-key { background-position: -112px -128px; } +.um .ui-icon-lightbulb { background-position: -128px -128px; } +.um .ui-icon-scissors { background-position: -144px -128px; } +.um .ui-icon-clipboard { background-position: -160px -128px; } +.um .ui-icon-copy { background-position: -176px -128px; } +.um .ui-icon-contact { background-position: -192px -128px; } +.um .ui-icon-image { background-position: -208px -128px; } +.um .ui-icon-video { background-position: -224px -128px; } +.um .ui-icon-script { background-position: -240px -128px; } +.um .ui-icon-alert { background-position: 0 -144px; } +.um .ui-icon-info { background-position: -16px -144px; } +.um .ui-icon-notice { background-position: -32px -144px; } +.um .ui-icon-help { background-position: -48px -144px; } +.um .ui-icon-check { background-position: -64px -144px; } +.um .ui-icon-bullet { background-position: -80px -144px; } +.um .ui-icon-radio-on { background-position: -96px -144px; } +.um .ui-icon-radio-off { background-position: -112px -144px; } +.um .ui-icon-pin-w { background-position: -128px -144px; } +.um .ui-icon-pin-s { background-position: -144px -144px; } +.um .ui-icon-play { background-position: 0 -160px; } +.um .ui-icon-pause { background-position: -16px -160px; } +.um .ui-icon-seek-next { background-position: -32px -160px; } +.um .ui-icon-seek-prev { background-position: -48px -160px; } +.um .ui-icon-seek-end { background-position: -64px -160px; } +.um .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } +.um .ui-icon-seek-first { background-position: -80px -160px; } +.um .ui-icon-stop { background-position: -96px -160px; } +.um .ui-icon-eject { background-position: -112px -160px; } +.um .ui-icon-volume-off { background-position: -128px -160px; } +.um .ui-icon-volume-on { background-position: -144px -160px; } +.um .ui-icon-power { background-position: 0 -176px; } +.um .ui-icon-signal-diag { background-position: -16px -176px; } +.um .ui-icon-signal { background-position: -32px -176px; } +.um .ui-icon-battery-0 { background-position: -48px -176px; } +.um .ui-icon-battery-1 { background-position: -64px -176px; } +.um .ui-icon-battery-2 { background-position: -80px -176px; } +.um .ui-icon-battery-3 { background-position: -96px -176px; } +.um .ui-icon-circle-plus { background-position: 0 -192px; } +.um .ui-icon-circle-minus { background-position: -16px -192px; } +.um .ui-icon-circle-close { background-position: -32px -192px; } +.um .ui-icon-circle-triangle-e { background-position: -48px -192px; } +.um .ui-icon-circle-triangle-s { background-position: -64px -192px; } +.um .ui-icon-circle-triangle-w { background-position: -80px -192px; } +.um .ui-icon-circle-triangle-n { background-position: -96px -192px; } +.um .ui-icon-circle-arrow-e { background-position: -112px -192px; } +.um .ui-icon-circle-arrow-s { background-position: -128px -192px; } +.um .ui-icon-circle-arrow-w { background-position: -144px -192px; } +.um .ui-icon-circle-arrow-n { background-position: -160px -192px; } +.um .ui-icon-circle-zoomin { background-position: -176px -192px; } +.um .ui-icon-circle-zoomout { background-position: -192px -192px; } +.um .ui-icon-circle-check { background-position: -208px -192px; } +.um .ui-icon-circlesmall-plus { background-position: 0 -208px; } +.um .ui-icon-circlesmall-minus { background-position: -16px -208px; } +.um .ui-icon-circlesmall-close { background-position: -32px -208px; } +.um .ui-icon-squaresmall-plus { background-position: -48px -208px; } +.um .ui-icon-squaresmall-minus { background-position: -64px -208px; } +.um .ui-icon-squaresmall-close { background-position: -80px -208px; } +.um .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.um .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.um .ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.um .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.um .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.um .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ -.ui-corner-all, -.ui-corner-top, -.ui-corner-left, -.ui-corner-tl { - border-top-left-radius: 4px; +.um .ui-corner-all, +.um .ui-corner-top, +.um .ui-corner-left, +.um .ui-corner-tl { + border-top-left-radius: 3px; } -.ui-corner-all, -.ui-corner-top, -.ui-corner-right, -.ui-corner-tr { - border-top-right-radius: 4px; +.um .ui-corner-all, +.um .ui-corner-top, +.um .ui-corner-right, +.um .ui-corner-tr { + border-top-right-radius: 3px; } -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-left, -.ui-corner-bl { - border-bottom-left-radius: 4px; +.um .ui-corner-all, +.um .ui-corner-bottom, +.um .ui-corner-left, +.um .ui-corner-bl { + border-bottom-left-radius: 3px; } -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-right, -.ui-corner-br { - border-bottom-right-radius: 4px; +.um .ui-corner-all, +.um .ui-corner-bottom, +.um .ui-corner-right, +.um .ui-corner-br { + border-bottom-right-radius: 3px; } /* Overlays */ -.ui-widget-overlay { +.um .ui-widget-overlay { background: #aaaaaa; opacity: .3; - filter: Alpha(Opacity=30); /* support: IE8 */ + -ms-filter: Alpha(Opacity=30); /* support: IE8 */ } -.ui-widget-shadow { - -webkit-box-shadow: -8px -8px 8px #aaaaaa; - box-shadow: -8px -8px 8px #aaaaaa; +.um .ui-widget-shadow { + -webkit-box-shadow: 0px 0px 5px #666666; + box-shadow: 0px 0px 5px #666666; } diff --git a/assets/libs/jquery-ui/jquery-ui.min.css b/assets/libs/jquery-ui/jquery-ui.min.css index dbd72353..c2d31935 100644 --- a/assets/libs/jquery-ui/jquery-ui.min.css +++ b/assets/libs/jquery-ui/jquery-ui.min.css @@ -1,7 +1,7 @@ -/*! jQuery UI - v1.12.1 - 2016-09-14 +/*! jQuery UI - v1.13.2 - 2023-10-18 * http://jqueryui.com -* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=.um&folderName=um-&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif * Copyright jQuery Foundation and other contributors; Licensed MIT */ -.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #d3d3d3}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#212121;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-icon-background,.ui-state-active .ui-icon-background{border:#aaa;background-color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-checked{border:1px solid #fcefa1;background:#fbf9ee}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:-8px -8px 8px #aaa;box-shadow:-8px -8px 8px #aaa} \ No newline at end of file +.um .ui-draggable-handle{-ms-touch-action:none;touch-action:none}.um .ui-helper-hidden{display:none}.um .ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.um .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.um .ui-helper-clearfix:before,.um .ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.um .ui-helper-clearfix:after{clear:both}.um .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.um .ui-front{z-index:100}.um .ui-state-disabled{cursor:default!important;pointer-events:none}.um .ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.um .ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.um .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.um .ui-resizable{position:relative}.um .ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.um .ui-resizable-disabled .ui-resizable-handle,.um .ui-resizable-autohide .ui-resizable-handle{display:none}.um .ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.um .ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.um .ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.um .ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.um .ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.um .ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.um .ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.um .ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.um .ui-selectable{-ms-touch-action:none;touch-action:none}.um .ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.um .ui-sortable-handle{-ms-touch-action:none;touch-action:none}.um .ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.um .ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.um .ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.um .ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.um .ui-menu .ui-menu{position:absolute}.um .ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.um .ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.um .ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.um .ui-menu .ui-state-focus,.um .ui-menu .ui-state-active{margin:-1px}.um .ui-menu-icons{position:relative}.um .ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.um .ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.um .ui-menu .ui-menu-icon{left:auto;right:0}.um .ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.um .ui-button,.um .ui-button:link,.um .ui-button:visited,.um .ui-button:hover,.um .ui-button:active{text-decoration:none}.um .ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.um .ui-button.ui-button-icon-only{text-indent:0}.um .ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.um .ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.um .ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.um .ui-button::-moz-focus-inner,button.um .ui-button::-moz-focus-inner{border:0;padding:0}.um .ui-controlgroup{vertical-align:middle;display:inline-block}.um .ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.um .ui-controlgroup > .ui-controlgroup-item:focus,.um .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.um .ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.um .ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.um .ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.um .ui-controlgroup .ui-controlgroup-label span{font-size:80%}.um .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.um .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.um .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.um .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.um .ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.um .ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.um .ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.um .ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.um .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.um .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.um .ui-checkboxradio-disabled{pointer-events:none}.um .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.um .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.um .ui-datepicker .ui-datepicker-prev,.um .ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.um .ui-datepicker .ui-datepicker-prev-hover,.um .ui-datepicker .ui-datepicker-next-hover{top:1px}.um .ui-datepicker .ui-datepicker-prev{left:2px}.um .ui-datepicker .ui-datepicker-next{right:2px}.um .ui-datepicker .ui-datepicker-prev-hover{left:1px}.um .ui-datepicker .ui-datepicker-next-hover{right:1px}.um .ui-datepicker .ui-datepicker-prev span,.um .ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.um .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.um .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.um .ui-datepicker select.ui-datepicker-month,.um .ui-datepicker select.ui-datepicker-year{width:45%}.um .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.um .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.um .ui-datepicker td{border:0;padding:1px}.um .ui-datepicker td span,.um .ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.um .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.um .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.um .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.um .ui-datepicker.ui-datepicker-multi{width:auto}.um .ui-datepicker-multi .ui-datepicker-group{float:left}.um .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.um .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.um .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.um .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.um .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.um .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.um .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.um .ui-datepicker-row-break{clear:both;width:100%;font-size:0}.um .ui-datepicker-rtl{direction:rtl}.um .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.um .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.um .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.um .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.um .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.um .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.um .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.um .ui-datepicker-rtl .ui-datepicker-group{float:right}.um .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.um .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.um .ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.um .ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.um .ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.um .ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.um .ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.um .ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.um .ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.um .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.um .ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.um .ui-dialog .ui-resizable-n{height:2px;top:0}.um .ui-dialog .ui-resizable-e{width:2px;right:0}.um .ui-dialog .ui-resizable-s{height:2px;bottom:0}.um .ui-dialog .ui-resizable-w{width:2px;left:0}.um .ui-dialog .ui-resizable-se,.um .ui-dialog .ui-resizable-sw,.um .ui-dialog .ui-resizable-ne,.um .ui-dialog .ui-resizable-nw{width:7px;height:7px}.um .ui-dialog .ui-resizable-se{right:0;bottom:0}.um .ui-dialog .ui-resizable-sw{left:0;bottom:0}.um .ui-dialog .ui-resizable-ne{right:0;top:0}.um .ui-dialog .ui-resizable-nw{left:0;top:0}.um .ui-draggable .ui-dialog-titlebar{cursor:move}.um .ui-progressbar{height:2em;text-align:left;overflow:hidden}.um .ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.um .ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;-ms-filter:"alpha(opacity=25)";opacity:0.25}.um .ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.um .ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.um .ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.um .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.um .ui-selectmenu-open{display:block}.um .ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.um .ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.um .ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.um .ui-slider{position:relative;text-align:left}.um .ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:pointer;-ms-touch-action:none;touch-action:none}.um .ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.um .ui-slider.ui-state-disabled .ui-slider-handle,.um .ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.um .ui-slider-horizontal{height:.8em}.um .ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.um .ui-slider-horizontal .ui-slider-range{top:0;height:100%}.um .ui-slider-horizontal .ui-slider-range-min{left:0}.um .ui-slider-horizontal .ui-slider-range-max{right:0}.um .ui-slider-vertical{width:.8em;height:100px}.um .ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.um .ui-slider-vertical .ui-slider-range{left:0;width:100%}.um .ui-slider-vertical .ui-slider-range-min{bottom:0}.um .ui-slider-vertical .ui-slider-range-max{top:0}.um .ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.um .ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.um .ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.um .ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.um .ui-spinner-up{top:0}.um .ui-spinner-down{bottom:0}.um .ui-tabs{position:relative;padding:.2em}.um .ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.um .ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.um .ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.um .ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.um .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.um .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.um .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.um .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.um .ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.um .ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .um .ui-tooltip{border-width:2px}.um .ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.um .ui-widget .ui-widget{font-size:1em}.um .ui-widget input,.um .ui-widget select,.um .ui-widget textarea,.um .ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.um .ui-widget.ui-widget-content{border:1px solid #c5c5c5}.um .ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.um .ui-widget-content a{color:#333}.um .ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.um .ui-widget-header a{color:#333}.um .ui-state-default,.um .ui-widget-content .ui-state-default,.um .ui-widget-header .ui-state-default,.um .ui-button,html .um .ui-button.ui-state-disabled:hover,html .um .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.um .ui-state-default a,.um .ui-state-default a:link,.um .ui-state-default a:visited,a.um .ui-button,a:link.um .ui-button,a:visited.um .ui-button,.um .ui-button{color:#454545;text-decoration:none}.um .ui-state-hover,.um .ui-widget-content .ui-state-hover,.um .ui-widget-header .ui-state-hover,.um .ui-state-focus,.um .ui-widget-content .ui-state-focus,.um .ui-widget-header .ui-state-focus,.um .ui-button:hover,.um .ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.um .ui-state-hover a,.um .ui-state-hover a:hover,.um .ui-state-hover a:link,.um .ui-state-hover a:visited,.um .ui-state-focus a,.um .ui-state-focus a:hover,.um .ui-state-focus a:link,.um .ui-state-focus a:visited,a.um .ui-button:hover,a.um .ui-button:focus{color:#2b2b2b;text-decoration:none}.um .ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.um .ui-state-active,.um .ui-widget-content .ui-state-active,.um .ui-widget-header .ui-state-active,a.um .ui-button:active,.um .ui-button:active,.um .ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.um .ui-icon-background,.um .ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.um .ui-state-active a,.um .ui-state-active a:link,.um .ui-state-active a:visited{color:#fff;text-decoration:none}.um .ui-state-highlight,.um .ui-widget-content .ui-state-highlight,.um .ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.um .ui-state-checked{border:1px solid #dad55e;background:#fffa90}.um .ui-state-highlight a,.um .ui-widget-content .ui-state-highlight a,.um .ui-widget-header .ui-state-highlight a{color:#777620}.um .ui-state-error,.um .ui-widget-content .ui-state-error,.um .ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.um .ui-state-error a,.um .ui-widget-content .ui-state-error a,.um .ui-widget-header .ui-state-error a{color:#5f3f3f}.um .ui-state-error-text,.um .ui-widget-content .ui-state-error-text,.um .ui-widget-header .ui-state-error-text{color:#5f3f3f}.um .ui-priority-primary,.um .ui-widget-content .ui-priority-primary,.um .ui-widget-header .ui-priority-primary{font-weight:bold}.um .ui-priority-secondary,.um .ui-widget-content .ui-priority-secondary,.um .ui-widget-header .ui-priority-secondary{opacity:.7;-ms-filter:"alpha(opacity=70)";font-weight:normal}.um .ui-state-disabled,.um .ui-widget-content .ui-state-disabled,.um .ui-widget-header .ui-state-disabled{opacity:.35;-ms-filter:"alpha(opacity=35)";background-image:none}.um .ui-state-disabled .ui-icon{-ms-filter:"alpha(opacity=35)"}.um .ui-icon{width:16px;height:16px}.um .ui-icon,.um .ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.um .ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.um .ui-state-hover .ui-icon,.um .ui-state-focus .ui-icon,.um .ui-button:hover .ui-icon,.um .ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.um .ui-state-active .ui-icon,.um .ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.um .ui-state-highlight .ui-icon,.um .ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.um .ui-state-error .ui-icon,.um .ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.um .ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.um .ui-icon-blank.ui-icon-blank.ui-icon-blank{background-image:none}.um .ui-icon-caret-1-n{background-position:0 0}.um .ui-icon-caret-1-ne{background-position:-16px 0}.um .ui-icon-caret-1-e{background-position:-32px 0}.um .ui-icon-caret-1-se{background-position:-48px 0}.um .ui-icon-caret-1-s{background-position:-65px 0}.um .ui-icon-caret-1-sw{background-position:-80px 0}.um .ui-icon-caret-1-w{background-position:-96px 0}.um .ui-icon-caret-1-nw{background-position:-112px 0}.um .ui-icon-caret-2-n-s{background-position:-128px 0}.um .ui-icon-caret-2-e-w{background-position:-144px 0}.um .ui-icon-triangle-1-n{background-position:0 -16px}.um .ui-icon-triangle-1-ne{background-position:-16px -16px}.um .ui-icon-triangle-1-e{background-position:-32px -16px}.um .ui-icon-triangle-1-se{background-position:-48px -16px}.um .ui-icon-triangle-1-s{background-position:-65px -16px}.um .ui-icon-triangle-1-sw{background-position:-80px -16px}.um .ui-icon-triangle-1-w{background-position:-96px -16px}.um .ui-icon-triangle-1-nw{background-position:-112px -16px}.um .ui-icon-triangle-2-n-s{background-position:-128px -16px}.um .ui-icon-triangle-2-e-w{background-position:-144px -16px}.um .ui-icon-arrow-1-n{background-position:0 -32px}.um .ui-icon-arrow-1-ne{background-position:-16px -32px}.um .ui-icon-arrow-1-e{background-position:-32px -32px}.um .ui-icon-arrow-1-se{background-position:-48px -32px}.um .ui-icon-arrow-1-s{background-position:-65px -32px}.um .ui-icon-arrow-1-sw{background-position:-80px -32px}.um .ui-icon-arrow-1-w{background-position:-96px -32px}.um .ui-icon-arrow-1-nw{background-position:-112px -32px}.um .ui-icon-arrow-2-n-s{background-position:-128px -32px}.um .ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.um .ui-icon-arrow-2-e-w{background-position:-160px -32px}.um .ui-icon-arrow-2-se-nw{background-position:-176px -32px}.um .ui-icon-arrowstop-1-n{background-position:-192px -32px}.um .ui-icon-arrowstop-1-e{background-position:-208px -32px}.um .ui-icon-arrowstop-1-s{background-position:-224px -32px}.um .ui-icon-arrowstop-1-w{background-position:-240px -32px}.um .ui-icon-arrowthick-1-n{background-position:1px -48px}.um .ui-icon-arrowthick-1-ne{background-position:-16px -48px}.um .ui-icon-arrowthick-1-e{background-position:-32px -48px}.um .ui-icon-arrowthick-1-se{background-position:-48px -48px}.um .ui-icon-arrowthick-1-s{background-position:-64px -48px}.um .ui-icon-arrowthick-1-sw{background-position:-80px -48px}.um .ui-icon-arrowthick-1-w{background-position:-96px -48px}.um .ui-icon-arrowthick-1-nw{background-position:-112px -48px}.um .ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.um .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.um .ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.um .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.um .ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.um .ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.um .ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.um .ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.um .ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.um .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.um .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.um .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.um .ui-icon-arrowreturn-1-w{background-position:-64px -64px}.um .ui-icon-arrowreturn-1-n{background-position:-80px -64px}.um .ui-icon-arrowreturn-1-e{background-position:-96px -64px}.um .ui-icon-arrowreturn-1-s{background-position:-112px -64px}.um .ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.um .ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.um .ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.um .ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.um .ui-icon-arrow-4{background-position:0 -80px}.um .ui-icon-arrow-4-diag{background-position:-16px -80px}.um .ui-icon-extlink{background-position:-32px -80px}.um .ui-icon-newwin{background-position:-48px -80px}.um .ui-icon-refresh{background-position:-64px -80px}.um .ui-icon-shuffle{background-position:-80px -80px}.um .ui-icon-transfer-e-w{background-position:-96px -80px}.um .ui-icon-transferthick-e-w{background-position:-112px -80px}.um .ui-icon-folder-collapsed{background-position:0 -96px}.um .ui-icon-folder-open{background-position:-16px -96px}.um .ui-icon-document{background-position:-32px -96px}.um .ui-icon-document-b{background-position:-48px -96px}.um .ui-icon-note{background-position:-64px -96px}.um .ui-icon-mail-closed{background-position:-80px -96px}.um .ui-icon-mail-open{background-position:-96px -96px}.um .ui-icon-suitcase{background-position:-112px -96px}.um .ui-icon-comment{background-position:-128px -96px}.um .ui-icon-person{background-position:-144px -96px}.um .ui-icon-print{background-position:-160px -96px}.um .ui-icon-trash{background-position:-176px -96px}.um .ui-icon-locked{background-position:-192px -96px}.um .ui-icon-unlocked{background-position:-208px -96px}.um .ui-icon-bookmark{background-position:-224px -96px}.um .ui-icon-tag{background-position:-240px -96px}.um .ui-icon-home{background-position:0 -112px}.um .ui-icon-flag{background-position:-16px -112px}.um .ui-icon-calendar{background-position:-32px -112px}.um .ui-icon-cart{background-position:-48px -112px}.um .ui-icon-pencil{background-position:-64px -112px}.um .ui-icon-clock{background-position:-80px -112px}.um .ui-icon-disk{background-position:-96px -112px}.um .ui-icon-calculator{background-position:-112px -112px}.um .ui-icon-zoomin{background-position:-128px -112px}.um .ui-icon-zoomout{background-position:-144px -112px}.um .ui-icon-search{background-position:-160px -112px}.um .ui-icon-wrench{background-position:-176px -112px}.um .ui-icon-gear{background-position:-192px -112px}.um .ui-icon-heart{background-position:-208px -112px}.um .ui-icon-star{background-position:-224px -112px}.um .ui-icon-link{background-position:-240px -112px}.um .ui-icon-cancel{background-position:0 -128px}.um .ui-icon-plus{background-position:-16px -128px}.um .ui-icon-plusthick{background-position:-32px -128px}.um .ui-icon-minus{background-position:-48px -128px}.um .ui-icon-minusthick{background-position:-64px -128px}.um .ui-icon-close{background-position:-80px -128px}.um .ui-icon-closethick{background-position:-96px -128px}.um .ui-icon-key{background-position:-112px -128px}.um .ui-icon-lightbulb{background-position:-128px -128px}.um .ui-icon-scissors{background-position:-144px -128px}.um .ui-icon-clipboard{background-position:-160px -128px}.um .ui-icon-copy{background-position:-176px -128px}.um .ui-icon-contact{background-position:-192px -128px}.um .ui-icon-image{background-position:-208px -128px}.um .ui-icon-video{background-position:-224px -128px}.um .ui-icon-script{background-position:-240px -128px}.um .ui-icon-alert{background-position:0 -144px}.um .ui-icon-info{background-position:-16px -144px}.um .ui-icon-notice{background-position:-32px -144px}.um .ui-icon-help{background-position:-48px -144px}.um .ui-icon-check{background-position:-64px -144px}.um .ui-icon-bullet{background-position:-80px -144px}.um .ui-icon-radio-on{background-position:-96px -144px}.um .ui-icon-radio-off{background-position:-112px -144px}.um .ui-icon-pin-w{background-position:-128px -144px}.um .ui-icon-pin-s{background-position:-144px -144px}.um .ui-icon-play{background-position:0 -160px}.um .ui-icon-pause{background-position:-16px -160px}.um .ui-icon-seek-next{background-position:-32px -160px}.um .ui-icon-seek-prev{background-position:-48px -160px}.um .ui-icon-seek-end{background-position:-64px -160px}.um .ui-icon-seek-start{background-position:-80px -160px}.um .ui-icon-seek-first{background-position:-80px -160px}.um .ui-icon-stop{background-position:-96px -160px}.um .ui-icon-eject{background-position:-112px -160px}.um .ui-icon-volume-off{background-position:-128px -160px}.um .ui-icon-volume-on{background-position:-144px -160px}.um .ui-icon-power{background-position:0 -176px}.um .ui-icon-signal-diag{background-position:-16px -176px}.um .ui-icon-signal{background-position:-32px -176px}.um .ui-icon-battery-0{background-position:-48px -176px}.um .ui-icon-battery-1{background-position:-64px -176px}.um .ui-icon-battery-2{background-position:-80px -176px}.um .ui-icon-battery-3{background-position:-96px -176px}.um .ui-icon-circle-plus{background-position:0 -192px}.um .ui-icon-circle-minus{background-position:-16px -192px}.um .ui-icon-circle-close{background-position:-32px -192px}.um .ui-icon-circle-triangle-e{background-position:-48px -192px}.um .ui-icon-circle-triangle-s{background-position:-64px -192px}.um .ui-icon-circle-triangle-w{background-position:-80px -192px}.um .ui-icon-circle-triangle-n{background-position:-96px -192px}.um .ui-icon-circle-arrow-e{background-position:-112px -192px}.um .ui-icon-circle-arrow-s{background-position:-128px -192px}.um .ui-icon-circle-arrow-w{background-position:-144px -192px}.um .ui-icon-circle-arrow-n{background-position:-160px -192px}.um .ui-icon-circle-zoomin{background-position:-176px -192px}.um .ui-icon-circle-zoomout{background-position:-192px -192px}.um .ui-icon-circle-check{background-position:-208px -192px}.um .ui-icon-circlesmall-plus{background-position:0 -208px}.um .ui-icon-circlesmall-minus{background-position:-16px -208px}.um .ui-icon-circlesmall-close{background-position:-32px -208px}.um .ui-icon-squaresmall-plus{background-position:-48px -208px}.um .ui-icon-squaresmall-minus{background-position:-64px -208px}.um .ui-icon-squaresmall-close{background-position:-80px -208px}.um .ui-icon-grip-dotted-vertical{background-position:0 -224px}.um .ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.um .ui-icon-grip-solid-vertical{background-position:-32px -224px}.um .ui-icon-grip-solid-horizontal{background-position:-48px -224px}.um .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.um .ui-icon-grip-diagonal-se{background-position:-80px -224px}.um .ui-corner-all,.um .ui-corner-top,.um .ui-corner-left,.um .ui-corner-tl{border-top-left-radius:3px}.um .ui-corner-all,.um .ui-corner-top,.um .ui-corner-right,.um .ui-corner-tr{border-top-right-radius:3px}.um .ui-corner-all,.um .ui-corner-bottom,.um .ui-corner-left,.um .ui-corner-bl{border-bottom-left-radius:3px}.um .ui-corner-all,.um .ui-corner-bottom,.um .ui-corner-right,.um .ui-corner-br{border-bottom-right-radius:3px}.um .ui-widget-overlay{background:#aaa;opacity:.3;-ms-filter:Alpha(Opacity=30)}.um .ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666} \ No newline at end of file diff --git a/assets/css/pickadate/default.css b/assets/libs/pickadate/default.css similarity index 100% rename from assets/css/pickadate/default.css rename to assets/libs/pickadate/default.css diff --git a/assets/css/pickadate/default.date.css b/assets/libs/pickadate/default.date.css similarity index 100% rename from assets/css/pickadate/default.date.css rename to assets/libs/pickadate/default.date.css diff --git a/assets/libs/pickadate/default.date.min.css b/assets/libs/pickadate/default.date.min.css new file mode 100644 index 00000000..3bf1abe3 --- /dev/null +++ b/assets/libs/pickadate/default.date.min.css @@ -0,0 +1 @@ +.um .picker__header{text-align:center;position:relative;margin-top:.75em;border-radius:2px 2px 0 0;padding:15px 0;font-size:18px}.um .picker__month,.um .picker__year{display:inline-block;margin-left:10px;margin-right:10px}.um .picker__select--month,.um .picker__select--year{margin-left:.25em;margin-right:.25em;font-size:16px;color:#999;background:#fff!important;outline:0!important;border:0!important}@media (min-width:24.5em){.um .picker__select--month,.um .picker__select--year{margin-top:-.5em}}.um .picker__select--month{width:35%}.um .picker__select--year{width:22.5%}.um .picker__nav--next,.um .picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;box-sizing:content-box!important;top:8px;color:#fff}.um-popup .picker__nav--next,.um-popup .picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;box-sizing:content-box!important;top:8px;color:#fff}.um .picker__nav--prev{left:0;padding-right:1.25em}.um-popup .picker__nav--prev{left:0;padding-right:1.25em}@media (min-width:24.5em){.um .picker__nav--prev{padding-right:1.5em}.um-popup .picker__nav--prev{padding-right:1.5em}}.um .picker__nav--next{right:0;padding-left:1.25em}.um-popup .picker__nav--next{right:0;padding-left:1.25em}@media (min-width:24.5em){.um .picker__nav--next{padding-left:1.5em}.um-popup .picker__nav--next{padding-left:1.5em}}.um .picker__nav--next:before,.um .picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.5em solid #fff;width:0;height:0;display:block;margin:0 auto}.um-popup .picker__nav--next:before,.um-popup .picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.5em solid #fff;width:0;height:0;display:block;margin:0 auto}.um .picker__nav--next:before{border-right:0;border-left:.5em solid #fff}.um-popup .picker__nav--next:before{border-right:0;border-left:.5em solid #fff}.um .picker__nav--next:hover,.um .picker__nav--prev:hover{cursor:pointer;color:#fff}.um-popup .picker__nav--next:hover,.um-popup .picker__nav--prev:hover{cursor:pointer;color:#fff}.um .picker__nav--disabled,.um .picker__nav--disabled:before,.um .picker__nav--disabled:before:hover,.um .picker__nav--disabled:hover{cursor:default;background:0 0}.um-popup .picker__nav--disabled,.um-popup .picker__nav--disabled:before,.um-popup .picker__nav--disabled:before:hover,.um-popup .picker__nav--disabled:hover{cursor:default;background:0 0}.um .picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:5px;border:none;margin-bottom:0}.um .picker__table td{margin:0;padding:0 10px;text-align:center;border:0}.um .picker__weekday{width:14.285714286%;color:#fff;text-align:center;padding:5px 0!important}.um .picker__day{padding:10px 0;line-height:1em!important}.um .picker__day--today{position:relative}.um .picker__day--outfocus{opacity:.75}.um .picker__day--infocus:hover,.um .picker__day--outfocus:hover{border-radius:2px;cursor:pointer}.um .picker--focused .picker__day--highlighted,.um .picker__day--highlighted:hover{border-radius:2px}.um .picker__day--disabled,.um .picker__day--disabled:hover{cursor:default;background:0 0!important;opacity:.3}.um .picker__footer{text-align:center;height:50px!important;line-height:50px!important;margin-top:5px;border-radius:0 0 2px 2px}.um .picker__button--clear,.um .picker__button--today{margin:0!important;width:50%;display:inline-block;background:0 0!important;box-shadow:none!important;border:0!important;outline:0!important;box-sizing:border-box!important}.um .picker__button--clear:focus,.um .picker__button--clear:hover,.um .picker__button--today:focus,.um .picker__button--today:hover{cursor:pointer} \ No newline at end of file diff --git a/assets/libs/pickadate/default.min.css b/assets/libs/pickadate/default.min.css new file mode 100644 index 00000000..c20e948b --- /dev/null +++ b/assets/libs/pickadate/default.min.css @@ -0,0 +1,4 @@ +.um .picker{font-size:16px;text-align:left;line-height:1.2;color:#fff;position:absolute;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.um .picker__box ul li[role=presentation]{margin:10px 0 0 0}.um .picker__input{cursor:default}.um .picker__input.picker__input--active{border-color:#0089ec}.um .picker__holder{width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}/*! + * Default mobile-first, responsive styling for pickadate.js + * Demo: http://amsul.github.io/pickadate.js + */.um .picker__frame,.um .picker__holder{bottom:0;left:0;right:0;top:100%}.um .picker__holder{position:fixed;-webkit-transition:background .15s ease-out,top 0s .15s;-moz-transition:background .15s ease-out,top 0s .15s;transition:background .15s ease-out,top 0s .15s}.um .picker__frame{position:absolute;margin:0 auto;min-width:256px;max-width:400px;width:100%;-moz-opacity:0;opacity:0;-webkit-transition:all .15s ease-out;-moz-transition:all .15s ease-out;transition:all .15s ease-out}@media (min-height:33.875em){.um .picker__frame{overflow:visible;top:auto;bottom:-100%;max-height:80%}}@media (min-height:40.125em){.um .picker__frame{margin-bottom:15%!important}}.um .picker__wrap{display:table;width:100%;height:100%}@media (min-height:33.875em){.um .picker__wrap{display:block}}.um .picker__box{display:table-cell;vertical-align:middle}@media (min-height:33.875em){.um .picker__box{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}}@media (min-height:40.125em){.um .picker__box{border-bottom-width:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}}.um .picker--opened .picker__holder{top:0;background:0 0;zoom:1;background:rgba(0,0,0,.7);-webkit-transition:background .15s ease-out;-moz-transition:background .15s ease-out;transition:background .15s ease-out}.um .picker--opened .picker__frame{top:0;-moz-opacity:1;opacity:1}@media (min-height:33.875em){.um .picker--opened .picker__frame{top:auto;bottom:0}} \ No newline at end of file diff --git a/assets/css/pickadate/default.time.css b/assets/libs/pickadate/default.time.css similarity index 100% rename from assets/css/pickadate/default.time.css rename to assets/libs/pickadate/default.time.css diff --git a/assets/libs/pickadate/default.time.min.css b/assets/libs/pickadate/default.time.min.css new file mode 100644 index 00000000..fe6a4741 --- /dev/null +++ b/assets/libs/pickadate/default.time.min.css @@ -0,0 +1 @@ +.um .picker__list{list-style:none;list-style:none!important;padding:5px!important;margin:0!important}.um .picker__list-item{position:relative;border-radius:2px;display:inline-block;width:25%;text-align:center;box-sizing:border-box;padding:6px 0!important;margin:5px 0!important}.um .picker__list-item:hover{cursor:pointer;z-index:10}.um .picker__list-item--highlighted{z-index:10}.um .picker--focused .picker__list-item--highlighted,.um .picker__list-item--highlighted:hover{cursor:pointer;font-weight:700}.um .picker--focused .picker__list-item--selected,.um .picker__list-item--selected,.um .picker__list-item--selected:hover{z-index:10}.um .picker--focused .picker__list-item--disabled,.um .picker__list-item--disabled,.um .picker__list-item--disabled:hover{color:#a9e792;cursor:default;background:0 0;z-index:auto}.um .picker--time .picker__button--clear{width:100%;display:inline-block;background:0 0;box-shadow:none!important;border:0!important;outline:0!important;background:0 0!important;border-radius:0 0 2px 2px;color:#fff!important}.um .picker--time .picker__button--clear:focus,.um .picker--time .picker__button--clear:hover{cursor:pointer}.um .picker--time .picker__frame{min-width:256px;max-width:400px}.um .picker--time .picker__box{font-size:15px;padding:0;border-radius:2px!important}.um .picker__box ul li[role=presentation]{margin:10px 0 0 0}@media (min-height:40.125em){.um .picker--time .picker__frame{margin-bottom:10%!important}} \ No newline at end of file diff --git a/assets/js/pickadate/legacy.js b/assets/libs/pickadate/legacy.js similarity index 100% rename from assets/js/pickadate/legacy.js rename to assets/libs/pickadate/legacy.js diff --git a/assets/libs/pickadate/legacy.min.js b/assets/libs/pickadate/legacy.min.js new file mode 100644 index 00000000..721f57b9 --- /dev/null +++ b/assets/libs/pickadate/legacy.min.js @@ -0,0 +1 @@ +[].map||(Array.prototype.map=function(t,e){for(var r=this,n=r.length,i=new Array(n),o=0;o>>0;if("function"!=typeof t)throw new TypeError;for(var n,i=[],o=arguments[1],l=0;l>>0;if(0!=r){var n=0;if(1>>0:e>>>0;(i=t.exec(r))&&!(c<(o=i.index+i[0].length)&&(p.push(r.slice(c,i.index)),!compliantExecNpcg&&1=e.from.pick&&t.pick<=e.to.pick},a.prototype.overlapRanges=function(e,t){var a=this;return e=a.createRange(e.from,e.to),t=a.createRange(t.from,t.to),a.withinRange(e,t.from)||a.withinRange(e,t.to)||a.withinRange(t,e.from)||a.withinRange(t,e.to)},a.prototype.now=function(e,t,a){return t=new Date,a&&a.rel&&t.setDate(t.getDate()+a.rel),this.normalize(t,a)},a.prototype.navigate=function(e,t,a){var n,i,r,o=p.isArray(t),s=p.isPlainObject(t),l=this.item.view;if(o||s){for(r=s?(n=t.year,i=t.month,t.date):(n=+t[0],i=+t[1],+t[2]),a&&a.nav&&l&&l.month!==i&&(n=l.year,i=l.month),n=(o=new Date(n,i+(a&&a.nav?a.nav:0),1)).getFullYear(),i=o.getMonth();new Date(n,i,r).getMonth()!==i;)--r;t=[n,i,r]}return t},a.prototype.normalize=function(e){return e.setHours(0,0,0,0),e},a.prototype.measure=function(e,t){return y.isInteger(t)?t=this.now(e,t,{rel:t}):t?"string"==typeof t&&(t=this.parse(e,t)):t="min"==e?-1/0:1/0,t},a.prototype.viewset=function(e,t){return this.create([t.year,t.month,1])},a.prototype.validate=function(e,a,t){var n,i,r,o,s=this,l=a,c=t&&t.interval?t.interval:1,d=-1===s.item.enable,u=s.item.min,h=s.item.max,m=d&&s.item.disable.filter(function(e){var t;return p.isArray(e)&&((t=s.create(e).pick)a.pick&&(i=!0)),y.isInteger(e)}).length;if((!t||!t.nav&&!t.defaultValue)&&(!d&&s.disabled(a)||d&&s.disabled(a)&&(m||n||i)||!d&&(a.pick<=u.pick||a.pick>=h.pick)))for(d&&!m&&(!i&&0l.month)&&(a=l,c=0=h.pick&&(o=!0,c=-1,a=s.create([h.year,h.month,h.date+(a.pick===h.pick?0:1)])),!r||!o);)a=s.create([a.year,a.month,a.date+c]);return a},a.prototype.disabled=function(t){var a=this,e=(e=a.item.disable.filter(function(e){return y.isInteger(e)?t.day===(a.settings.firstDay?e:e-1)%7:p.isArray(e)||y.isDate(e)?t.pick===a.create(e).pick:p.isPlainObject(e)?a.withinRange(e,t):void 0})).length&&!e.filter(function(e){return p.isArray(e)&&"inverted"==e[3]||p.isPlainObject(e)&&e.inverted}).length;return-1===a.item.enable?!e:e||t.picka.item.max.pick},a.prototype.parse=function(e,n,t){var i=this,r={};return n&&"string"==typeof n?(t&&t.format||((t=t||{}).format=i.settings.format),i.formats.toArray(t.format).map(function(e){var t=i.formats[e],a=t?y.trigger(t,i,[n,r]):e.replace(/^!/,"").length;t&&(r[e]=n.substr(0,a)),n=n.substr(a)}),[r.yyyy||r.yy,+(r.mm||r.m)-1,r.dd||r.d]):n},a.prototype.formats={d:function(e,t){return e?y.digits(e):t.date},dd:function(e,t){return e?2:y.lead(t.date)},ddd:function(e,t){return e?i(e):this.settings.weekdaysShort[t.day]},dddd:function(e,t){return e?i(e):this.settings.weekdaysFull[t.day]},m:function(e,t){return e?y.digits(e):t.month+1},mm:function(e,t){return e?2:y.lead(t.month+1)},mmm:function(e,t){var a=this.settings.monthsShort;return e?n(e,a,t):a[t.month]},mmmm:function(e,t){var a=this.settings.monthsFull;return e?n(e,a,t):a[t.month]},yy:function(e,t){return e?2:(""+t.year).slice(2)},yyyy:function(e,t){return e?4:t.year},toArray:function(e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(e,t){var a=this;return a.formats.toArray(e).map(function(e){return y.trigger(a.formats[e],a,[0,t])||e.replace(/^!/,"")}).join("")}},a.prototype.isDateExact=function(e,t){return y.isInteger(e)&&y.isInteger(t)||"boolean"==typeof e&&"boolean"==typeof t?e===t:(y.isDate(e)||p.isArray(e))&&(y.isDate(t)||p.isArray(t))?this.create(e).pick===this.create(t).pick:!(!p.isPlainObject(e)||!p.isPlainObject(t))&&this.isDateExact(e.from,t.from)&&this.isDateExact(e.to,t.to)},a.prototype.isDateOverlap=function(e,t){var a=this.settings.firstDay?1:0;return y.isInteger(e)&&(y.isDate(t)||p.isArray(t))?(e=e%7+a)===this.create(t).day+1:y.isInteger(t)&&(y.isDate(e)||p.isArray(e))?(t=t%7+a)===this.create(e).day+1:!(!p.isPlainObject(e)||!p.isPlainObject(t))&&this.overlapRanges(e,t)},a.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(-1==t.enable?1:-1)},a.prototype.deactivate=function(e,t){var n=this,i=n.item.disable.slice(0);return"flip"==t?n.flipEnable():!1===t?(n.flipEnable(1),i=[]):!0===t?(n.flipEnable(-1),i=[]):t.map(function(e){for(var t,a=0;a=f.year&&h.month>=f.month||!e&&h.year<=p.year&&h.month<=p.month?" "+l.klass.navDisabled:""),"data-nav="+(e||-1)+" "+y.ariaAttr({role:"button",controls:s.$node[0].id+"_table"})+' title="'+(e?l.labelMonthNext:l.labelMonthPrev)+'"')}function t(){var t=l.showMonthsShort?l.monthsShort:l.monthsFull;return l.selectMonths?y.node("select",y.group({min:0,max:11,i:1,node:"option",item:function(e){return[t[e],0,"value="+e+(h.month==e?" selected":"")+(h.year==p.year&&ef.month?" disabled":"")]}}),l.klass.selectMonth,(o?"":"disabled")+" "+y.ariaAttr({controls:s.$node[0].id+"_table"})+' title="'+l.labelMonthSelect+'"'):y.node("div",t[h.month],l.klass.month)}function a(){var e,t,a,n,i=h.year,r=!0===l.selectYears?5:~~(l.selectYears/2);return r?(a=p.year,e=f.year,t=i+r,(r=i-r)f.pick,r=y.trigger(s.formats.toString,s,[l.format,e]);return[y.node("div",e.date,((t=[l.klass.day]).push(h.month==e.month?l.klass.infocus:l.klass.outfocus),c.pick==e.pick&&t.push(l.klass.now),a&&t.push(l.klass.selected),n&&t.push(l.klass.highlighted),i&&t.push(l.klass.disabled),t.join(" ")),"data-pick="+e.pick+" "+y.ariaAttr({role:"gridcell",label:r,selected:!(!a||s.$node.val()!==r)||null,activedescendant:!!n||null,disabled:!!i||null})),"",y.ariaAttr({role:"presentation"})]}})]}})),l.klass.table,'id="'+s.$node[0].id+'_table" '+y.ariaAttr({role:"grid",controls:s.$node[0].id,readonly:!0}))+y.node("div",y.node("button",l.today,l.klass.buttonToday,"type=button data-pick="+c.pick+(o&&!s.disabled(c)?"":" disabled")+" "+y.ariaAttr({controls:s.$node[0].id}))+y.node("button",l.clear,l.klass.buttonClear,"type=button data-clear=1"+(o?"":" disabled")+" "+y.ariaAttr({controls:s.$node[0].id}))+y.node("button",l.close,l.klass.buttonClose,"type=button data-close=true "+(o?"":" disabled")+" "+y.ariaAttr({controls:s.$node[0].id})),l.klass.footer)},a.defaults={labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,updateInput:!0,format:"d mmmm, yyyy",klass:{table:(t=e.klasses().picker+"__")+"table",header:t+"header",navPrev:t+"nav--prev",navNext:t+"nav--next",navDisabled:t+"nav--disabled",month:t+"month",year:t+"year",selectMonth:t+"select--month",selectYear:t+"select--year",weekdays:t+"weekday",day:t+"day",disabled:t+"day--disabled",selected:t+"day--selected",highlighted:t+"day--highlighted",now:t+"day--today",infocus:t+"day--infocus",outfocus:t+"day--outfocus",footer:t+"footer",buttonClear:t+"button--clear",buttonToday:t+"button--today",buttonClose:t+"button--close"}},e.extend("pickadate",a)}); \ No newline at end of file diff --git a/assets/js/pickadate/picker.js b/assets/libs/pickadate/picker.js similarity index 100% rename from assets/js/pickadate/picker.js rename to assets/libs/pickadate/picker.js diff --git a/assets/libs/pickadate/picker.min.js b/assets/libs/pickadate/picker.min.js new file mode 100644 index 00000000..d1a09ce2 --- /dev/null +++ b/assets/libs/pickadate/picker.min.js @@ -0,0 +1 @@ +!function(e){"function"==typeof define&&define.amd?define("picker",["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):this.Picker=e(jQuery)}(function(h){var o=h(window),m=h(document),r=h(document.documentElement),g=null!=document.documentElement.style.transition;function v(r,t,n,e){var o,d,s,i,c,u;return r?(o=!1,d={id:r.id||"P"+Math.abs(~~(Math.random()*new Date))},s=n?h.extend(!0,{},n.defaults,e):e||{},i=h.extend({},v.klasses(),s.klass),c=h(r),u=(e=function(){return this.start()}).prototype={constructor:e,$node:c,start:function(){var e;return d&&d.start?u:(d.methods={},d.start=!0,d.open=!1,d.type=r.type,r.autofocus=r==b(),r.readOnly=!s.editable,r.id=r.id||d.id,"text"!=r.type&&(r.type="text"),u.component=new n(u,s),u.$root=h('
'),$(u.$root[0],"hidden",!0),u.$holder=h(a()).appendTo(u.$root),l(),s.formatSubmit&&(!0===s.hiddenName?(e=r.name,r.name=""):e=(e=["string"==typeof s.hiddenPrefix?s.hiddenPrefix:"","string"==typeof s.hiddenSuffix?s.hiddenSuffix:"_submit"])[0]+r.name+e[1],u._hidden=h('")[0],c.on("change."+d.id,function(){u._hidden.value=r.value?u.get("select",s.formatSubmit):""})),c.data(t,u).addClass(i.input).val(c.data("value")?u.get("select",s.format):r.value).on("focus."+d.id+" click."+d.id,function(o,r,i){var a;return function(){var e=this,t=arguments,n=i&&!a;clearTimeout(a),a=setTimeout(function(){a=null,i||o.apply(e,t)},r),n&&o.apply(e,t)}}(function(e){e.preventDefault(),u.open()},100)),s.editable||c.on("keydown."+d.id,p),$(r,{haspopup:!0,expanded:!1,readonly:!1,owns:r.id+"_root"}),s.containerHidden?h(s.containerHidden).append(u._hidden):c.after(u._hidden),s.container?h(s.container).append(u.$root):c.after(u.$root),u.on({start:u.component.onStart,render:u.component.onRender,stop:u.component.onStop,open:u.component.onOpen,close:u.component.onClose,set:u.component.onSet}).on({start:s.onStart,render:s.onRender,stop:s.onStop,open:s.onOpen,close:s.onClose,set:s.onSet}),o=function(e){var t,n="position";e.currentStyle?t=e.currentStyle[n]:window.getComputedStyle&&(t=getComputedStyle(e)[n]);return"fixed"==t}(u.$holder[0]),r.autofocus&&u.open(),u.trigger("start").trigger("render"))},render:function(e){return e?(u.$holder=h(a()),l(),u.$root.html(u.$holder)):u.$root.find("."+i.box).html(u.component.nodes(d.open)),u.trigger("render")},stop:function(){return d.start&&(u.close(),u._hidden&&u._hidden.parentNode.removeChild(u._hidden),u.$root.remove(),c.removeClass(i.input).removeData(t),setTimeout(function(){c.off("."+d.id)},0),r.type=d.type,r.readOnly=!1,u.trigger("stop"),d.methods={},d.start=!1),u},open:function(e){return d.open?u:(c.addClass(i.active),$(r,"expanded",!0),setTimeout(function(){u.$root.addClass(i.opened),$(u.$root[0],"hidden",!1)},0),!1!==e&&(d.open=!0,o&&h("body").css("overflow","hidden").css("padding-right","+="+y()),o&&g?u.$holder.find("."+i.frame).one("transitionend",function(){u.$holder.eq(0).focus()}):setTimeout(function(){u.$holder.eq(0).focus()},0),m.on("click."+d.id+" focusin."+d.id,function(e){var t=_(e,r);e.isSimulated||t==r||t==document||3==e.which||u.close(t===u.$holder[0])}).on("keydown."+d.id,function(e){var t=e.keyCode,n=u.component.key[t],o=_(e,r);27==t?u.close(!0):o!=u.$holder[0]||!n&&13!=t?h.contains(u.$root[0],o)&&13==t&&(e.preventDefault(),o.click()):(e.preventDefault(),n?v._.trigger(u.component.key.go,u,[v._.trigger(n)]):u.$root.find("."+i.highlighted).hasClass(i.disabled)||(u.set("select",u.component.item.highlight),s.closeOnSelect&&u.close(!0)))})),u.trigger("open"))},close:function(e){return e&&(s.editable?r.focus():(u.$holder.off("focus.toOpen").focus(),setTimeout(function(){u.$holder.on("focus.toOpen",f)},0))),c.removeClass(i.active),$(r,"expanded",!1),setTimeout(function(){u.$root.removeClass(i.opened+" "+i.focused),$(u.$root[0],"hidden",!0)},0),d.open?(d.open=!1,o&&h("body").css("overflow","").css("padding-right","-="+y()),m.off("."+d.id),u.trigger("close")):u},clear:function(e){return u.set("clear",null,e)},set:function(e,t,n){var o,r,i=h.isPlainObject(e),a=i?e:{};if(n=i&&h.isPlainObject(t)?t:n||{},e){for(o in i||(a[e]=t),a)r=a[o],o in u.component.item&&(void 0===r&&(r=null),u.component.set(o,r,n)),"select"!=o&&"clear"!=o||!s.updateInput||c.val("clear"==o?"":u.get(o,s.format)).trigger("change");u.render()}return n.muted?u:u.trigger("set",a)},get:function(e,t){if(null!=d[e=e||"value"])return d[e];if("valueSubmit"==e){if(u._hidden)return u._hidden.value;e="value"}var n;return"value"==e?r.value:e in u.component.item?"string"==typeof t?(n=u.component.get(e))?v._.trigger(u.component.formats.toString,u.component,[t,n]):"":u.component.get(e):void 0},on:function(e,t,n){var o,r,i=h.isPlainObject(e),a=i?e:{};if(e)for(o in i||(a[e]=t),a)r=a[o],d.methods[o=n?"_"+o:o]=d.methods[o]||[],d.methods[o].push(r);return u},off:function(){var e,t=arguments,n=0;for(namesCount=t.length;n').appendTo("body"),t=e[0].offsetWidth;e.css("overflow","scroll");var n=h('
').appendTo(e)[0].offsetWidth;return e.remove(),t-n}function _(e,t){var n=[];return e.path&&(n=e.path),(n=e.originalEvent&&e.originalEvent.path?e.originalEvent.path:n)&&0"+(t=h.isArray(t)?t.join(""):t)+"":""},lead:function(e){return(e<10?"0":"")+e},trigger:function(e,t,n){return"function"==typeof e?e.apply(t,n||[]):e},digits:function(e){return/\d/.test(e[1])?2:1},isDate:function(e){return-1<{}.toString.call(e).indexOf("Date")&&this.isInteger(e.getDate())},isInteger:function(e){return-1<{}.toString.call(e).indexOf("Number")&&e%1==0},ariaAttr:function(e,t){h.isPlainObject(e)||(e={attribute:t});for(var n in t="",e){var o=("role"==n?"":"aria-")+n,r=e[n];t+=null==r?"":o+'="'+e[n]+'"'}return t}},v.extend=function(o,r){h.fn[o]=function(e,t){var n=this.data(o);return"picker"==e?n:n&&"string"==typeof e?v._.trigger(n[e],n,[t]):this.each(function(){h(this).data(o)||new v(this,o,r,e)})},h.fn[o].defaults=r.defaults},v}); \ No newline at end of file diff --git a/assets/js/pickadate/picker.time.js b/assets/libs/pickadate/picker.time.js similarity index 100% rename from assets/js/pickadate/picker.time.js rename to assets/libs/pickadate/picker.time.js diff --git a/assets/libs/pickadate/picker.time.min.js b/assets/libs/pickadate/picker.time.min.js new file mode 100644 index 00000000..b661546c --- /dev/null +++ b/assets/libs/pickadate/picker.time.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(["./picker","jquery"],t):"object"==typeof exports?module.exports=t(require("./picker.js"),require("jquery")):t(Picker,jQuery)}(function(t,l){var e,m=60,n=1440,h=t._;function i(n,a){var t,e=this,i=n.$node[0].value,r=n.$node.data("value"),i=r||i,r=r?a.formatSubmit:a.format;e.settings=a,e.$node=n.$node,e.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"},e.item={},e.item.clear=null,e.item.interval=a.interval||30,e.item.disable=(a.disable||[]).slice(0),e.item.enable=-(!0===(t=e.item.disable)[0]?t.shift():-1),e.set("min",a.min).set("max",a.max).set("now"),i?e.set("select",i,{format:r}):e.set("select",null).set("highlight",e.item.now),e.key={40:1,38:-1,39:1,37:-1,go:function(t){e.set("highlight",e.item.highlight.pick+t*e.item.interval,{interval:t*e.item.interval}),this.render()}},n.on("render",function(){function t(e,i){r("transform").map(function(t){e.css(t,i)}),r("transition").map(function(t){e.css(t,i)})}var e=n.$root.children(),i=e.find("."+a.klass.viewset),r=function(e){return["webkit","moz","ms","o",""].map(function(t){return(t?"-"+t+"-":"")+e})};i.length&&(t(e,"none"),e[0].scrollTop=~~i.position().top-2*i[0].clientHeight,t(e,""))},1).on("open",function(){n.$root.find("button").attr("disabled",!1)},1).on("close",function(){n.$root.find("button").attr("disabled",!0)},1)}i.prototype.set=function(e,i,r){var n=this,t=n.item;return null===i?t[e="clear"==e?"select":e]=i:(t["enable"==e?"disable":"flip"==e?"enable":e]=n.queue[e].split(" ").map(function(t){return i=n[t](e,i,r)}).pop(),"select"==e?n.set("highlight",t.select,r):"highlight"==e?n.set("view",t.highlight,r):"interval"==e?n.set("min",t.min,r).set("max",t.max,r):e.match(/^(flip|min|max|disable|enable)$/)&&(t.select&&n.disabled(t.select)&&n.set("select",i,r),t.highlight&&n.disabled(t.highlight)&&n.set("highlight",i,r),"min"==e)&&n.set("max",t.max,r)),n},i.prototype.get=function(t){return this.item[t]},i.prototype.create=function(t,e,i){var r=this;return h.isDate(e=void 0===e?t:e)&&(e=[e.getHours(),e.getMinutes()]),l.isPlainObject(e)&&h.isInteger(e.pick)?e=e.pick:l.isArray(e)?e=+e[0]*m+ +e[1]:h.isInteger(e)||(e=r.now(t,e,i)),"max"==t&&e=t.from.pick&&e.pick<=t.to.pick},i.prototype.overlapRanges=function(t,e){var i=this;return t=i.createRange(t.from,t.to),e=i.createRange(e.from,e.to),i.withinRange(t,e.from)||i.withinRange(t,e.to)||i.withinRange(e,t.from)||i.withinRange(e,t.to)},i.prototype.now=function(t,e){var i,r=this.item.interval,n=new Date,n=n.getHours()*m+n.getMinutes();return n-=n%r,i=e<0&&r*e+n<=-r,n+="min"==t&&i?0:r,h.isInteger(e)&&(n+=r*(i&&"max"!=t?e+1:e)),n},i.prototype.normalize=function(t,e){var i=this.item.interval,r=this.item.min&&this.item.min.pick||0;return e-="min"==t?0:(e-r)%i},i.prototype.measure=function(t,e,i){return"string"==typeof(e=e||("min"==t?[0,0]:[23,59]))?e=this.parse(t,e):!0===e||h.isInteger(e)?e=this.now(t,e,i):l.isPlainObject(e)&&h.isInteger(e.pick)&&(e=this.normalize(t,e.pick,i)),e},i.prototype.validate=function(t,e,i){var r=this,i=(i&&i.interval?i:r.item).interval;return r.disabled(e)&&(e=r.shift(e,i)),e=r.scope(e),e=r.disabled(e)?r.shift(e,-1*i):e},i.prototype.disabled=function(e){var i=this,t=(t=i.item.disable.filter(function(t){return h.isInteger(t)?e.hour==t:l.isArray(t)||h.isDate(t)?e.pick==i.create(t).pick:l.isPlainObject(t)?i.withinRange(t,e):void 0})).length&&!t.filter(function(t){return l.isArray(t)&&"inverted"==t[2]||l.isPlainObject(t)&&t.inverted}).length;return-1===i.item.enable?!t:t||e.picki.item.max.pick},i.prototype.shift=function(t,e){var i=this,r=i.item.min.pick,n=i.item.max.pick;for(e=e||i.item.interval;i.disabled(t)&&!((t=i.create(t.pick+=e)).pick<=r||t.pick>=n););return t},i.prototype.scope=function(t){var e=this.item.min.pick,i=this.item.max.pick;return this.create(t.pick>i?i:t.pick 0 && $('body').css('position') == 'relative' ) { if ( $('#wpadminbar').length ) { @@ -61,198 +61,198 @@ } } tp = {top: pos.top + pos.height / 2 - actualHeight / 2 - extra_gap, left: pos.left + pos.width + this.options.offset}; - break; - } - - if (gravity.length == 2) { - if (gravity.charAt(1) == 'w') { - tp.left = pos.left + pos.width / 2 - 15; - } else { - tp.left = pos.left + pos.width / 2 - actualWidth + 15; - } - } - - $tip.css(tp).addClass('tipsy-' + gravity); - $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); - if (this.options.className) { - $tip.addClass(maybeCall(this.options.className, this.$element[0])); - } - - if (this.options.fade) { - $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); - } else { - $tip.css({visibility: 'visible', opacity: this.options.opacity}); - } - } - }, - - hide: function() { - if (this.options.fade) { - this.tip().stop().fadeOut(function() { $(this).remove(); }); - } else { - this.tip().remove(); - } - }, - - fixTitle: function() { - var $e = this.$element; - if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { - $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); - } - }, - - getTitle: function() { - var title, $e = this.$element, o = this.options; - this.fixTitle(); - var title, o = this.options; - if (typeof o.title == 'string') { - title = $e.attr(o.title == 'title' ? 'original-title' : o.title); - } else if (typeof o.title == 'function') { - title = o.title.call($e[0]); - } - title = ('' + title).replace(/(^\s*|\s*$)/, ""); - return title || o.fallback; - }, - - tip: function() { - if (!this.$tip) { - this.$tip = $('
').html('
'); - this.$tip.data('tipsy-pointee', this.$element[0]); - } - return this.$tip; - }, - - validate: function() { - if (!this.$element[0].parentNode) { - this.hide(); - this.$element = null; - this.options = null; - } - }, - - enable: function() { this.enabled = true; }, - disable: function() { this.enabled = false; }, - toggleEnabled: function() { this.enabled = !this.enabled; } - }; - - $.fn.tipsy = function(options) { - - if (options === true) { - return this.data('tipsy'); - } else if (typeof options == 'string') { - var tipsy = this.data('tipsy'); - if (tipsy) tipsy[options](); - return this; - } - - options = $.extend({}, $.fn.tipsy.defaults, options); - - function get(ele) { - var tipsy = $.data(ele, 'tipsy'); - if (!tipsy) { - tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); - $.data(ele, 'tipsy', tipsy); - } - return tipsy; - } - - function enter() { - var tipsy = get(this); - tipsy.hoverState = 'in'; - if (options.delayIn == 0) { - tipsy.show(); - } else { - tipsy.fixTitle(); - setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); - } - }; - - function leave() { - var tipsy = get(this); - tipsy.hoverState = 'out'; - if (options.delayOut == 0) { - tipsy.hide(); - } else { - setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); - } - }; - - if (!options.on) this.each(function() { get(this); }); + break; + } - if (options.trigger != 'manual') { - var eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', - eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; - if (options.on) - $(document).on(eventIn, this.selector, enter).on(eventOut, this.selector, leave); - else - this.on(eventIn, enter).on(eventOut, leave); - } + if (gravity.length == 2) { + if (gravity.charAt(1) == 'w') { + tp.left = pos.left + pos.width / 2 - 15; + } else { + tp.left = pos.left + pos.width / 2 - actualWidth + 15; + } + } - return this; - - }; - - $.fn.tipsy.defaults = { - className: null, - delayIn: 0, - delayOut: 0, - fade: false, - fallback: '', - gravity: 'n', - html: false, - live: false, - offset: 0, - opacity: 0.8, - title: 'title', - trigger: 'hover' - }; - - $.fn.tipsy.revalidate = function() { - $('.tipsy').each(function() { - var pointee = $.data(this, 'tipsy-pointee'); - if (!pointee || !isElementInDOM(pointee)) { - $(this).remove(); - } - }); - }; - - // Overwrite this method to provide options on a per-element basis. - // For example, you could store the gravity in a 'tipsy-gravity' attribute: - // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); - // (remember - do not modify 'options' in place!) - $.fn.tipsy.elementOptions = function(ele, options) { - return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; - }; - - $.fn.tipsy.autoNS = function() { - return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; - }; - - $.fn.tipsy.autoWE = function() { - return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; - }; - - /** - * yields a closure of the supplied parameters, producing a function that takes - * no arguments and is suitable for use as an autogravity function like so: - * - * @param margin (int) - distance from the viewable region edge that an - * element should be before setting its tooltip's gravity to be away - * from that edge. - * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer - * if there are no viewable region edges effecting the tooltip's - * gravity. It will try to vary from this minimally, for example, - * if 'sw' is preferred and an element is near the right viewable - * region edge, but not the top edge, it will set the gravity for - * that element's tooltip to be 'se', preserving the southern - * component. - */ - $.fn.tipsy.autoBounds = function(margin, prefer) { + $tip.css(tp).addClass('tipsy-' + gravity); + $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); + if (this.options.className) { + $tip.addClass(maybeCall(this.options.className, this.$element[0])); + } + + if (this.options.fade) { + $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); + } else { + $tip.css({visibility: 'visible', opacity: this.options.opacity}); + } + } + }, + + hide: function() { + if (this.options.fade) { + this.tip().stop().fadeOut(function() { $(this).remove(); }); + } else { + this.tip().remove(); + } + }, + + fixTitle: function() { + var $e = this.$element; + if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { + $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); + } + }, + + getTitle: function() { + var title, $e = this.$element, o = this.options; + this.fixTitle(); + var title, o = this.options; + if (typeof o.title == 'string') { + title = $e.attr(o.title == 'title' ? 'original-title' : o.title); + } else if (typeof o.title == 'function') { + title = o.title.call($e[0]); + } + title = ('' + title).replace(/(^\s*|\s*$)/, ""); + return title || o.fallback; + }, + + tip: function() { + if (!this.$tip) { + this.$tip = $('
').html('
'); + this.$tip.data('tipsy-pointee', this.$element[0]); + } + return this.$tip; + }, + + validate: function() { + if (!this.$element[0].parentNode) { + this.hide(); + this.$element = null; + this.options = null; + } + }, + + enable: function() { this.enabled = true; }, + disable: function() { this.enabled = false; }, + toggleEnabled: function() { this.enabled = !this.enabled; } + }; + + $.fn.tipsy = function(options) { + + if (options === true) { + return this.data('tipsy'); + } else if (typeof options == 'string') { + var tipsy = this.data('tipsy'); + if (tipsy) tipsy[options](); + return this; + } + + options = $.extend({}, $.fn.tipsy.defaults, options); + + function get(ele) { + var tipsy = $.data(ele, 'tipsy'); + if (!tipsy) { + tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); + $.data(ele, 'tipsy', tipsy); + } + return tipsy; + } + + function enter() { + var tipsy = get(this); + tipsy.hoverState = 'in'; + if (options.delayIn == 0) { + tipsy.show(); + } else { + tipsy.fixTitle(); + setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); + } + }; + + function leave() { + var tipsy = get(this); + tipsy.hoverState = 'out'; + if (options.delayOut == 0) { + tipsy.hide(); + } else { + setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); + } + }; + + if (!options.on) this.each(function() { get(this); }); + + if (options.trigger != 'manual') { + var eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', + eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; + if (options.on) + $(document).on(eventIn, this.selector, enter).on(eventOut, this.selector, leave); + else + this.on(eventIn, enter).on(eventOut, leave); + } + + return this; + + }; + + $.fn.tipsy.defaults = { + className: null, + delayIn: 0, + delayOut: 0, + fade: false, + fallback: '', + gravity: 'n', + html: false, + live: false, + offset: 0, + opacity: 0.8, + title: 'title', + trigger: 'hover' + }; + + $.fn.tipsy.revalidate = function() { + $('.tipsy').each(function() { + var pointee = $.data(this, 'tipsy-pointee'); + if (!pointee || !isElementInDOM(pointee)) { + $(this).remove(); + } + }); + }; + + // Overwrite this method to provide options on a per-element basis. + // For example, you could store the gravity in a 'tipsy-gravity' attribute: + // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); + // (remember - do not modify 'options' in place!) + $.fn.tipsy.elementOptions = function(ele, options) { + return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; + }; + + $.fn.tipsy.autoNS = function() { + return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; + }; + + $.fn.tipsy.autoWE = function() { + return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; + }; + + /** + * yields a closure of the supplied parameters, producing a function that takes + * no arguments and is suitable for use as an autogravity function like so: + * + * @param margin (int) - distance from the viewable region edge that an + * element should be before setting its tooltip's gravity to be away + * from that edge. + * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer + * if there are no viewable region edges effecting the tooltip's + * gravity. It will try to vary from this minimally, for example, + * if 'sw' is preferred and an element is near the right viewable + * region edge, but not the top edge, it will set the gravity for + * that element's tooltip to be 'se', preserving the southern + * component. + */ + $.fn.tipsy.autoBounds = function(margin, prefer) { return function() { var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, - boundTop = $(document).scrollTop() + margin, - boundLeft = $(document).scrollLeft() + margin, - $this = $(this); + boundTop = $(document).scrollTop() + margin, + boundLeft = $(document).scrollLeft() + margin, + $this = $(this); if ($this.offset().top < boundTop) dir.ns = 'n'; if ($this.offset().left < boundLeft) dir.ew = 'w'; @@ -262,5 +262,5 @@ return dir.ns + (dir.ew ? dir.ew : ''); } }; - + })(jQuery); diff --git a/assets/libs/tipsy/tipsy.min.css b/assets/libs/tipsy/tipsy.min.css index dc8b0b73..5d3fb155 100644 --- a/assets/libs/tipsy/tipsy.min.css +++ b/assets/libs/tipsy/tipsy.min.css @@ -1 +1 @@ -.tipsy{padding:5px;position:absolute;z-index:9999999999!important}.tipsy-inner{font-size:13px!important;line-height:17px!important;background-color:#333!important;color:#fff!important;max-width:250px!important;padding:6px 10px!important;text-align:left!important;word-wrap:break-word!important;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale!important}.tipsy-inner{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}.tipsy-arrow{position:absolute!important;width:0!important;height:0!important;line-height:0!important;border:5px dashed #333}.tipsy-arrow-n{border-bottom-color:#333!important}.tipsy-arrow-s{border-top-color:#333!important}.tipsy-arrow-e{border-left-color:#333!important}.tipsy-arrow-w{border-right-color:#333!important}.tipsy-n .tipsy-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent} \ No newline at end of file +.tipsy{font-size:10px;position:absolute;padding:5px;z-index:100000}.tipsy-inner{background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center}.tipsy-inner{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}.tipsy-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.tipsy-arrow-n{border-bottom-color:#000}.tipsy-arrow-s{border-top-color:#000}.tipsy-arrow-e{border-left-color:#000}.tipsy-arrow-w{border-right-color:#000}.tipsy-n .tipsy-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-nw .tipsy-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-ne .tipsy-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.tipsy-s .tipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-sw .tipsy-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-se .tipsy-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.tipsy-e .tipsy-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.tipsy-w .tipsy-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index b058b6e0..734bfec5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,6 +19,37 @@ gulp.task( 'default', function ( done ) { .pipe( rename({ suffix: '.min' }) ) .pipe( gulp.dest( 'assets/js/' ) ); + gulp.src(['assets/js/admin/*.js','!assets/js/admin/*.min.js']) // path to your files + .pipe( uglify() ) + .pipe( rename({ suffix: '.min' }) ) + .pipe( gulp.dest( 'assets/js/admin/' ) ); + gulp.src(['assets/css/admin/*.css', '!assets/css/admin/*.min.css',]) + .pipe( cleanCSS() ) + .pipe( rename( { suffix: '.min' } ) ) + .pipe( gulp.dest( 'assets/css/admin/' ) ); + + // full CSS files + gulp.src(['assets/css/admin/*.sass']) + .pipe( sass().on( 'error', sass.logError ) ) + .pipe( gulp.dest( 'assets/css/admin/' ) ); + // min CSS files + gulp.src(['assets/css/admin/*.sass']) + .pipe( sass().on( 'error', sass.logError ) ) + .pipe( cleanCSS() ) + .pipe( rename( { suffix: '.min' } ) ) + .pipe( gulp.dest( 'assets/css/admin/' ) ); + + // full CSS files + gulp.src(['assets/css/*.sass']) + .pipe( sass().on( 'error', sass.logError ) ) + .pipe( gulp.dest( 'assets/css/' ) ); + // min CSS files + gulp.src(['assets/css/*.sass']) + .pipe( sass().on( 'error', sass.logError ) ) + .pipe( cleanCSS() ) + .pipe( rename( { suffix: '.min' } ) ) + .pipe( gulp.dest( 'assets/css/' ) ); + gulp.src(['assets/libs/legacy/fonticons/*.css', '!assets/libs/legacy/fonticons/*.min.css',]) .pipe( cleanCSS() ) .pipe( rename( { suffix: '.min' } ) ) @@ -44,5 +75,19 @@ gulp.task( 'default', function ( done ) { .pipe( rename({ suffix: '.min' }) ) .pipe( gulp.dest( 'assets/libs/tipsy/' ) ); + // Pickadate lib + gulp.src(['assets/libs/pickadate/*.css', '!assets/libs/pickadate/*.min.css',]) + .pipe( cleanCSS() ) + .pipe( rename( { suffix: '.min' } ) ) + .pipe( gulp.dest( 'assets/libs/pickadate/' ) ); + gulp.src(['assets/libs/pickadate/*.js', '!assets/libs/pickadate/*.min.js',]) + .pipe( uglify() ) + .pipe( rename({ suffix: '.min' }) ) + .pipe( gulp.dest( 'assets/libs/pickadate/' ) ); + gulp.src(['assets/libs/pickadate/translations/*.js', '!assets/libs/pickadate/translations/*.min.js',]) + .pipe( uglify() ) + .pipe( rename({ suffix: '.min' }) ) + .pipe( gulp.dest( 'assets/libs/pickadate/translations/' ) ); + done(); }); diff --git a/includes/admin/assets/css/um-admin-columns.css b/includes/admin/assets/css/um-admin-columns.css index 25ff9e7a..d0a8e492 100644 --- a/includes/admin/assets/css/um-admin-columns.css +++ b/includes/admin/assets/css/um-admin-columns.css @@ -2,68 +2,3 @@ -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale; } - -.um-admin.post-type-um_form .manage-column.column-id {width: 60px} -.um-admin.post-type-um_form .manage-column.column-mode {width: 100px} -.um-admin.post-type-um_form .manage-column.column-is_default {width: 60px} -.um-admin.post-type-um_form .manage-column.column-title {width: 200px} -.um-admin.post-type-um_form .manage-column.column-shortcode {width: 200px} -.um-admin.post-type-um_form .manage-column.column-impressions {width: 100px} -.um-admin.post-type-um_form .manage-column.column-conversions {width: 100px} - -.um-admin.post-type-um_directory .manage-column.column-id {width: 60px} -.um-admin.post-type-um_directory .manage-column.column-title {width: 250px} -.um-admin.post-type-um_directory .manage-column.column-is_default {width: 60px} - -.um-admin.post-type-um_role .manage-column.column-title {width: 200px} -.um-admin.post-type-um_role .manage-column.column-count {width: 150px} -.um-admin.post-type-um_role .manage-column.column-core {width: 150px} - -.um-admin.post-type-um_form td.column-shortcode, -.um-admin.post-type-um_form td.column-id, -.um-admin.post-type-um_directory td.column-shortcode, -.um-admin.post-type-um_directory td.column-id, -.um-admin.post-type-um_role td.column-count -{font-size: 14px;} - -.um-admin.users-php td.column-um_actions {padding-top: 12px} - -.um-admin.users-php td.column-um_actions a.button { - height: 29px !important; - margin: 0 0 0 2px !important; - position: relative; -} - -.um-admin-tag { - display: inline-block; - border-radius: 2px; - width: 100%; - box-sizing: border-box; - text-align: center; - background: #0085ba; - color: #fff; - font-size: 14px; - height: 34px; - line-height: 34px; -} -.um-admin-tag.small {font-size: 13px;height:28px;line-height: 28px;display:inline;padding: 4px 10px;background: transparent;color: #666;border-radius:0;} -.um-admin-tag.approved {border-left: 2px solid #7ACF58} -.um-admin-tag.pending {border-left: 2px solid #C74A4A} - -.um-admin-txtspace {margin: 0 0 0 10px;} - -.um-adm-ico { - font-size: 18px; - width: 18px; - text-align: center; - display: inline-block; - color: #7ACF58; -} - -.um-adm-ico.inactive {color: #C74A4A} -.um-adm-ico.pointer {cursor: pointer} - -.um-admin-icontext i { - font-size: 18px; - margin: 0 5px 0 0; -} \ No newline at end of file diff --git a/includes/admin/assets/css/um-admin-dashboard.css b/includes/admin/assets/css/um-admin-dashboard.css deleted file mode 100644 index 6538cd58..00000000 --- a/includes/admin/assets/css/um-admin-dashboard.css +++ /dev/null @@ -1,295 +0,0 @@ -#um-extensions-wrap #the-list { - margin: 0; - width: 100%; - display: grid; - grid-template-rows: auto 1fr; - grid-template-columns: repeat(3, 1fr); - grid-gap: 10px; - grid-auto-rows: minmax(max-content, auto); - -ms-grid-template-rows: auto 1fr; - -ms-grid-template-columns: repeat(3, 1fr); - -ms-grid-gap: 10px; - -ms-grid-auto-rows: minmax(max-content, auto); - align-items: center; -} - -#um-extensions-wrap .plugin-card { - padding: 20px; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: flex-start; - align-items: stretch; - width: 100%; - margin: 0; -} - -#um-extensions-wrap .plugin-image-wrapper { - color: #fff; - height: 70px; - width: 70px; - margin: 0 auto; - border-radius: 60px; - box-shadow: 0 2px 9px rgb(50 50 93 / 21%); - border: solid 4px #fff; - display: flex; - justify-content: center; - align-items: center; - overflow: hidden; -} - -#um-extensions-wrap .plugin-image-wrapper a { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - background-color: #7856ff; -} - -#um-extensions-wrap a.plugin-image.svg-image { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - flex-wrap: nowrap; -} - -#um_bbpress_image { - background-color: #fff !important; - filter: none !important; - width: 70px !important; -} - -#um_mycred_image { - background-color: #fff; -} - -#um_groups_image, -#um_profile-tabs_image, -#um_user-tags_image, -#um_friends_image, -#um_user-reviews_image, -#um_verified-users_image, -#um_private-content_image, -#um_online-users_image { - width: 36px !important; -} - -#um_notices_image, -#um_social-activity_image, -#um_profile-completeness_image, -#um_private-messages_image, -#um_user-photos_image, -#um_terms-conditions_image { - width: 29px !important; -} - -#um_social-login_image { - width: 28px !important; -} - -#um_real-time-notifications_image, -#um_user-notes_image { - width: 26px !important; -} - -#um_followers_image, -#um_user-locations_image { - width: 32px !important; -} - -#um_user-bookmarks_image { - width: 23px !important; -} - -#um-extensions-wrap a.plugin-image.svg-image img { - filter: invert(1); - background-color: transparent; - width: 38px; - height: auto; -} - -#um-extensions-wrap a.plugin-image, -#um-extensions-wrap a.plugin-image img { - display: block; -} - -#um-extensions-wrap .plugin-image:not(.svg-image) img { - width: 70px; - margin: 0; - height: 70px; - padding: 0; -} - -#um-extensions-wrap .plugin-card-top { - margin: 0; - padding: 20px 0 0 0; - width: 100%; - min-height: 100px; -} - -#um-extensions-wrap .plugin-card-top h3 { - text-align: center; - margin: 0 0 20px 0; - padding: 0; -} - -#um-extensions-wrap .plugin-card-top .desc { - text-align: center; - margin: 0 !important; - padding: 0 !important; -} - -#um-extensions-wrap .plugin-action-links { - padding: 20px 0 0 0; - width: 100%; - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: baseline; - flex-wrap: nowrap; -} - - -@media (max-width: 1152px) { - #um-extensions-wrap .plugin-card-top { - min-height: 120px; - } -} - -@media (max-width: 992px) { - #um-extensions-wrap #the-list { - grid-template-columns: repeat(2, 1fr); - -ms-grid-template-columns: repeat(2, 1fr); - } -} - -@media (max-width: 782px) { - #um-extensions-wrap #the-list { - grid-template-columns: repeat(1, 1fr); - -ms-grid-template-columns: repeat(1, 1fr); - } -} - -@media screen and (max-width: 782px) { - #um-extensions-wrap .plugin-card-top { - min-height: 80px; - } -} - -#um-metaboxes-general h1 sup { - font-size: 14px; - position: relative; - font-weight: 400; - background: #0085ba; - color: #fff !important; - padding: 2px 4px !important; - border-radius: 3px; - top: 5px; - left: 3px; - border: none !important; -} - -.wrap a.red, .wrap span.red {color:#C74A4A} -.wrap span.ok {color:#7ACF58} - -/* Misc */ - -.um-admin-dash-review { - text-decoration: none !important; - font-size: 16px; - position: absolute; - top: -2px; - right: 4px; -} - -/* Dashboard widgets */ - -.p_seperate { - margin-top: 12px; - border-top: 1px solid #ddd; -} - -.um-metabox-holder p.sub { - padding: 0 4px 2px 4px; - margin: 0 0 8px 0; - color: #8F8F8F; - font-size: 14px; - border-bottom: 1px solid #ECECEC; -} - -.um-metabox-holder .table { - float: left; - width: 45%; -} - -.um-metabox-holder a.warning { - color: #C74A4A !important; - background: transparent !important; - border: 0; -} - -.um-metabox-holder .table_right { - float: right; - width: 45%; -} - -.um-metabox-holder td.b { - padding-right: 6px; - text-align: right; - font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; - font-size: 14px; - width: 1%; -} - -.um-metabox-holder td.b { - text-align: right; - font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; - font-size: 14px; -} - -.um-metabox-holder table td { - white-space: nowrap; - font-size: 12px; -} - -.um-metabox-holder td.b a { - font-size: 18px; -} - -.um-metabox-holder .norm i { - display: inline-block; - width: 30px; - text-align: center; -} - -.um-metabox-holder .norm p { - margin: 5px 0; -} - -.um-metabox-holder .norm .count { - font-size: 16px; - font-family: Gerogia; - color: #999; - width: 40px; - display: inline-block; - text-align: right; - margin-right: 10px; -} - -/* Share bar */ - -.um-admin-dash-share { - margin-top: 11px !important; - float: left; - line-height: 28px; - font-size: 15px; -} - -.um-admin-dash-share a { - margin: 0 15px 0 0 !important; - text-decoration: none !important; - color: #777 !important; - font-size: 22px !important; -} -.um-admin-dash-share a:hover {color: #0085ba !important} diff --git a/includes/admin/assets/css/um-admin-form.css b/includes/admin/assets/css/um-admin-form.css deleted file mode 100644 index 4efbb1ee..00000000 --- a/includes/admin/assets/css/um-admin-form.css +++ /dev/null @@ -1,61 +0,0 @@ -/* - - General -*/ - -.um-admin-metabox * { - -webkit-font-smoothing: antialiased !important; - -moz-osx-font-smoothing: grayscale !important; -} - -.um-admin-metabox h6 { - font-size: 14px; - margin: 12px 0 0 0; -} - -/* - - Metabox layout -*/ - -.um-admin.post-type-um_form div#submitdiv, -.um-admin.post-type-um_form div#side-sortables -{display:none} - -/* - - Boxed Links -*/ - -.um-admin-boxed-links { - width: 100%; - text-align: center; -} - -.um-admin-boxed-links a { - width: 33.3%; - float: left; - border-left: 1px solid #fff; - border-right: 1px solid #fff; - padding: 30px 25px !important; - background: #f8f8f8; - text-align: center; - display: inline-block !important; - font-size: 14px; - transition: all .2s linear; - text-decoration: none; - color: #666; - margin: 0 !important; - box-sizing: border-box !important; - border-radius: 2px; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-weight: 600; -} - -.um-admin-boxed-links i { - font-size: 28px; - vertical-align: middle; - margin: 0 10px 0 0; -} - -.um-admin-boxed-links a:hover { - background: #eee; -} \ No newline at end of file diff --git a/includes/admin/assets/css/um-admin-global.css b/includes/admin/assets/css/um-admin-global.css deleted file mode 100644 index b38567b6..00000000 --- a/includes/admin/assets/css/um-admin-global.css +++ /dev/null @@ -1,225 +0,0 @@ -.um-admin-notice { - border-color: #0085ba !important; - color: #555; -} - -.um-admin-notice.notice-warning { - border-color: #dba617 !important; - color: #555; -} - -.um-admin-notice.upgraded { - border-color: #0085ba !important; - color: #555; -} - -.um-admin-notice.error { - border-color: #dc3232 !important; - color: #555; -} - -.um-admin-notice a.button-primary { - background-color: #0085ba !important; - border-color: #0085ba !important; -} - -.um-admin-notice a.button-primary:hover { - background-color: #008ec2 !important; - border-color: #008ec2 !important; -} - -.um-admin-notice a.button-secondary {opacity: 0.7} -.um-admin-notice a.button-secondary:hover {opacity: 0.9} -.um-admin-notice a {text-decoration: none;color: #0085ba} -.um-admin-notice a:hover {color: #44b0ec} - -.um-filter { - padding: 12px; - border-color: #ddd !important; - margin: 20px 0 0 0 !important; - font-size: 14px; - line-height: 24px; -} - -/* - - General metabox styling -*/ - -#um-admin-access-settings h3 { - padding: 10px 20px 10px 60px; - color: #fff; - background: #0085ba url(../img/logo-small.png) no-repeat 12px center; - font-weight: bold; - font-size: 14px !important; - -webkit-font-smoothing: antialiased !important; - -moz-osx-font-smoothing: grayscale !important; -} - -#um-admin-access-settings h4 { margin: 10px 0 4px 0!important} - -#um-admin-access-settings div.handlediv { - color: #fff !important; - -webkit-font-smoothing: antialiased !important; - -moz-osx-font-smoothing: grayscale !important; -} - -#um-admin-access-settings p {font-size: 13px} - -#um-admin-access-settings input[type=text] {font-size: 13px} - -/* - - Nav Menu -*/ - -.um-nav-edit * { - -webkit-font-smoothing: antialiased !important; - -moz-osx-font-smoothing: grayscale !important; -} - -.um-nav-edit-h2 { - padding: 10px 20px 10px 60px; - margin: 14px 12px 0 0; - border-radius: 3px; - color: #fff; - background: #0085ba url(../img/logo-small.png) no-repeat 12px center; - font-weight: bold; -} - -.um-nav-mode {margin-top:10px} -.um-nav-roles {display: none;margin-top:5px} - -/* - - jQuery Tooltips -*/ - -.um-admin-tip { - margin: 0 0 0 2px; - color: #0085ba !important; - vertical-align: middle; - position: relative; - top: -3px; - opacity: 0.8; -} -.um-admin-tip.n {margin-left: 5px} -.um-admin-tip i {cursor: pointer; vertical-align: middle; font-size: 20px; line-height: 20px;color: #0085ba !important;} -a.um-delete{ color: #a00; } - - - -/* Roles metabox + table features */ -.um-metabox-section .description { - font-style: italic; -} - -.um-metabox-section th { - width: 35%; -} - -.wp-list-table.roles .column-core, -.wp-list-table.roles .column-users, -.wp-list-table.roles .column-admin_access, -.wp-list-table.roles .column-priority { - width:15%; - text-align: center !important; -} - -@media screen and (max-width: 782px) { - .wp-list-table.roles .column-core, - .wp-list-table.roles .column-users, - .wp-list-table.roles .column-admin_access, - .wp-list-table.roles .column-priority { - text-align: left !important; - } -} - -#um-admin-form-wp-capabilities .um-metadata-line th { - width: auto; -} - -#um-admin-form-wp-capabilities .um-metadata-line td { - width: 20px; -} - -#um_edit_role #titlewrap > span { - width: 40px; - font-size: 24px; - float:left; - display: block; - line-height: 37px; -} - -#um-roles .row-actions .reset a { - color:#a00; -} - -#um-roles .row-actions .reset a:hover { - color:red; -} - - -/*Tooltip*/ -.ui-tooltip.um_tooltip { - padding: 8px; - color: #eeeeee !important; - background: #333 !important; - position: absolute; - z-index: 1000000; - max-width: 300px; - font-size: 12px; - border-radius: 5px; - border: none !important; - text-shadow: none !important; -} - -.ui-tooltip.um_tooltip a { - color: #eeeeee !important; -} - -.um_tooltip.dashicons, -.um_tooltip.dashicons:before { - height:22px; -} - -.um_tooltip.dashicons-editor-help::before { - float: left; - font-size: 20px; - line-height: 20px; - color: #333 !important; -} -.um_tooltip { - cursor: pointer; - vertical-align: middle; -} -.um_tooltip:hover { - opacity: 1; -} - -.um_tooltip:hover:before { - opacity: 0.8; -} - - -.wp-admin p.um-nav-roles label input[type=checkbox] { - margin-top: 0 !important; -} - -.wp-admin p.um-nav-roles label { - margin-top: 2px !important; - margin-bottom: 2px !important; -} - -/* - - Restrict access -*/ - -.um_hidden_notice, -.um_block_settings .um_block_settings_hide{ - display: none; -} -.um_block_settings .components-select-control .components-select-control__input[multiple]{ - height: auto; -} -.um_block_settings .components-select-control .components-select-control__input[multiple] + .components-input-control__suffix{ - display: none; -} - diff --git a/includes/admin/assets/css/um-admin-menu.css b/includes/admin/assets/css/um-admin-menu.css deleted file mode 100644 index 3c8c8d14..00000000 --- a/includes/admin/assets/css/um-admin-menu.css +++ /dev/null @@ -1,3 +0,0 @@ -ul#adminmenu a.wp-has-current-submenu:after,ul#adminmenu>li.current>a.current:after {display: none !important} - -ul#adminmenu li.wp-has-submenu.wp-not-current-submenu:hover:after{right:-9999999px} \ No newline at end of file diff --git a/includes/admin/assets/css/um-admin-misc.css b/includes/admin/assets/css/um-admin-misc.css index 7cb87ec8..8f92628e 100644 --- a/includes/admin/assets/css/um-admin-misc.css +++ b/includes/admin/assets/css/um-admin-misc.css @@ -1,163 +1,7 @@ -/* - - Welcome -*/ - -.um-about-wrap * { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.um-about-wrap a.um-about-icon { - margin: 0 0 0 15px !important; - padding: 0 !important; - text-decoration: none !important; - color: #777 !important; - font-size: 22px !important; -} - -.um-about-wrap a.um-about-icon:hover {color: #0085ba !important} - -.um-badge { - color: #fff; - background: none !important; - background: #0085ba url(../img/logo_small.png) no-repeat center 0px !important; -} - -.um-about-wrap .ultimatemember-actions a.button-primary, -.um-about-wrap .ultimatemember-actions a.button { - vertical-align: top; - margin: 0 5px 0 0; -} - -.changelog a.button-primary { - height: 40px; - line-height: 38px; -} - -.um-about-wrap a {text-decoration: none} - -/* - - General -*/ - -body.um-admin-modal-open { - overflow: hidden; -} - -.um-admin #major-publishing-actions{background-color: #fff !important;border-top:0} - -.um-admin-hide {display: none} - -.um-admin-field { - display: block; - width: 100%; - margin-top: 10px; -} - -.um-admin-field a.button { - position: relative; - top: 1px; - height: 30px !important; -} - -.um-admin-half { - float: left; - width: 48%; -} - -.um-admin-tri { - float: left; - width: 33%; -} - -.um-admin-left{float: left} -.um-admin-right {float: right} -.um-admin-clear {clear: both} - -.um-admin a.um-admin-activebg, -.um-admin a.um-admin-activebg:hover{ - /*background: #3ba1da;*/ - background: #0085ba; - color: #fff; -} - -.um-admin a.button i, -.um-admin a.button-primary i { - font-size: 15px !important; - height: 15px !important; - width: 15px !important; - text-align: center !important; - margin: 0 5px 0 0 !important; - display: inline-block; -} - -.um-admin a.button i:before, -.um-admin a.button-primary i:before { - position: relative; - top: 1px; -} - /* - Form Inputs */ -.um-admin-metabox h3 { - padding-left: 0 !important; -} - -.um-admin-metabox h4 { - font-size: 14px; - background: #f5f5f5; - padding: 8px 4px; - color: #333; -} - -.um-admin-metabox p {margin: 10px 0 0 0} - -.um-admin-metabox label{ - display: block; - cursor: default; - margin: 0 0 8px 0 !important; - padding: 0!important; - font-size: 13px; - color: #666; -} - -.um-admin-metabox input[type=text]:disabled{ - opacity: 0.7 !important; - color: #aaa !important; -} - -.um-admin-metabox input[type=text] { - height: auto !important; -} - -.um-admin-metabox input[type=text], -.um-admin-metabox textarea { - width: 100%; - max-width: 100%; - display: block; - box-sizing: border-box !important; - font-size: 13px !important; - line-height: 1.4em !important; - padding: 4px 10px !important; -} - -.um-admin-metabox textarea { - padding: 8px !important; - line-height: 1.6em; - color: #888 !important; -} - -.um-admin-metabox input[type=text].um-admin-error, -.um-admin-metabox textarea.um-admin-error -{border-color: #C74A4A!important} - -.um-admin-metabox input[type=text].small {width: 54px} - -.um-admin-metabox textarea {min-height: 100px;height: 100px} -.um-admin-metabox textarea.tall {min-height: 200px;height: 200px} - .wp-picker-container input.wp-color-picker[type="text"] { width: 68px !important; float: left !important; @@ -165,102 +9,6 @@ body.um-admin-modal-open { border-width: 1px !important; } -/* - - Error blocks -*/ - -.um-admin-error-block, .um-admin-success-block{ - display: none; - width: 100%; - background: #C74A4A; - border-radius: 3px; - color: #fff; - box-sizing: border-box; - position: relative; - padding: 12px; - font-size: 13px; - line-height: 1em !important; - margin: 0 0 16px 0; -} - -.um-admin-success-block { - background: #7ACF58; -} - -/* - - Yes or NO UI -*/ - -p.disabled-on-off .um-admin-yesno { - opacity: 0.5!important; - cursor: default !important; -} -p.disabled-on-off .um-admin-yesno *{ - cursor: default !important; -} - -.um-admin-yesno { - width: 100px !important; - height: 26px; - display: block; - position: relative; - color: #fff; -} - -.um-admin-yesno span.btn { - position: absolute; - left: 0; - top: -2px; - width: 50px; - height: 28px; - text-align: center; - background: #f9f9f9; - z-index: 999; - border-radius: 3px; - cursor: pointer; - border: solid 1px #D0D9DB; - margin: 0; - padding: 0 !important; -} - -.um-admin-yesno span.btn.pos-1 {left: 48px} - -.um-admin-yesno span.yes, .um-admin-yesno span.no { - width: 50px; - float: left; - line-height: 24px; - height: 26px; - cursor: default; - font-size: 14px; - color: #fff; - padding: 0 0 0 10px; - box-sizing: border-box; -} - -.um-admin-yesno .yes { - background: #0085ba; - border-radius: 3px 0 0 3px; - border: 1px solid rgba(0,0,0,.2); -} - -.um-admin-yesno .no { - padding: 0 10px 0 0 !important; - text-align: right; - float: right; - background: #fff; - color: #222 !important; - border-radius: 0 3px 3px 0; - border: 1px solid #ddd; -} - -.um-admin.users-php .subsubsub li.subsep { - display: block; - visibility: hidden; - height: 0; -} - -.um-admin-cur-condition-template { - display: none; -} + diff --git a/includes/admin/assets/css/um-admin-rtl.css b/includes/admin/assets/css/um-admin-rtl.css index 57ba3098..4e2298bf 100644 --- a/includes/admin/assets/css/um-admin-rtl.css +++ b/includes/admin/assets/css/um-admin-rtl.css @@ -1,7 +1,3 @@ -.um-admin-yesno span.yes, .um-admin-yesno span.no { - padding: 0 10px 0 0; -} - .um-admin-drag-ctrls-demo.um-admin-drag-ctrls { left: 12px; right: auto; @@ -68,4 +64,4 @@ .um-form-fields-section label input { float: right; -} \ No newline at end of file +} diff --git a/includes/admin/assets/css/um-admin-settings.css b/includes/admin/assets/css/um-admin-settings.css index 4bcac0c7..d8207f19 100644 --- a/includes/admin/assets/css/um-admin-settings.css +++ b/includes/admin/assets/css/um-admin-settings.css @@ -242,31 +242,6 @@ th.column-email.column-primary { } } -/* -.email_template_wrapper .copy_button_overlay { - position:absolute; - top:0; - bottom:0; - width:calc( 100% - 30px ); - z-index: 2; - background: rgba( 241, 241, 241, 0.95 ); - text-align: center; - padding-top: 30%; - padding-right: 20px; - padding-left: 20px; -} - -.email_template_wrapper .copy_button_overlay > span { - color: #444; - margin: 0 0 15px 0; - display: inline-block; -} - -.email_template_wrapper.in_theme .copy_button_overlay { - display: none !important; -} -*/ - .um_setting_ajax_button_response.complete { color:darkgreen; font-style: italic; diff --git a/includes/admin/assets/js/um-admin-ajax.js b/includes/admin/assets/js/um-admin-ajax.js index adfb5fdf..712bf980 100644 --- a/includes/admin/assets/js/um-admin-ajax.js +++ b/includes/admin/assets/js/um-admin-ajax.js @@ -28,10 +28,6 @@ function um_builder_delete_field_ajax( callback ) { jQuery(document).ready(function() { - jQuery(document).ajaxStart( function() { - jQuery('.tipsy').hide(); - }); - jQuery( document.body ).on('click', 'a[data-silent_action^="um_"]', function() { if ( typeof jQuery(this).attr('disabled') !== 'undefined' ) { return false; @@ -54,8 +50,6 @@ jQuery(document).ready(function() { in_group = demon_settings.data('in_group'); } - jQuery('.tipsy').hide(); - um_admin_remove_modal(); jQuery.ajax({ url: wp.ajax.settings.url, diff --git a/includes/admin/assets/js/um-admin-blocks.js b/includes/admin/assets/js/um-admin-blocks.js deleted file mode 100644 index 2f3ec381..00000000 --- a/includes/admin/assets/js/um-admin-blocks.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -var um_components = wp.components, - umSelectControl = um_components.SelectControl, - umTextareaControl = um_components.TextareaControl; - - -function um_admin_blocks_custom_fields( um_condition_fields, props ) { - return wp.hooks.applyFilters( 'um_admin_blocks_custom_fields', [], um_condition_fields, props ); -} - -var um_block_restriction = wp.compose.createHigherOrderComponent( - function( BlockEdit ) { - var um_condition_fields = { - um_who_access: 'um_block_settings_hide', - um_roles_access: 'um_block_settings_hide', - um_message_type: 'um_block_settings_hide', - um_message_content: 'um_block_settings_hide' - }; - - um_condition_fields = wp.hooks.applyFilters( 'um_admin_blocks_condition_fields_default', um_condition_fields ); - - return function( props ) { - let initialIsRestrict = props.attributes.um_is_restrict !== undefined ? props.attributes.um_is_restrict : false; - - if ( props.attributes.um_is_restrict !== true ) { - um_condition_fields['um_who_access'] = 'um_block_settings_hide'; - um_condition_fields['um_roles_access'] = 'um_block_settings_hide'; - um_condition_fields['um_message_type'] = 'um_block_settings_hide'; - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - } else { - um_condition_fields['um_who_access'] = ''; - - if ( parseInt( props.attributes.um_who_access ) === 0 || typeof props.attributes.um_who_access === 'undefined' ) { - um_condition_fields['um_roles_access'] = 'um_block_settings_hide'; - um_condition_fields['um_message_type'] = 'um_block_settings_hide'; - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - } else if ( parseInt( props.attributes.um_who_access ) === 1 ) { - um_condition_fields['um_roles_access'] = ''; - um_condition_fields['um_message_type'] = ''; - - if ( parseInt( props.attributes.um_message_type ) === 2 ) { - um_condition_fields['um_message_content'] = ''; - } else { - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - } - } else { - um_condition_fields['um_message_type'] = ''; - - if ( parseInt( props.attributes.um_message_type ) === 2 ) { - um_condition_fields['um_message_content'] = ''; - } else { - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - } - } - } - - um_condition_fields = wp.hooks.applyFilters( 'um_admin_blocks_condition_fields', um_condition_fields, props ); - - return wp.element.createElement( - wp.element.Fragment, - {}, - wp.element.createElement( BlockEdit, props ), - wp.element.createElement( - wp.blockEditor.InspectorControls, - {}, - wp.element.createElement( - wp.components.PanelBody, - { - title: wp.i18n.__( 'Ultimate Member: Content Restriction', 'ultimate-member' ), - className: 'um_block_settings' - }, - wp.element.createElement( - wp.components.ToggleControl, - { - label: wp.i18n.__( 'Restrict access?', 'ultimate-member' ), - checked: initialIsRestrict, - onChange: function onChange( value ) { - props.setAttributes( { um_is_restrict: value } ); - if ( value === false ) { - um_condition_fields['um_who_access'] = 'um_block_settings_hide'; - um_condition_fields['um_roles_access'] = 'um_block_settings_hide'; - um_condition_fields['um_message_type'] = 'um_block_settings_hide'; - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - } else { - um_condition_fields['um_who_access'] = ''; - } - - um_condition_fields = wp.hooks.applyFilters( 'um_admin_blocks_condition_fields_on_change', um_condition_fields, 'um_is_restrict', value ); - } - } - ), - wp.element.createElement( - umSelectControl, - { - type: 'number', - className: um_condition_fields['um_who_access'], - label: wp.i18n.__( 'Who can access this block?', 'ultimate-member' ), - value: props.attributes.um_who_access, - options: [ - { - label: wp.i18n.__( 'Everyone', 'ultimate-member' ), - value: 0 - }, - { - label: wp.i18n.__( 'Logged in users', 'ultimate-member' ), - value: 1 - }, - { - label: wp.i18n.__( 'Logged out users', 'ultimate-member' ), - value: 2 - } - ], - onChange: function onChange( value ) { - props.setAttributes( { um_who_access: value } ); - if ( parseInt( value ) === 0 ) { - um_condition_fields['um_message_type'] = 'um_block_settings_hide'; - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - um_condition_fields['um_roles_access'] = 'um_block_settings_hide'; - } else if ( parseInt( value ) === 1 ) { - um_condition_fields['um_message_type'] = ''; - um_condition_fields['um_roles_access'] = ''; - } else { - um_condition_fields['um_message_type'] = ''; - um_condition_fields['um_roles_access'] = 'um_block_settings_hide'; - } - - um_condition_fields = wp.hooks.applyFilters( 'um_admin_blocks_condition_fields_on_change', um_condition_fields, 'um_who_access', value ); - } - } - ), - wp.element.createElement( - umSelectControl, - { - multiple: true, - className: um_condition_fields['um_roles_access'], - label: wp.i18n.__( 'What roles can access this block?', 'ultimate-member' ), - value: props.attributes.um_roles_access, - options: um_restrict_roles, - onChange: function onChange( value ) { - props.setAttributes( { um_roles_access: value } ); - } - } - ), - wp.element.createElement( - umSelectControl, - { - type: 'number', - className: um_condition_fields['um_message_type'], - label: wp.i18n.__( 'Restriction action', 'ultimate-member' ), - value: props.attributes.um_message_type, - options: [ - { - label: wp.i18n.__( 'Hide block', 'ultimate-member' ), - value: 0 - }, - { - label: wp.i18n.__( 'Show global default message', 'ultimate-member' ), - value: 1 - }, - { - label: wp.i18n.__( 'Show custom message', 'ultimate-member' ), - value: 2 - } - ], - onChange: function onChange( value ) { - props.setAttributes( { um_message_type: value } ); - if ( parseInt( value ) === 2 ) { - um_condition_fields['um_message_content'] = ''; - } else { - um_condition_fields['um_message_content'] = 'um_block_settings_hide'; - } - } - } - ), - wp.element.createElement( - umTextareaControl, - { - type: 'number', - className: um_condition_fields['um_message_content'], - label: wp.i18n.__( 'Custom restricted access message', 'ultimate-member' ), - value: props.attributes.um_message_content, - onChange: function onChange( value ) { - props.setAttributes( { um_message_content: value } ); - } - } - ), - um_admin_blocks_custom_fields( um_condition_fields, props ) - ) - ) - ); - }; - }, - 'um_block_restriction' -); - -wp.hooks.addFilter( 'editor.BlockEdit', 'um-block/um_block_restriction', um_block_restriction ); diff --git a/includes/admin/assets/js/um-admin-builder.js b/includes/admin/assets/js/um-admin-builder.js deleted file mode 100644 index d59d22f3..00000000 --- a/includes/admin/assets/js/um-admin-builder.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This function updates the builder area with fields - * - * @returns {boolean} - */ -function um_admin_update_builder() { - var form_id = jQuery('.um-admin-builder').data('form_id'); - - jQuery('.tipsy').hide(); - - jQuery.ajax({ - url: wp.ajax.settings.url, - type: 'POST', - data: { - action:'um_update_builder', - form_id: form_id, - nonce: um_admin_scripts.nonce - }, - success: function( data ) { - jQuery('.um-admin-drag-ajax').html( data ); - jQuery('.tipsy').hide(); - - /* trigger columns at start */ - allow_update_via_col_click = false; - jQuery('.um-admin-drag-ctrls.columns a.active').each( function() { - jQuery(this).trigger('click'); - }).promise().done( function(){ - allow_update_via_col_click = true; - }); - - UM_Rows_Refresh(); - }, - error: function( data ) { - - } - }); - - return false; -} - -jQuery( document ).ready( function() { - if ( um_admin_builder_data.hide_footer ) { - jQuery('#wpfooter').hide(); - } -}); diff --git a/includes/admin/assets/js/um-admin-dragdrop.js b/includes/admin/assets/js/um-admin-dragdrop.js index e6933112..7eba5530 100644 --- a/includes/admin/assets/js/um-admin-dragdrop.js +++ b/includes/admin/assets/js/um-admin-dragdrop.js @@ -85,7 +85,7 @@ function UM_Drag_and_Drop() { placeholder: "um-row-placeholder", forcePlaceholderSize:true, out: function(){ - jQuery('.tipsy').remove(); + UM.common.tipsy.hide(); }, update: function(){ @@ -110,7 +110,7 @@ function UM_update_rows() { c++; row = jQuery(this); if ( c != 1 ) { - row.find('.um-admin-drag-row-icons').append( '' ); + row.find('.um-admin-drag-row-icons').append( '' ); } }); } @@ -123,7 +123,7 @@ function UM_update_subrows(){ c++; row = jQuery(this); if ( c != 1 ) { - row.find('.um-admin-drag-rowsub-icons').append(''); + row.find('.um-admin-drag-rowsub-icons').append(''); } }); }); @@ -267,7 +267,7 @@ function UM_Rows_Refresh(){ function UM_Add_Icon(){ - var add_icon_html = ''; + var add_icon_html = ''; jQuery('.um-admin-drag-col').each(function(){ if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) { @@ -377,8 +377,8 @@ jQuery(document).ready(function() { if ( UM.admin.builder.fieldsToDelete.length > 0 ) { um_builder_delete_field_ajax( function () { + UM.common.tipsy.hide(); deleteButton.parents('.' +element).remove(); - jQuery('.tipsy').remove(); UM_Rows_Refresh(); jQuery.each( UM.admin.builder.deleteProcess, function(i) { @@ -391,8 +391,8 @@ jQuery(document).ready(function() { loadingWrapper.hide(); } ); } else { + UM.common.tipsy.hide(); jQuery(this).parents('.' +element).remove(); - jQuery('.tipsy').remove(); UM_Rows_Refresh(); jQuery.each( UM.admin.builder.deleteProcess, function(i) { diff --git a/includes/admin/assets/js/um-admin-field.js b/includes/admin/assets/js/um-admin-field.js index cbb6c8e4..a0843c13 100644 --- a/includes/admin/assets/js/um-admin-field.js +++ b/includes/admin/assets/js/um-admin-field.js @@ -91,7 +91,7 @@ jQuery(document).ready(function() { um_admin_modal_responsive(); } else { jQuery('.um-col-demon-settings').data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', ''); - jQuery('.tipsy').hide(); + UM.common.tipsy.hide(); um_admin_remove_modal(); um_admin_update_builder(); } diff --git a/includes/admin/assets/js/um-admin-form.js b/includes/admin/assets/js/um-admin-form.js deleted file mode 100644 index 5cecf3b9..00000000 --- a/includes/admin/assets/js/um-admin-form.js +++ /dev/null @@ -1,32 +0,0 @@ -function um_form_select_tab( tab, set_val ) { - var mode_block = jQuery('input#form__um_mode'); - tab.parents('.um-admin-boxed-links').find('a').removeClass('um-admin-activebg'); - tab.addClass('um-admin-activebg'); - - jQuery('.um-admin div#side-sortables').show(); - jQuery('div[id^="um-admin-form"]').hide(); - jQuery('#submitdiv').show(); - jQuery('div#um-admin-form-mode,div#um-admin-form-title,div#um-admin-form-builder,div#um-admin-form-shortcode').show(); - jQuery('div[id^="um-admin-form-' + tab.data('role') + '"]').show(); - - if ( set_val ) { - mode_block.val( tab.data('role') ); - } - - jQuery('.empty-container').css({'border' : 'none'}); - jQuery('.um-admin-builder').removeClass().addClass( 'um-admin-builder ' + mode_block.val() ); -} - -jQuery(document).ready(function() { - /* Default form tab */ - if ( jQuery('.um-admin-boxed-links').length > 0 ) { - var tab = jQuery('.um-admin-boxed-links a[data-role="'+jQuery('input#form__um_mode').val()+'"]'); - um_form_select_tab( tab, false ); - } - - - /* Creating new form button */ - jQuery('.um-admin-boxed-links:not(.is-core-form) a').on( 'click', function() { - um_form_select_tab( jQuery(this), true ); - }); -}); \ No newline at end of file diff --git a/includes/admin/assets/js/um-admin-global.js b/includes/admin/assets/js/um-admin-global.js deleted file mode 100644 index d0f5caf6..00000000 --- a/includes/admin/assets/js/um-admin-global.js +++ /dev/null @@ -1,64 +0,0 @@ -jQuery(document).ready(function() { - - - jQuery(document.body).on('click', '#um_add_review_love', function (e) { - jQuery(this).parents('#um_start_review_notice').hide(); - jQuery('.um_hidden_notice[data-key="love"]').show(); - }); - - - jQuery(document.body).on('click', '#um_add_review_good', function (e) { - jQuery(this).parents('#um_start_review_notice').hide(); - jQuery('.um_hidden_notice[data-key="good"]').show(); - }); - - - jQuery(document.body).on('click', '#um_add_review_bad', function (e) { - jQuery(this).parents('#um_start_review_notice').hide(); - jQuery('.um_hidden_notice[data-key="bad"]').show(); - }); - - - jQuery(document.body).on('click', '.um_review_link', function (e) { - jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click'); - }); - - - jQuery(document.body).on('click', '.um_secondary_dimiss', function (e) { - jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click'); - }); - - - jQuery(document.body).on( 'click', '.um-admin-notice.is-dismissible .notice-dismiss', function(e) { - var notice_key = jQuery(this).parents('.um-admin-notice').data('key'); - - wp.ajax.send( 'um_dismiss_notice', { - data: { - key: notice_key, - nonce: um_admin_scripts.nonce - }, - success: function( data ) { - return true; - }, - error: function( data ) { - um_admin_dismiss_notice_fallback( notice_key ); - return false; - } - }); - }); - - -}); - -/** - * Dismiss fallback of ajax request - */ -function um_admin_dismiss_notice_fallback( notice_key ) { - var href_index = ""; - if ( window.location.href.indexOf("?") > -1 ) { - href_index = window.location.href + "&"; - } else { - href_index = window.location.href + "?"; - } - window.location.href = href_index + "um_dismiss_notice=" + notice_key + "&um_admin_nonce=" + um_admin_scripts.nonce; -} diff --git a/includes/admin/assets/js/um-admin-modal.js b/includes/admin/assets/js/um-admin-modal.js index 52278298..8998ed49 100644 --- a/includes/admin/assets/js/um-admin-modal.js +++ b/includes/admin/assets/js/um-admin-modal.js @@ -14,7 +14,7 @@ function um_admin_live_update_scripts() { function um_admin_new_modal( id, ajax, size ) { var modal = jQuery('body').find('.um-admin-overlay'); - jQuery('.tipsy').hide(); + UM.common.tipsy.hide(); um_admin_remove_modal(); @@ -146,9 +146,8 @@ function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) { jQuery('.um-admin-preview-overlay').css('height', jQuery('.um-admin-preview-overlay').siblings('.um').outerHeight(true)*1 + 20 + 'px' ); } - um_init_tooltips(); - - um_admin_init_datetimepicker(); + UM.admin.tooltip.init(); + UM.admin.datetimePicker.init(); }, error: function(data) { @@ -199,10 +198,8 @@ function um_admin_remove_modal() { jQuery('.um_tiny_placeholder').replaceWith( jQuery( $um_tiny_editor ).html() ); } - if ( 'undefined' !== typeof window.UM.admin.allTooltips && window.UM.admin.allTooltips.length > 0 && 'function' === typeof window.UM.admin.allTooltips.tooltip ) { - window.UM.admin.allTooltips.tooltip('close'); - } - jQuery('.tipsy').hide(); + UM.admin.tooltip.close(); + UM.common.tipsy.hide(); jQuery('body').removeClass('um-admin-modal-open'); jQuery('.um-admin-modal div[id^="UM_"]').hide().appendTo('body'); jQuery('.um-admin-modal,.um-admin-overlay').remove(); @@ -322,7 +319,7 @@ jQuery(document).ready(function() { jQuery(document.body).on('click', '.um-admin-remove-condition', function(){ var condition = jQuery(this).parents('.um-admin-cur-condition'); jQuery('.um-admin-new-condition').removeClass('disabled'); - jQuery('.tipsy').remove(); + UM.common.tipsy.hide(); condition.remove(); //need fields refactor var conditions = jQuery('.um-admin-cur-condition'); @@ -345,7 +342,7 @@ jQuery(document).ready(function() { remove modal via action **/ jQuery(document.body).on('click', '.um-admin-overlay, a[data-action="UM_remove_modal"]', function(){ - jQuery('.tipsy').hide(); + UM.common.tipsy.hide(); um_admin_remove_modal(); }); @@ -406,7 +403,7 @@ jQuery(document).ready(function() { } jQuery(this).attr('data-code', ''); if ( v_id == '.postbox' ) { - jQuery('.tipsy').hide(); + UM.common.tipsy.hide(); um_admin_remove_modal(); } }); diff --git a/includes/admin/assets/js/um-admin-scripts.js b/includes/admin/assets/js/um-admin-scripts.js deleted file mode 100644 index f9e181ce..00000000 --- a/includes/admin/assets/js/um-admin-scripts.js +++ /dev/null @@ -1,286 +0,0 @@ -if ( typeof (window.UM) !== 'object' ) { - window.UM = {}; -} - -if ( typeof (window.UM.admin) !== 'object' ) { - window.UM.admin = {}; -} - -function um_admin_init_datetimepicker() { - jQuery('.um-datepicker:not(.picker__input)').each(function(){ - elem = jQuery(this); - - if ( typeof elem.attr('data-disabled_weekdays') != 'undefined' && elem.attr('data-disabled_weekdays') != '' ) { - var disable = JSON.parse( elem.attr('data-disabled_weekdays') ); - } else { - var disable = false; - } - - var years_n = null; - if ( typeof elem.attr('data-years') != 'undefined' ) { - years_n = elem.attr('data-years'); - } - - var minRange = elem.attr('data-date_min'); - var maxRange = elem.attr('data-date_max'); - - var minSplit = [], maxSplit = []; - if ( typeof minRange != 'undefined' ) { - minSplit = minRange.split(","); - } - if ( typeof maxRange != 'undefined' ) { - maxSplit = maxRange.split(","); - } - - var min = minSplit.length ? new Date(minSplit) : null; - var max = minSplit.length ? new Date(maxSplit) : null; - - // fix min date for safari - if ( min && min.toString() == 'Invalid Date' && minSplit.length == 3 ) { - var minDateString = minSplit[1] + '/' + minSplit[2] + '/' + minSplit[0]; - min = new Date(Date.parse(minDateString)); - } - - // fix max date for safari - if ( max && max.toString() == 'Invalid Date' && maxSplit.length == 3 ) { - var maxDateString = maxSplit[1] + '/' + maxSplit[2] + '/' + maxSplit[0]; - max = new Date(Date.parse(maxDateString)); - } - - var data = { - disable: disable, - format: elem.attr( 'data-format' ), - formatSubmit: 'yyyy/mm/dd', - hiddenName: true, - onOpen: function() { elem.blur(); }, - onClose: function() { elem.blur(); } - }; - - if ( years_n !== null ) { - data.selectYears = years_n; - } - - if ( min !== null ) { - data.min = min; - } - - if ( max !== null ) { - data.max = max; - } - - elem.pickadate( data ); - }); - - jQuery('.um-timepicker:not(.picker__input)').each(function(){ - elem = jQuery(this); - - elem.pickatime({ - format: elem.attr('data-format'), - interval: parseInt( elem.attr('data-intervals') ), - formatSubmit: 'HH:i', - hiddenName: true, - onOpen: function() { elem.blur(); }, - onClose: function() { elem.blur(); } - }); - }); -} - -function um_init_tooltips() { - if ( jQuery( '.um_tooltip' ).length > 0 ) { - window.UM.admin.allTooltips = jQuery( '.um_tooltip' ).tooltip({ - tooltipClass: "um_tooltip", - content: function () { - return jQuery( this ).attr( 'title' ); - } - }); - } -} - - -jQuery(document).ready(function() { - - /** - clone a field dropdown - **/ - jQuery(document.body).on('click', '.um-admin-clone', function(e){ - e.preventDefault(); - var container = jQuery(this).parents('.um-admin-field'); - var parent = jQuery(this).parents('p').find('.um-admin-field:last-child'); - container.find('select').select2('destroy'); - var cloned = container.clone(); - cloned.find('.um-admin-clone').replaceWith(''); - cloned.insertAfter( parent ); - cloned.find('select').val(''); - jQuery('.um-admin-field select').select2({ - allowClear: true, - minimumResultsForSearch: 10 - }); - return false; - }); - - /** - remove a field dropdown - **/ - jQuery(document.body).on('click', '.um-admin-clone-remove', function(e){ - e.preventDefault(); - var container = jQuery(this).parents('.um-admin-field'); - jQuery('.tipsy').remove(); - container.remove(); - jQuery('.um-admin-field select').select2({ - allowClear: true, - minimumResultsForSearch: 10 - }); - return false; - }); - - /** - Ajax link - **/ - jQuery('.um-admin-ajaxlink').on('click', function(e){ - e.preventDefault(); - return false; - }); - - /** - On/Off Buttons - **/ - jQuery(document.body).on('click', '.um-admin-yesno span.btn', function(){ - if (!jQuery(this).parents('p').hasClass('disabled-on-off')){ - if ( jQuery(this).parent().find('input[type=hidden]').val() == 0 ){ - update_val = 1; - jQuery(this).animate({'left': '48px'}, 200); - jQuery(this).parent().find('input[type=hidden]').val( update_val ).trigger('change'); - } else { - update_val = 0; - jQuery(this).animate({'left': '0'}, 200); - jQuery(this).parent().find('input[type=hidden]').val( update_val ).trigger('change'); - } - } - }); - - /** - WP Color Picker - **/ - if ( jQuery('.um-admin-colorpicker').length ) { - jQuery('.um-admin-colorpicker').wpColorPicker(); - } - - - /** - Tooltips - **/ - um_init_tooltips(); - - if( typeof tipsy !== 'undefined' ){ - jQuery('.um-admin-tipsy-n').tipsy({gravity: 'n', opacity: 1, live: 'a.live' }); - jQuery('.um-admin-tipsy-w').tipsy({gravity: 'w', opacity: 1, live: 'a.live' }); - jQuery('.um-admin-tipsy-e').tipsy({gravity: 'e', opacity: 1, live: 'a.live' }); - jQuery('.um-admin-tipsy-s').tipsy({gravity: 's', opacity: 1, live: 'a.live' }); - } - - - /** - Conditional fields - **/ - jQuery( document.body ).on('change', '.um-adm-conditional', function(){ - - var value; - if ( jQuery(this).attr("type") == 'checkbox' ) { - value = jQuery(this).is(':checked') ? 1 : 0; - } else { - value = jQuery(this).val(); - } - - if ( jQuery(this).data('cond1') ) { - if ( value == jQuery(this).data('cond1') ) { - jQuery('.' + jQuery(this).data('cond1-show') ).show(); - jQuery('.' + jQuery(this).data('cond1-hide') ).hide(); - - if ( jQuery(this).data('cond1-show') == '_roles' ) { - return false; - } - - } else { - jQuery('.' + jQuery(this).data('cond1-show') ).hide(); - jQuery('.' + jQuery(this).data('cond1-hide') ).show(); - } - } - - if ( jQuery(this).data('cond2') ) { - if ( value == jQuery(this).data('cond2') ) { - jQuery('.' + jQuery(this).data('cond2-show') ).show(); - jQuery('.' + jQuery(this).data('cond2-hide') ).hide(); - - if ( jQuery(this).data('cond2-show') == '_roles' ) { - return false; - } - - } else { - jQuery('.' + jQuery(this).data('cond2-show') ).hide(); - jQuery('.' + jQuery(this).data('cond2-hide') ).show(); - } - } - - if ( jQuery(this).data('cond3') ) { - if ( value == jQuery(this).data('cond3') ) { - jQuery('.' + jQuery(this).data('cond3-show') ).show(); - jQuery('.' + jQuery(this).data('cond3-hide') ).hide(); - } else { - jQuery('.' + jQuery(this).data('cond3-show') ).hide(); - jQuery('.' + jQuery(this).data('cond3-hide') ).show(); - } - } - - });jQuery('.um-adm-conditional').each(function(){jQuery(this).trigger('change');}); - - /** - Conditional fields for - Radio Group - **/ - jQuery('.um-conditional-radio-group input[type=radio]').on('click', function(){ - var holder = jQuery('.um-conditional-radio-group'); - - var val = jQuery(this).val(); - var cond1 = holder.data('cond1'); - var show1 = holder.data('cond1-show'); - if ( val == cond1 ) { // condition met - jQuery('.' + show1).show(); - } else { - jQuery('.' + show1).hide(); - } - - var val2 = jQuery(this).val(); - var cond2 = holder.data('cond2'); - var show2 = holder.data('cond2-show'); - if ( val2 == cond2 ) { // condition met - jQuery('.' + show2).show(); - } else { - jQuery('.' + show2).hide(); - } - - });jQuery('.um-conditional-radio-group input[type=radio]:checked').each(function(){jQuery(this).trigger('click');}); - - - - /** - Conditional fields for - nav-menu editor options - **/ - - jQuery('.um-nav-mode').each( function() { - if ( jQuery(this).find('select').val() == 2 ) { - jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').show(); - } else { - jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').hide(); - } - }); - - - jQuery( document.body ).on('change', '.um-nav-mode select', function(){ - if ( jQuery(this).val() == 2 ) { - jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').show(); - } else { - jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').hide(); - } - }); -}); diff --git a/includes/admin/class-admin-functions.php b/includes/admin/class-admin-functions.php index 5d81583b..31cc030c 100644 --- a/includes/admin/class-admin-functions.php +++ b/includes/admin/class-admin-functions.php @@ -1,33 +1,24 @@ id; - if ( strstr( $screen_id, 'ultimatemember' ) || - strstr( $screen_id, 'um_' ) || - strstr( $screen_id, 'user' ) || - strstr( $screen_id, 'profile' ) || - $screen_id == 'nav-menus' ) { - $is_um_screen = true; - } - } - - if ( $this->is_plugin_post_type() ) { - $is_um_screen = true; - } - - if ( $this->is_restricted_entity() ) { - $is_um_screen = true; - } - - return apply_filters( 'um_is_ultimatememeber_admin_screen', $is_um_screen ); + public function is_um_screen() { + _deprecated_function( __METHOD__, '2.7.1', 'UM()->admin()->screen()->is_own_screen()' ); + return UM()->admin()->screen()->is_own_screen(); } - /** * Check if current page load UM post type * + * @deprecated 2.7.1 + * * @return bool */ - function is_plugin_post_type() { - $cpt = UM()->cpt_list(); - - if ( isset( $_REQUEST['post_type'] ) ) { - $post_type = sanitize_key( $_REQUEST['post_type'] ); - if ( in_array( $post_type, $cpt ) ) { - return true; - } - } elseif ( isset( $_REQUEST['action'] ) && sanitize_key( $_REQUEST['action'] ) == 'edit' ) { - $post_type = get_post_type(); - if ( in_array( $post_type, $cpt ) ) { - return true; - } - } - - return false; + public function is_plugin_post_type() { + _deprecated_function( __METHOD__, '2.7.1', 'UM()->admin()->screen()->is_own_post_type()' ); + return UM()->admin()->screen()->is_own_post_type(); } - /** * If page now show content with restricted post/taxonomy * + * @deprecated 2.7.1 + * * @return bool */ - function is_restricted_entity() { - $restricted_posts = UM()->options()->get( 'restricted_access_post_metabox' ); - $restricted_taxonomies = UM()->options()->get( 'restricted_access_taxonomy_metabox' ); - - global $typenow, $taxnow; - if ( ! empty( $typenow ) && ! empty( $restricted_posts[ $typenow ] ) ) { - return true; - } - - if ( ! empty( $taxnow ) && ! empty( $restricted_taxonomies[ $taxnow ] ) ) { - return true; - } - - return false; + public function is_restricted_entity() { + _deprecated_function( __METHOD__, '2.7.1', 'UM()->admin()->screen()->is_restricted_entity()' ); + return UM()->admin()->screen()->is_restricted_entity(); } } } diff --git a/includes/admin/class-admin.php b/includes/admin/class-admin.php index 32fab1ad..032c45f5 100644 --- a/includes/admin/class-admin.php +++ b/includes/admin/class-admin.php @@ -59,8 +59,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) { * Admin constructor. */ public function __construct() { - parent::__construct(); - $this->templates_path = UM_PATH . 'includes/admin/templates/'; add_action( 'admin_init', array( &$this, 'admin_init' ), 0 ); @@ -78,8 +76,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) { add_action( 'um_admin_do_action__install_core_pages', array( &$this, 'install_core_pages' ) ); - add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 ); - add_action( 'parent_file', array( &$this, 'parent_file' ), 9 ); add_filter( 'gettext', array( &$this, 'gettext' ), 10, 4 ); add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages' ) ); @@ -1590,21 +1586,6 @@ if ( ! class_exists( 'um\admin\Admin' ) ) { return $data; } - - /** - * Adds class to our admin pages - * - * @param $classes - * - * @return string - */ - public function admin_body_class( $classes ) { - if ( $this->is_um_screen() ) { - return "$classes um-admin"; - } - return $classes; - } - /** * */ @@ -2012,9 +1993,9 @@ if ( ! class_exists( 'um\admin\Admin' ) ) { * * @return string */ - function gettext( $translation, $text, $domain ) { + public function gettext( $translation, $text, $domain ) { global $post; - if ( isset( $post->post_type ) && $this->is_plugin_post_type() ) { + if ( isset( $post->post_type ) && $this->screen()->is_own_post_type() ) { $translations = get_translations_for_domain( $domain ); if ( $text == 'Publish' ) { return $translations->translate( 'Create' ); @@ -2067,6 +2048,18 @@ if ( ! class_exists( 'um\admin\Admin' ) ) { return UM()->classes['admin_notices']; } + /** + * @since 2.7.1 + * + * @return Screen + */ + public function screen() { + if ( empty( UM()->classes['um\admin\screen'] ) ) { + UM()->classes['um\admin\screen'] = new Screen(); + } + return UM()->classes['um\admin\screen']; + } + /** * @since 2.6.8 * diff --git a/includes/admin/class-enqueue.php b/includes/admin/class-enqueue.php index bd2791da..889869ed 100644 --- a/includes/admin/class-enqueue.php +++ b/includes/admin/class-enqueue.php @@ -50,7 +50,7 @@ final class Enqueue extends \um\common\Enqueue { /** - * Admin_Enqueue constructor. + * Enqueue constructor. */ public function __construct() { parent::__construct(); @@ -63,41 +63,59 @@ final class Enqueue extends \um\common\Enqueue { $this->um_cpt_form_screen = false; + add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 ); + add_action( 'admin_head', array( &$this, 'admin_head' ), 9 ); add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) ); add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) ); - add_action( 'load-user-new.php', array( &$this, 'enqueue_role_wrapper' ) ); - add_action( 'load-user-edit.php', array( &$this, 'enqueue_role_wrapper' ) ); + add_action( 'load-customize.php', array( &$this, 'navmenu_scripts' ) ); + add_action( 'load-edit.php', array( &$this, 'posts_page' ) ); add_action( 'load-post-new.php', array( &$this, 'enqueue_cpt_scripts' ) ); add_action( 'load-post.php', array( &$this, 'enqueue_cpt_scripts' ) ); global $wp_version; if ( version_compare( $wp_version, '5.8', '>=' ) ) { - add_filter( 'block_categories_all', array( &$this, 'blocks_category' ), 10, 2 ); + add_filter( 'block_categories_all', array( &$this, 'blocks_category' ) ); } else { - add_filter( 'block_categories', array( &$this, 'blocks_category' ), 10, 2 ); + add_filter( 'block_categories', array( &$this, 'blocks_category' ) ); } add_action( 'enqueue_block_assets', array( &$this, 'block_editor' ), 11 ); } + /** + * Adds class to our admin pages + * + * @since 2.7.1 + * + * @param $classes + * + * @return string + */ + public function admin_body_class( $classes ) { + if ( UM()->admin()->screen()->is_own_screen() ) { + return "$classes um um-admin"; + } + return $classes; + } /** * Enqueue Gutenberg Block Editor assets */ public function block_editor() { - $suffix = self::get_suffix(); + $suffix = self::get_suffix(); + $libs_url = self::get_url( 'libs' ); $this->register_jquery_ui(); + wp_register_style( 'um_members', UM_URL . 'assets/css/um-members.css', array( 'um_ui' ), UM_VERSION ); if ( is_rtl() ) { wp_register_style( 'um_members_rtl', UM_URL . 'assets/css/um-members-rtl.css', array( 'um_members' ), UM_VERSION ); } wp_register_style( 'um_styles', UM_URL . 'assets/css/um-styles.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2' ), UM_VERSION ); wp_register_style( 'um_profile', UM_URL . 'assets/css/um-profile.css', array(), UM_VERSION ); - wp_register_style( 'um_crop', UM_URL . 'assets/css/um-crop.css', array(), UM_VERSION ); wp_register_style( 'um_responsive', UM_URL . 'assets/css/um-responsive.css', array( 'um_profile', 'um_crop' ), UM_VERSION ); wp_register_style( 'um_account', UM_URL . 'assets/css/um-account.css', array(), UM_VERSION ); wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', array(), UM_VERSION ); @@ -161,9 +179,8 @@ final class Enqueue extends \um\common\Enqueue { wp_register_script( 'um_members', UM_URL . 'assets/js/um-members' . $suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks', 'jquery-masonry', 'um_scripts' ), UM_VERSION, true ); wp_register_script( 'um_account', UM_URL . 'assets/js/um-account' . $suffix . '.js', array( 'jquery', 'wp-hooks' ), UM_VERSION, true ); - wp_register_script( 'um_scrollbar', UM_URL . 'assets/js/simplebar' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true ); - wp_register_script( 'um_crop', UM_URL . 'assets/js/um-crop' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true ); - wp_register_script( 'um_functions', UM_URL . 'assets/js/um-functions' . $suffix . '.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), UM_VERSION, true ); + + wp_register_script( 'um_functions', UM_URL . 'assets/js/um-functions' . $suffix . '.js', array( 'jquery', 'jquery-masonry', 'wp-util' ), UM_VERSION, true ); wp_register_script( 'um_responsive', UM_URL . 'assets/js/um-responsive' . $suffix . '.js', array( 'jquery', 'um_functions', 'um_crop' ), UM_VERSION, true ); // render blocks @@ -174,8 +191,6 @@ final class Enqueue extends \um\common\Enqueue { wp_enqueue_script( 'um_dropdown' ); wp_enqueue_script( 'um_members' ); wp_enqueue_script( 'um_account' ); - wp_enqueue_script( 'um_scrollbar' ); - wp_enqueue_script( 'um_crop' ); wp_enqueue_script( 'um_functions' ); wp_enqueue_script( 'um_responsive' ); @@ -183,19 +198,90 @@ final class Enqueue extends \um\common\Enqueue { wp_enqueue_style( 'um_members' ); wp_enqueue_style( 'um_styles' ); wp_enqueue_style( 'um_profile' ); - wp_enqueue_style( 'um_crop' ); wp_enqueue_style( 'um_responsive' ); wp_enqueue_style( 'um_account' ); $custom_css = '.um{opacity: 1;}.um_request_name {display: none !important;}'; wp_add_inline_style( 'um_styles', $custom_css ); + + $this->load_gutenberg_js(); + } + + /** + * @since 2.7.1 + */ + public function navmenu_scripts() { + add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_navmenu_scripts' ) ); + } + + /** + * @since 2.7.1 + */ + public function posts_page() { + if ( isset( $_GET['post_type'] ) && 'um_form' === sanitize_key( $_GET['post_type'] ) ) { + add_action( 'admin_enqueue_scripts', array( &$this, 'forms_page_scripts' ) ); + } elseif ( isset( $_GET['post_type'] ) && 'um_directory' === sanitize_key( $_GET['post_type'] ) ) { + add_action( 'admin_enqueue_scripts', array( &$this, 'directories_page_scripts' ) ); + } + } + + /** + * @since 2.7.1 + */ + public function forms_page_scripts() { + $suffix = self::get_suffix(); + $css_url = self::get_url( 'css' ); + wp_register_style( 'um_admin_forms-screen', $css_url . 'admin/forms-screen' . $suffix . '.css', array(), UM_VERSION ); + wp_enqueue_style( 'um_admin_forms-screen' ); + } + + /** + * @since 2.7.1 + */ + public function directories_page_scripts() { + $suffix = self::get_suffix(); + $css_url = self::get_url( 'css' ); + wp_register_style( 'um_admin_directories-screen', $css_url . 'admin/directories-screen' . $suffix . '.css', array(), UM_VERSION ); + wp_enqueue_style( 'um_admin_directories-screen' ); + } + + /** + * @since 2.7.1 + */ + public function enqueue_navmenu_scripts() { + $suffix = self::get_suffix(); + $js_url = self::get_url( 'js' ); + $css_url = self::get_url( 'css' ); + + wp_register_script( 'um_admin_nav_menu', $js_url . 'admin/nav-menu' . $suffix . '.js', array( 'jquery', 'wp-util' ), UM_VERSION, true ); + $menu_restriction_data = array(); + $menus = get_posts( 'post_type=nav_menu_item&numberposts=-1' ); + foreach ( $menus as $data ) { + $_nav_roles_meta = get_post_meta( $data->ID, 'menu-item-um_nav_roles', true ); + + $um_nav_roles = array(); + if ( $_nav_roles_meta ) { + foreach ( $_nav_roles_meta as $key => $value ) { + if ( is_int( $key ) ) { + $um_nav_roles[] = $value; + } + } + } + + $menu_restriction_data[ $data->ID ] = array( + 'um_nav_public' => get_post_meta( $data->ID, 'menu-item-um_nav_public', true ), + 'um_nav_roles' => $um_nav_roles, + ); + } + wp_localize_script( 'um_admin_nav_menu', 'um_menu_restriction_data', $menu_restriction_data ); + wp_enqueue_script( 'um_admin_nav_menu' ); + + wp_register_style( 'um_admin_nav_menu', $css_url . 'admin/nav-menu' . $suffix . '.css', array(), UM_VERSION ); + wp_enqueue_style( 'um_admin_nav_menu' ); } - public function enqueue_role_wrapper() { - add_action( 'admin_enqueue_scripts', array( &$this, 'load_role_wrapper' ) ); - } /** @@ -214,13 +300,16 @@ final class Enqueue extends \um\common\Enqueue { * */ public function enqueue_frontend_preview_assets() { - $suffix = self::get_suffix(); + $suffix = self::get_suffix(); + $libs_url = self::get_url( 'libs' ); + + $this->register_jquery_ui(); //scripts for FRONTEND PREVIEW wp_register_script( 'um_jquery_form', $this->front_js_baseurl . 'um-jquery-form' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true ); wp_register_script( 'um_fileupload', $this->front_js_baseurl . 'um-fileupload.js', array( 'jquery' ), UM_VERSION, true ); - wp_register_script( 'um_crop', $this->front_js_baseurl . 'um-crop' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true ); - wp_register_script( 'um_functions', $this->front_js_baseurl . 'um-functions' . $suffix . '.js', array( 'jquery', 'um_tipsy', 'um_scrollbar' ), UM_VERSION, true ); + + wp_register_script( 'um_functions', $this->front_js_baseurl . 'um-functions' . $suffix . '.js', array( 'jquery', 'um_tipsy' ), UM_VERSION, true ); wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), UM_VERSION, true ); wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true ); @@ -237,40 +326,26 @@ final class Enqueue extends \um\common\Enqueue { } wp_register_script( 'um_scripts', $this->front_js_baseurl . 'um-scripts' . $suffix . '.js', array( 'um_functions', 'um_crop', 'um_raty', self::$select2_handle, 'um_jquery_form', 'um_fileupload', 'um_datetime', 'um_datetime_date', 'um_datetime_time'/*, 'um_datetime_legacy'*/ ), UM_VERSION, true ); - wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $suffix . '.js', array( 'um_scripts' ), UM_VERSION, true ); + wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $suffix . '.js', array( 'um_scripts', 'um_crop' ), UM_VERSION, true ); wp_register_script( 'um_modal', $this->front_js_baseurl . 'um-modal' . $suffix . '.js', array( 'um_responsive' ), UM_VERSION, true ); wp_register_style( 'um_datetime', $this->front_css_baseurl . 'pickadate/default.css', array(), UM_VERSION ); wp_register_style( 'um_datetime_date', $this->front_css_baseurl . 'pickadate/default.date.css', array( 'um_datetime' ), UM_VERSION ); - wp_register_style( 'um_datetime_time', $this->front_css_baseurl . 'pickadate/default.time.css', array( 'um_datetime' ), ultimatemember_version ); + wp_register_style( 'um_datetime_time', $this->front_css_baseurl . 'pickadate/default.time.css', array( 'um_datetime' ), UM_VERSION ); - wp_register_style( 'um_scrollbar', $this->front_css_baseurl . 'simplebar.css', array(), ultimatemember_version ); - wp_register_style( 'um_crop', $this->front_css_baseurl . 'um-crop.css', array(), ultimatemember_version ); - wp_register_style( 'um_responsive', $this->front_css_baseurl . 'um-responsive.css', array(), ultimatemember_version ); + wp_register_style( 'um_responsive', $this->front_css_baseurl . 'um-responsive.css', array(), UM_VERSION ); wp_register_style( 'um_modal', $this->front_css_baseurl . 'um-modal.css', array(), ultimatemember_version ); - wp_register_style( 'um_styles', $this->front_css_baseurl . 'um-styles.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2' ), ultimatemember_version ); + wp_register_style( 'um_styles', $this->front_css_baseurl . 'um-styles.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2' ), UM_VERSION ); wp_register_style( 'um_members', $this->front_css_baseurl . 'um-members.css', array(), ultimatemember_version ); wp_register_style( 'um_profile', $this->front_css_baseurl . 'um-profile.css', array(), ultimatemember_version ); wp_register_style( 'um_account', $this->front_css_baseurl . 'um-account.css', array(), ultimatemember_version ); wp_register_style( 'um_misc', $this->front_css_baseurl . 'um-misc.css', array(), ultimatemember_version ); - wp_register_style( 'um_default_css', $this->front_css_baseurl . 'um-old-default.css', array( 'um_crop', 'um_tipsy', 'um_raty', 'um_responsive', 'um_modal', 'um_styles', 'um_members', 'um_profile', 'um_account', 'um_misc', 'um_datetime_date', 'um_datetime_time', 'um_scrollbar', 'select2' ), UM_VERSION ); + wp_register_style( 'um_default_css', $this->front_css_baseurl . 'um-old-default.css', array( 'um_crop', 'um_tipsy', 'um_raty', 'um_responsive', 'um_modal', 'um_styles', 'um_members', 'um_profile', 'um_account', 'um_misc', 'um_datetime_date', 'um_datetime_time', 'select2' ), UM_VERSION ); wp_enqueue_script( 'um_modal' ); wp_enqueue_style( 'um_default_css' ); } - - /** - * Load js for Add/Edit User form - */ - public function load_role_wrapper() { - wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', array( 'jquery' ), ultimatemember_version, true ); - $localize_roles_data = get_option( 'um_roles', array() ); - wp_localize_script( 'um_admin_role_wrapper', 'um_roles', (array) $localize_roles_data ); - wp_enqueue_script( 'um_admin_role_wrapper' ); - } - - /** * Enter title placeholder * @@ -293,7 +368,7 @@ final class Enqueue extends \um\common\Enqueue { * Runs on admin head */ public function admin_head() { - if ( UM()->admin()->is_plugin_post_type() ) { ?> + if ( UM()->admin()->screen()->is_own_post_type() ) { ?>