diff --git a/.gitignore b/.gitignore index 3d1e14d..697ed93 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ # Dev dependencies node_modules/ -vendor +/vendor .env # Tests diff --git a/.wp-env.json b/.wp-env.json index b2b9780..03b709c 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -19,6 +19,6 @@ "DISALLOW_FILE_EDIT": false }, "lifecycleScripts": { - "afterStart": "wp-env run cli bash -c 'curl -fsSL -o /tmp/wp-cli.phar https://github.com/wp-cli/builds/raw/gh-pages/phar/wp-cli.phar && chmod +x /tmp/wp-cli.phar && sudo cp /tmp/wp-cli.phar /usr/local/bin/wp && sudo chmod +x /usr/local/bin/wp'" + "afterStart": "wp-env run cli bash -c 'curl -fsSL -o /tmp/wp-cli.phar https://github.com/wp-cli/builds/raw/gh-pages/phar/wp-cli.phar && chmod +x /tmp/wp-cli.phar && sudo cp /tmp/wp-cli.phar /usr/local/bin/wp && sudo chmod +x /usr/local/bin/wp' && wp-env run cli wp plugin activate cooked" } } diff --git a/assets/admin/css/style.css b/assets/admin/css/style.css index f736ee4..d350879 100644 --- a/assets/admin/css/style.css +++ b/assets/admin/css/style.css @@ -266,6 +266,32 @@ body.post-type-cp_recipe .switchery-small > small, .cooked-tooltip-buttons .cooked-icon-spin { margin-top:10px; font-size:15px; } .cooked-tooltip-buttons .cooked-saved-default { height:28px; line-height:28px; font-weight:bold; font-size:15px; color:#888; } +/* Tooltips (Floating UI, vendored — see assets/vendor/floating-ui/README.md). + * Positioned by cooked-functions.js; data-placement holds the resolved side. + * Headings never wrap; min-width lets a heading longer than the 275px cap widen the bubble instead of overflowing it. */ +.cooked-tooltip-floating { position:fixed; top:0; left:0; z-index:2001; box-sizing:border-box; width:max-content; max-width:275px; min-width:min-content; color:#666; font-size:12px; line-height:1.6; text-align:left; white-space:normal; pointer-events:none; } +.cooked-tooltip-floating > .cooked-tooltip-bubble { box-sizing:border-box; padding:15px 18px; background:#fff; border:1px solid #ccc; border-radius:3px; box-shadow:0 3px 8px rgba(0,0,0,.12); } +.cooked-tooltip-floating[hidden] { display:none; } +.cooked-tooltip-floating strong { color:#07a780; display:block; margin:0 0 2px; } +.cooked-tooltip-floating strong.cooked-tooltip-heading { display:block; font-size:15px; margin:0 0 5px; white-space:nowrap; } +/* Grow open/close animation (based on Tooltipster's grow, eased and fading). Floating UI positions and measures the + * outer shell; only the inner bubble scales, so flip, shift and the arrow see the full box. + * The arrow sits inside the bubble and scales with it. Also used by Cooked Pro. */ +.cooked-tooltip-bubble { position:relative; opacity:0; transform:scale(0); transform-origin:center; transition:transform 400ms cubic-bezier(.22,.61,.36,1), opacity 400ms cubic-bezier(.22,.61,.36,1); } +.cooked-tooltip-open > .cooked-tooltip-bubble { opacity:1; transform:scale(1); } + +/* Arrow (tooltips and the Save as Default panel): a rotated square bordered on the two sides facing the trigger. */ +.cooked-tooltip-arrow { position:absolute; width:10px; height:10px; background:#fff; border:0 solid #ccc; transform:rotate(45deg); } +.cooked-save-default-panel:not([data-placement]) .cooked-tooltip-arrow { display:none; } +[data-placement='top'] > .cooked-tooltip-arrow, +[data-placement='top'] > .cooked-tooltip-bubble > .cooked-tooltip-arrow { border-width:0 1px 1px 0; } +[data-placement='bottom'] > .cooked-tooltip-arrow, +[data-placement='bottom'] > .cooked-tooltip-bubble > .cooked-tooltip-arrow { border-width:1px 0 0 1px; } +[data-placement='left'] > .cooked-tooltip-arrow, +[data-placement='left'] > .cooked-tooltip-bubble > .cooked-tooltip-arrow { border-width:1px 1px 0 0; } +[data-placement='right'] > .cooked-tooltip-arrow, +[data-placement='right'] > .cooked-tooltip-bubble > .cooked-tooltip-arrow { border-width:0 0 1px 1px; } + .cooked-progress { display:none; position:relative; background:#eee; width:100%; height:6px; padding:0; border-radius:3px; margin:10px 0 0 0; } .cooked-progress-text { display:none; font-size:10px; color:#aaa; padding:2px 0 5px; } .cooked-progress.cooked-active, .cooked-progress-text.cooked-active { display:block; } @@ -297,6 +323,16 @@ body.post-type-cp_recipe .switchery-small > small, /* Save as Default */ #cooked_recipe_settings .cooked-layout-save-default { position:relative; top:-2px; z-index:10; margin:0 0 0 15px; padding:0 8px 1px; } #cooked_recipe_settings .cooked-layout-load-default { position:relative; top:-2px; z-index:10; margin:0 0 0 10px; padding:0 8px 1px; } +.cooked-save-default-panel { background:#fff; border:1px solid #ccc; border-radius:3px; box-shadow:0 3px 8px rgba(0,0,0,.12); box-sizing:border-box; color:#666; font-size:12px; line-height:1.6; margin:10px 0 0; max-width:320px; padding:15px 18px; } +.cooked-save-default-panel[hidden] { display:none; } +/* Once Floating UI places it (data-placement set), the panel floats by the button like a tooltip. */ +.cooked-save-default-panel[data-placement] { position:fixed; top:0; left:0; z-index:2001; width:max-content; max-width:275px; min-width:min-content; margin:0; } +/* With Floating UI, cooked-functions.js wraps the contents in a .cooked-tooltip-bubble that grows open. */ +.cooked-save-default-panel.cooked-tooltip-shell { background:none; border:0; border-radius:0; box-shadow:none; padding:0; } +.cooked-save-default-panel > .cooked-tooltip-bubble { box-sizing:border-box; padding:15px 18px; background:#fff; border:1px solid #ccc; border-radius:3px; box-shadow:0 3px 8px rgba(0,0,0,.12); } +.cooked-save-default-panel .cooked-tooltip-heading { color:#07a780; display:block; font-size:15px; margin:0 0 5px; white-space:nowrap; } +.cooked-save-default-panel p { margin:0 0 5px; } +.cooked-save-default-panel .cooked-tooltip-buttons { display:block; padding:12px 0 5px; } body .button.button-cooked-reset { color:#999; } body .button.button-cooked-reset:hover { color:#555; } @@ -431,9 +467,7 @@ body .button.button-cooked-reset:hover { color:#555; } right: auto; top: auto; } - #cooked_recipe_settings .cooked-recipe-tab-content { - padding: 0px 0px 15px 0px; - } + #cooked-recipe-tabs { white-space: nowrap; overflow-x: auto; @@ -449,6 +483,12 @@ body .button.button-cooked-reset:hover { color:#555; } } } +@media screen and (max-width: 1024px) { + #cooked_recipe_settings .cooked-recipe-tab-content { + padding: 10px; + } +} + /* Recipe Gallery */ #cooked-recipe-image-gallery { margin:0 -1% 0; } #cooked-recipe-image-gallery .cooked-recipe-gallery-item { position:relative; overflow:hidden; cursor:move; box-sizing:border-box; display:inline-block; width:18%; height:auto; padding:0; margin:0 1% 2% 1%; } diff --git a/assets/admin/css/style.min.css b/assets/admin/css/style.min.css index 0b777e2..a17db4d 100644 --- a/assets/admin/css/style.min.css +++ b/assets/admin/css/style.min.css @@ -1 +1 @@ -.cooked-clearfix:after{content:"";display:table;clear:both}#post-body-content #postdivrich{display:none}body.post-type-cp_recipe .wp-list-table tfoot th.check-column,body.post-type-cp_recipe .wp-list-table thead th.check-column{padding:15px 0 0 7px}body.post-type-cp_recipe .wp-list-table tfoot td,body.post-type-cp_recipe .wp-list-table tfoot th,body.post-type-cp_recipe .wp-list-table thead td,body.post-type-cp_recipe .wp-list-table thead th{padding:10px 10px}body.post-type-cp_recipe .wp-list-table tfoot th.sortable a,body.post-type-cp_recipe .wp-list-table tfoot th.sorted a,body.post-type-cp_recipe .wp-list-table thead th.sortable a,body.post-type-cp_recipe .wp-list-table thead th.sorted a{padding-left:0;padding-right:0}body.post-type-cp_recipe .wp-list-table tbody th.check-column{padding:15px 0 0 10px}body.post-type-cp_recipe .wp-list-table tbody td,body.post-type-cp_recipe .wp-list-table tbody th{padding:12px 10px}body.post-type-cp_recipe .wp-list-table tbody td.column-title strong{margin-top:6px}body.post-type-cp_recipe .wp-list-table tbody td.column-title strong .row-title{padding-top:10px;font-size:1rem!important}th.column-featured_image{width:50px;text-align:center}td.column-featured_image{width:50px;text-align:center}.cooked-admin-recipes-list-image img{width:49px;height:auto;border-radius:3px;position:relative;top:3px}body.post-type-cp_recipe #titlediv #title{box-shadow:none;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:0 12px;font-weight:400;font-size:19px;letter-spacing:0;height:44px}body.post-type-cp_recipe #titlediv #title-prompt-text{font-size:15px;color:#888;font-weight:400;letter-spacing:0;padding:12px 15px}body.mce-fullscreen #cooked-recipe-tabs{z-index:auto}body.mce-fullscreen #adminmenumain{display:none}body.mce-fullscreen #cooked-directions-builder .cooked-direction-block:not(:has(.mce-fullscreen)),body.mce-fullscreen #cooked_recipe_settings .wp-editor-wrap:not(:has(.mce-fullscreen)){visibility:hidden}body.mce-fullscreen div.mce-tinymce.mce-fullscreen{z-index:100010}#cooked-settings-prewrap{display:flex;justify-content:center}#cooked-settings-wrap{position:relative;border-radius:10px;margin:40px 40px 40px 20px;max-width:1200px;min-width:1000px;background:#fff;box-shadow:0 4px 4px rgba(0,0,0,.05),0 8px 8px rgba(0,0,0,.05),0 32px 32px rgba(0,0,0,.05),0 64px 64px rgba(0,0,0,.05)}#cooked-settings-wrap.is-stuck{position:static!important}#cooked-settings-wrap .cooked-settings-update-button{position:absolute;top:30px;right:30px}#cooked-settings-wrap .cooked-settings-update-button>.button-primary{box-shadow:none;border:none}#cooked-settings-wrap.is-stuck .cooked-settings-update-button{position:fixed;top:35px;right:11px;z-index:100001}#cooked-recipe-tabs{list-style:none;padding:0;margin:0;position:sticky;top:var(--wp-admin--admin-bar--height,0);z-index:1000;width:100%}#cooked_recipe_settings.stuck #cooked-recipe-tabs{box-shadow:0 3px 50px rgba(0,0,0,.25)}#cooked-recipe-tabs li{font-size:.9rem;line-height:3rem;height:3rem;font-weight:500;display:inline-block;padding:0 1.25rem;margin:0;color:#fff}#cooked-recipe-tabs li:hover{cursor:pointer}#cooked-recipe-tabs li.active,#cooked-recipe-tabs li.active:hover{cursor:default}#cooked-recipe-tabs li:last-child{border-right:none!important}#cooked-recipe-tabs li.cooked-loading{opacity:0;background:0 0;color:#fff;position:absolute;top:0;right:0;cursor:default;font-size:14px;width:40px;height:40px;text-align:center;display:block;line-height:40px;padding:0}#cooked-recipe-tabs li.cooked-loading:hover{background:0 0;color:#fff}#cooked_recipe_settings.cooked-loading #cooked-recipe-tabs li.cooked-loading{opacity:1}#cooked_recipe_settings .inside{padding:0;margin:0}.cooked-recipe-tab-content-wrapper .cooked-recipe-tab-content{display:none}.cooked-recipe-tab-content-wrapper .cooked-recipe-tab-content:first-child{display:block}.cooked-left{float:left;display:inline-block;width:auto}.cooked-right{float:right;display:inline-block;width:auto}#cooked_field--cooked_pro_license_key{font-family:monospace}#cooked_recipe_settings .cooked-bm-5{margin-bottom:5px!important}#cooked_recipe_settings .cooked-bm-10{margin-bottom:10px!important}#cooked_recipe_settings .cooked-tm-10{margin-top:10px!important}#cooked_recipe_settings .cooked-bm-15{margin-bottom:15px!important}#cooked_recipe_settings .cooked-bm-20{margin-bottom:20px!important}#cooked_recipe_settings .cooked-bm-30{margin-bottom:30px!important}#cooked_recipe_settings .cooked-bm-5-up{margin-bottom:-5px!important}#cooked_recipe_settings .cooked-bm-10-up{margin-bottom:-10px!important}#cooked_recipe_settings .cooked-bm-15-up{margin-bottom:-15px!important}#cooked_recipe_settings .cooked-bm-20-up{margin-bottom:-20px!important}#cooked_recipe_settings .cooked-bm-30-up{margin-bottom:-30px!important}#cooked_recipe_settings .cooked-hr{border:none;border-top:2px solid #ddd;margin:10px 0 0 0;padding:15px 0 0 0}#cooked_recipe_settings .cooked-conditional-hidden{display:none}#cooked_recipe_settings .cooked-recipe-tab-content{padding:23px 30px 15px 30px}#cooked_recipe_settings .recipe-setting-block{margin:0 0 20px;width:100%}#cooked_recipe_settings .recipe-setting-block p{font-size:.9rem;line-height:1.5rem;margin:0 0 1rem;padding:0}#cooked_recipe_settings .recipe-setting-block p.cooked-padded{line-height:1.75rem;font-size:.85rem}#cooked_recipe_settings .recipe-setting-block .cooked-conditional-hidden{padding:0}#cooked_recipe_settings textarea{width:100%;height:75px;padding:15px;box-sizing:border-box;position:relative;top:5px}#cooked_recipe_settings .recipe-setting-block>label.cooked-select-label{top:5px}#cooked_recipe_settings select{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;border-radius:3px;padding:0 45px 0 9px;line-height:31px;height:33px;box-sizing:border-box;background:#fff}#cooked_recipe_settings .cooked-select-wrapper{background:#fff;position:relative;width:auto;display:inline-block;border-radius:3px;margin:0 5px 0 0}#cooked_recipe_settings .cooked-select-wrapper select{margin:0;background:0 0;position:relative}#cooked_recipe_settings .cooked-select-wrapper:before{font-family:CookedIcons;display:block;width:15px;height:15px;line-height:14px;color:#000;font-size:14px;content:"\f00b";position:absolute;right:12px;top:11px;color:rgba(0,0,0,.3)}#cooked_recipe_settings .cooked-select-wrapper:hover:before{color:#000}#cooked_recipe_settings .cooked-select-wrapper:hover select{border-color:#ccc}#cooked_recipe_settings .cooked-checkbox-radio-label{position:relative;left:1px}#cooked_recipe_settings .recipe-setting-block input[type=checkbox],#cooked_recipe_settings .recipe-setting-block input[type=radio]{margin-top:0}#cooked_recipe_settings .recipe-setting-block input[type=number]{width:65px}#cooked_recipe_settings .recipe-setting-block input[type=password],#cooked_recipe_settings .recipe-setting-block input[type=text]{width:75%}#cooked_recipe_settings .recipe-setting-block input[type=number],#cooked_recipe_settings .recipe-setting-block input[type=password],#cooked_recipe_settings .recipe-setting-block input[type=text]{margin:0 6px 5px 0;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;height:33px;box-shadow:none;position:relative;top:2px;padding:0 10px}#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs .cooked-measurement-column{width:43%;margin-right:3%;display:inline-block}#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs .cooked-select-wrapper,#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs input,#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs label{width:100%;display:block}#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs .cooked-select-wrapper select{width:100%}#cooked_recipe_settings .recipe-setting-block input[type=number],#cooked_recipe_settings .recipe-setting-block input[type=password].cooked-small-textfield,#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-small-textfield{width:150px}#cooked_recipe_settings small{display:block;line-height:1.5;font-size:12px;color:#888;padding:10px 0 0}#cooked_recipe_settings .recipe-setting-block em{color:#aaa}#cooked_recipe_settings .recipe-setting-block,#cooked_recipe_settings .recipe-setting-block .cooked-repositioned{display:block;position:relative;box-sizing:border-box;line-height:1}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned{padding-left:157px}#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{width:70%;position:relative;z-index:2;padding:.5rem 0 .5rem;margin:0;font-size:1rem;line-height:1.5rem;font-weight:600}#cooked_recipe_settings .recipe-setting-block strong.cooked-heading{font-size:14px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned>label{position:absolute;top:1px;left:0;width:147px;cursor:default;font-weight:600}#cooked_recipe_settings .recipe-setting-block .cooked-tooltip-icon{color:#aaa;cursor:help;display:inline-block;margin-left:10px}#cooked_recipe_settings .recipe-setting-block .cooked-tooltip-icon:hover{color:#eee}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned>.cooked-checkbox-radio-label{top:7px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned>label{top:auto;height:33px;line-height:30px;padding:0;width:130px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned:first-child label:first-child{padding-top:12px;margin-top:-12px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned span.cooked-padded{padding:0 0 15px;display:block;line-height:1.9}#cooked_recipe_settings .recipe-setting-block .wp-picker-container .cooked-color-field.wp-color-picker{padding:5px;height:25px;top:0;margin:0;width:74px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #ccc}#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-shortcode-field{font-family:monospace;background:#f5f5f5;font-size:12px}#cooked_recipe_settings .cooked-banner-block{margin:30px -30px -17px;display:block;box-sizing:content-box;padding:10px 30px 15px;background:#f9f9f9;width:100%;border-top:1px solid #e5e5e5}#cooked_recipe_settings .cooked-advanced-options-hr{border:none;border-bottom:1px solid #ddd;height:1px;padding:10px 0 0 0;margin:0 0 20px}#cooked_recipe_settings .recipe-setting-block input.cooked-time-picker{top:0;width:100%;padding-right:70%;margin:0 0 3px}#cooked_recipe_settings .recipe-setting-block .cooked-time-picker-text{position:absolute;bottom:13px;right:40px;color:#888}#cooked_recipe_settings .cooked-alert-block{background:#fffbdc;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;margin:10px 0 15px;padding:10px 22px 2px;border:2px solid #ece8c4}#cooked_recipe_settings .recipe-setting-block.cooked-template{display:none}#cooked_recipe_settings ul.cooked-admin-ul{font-size:.9rem;margin:0 0 1rem 2rem;list-style:disc}#cooked_recipe_settings ul.cooked-admin-ul li{font-size:.9rem;padding:0;margin:0 0 .5rem}#cooked_recipe_settings .cooked-html-block{background:#fff;width:auto;min-width:300px;display:inline-block;padding:.5rem 1.3rem .25rem;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}#cooked_recipe_settings .recipe-setting-block .cooked-html-block h3.cooked-settings-title{width:100%;color:#333}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.valid{background:#fff;border:2px solid #0aa780;box-shadow:none;border-radius:5px}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.valid>.cooked-settings-title{color:#0aa780}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.expired,#cooked_recipe_settings .recipe-setting-block .cooked-html-block.invalid{border:2px solid #ca4a20}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.expired>.cooked-settings-title,#cooked_recipe_settings .recipe-setting-block .cooked-html-block.invalid>.cooked-settings-title{color:#ca4a20}#cooked-directions-builder .cooked-direction-block.cooked-expanded>.cooked-heading-name,#cooked-directions-builder .cooked-direction-block.cooked-has-heading-element>.cooked-heading-name,#cooked-directions-builder .cooked-direction-block:hover>.cooked-heading-name,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-heading-name,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-heading-element>.cooked-heading-name,#cooked-ingredients-builder .cooked-ingredient-block:hover>.cooked-heading-name{padding-right:32px}#cooked-directions-builder .cooked-direction-block .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-heading-element{opacity:0;cursor:pointer;font-size:14px;position:absolute;top:14px;right:35px}#cooked-directions-builder .cooked-direction-block .cooked-show-heading-element .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-heading-element .cooked-icon{color:#888}#cooked-directions-builder .cooked-direction-block.cooked-expanded .cooked-show-heading-element,#cooked-directions-builder .cooked-direction-block.cooked-has-heading-element .cooked-show-heading-element,#cooked-directions-builder .cooked-direction-block:hover .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-heading-element .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-show-heading-element{opacity:1}#cooked-directions-builder .cooked-direction-block .cooked-show-heading-element .cooked-icon:hover,#cooked-directions-builder .cooked-direction-block.cooked-expanded .cooked-show-heading-element .cooked-icon,#cooked-directions-builder .cooked-direction-block.cooked-has-heading-element .cooked-show-heading-element .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-heading-element .cooked-icon:hover,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-heading-element .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-heading-element .cooked-show-heading-element .cooked-icon{color:#0685ba}#cooked-directions-builder .cooked-direction-block>.cooked-heading-element,#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-element{display:none;width:65%;float:right;margin-top:4px;padding-right:32px}#cooked-directions-builder .cooked-direction-block>.cooked-heading-element select,#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-element select{color:#0685ba;width:100%}#cooked-directions-builder .cooked-direction-block>.cooked-heading-element label,#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-element label{font-weight:600}#cooked-directions-builder .cooked-direction-block.cooked-expanded>.cooked-heading-element,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-heading-element{display:block}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution{opacity:0;cursor:pointer;font-size:14px;position:absolute;top:15px;right:58px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution .cooked-icon{color:#888}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-show-substitution{opacity:1;right:50px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution .cooked-icon:hover,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-substitution .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution .cooked-show-substitution .cooked-icon{color:#0685ba}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-ingredient-name,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution>.cooked-ingredient-name,#cooked-ingredients-builder .cooked-ingredient-block:hover>.cooked-ingredient-name{padding-right:32px}#cooked_recipe_settings .switchery-small,body.post-type-cp_recipe .switchery-small{height:1rem;width:1.75rem;border-radius:1rem;margin-right:.4rem}#cooked_recipe_settings .switchery-small>small,body.post-type-cp_recipe .switchery-small>small{width:1rem;height:1rem;padding:0}.cooked-tooltip-buttons .cooked-icon-spin{margin-top:10px;font-size:15px}.cooked-tooltip-buttons .cooked-saved-default{height:28px;line-height:28px;font-weight:700;font-size:15px;color:#888}.cooked-progress{display:none;position:relative;background:#eee;width:100%;height:6px;padding:0;border-radius:3px;margin:10px 0 0 0}.cooked-progress-text{display:none;font-size:10px;color:#aaa;padding:2px 0 5px}.cooked-progress-text.cooked-active,.cooked-progress.cooked-active{display:block}.cooked-progress .cooked-progress-bar{display:block;position:absolute;background:#0085ba;width:0%;height:6px;top:0;left:0;border-radius:3px}#cooked-import-progress.cooked-progress,#cooked-migration-progress.cooked-progress{background:#ccc;margin:25px 0 0 0;border-radius:6px;height:12px;max-width:600px}#cooked-import-progress.cooked-progress .cooked-progress-bar,#cooked-migration-progress.cooked-progress .cooked-progress-bar{border-radius:6px;height:12px}#cooked-import-progress-text.cooked-progress-text,#cooked-migration-progress-text.cooked-progress-text{font-size:11px;color:#888;max-width:600px}#cooked-import-completed,#cooked-migration-completed{display:none}#cooked-import-completed.cooked-active,#cooked-migration-completed.cooked-active{display:block}#cooked-csv-import-progress.cooked-progress{background:#ccc;margin:25px 0 0 0;border-radius:6px;height:12px;max-width:600px}#cooked-csv-import-progress.cooked-progress .cooked-progress-bar{border-radius:6px;height:12px}#cooked-csv-import-progress-text.cooked-progress-text{font-size:11px;color:#888;max-width:600px}#cooked-csv-import-completed{display:none}#cooked-csv-import-completed.cooked-active{display:block}#cooked-csv-import-form{max-width:100%;box-sizing:border-box}#cooked-csv-import-form input[type=file]{max-width:100%;box-sizing:border-box;width:100%}#cooked-csv-import-errors{max-width:100%;box-sizing:border-box;word-wrap:break-word}#cooked-import-progress.cooked-progress,#cooked-migration-progress.cooked-progress,#cooked-related-progress.cooked-progress{background:#ccc;margin:25px 0 0 0;border-radius:6px;height:12px;max-width:600px}#cooked-import-progress.cooked-progress .cooked-progress-bar,#cooked-migration-progress.cooked-progress .cooked-progress-bar,#cooked-related-progress.cooked-progress .cooked-progress-bar{border-radius:6px;height:12px}#cooked-import-progress-text.cooked-progress-text,#cooked-migration-progress-text.cooked-progress-text,#cooked-related-progress-text.cooked-progress-text{font-size:11px;color:#888;max-width:600px}#cooked-import-completed,#cooked-migration-completed,#cooked-related-completed{display:none}#cooked-import-completed.cooked-active,#cooked-migration-completed.cooked-active,#cooked-related-completed.cooked-active{display:block}.cooked-related-status{margin:0 0 12px 0;padding:8px 12px;font-size:13px;line-height:1.4;border-radius:4px;border-left:3px solid #00a878;background:#f0f9f6;color:#2d4a42;max-width:480px}#cooked-related-last-done.cooked-related-status{border-left-color:#8c9b99;background:#f6f8f7;color:#5c6b69}#cooked_recipe_settings .cooked-layout-save-default{position:relative;top:-2px;z-index:10;margin:0 0 0 15px;padding:0 8px 1px}#cooked_recipe_settings .cooked-layout-load-default{position:relative;top:-2px;z-index:10;margin:0 0 0 10px;padding:0 8px 1px}body .button.button-cooked-reset{color:#999}body .button.button-cooked-reset:hover{color:#555}#cooked_recipe_settings .cooked-ingredient-headers{display:block;padding:5px 25px 0 35px}#cooked_recipe_settings .cooked-ingredient-headers span{font-size:.7rem;font-weight:700;letter-spacing:.03rem;text-transform:uppercase;color:#0085ba;box-sizing:border-box;display:inline-block;float:left}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-amount{width:15%}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-measurement{width:20%}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-item{width:65%}#cooked-ingredients-builder{margin:0 0 20px}#cooked-ingredients-builder .cooked-ingredient-block{display:block;padding:5px 45px 5px 35px}#cooked-ingredients-builder .cooked-ingredient-block:hover{background:#eee}#cooked-ingredients-builder .cooked-ingredient-block input[type=number],#cooked-ingredients-builder .cooked-ingredient-block input[type=text],#cooked-ingredients-builder .cooked-ingredient-block select{margin:0;display:block;top:0}#cooked-ingredients-builder .cooked-ingredient-block>div{display:inline-block;float:left;box-sizing:border-box;padding-right:10px}#cooked-ingredients-builder .cooked-ingredient-block>div input[type=text]{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-amount{width:15%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement{width:20%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement .cooked-select-wrapper{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement .cooked-select-wrapper select{width:100%}#cooked-ingredients-builder .cooked-ingredient-block .cooked-substitution-fields>.cooked-ingredient-measurement .cooked-select-wrapper{width:100%}#cooked-ingredients-builder .cooked-ingredient-block .cooked-substitution-fields>.cooked-ingredient-measurement .cooked-select-wrapper select{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-name{width:65%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-name{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>div small.cooked-input-ex{display:block;padding:5px 0 0 2px}#cooked-ingredients-builder .cooked-ingredient-block{margin:0}#cooked-ingredients-builder .cooked-ingredient-block i.cooked-icon-drag{cursor:move;color:#ccc;font-size:32px;position:absolute;top:5px;left:1px;touch-action:none}#cooked-ingredients-builder .cooked-ingredient-block:hover i.cooked-icon-drag{color:#888}#cooked-ingredients-builder .cooked-ingredient-block.ui-sortable-helper{background:#f5f5f5;box-shadow:0 10px 20px rgba(0,0,0,.15);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#cooked-ingredients-builder .cooked-ingredient-block.ui-sortable-placeholder{visibility:visible!important;background:#eee;display:block;width:100%;height:43px;border-top:6px solid #fff;border-bottom:6px solid #fff}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient{cursor:pointer;font-size:14px;position:absolute;top:14px;right:11px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient .cooked-icon{color:#fff}#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-delete-ingredient .cooked-icon{color:#888}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient .cooked-icon:hover{color:#de2020}#cooked-ingredients-builder .cooked-ingredient-block.cooked-ingredient-heading{margin:10px 0}#cooked-ingredients-builder .cooked-ingredient-block.cooked-ingredient-heading>div input[type=text]{padding:0 7px;font-size:16px;background:#f9f9f9;font-weight:600}#cooked-directions-builder{margin:0 0 20px}#cooked-directions-builder .cooked-direction-block{display:block;padding:15px 25px 15px 35px}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading{padding:5px 25px 5px 35px}#cooked-directions-builder .cooked-direction-block:hover{background:#f5f5f5}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading:hover{background:#eee}#cooked-directions-builder .cooked-direction-block textarea{margin:0;display:block;height:250px;top:0}#cooked-directions-builder .cooked-direction-block>div{display:inline-block;float:left;box-sizing:border-box;padding-right:15px}#cooked-directions-builder .cooked-direction-block>div:last-child{padding:0}#cooked-directions-builder .cooked-direction-block>div input[type=text]{width:100%}#cooked-directions-builder .cooked-direction-block .mce-statusbar{display:none}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image{width:135px;position:absolute;top:15px;left:35px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image img{cursor:pointer;display:none;border-radius:3px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .cooked-direction-img-placeholder{box-sizing:border-box;cursor:pointer;border-radius:3px;width:100%;padding-bottom:100%;background:0 0;border:2px dashed #ddd;border-radius:3px;margin-top:15px}#cooked-directions-builder .cooked-direction-block:hover>.cooked-direction-image .cooked-direction-img-placeholder{background:0 0}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .cooked-direction-img-placeholder:hover{background:#ddd;border:2px solid #ddd}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .direction-image-button{width:100%;text-align:center}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .remove-image-button{display:none;position:absolute;top:43px;right:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image .remove-image-button{display:inline-block;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image .remove-image-button:hover{background:#ff0100}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image img{width:100%;height:auto;display:block;margin:15px 0 0}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image .cooked-direction-img-placeholder{display:none}#cooked-directions-builder .cooked-direction-block>.cooked-direction-content{width:100%;padding-left:175px;padding-right:175px}#cooked-directions-builder .cooked-direction-block .cooked-direction-number{opacity:.4;position:absolute;display:inline-block;font-weight:800;top:17px;left:35px;font-size:1.25rem;line-height:1}#cooked-directions-builder .cooked-direction-block.cooked-direction-has-number>.cooked-direction-image{left:65px}#cooked-directions-builder .cooked-direction-block.cooked-direction-has-number>.cooked-direction-content{padding-left:175px;padding-right:175px}#cooked-directions-builder .cooked-direction-block.cooked-direction-has-number-wide>.cooked-direction-content{padding-left:185px;padding-right:175px}#cooked-directions-builder .cooked-direction-block>.cooked-heading-name{width:100%}#cooked-directions-builder .cooked-direction-block{margin:0}#cooked-directions-builder .cooked-direction-block i.cooked-icon-drag{cursor:move;color:#ccc;font-size:32px;position:absolute;top:13px;left:1px;touch-action:none}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading i.cooked-icon-drag{top:5px}#cooked-directions-builder .cooked-direction-block:hover i.cooked-icon-drag{color:#888}#cooked-directions-builder .cooked-direction-block.ui-sortable-helper{background:#f5f5f5;box-shadow:0 10px 20px rgba(0,0,0,.15);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#cooked-directions-builder .cooked-direction-block.ui-sortable-placeholder{visibility:visible!important;background:#eee;display:block;width:100%;height:280px;border-top:6px solid #fff;border-bottom:6px solid #fff}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading.ui-sortable-placeholder{height:43px}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction{cursor:pointer;font-size:14px;position:absolute;right:14px}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction .cooked-icon{color:#fff}#cooked-directions-builder .cooked-direction-block:hover .cooked-delete-direction .cooked-icon{color:#888}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction .cooked-icon:hover{color:#de2020}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video{width:135px;position:absolute;top:15px;right:25px}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading{margin:10px 0}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading>div input[type=text]{padding:0 7px;font-size:16px;background:#f9f9f9;font-weight:600;top:0;margin:0}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction{top:16px}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading .cooked-delete-direction{top:14px}.cooked-settings-image-field{position:relative;display:inline-block;max-width:150px}.cooked-settings-image-field .cooked-settings-image-preview-img{display:none;width:100%;height:auto;margin:10px 0 0;border-radius:3px}.cooked-settings-image-field .cooked-settings-image-remove{display:none;position:absolute;top:50px;right:0;padding:10px;background:rgba(0,0,0,.25);color:#fff;border-radius:3px}.cooked-settings-image-field.cooked-has-image .cooked-settings-image-remove{display:inline-block}.cooked-settings-image-field.cooked-has-image .cooked-settings-image-remove:hover{background:#ff0100}.cooked-settings-image-field.cooked-has-image .cooked-settings-image-preview-img{display:block}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .cooked-direction-video-preview{display:none;width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:3px;cursor:pointer}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .cooked-direction-video-placeholder{box-sizing:border-box;cursor:pointer;border-radius:3px;width:100%;padding-bottom:100%;background:0 0;border:2px dashed #ddd;margin-top:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .cooked-direction-video-placeholder:hover{background:#ddd;border:2px solid #ddd}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .direction-video-button{width:100%;text-align:center}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .cooked-direction-video-placeholder{display:none}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .cooked-direction-video-preview{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;margin-top:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .remove-video-button{display:none;position:absolute;top:43px;right:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .remove-video-button{display:inline-block;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .remove-video-button:hover{background:#ff0100}@media screen and (max-width:1440px){#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading){display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"content content" "image video";gap:10px;padding:15px 0 15px 0}#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading)>.cooked-direction-content{grid-area:content;padding:14px 14px 0 14px!important;min-height:80px}#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading)>.cooked-direction-image{grid-area:image;position:relative;width:auto;left:auto;top:auto;padding-left:15px;padding-right:0}#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading)>.cooked-direction-video{grid-area:video;position:relative;width:auto;right:auto;top:auto}#cooked_recipe_settings .cooked-recipe-tab-content{padding:0 0 15px 0}#cooked-recipe-tabs{white-space:nowrap;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;width:100%}#cooked-recipe-tabs::-webkit-scrollbar{display:none}#cooked-recipe-tabs li{float:none}}#cooked-recipe-image-gallery{margin:0 -1% 0}#cooked-recipe-image-gallery .cooked-recipe-gallery-item{position:relative;overflow:hidden;cursor:move;box-sizing:border-box;display:inline-block;width:18%;height:auto;padding:0;margin:0 1% 2% 1%}#cooked-recipe-image-gallery .cooked-recipe-gallery-item:hover{opacity:.9}#cooked-recipe-image-gallery .cooked-recipe-gallery-item img{width:100%;height:auto;border-radius:3px;display:block;margin:0;padding:0;border:none}#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-helper,#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-helper:hover{opacity:.75;box-shadow:0 10px 20px rgba(0,0,0,.15)}#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-placeholder{width:18%;height:auto;visibility:visible!important;border-radius:3px;background:#ddd;display:inline-block}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .remove-image-button{border-radius:0 3px 0 0;display:inline-block;position:absolute;top:0;right:0;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .remove-image-button:hover{background:#ff0100}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .cooked-gallery-edit-button{border-radius:3px 0 0 0;display:inline-block;position:absolute;top:0;left:0;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .cooked-gallery-edit-button:hover{background:#0084bc}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .cooked-gallery-item-title{position:absolute;left:0;bottom:0;box-sizing:border-box;width:100%;border-radius:0 0 3px 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;padding:10px 10px 11px;text-align:center;background:#000;background:rgba(0,0,0,.3);color:#fff;font-size:12px}#cooked-recipe-image-gallery .cooked-recipe-gallery-item:hover .cooked-gallery-item-title{background:#000;background:rgba(0,0,0,.75)}#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-helper{-webkit-animation:cooked-wiggle .4s infinite;-moz-animation:cooked-wiggle .4s infinite;-o-animation:cooked-wiggle .4s infinite;animation:cooked-wiggle .4s infinite}#cooked_recipe_settings label.cooked-nutrition-label{display:block;font-size:.7rem;letter-spacing:.03rem;font-weight:700;text-transform:uppercase;line-height:1;margin:0 0 7px}#cooked_recipe_settings #cooked-nutrition-label{line-height:1.6;font-size:1.1rem;border:1px solid #aaa;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:5%;margin:0 0 2rem;font-family:Helvetica,Arial,sans-serif;container-name:nutrition-label;container-type:inline-size}#cooked_recipe_settings #cooked-nutrition-label h2{font-size:2.5rem;line-height:1;letter-spacing:0;font-weight:800;padding:0 0 .5rem 0;margin:0 0 .4rem;color:#333;border-bottom:1px solid #aaa}#cooked_recipe_settings #cooked-nutrition-label p.cooked-daily-value-text{padding:.5rem 0 0 0;margin:0;font-size:.9rem}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-servings p{font-size:1.5rem}#cooked_recipe_settings #cooked-nutrition-label ul{list-style:none;margin:0;padding:0}#cooked_recipe_settings #cooked-nutrition-label li{position:relative;margin:0;padding:0 0 3px 0;border-top:1px solid #aaa}#cooked_recipe_settings #cooked-nutrition-label li li{padding:3px 0 0;margin:3px 0 0}#cooked_recipe_settings #cooked-nutrition-label li:after{content:"";display:table;clear:both}#cooked_recipe_settings #cooked-nutrition-label li.no-after:after{content:none}#cooked_recipe_settings #cooked-nutrition-label li.cooked-nut-spacer{border:none;height:.6rem;padding:0;background:#333}#cooked_recipe_settings #cooked-nutrition-label ul li.cooked-nut-no-border,#cooked_recipe_settings #cooked-nutrition-label>ul>li:first-child{border:none}#cooked_recipe_settings #cooked-nutrition-label li ul{padding:0;margin:0 0 0 20px}#cooked_recipe_settings #cooked-nutrition-label li ul.cooked-right{margin:0}#cooked_recipe_settings #cooked-nutrition-label li ul.cooked-right li{border:none;padding:0;margin:0}#cooked_recipe_settings #cooked-nutrition-label li.cooked-calories ul.cooked-right li strong.cooked-nut-label{font-size:2.5rem;line-height:1}#cooked_recipe_settings #cooked-nutrition-label .cooked-calories{border-top:none;display:flex;justify-content:space-between;align-items:baseline;padding:0}#cooked_recipe_settings #cooked-nutrition-label .cooked-calories strong,#cooked_recipe_settings #cooked-nutrition-label .cooked-calories strong.cooked-nut-label{font-size:2rem;font-weight:800}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-servings li{border:none}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-servings{margin:0}#cooked_recipe_settings #cooked-nutrition-label .cooked-nut-hr{border:none;border-top:1.3rem solid #333;margin:.1rem 0 0;padding:0}#cooked_recipe_settings #cooked-nutrition-label strong{font-weight:800}#cooked_recipe_settings #cooked-nutrition-label .cooked-serving-size strong,#cooked_recipe_settings #cooked-nutrition-label .cooked-serving-size strong.cooked-nut-label{font-size:1.5rem;font-weight:800}#cooked_recipe_settings #cooked-nutrition-label strong.cooked-nut-heading{font-size:1rem}#cooked_recipe_settings #cooked-nutrition-label strong.cooked-nut-label{font-weight:400}#cooked_recipe_settings #cooked-nutrition-label .cooked-nut-right{float:right}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-bottom{margin:0 0 .75rem}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-bottom li{border-top:none;border-bottom:1px solid #aaa;float:left;width:100%;box-sizing:border-box}#cooked_recipe_settings .cooked-measurement-inputs .cooked-select-wrapper:before{top:8px}.cooked-auto-nutrition{display:flex;justify-content:end;margin:0 0 1rem}#cooked-tooltip-auto-nutrition-notice{margin:0}.cooked-settings-header{border-radius:10px 10px 0 0;width:auto;height:90px;line-height:85px;padding:0 30px;font-weight:600;box-sizing:border-box;background:#33373c;color:#fff;font-size:29px;letter-spacing:-.03rem}.cooked-settings-header .cooked-icon{color:#00e0a9}.cooked-settings-submit-wrap{padding:0 0 35px 35px;margin:-20px 0 0}#cooked_recipe_settings .recipe-setting-block .cooked-permalink-field-wrapper span{font-size:14px;display:inline-block;line-height:32px;padding:5px 0 0 0}#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-permalink-field{position:relative;top:0;display:inline-block;width:150px;margin:0 10px}#cooked-settings-panel{position:relative;margin:0;padding:0}#cooked-settings-tabs{display:flex;width:auto;padding:0 20px 0 0;margin:0;list-style:none}#cooked-settings-tabs li{font-size:13px;line-height:1;font-weight:400;display:block;padding:0;margin:0;color:#fff}#cooked-settings-tabs li .cooked-icon{font-size:14px}#cooked-settings-tabs li .cooked-icon.cooked-icon-recipe-icon{font-size:20px;top:2px;position:relative}#cooked-settings-tabs li:hover{cursor:pointer}#cooked-settings-tabs li.active,#cooked-settings-tabs li.active:hover{cursor:default}#cooked-settings-tabs a{line-height:41px;font-size:.9rem;letter-spacing:.03rem;padding:2px 15px 4px;display:block;outline:0;box-shadow:none;border:none;white-space:nowrap}#cooked-settings-panel.stuck{padding-top:41px}#cooked-settings-panel.stuck #cooked-settings-tabs{position:fixed;width:calc(100% - 180px);top:32px;left:0;z-index:100000;margin-left:160px}#cooked-settings-panel .cooked-settings-tab-content-wrapper .cooked-settings-tab-content{display:none}#cooked-settings-panel .cooked-settings-tab-content-wrapper .cooked-settings-tab-content:first-child{display:block}#cooked-settings-panel .cooked-settings-tab-content{padding:25px 35px;margin-right:0}#cooked-settings-panel #cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{padding-bottom:.2rem}#cooked_recipe_settings .cooked-setting-column-14{position:relative;width:25%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-13{position:relative;width:33%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-23{position:relative;width:66%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-12{position:relative;width:50%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-12 input[type=text],#cooked_recipe_settings .cooked-setting-column-13 input[type=text],#cooked_recipe_settings .cooked-setting-column-14 input[type=text],#cooked_recipe_settings .cooked-setting-column-23 input[type=text],#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-shortcode-field{width:95%}#cooked_recipe_settings .cooked-setting-column-12 .cooked-select-wrapper,#cooked_recipe_settings .cooked-setting-column-12 select,#cooked_recipe_settings .cooked-setting-column-13 .cooked-select-wrapper,#cooked_recipe_settings .cooked-setting-column-13 select,#cooked_recipe_settings .cooked-setting-column-14 .cooked-select-wrapper,#cooked_recipe_settings .cooked-setting-column-14 select,#cooked_recipe_settings .cooked-setting-column-23 select{width:100%}#cooked_recipe_settings .cooked-setting-column-14.cooked-tb-col{padding:0}#cooked-welcome-screen{padding:15px 50px 0 30px;position:relative}#cooked-welcome-screen .cooked-badge{position:absolute;top:0;right:0}#cooked-welcome-screen .cooked-badge img{border:none;width:150px;height:150px;display:block;margin:0}#cooked-welcome-screen .about-text{margin-bottom:40px;line-height:1.8;font-size:17px;margin-right:260px}#cooked-welcome-screen .about-wrap{margin:25px auto 0;max-width:1000px}#cooked-welcome-screen .about-wrap h1{font-size:2.25rem}#cooked-welcome-screen .about-wrap p{font-size:1rem;margin:0 0 2rem;line-height:1.7rem}#cooked-welcome-screen #cooked-welcome-panel{background:#fff;padding:30px 30px 15px 30px;-moz-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;border:none;box-shadow:0 4px 4px rgba(0,0,0,.05),0 8px 8px rgba(0,0,0,.05),0 32px 32px rgba(0,0,0,.05),0 64px 64px rgba(0,0,0,.05)}#cooked-welcome-screen #cooked-welcome-panel img.cooked-welcome-banner{border:none;display:block;padding:0;margin:0 0 30px;box-sizing:border-box;border-radius:5px 5px 0 0}#cooked-welcome-screen #cooked-welcome-panel .cooked-welcome-panel-intro{text-align:center;margin:0 50px 2rem;padding:15px 0;border-bottom:1px solid #e5e5e5}#cooked-welcome-screen #cooked-welcome-panel .cooked-welcome-panel-intro h1{font-size:1.75rem;margin:0 0 1rem;padding:0}#cooked-welcome-screen #cooked-welcome-panel .cooked-welcome-panel-intro p{max-width:600px;font-size:1.1rem;line-height:1.8rem;margin:0 auto 2rem;padding:0}#cooked-welcome-screen .cooked-welcome-panel a{text-decoration:none}#cooked-welcome-screen .cooked-welcome-panel-column{display:block!important}#cooked-welcome-screen .cooked-welcome-panel-column>strong{font-size:1rem}#cooked-welcome-screen .cooked-welcome-panel-column h3{font-size:1.75rem;margin:0 0 1rem;position:relative}#cooked-welcome-screen .cooked-welcome-panel-column h3 a{position:absolute;top:0;right:0;font-size:12px;font-weight:400}#cooked-welcome-screen .cooked-welcome-panel-column h3 a i.fa{position:relative;top:1px}#cooked-welcome-screen .cooked-welcome-panel-column h4{font-size:1.25rem;margin:0 0 1rem;position:relative}#cooked-welcome-screen .cooked-welcome-panel-column h4 a{position:absolute;top:0;right:0;font-size:12px;font-weight:400}#cooked-welcome-screen .cooked-welcome-panel-column h4 a i.fa{position:relative;top:1px}#cooked-welcome-screen .cooked-welcome-panel-column.cooked-welcome-panel-full{width:100%;padding-right:0;float:none}#cooked-welcome-screen .cooked-welcome-panel-column.cooked-welcome-panel-last{width:70%;padding-right:0;float:right}#cooked-welcome-screen .cooked-welcome-panel-column .fa-external-link{color:#888}#cooked-welcome-screen .cooked-welcome-panel-content{min-height:1px;padding:10px 50px 20px;margin:0}#cooked-welcome-screen .cooked-welcome-panel .cooked-welcome-panel-column-container{display:flex;justify-content:between!important;padding:0!important;flex-wrap:wrap}#cooked-welcome-screen .cooked-welcome-panel-column{box-sizing:border-box;padding-right:2rem;width:30%}#cooked-welcome-screen .cooked-pro-features{width:85%;margin:0 auto;padding:0 0 10px;display:flex;flex-wrap:wrap}#cooked-welcome-screen ul.cooked-whatsnew-list{margin-right:0}#cooked-welcome-screen ul.cooked-whatsnew-list li{line-height:1.7;position:relative;margin-right:0;border-top:1px solid #e5e5e5;padding:8px 0 4px 0}#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child{border:none;padding-top:0}#cooked-welcome-screen ul.cooked-whatsnew-list em.fix,#cooked-welcome-screen ul.cooked-whatsnew-list strong.new,#cooked-welcome-screen ul.cooked-whatsnew-list strong.tweak{position:absolute;font-style:normal;display:inline-block;background:#aaa;text-transform:uppercase;top:11px;left:0;color:#fff;font-weight:600;-moz-border-radius:3px;-webkit-border-radius:3px;text-align:center;width:38px;border-radius:3px;font-size:10px;line-height:19px;height:19px;padding:0 6px;margin:0 6px 0 0}#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child em.fix,#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child strong.new,#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child strong.tweak{top:3px}#cooked-welcome-screen ul.cooked-whatsnew-list strong.new{background:#56c477}#cooked-welcome-screen ul.cooked-whatsnew-list strong.tweak{background:#0073aa}#cooked-welcome-screen ul.cooked-whatsnew-list em.fix{background:#ffad10}#cooked-welcome-screen ul li.cooked-pro i.cooked-icon{color:#ffad10}#cooked-welcome-screen ul li.cooked-pro a{font-weight:600;color:#ffad10}#cooked-welcome-screen ul li.cooked-pro a:hover{color:#d3910f}#cooked-welcome-screen ul.cooked-whatsnew-pro{margin-bottom:0;flex:1 0 auto;width:33.333%}#cooked-welcome-screen ul.cooked-whatsnew-pro li{padding-left:0;font-size:1.15rem;font-weight:400}#cooked-welcome-screen ul.cooked-whatsnew-pro li i.cooked-icon-star{color:#ffad10;margin:0 7px 0 0;font-size:19px;position:relative;top:1px}#cooked-welcome-screen .cooked-welcome-bottom{text-align:center;background:#f9f9f9;margin:30px -80px -15px;border-top:1px solid #f1f1f1}#cooked-welcome-screen .cooked-pro-button{display:inline-block;clear:both;text-align:center;width:auto;margin:30px auto;padding:20px 25px 21px;font-size:1.25rem;line-height:1rem;font-weight:600;color:#fff;background:#ffad10;border-radius:50px}#cooked-welcome-screen .cooked-pro-button:hover{background:#e08704}#cooked-welcome-screen .cooked-coupon-code{color:#4c5e65;display:inline-block;font-size:17px;padding:0 0 0 1.5rem}@media screen and (max-width:1050px){#cooked-welcome-screen ul.cooked-whatsnew-pro{width:100%;margin-top:0}#cooked-welcome-screen ul.cooked-whatsnew-pro:first-child{margin-top:10px}#cooked-welcome-screen ul.cooked-whatsnew-pro li:first-child{border-top:1px solid #e5e5e5;padding-top:8px}#cooked-welcome-screen ul.cooked-whatsnew-pro:first-child li:first-child{border:none;padding-top:0}}@media screen and (max-width:870px){#cooked-welcome-screen .cooked-pro-features{width:90%}#cooked-welcome-screen .cooked-welcome-panel-column{padding-right:0}#cooked-welcome-screen .cooked-welcome-panel-column.cooked-welcome-panel-last{width:100%;padding-top:20px}#cooked-welcome-screen .about-wrap{margin-top:0}#cooked-welcome-screen .cooked-welcome-panel .cooked-welcome-panel-column li{display:block}}@media screen and (max-width:782px){#cooked-welcome-screen .cooked-pro-features{width:100%}#cooked-welcome-screen{padding:15px 40px 0 30px}#cooked-welcome-screen .cooked-badge{display:none}#cooked-welcome-screen .about-text,#cooked-welcome-screen .about-wrap h1{margin-right:0}#cooked-welcome-screen .cooked-welcome-panel-column h3 a{display:block;position:relative}}@media screen and (max-width:500px){#cooked-welcome-screen #cooked-welcome-panel img.cooked-welcome-banner{display:none}#cooked-welcome-screen .about-wrap h1{font-size:1.8rem}#cooked-welcome-screen .about-text{font-size:15px}}#cooked_recipe_settings #cooked-nutrition-label .cooked-nut-label,#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{color:#0173aa}#cooked_recipe_settings .recipe-setting-block.cooked-danger h3.cooked-settings-title{color:#d44d1f}#cooked_recipe_settings .cooked-alert-block h3.cooked-settings-title{color:#c02a2a}#cooked-recipe-tabs{background:#fff}#cooked-recipe-tabs li{background:#454b52;color:#fff;color:rgba(255,255,255,.75);border-right:1px solid rgba(0,0,0,.15)}#cooked-recipe-tabs li:hover{background:#535a62;color:#fff;border-right:1px solid rgba(0,0,0,.15)}#cooked-recipe-tabs li.active{background:#fff;color:#333;border-right:1px solid #fff}#cooked-settings-tabs{background:#454b52}#cooked-settings-tabs a{color:#fff;text-decoration:none}#cooked-settings-tabs li{background:#454b52;color:#fff;color:rgba(255,255,255,.75)}#cooked-settings-tabs li:hover{background:#535a62;color:#fff}#cooked-settings-tabs li.active{background:#fff}#cooked-settings-tabs li.active a{color:#000}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .cooked-direction-img-placeholder,#cooked-migration-progress.cooked-progress .cooked-progress-bar,#cooked-related-progress.cooked-progress .cooked-progress-bar,#cooked_recipe_settings .cooked-select-wrapper:before,#cooked_recipe_settings .cooked-tooltip-icon,#cooked_recipe_settings select{-webkit-transition:all .15s ease-out;-moz-transition:all .15s ease-out;transition:all .15s ease-out}#cooked-recipe-image-gallery .cooked-recipe-gallery-item{-webkit-transition:transform .15s ease-out;-moz-transition:all .15s ease-out;transition:transform .15s ease-out}#cooked-recipe-tabs li.cooked-loading{-webkit-transition:opacity .15s ease-out;-moz-transition:all .15s ease-out;transition:opacity .15s ease-out}@-webkit-keyframes cooked-wiggle{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.03)}100%{-webkit-transform:scale(1)}}@-moz-keyframes cooked-wiggle{0%{-moz-transform:scale(1)}50%{-moz-transform:scale(1.03)}100%{-moz-transform:scale(1)}}@-o-keyframes cooked-wiggle{0%{-o-transform:scale(1)}50%{-o-transform:scale(1.03)}100%{-o-transform:scale(1)}}@keyframes cooked-wiggle{0%{transform:scale(1)}50%{transform:scale(1.03)}100%{transform:scale(1)}}@media screen and (max-width:1150px){#cooked-recipe-tabs li{font-size:.8rem;padding:0 1.2rem 0 .7rem}#cooked-recipe-tabs li .cooked-icon{display:none}}@media screen and (max-width:768px){#cooked_recipe_settings .cooked-clearfix:has(>.cooked-setting-column-14){display:grid;grid-template-columns:1fr 1fr;gap:10px}#cooked_recipe_settings .cooked-setting-column-14{width:100%;float:none;padding-right:0}#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{width:60%}}@media screen and (max-width:600px){#cooked-recipe-tabs{top:0}#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{display:flex;flex-wrap:wrap;align-items:center;row-gap:10px}#cooked_recipe_settings .recipe-setting-block:has(#cooked-nutrition-label) .cooked-setting-column-12{width:100%;float:none;padding-right:0}#cooked_recipe_settings .recipe-setting-block:has(#cooked-nutrition-label) p.cooked-measurement-inputs{display:flex;gap:10px}#cooked_recipe_settings .recipe-setting-block:has(#cooked-nutrition-label) p.cooked-measurement-inputs .cooked-measurement-column{width:50%;margin-right:0;flex:1}#cooked-ingredients-builder .cooked-ingredient-block{display:grid;grid-template-columns:1fr 1fr;column-gap:8px;row-gap:4px;padding-left:30px;padding-right:35px}#cooked-ingredients-builder .cooked-ingredient-block>div{display:block;float:none;padding-right:0}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-amount{width:auto;grid-column:1}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement{width:auto;grid-column:2}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-name{width:auto;grid-column:1/-1;padding-right:40px}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields{width:auto;float:none;clear:none;grid-column:1/-1}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-name{grid-column:1/-1}#cooked_recipe_settings .cooked-ingredient-headers{display:grid;grid-template-columns:1fr 1fr;padding-left:30px;padding-right:35px}#cooked_recipe_settings .cooked-ingredient-headers span{display:block;float:none}#cooked_recipe_settings .cooked-layout-save-default{margin:0}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-amount{width:auto}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-measurement{width:auto}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-item{width:auto;grid-column:1/-1;padding-top:2px}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields{display:grid;grid-template-columns:1fr 1fr;column-gap:8px;row-gap:4px}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields>div{display:block;float:none;padding-right:0}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-ingredient-amount,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-ingredient-measurement{width:100%;display:block}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-ingredient-name{width:auto;grid-column:1/-1;padding-top:0}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-sub-label{grid-column:1/-1}#cooked-ingredients-builder .cooked-ingredient-block{position:relative}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution{top:60px;right:42px}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-show-substitution{right:42px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient{right:11px}}@media screen and (max-width:500px){#cooked_recipe_settings .cooked-clearfix:has(>.cooked-setting-column-14){grid-template-columns:1fr}}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields{width:100%;float:left;clear:both;margin-top:10px;padding-top:10px;padding-right:0;padding-left:0;margin-left:0;box-sizing:border-box;padding-bottom:5px;position:relative}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-ingredient-amount{width:15%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-ingredient-measurement{width:20%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-ingredient-name{width:65%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-sub-label{color:#7c7c7c;font-size:14px;font-weight:300}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields>div{display:inline-block;float:left;box-sizing:border-box;padding-right:10px}.cooked-bulk-add-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:100100;display:flex;align-items:center;justify-content:center}.cooked-bulk-add-modal{background:#fff;border-radius:6px;width:600px;max-width:90vw;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 5px 30px rgba(0,0,0,.3)}.cooked-bulk-add-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #ddd}.cooked-bulk-add-header h2{margin:0;font-size:18px;line-height:1.3}.cooked-bulk-add-close{font-size:24px;text-decoration:none;color:#666;line-height:1;padding:0 4px}.cooked-bulk-add-close:hover{color:#d63638}.cooked-bulk-add-body{padding:20px;overflow-y:auto;flex:1}.cooked-bulk-add-help{margin-top:0;color:#666;font-size:13px}#cooked-bulk-add-textarea{width:100%;min-height:160px;font-size:14px;padding:10px;box-sizing:border-box;resize:vertical}.cooked-bulk-add-preview{margin-top:16px}.cooked-bulk-add-preview-label{margin:0 0 8px;font-size:13px}.cooked-bulk-add-preview-notice-ingredients{display:none;margin:10px 0 0;font-size:12px;line-height:1.45;color:#b45309;font-weight:700;gap:6px;align-items:flex-start}#cooked-bulk-add-preview[data-bulk-type=ingredients] .cooked-bulk-add-preview-notice-ingredients{display:flex}.cooked-bulk-add-preview-notice-mark{flex-shrink:0;font-weight:700;line-height:1.45;color:#b45309}.cooked-bulk-add-preview-notice-text{flex:1;min-width:0;font-weight:700;color:#b45309}.cooked-bulk-add-preview-list{max-height:200px;overflow-y:auto;border:1px solid #ddd;border-radius:4px;padding:4px}.cooked-bulk-add-preview-row{display:flex;align-items:center;gap:8px;padding:4px 6px;border-bottom:1px solid #f0f0f0}.cooked-bulk-add-preview-row:last-child{border-bottom:0}.cooked-bulk-add-heading-toggle{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:12px;color:#666;cursor:pointer;flex-shrink:0}.cooked-bulk-add-heading-toggle input[type=checkbox]{margin:0}.cooked-bulk-add-preview-text{flex:1;border:1px solid #ddd;border-radius:3px;padding:4px 8px;font-size:13px}.cooked-bulk-add-preview-row:not(.cooked-bulk-add-preview-row-ingredient).cooked-bulk-add-is-heading .cooked-bulk-add-preview-text{font-weight:700}.cooked-bulk-add-preview-row-ingredient .cooked-bulk-add-heading-line-wrap{display:none;flex:1;align-items:center;gap:8px;min-width:0}.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-heading-line-wrap{display:flex}.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-parsed-amount,.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-parsed-name,.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-parsed-unit{display:none}.cooked-bulk-add-heading-line-label{flex-shrink:0;font-size:12px;font-weight:600;color:#666}.cooked-bulk-add-preview-row-ingredient .cooked-bulk-add-heading-line-wrap .cooked-bulk-add-preview-text{flex:1;min-width:0;border:1px solid #ddd;border-radius:3px;padding:4px 8px;font-size:13px;font-weight:600}.cooked-bulk-add-preview-header{display:flex;align-items:center;gap:8px;padding:4px 6px 6px;border-bottom:1px solid #ddd;font-size:11px;font-weight:600;color:#999;text-transform:uppercase;letter-spacing:.5px}.cooked-bulk-add-col-heading{flex-shrink:0;width:108px}.cooked-bulk-add-col-amount{width:72px;flex-shrink:0}.cooked-bulk-add-col-unit{width:108px;flex-shrink:0}.cooked-bulk-add-col-name{flex:1}.cooked-bulk-add-parsed-amount{width:72px;flex-shrink:0;border:1px solid #ddd;border-radius:3px;padding:4px 6px;font-size:13px;text-align:center}.cooked-bulk-add-parsed-unit{width:108px;flex-shrink:0;border:1px solid #ddd;border-radius:3px;padding:4px 6px;font-size:13px}.cooked-bulk-add-parsed-name{flex:1;border:1px solid #ddd;border-radius:3px;padding:4px 6px;font-size:13px}.cooked-bulk-add-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid #ddd}.cooked-bulk-add-footer .button,.cooked-bulk-add-footer .button.button-primary{float:none;margin:0;vertical-align:middle}.cooked-bulk-add-spinner{float:none!important;margin:0!important}#cooked_allergens .cooked-allergens-checkboxes{display:flex;flex-direction:column;gap:8px}#cooked_allergens .cooked-allergen-checkbox{display:flex;align-items:center;gap:8px;cursor:pointer}#cooked_allergens .cooked-allergen-checkbox input[type=checkbox]{margin:0}#cooked_allergens .cooked-allergen{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}#cooked_allergens .cooked-allergen .cooked-icon{font-size:1.5rem;line-height:1}#cooked_allergens .cooked-allergen,#cooked_allergens .cooked-allergen .cooked-icon{color:rgba(0,0,0,.4)}#cooked_allergens .cooked-allergen-label{font-size:13px;color:#333} \ No newline at end of file +.cooked-clearfix:after{content:"";display:table;clear:both}#post-body-content #postdivrich{display:none}body.post-type-cp_recipe .wp-list-table tfoot th.check-column,body.post-type-cp_recipe .wp-list-table thead th.check-column{padding:15px 0 0 7px}body.post-type-cp_recipe .wp-list-table tfoot td,body.post-type-cp_recipe .wp-list-table tfoot th,body.post-type-cp_recipe .wp-list-table thead td,body.post-type-cp_recipe .wp-list-table thead th{padding:10px 10px}body.post-type-cp_recipe .wp-list-table tfoot th.sortable a,body.post-type-cp_recipe .wp-list-table tfoot th.sorted a,body.post-type-cp_recipe .wp-list-table thead th.sortable a,body.post-type-cp_recipe .wp-list-table thead th.sorted a{padding-left:0;padding-right:0}body.post-type-cp_recipe .wp-list-table tbody th.check-column{padding:15px 0 0 10px}body.post-type-cp_recipe .wp-list-table tbody td,body.post-type-cp_recipe .wp-list-table tbody th{padding:12px 10px}body.post-type-cp_recipe .wp-list-table tbody td.column-title strong{margin-top:6px}body.post-type-cp_recipe .wp-list-table tbody td.column-title strong .row-title{padding-top:10px;font-size:1rem!important}th.column-featured_image{width:50px;text-align:center}td.column-featured_image{width:50px;text-align:center}.cooked-admin-recipes-list-image img{width:49px;height:auto;border-radius:3px;position:relative;top:3px}body.post-type-cp_recipe #titlediv #title{box-shadow:none;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:0 12px;font-weight:400;font-size:19px;letter-spacing:0;height:44px}body.post-type-cp_recipe #titlediv #title-prompt-text{font-size:15px;color:#888;font-weight:400;letter-spacing:0;padding:12px 15px}body.mce-fullscreen #cooked-recipe-tabs{z-index:auto}body.mce-fullscreen #adminmenumain{display:none}body.mce-fullscreen #cooked-directions-builder .cooked-direction-block:not(:has(.mce-fullscreen)),body.mce-fullscreen #cooked_recipe_settings .wp-editor-wrap:not(:has(.mce-fullscreen)){visibility:hidden}body.mce-fullscreen div.mce-tinymce.mce-fullscreen{z-index:100010}#cooked-settings-prewrap{display:flex;justify-content:center}#cooked-settings-wrap{position:relative;border-radius:10px;margin:40px 40px 40px 20px;max-width:1200px;min-width:1000px;background:#fff;box-shadow:0 4px 4px rgba(0,0,0,.05),0 8px 8px rgba(0,0,0,.05),0 32px 32px rgba(0,0,0,.05),0 64px 64px rgba(0,0,0,.05)}#cooked-settings-wrap.is-stuck{position:static!important}#cooked-settings-wrap .cooked-settings-update-button{position:absolute;top:30px;right:30px}#cooked-settings-wrap .cooked-settings-update-button>.button-primary{box-shadow:none;border:none}#cooked-settings-wrap.is-stuck .cooked-settings-update-button{position:fixed;top:35px;right:11px;z-index:100001}#cooked-recipe-tabs{list-style:none;padding:0;margin:0;position:sticky;top:var(--wp-admin--admin-bar--height,0);z-index:1000;width:100%}#cooked_recipe_settings.stuck #cooked-recipe-tabs{box-shadow:0 3px 50px rgba(0,0,0,.25)}#cooked-recipe-tabs li{font-size:.9rem;line-height:3rem;height:3rem;font-weight:500;display:inline-block;padding:0 1.25rem;margin:0;color:#fff}#cooked-recipe-tabs li:hover{cursor:pointer}#cooked-recipe-tabs li.active,#cooked-recipe-tabs li.active:hover{cursor:default}#cooked-recipe-tabs li:last-child{border-right:none!important}#cooked-recipe-tabs li.cooked-loading{opacity:0;background:0 0;color:#fff;position:absolute;top:0;right:0;cursor:default;font-size:14px;width:40px;height:40px;text-align:center;display:block;line-height:40px;padding:0}#cooked-recipe-tabs li.cooked-loading:hover{background:0 0;color:#fff}#cooked_recipe_settings.cooked-loading #cooked-recipe-tabs li.cooked-loading{opacity:1}#cooked_recipe_settings .inside{padding:0;margin:0}.cooked-recipe-tab-content-wrapper .cooked-recipe-tab-content{display:none}.cooked-recipe-tab-content-wrapper .cooked-recipe-tab-content:first-child{display:block}.cooked-left{float:left;display:inline-block;width:auto}.cooked-right{float:right;display:inline-block;width:auto}#cooked_field--cooked_pro_license_key{font-family:monospace}#cooked_recipe_settings .cooked-bm-5{margin-bottom:5px!important}#cooked_recipe_settings .cooked-bm-10{margin-bottom:10px!important}#cooked_recipe_settings .cooked-tm-10{margin-top:10px!important}#cooked_recipe_settings .cooked-bm-15{margin-bottom:15px!important}#cooked_recipe_settings .cooked-bm-20{margin-bottom:20px!important}#cooked_recipe_settings .cooked-bm-30{margin-bottom:30px!important}#cooked_recipe_settings .cooked-bm-5-up{margin-bottom:-5px!important}#cooked_recipe_settings .cooked-bm-10-up{margin-bottom:-10px!important}#cooked_recipe_settings .cooked-bm-15-up{margin-bottom:-15px!important}#cooked_recipe_settings .cooked-bm-20-up{margin-bottom:-20px!important}#cooked_recipe_settings .cooked-bm-30-up{margin-bottom:-30px!important}#cooked_recipe_settings .cooked-hr{border:none;border-top:2px solid #ddd;margin:10px 0 0 0;padding:15px 0 0 0}#cooked_recipe_settings .cooked-conditional-hidden{display:none}#cooked_recipe_settings .cooked-recipe-tab-content{padding:23px 30px 15px 30px}#cooked_recipe_settings .recipe-setting-block{margin:0 0 20px;width:100%}#cooked_recipe_settings .recipe-setting-block p{font-size:.9rem;line-height:1.5rem;margin:0 0 1rem;padding:0}#cooked_recipe_settings .recipe-setting-block p.cooked-padded{line-height:1.75rem;font-size:.85rem}#cooked_recipe_settings .recipe-setting-block .cooked-conditional-hidden{padding:0}#cooked_recipe_settings textarea{width:100%;height:75px;padding:15px;box-sizing:border-box;position:relative;top:5px}#cooked_recipe_settings .recipe-setting-block>label.cooked-select-label{top:5px}#cooked_recipe_settings select{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;border-radius:3px;padding:0 45px 0 9px;line-height:31px;height:33px;box-sizing:border-box;background:#fff}#cooked_recipe_settings .cooked-select-wrapper{background:#fff;position:relative;width:auto;display:inline-block;border-radius:3px;margin:0 5px 0 0}#cooked_recipe_settings .cooked-select-wrapper select{margin:0;background:0 0;position:relative}#cooked_recipe_settings .cooked-select-wrapper:before{font-family:CookedIcons;display:block;width:15px;height:15px;line-height:14px;color:#000;font-size:14px;content:"\f00b";position:absolute;right:12px;top:11px;color:rgba(0,0,0,.3)}#cooked_recipe_settings .cooked-select-wrapper:hover:before{color:#000}#cooked_recipe_settings .cooked-select-wrapper:hover select{border-color:#ccc}#cooked_recipe_settings .cooked-checkbox-radio-label{position:relative;left:1px}#cooked_recipe_settings .recipe-setting-block input[type=checkbox],#cooked_recipe_settings .recipe-setting-block input[type=radio]{margin-top:0}#cooked_recipe_settings .recipe-setting-block input[type=number]{width:65px}#cooked_recipe_settings .recipe-setting-block input[type=password],#cooked_recipe_settings .recipe-setting-block input[type=text]{width:75%}#cooked_recipe_settings .recipe-setting-block input[type=number],#cooked_recipe_settings .recipe-setting-block input[type=password],#cooked_recipe_settings .recipe-setting-block input[type=text]{margin:0 6px 5px 0;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;height:33px;box-shadow:none;position:relative;top:2px;padding:0 10px}#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs .cooked-measurement-column{width:43%;margin-right:3%;display:inline-block}#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs .cooked-select-wrapper,#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs input,#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs label{width:100%;display:block}#cooked_recipe_settings .recipe-setting-block p.cooked-measurement-inputs .cooked-select-wrapper select{width:100%}#cooked_recipe_settings .recipe-setting-block input[type=number],#cooked_recipe_settings .recipe-setting-block input[type=password].cooked-small-textfield,#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-small-textfield{width:150px}#cooked_recipe_settings small{display:block;line-height:1.5;font-size:12px;color:#888;padding:10px 0 0}#cooked_recipe_settings .recipe-setting-block em{color:#aaa}#cooked_recipe_settings .recipe-setting-block,#cooked_recipe_settings .recipe-setting-block .cooked-repositioned{display:block;position:relative;box-sizing:border-box;line-height:1}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned{padding-left:157px}#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{width:70%;position:relative;z-index:2;padding:.5rem 0 .5rem;margin:0;font-size:1rem;line-height:1.5rem;font-weight:600}#cooked_recipe_settings .recipe-setting-block strong.cooked-heading{font-size:14px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned>label{position:absolute;top:1px;left:0;width:147px;cursor:default;font-weight:600}#cooked_recipe_settings .recipe-setting-block .cooked-tooltip-icon{color:#aaa;cursor:help;display:inline-block;margin-left:10px}#cooked_recipe_settings .recipe-setting-block .cooked-tooltip-icon:hover{color:#eee}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned>.cooked-checkbox-radio-label{top:7px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned>label{top:auto;height:33px;line-height:30px;padding:0;width:130px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned:first-child label:first-child{padding-top:12px;margin-top:-12px}#cooked_recipe_settings .recipe-setting-block .cooked-repositioned span.cooked-padded{padding:0 0 15px;display:block;line-height:1.9}#cooked_recipe_settings .recipe-setting-block .wp-picker-container .cooked-color-field.wp-color-picker{padding:5px;height:25px;top:0;margin:0;width:74px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #ccc}#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-shortcode-field{font-family:monospace;background:#f5f5f5;font-size:12px}#cooked_recipe_settings .cooked-banner-block{margin:30px -30px -17px;display:block;box-sizing:content-box;padding:10px 30px 15px;background:#f9f9f9;width:100%;border-top:1px solid #e5e5e5}#cooked_recipe_settings .cooked-advanced-options-hr{border:none;border-bottom:1px solid #ddd;height:1px;padding:10px 0 0 0;margin:0 0 20px}#cooked_recipe_settings .recipe-setting-block input.cooked-time-picker{top:0;width:100%;padding-right:70%;margin:0 0 3px}#cooked_recipe_settings .recipe-setting-block .cooked-time-picker-text{position:absolute;bottom:13px;right:40px;color:#888}#cooked_recipe_settings .cooked-alert-block{background:#fffbdc;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;margin:10px 0 15px;padding:10px 22px 2px;border:2px solid #ece8c4}#cooked_recipe_settings .recipe-setting-block.cooked-template{display:none}#cooked_recipe_settings ul.cooked-admin-ul{font-size:.9rem;margin:0 0 1rem 2rem;list-style:disc}#cooked_recipe_settings ul.cooked-admin-ul li{font-size:.9rem;padding:0;margin:0 0 .5rem}#cooked_recipe_settings .cooked-html-block{background:#fff;width:auto;min-width:300px;display:inline-block;padding:.5rem 1.3rem .25rem;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}#cooked_recipe_settings .recipe-setting-block .cooked-html-block h3.cooked-settings-title{width:100%;color:#333}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.valid{background:#fff;border:2px solid #0aa780;box-shadow:none;border-radius:5px}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.valid>.cooked-settings-title{color:#0aa780}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.expired,#cooked_recipe_settings .recipe-setting-block .cooked-html-block.invalid{border:2px solid #ca4a20}#cooked_recipe_settings .recipe-setting-block .cooked-html-block.expired>.cooked-settings-title,#cooked_recipe_settings .recipe-setting-block .cooked-html-block.invalid>.cooked-settings-title{color:#ca4a20}#cooked-directions-builder .cooked-direction-block.cooked-expanded>.cooked-heading-name,#cooked-directions-builder .cooked-direction-block.cooked-has-heading-element>.cooked-heading-name,#cooked-directions-builder .cooked-direction-block:hover>.cooked-heading-name,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-heading-name,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-heading-element>.cooked-heading-name,#cooked-ingredients-builder .cooked-ingredient-block:hover>.cooked-heading-name{padding-right:32px}#cooked-directions-builder .cooked-direction-block .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-heading-element{opacity:0;cursor:pointer;font-size:14px;position:absolute;top:14px;right:35px}#cooked-directions-builder .cooked-direction-block .cooked-show-heading-element .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-heading-element .cooked-icon{color:#888}#cooked-directions-builder .cooked-direction-block.cooked-expanded .cooked-show-heading-element,#cooked-directions-builder .cooked-direction-block.cooked-has-heading-element .cooked-show-heading-element,#cooked-directions-builder .cooked-direction-block:hover .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-heading-element .cooked-show-heading-element,#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-show-heading-element{opacity:1}#cooked-directions-builder .cooked-direction-block .cooked-show-heading-element .cooked-icon:hover,#cooked-directions-builder .cooked-direction-block.cooked-expanded .cooked-show-heading-element .cooked-icon,#cooked-directions-builder .cooked-direction-block.cooked-has-heading-element .cooked-show-heading-element .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-heading-element .cooked-icon:hover,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-heading-element .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-heading-element .cooked-show-heading-element .cooked-icon{color:#0685ba}#cooked-directions-builder .cooked-direction-block>.cooked-heading-element,#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-element{display:none;width:65%;float:right;margin-top:4px;padding-right:32px}#cooked-directions-builder .cooked-direction-block>.cooked-heading-element select,#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-element select{color:#0685ba;width:100%}#cooked-directions-builder .cooked-direction-block>.cooked-heading-element label,#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-element label{font-weight:600}#cooked-directions-builder .cooked-direction-block.cooked-expanded>.cooked-heading-element,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-heading-element{display:block}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution{opacity:0;cursor:pointer;font-size:14px;position:absolute;top:15px;right:58px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution .cooked-icon{color:#888}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-show-substitution{opacity:1;right:50px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution .cooked-icon:hover,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-substitution .cooked-icon,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution .cooked-show-substitution .cooked-icon{color:#0685ba}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-ingredient-name,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution>.cooked-ingredient-name,#cooked-ingredients-builder .cooked-ingredient-block:hover>.cooked-ingredient-name{padding-right:32px}#cooked_recipe_settings .switchery-small,body.post-type-cp_recipe .switchery-small{height:1rem;width:1.75rem;border-radius:1rem;margin-right:.4rem}#cooked_recipe_settings .switchery-small>small,body.post-type-cp_recipe .switchery-small>small{width:1rem;height:1rem;padding:0}.cooked-tooltip-buttons .cooked-icon-spin{margin-top:10px;font-size:15px}.cooked-tooltip-buttons .cooked-saved-default{height:28px;line-height:28px;font-weight:700;font-size:15px;color:#888}.cooked-tooltip-floating{position:fixed;top:0;left:0;z-index:2001;box-sizing:border-box;width:max-content;max-width:275px;min-width:min-content;color:#666;font-size:12px;line-height:1.6;text-align:left;white-space:normal;pointer-events:none}.cooked-tooltip-floating>.cooked-tooltip-bubble{box-sizing:border-box;padding:15px 18px;background:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 3px 8px rgba(0,0,0,.12)}.cooked-tooltip-floating[hidden]{display:none}.cooked-tooltip-floating strong{color:#07a780;display:block;margin:0 0 2px}.cooked-tooltip-floating strong.cooked-tooltip-heading{display:block;font-size:15px;margin:0 0 5px;white-space:nowrap}.cooked-tooltip-bubble{position:relative;opacity:0;transform:scale(0);transform-origin:center;transition:transform .4s cubic-bezier(.22,.61,.36,1),opacity .4s cubic-bezier(.22,.61,.36,1)}.cooked-tooltip-open>.cooked-tooltip-bubble{opacity:1;transform:scale(1)}.cooked-tooltip-arrow{position:absolute;width:10px;height:10px;background:#fff;border:0 solid #ccc;transform:rotate(45deg)}.cooked-save-default-panel:not([data-placement]) .cooked-tooltip-arrow{display:none}[data-placement=top]>.cooked-tooltip-arrow,[data-placement=top]>.cooked-tooltip-bubble>.cooked-tooltip-arrow{border-width:0 1px 1px 0}[data-placement=bottom]>.cooked-tooltip-arrow,[data-placement=bottom]>.cooked-tooltip-bubble>.cooked-tooltip-arrow{border-width:1px 0 0 1px}[data-placement=left]>.cooked-tooltip-arrow,[data-placement=left]>.cooked-tooltip-bubble>.cooked-tooltip-arrow{border-width:1px 1px 0 0}[data-placement=right]>.cooked-tooltip-arrow,[data-placement=right]>.cooked-tooltip-bubble>.cooked-tooltip-arrow{border-width:0 0 1px 1px}.cooked-progress{display:none;position:relative;background:#eee;width:100%;height:6px;padding:0;border-radius:3px;margin:10px 0 0 0}.cooked-progress-text{display:none;font-size:10px;color:#aaa;padding:2px 0 5px}.cooked-progress-text.cooked-active,.cooked-progress.cooked-active{display:block}.cooked-progress .cooked-progress-bar{display:block;position:absolute;background:#0085ba;width:0%;height:6px;top:0;left:0;border-radius:3px}#cooked-import-progress.cooked-progress,#cooked-migration-progress.cooked-progress{background:#ccc;margin:25px 0 0 0;border-radius:6px;height:12px;max-width:600px}#cooked-import-progress.cooked-progress .cooked-progress-bar,#cooked-migration-progress.cooked-progress .cooked-progress-bar{border-radius:6px;height:12px}#cooked-import-progress-text.cooked-progress-text,#cooked-migration-progress-text.cooked-progress-text{font-size:11px;color:#888;max-width:600px}#cooked-import-completed,#cooked-migration-completed{display:none}#cooked-import-completed.cooked-active,#cooked-migration-completed.cooked-active{display:block}#cooked-csv-import-progress.cooked-progress{background:#ccc;margin:25px 0 0 0;border-radius:6px;height:12px;max-width:600px}#cooked-csv-import-progress.cooked-progress .cooked-progress-bar{border-radius:6px;height:12px}#cooked-csv-import-progress-text.cooked-progress-text{font-size:11px;color:#888;max-width:600px}#cooked-csv-import-completed{display:none}#cooked-csv-import-completed.cooked-active{display:block}#cooked-csv-import-form{max-width:100%;box-sizing:border-box}#cooked-csv-import-form input[type=file]{max-width:100%;box-sizing:border-box;width:100%}#cooked-csv-import-errors{max-width:100%;box-sizing:border-box;word-wrap:break-word}#cooked-import-progress.cooked-progress,#cooked-migration-progress.cooked-progress,#cooked-related-progress.cooked-progress{background:#ccc;margin:25px 0 0 0;border-radius:6px;height:12px;max-width:600px}#cooked-import-progress.cooked-progress .cooked-progress-bar,#cooked-migration-progress.cooked-progress .cooked-progress-bar,#cooked-related-progress.cooked-progress .cooked-progress-bar{border-radius:6px;height:12px}#cooked-import-progress-text.cooked-progress-text,#cooked-migration-progress-text.cooked-progress-text,#cooked-related-progress-text.cooked-progress-text{font-size:11px;color:#888;max-width:600px}#cooked-import-completed,#cooked-migration-completed,#cooked-related-completed{display:none}#cooked-import-completed.cooked-active,#cooked-migration-completed.cooked-active,#cooked-related-completed.cooked-active{display:block}.cooked-related-status{margin:0 0 12px 0;padding:8px 12px;font-size:13px;line-height:1.4;border-radius:4px;border-left:3px solid #00a878;background:#f0f9f6;color:#2d4a42;max-width:480px}#cooked-related-last-done.cooked-related-status{border-left-color:#8c9b99;background:#f6f8f7;color:#5c6b69}#cooked_recipe_settings .cooked-layout-save-default{position:relative;top:-2px;z-index:10;margin:0 0 0 15px;padding:0 8px 1px}#cooked_recipe_settings .cooked-layout-load-default{position:relative;top:-2px;z-index:10;margin:0 0 0 10px;padding:0 8px 1px}.cooked-save-default-panel{background:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 3px 8px rgba(0,0,0,.12);box-sizing:border-box;color:#666;font-size:12px;line-height:1.6;margin:10px 0 0;max-width:320px;padding:15px 18px}.cooked-save-default-panel[hidden]{display:none}.cooked-save-default-panel[data-placement]{position:fixed;top:0;left:0;z-index:2001;width:max-content;max-width:275px;min-width:min-content;margin:0}.cooked-save-default-panel.cooked-tooltip-shell{background:0 0;border:0;border-radius:0;box-shadow:none;padding:0}.cooked-save-default-panel>.cooked-tooltip-bubble{box-sizing:border-box;padding:15px 18px;background:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 3px 8px rgba(0,0,0,.12)}.cooked-save-default-panel .cooked-tooltip-heading{color:#07a780;display:block;font-size:15px;margin:0 0 5px;white-space:nowrap}.cooked-save-default-panel p{margin:0 0 5px}.cooked-save-default-panel .cooked-tooltip-buttons{display:block;padding:12px 0 5px}body .button.button-cooked-reset{color:#999}body .button.button-cooked-reset:hover{color:#555}#cooked_recipe_settings .cooked-ingredient-headers{display:block;padding:5px 25px 0 35px}#cooked_recipe_settings .cooked-ingredient-headers span{font-size:.7rem;font-weight:700;letter-spacing:.03rem;text-transform:uppercase;color:#0085ba;box-sizing:border-box;display:inline-block;float:left}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-amount{width:15%}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-measurement{width:20%}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-item{width:65%}#cooked-ingredients-builder{margin:0 0 20px}#cooked-ingredients-builder .cooked-ingredient-block{display:block;padding:5px 45px 5px 35px}#cooked-ingredients-builder .cooked-ingredient-block:hover{background:#eee}#cooked-ingredients-builder .cooked-ingredient-block input[type=number],#cooked-ingredients-builder .cooked-ingredient-block input[type=text],#cooked-ingredients-builder .cooked-ingredient-block select{margin:0;display:block;top:0}#cooked-ingredients-builder .cooked-ingredient-block>div{display:inline-block;float:left;box-sizing:border-box;padding-right:10px}#cooked-ingredients-builder .cooked-ingredient-block>div input[type=text]{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-amount{width:15%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement{width:20%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement .cooked-select-wrapper{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement .cooked-select-wrapper select{width:100%}#cooked-ingredients-builder .cooked-ingredient-block .cooked-substitution-fields>.cooked-ingredient-measurement .cooked-select-wrapper{width:100%}#cooked-ingredients-builder .cooked-ingredient-block .cooked-substitution-fields>.cooked-ingredient-measurement .cooked-select-wrapper select{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-name{width:65%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-name{width:100%}#cooked-ingredients-builder .cooked-ingredient-block>div small.cooked-input-ex{display:block;padding:5px 0 0 2px}#cooked-ingredients-builder .cooked-ingredient-block{margin:0}#cooked-ingredients-builder .cooked-ingredient-block i.cooked-icon-drag{cursor:move;color:#ccc;font-size:32px;position:absolute;top:5px;left:1px;touch-action:none}#cooked-ingredients-builder .cooked-ingredient-block:hover i.cooked-icon-drag{color:#888}#cooked-ingredients-builder .cooked-ingredient-block.ui-sortable-helper{background:#f5f5f5;box-shadow:0 10px 20px rgba(0,0,0,.15);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#cooked-ingredients-builder .cooked-ingredient-block.ui-sortable-placeholder{visibility:visible!important;background:#eee;display:block;width:100%;height:43px;border-top:6px solid #fff;border-bottom:6px solid #fff}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient{cursor:pointer;font-size:14px;position:absolute;top:14px;right:11px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient .cooked-icon{color:#fff}#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-delete-ingredient .cooked-icon{color:#888}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient .cooked-icon:hover{color:#de2020}#cooked-ingredients-builder .cooked-ingredient-block.cooked-ingredient-heading{margin:10px 0}#cooked-ingredients-builder .cooked-ingredient-block.cooked-ingredient-heading>div input[type=text]{padding:0 7px;font-size:16px;background:#f9f9f9;font-weight:600}#cooked-directions-builder{margin:0 0 20px}#cooked-directions-builder .cooked-direction-block{display:block;padding:15px 25px 15px 35px}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading{padding:5px 25px 5px 35px}#cooked-directions-builder .cooked-direction-block:hover{background:#f5f5f5}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading:hover{background:#eee}#cooked-directions-builder .cooked-direction-block textarea{margin:0;display:block;height:250px;top:0}#cooked-directions-builder .cooked-direction-block>div{display:inline-block;float:left;box-sizing:border-box;padding-right:15px}#cooked-directions-builder .cooked-direction-block>div:last-child{padding:0}#cooked-directions-builder .cooked-direction-block>div input[type=text]{width:100%}#cooked-directions-builder .cooked-direction-block .mce-statusbar{display:none}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image{width:135px;position:absolute;top:15px;left:35px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image img{cursor:pointer;display:none;border-radius:3px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .cooked-direction-img-placeholder{box-sizing:border-box;cursor:pointer;border-radius:3px;width:100%;padding-bottom:100%;background:0 0;border:2px dashed #ddd;border-radius:3px;margin-top:15px}#cooked-directions-builder .cooked-direction-block:hover>.cooked-direction-image .cooked-direction-img-placeholder{background:0 0}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .cooked-direction-img-placeholder:hover{background:#ddd;border:2px solid #ddd}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .direction-image-button{width:100%;text-align:center}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .remove-image-button{display:none;position:absolute;top:43px;right:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image .remove-image-button{display:inline-block;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image .remove-image-button:hover{background:#ff0100}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image img{width:100%;height:auto;display:block;margin:15px 0 0}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image.cooked-has-image .cooked-direction-img-placeholder{display:none}#cooked-directions-builder .cooked-direction-block>.cooked-direction-content{width:100%;padding-left:175px;padding-right:175px}#cooked-directions-builder .cooked-direction-block .cooked-direction-number{opacity:.4;position:absolute;display:inline-block;font-weight:800;top:17px;left:35px;font-size:1.25rem;line-height:1}#cooked-directions-builder .cooked-direction-block.cooked-direction-has-number>.cooked-direction-image{left:65px}#cooked-directions-builder .cooked-direction-block.cooked-direction-has-number>.cooked-direction-content{padding-left:175px;padding-right:175px}#cooked-directions-builder .cooked-direction-block.cooked-direction-has-number-wide>.cooked-direction-content{padding-left:185px;padding-right:175px}#cooked-directions-builder .cooked-direction-block>.cooked-heading-name{width:100%}#cooked-directions-builder .cooked-direction-block{margin:0}#cooked-directions-builder .cooked-direction-block i.cooked-icon-drag{cursor:move;color:#ccc;font-size:32px;position:absolute;top:13px;left:1px;touch-action:none}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading i.cooked-icon-drag{top:5px}#cooked-directions-builder .cooked-direction-block:hover i.cooked-icon-drag{color:#888}#cooked-directions-builder .cooked-direction-block.ui-sortable-helper{background:#f5f5f5;box-shadow:0 10px 20px rgba(0,0,0,.15);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#cooked-directions-builder .cooked-direction-block.ui-sortable-placeholder{visibility:visible!important;background:#eee;display:block;width:100%;height:280px;border-top:6px solid #fff;border-bottom:6px solid #fff}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading.ui-sortable-placeholder{height:43px}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction{cursor:pointer;font-size:14px;position:absolute;right:14px}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction .cooked-icon{color:#fff}#cooked-directions-builder .cooked-direction-block:hover .cooked-delete-direction .cooked-icon{color:#888}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction .cooked-icon:hover{color:#de2020}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video{width:135px;position:absolute;top:15px;right:25px}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading{margin:10px 0}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading>div input[type=text]{padding:0 7px;font-size:16px;background:#f9f9f9;font-weight:600;top:0;margin:0}#cooked-directions-builder .cooked-direction-block .cooked-delete-direction{top:16px}#cooked-directions-builder .cooked-direction-block.cooked-direction-heading .cooked-delete-direction{top:14px}.cooked-settings-image-field{position:relative;display:inline-block;max-width:150px}.cooked-settings-image-field .cooked-settings-image-preview-img{display:none;width:100%;height:auto;margin:10px 0 0;border-radius:3px}.cooked-settings-image-field .cooked-settings-image-remove{display:none;position:absolute;top:50px;right:0;padding:10px;background:rgba(0,0,0,.25);color:#fff;border-radius:3px}.cooked-settings-image-field.cooked-has-image .cooked-settings-image-remove{display:inline-block}.cooked-settings-image-field.cooked-has-image .cooked-settings-image-remove:hover{background:#ff0100}.cooked-settings-image-field.cooked-has-image .cooked-settings-image-preview-img{display:block}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .cooked-direction-video-preview{display:none;width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:3px;cursor:pointer}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .cooked-direction-video-placeholder{box-sizing:border-box;cursor:pointer;border-radius:3px;width:100%;padding-bottom:100%;background:0 0;border:2px dashed #ddd;margin-top:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .cooked-direction-video-placeholder:hover{background:#ddd;border:2px solid #ddd}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .direction-video-button{width:100%;text-align:center}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .cooked-direction-video-placeholder{display:none}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .cooked-direction-video-preview{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;margin-top:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video .remove-video-button{display:none;position:absolute;top:43px;right:15px}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .remove-video-button{display:inline-block;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-directions-builder .cooked-direction-block>.cooked-direction-video.cooked-has-video .remove-video-button:hover{background:#ff0100}@media screen and (max-width:1440px){#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading){display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"content content" "image video";gap:10px;padding:15px 0 15px 0}#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading)>.cooked-direction-content{grid-area:content;padding:14px 14px 0 14px!important;min-height:80px}#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading)>.cooked-direction-image{grid-area:image;position:relative;width:auto;left:auto;top:auto;padding-left:15px;padding-right:0}#cooked-directions-builder .cooked-direction-block:not(.cooked-direction-heading)>.cooked-direction-video{grid-area:video;position:relative;width:auto;right:auto;top:auto}#cooked-recipe-tabs{white-space:nowrap;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;width:100%}#cooked-recipe-tabs::-webkit-scrollbar{display:none}#cooked-recipe-tabs li{float:none}}@media screen and (max-width:1024px){#cooked_recipe_settings .cooked-recipe-tab-content{padding:10px}}#cooked-recipe-image-gallery{margin:0 -1% 0}#cooked-recipe-image-gallery .cooked-recipe-gallery-item{position:relative;overflow:hidden;cursor:move;box-sizing:border-box;display:inline-block;width:18%;height:auto;padding:0;margin:0 1% 2% 1%}#cooked-recipe-image-gallery .cooked-recipe-gallery-item:hover{opacity:.9}#cooked-recipe-image-gallery .cooked-recipe-gallery-item img{width:100%;height:auto;border-radius:3px;display:block;margin:0;padding:0;border:none}#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-helper,#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-helper:hover{opacity:.75;box-shadow:0 10px 20px rgba(0,0,0,.15)}#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-placeholder{width:18%;height:auto;visibility:visible!important;border-radius:3px;background:#ddd;display:inline-block}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .remove-image-button{border-radius:0 3px 0 0;display:inline-block;position:absolute;top:0;right:0;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .remove-image-button:hover{background:#ff0100}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .cooked-gallery-edit-button{border-radius:3px 0 0 0;display:inline-block;position:absolute;top:0;left:0;padding:10px;background:rgba(0,0,0,.25);color:#fff}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .cooked-gallery-edit-button:hover{background:#0084bc}#cooked-recipe-image-gallery .cooked-recipe-gallery-item .cooked-gallery-item-title{position:absolute;left:0;bottom:0;box-sizing:border-box;width:100%;border-radius:0 0 3px 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;padding:10px 10px 11px;text-align:center;background:#000;background:rgba(0,0,0,.3);color:#fff;font-size:12px}#cooked-recipe-image-gallery .cooked-recipe-gallery-item:hover .cooked-gallery-item-title{background:#000;background:rgba(0,0,0,.75)}#cooked-recipe-image-gallery .cooked-recipe-gallery-item.ui-sortable-helper{-webkit-animation:cooked-wiggle .4s infinite;-moz-animation:cooked-wiggle .4s infinite;-o-animation:cooked-wiggle .4s infinite;animation:cooked-wiggle .4s infinite}#cooked_recipe_settings label.cooked-nutrition-label{display:block;font-size:.7rem;letter-spacing:.03rem;font-weight:700;text-transform:uppercase;line-height:1;margin:0 0 7px}#cooked_recipe_settings #cooked-nutrition-label{line-height:1.6;font-size:1.1rem;border:1px solid #aaa;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:5%;margin:0 0 2rem;font-family:Helvetica,Arial,sans-serif;container-name:nutrition-label;container-type:inline-size}#cooked_recipe_settings #cooked-nutrition-label h2{font-size:2.5rem;line-height:1;letter-spacing:0;font-weight:800;padding:0 0 .5rem 0;margin:0 0 .4rem;color:#333;border-bottom:1px solid #aaa}#cooked_recipe_settings #cooked-nutrition-label p.cooked-daily-value-text{padding:.5rem 0 0 0;margin:0;font-size:.9rem}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-servings p{font-size:1.5rem}#cooked_recipe_settings #cooked-nutrition-label ul{list-style:none;margin:0;padding:0}#cooked_recipe_settings #cooked-nutrition-label li{position:relative;margin:0;padding:0 0 3px 0;border-top:1px solid #aaa}#cooked_recipe_settings #cooked-nutrition-label li li{padding:3px 0 0;margin:3px 0 0}#cooked_recipe_settings #cooked-nutrition-label li:after{content:"";display:table;clear:both}#cooked_recipe_settings #cooked-nutrition-label li.no-after:after{content:none}#cooked_recipe_settings #cooked-nutrition-label li.cooked-nut-spacer{border:none;height:.6rem;padding:0;background:#333}#cooked_recipe_settings #cooked-nutrition-label ul li.cooked-nut-no-border,#cooked_recipe_settings #cooked-nutrition-label>ul>li:first-child{border:none}#cooked_recipe_settings #cooked-nutrition-label li ul{padding:0;margin:0 0 0 20px}#cooked_recipe_settings #cooked-nutrition-label li ul.cooked-right{margin:0}#cooked_recipe_settings #cooked-nutrition-label li ul.cooked-right li{border:none;padding:0;margin:0}#cooked_recipe_settings #cooked-nutrition-label li.cooked-calories ul.cooked-right li strong.cooked-nut-label{font-size:2.5rem;line-height:1}#cooked_recipe_settings #cooked-nutrition-label .cooked-calories{border-top:none;display:flex;justify-content:space-between;align-items:baseline;padding:0}#cooked_recipe_settings #cooked-nutrition-label .cooked-calories strong,#cooked_recipe_settings #cooked-nutrition-label .cooked-calories strong.cooked-nut-label{font-size:2rem;font-weight:800}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-servings li{border:none}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-servings{margin:0}#cooked_recipe_settings #cooked-nutrition-label .cooked-nut-hr{border:none;border-top:1.3rem solid #333;margin:.1rem 0 0;padding:0}#cooked_recipe_settings #cooked-nutrition-label strong{font-weight:800}#cooked_recipe_settings #cooked-nutrition-label .cooked-serving-size strong,#cooked_recipe_settings #cooked-nutrition-label .cooked-serving-size strong.cooked-nut-label{font-size:1.5rem;font-weight:800}#cooked_recipe_settings #cooked-nutrition-label strong.cooked-nut-heading{font-size:1rem}#cooked_recipe_settings #cooked-nutrition-label strong.cooked-nut-label{font-weight:400}#cooked_recipe_settings #cooked-nutrition-label .cooked-nut-right{float:right}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-bottom{margin:0 0 .75rem}#cooked_recipe_settings #cooked-nutrition-label ul.cooked-nut-bottom li{border-top:none;border-bottom:1px solid #aaa;float:left;width:100%;box-sizing:border-box}#cooked_recipe_settings .cooked-measurement-inputs .cooked-select-wrapper:before{top:8px}.cooked-auto-nutrition{display:flex;justify-content:end;margin:0 0 1rem}#cooked-tooltip-auto-nutrition-notice{margin:0}.cooked-settings-header{border-radius:10px 10px 0 0;width:auto;height:90px;line-height:85px;padding:0 30px;font-weight:600;box-sizing:border-box;background:#33373c;color:#fff;font-size:29px;letter-spacing:-.03rem}.cooked-settings-header .cooked-icon{color:#00e0a9}.cooked-settings-submit-wrap{padding:0 0 35px 35px;margin:-20px 0 0}#cooked_recipe_settings .recipe-setting-block .cooked-permalink-field-wrapper span{font-size:14px;display:inline-block;line-height:32px;padding:5px 0 0 0}#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-permalink-field{position:relative;top:0;display:inline-block;width:150px;margin:0 10px}#cooked-settings-panel{position:relative;margin:0;padding:0}#cooked-settings-tabs{display:flex;width:auto;padding:0 20px 0 0;margin:0;list-style:none}#cooked-settings-tabs li{font-size:13px;line-height:1;font-weight:400;display:block;padding:0;margin:0;color:#fff}#cooked-settings-tabs li .cooked-icon{font-size:14px}#cooked-settings-tabs li .cooked-icon.cooked-icon-recipe-icon{font-size:20px;top:2px;position:relative}#cooked-settings-tabs li:hover{cursor:pointer}#cooked-settings-tabs li.active,#cooked-settings-tabs li.active:hover{cursor:default}#cooked-settings-tabs a{line-height:41px;font-size:.9rem;letter-spacing:.03rem;padding:2px 15px 4px;display:block;outline:0;box-shadow:none;border:none;white-space:nowrap}#cooked-settings-panel.stuck{padding-top:41px}#cooked-settings-panel.stuck #cooked-settings-tabs{position:fixed;width:calc(100% - 180px);top:32px;left:0;z-index:100000;margin-left:160px}#cooked-settings-panel .cooked-settings-tab-content-wrapper .cooked-settings-tab-content{display:none}#cooked-settings-panel .cooked-settings-tab-content-wrapper .cooked-settings-tab-content:first-child{display:block}#cooked-settings-panel .cooked-settings-tab-content{padding:25px 35px;margin-right:0}#cooked-settings-panel #cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{padding-bottom:.2rem}#cooked_recipe_settings .cooked-setting-column-14{position:relative;width:25%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-13{position:relative;width:33%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-23{position:relative;width:66%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-12{position:relative;width:50%;float:left;padding-right:20px;box-sizing:border-box}#cooked_recipe_settings .cooked-setting-column-12 input[type=text],#cooked_recipe_settings .cooked-setting-column-13 input[type=text],#cooked_recipe_settings .cooked-setting-column-14 input[type=text],#cooked_recipe_settings .cooked-setting-column-23 input[type=text],#cooked_recipe_settings .recipe-setting-block input[type=text].cooked-shortcode-field{width:95%}#cooked_recipe_settings .cooked-setting-column-12 .cooked-select-wrapper,#cooked_recipe_settings .cooked-setting-column-12 select,#cooked_recipe_settings .cooked-setting-column-13 .cooked-select-wrapper,#cooked_recipe_settings .cooked-setting-column-13 select,#cooked_recipe_settings .cooked-setting-column-14 .cooked-select-wrapper,#cooked_recipe_settings .cooked-setting-column-14 select,#cooked_recipe_settings .cooked-setting-column-23 select{width:100%}#cooked_recipe_settings .cooked-setting-column-14.cooked-tb-col{padding:0}#cooked-welcome-screen{padding:15px 50px 0 30px;position:relative}#cooked-welcome-screen .cooked-badge{position:absolute;top:0;right:0}#cooked-welcome-screen .cooked-badge img{border:none;width:150px;height:150px;display:block;margin:0}#cooked-welcome-screen .about-text{margin-bottom:40px;line-height:1.8;font-size:17px;margin-right:260px}#cooked-welcome-screen .about-wrap{margin:25px auto 0;max-width:1000px}#cooked-welcome-screen .about-wrap h1{font-size:2.25rem}#cooked-welcome-screen .about-wrap p{font-size:1rem;margin:0 0 2rem;line-height:1.7rem}#cooked-welcome-screen #cooked-welcome-panel{background:#fff;padding:30px 30px 15px 30px;-moz-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;border:none;box-shadow:0 4px 4px rgba(0,0,0,.05),0 8px 8px rgba(0,0,0,.05),0 32px 32px rgba(0,0,0,.05),0 64px 64px rgba(0,0,0,.05)}#cooked-welcome-screen #cooked-welcome-panel img.cooked-welcome-banner{border:none;display:block;padding:0;margin:0 0 30px;box-sizing:border-box;border-radius:5px 5px 0 0}#cooked-welcome-screen #cooked-welcome-panel .cooked-welcome-panel-intro{text-align:center;margin:0 50px 2rem;padding:15px 0;border-bottom:1px solid #e5e5e5}#cooked-welcome-screen #cooked-welcome-panel .cooked-welcome-panel-intro h1{font-size:1.75rem;margin:0 0 1rem;padding:0}#cooked-welcome-screen #cooked-welcome-panel .cooked-welcome-panel-intro p{max-width:600px;font-size:1.1rem;line-height:1.8rem;margin:0 auto 2rem;padding:0}#cooked-welcome-screen .cooked-welcome-panel a{text-decoration:none}#cooked-welcome-screen .cooked-welcome-panel-column{display:block!important}#cooked-welcome-screen .cooked-welcome-panel-column>strong{font-size:1rem}#cooked-welcome-screen .cooked-welcome-panel-column h3{font-size:1.75rem;margin:0 0 1rem;position:relative}#cooked-welcome-screen .cooked-welcome-panel-column h3 a{position:absolute;top:0;right:0;font-size:12px;font-weight:400}#cooked-welcome-screen .cooked-welcome-panel-column h3 a i.fa{position:relative;top:1px}#cooked-welcome-screen .cooked-welcome-panel-column h4{font-size:1.25rem;margin:0 0 1rem;position:relative}#cooked-welcome-screen .cooked-welcome-panel-column h4 a{position:absolute;top:0;right:0;font-size:12px;font-weight:400}#cooked-welcome-screen .cooked-welcome-panel-column h4 a i.fa{position:relative;top:1px}#cooked-welcome-screen .cooked-welcome-panel-column.cooked-welcome-panel-full{width:100%;padding-right:0;float:none}#cooked-welcome-screen .cooked-welcome-panel-column.cooked-welcome-panel-last{width:70%;padding-right:0;float:right}#cooked-welcome-screen .cooked-welcome-panel-column .fa-external-link{color:#888}#cooked-welcome-screen .cooked-welcome-panel-content{min-height:1px;padding:10px 50px 20px;margin:0}#cooked-welcome-screen .cooked-welcome-panel .cooked-welcome-panel-column-container{display:flex;justify-content:between!important;padding:0!important;flex-wrap:wrap}#cooked-welcome-screen .cooked-welcome-panel-column{box-sizing:border-box;padding-right:2rem;width:30%}#cooked-welcome-screen .cooked-pro-features{width:85%;margin:0 auto;padding:0 0 10px;display:flex;flex-wrap:wrap}#cooked-welcome-screen ul.cooked-whatsnew-list{margin-right:0}#cooked-welcome-screen ul.cooked-whatsnew-list li{line-height:1.7;position:relative;margin-right:0;border-top:1px solid #e5e5e5;padding:8px 0 4px 0}#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child{border:none;padding-top:0}#cooked-welcome-screen ul.cooked-whatsnew-list em.fix,#cooked-welcome-screen ul.cooked-whatsnew-list strong.new,#cooked-welcome-screen ul.cooked-whatsnew-list strong.tweak{position:absolute;font-style:normal;display:inline-block;background:#aaa;text-transform:uppercase;top:11px;left:0;color:#fff;font-weight:600;-moz-border-radius:3px;-webkit-border-radius:3px;text-align:center;width:38px;border-radius:3px;font-size:10px;line-height:19px;height:19px;padding:0 6px;margin:0 6px 0 0}#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child em.fix,#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child strong.new,#cooked-welcome-screen ul.cooked-whatsnew-list li:first-child strong.tweak{top:3px}#cooked-welcome-screen ul.cooked-whatsnew-list strong.new{background:#56c477}#cooked-welcome-screen ul.cooked-whatsnew-list strong.tweak{background:#0073aa}#cooked-welcome-screen ul.cooked-whatsnew-list em.fix{background:#ffad10}#cooked-welcome-screen ul li.cooked-pro i.cooked-icon{color:#ffad10}#cooked-welcome-screen ul li.cooked-pro a{font-weight:600;color:#ffad10}#cooked-welcome-screen ul li.cooked-pro a:hover{color:#d3910f}#cooked-welcome-screen ul.cooked-whatsnew-pro{margin-bottom:0;flex:1 0 auto;width:33.333%}#cooked-welcome-screen ul.cooked-whatsnew-pro li{padding-left:0;font-size:1.15rem;font-weight:400}#cooked-welcome-screen ul.cooked-whatsnew-pro li i.cooked-icon-star{color:#ffad10;margin:0 7px 0 0;font-size:19px;position:relative;top:1px}#cooked-welcome-screen .cooked-welcome-bottom{text-align:center;background:#f9f9f9;margin:30px -80px -15px;border-top:1px solid #f1f1f1}#cooked-welcome-screen .cooked-pro-button{display:inline-block;clear:both;text-align:center;width:auto;margin:30px auto;padding:20px 25px 21px;font-size:1.25rem;line-height:1rem;font-weight:600;color:#fff;background:#ffad10;border-radius:50px}#cooked-welcome-screen .cooked-pro-button:hover{background:#e08704}#cooked-welcome-screen .cooked-coupon-code{color:#4c5e65;display:inline-block;font-size:17px;padding:0 0 0 1.5rem}@media screen and (max-width:1050px){#cooked-welcome-screen ul.cooked-whatsnew-pro{width:100%;margin-top:0}#cooked-welcome-screen ul.cooked-whatsnew-pro:first-child{margin-top:10px}#cooked-welcome-screen ul.cooked-whatsnew-pro li:first-child{border-top:1px solid #e5e5e5;padding-top:8px}#cooked-welcome-screen ul.cooked-whatsnew-pro:first-child li:first-child{border:none;padding-top:0}}@media screen and (max-width:870px){#cooked-welcome-screen .cooked-pro-features{width:90%}#cooked-welcome-screen .cooked-welcome-panel-column{padding-right:0}#cooked-welcome-screen .cooked-welcome-panel-column.cooked-welcome-panel-last{width:100%;padding-top:20px}#cooked-welcome-screen .about-wrap{margin-top:0}#cooked-welcome-screen .cooked-welcome-panel .cooked-welcome-panel-column li{display:block}}@media screen and (max-width:782px){#cooked-welcome-screen .cooked-pro-features{width:100%}#cooked-welcome-screen{padding:15px 40px 0 30px}#cooked-welcome-screen .cooked-badge{display:none}#cooked-welcome-screen .about-text,#cooked-welcome-screen .about-wrap h1{margin-right:0}#cooked-welcome-screen .cooked-welcome-panel-column h3 a{display:block;position:relative}}@media screen and (max-width:500px){#cooked-welcome-screen #cooked-welcome-panel img.cooked-welcome-banner{display:none}#cooked-welcome-screen .about-wrap h1{font-size:1.8rem}#cooked-welcome-screen .about-text{font-size:15px}}#cooked_recipe_settings #cooked-nutrition-label .cooked-nut-label,#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{color:#0173aa}#cooked_recipe_settings .recipe-setting-block.cooked-danger h3.cooked-settings-title{color:#d44d1f}#cooked_recipe_settings .cooked-alert-block h3.cooked-settings-title{color:#c02a2a}#cooked-recipe-tabs{background:#fff}#cooked-recipe-tabs li{background:#454b52;color:#fff;color:rgba(255,255,255,.75);border-right:1px solid rgba(0,0,0,.15)}#cooked-recipe-tabs li:hover{background:#535a62;color:#fff;border-right:1px solid rgba(0,0,0,.15)}#cooked-recipe-tabs li.active{background:#fff;color:#333;border-right:1px solid #fff}#cooked-settings-tabs{background:#454b52}#cooked-settings-tabs a{color:#fff;text-decoration:none}#cooked-settings-tabs li{background:#454b52;color:#fff;color:rgba(255,255,255,.75)}#cooked-settings-tabs li:hover{background:#535a62;color:#fff}#cooked-settings-tabs li.active{background:#fff}#cooked-settings-tabs li.active a{color:#000}#cooked-directions-builder .cooked-direction-block>.cooked-direction-image .cooked-direction-img-placeholder,#cooked-migration-progress.cooked-progress .cooked-progress-bar,#cooked-related-progress.cooked-progress .cooked-progress-bar,#cooked_recipe_settings .cooked-select-wrapper:before,#cooked_recipe_settings .cooked-tooltip-icon,#cooked_recipe_settings select{-webkit-transition:all .15s ease-out;-moz-transition:all .15s ease-out;transition:all .15s ease-out}#cooked-recipe-image-gallery .cooked-recipe-gallery-item{-webkit-transition:transform .15s ease-out;-moz-transition:all .15s ease-out;transition:transform .15s ease-out}#cooked-recipe-tabs li.cooked-loading{-webkit-transition:opacity .15s ease-out;-moz-transition:all .15s ease-out;transition:opacity .15s ease-out}@-webkit-keyframes cooked-wiggle{0%{-webkit-transform:scale(1)}50%{-webkit-transform:scale(1.03)}100%{-webkit-transform:scale(1)}}@-moz-keyframes cooked-wiggle{0%{-moz-transform:scale(1)}50%{-moz-transform:scale(1.03)}100%{-moz-transform:scale(1)}}@-o-keyframes cooked-wiggle{0%{-o-transform:scale(1)}50%{-o-transform:scale(1.03)}100%{-o-transform:scale(1)}}@keyframes cooked-wiggle{0%{transform:scale(1)}50%{transform:scale(1.03)}100%{transform:scale(1)}}@media screen and (max-width:1150px){#cooked-recipe-tabs li{font-size:.8rem;padding:0 1.2rem 0 .7rem}#cooked-recipe-tabs li .cooked-icon{display:none}}@media screen and (max-width:768px){#cooked_recipe_settings .cooked-clearfix:has(>.cooked-setting-column-14){display:grid;grid-template-columns:1fr 1fr;gap:10px}#cooked_recipe_settings .cooked-setting-column-14{width:100%;float:none;padding-right:0}#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{width:60%}}@media screen and (max-width:600px){#cooked-recipe-tabs{top:0}#cooked_recipe_settings .recipe-setting-block h3.cooked-settings-title{display:flex;flex-wrap:wrap;align-items:center;row-gap:10px}#cooked_recipe_settings .recipe-setting-block:has(#cooked-nutrition-label) .cooked-setting-column-12{width:100%;float:none;padding-right:0}#cooked_recipe_settings .recipe-setting-block:has(#cooked-nutrition-label) p.cooked-measurement-inputs{display:flex;gap:10px}#cooked_recipe_settings .recipe-setting-block:has(#cooked-nutrition-label) p.cooked-measurement-inputs .cooked-measurement-column{width:50%;margin-right:0;flex:1}#cooked-ingredients-builder .cooked-ingredient-block{display:grid;grid-template-columns:1fr 1fr;column-gap:8px;row-gap:4px;padding-left:30px;padding-right:35px}#cooked-ingredients-builder .cooked-ingredient-block>div{display:block;float:none;padding-right:0}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-amount{width:auto;grid-column:1}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-measurement{width:auto;grid-column:2}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-ingredient-name{width:auto;grid-column:1/-1;padding-right:40px}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields{width:auto;float:none;clear:none;grid-column:1/-1}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-heading-name{grid-column:1/-1}#cooked_recipe_settings .cooked-ingredient-headers{display:grid;grid-template-columns:1fr 1fr;padding-left:30px;padding-right:35px}#cooked_recipe_settings .cooked-ingredient-headers span{display:block;float:none}#cooked_recipe_settings .cooked-layout-save-default{margin:0}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-amount{width:auto}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-measurement{width:auto}#cooked_recipe_settings .cooked-ingredient-headers span.cooked-ingredient-header-item{width:auto;grid-column:1/-1;padding-top:2px}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields{display:grid;grid-template-columns:1fr 1fr;column-gap:8px;row-gap:4px}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields>div{display:block;float:none;padding-right:0}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-ingredient-amount,#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-ingredient-measurement{width:100%;display:block}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-ingredient-name{width:auto;grid-column:1/-1;padding-top:0}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded>.cooked-substitution-fields .cooked-sub-label{grid-column:1/-1}#cooked-ingredients-builder .cooked-ingredient-block{position:relative}#cooked-ingredients-builder .cooked-ingredient-block .cooked-show-substitution{top:60px;right:42px}#cooked-ingredients-builder .cooked-ingredient-block.cooked-expanded .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block.cooked-has-substitution .cooked-show-substitution,#cooked-ingredients-builder .cooked-ingredient-block:hover .cooked-show-substitution{right:42px}#cooked-ingredients-builder .cooked-ingredient-block .cooked-delete-ingredient{right:11px}}@media screen and (max-width:500px){#cooked_recipe_settings .cooked-clearfix:has(>.cooked-setting-column-14){grid-template-columns:1fr}}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields{width:100%;float:left;clear:both;margin-top:10px;padding-top:10px;padding-right:0;padding-left:0;margin-left:0;box-sizing:border-box;padding-bottom:5px;position:relative}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-ingredient-amount{width:15%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-ingredient-measurement{width:20%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-ingredient-name{width:65%}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields .cooked-sub-label{color:#7c7c7c;font-size:14px;font-weight:300}#cooked-ingredients-builder .cooked-ingredient-block>.cooked-substitution-fields>div{display:inline-block;float:left;box-sizing:border-box;padding-right:10px}.cooked-bulk-add-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:100100;display:flex;align-items:center;justify-content:center}.cooked-bulk-add-modal{background:#fff;border-radius:6px;width:600px;max-width:90vw;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 5px 30px rgba(0,0,0,.3)}.cooked-bulk-add-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #ddd}.cooked-bulk-add-header h2{margin:0;font-size:18px;line-height:1.3}.cooked-bulk-add-close{font-size:24px;text-decoration:none;color:#666;line-height:1;padding:0 4px}.cooked-bulk-add-close:hover{color:#d63638}.cooked-bulk-add-body{padding:20px;overflow-y:auto;flex:1}.cooked-bulk-add-help{margin-top:0;color:#666;font-size:13px}#cooked-bulk-add-textarea{width:100%;min-height:160px;font-size:14px;padding:10px;box-sizing:border-box;resize:vertical}.cooked-bulk-add-preview{margin-top:16px}.cooked-bulk-add-preview-label{margin:0 0 8px;font-size:13px}.cooked-bulk-add-preview-notice-ingredients{display:none;margin:10px 0 0;font-size:12px;line-height:1.45;color:#b45309;font-weight:700;gap:6px;align-items:flex-start}#cooked-bulk-add-preview[data-bulk-type=ingredients] .cooked-bulk-add-preview-notice-ingredients{display:flex}.cooked-bulk-add-preview-notice-mark{flex-shrink:0;font-weight:700;line-height:1.45;color:#b45309}.cooked-bulk-add-preview-notice-text{flex:1;min-width:0;font-weight:700;color:#b45309}.cooked-bulk-add-preview-list{max-height:200px;overflow-y:auto;border:1px solid #ddd;border-radius:4px;padding:4px}.cooked-bulk-add-preview-row{display:flex;align-items:center;gap:8px;padding:4px 6px;border-bottom:1px solid #f0f0f0}.cooked-bulk-add-preview-row:last-child{border-bottom:0}.cooked-bulk-add-heading-toggle{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:12px;color:#666;cursor:pointer;flex-shrink:0}.cooked-bulk-add-heading-toggle input[type=checkbox]{margin:0}.cooked-bulk-add-preview-text{flex:1;border:1px solid #ddd;border-radius:3px;padding:4px 8px;font-size:13px}.cooked-bulk-add-preview-row:not(.cooked-bulk-add-preview-row-ingredient).cooked-bulk-add-is-heading .cooked-bulk-add-preview-text{font-weight:700}.cooked-bulk-add-preview-row-ingredient .cooked-bulk-add-heading-line-wrap{display:none;flex:1;align-items:center;gap:8px;min-width:0}.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-heading-line-wrap{display:flex}.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-parsed-amount,.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-parsed-name,.cooked-bulk-add-preview-row-ingredient.cooked-bulk-add-is-heading .cooked-bulk-add-parsed-unit{display:none}.cooked-bulk-add-heading-line-label{flex-shrink:0;font-size:12px;font-weight:600;color:#666}.cooked-bulk-add-preview-row-ingredient .cooked-bulk-add-heading-line-wrap .cooked-bulk-add-preview-text{flex:1;min-width:0;border:1px solid #ddd;border-radius:3px;padding:4px 8px;font-size:13px;font-weight:600}.cooked-bulk-add-preview-header{display:flex;align-items:center;gap:8px;padding:4px 6px 6px;border-bottom:1px solid #ddd;font-size:11px;font-weight:600;color:#999;text-transform:uppercase;letter-spacing:.5px}.cooked-bulk-add-col-heading{flex-shrink:0;width:108px}.cooked-bulk-add-col-amount{width:72px;flex-shrink:0}.cooked-bulk-add-col-unit{width:108px;flex-shrink:0}.cooked-bulk-add-col-name{flex:1}.cooked-bulk-add-parsed-amount{width:72px;flex-shrink:0;border:1px solid #ddd;border-radius:3px;padding:4px 6px;font-size:13px;text-align:center}.cooked-bulk-add-parsed-unit{width:108px;flex-shrink:0;border:1px solid #ddd;border-radius:3px;padding:4px 6px;font-size:13px}.cooked-bulk-add-parsed-name{flex:1;border:1px solid #ddd;border-radius:3px;padding:4px 6px;font-size:13px}.cooked-bulk-add-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid #ddd}.cooked-bulk-add-footer .button,.cooked-bulk-add-footer .button.button-primary{float:none;margin:0;vertical-align:middle}.cooked-bulk-add-spinner{float:none!important;margin:0!important}#cooked_allergens .cooked-allergens-checkboxes{display:flex;flex-direction:column;gap:8px}#cooked_allergens .cooked-allergen-checkbox{display:flex;align-items:center;gap:8px;cursor:pointer}#cooked_allergens .cooked-allergen-checkbox input[type=checkbox]{margin:0}#cooked_allergens .cooked-allergen{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}#cooked_allergens .cooked-allergen .cooked-icon{font-size:1.5rem;line-height:1}#cooked_allergens .cooked-allergen,#cooked_allergens .cooked-allergen .cooked-icon{color:rgba(0,0,0,.4)}#cooked_allergens .cooked-allergen-label{font-size:13px;color:#333} \ No newline at end of file diff --git a/assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.css b/assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.css deleted file mode 100644 index 42bb60d..0000000 --- a/assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.css +++ /dev/null @@ -1,110 +0,0 @@ -.tooltipster-sidetip.tooltipster-light .tooltipster-box { - border-radius: 3px; - border: 1px solid #cccccc; - background: #fff; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-content { - color: #666666; - padding: 15px 18px; - font-size: 12px; - line-height: 1.6; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-arrow { - height: 9px; - margin-left: -9px; - width: 18px; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow, -.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow { - height: 18px; - margin-left: 0; - margin-top: -9px; - width: 9px; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-arrow-background { - border: 9px solid transparent; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-background { - border-bottom-color: #fff; - top: 1px; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-background { - border-left-color: #fff; - left: -1px; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-background { - border-right-color: #fff; - left: 1px; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-background { - border-top-color: #fff; - top: -1px; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-arrow-border { - border: 9px solid transparent; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-border { - border-bottom-color: #cccccc; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-border { - border-left-color: #cccccc; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-border { - border-right-color: #cccccc; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-border { - border-top-color: #cccccc; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-uncropped { - top: -9px; -} - -.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-uncropped { - left: -9px; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-content strong { - color:#07a780; - display:block; - margin:0 0 2px; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-content strong.cooked-tooltip-heading { - display:block; - font-size:15px; - margin:0 0 5px; - white-space:nowrap; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-content .cooked-tooltip-buttons { - display:block; - padding:12px 0 5px; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-content pre { - padding:5px; - background:#f5f5f5; - color:#888; -} - -.tooltipster-sidetip.tooltipster-light .tooltipster-content input[type="text"] { - display:block; - width:100%; - margin:5px 0 20px; - font-size:12px; -} -.tooltip_templates { display: none; } \ No newline at end of file diff --git a/assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.min.css b/assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.min.css deleted file mode 100644 index f973877..0000000 --- a/assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.min.css +++ /dev/null @@ -1 +0,0 @@ -.tooltipster-sidetip.tooltipster-light .tooltipster-box{border-radius:3px;border:1px solid #ccc;background:#fff}.tooltipster-sidetip.tooltipster-light .tooltipster-content{color:#666;padding:15px 18px;font-size:12px;line-height:1.6}.tooltipster-sidetip.tooltipster-light .tooltipster-arrow{height:9px;margin-left:-9px;width:18px}.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow,.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow{height:18px;margin-left:0;margin-top:-9px;width:9px}.tooltipster-sidetip.tooltipster-light .tooltipster-arrow-background{border:9px solid transparent}.tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-background{border-bottom-color:#fff;top:1px}.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-background{border-left-color:#fff;left:-1px}.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-background{border-right-color:#fff;left:1px}.tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-background{border-top-color:#fff;top:-1px}.tooltipster-sidetip.tooltipster-light .tooltipster-arrow-border{border:9px solid transparent}.tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#ccc}.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-border{border-left-color:#ccc}.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-border{border-right-color:#ccc}.tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-border{border-top-color:#ccc}.tooltipster-sidetip.tooltipster-light.tooltipster-bottom .tooltipster-arrow-uncropped{top:-9px}.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-uncropped{left:-9px}.tooltipster-sidetip.tooltipster-light .tooltipster-content strong{color:#07a780;display:block;margin:0 0 2px}.tooltipster-sidetip.tooltipster-light .tooltipster-content strong.cooked-tooltip-heading{display:block;font-size:15px;margin:0 0 5px;white-space:nowrap}.tooltipster-sidetip.tooltipster-light .tooltipster-content .cooked-tooltip-buttons{display:block;padding:12px 0 5px}.tooltipster-sidetip.tooltipster-light .tooltipster-content pre{padding:5px;background:#f5f5f5;color:#888}.tooltipster-sidetip.tooltipster-light .tooltipster-content input[type=text]{display:block;width:100%;margin:5px 0 20px;font-size:12px}.tooltip_templates{display:none} \ No newline at end of file diff --git a/assets/admin/css/tooltipster/tooltipster.bundle.min.css b/assets/admin/css/tooltipster/tooltipster.bundle.min.css deleted file mode 100644 index d8f30fe..0000000 --- a/assets/admin/css/tooltipster/tooltipster.bundle.min.css +++ /dev/null @@ -1 +0,0 @@ -.tooltipster-fall,.tooltipster-grow.tooltipster-show{-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1);-moz-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-ms-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-o-transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-base{display:flex;pointer-events:none;position:absolute}.tooltipster-box{flex:1 1 auto}.tooltipster-content{box-sizing:border-box;max-height:100%;max-width:100%;overflow:auto}.tooltipster-ruler{bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;visibility:hidden}.tooltipster-fade{opacity:0;-webkit-transition-property:opacity;-moz-transition-property:opacity;-o-transition-property:opacity;-ms-transition-property:opacity;transition-property:opacity}.tooltipster-fade.tooltipster-show{opacity:1}.tooltipster-grow{-webkit-transform:scale(0,0);-moz-transform:scale(0,0);-o-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0);-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-backface-visibility:hidden}.tooltipster-grow.tooltipster-show{-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1);-ms-transform:scale(1,1);transform:scale(1,1);-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-swing{opacity:0;-webkit-transform:rotateZ(4deg);-moz-transform:rotateZ(4deg);-o-transform:rotateZ(4deg);-ms-transform:rotateZ(4deg);transform:rotateZ(4deg);-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform}.tooltipster-swing.tooltipster-show{opacity:1;-webkit-transform:rotateZ(0);-moz-transform:rotateZ(0);-o-transform:rotateZ(0);-ms-transform:rotateZ(0);transform:rotateZ(0);-webkit-transition-timing-function:cubic-bezier(.23,.635,.495,1);-webkit-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);-moz-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);-ms-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);-o-transition-timing-function:cubic-bezier(.23,.635,.495,2.4);transition-timing-function:cubic-bezier(.23,.635,.495,2.4)}.tooltipster-fall{-webkit-transition-property:top;-moz-transition-property:top;-o-transition-property:top;-ms-transition-property:top;transition-property:top;-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-fall.tooltipster-initial{top:0!important}.tooltipster-fall.tooltipster-dying{-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;-ms-transition-property:all;transition-property:all;top:0!important;opacity:0}.tooltipster-slide{-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;-ms-transition-property:left;transition-property:left;-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1);-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-moz-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-ms-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);-o-transition-timing-function:cubic-bezier(.175,.885,.32,1.15);transition-timing-function:cubic-bezier(.175,.885,.32,1.15)}.tooltipster-slide.tooltipster-initial{left:-40px!important}.tooltipster-slide.tooltipster-dying{-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;-ms-transition-property:all;transition-property:all;left:0!important;opacity:0}@keyframes tooltipster-fading{0%{opacity:0}100%{opacity:1}}.tooltipster-update-fade{animation:tooltipster-fading .4s}@keyframes tooltipster-rotating{25%{transform:rotate(-2deg)}75%{transform:rotate(2deg)}100%{transform:rotate(0)}}.tooltipster-update-rotate{animation:tooltipster-rotating .6s}@keyframes tooltipster-scaling{50%{transform:scale(1.1)}100%{transform:scale(1)}}.tooltipster-update-scale{animation:tooltipster-scaling .6s}.tooltipster-sidetip .tooltipster-box{background:#565656;border:2px solid #000;border-radius:4px}.tooltipster-sidetip.tooltipster-bottom .tooltipster-box{margin-top:8px}.tooltipster-sidetip.tooltipster-left .tooltipster-box{margin-right:8px}.tooltipster-sidetip.tooltipster-right .tooltipster-box{margin-left:8px}.tooltipster-sidetip.tooltipster-top .tooltipster-box{margin-bottom:8px}.tooltipster-sidetip .tooltipster-content{color:#fff;line-height:18px;padding:6px 14px}.tooltipster-sidetip .tooltipster-arrow{overflow:hidden;position:absolute}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow{height:10px;margin-left:-10px;top:0;width:20px}.tooltipster-sidetip.tooltipster-left .tooltipster-arrow{height:20px;margin-top:-10px;right:0;top:0;width:10px}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow{height:20px;margin-top:-10px;left:0;top:0;width:10px}.tooltipster-sidetip.tooltipster-top .tooltipster-arrow{bottom:0;height:10px;margin-left:-10px;width:20px}.tooltipster-sidetip .tooltipster-arrow-background,.tooltipster-sidetip .tooltipster-arrow-border{height:0;position:absolute;width:0}.tooltipster-sidetip .tooltipster-arrow-background{border:10px solid transparent}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-background{border-bottom-color:#565656;left:0;top:3px}.tooltipster-sidetip.tooltipster-left .tooltipster-arrow-background{border-left-color:#565656;left:-3px;top:0}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-background{border-right-color:#565656;left:3px;top:0}.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-background{border-top-color:#565656;left:0;top:-3px}.tooltipster-sidetip .tooltipster-arrow-border{border:10px solid transparent;left:0;top:0}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#000}.tooltipster-sidetip.tooltipster-left .tooltipster-arrow-border{border-left-color:#000}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-border{border-right-color:#000}.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-border{border-top-color:#000}.tooltipster-sidetip .tooltipster-arrow-uncropped{position:relative}.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-uncropped{top:-10px}.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-uncropped{left:-10px} \ No newline at end of file diff --git a/assets/admin/js/cooked-functions.js b/assets/admin/js/cooked-functions.js index b1e1558..109b0df 100644 --- a/assets/admin/js/cooked-functions.js +++ b/assets/admin/js/cooked-functions.js @@ -146,98 +146,173 @@ var cookedSortableTouchHandler = function(event) { } } - // Save as Default + // Save as Default (click-toggle popover anchored to the button, see #cooked-save-default-panel) if ($_CookedRecipeSaveDefault.length) { - var saveDefaultTooltip = $_CookedRecipeSaveDefault.tooltipster({ - theme : ['tooltipster-light', 'tooltipster-sideTip-cooked'], - trigger : 'click', - animation : 'grow', - delay : 0, - speed : 200, - maxWidth : 275, - contentAsHTML : true, - interactive : true, - functionReady: function(instance, helper) { - $('.cooked-save-default-all').on('click', function(e) { - e.preventDefault(); + var $_CookedSaveDefaultPanel = $('#cooked-save-default-panel'), + saveDefaultPanelArrow = $('
').appendTo($_CookedSaveDefaultPanel)[0], + saveDefaultPanelFloating = !!(window.FloatingUICore && window.FloatingUIDOM), + saveDefaultPanelCleanup = null; + + // With Floating UI the panel grows open like the tooltips: it becomes the + // positioned shell and its contents (arrow included) move into the bubble. + if (saveDefaultPanelFloating) { + $_CookedSaveDefaultPanel.addClass('cooked-tooltip-shell').wrapInner('
'); + } + + // While closing, the panel is still visible but already counts as closed. + var cooked_save_default_panel_is_open = function() { + if (!$_CookedSaveDefaultPanel.length) { + return false; + } + return saveDefaultPanelFloating ? $_CookedSaveDefaultPanel.hasClass('cooked-tooltip-open') : !$_CookedSaveDefaultPanel.prop('hidden'); + }; + + var cooked_toggle_save_default_panel = function(show) { + if (!$_CookedSaveDefaultPanel.length) { + return; + } + + var reference = $_CookedRecipeSaveDefault[0], + panel = $_CookedSaveDefaultPanel[0]; - var thisButton = $(this), - cooked_save_default_nonce = thisButton.data('nonce'), - cooked_save_default_bulk_nonce = thisButton.data('bulk-nonce'), - thisContainer = thisButton.parent(), - confirm_save = confirm(cooked_admin_functions_js_vars.i18n_confirm_save_default_all), - recipe_editor_textarea = $( "#_recipe_settings_content" ), - recipe_editor = tinymce.get('_recipe_settings_content'); - - if (recipe_editor === null) { - var recipe_editor_content = recipe_editor_textarea.val(); - } else { - var recipe_editor_content = recipe_editor.getContent(); + $_CookedRecipeSaveDefault.attr('aria-expanded', show ? 'true' : 'false'); + + // Without Floating UI the panel opens and closes instantly, in the normal flow. + if (!saveDefaultPanelFloating) { + panel.hidden = !show; + return; + } + + if (show) { + panel.hidden = false; + if (!saveDefaultPanelCleanup) { + saveDefaultPanelCleanup = window.FloatingUIDOM.autoUpdate(reference, panel, function() { + cooked_position_floating(reference, panel, saveDefaultPanelArrow, ['top', 'bottom'], function() { + return !panel.hidden; + }); + }); + } + cooked_grow_open(panel); + } else if (cooked_save_default_panel_is_open()) { + // Keep positioning while it scales down, then hide. + cooked_grow_close(panel, function() { + if (saveDefaultPanelCleanup) { + saveDefaultPanelCleanup(); + saveDefaultPanelCleanup = null; } + panel.hidden = true; + }); + } + }; + + $_CookedRecipeSaveDefault.on('click', function(e) { + e.preventDefault(); + cooked_toggle_save_default_panel(!cooked_save_default_panel_is_open()); + }); - if (confirm_save && !thisButton.hasClass('disabled')) { - thisContainer.find('.button, .button-primary').addClass('disabled'); + $_CookedRecipeSaveDefault.on('keydown', function(e) { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + cooked_toggle_save_default_panel(!cooked_save_default_panel_is_open()); + } + }); + $(document).on('click', function(e) { + if (!cooked_save_default_panel_is_open()) { + return; + } + + if (!$(e.target).closest('.cooked-layout-save-default, #cooked-save-default-panel').length) { + cooked_toggle_save_default_panel(false); + } + }); + + $(document).on('keydown', function(e) { + if (e.key === 'Escape' && cooked_save_default_panel_is_open()) { + cooked_toggle_save_default_panel(false); + $_CookedRecipeSaveDefault.focus(); + } + }); + + // Save as Default panel buttons. + $('.cooked-save-default-all').on('click', function(e) { + e.preventDefault(); + + var thisButton = $(this), + cooked_save_default_nonce = thisButton.data('nonce'), + cooked_save_default_bulk_nonce = thisButton.data('bulk-nonce'), + thisContainer = thisButton.parent(), + confirm_save = confirm(cooked_admin_functions_js_vars.i18n_confirm_save_default_all), + recipe_editor_textarea = $( "#_recipe_settings_content" ), + recipe_editor = tinymce.get('_recipe_settings_content'); + + if (recipe_editor === null) { + var recipe_editor_content = recipe_editor_textarea.val(); + } else { + var recipe_editor_content = recipe_editor.getContent(); + } + + if (confirm_save && !thisButton.hasClass('disabled')) { + thisContainer.find('.button, .button-primary').addClass('disabled'); + + $.post( + cooked_admin_functions_js_vars.ajax_url, + { + action: 'cooked_save_default', + 'default_content': recipe_editor_content, + nonce: cooked_save_default_nonce + }, + function() { $.post( cooked_admin_functions_js_vars.ajax_url, { - action: 'cooked_save_default', - 'default_content': recipe_editor_content, - nonce: cooked_save_default_nonce + action: 'cooked_get_recipe_count', + nonce: cooked_save_default_bulk_nonce + }, + function(response) { + thisButton.removeClass("button-primary").addClass("button"); + + if (response && response.success && response.data.total > 0) { + cooked_recipe_update_counter = 0; + cooked_set_default_template(0, response.data.total, recipe_editor_content, cooked_save_default_bulk_nonce); + } }, - function() { - $.post( - cooked_admin_functions_js_vars.ajax_url, - { - action: 'cooked_get_recipe_count', - nonce: cooked_save_default_bulk_nonce - }, - function(response) { - thisButton.removeClass("button-primary").addClass("button"); - - if (response && response.success && response.data.total > 0) { - cooked_recipe_update_counter = 0; - cooked_set_default_template(0, response.data.total, recipe_editor_content, cooked_save_default_bulk_nonce, instance); - } - }, - 'json' - ); - } + 'json' ); } - }); + ); + } + }); - $('.cooked-save-default-new').on('click', function(e) { - e.preventDefault(); - var thisButton = $(this), - nonce = thisButton.data('nonce'), - thisContainer = thisButton.parent(), - recipe_editor_textarea = $("#_recipe_settings_content"), - recipe_editor = tinymce.get('_recipe_settings_content'); - - if (recipe_editor === null) { - var recipe_editor_content = recipe_editor_textarea.val(); - } else { - var recipe_editor_content = recipe_editor.getContent(); - } + $('.cooked-save-default-new').on('click', function(e) { + e.preventDefault(); + var thisButton = $(this), + nonce = thisButton.data('nonce'), + thisContainer = thisButton.parent(), + recipe_editor_textarea = $("#_recipe_settings_content"), + recipe_editor = tinymce.get('_recipe_settings_content'); - if (!thisButton.hasClass('disabled')) { - thisContainer.find('.button, .button-primary').addClass('disabled'); - var ajax__save_default_new = $.post( - cooked_admin_functions_js_vars.ajax_url, - { - action: 'cooked_save_default', - 'default_content': recipe_editor_content, - nonce: nonce - }, - function(result) { - thisButton.text( cooked_admin_functions_js_vars.i18n_saved ); - thisContainer.find('.button-primary').removeClass('disabled'); - } - ).fail(function(result) { - //console.log( 'Error: ' + result ); - }); + if (recipe_editor === null) { + var recipe_editor_content = recipe_editor_textarea.val(); + } else { + var recipe_editor_content = recipe_editor.getContent(); + } + + if (!thisButton.hasClass('disabled')) { + thisContainer.find('.button, .button-primary').addClass('disabled'); + var ajax__save_default_new = $.post( + cooked_admin_functions_js_vars.ajax_url, + { + action: 'cooked_save_default', + 'default_content': recipe_editor_content, + nonce: nonce + }, + function(result) { + thisButton.text( cooked_admin_functions_js_vars.i18n_saved ); + thisContainer.find('.button-primary').removeClass('disabled'); } + ).fail(function(result) { + //console.log( 'Error: ' + result ); }); } }); @@ -281,17 +356,164 @@ var cookedSortableTouchHandler = function(event) { }); } - // Cooked Tooltips - if ($_CookedTooltips.length){ - $_CookedTooltips.tooltipster({ - theme : ['tooltipster-light', 'tooltipster-sideTip-cooked'], - animation : 'grow', - delay : 100, - speed : 200, - maxWidth : 275, - contentAsHTML : true, - interactive : true - }); + // Cooked Tooltips (Floating UI, vendored — see assets/vendor/floating-ui/README.md). + // .cooked-tooltip elements carry their (HTML) content in data-tooltip and an optional + // comma-separated placement preference in data-positions, e.g. "top,bottom". + // Handlers are delegated, so one setup covers present and future elements. + if ($_CookedTooltips.length && window.FloatingUICore && window.FloatingUIDOM) { + // One shared tooltip: an outer shell that Floating UI positions and an inner + // bubble (content and arrow) that grows open and closed. + // tooltipReference is the trigger the tooltip is for; tooltipAnchor is the one + // it is placed against, which outlives the reference while the close plays. + var FloatingUI = window.FloatingUIDOM, + tooltip = document.createElement('div'), + tooltipBubble = document.createElement('div'), + tooltipContent = document.createElement('div'), + tooltipArrow = document.createElement('div'), + tooltipReference = null, + tooltipAnchor = null, + tooltipDescribedBy = null, + tooltipReasons = {}, + tooltipOpenTimer = null, + tooltipCleanup = null; + + tooltip.id = 'cooked-tooltip-floating'; + tooltip.className = 'cooked-tooltip-floating'; + tooltip.setAttribute('role', 'tooltip'); + tooltip.hidden = true; + tooltipBubble.className = 'cooked-tooltip-bubble'; + tooltipArrow.className = 'cooked-tooltip-arrow'; + tooltipBubble.appendChild(tooltipContent); + tooltipBubble.appendChild(tooltipArrow); + tooltip.appendChild(tooltipBubble); + document.body.appendChild(tooltip); + + var tooltipPlacements = function(el) { + var placements = []; + String(el.getAttribute('data-positions') || '').split(',').forEach(function(placement) { + placement = placement.trim().toLowerCase(); + if (/^(top|right|bottom|left)(-start|-end)?$/.test(placement) && placements.indexOf(placement) === -1) { + placements.push(placement); + } + }); + return placements.length ? placements : ['bottom']; + }; + + var finishHideTooltip = function() { + if (tooltipCleanup) { + tooltipCleanup(); + tooltipCleanup = null; + } + tooltipAnchor = null; + tooltip.hidden = true; + }; + + // animate: grow closed (hover/focus leaving, Escape). Otherwise hide at once, + // cancelling any open or close in progress. + var hideTooltip = function(animate) { + clearTimeout(tooltipOpenTimer); + tooltipOpenTimer = null; + if (tooltipReference) { + if (tooltipDescribedBy === null) { + tooltipReference.removeAttribute('aria-describedby'); + } else { + tooltipReference.setAttribute('aria-describedby', tooltipDescribedBy); + } + } + tooltipReference = null; + tooltipDescribedBy = null; + tooltipReasons = {}; + + if (!animate || !tooltipAnchor) { + cooked_grow_cancel(tooltip); + tooltip.classList.remove('cooked-tooltip-open'); + finishHideTooltip(); + } else if (tooltip.classList.contains('cooked-tooltip-open')) { + cooked_grow_close(tooltip, finishHideTooltip); + } + // Otherwise it is already closing. + }; + + var updateTooltip = function() { + var anchor = tooltipAnchor; + if (!anchor || !anchor.isConnected) { + hideTooltip(false); + return; + } + + cooked_position_floating(anchor, tooltip, tooltipArrow, tooltipPlacements(anchor), function() { + // A newer show/hide may have happened while this was computing. + return tooltipAnchor === anchor; + }); + }; + + var openTooltip = function(el) { + tooltipOpenTimer = null; + if (!el.isConnected) { + hideTooltip(false); + return; + } + tooltipContent.innerHTML = el.getAttribute('data-tooltip'); + tooltipAnchor = el; + tooltip.hidden = false; + if (!tooltipCleanup) { + tooltipCleanup = FloatingUI.autoUpdate(el, tooltip, updateTooltip); + } + cooked_grow_open(tooltip); + }; + + // Hover opens after 100ms (Tooltipster's delay); leaving sooner shows nothing. + // Focus opens at once. + var showTooltip = function(el, reason) { + var content = el.getAttribute('data-tooltip'); + if (!content) { + return; + } + tooltipReasons[reason] = true; + if (tooltipReference === el) { + if (tooltipOpenTimer && reason !== 'hover') { + clearTimeout(tooltipOpenTimer); + openTooltip(el); + } else if (!tooltipOpenTimer) { + tooltipContent.innerHTML = content; + } + return; + } + + hideTooltip(false); + tooltipReasons[reason] = true; + tooltipReference = el; + tooltipDescribedBy = el.getAttribute('aria-describedby'); + el.setAttribute('aria-describedby', tooltipDescribedBy ? tooltipDescribedBy + ' ' + tooltip.id : tooltip.id); + + if (reason === 'hover') { + tooltipOpenTimer = setTimeout(function() { openTooltip(el); }, 100); + } else { + openTooltip(el); + } + }; + + // Hover and focus each keep the tooltip open; it hides once neither does. + var releaseTooltip = function(el, reason) { + if (tooltipReference !== el) { + return; + } + delete tooltipReasons[reason]; + if ($.isEmptyObject(tooltipReasons)) { + hideTooltip(true); + } + }; + + $(document) + .on('mouseenter', '.cooked-tooltip[data-tooltip]', function() { showTooltip(this, 'hover'); }) + .on('mouseleave', '.cooked-tooltip[data-tooltip]', function() { releaseTooltip(this, 'hover'); }) + .on('focusin', '.cooked-tooltip[data-tooltip]', function() { showTooltip(this, 'focus'); }) + .on('focusout', '.cooked-tooltip[data-tooltip]', function() { releaseTooltip(this, 'focus'); }) + .on('keydown', function(e) { + if (e.key === 'Escape') { + hideTooltip(true); + } + }); } // Cooked Shortcode Fields @@ -893,8 +1115,91 @@ var cookedSortableTouchHandler = function(event) { var cooked_recipe_update_counter = 0; var cooked_bulk_per_page = 20; +/** + * Positions a floating element (tooltip or popover) next to its reference with + * Floating UI: first placement preferred, the rest as flip fallbacks. Sets + * data-placement on the floating element and moves its arrow to the right side. + * isCurrent() lets callers drop a result that arrives after they closed. + */ +function cooked_position_floating(reference, floating, arrow, placements, isCurrent) { + var FloatingUI = window.FloatingUIDOM, + arrowSides = { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }; + + return FloatingUI.computePosition(reference, floating, { + placement: placements[0], + strategy: 'fixed', + middleware: [ + FloatingUI.offset(10), + FloatingUI.flip({ fallbackPlacements: placements.length > 1 ? placements.slice(1) : undefined, padding: 4 }), + FloatingUI.shift({ padding: 4 }), + FloatingUI.arrow({ element: arrow, padding: 6 }) + ] + }).then(function(position) { + if (isCurrent && !isCurrent()) { + return; + } + var side = position.placement.split('-')[0], + arrowData = position.middlewareData.arrow || {}; + + floating.setAttribute('data-placement', side); + floating.style.left = position.x + 'px'; + floating.style.top = position.y + 'px'; + + arrow.style.left = arrowData.x != null ? arrowData.x + 'px' : ''; + arrow.style.top = arrowData.y != null ? arrowData.y + 'px' : ''; + arrow.style.right = ''; + arrow.style.bottom = ''; + arrow.style[arrowSides[side]] = '-6px'; + }); +} + +/** + * Grow animation for a floating shell (Tooltipster's "grow"): the shell's + * .cooked-tooltip-bubble scales from 0 to 1 via .cooked-tooltip-open (see the + * admin stylesheet). The shell must already be visible. Also used by Cooked Pro. + */ +function cooked_grow_open(shell) { + cooked_grow_cancel(shell); + shell.classList.remove('cooked-tooltip-open'); + void shell.offsetWidth; // Commit scale(0) so the transition plays. + shell.classList.add('cooked-tooltip-open'); +} + +/** + * Scales the bubble back down, then calls done() (on transitionend, or after + * 400ms if that never fires). cooked_grow_open() and cooked_grow_cancel() stop it. + */ +function cooked_grow_close(shell, done) { + var bubble = shell.querySelector('.cooked-tooltip-bubble'), + timer = null, + finish = function(e) { + if (e && (e.target !== bubble || e.propertyName !== 'transform')) { + return; + } + cooked_grow_cancel(shell); + done(); + }; + + cooked_grow_cancel(shell); + shell.classList.remove('cooked-tooltip-open'); + bubble.addEventListener('transitionend', finish); + timer = setTimeout(finish, 400); + shell.cookedGrowCancel = function() { + clearTimeout(timer); + bubble.removeEventListener('transitionend', finish); + shell.cookedGrowCancel = null; + }; +} + +/** Stops a pending cooked_grow_close() without calling its done(). */ +function cooked_grow_cancel(shell) { + if (shell.cookedGrowCancel) { + shell.cookedGrowCancel(); + } +} + /** Applies default recipe content in paginated AJAX batches and updates the progress UI. */ -function cooked_set_default_template(page, total_recipes, content, nonce, instance) { +function cooked_set_default_template(page, total_recipes, content, nonce) { if (total_recipes <= 0) { return; } @@ -907,7 +1212,6 @@ function cooked_set_default_template(page, total_recipes, content, nonce, instan progress.addClass('cooked-active'); progress_text.addClass('cooked-active'); progress_bar.css({ "width" : "0%" }); - instance.reposition(); } jQuery.post( @@ -927,15 +1231,13 @@ function cooked_set_default_template(page, total_recipes, content, nonce, instan progress_text.text(cooked_recipe_update_counter + " / " + total_recipes); if (response.data.has_more) { - cooked_set_default_template(page + 1, total_recipes, content, nonce, instance); + cooked_set_default_template(page + 1, total_recipes, content, nonce); } else { jQuery('.cooked-save-default-all').text(cooked_admin_functions_js_vars.i18n_applied); progress_bar.css({ "width" : "100%" }); progress_text.text(total_recipes + " / " + total_recipes); progress.removeClass('cooked-active'); progress_text.removeClass('cooked-active').text(""); - - instance.reposition(); } } }, diff --git a/assets/admin/js/cooked-functions.min.js b/assets/admin/js/cooked-functions.min.js index 4c73128..25c69e4 100644 --- a/assets/admin/js/cooked-functions.min.js +++ b/assets/admin/js/cooked-functions.min.js @@ -1 +1 @@ -var $_CookedConditionalTimeout=!1,cookedSortableTouchHandler=function(e){var t={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"},o=e.target.closest(".cooked-icon-drag");o&&o.closest(".cooked-sortable")&&e.changedTouches&&e.changedTouches.length&&t[e.type]&&(o=e.changedTouches[0],e.preventDefault(),t=new MouseEvent(t[e.type],{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null}),o.target.dispatchEvent(t))},cooked_recipe_update_counter=((g=>{g(document).ready(function(){var c,o,t,e,i,n,d,a,r,s,l,u=g(".cooked-color-field"),k=g("#cooked_recipe_settings").find("select"),p=g("#cooked-recipe-tabs"),_=(g("#cooked-settings-wrap"),g("#cooked_recipe_settings")),m=_.find("input#submit");$_CookedTooltips=g(".cooked-tooltip"),$_CookedConditionals=g(".cooked-conditional-hidden"),$_CookedSortable=g(".cooked-sortable"),$_CookedRecipeSaveDefault=g(".cooked-layout-save-default"),$_CookedShortcodeField=g(".cooked-shortcode-field"),$_CookedIngredientBuilder=g("#cooked-ingredients-builder"),$_CookedAutoNutritionButton=g(".cooked-auto-nutrition-button"),$_CookedDirectionBuilder=g("#cooked-directions-builder"),$_CookedRecipeGallery=g("#cooked-recipe-image-gallery"),$_CookedNutritionFactsTab=g("#cooked-recipe-tab-content-nutrition"),$_CookedSettingsPanel=g("#cooked-settings-panel"),$_CookedSettingsTabs=g("#cooked-settings-tabs"),u.length&&u.wpColorPicker(),$_CookedSortable.length&&(document.addEventListener("touchstart",cookedSortableTouchHandler,{passive:!1}),document.addEventListener("touchmove",cookedSortableTouchHandler,{passive:!1}),document.addEventListener("touchend",cookedSortableTouchHandler,{passive:!1}),$_CookedSortable.find(".cooked-icon-drag").length?$_CookedSortable.sortable({handle:".cooked-icon-drag",stop:function(e,t){t.item.closest("#cooked-directions-builder").length&&cooked_reset_direction_builder();var t=t.item.find("textarea"),o=!(!cooked_admin_functions_js_vars.wp_editor_roles_allowed||"undefined"==typeof wp||!wp.editor||"function"!=typeof wp.editor.remove||"function"!=typeof wp.editor.initialize);t.length&&o&&(o=t.attr("name"),t=t.attr("id"),wp.editor.remove(t),wp.editor.initialize(t,{tinymce:{wpautop:!1,toolbar1:"bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,wp_link_advanced,unlink,fullscreen",toolbar2:"",toolbar3:"",toolbar4:"",height:100,textarea_name:o,plugins:"link lists fullscreen wordpress wplink",setup:function(e){}},quicktags:!0,mediaButtons:!1}))}}):$_CookedSortable.sortable({stop:function(e,t){t.item.closest("#cooked-directions-builder").length&&cooked_reset_direction_builder()}})),$_CookedRecipeSaveDefault.length&&($_CookedRecipeSaveDefault.tooltipster({theme:["tooltipster-light","tooltipster-sideTip-cooked"],trigger:"click",animation:"grow",delay:0,speed:200,maxWidth:275,contentAsHTML:!0,interactive:!0,functionReady:function(r,e){g(".cooked-save-default-all").on("click",function(e){e.preventDefault();var t,o=g(this),e=o.data("nonce"),i=o.data("bulk-nonce"),n=o.parent(),d=confirm(cooked_admin_functions_js_vars.i18n_confirm_save_default_all),a=g("#_recipe_settings_content"),c=tinymce.get("_recipe_settings_content");t=null===c?a.val():c.getContent(),d&&!o.hasClass("disabled")&&(n.find(".button, .button-primary").addClass("disabled"),g.post(cooked_admin_functions_js_vars.ajax_url,{action:"cooked_save_default",default_content:t,nonce:e},function(){g.post(cooked_admin_functions_js_vars.ajax_url,{action:"cooked_get_recipe_count",nonce:i},function(e){o.removeClass("button-primary").addClass("button"),e&&e.success&&0')}),$_CookedTooltips.length&&$_CookedTooltips.tooltipster({theme:["tooltipster-light","tooltipster-sideTip-cooked"],animation:"grow",delay:100,speed:200,maxWidth:275,contentAsHTML:!0,interactive:!0}),$_CookedShortcodeField.length&&$_CookedShortcodeField.on("click",function(e){g(this).select()}),$_CookedConditionals.length&&(c=[],$_CookedConditionals.each(function(){var e=g(this),t=g(this).data("condition"),o=g(this).data("value"),i=g("#"+t),o=!!o&&o.split(" "),n=e.is("li")||e.is("span")?"inline-block":"block";i.is(":checkbox")&&i.is(":checked")||i.is(":radio")&&i.is(":checked")||!(i.is(":checkbox")&&!i.is(":checked")||i.is(":radio")&&!i.is(":checked"))&&(!i.is(":checkbox")&&!o&&i.val()||!i.is(":checkbox")&&o&&-1 a").attr("href")).split("#"))[1],g(".cooked-settings-tab-content").hide(),g("#cooked-settings-tab-content-"+n).show(),k.on("click",function(e){g(".tab-content").hide();var t=g(this).find("a"),t=($_CookedSettingsTabs.find("li").removeClass("active"),g(this).addClass("active"),t.attr("href"));"migration"==(t=(t=t.split("#"))[1])?m.hide():m.show(),g(".cooked-settings-tab-content").hide(),g("#cooked-settings-tab-content-"+t).show(),g("#cooked-settings-panel").hasClass("stuck")?window.scrollTo(0,130):window.scrollTo(0,0)}),$_CookedSettingsPanel.on("click",".cooked-settings-image-remove",function(e){e.preventDefault();e=g(this).closest(".cooked-settings-image-field");e.removeClass("cooked-has-image"),e.find(".cooked-settings-image-preview-img").attr("src","").removeAttr("srcset").removeAttr("sizes"),e.find(".cooked-settings-image-input").val("0"),e.find(".cooked-settings-image-button").val(cooked_admin_functions_js_vars.i18n_image_title)}),$_CookedSettingsPanel.on("click",".cooked-settings-image-button",function(e){e.preventDefault();var o=g(this),i=o.closest(".cooked-settings-image-field");d&&d.off("select"),(d=wp.media({title:cooked_admin_functions_js_vars.i18n_image_title,button:{text:cooked_admin_functions_js_vars.i18n_image_button},library:{type:"image"}})).on("select",function(){var e=d.state().get("selection").first().toJSON(),t=(e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail:e).url;i.addClass("cooked-has-image"),i.find(".cooked-settings-image-preview-img").attr("src",t).removeAttr("srcset").removeAttr("sizes"),i.find(".cooked-settings-image-input").val(e.id),o.val(cooked_admin_functions_js_vars.i18n_image_change)}),d.open()})),$_CookedIngredientBuilder.length&&(cooked_reset_ingredient_builder(),$_CookedIngredientBuilder.on("keydown",'input[data-ingredient-part="name"]',function(e){9!==e.keyCode&&13!==e.keyCode||g(this).parents(".cooked-ingredient-block").is(":last-child")&&(e.preventDefault(),g("#cooked-recipe-tab-content-ingredients").find(".cooked-add-ingredient-button").trigger("click"),$_CookedIngredientBuilder.find('.cooked-ingredient-block:last-child input[data-ingredient-part="amount"]').focus())}),$_CookedIngredientBuilder.parent().on("click",".cooked-show-substitution",function(e){e.preventDefault();e=g(this).parent();e.hasClass("cooked-expanded")?e.removeClass("cooked-expanded"):(e.addClass("cooked-expanded"),e.find('input[data-ingredient-part="sub_amount"]').focus())}),$_CookedIngredientBuilder.on("keyup change",'input[data-ingredient-part="sub_amount"], input[data-ingredient-part="sub_name"], select[data-ingredient-part="sub_measurement"]',function(e){var t=g(this).parents(".recipe-setting-block"),o=t.find('input[data-ingredient-part="sub_name"]').val();o&&o.trim()?t.addClass("cooked-has-substitution"):t.removeClass("cooked-has-substitution")}),$_CookedAutoNutritionButton.length&&$_CookedIngredientBuilder.on("change",'input[data-ingredient-part="name"]',function(e){var t=!1;$_CookedIngredientBuilder.find('input[data-ingredient-part="name"]').each(function(){if(""!=g(this).val())return!(t=!0)}),t?$_CookedAutoNutritionButton.prop("disabled",!1):$_CookedAutoNutritionButton.prop("disabled",!0)}),$_CookedIngredientBuilder.on("keyup",'input[data-ingredient-part="url"]',function(e){var t=g(this).val(),o=g(this).parents(".recipe-setting-block");t?o.addClass("cooked-has-url"):o.removeClass("cooked-has-url")}),$_CookedIngredientBuilder.parent().on("click",".cooked-add-ingredient-button",function(e){e.preventDefault();e=$_CookedIngredientBuilder.parent().find(".cooked-ingredient-template").clone().removeClass("cooked-template cooked-ingredient-template").addClass("cooked-ingredient-block");$_CookedIngredientBuilder.append(e),cooked_reset_ingredient_builder()}),$_CookedIngredientBuilder.parent().on("click",".cooked-add-heading-button",function(e){e.preventDefault();e=$_CookedIngredientBuilder.parent().find(".cooked-heading-template").clone().removeClass("cooked-template cooked-heading-template").addClass("cooked-ingredient-block cooked-ingredient-heading");$_CookedIngredientBuilder.append(e),cooked_reset_ingredient_builder()}),$_CookedIngredientBuilder.parent().on("click",".cooked-delete-ingredient",function(e){e.preventDefault(),g(this).parent().remove(),cooked_reset_ingredient_builder()})),$_CookedDirectionBuilder.length&&(cooked_reset_direction_builder(),$_CookedDirectionBuilder.parent().on("click",".cooked-show-heading-element",function(e){e.preventDefault();e=g(this).parent();e.hasClass("cooked-expanded")?e.removeClass("cooked-expanded"):(e.addClass("cooked-expanded"),e.find('input[data-direction-part="section_heading_element"]').focus())}),$_CookedDirectionBuilder.parent().on("click",".cooked-add-direction-button",function(e){e.preventDefault();e=$_CookedDirectionBuilder.parent().find(".cooked-direction-template").clone().removeClass("cooked-template cooked-direction-template").addClass("cooked-direction-block");$_CookedDirectionBuilder.append(e),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".cooked-add-heading-button",function(e){e.preventDefault();e=$_CookedDirectionBuilder.parent().find(".cooked-heading-template").clone().removeClass("cooked-template cooked-heading-template").addClass("cooked-direction-block cooked-direction-heading");$_CookedDirectionBuilder.append(e),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".cooked-delete-direction",function(e){e.preventDefault();var t,e=g(this).parent();cooked_admin_functions_js_vars.wp_editor_roles_allowed&&"undefined"!=typeof wp&&wp.editor&&"function"==typeof wp.editor.remove&&(t=e.find('textarea[data-direction-part="content"]').attr("id"))&&wp.editor.remove(t),e.remove(),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".remove-image-button",function(e){e.preventDefault();e=g(this).parent();e.removeClass("cooked-has-image"),e.find("img").attr("src","").removeAttr("srcset").removeAttr("sizes"),e.find('input[data-direction-part="image"]').val(""),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".remove-video-button",function(e){e.preventDefault();e=g(this).parent();e.removeClass("cooked-has-video"),e.find(".cooked-direction-video-preview").attr("src",""),e.find('input[data-direction-part="video"]').val(""),e.find(".direction-video-button").prop("value",cooked_admin_functions_js_vars.i18n_video_title),cooked_reset_direction_builder()}),g("body").on("click",".cooked-direction-img-placeholder, .cooked-direction-img",function(e){e.preventDefault(),g(this).parent().find(".direction-image-button").trigger("click")}),g("body").on("click",".direction-image-button",function(e){var t=g(this);s=t.data("id"),e.preventDefault(),a||(a=wp.media.frames.direction_image_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_image_title,button:{text:cooked_admin_functions_js_vars.i18n_image_button},library:{type:"image"}})).on("select",function(){var e=a.state().get("selection").first().toJSON();g("#direction-"+s+"-image-src").attr("src",e.sizes.thumbnail.url).removeAttr("srcset").removeAttr("sizes").parent().addClass("cooked-has-image"),g('input[name="_recipe_settings[directions]['+s+'][image]"]').val(e.id),g('.direction-image-button[data-id="'+s+'"]').prop("value",cooked_admin_functions_js_vars.i18n_image_change)}),a.open()}),g("body").on("click",".cooked-direction-video-placeholder, .cooked-direction-video-preview",function(e){e.preventDefault(),g(this).parent().find(".direction-video-button").trigger("click")}),g("body").on("click",".direction-video-button",function(e){var t=g(this);s=t.data("id"),e.preventDefault(),r||(r=wp.media.frames.direction_video_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_video_title,button:{text:cooked_admin_functions_js_vars.i18n_video_button},library:{type:"video"}})).on("select",function(){var e=r.state().get("selection").first().toJSON(),t=g('.direction-video-button[data-id="'+s+'"]').closest(".cooked-direction-video");t.find(".cooked-direction-video-preview").attr("src",e.url),t.find('input[data-direction-part="video"]').val(e.id),t.addClass("cooked-has-video"),g('.direction-video-button[data-id="'+s+'"]').prop("value",cooked_admin_functions_js_vars.i18n_video_change)}),r.open()})),cooked_init_bulk_add(g),$_CookedRecipeGallery.length&&(cooked_init_gallery_sorting(),g("body").on("click",".cooked-gallery-add-button",function(e){g(this);e.preventDefault(),l||(l=wp.media.frames.gallery_images_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_gallery_image_title,button:{text:cooked_admin_functions_js_vars.i18n_gallery_image_title},library:{type:"image"},multiple:!0})).on("select",function(){var e,t,o,i=l.state().get("selection").toJSON();for(e in i)i.hasOwnProperty(e)&&(o=(t=i[e]).sizes.thumbnail.url,g("#cooked-recipe-image-gallery").append(''));cooked_init_gallery_sorting()}),l.open()}),g("body").on("click",".cooked-recipe-gallery-item img",function(e){e.preventDefault(),g(this).parent().find(".cooked-gallery-edit-button").trigger("click")}),g("body").on("click",".cooked-gallery-edit-button",function(e){var n=g(this),t=n.data("attachment-id"),d=(e.preventDefault(),wp.media.frames.gallery_images_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_edit_image_title,button:{text:cooked_admin_functions_js_vars.i18n_edit_image_button},library:{type:"image"},multiple:!1}));d.on("open",function(){var e=d.state().get("selection");(attachment=wp.media.attachment(t)).fetch(),e.add(attachment?[attachment]:[])}),d.open(),d.on("select",function(){var e,t,o,i=d.state().get("selection").toJSON();for(e in i)i.hasOwnProperty(e)&&(o=(t=i[e]).sizes.thumbnail.url,n.parent().replaceWith(''));cooked_init_gallery_sorting()})}),$_CookedRecipeGallery.on("click",".remove-image-button",function(e){var t=g(this);s=t.data("id"),e.preventDefault(),s?(g("#direction-"+s+"-image-src").parent().removeClass("cooked-has-image").prop("src",!1),g('input[name="_recipe_settings[directions]['+s+'][image]"]').val(""),g('.direction-image-button[data-id="'+s+'"]').prop("value",cooked_admin_functions_js_vars.i18n_image_title)):t.parent().remove()})),$_CookedNutritionFactsTab.length&&(init_nutrition_facts($_CookedNutritionFactsTab),$_CookedNutritionFactsTab.on("keyup","input",function(e){init_nutrition_facts($_CookedNutritionFactsTab)})),g("#cooked-prep-time").length&&g("#cooked-prep-time,#cooked-cook-time").on("change",function(){cooked_updateTotalTimeValue(parseInt(g("#cooked-prep-time").val()),parseInt(g("#cooked-cook-time").val()))})})})(jQuery),0),cooked_bulk_per_page=20;function cooked_set_default_template(o,i,n,d,a){var c,r,s;i<=0||(c=jQuery("#cooked-template-progress"),r=c.find(".cooked-progress-bar"),s=jQuery("#cooked-template-progress-text"),c.hasClass("cooked-active")||(c.addClass("cooked-active"),s.addClass("cooked-active"),r.css({width:"0%"}),a.reposition()),jQuery.post(cooked_admin_functions_js_vars.ajax_url,{action:"cooked_save_default_bulk",page:o,default_content:n,nonce:d},function(e){var t;e&&e.success&&(cooked_recipe_update_counter=Math.min((o+1)*cooked_bulk_per_page,i),t=Math.round(cooked_recipe_update_counter/i*100),r.css({width:t+"%"}),s.text(cooked_recipe_update_counter+" / "+i),e.data.has_more?cooked_set_default_template(o+1,i,n,d,a):(jQuery(".cooked-save-default-all").text(cooked_admin_functions_js_vars.i18n_applied),r.css({width:"100%"}),s.text(i+" / "+i),c.removeClass("cooked-active"),s.removeClass("cooked-active").text(""),a.reposition()))},"json"))}function cooked_updateTotalTimeValue(e,t){jQuery("#cooked-total-time").val(e+t)}function cooked_init_gallery_sorting(){jQuery("#cooked-recipe-image-gallery").sortable()}function init_nutrition_facts(e){e.find("input").each(function(){var e,t=jQuery(this),o=t.attr("id"),t=t.val(),i=jQuery('.cooked-nut-percent[data-labeltype="'+o+'"]').length;jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').length&&(t?(jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').text(t),jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').parents("li").eq(0).show(),jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').parents("p").eq(0).show(),i&&(e=(i=jQuery('.cooked-nut-percent[data-labeltype="'+o+'"]')).data("pdv"))&&(thisPercent=Math.ceil(t/e*100),i.text(thisPercent))):(jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').text("___"),jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').parents("li").eq(0).hide(),jQuery('.cooked-nut-label[data-labeltype="'+o+'"]').parents("p").eq(0).hide()))})}function cooked_reset_ingredient_builder(){var e=jQuery(".cooked-ingredient-block"),t=0,i=0,o=!1;0").text(e).html()}function h(e,t){if(u.empty(),e.length){l.attr("data-bulk-type","ingredients"),l.show(),k.removeAttr("disabled"),u.find(".cooked-bulk-add-preview-header").length||u.prepend('
'+f(_.i18n_bulk_add_amount)+''+f(_.i18n_bulk_add_unit)+''+f(_.i18n_bulk_add_name)+"
");for(var o=0;o
'),d=s('"),a=s('
'),c=s('').text(_.i18n_bulk_add_heading_line_label),r=s('').val(e[o]),c=(a.append(c).append(r),s('').val(i.amount)),r=s('').val(i.measurement),i=s('').val(i.name);n.append(d).append(a).append(c).append(r).append(i),u.append(n)}}else l.attr("data-bulk-type",""),l.hide(),k.attr("disabled","disabled")}i.length&&(t=s("#cooked-bulk-add-textarea"),l=s("#cooked-bulk-add-preview"),u=s("#cooked-bulk-add-preview-list"),o=s("#cooked-bulk-add-title"),r=s("#cooked-bulk-add-type"),k=i.find(".cooked-bulk-add-submit"),p=i.find(".cooked-bulk-add-spinner"),_=cooked_admin_functions_js_vars,m=null,g="",t.on("input",function(){var e=r.val(),o=(e=>{for(var t=e.split(/[\r\n]+/),o=[],i=0;i
'),a=s('"),c=s('').val(i[n]);d.append(a).append(c),u.append(d)}}else l.attr("data-bulk-type",""),l.hide(),k.attr("disabled","disabled")}else t!==g&&(g=t,h(o,null),m&&clearTimeout(m),m=setTimeout(function(){var t;(t=o).length?(p.show().css("visibility","visible"),s.post(_.ajax_url,{action:"cooked_parse_bulk_ingredients",nonce:_.cooked_bulk_add_nonce,lines:t},function(e){p.hide();e=e.success&&e.data&&e.data.parsed?e.data.parsed:null;h(t,e)}).fail(function(){p.hide(),h(t,null)})):h([],null)},400))}),s(document).on("click",".cooked-bulk-add-button",function(e){e.preventDefault();var e=s(this).data("type");e=e,r.val(e),t.val(""),u.empty(),l.attr("data-bulk-type",""),l.hide(),k.attr("disabled","disabled"),p.hide(),g="","ingredients"===e?(o.text(_.i18n_bulk_add_ingredients),t.attr("placeholder",_.i18n_bulk_add_placeholder_ingredients),k.text(_.i18n_bulk_add_submit_ingredients)):(o.text(_.i18n_bulk_add_directions),t.attr("placeholder",_.i18n_bulk_add_placeholder_directions),k.text(_.i18n_bulk_add_submit_directions)),i.show(),t.focus()}),i.on("click",".cooked-bulk-add-close, .cooked-bulk-add-cancel",function(e){e.preventDefault(),n()}),i.on("click",function(e){s(e.target).is(i)&&n()}),s(document).on("keydown",function(e){"Escape"===e.key&&i.is(":visible")&&n()}),u.on("change",'input[type="checkbox"]',function(){var e=s(this).closest(".cooked-bulk-add-preview-row"),t=s(this).is(":checked");e.toggleClass("cooked-bulk-add-is-heading",t)}),k.on("click",function(e){var i;e.preventDefault(),s(this).attr("disabled")||(e=r.val(),i=[],"ingredients"===e?u.find(".cooked-bulk-add-preview-row").each(function(){var e=s(this),t=e.find('input[type="checkbox"]').is(":checked"),o=e.find(".cooked-bulk-add-preview-text").val().trim();o&&i.push(t?{text:o,heading:!0}:{heading:!1,amount:e.find(".cooked-bulk-add-parsed-amount").val().trim(),measurement:e.find(".cooked-bulk-add-parsed-unit").val().trim(),name:e.find(".cooked-bulk-add-parsed-name").val().trim()||o})}):u.find(".cooked-bulk-add-preview-row").each(function(){var e=s(this),t=e.find(".cooked-bulk-add-preview-text").val().trim(),e=e.find('input[type="checkbox"]').is(":checked");t&&i.push({text:t,heading:e})}),i.length&&(("directions"===e?cooked_bulk_add_directions:cooked_bulk_add_ingredients_parsed)(i),n()))}))}function cooked_bulk_add_directions(e){for(var t=jQuery("#cooked-directions-builder"),o=t.parent(),i=0;i{O(document).ready(function(){var i,n,d,a,c,t,o,r,l,s,u,k,p,_,m,g,f,h,b,v,y,e,C,w,x,z,F,M,$,j,D,S,T,Q,A=O(".cooked-color-field"),B=O("#cooked_recipe_settings").find("select"),I=O("#cooked-recipe-tabs"),N=(O("#cooked-settings-wrap"),O("#cooked_recipe_settings")),E=N.find("input#submit");$_CookedTooltips=O(".cooked-tooltip"),$_CookedConditionals=O(".cooked-conditional-hidden"),$_CookedSortable=O(".cooked-sortable"),$_CookedRecipeSaveDefault=O(".cooked-layout-save-default"),$_CookedShortcodeField=O(".cooked-shortcode-field"),$_CookedIngredientBuilder=O("#cooked-ingredients-builder"),$_CookedAutoNutritionButton=O(".cooked-auto-nutrition-button"),$_CookedDirectionBuilder=O("#cooked-directions-builder"),$_CookedRecipeGallery=O("#cooked-recipe-image-gallery"),$_CookedNutritionFactsTab=O("#cooked-recipe-tab-content-nutrition"),$_CookedSettingsPanel=O("#cooked-settings-panel"),$_CookedSettingsTabs=O("#cooked-settings-tabs"),A.length&&A.wpColorPicker(),$_CookedSortable.length&&(document.addEventListener("touchstart",cookedSortableTouchHandler,{passive:!1}),document.addEventListener("touchmove",cookedSortableTouchHandler,{passive:!1}),document.addEventListener("touchend",cookedSortableTouchHandler,{passive:!1}),$_CookedSortable.find(".cooked-icon-drag").length?$_CookedSortable.sortable({handle:".cooked-icon-drag",stop:function(e,t){t.item.closest("#cooked-directions-builder").length&&cooked_reset_direction_builder();var t=t.item.find("textarea"),o=!(!cooked_admin_functions_js_vars.wp_editor_roles_allowed||"undefined"==typeof wp||!wp.editor||"function"!=typeof wp.editor.remove||"function"!=typeof wp.editor.initialize);t.length&&o&&(o=t.attr("name"),t=t.attr("id"),wp.editor.remove(t),wp.editor.initialize(t,{tinymce:{wpautop:!1,toolbar1:"bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,wp_link_advanced,unlink,fullscreen",toolbar2:"",toolbar3:"",toolbar4:"",height:100,textarea_name:o,plugins:"link lists fullscreen wordpress wplink",setup:function(e){}},quicktags:!0,mediaButtons:!1}))}}):$_CookedSortable.sortable({stop:function(e,t){t.item.closest("#cooked-directions-builder").length&&cooked_reset_direction_builder()}})),$_CookedRecipeSaveDefault.length&&(i=O("#cooked-save-default-panel"),n=O('
').appendTo(i)[0],d=!(!window.FloatingUICore||!window.FloatingUIDOM),a=null,d&&i.addClass("cooked-tooltip-shell").wrapInner('
'),c=function(){return!!i.length&&(d?i.hasClass("cooked-tooltip-open"):!i.prop("hidden"))},t=function(e){var t,o;i.length&&(t=$_CookedRecipeSaveDefault[0],o=i[0],$_CookedRecipeSaveDefault.attr("aria-expanded",e?"true":"false"),d?e?(o.hidden=!1,a=a||window.FloatingUIDOM.autoUpdate(t,o,function(){cooked_position_floating(t,o,n,["top","bottom"],function(){return!o.hidden})}),cooked_grow_open(o)):c()&&cooked_grow_close(o,function(){a&&(a(),a=null),o.hidden=!0}):o.hidden=!e)},$_CookedRecipeSaveDefault.on("click",function(e){e.preventDefault(),t(!c())}),$_CookedRecipeSaveDefault.on("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(!c()))}),O(document).on("click",function(e){!c()||O(e.target).closest(".cooked-layout-save-default, #cooked-save-default-panel").length||t(!1)}),O(document).on("keydown",function(e){"Escape"===e.key&&c()&&(t(!1),$_CookedRecipeSaveDefault.focus())}),O(".cooked-save-default-all").on("click",function(e){e.preventDefault();var t,o=O(this),e=o.data("nonce"),i=o.data("bulk-nonce"),n=o.parent(),d=confirm(cooked_admin_functions_js_vars.i18n_confirm_save_default_all),a=O("#_recipe_settings_content"),c=tinymce.get("_recipe_settings_content");t=null===c?a.val():c.getContent(),d&&!o.hasClass("disabled")&&(n.find(".button, .button-primary").addClass("disabled"),O.post(cooked_admin_functions_js_vars.ajax_url,{action:"cooked_save_default",default_content:t,nonce:e},function(){O.post(cooked_admin_functions_js_vars.ajax_url,{action:"cooked_get_recipe_count",nonce:i},function(e){o.removeClass("button-primary").addClass("button"),e&&e.success&&0')}),$_CookedTooltips.length&&window.FloatingUICore&&window.FloatingUIDOM&&(o=window.FloatingUIDOM,r=document.createElement("div"),A=document.createElement("div"),l=document.createElement("div"),s=document.createElement("div"),_={},g=m=p=k=u=null,r.id="cooked-tooltip-floating",r.className="cooked-tooltip-floating",r.setAttribute("role","tooltip"),r.hidden=!0,A.className="cooked-tooltip-bubble",s.className="cooked-tooltip-arrow",A.appendChild(l),A.appendChild(s),r.appendChild(A),document.body.appendChild(r),f=function(e){var t=[];return String(e.getAttribute("data-positions")||"").split(",").forEach(function(e){e=e.trim().toLowerCase(),/^(top|right|bottom|left)(-start|-end)?$/.test(e)&&-1===t.indexOf(e)&&t.push(e)}),t.length?t:["bottom"]},h=function(){g&&(g(),g=null),k=null,r.hidden=!0},b=function(e){clearTimeout(m),m=null,u&&(null===p?u.removeAttribute("aria-describedby"):u.setAttribute("aria-describedby",p)),p=u=null,_={},e&&k?r.classList.contains("cooked-tooltip-open")&&cooked_grow_close(r,h):(cooked_grow_cancel(r),r.classList.remove("cooked-tooltip-open"),h())},v=function(){var e=k;e&&e.isConnected?cooked_position_floating(e,r,s,f(e),function(){return k===e}):b(!1)},y=function(e){m=null,e.isConnected?(l.innerHTML=e.getAttribute("data-tooltip"),k=e,r.hidden=!1,g=g||o.autoUpdate(e,r,v),cooked_grow_open(r)):b(!1)},e=function(e,t){var o=e.getAttribute("data-tooltip");o&&(_[t]=!0,u===e?m&&"hover"!==t?(clearTimeout(m),y(e)):m||(l.innerHTML=o):(b(!1),_[t]=!0,p=(u=e).getAttribute("aria-describedby"),e.setAttribute("aria-describedby",p?p+" "+r.id:r.id),"hover"===t?m=setTimeout(function(){y(e)},100):y(e)))},C=function(e,t){u===e&&(delete _[t],O.isEmptyObject(_))&&b(!0)},O(document).on("mouseenter",".cooked-tooltip[data-tooltip]",function(){e(this,"hover")}).on("mouseleave",".cooked-tooltip[data-tooltip]",function(){C(this,"hover")}).on("focusin",".cooked-tooltip[data-tooltip]",function(){e(this,"focus")}).on("focusout",".cooked-tooltip[data-tooltip]",function(){C(this,"focus")}).on("keydown",function(e){"Escape"===e.key&&b(!0)})),$_CookedShortcodeField.length&&$_CookedShortcodeField.on("click",function(e){O(this).select()}),$_CookedConditionals.length&&(w=[],$_CookedConditionals.each(function(){var e=O(this),t=O(this).data("condition"),o=O(this).data("value"),i=O("#"+t),o=!!o&&o.split(" "),n=e.is("li")||e.is("span")?"inline-block":"block";i.is(":checkbox")&&i.is(":checked")||i.is(":radio")&&i.is(":checked")||!(i.is(":checkbox")&&!i.is(":checked")||i.is(":radio")&&!i.is(":checked"))&&(!i.is(":checkbox")&&!o&&i.val()||!i.is(":checkbox")&&o&&-1 a").attr("href")).split("#"))[1],O(".cooked-settings-tab-content").hide(),O("#cooked-settings-tab-content-"+$).show(),A.on("click",function(e){O(".tab-content").hide();var t=O(this).find("a"),t=($_CookedSettingsTabs.find("li").removeClass("active"),O(this).addClass("active"),t.attr("href"));"migration"==(t=(t=t.split("#"))[1])?E.hide():E.show(),O(".cooked-settings-tab-content").hide(),O("#cooked-settings-tab-content-"+t).show(),O("#cooked-settings-panel").hasClass("stuck")?window.scrollTo(0,130):window.scrollTo(0,0)}),$_CookedSettingsPanel.on("click",".cooked-settings-image-remove",function(e){e.preventDefault();e=O(this).closest(".cooked-settings-image-field");e.removeClass("cooked-has-image"),e.find(".cooked-settings-image-preview-img").attr("src","").removeAttr("srcset").removeAttr("sizes"),e.find(".cooked-settings-image-input").val("0"),e.find(".cooked-settings-image-button").val(cooked_admin_functions_js_vars.i18n_image_title)}),$_CookedSettingsPanel.on("click",".cooked-settings-image-button",function(e){e.preventDefault();var o=O(this),i=o.closest(".cooked-settings-image-field");j&&j.off("select"),(j=wp.media({title:cooked_admin_functions_js_vars.i18n_image_title,button:{text:cooked_admin_functions_js_vars.i18n_image_button},library:{type:"image"}})).on("select",function(){var e=j.state().get("selection").first().toJSON(),t=(e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail:e).url;i.addClass("cooked-has-image"),i.find(".cooked-settings-image-preview-img").attr("src",t).removeAttr("srcset").removeAttr("sizes"),i.find(".cooked-settings-image-input").val(e.id),o.val(cooked_admin_functions_js_vars.i18n_image_change)}),j.open()})),$_CookedIngredientBuilder.length&&(cooked_reset_ingredient_builder(),$_CookedIngredientBuilder.on("keydown",'input[data-ingredient-part="name"]',function(e){9!==e.keyCode&&13!==e.keyCode||O(this).parents(".cooked-ingredient-block").is(":last-child")&&(e.preventDefault(),O("#cooked-recipe-tab-content-ingredients").find(".cooked-add-ingredient-button").trigger("click"),$_CookedIngredientBuilder.find('.cooked-ingredient-block:last-child input[data-ingredient-part="amount"]').focus())}),$_CookedIngredientBuilder.parent().on("click",".cooked-show-substitution",function(e){e.preventDefault();e=O(this).parent();e.hasClass("cooked-expanded")?e.removeClass("cooked-expanded"):(e.addClass("cooked-expanded"),e.find('input[data-ingredient-part="sub_amount"]').focus())}),$_CookedIngredientBuilder.on("keyup change",'input[data-ingredient-part="sub_amount"], input[data-ingredient-part="sub_name"], select[data-ingredient-part="sub_measurement"]',function(e){var t=O(this).parents(".recipe-setting-block"),o=t.find('input[data-ingredient-part="sub_name"]').val();o&&o.trim()?t.addClass("cooked-has-substitution"):t.removeClass("cooked-has-substitution")}),$_CookedAutoNutritionButton.length&&$_CookedIngredientBuilder.on("change",'input[data-ingredient-part="name"]',function(e){var t=!1;$_CookedIngredientBuilder.find('input[data-ingredient-part="name"]').each(function(){if(""!=O(this).val())return!(t=!0)}),t?$_CookedAutoNutritionButton.prop("disabled",!1):$_CookedAutoNutritionButton.prop("disabled",!0)}),$_CookedIngredientBuilder.on("keyup",'input[data-ingredient-part="url"]',function(e){var t=O(this).val(),o=O(this).parents(".recipe-setting-block");t?o.addClass("cooked-has-url"):o.removeClass("cooked-has-url")}),$_CookedIngredientBuilder.parent().on("click",".cooked-add-ingredient-button",function(e){e.preventDefault();e=$_CookedIngredientBuilder.parent().find(".cooked-ingredient-template").clone().removeClass("cooked-template cooked-ingredient-template").addClass("cooked-ingredient-block");$_CookedIngredientBuilder.append(e),cooked_reset_ingredient_builder()}),$_CookedIngredientBuilder.parent().on("click",".cooked-add-heading-button",function(e){e.preventDefault();e=$_CookedIngredientBuilder.parent().find(".cooked-heading-template").clone().removeClass("cooked-template cooked-heading-template").addClass("cooked-ingredient-block cooked-ingredient-heading");$_CookedIngredientBuilder.append(e),cooked_reset_ingredient_builder()}),$_CookedIngredientBuilder.parent().on("click",".cooked-delete-ingredient",function(e){e.preventDefault(),O(this).parent().remove(),cooked_reset_ingredient_builder()})),$_CookedDirectionBuilder.length&&(cooked_reset_direction_builder(),$_CookedDirectionBuilder.parent().on("click",".cooked-show-heading-element",function(e){e.preventDefault();e=O(this).parent();e.hasClass("cooked-expanded")?e.removeClass("cooked-expanded"):(e.addClass("cooked-expanded"),e.find('input[data-direction-part="section_heading_element"]').focus())}),$_CookedDirectionBuilder.parent().on("click",".cooked-add-direction-button",function(e){e.preventDefault();e=$_CookedDirectionBuilder.parent().find(".cooked-direction-template").clone().removeClass("cooked-template cooked-direction-template").addClass("cooked-direction-block");$_CookedDirectionBuilder.append(e),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".cooked-add-heading-button",function(e){e.preventDefault();e=$_CookedDirectionBuilder.parent().find(".cooked-heading-template").clone().removeClass("cooked-template cooked-heading-template").addClass("cooked-direction-block cooked-direction-heading");$_CookedDirectionBuilder.append(e),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".cooked-delete-direction",function(e){e.preventDefault();var t,e=O(this).parent();cooked_admin_functions_js_vars.wp_editor_roles_allowed&&"undefined"!=typeof wp&&wp.editor&&"function"==typeof wp.editor.remove&&(t=e.find('textarea[data-direction-part="content"]').attr("id"))&&wp.editor.remove(t),e.remove(),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".remove-image-button",function(e){e.preventDefault();e=O(this).parent();e.removeClass("cooked-has-image"),e.find("img").attr("src","").removeAttr("srcset").removeAttr("sizes"),e.find('input[data-direction-part="image"]').val(""),cooked_reset_direction_builder()}),$_CookedDirectionBuilder.parent().on("click",".remove-video-button",function(e){e.preventDefault();e=O(this).parent();e.removeClass("cooked-has-video"),e.find(".cooked-direction-video-preview").attr("src",""),e.find('input[data-direction-part="video"]').val(""),e.find(".direction-video-button").prop("value",cooked_admin_functions_js_vars.i18n_video_title),cooked_reset_direction_builder()}),O("body").on("click",".cooked-direction-img-placeholder, .cooked-direction-img",function(e){e.preventDefault(),O(this).parent().find(".direction-image-button").trigger("click")}),O("body").on("click",".direction-image-button",function(e){var t=O(this);T=t.data("id"),e.preventDefault(),D||(D=wp.media.frames.direction_image_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_image_title,button:{text:cooked_admin_functions_js_vars.i18n_image_button},library:{type:"image"}})).on("select",function(){var e=D.state().get("selection").first().toJSON();O("#direction-"+T+"-image-src").attr("src",e.sizes.thumbnail.url).removeAttr("srcset").removeAttr("sizes").parent().addClass("cooked-has-image"),O('input[name="_recipe_settings[directions]['+T+'][image]"]').val(e.id),O('.direction-image-button[data-id="'+T+'"]').prop("value",cooked_admin_functions_js_vars.i18n_image_change)}),D.open()}),O("body").on("click",".cooked-direction-video-placeholder, .cooked-direction-video-preview",function(e){e.preventDefault(),O(this).parent().find(".direction-video-button").trigger("click")}),O("body").on("click",".direction-video-button",function(e){var t=O(this);T=t.data("id"),e.preventDefault(),S||(S=wp.media.frames.direction_video_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_video_title,button:{text:cooked_admin_functions_js_vars.i18n_video_button},library:{type:"video"}})).on("select",function(){var e=S.state().get("selection").first().toJSON(),t=O('.direction-video-button[data-id="'+T+'"]').closest(".cooked-direction-video");t.find(".cooked-direction-video-preview").attr("src",e.url),t.find('input[data-direction-part="video"]').val(e.id),t.addClass("cooked-has-video"),O('.direction-video-button[data-id="'+T+'"]').prop("value",cooked_admin_functions_js_vars.i18n_video_change)}),S.open()})),cooked_init_bulk_add(O),$_CookedRecipeGallery.length&&(cooked_init_gallery_sorting(),O("body").on("click",".cooked-gallery-add-button",function(e){O(this);e.preventDefault(),Q||(Q=wp.media.frames.gallery_images_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_gallery_image_title,button:{text:cooked_admin_functions_js_vars.i18n_gallery_image_title},library:{type:"image"},multiple:!0})).on("select",function(){var e,t,o,i=Q.state().get("selection").toJSON();for(e in i)i.hasOwnProperty(e)&&(o=(t=i[e]).sizes.thumbnail.url,O("#cooked-recipe-image-gallery").append(''));cooked_init_gallery_sorting()}),Q.open()}),O("body").on("click",".cooked-recipe-gallery-item img",function(e){e.preventDefault(),O(this).parent().find(".cooked-gallery-edit-button").trigger("click")}),O("body").on("click",".cooked-gallery-edit-button",function(e){var n=O(this),t=n.data("attachment-id"),d=(e.preventDefault(),wp.media.frames.gallery_images_frame=wp.media({title:cooked_admin_functions_js_vars.i18n_edit_image_title,button:{text:cooked_admin_functions_js_vars.i18n_edit_image_button},library:{type:"image"},multiple:!1}));d.on("open",function(){var e=d.state().get("selection");(attachment=wp.media.attachment(t)).fetch(),e.add(attachment?[attachment]:[])}),d.open(),d.on("select",function(){var e,t,o,i=d.state().get("selection").toJSON();for(e in i)i.hasOwnProperty(e)&&(o=(t=i[e]).sizes.thumbnail.url,n.parent().replaceWith(''));cooked_init_gallery_sorting()})}),$_CookedRecipeGallery.on("click",".remove-image-button",function(e){var t=O(this);T=t.data("id"),e.preventDefault(),T?(O("#direction-"+T+"-image-src").parent().removeClass("cooked-has-image").prop("src",!1),O('input[name="_recipe_settings[directions]['+T+'][image]"]').val(""),O('.direction-image-button[data-id="'+T+'"]').prop("value",cooked_admin_functions_js_vars.i18n_image_title)):t.parent().remove()})),$_CookedNutritionFactsTab.length&&(init_nutrition_facts($_CookedNutritionFactsTab),$_CookedNutritionFactsTab.on("keyup","input",function(e){init_nutrition_facts($_CookedNutritionFactsTab)})),O("#cooked-prep-time").length&&O("#cooked-prep-time,#cooked-cook-time").on("change",function(){cooked_updateTotalTimeValue(parseInt(O("#cooked-prep-time").val()),parseInt(O("#cooked-cook-time").val()))})})})(jQuery),0),cooked_bulk_per_page=20;function cooked_position_floating(e,i,n,t,d){var o=window.FloatingUIDOM,a={top:"bottom",right:"left",bottom:"top",left:"right"};return o.computePosition(e,i,{placement:t[0],strategy:"fixed",middleware:[o.offset(10),o.flip({fallbackPlacements:1").text(e).html()}function h(e,t){if(u.empty(),e.length){s.attr("data-bulk-type","ingredients"),s.show(),k.removeAttr("disabled"),u.find(".cooked-bulk-add-preview-header").length||u.prepend('
'+f(_.i18n_bulk_add_amount)+''+f(_.i18n_bulk_add_unit)+''+f(_.i18n_bulk_add_name)+"
");for(var o=0;o
'),d=l('"),a=l('
'),c=l('').text(_.i18n_bulk_add_heading_line_label),r=l('').val(e[o]),c=(a.append(c).append(r),l('').val(i.amount)),r=l('').val(i.measurement),i=l('').val(i.name);n.append(d).append(a).append(c).append(r).append(i),u.append(n)}}else s.attr("data-bulk-type",""),s.hide(),k.attr("disabled","disabled")}i.length&&(t=l("#cooked-bulk-add-textarea"),s=l("#cooked-bulk-add-preview"),u=l("#cooked-bulk-add-preview-list"),o=l("#cooked-bulk-add-title"),r=l("#cooked-bulk-add-type"),k=i.find(".cooked-bulk-add-submit"),p=i.find(".cooked-bulk-add-spinner"),_=cooked_admin_functions_js_vars,m=null,g="",t.on("input",function(){var e=r.val(),o=(e=>{for(var t=e.split(/[\r\n]+/),o=[],i=0;i
'),a=l('"),c=l('').val(i[n]);d.append(a).append(c),u.append(d)}}else s.attr("data-bulk-type",""),s.hide(),k.attr("disabled","disabled")}else t!==g&&(g=t,h(o,null),m&&clearTimeout(m),m=setTimeout(function(){var t;(t=o).length?(p.show().css("visibility","visible"),l.post(_.ajax_url,{action:"cooked_parse_bulk_ingredients",nonce:_.cooked_bulk_add_nonce,lines:t},function(e){p.hide();e=e.success&&e.data&&e.data.parsed?e.data.parsed:null;h(t,e)}).fail(function(){p.hide(),h(t,null)})):h([],null)},400))}),l(document).on("click",".cooked-bulk-add-button",function(e){e.preventDefault();var e=l(this).data("type");e=e,r.val(e),t.val(""),u.empty(),s.attr("data-bulk-type",""),s.hide(),k.attr("disabled","disabled"),p.hide(),g="","ingredients"===e?(o.text(_.i18n_bulk_add_ingredients),t.attr("placeholder",_.i18n_bulk_add_placeholder_ingredients),k.text(_.i18n_bulk_add_submit_ingredients)):(o.text(_.i18n_bulk_add_directions),t.attr("placeholder",_.i18n_bulk_add_placeholder_directions),k.text(_.i18n_bulk_add_submit_directions)),i.show(),t.focus()}),i.on("click",".cooked-bulk-add-close, .cooked-bulk-add-cancel",function(e){e.preventDefault(),n()}),i.on("click",function(e){l(e.target).is(i)&&n()}),l(document).on("keydown",function(e){"Escape"===e.key&&i.is(":visible")&&n()}),u.on("change",'input[type="checkbox"]',function(){var e=l(this).closest(".cooked-bulk-add-preview-row"),t=l(this).is(":checked");e.toggleClass("cooked-bulk-add-is-heading",t)}),k.on("click",function(e){var i;e.preventDefault(),l(this).attr("disabled")||(e=r.val(),i=[],"ingredients"===e?u.find(".cooked-bulk-add-preview-row").each(function(){var e=l(this),t=e.find('input[type="checkbox"]').is(":checked"),o=e.find(".cooked-bulk-add-preview-text").val().trim();o&&i.push(t?{text:o,heading:!0}:{heading:!1,amount:e.find(".cooked-bulk-add-parsed-amount").val().trim(),measurement:e.find(".cooked-bulk-add-parsed-unit").val().trim(),name:e.find(".cooked-bulk-add-parsed-name").val().trim()||o})}):u.find(".cooked-bulk-add-preview-row").each(function(){var e=l(this),t=e.find(".cooked-bulk-add-preview-text").val().trim(),e=e.find('input[type="checkbox"]').is(":checked");t&&i.push({text:t,heading:e})}),i.length&&(("directions"===e?cooked_bulk_add_directions:cooked_bulk_add_ingredients_parsed)(i),n()))}))}function cooked_bulk_add_directions(e){for(var t=jQuery("#cooked-directions-builder"),o=t.parent(),i=0;i child element - if (self.__instance.content() === null) { - - // TODO: when there are several tags (not supported in - // today's browsers yet though, still an RFC draft), pick the right - // one based on its "lang" attribute - var $title = self.__instance._$origin.find('>title'); - - if ($title[0]) { - - var title = $title.text(); - - self.__hadTitleTag = true; - self.__instance._$origin.data('tooltipster-initialTitle', title); - self.__instance.content(title); - - $title.remove(); - } - } - - // rectify the geometry if SVG.js and its screenBBox plugin have been included - self.__instance - ._on('geometry.'+ self.namespace, function(event) { - - var win = $.tooltipster._env.window; - - // SVG coordinates may need fixing but we need svg.screenbox.js - // to provide it. SVGElement is IE8+ - if (win.SVG.svgjs) { - - if (!win.SVG.parser) { - win.SVG.prepare(); - } - - var svgEl = win.SVG.adopt(event.origin); - - // not all figures need (and have) screenBBox - if (svgEl && svgEl.screenBBox) { - - var bbox = svgEl.screenBBox(); - - event.edit({ - height: bbox.height, - left: bbox.x, - top: bbox.y, - width: bbox.width - }); - } - } - }) - // if jQuery < v3.0, we have to remove the class ourselves - ._on('destroy.'+ self.namespace, function() { - self.__destroy(); - }); - }, - - __destroy: function() { - - var self = this; - - if (!self.__instance._$origin.hasClass('tooltipstered')) { - var c = self.__instance._$origin.attr('class').replace('tooltipstered', ''); - self.__instance._$origin.attr('class', c); - } - - self.__instance._off('.'+ self.namespace); - - // if the content was provided as a title tag, we may need to restore it - if (self.__hadTitleTag) { - - // this must happen after Tooltipster restored (or not) the title attr - self.__instance.one('destroyed', function() { - - // if a title attribute was restored, we just need to replace it with a tag - var title = self.__instance._$origin.attr('title'); - - if (title) { - - // must be namespaced to work - $(document.createElementNS('http://www.w3.org/2000/svg', 'title')) - .text(title) - .appendTo(self.__instance._$origin); - - self.__instance._$origin.removeAttr('title'); - } - }); - } - } - } -}); - -/* a build task will add "return $;" here */ -return $; - -})); - - -})); diff --git a/assets/admin/js/tooltipster/plugins/tooltipster/SVG/tooltipster-SVG.min.js b/assets/admin/js/tooltipster/plugins/tooltipster/SVG/tooltipster-SVG.min.js deleted file mode 100644 index df77068..0000000 --- a/assets/admin/js/tooltipster/plugins/tooltipster/SVG/tooltipster-SVG.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a,b){"function"==typeof define&&define.amd?define(["tooltipster"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("tooltipster")):b(jQuery)}(this,function(a){!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b="tooltipster.SVG";return a.tooltipster._plugin({name:b,core:{__init:function(){a.tooltipster._on("init",function(c){var d=a.tooltipster._env.window;d.SVGElement&&c.origin instanceof d.SVGElement&&c.instance._plug(b)})}},instance:{__init:function(b){var c=this;if(c.__hadTitleTag=!1,c.__instance=b,!c.__instance._$origin.hasClass("tooltipstered")){var d=c.__instance._$origin.attr("class")||"";-1==d.indexOf("tooltipstered")&&c.__instance._$origin.attr("class",d+" tooltipstered")}if(null===c.__instance.content()){var e=c.__instance._$origin.find(">title");if(e[0]){var f=e.text();c.__hadTitleTag=!0,c.__instance._$origin.data("tooltipster-initialTitle",f),c.__instance.content(f),e.remove()}}c.__instance._on("geometry."+c.namespace,function(b){var c=a.tooltipster._env.window;if(c.SVG.svgjs){c.SVG.parser||c.SVG.prepare();var d=c.SVG.adopt(b.origin);if(d&&d.screenBBox){var e=d.screenBBox();b.edit({height:e.height,left:e.x,top:e.y,width:e.width})}}})._on("destroy."+c.namespace,function(){c.__destroy()})},__destroy:function(){var b=this;if(!b.__instance._$origin.hasClass("tooltipstered")){var c=b.__instance._$origin.attr("class").replace("tooltipstered","");b.__instance._$origin.attr("class",c)}b.__instance._off("."+b.namespace),b.__hadTitleTag&&b.__instance.one("destroyed",function(){var c=b.__instance._$origin.attr("title");c&&(a(document.createElementNS("http://www.w3.org/2000/svg","title")).text(c).appendTo(b.__instance._$origin),b.__instance._$origin.removeAttr("title"))})}}}),a})}); \ No newline at end of file diff --git a/assets/admin/js/tooltipster/tooltipster.bundle.js b/assets/admin/js/tooltipster/tooltipster.bundle.js deleted file mode 100644 index e40be59..0000000 --- a/assets/admin/js/tooltipster/tooltipster.bundle.js +++ /dev/null @@ -1,4275 +0,0 @@ -/** - * tooltipster http://calebjacob.github.io/tooltipster/ - * A rockin' custom tooltip jQuery plugin - * Developed by Caleb Jacob and Louis Ameline - * MIT license - * - * Fork: data-tooltip-content uses $(document).find() so the attribute is - * never passed to $() as HTML (CodeQL js/xss-through-dom). - */ -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module unless amdModuleId is set - define(["jquery"], function (a0) { - return (factory(a0)); - }); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(require("jquery")); - } else { - factory(jQuery); - } -}(this, function ($) { - -// This file will be UMDified by a build task. - -var defaults = { - animation: 'fade', - animationDuration: 350, - content: null, - contentAsHTML: false, - contentCloning: false, - debug: true, - delay: 300, - delayTouch: [300, 500], - functionInit: null, - functionBefore: null, - functionReady: null, - functionAfter: null, - functionFormat: null, - IEmin: 6, - interactive: false, - multiple: false, - // will default to document.body, or must be an element positioned at (0, 0) - // in the document, typically like the very top views of an app. - parent: null, - plugins: ['sideTip'], - repositionOnScroll: false, - restoration: 'none', - selfDestruction: true, - theme: [], - timer: 0, - trackerInterval: 500, - trackOrigin: false, - trackTooltip: false, - trigger: 'hover', - triggerClose: { - click: false, - mouseleave: false, - originClick: false, - scroll: false, - tap: false, - touchleave: false - }, - triggerOpen: { - click: false, - mouseenter: false, - tap: false, - touchstart: false - }, - updateAnimation: 'rotate', - zIndex: 9999999 - }, - // we'll avoid using the 'window' global as a good practice but npm's - // jquery@<2.1.0 package actually requires a 'window' global, so not sure - // it's useful at all - win = (typeof window != 'undefined') ? window : null, - // env will be proxied by the core for plugins to have access its properties - env = { - // detect if this device can trigger touch events. Better have a false - // positive (unused listeners, that's ok) than a false negative. - // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js - // http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript - hasTouchCapability: !!( - win - && ( 'ontouchstart' in win - || (win.DocumentTouch && win.document instanceof win.DocumentTouch) - || win.navigator.maxTouchPoints - ) - ), - hasTransitions: transitionSupport(), - IE: false, - // don't set manually, it will be updated by a build task after the manifest - semVer: '4.2.8', - window: win - }, - core = function() { - - // core variables - - // the core emitters - this.__$emitterPrivate = $({}); - this.__$emitterPublic = $({}); - this.__instancesLatestArr = []; - // collects plugin constructors - this.__plugins = {}; - // proxy env variables for plugins who might use them - this._env = env; - }; - -// core methods -core.prototype = { - - /** - * A function to proxy the public methods of an object onto another - * - * @param {object} constructor The constructor to bridge - * @param {object} obj The object that will get new methods (an instance or the core) - * @param {string} pluginName A plugin name for the console log message - * @return {core} - * @private - */ - __bridge: function(constructor, obj, pluginName) { - - // if it's not already bridged - if (!obj[pluginName]) { - - var fn = function() {}; - fn.prototype = constructor; - - var pluginInstance = new fn(); - - // the _init method has to exist in instance constructors but might be missing - // in core constructors - if (pluginInstance.__init) { - pluginInstance.__init(obj); - } - - $.each(constructor, function(methodName, fn) { - - // don't proxy "private" methods, only "protected" and public ones - if (methodName.indexOf('__') != 0) { - - // if the method does not exist yet - if (!obj[methodName]) { - - obj[methodName] = function() { - return pluginInstance[methodName].apply(pluginInstance, Array.prototype.slice.apply(arguments)); - }; - - // remember to which plugin this method corresponds (several plugins may - // have methods of the same name, we need to be sure) - obj[methodName].bridged = pluginInstance; - } - else if (defaults.debug) { - - console.log('The '+ methodName +' method of the '+ pluginName - +' plugin conflicts with another plugin or native methods'); - } - } - }); - - obj[pluginName] = pluginInstance; - } - - return this; - }, - - /** - * For mockup in Node env if need be, for testing purposes - * - * @return {core} - * @private - */ - __setWindow: function(window) { - env.window = window; - return this; - }, - - /** - * Returns a ruler, a tool to help measure the size of a tooltip under - * various settings. Meant for plugins - * - * @see Ruler - * @return {object} A Ruler instance - * @protected - */ - _getRuler: function($tooltip) { - return new Ruler($tooltip); - }, - - /** - * For internal use by plugins, if needed - * - * @return {core} - * @protected - */ - _off: function() { - this.__$emitterPrivate.off.apply(this.__$emitterPrivate, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * For internal use by plugins, if needed - * - * @return {core} - * @protected - */ - _on: function() { - this.__$emitterPrivate.on.apply(this.__$emitterPrivate, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * For internal use by plugins, if needed - * - * @return {core} - * @protected - */ - _one: function() { - this.__$emitterPrivate.one.apply(this.__$emitterPrivate, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * Returns (getter) or adds (setter) a plugin - * - * @param {string|object} plugin Provide a string (in the full form - * "namespace.name") to use as as getter, an object to use as a setter - * @return {object|core} - * @protected - */ - _plugin: function(plugin) { - - var self = this; - - // getter - if (typeof plugin == 'string') { - - var pluginName = plugin, - p = null; - - // if the namespace is provided, it's easy to search - if (pluginName.indexOf('.') > 0) { - p = self.__plugins[pluginName]; - } - // otherwise, return the first name that matches - else { - $.each(self.__plugins, function(i, plugin) { - - if (plugin.name.substring(plugin.name.length - pluginName.length - 1) == '.'+ pluginName) { - p = plugin; - return false; - } - }); - } - - return p; - } - // setter - else { - - // force namespaces - if (plugin.name.indexOf('.') < 0) { - throw new Error('Plugins must be namespaced'); - } - - self.__plugins[plugin.name] = plugin; - - // if the plugin has core features - if (plugin.core) { - - // bridge non-private methods onto the core to allow new core methods - self.__bridge(plugin.core, self, plugin.name); - } - - return this; - } - }, - - /** - * Trigger events on the core emitters - * - * @returns {core} - * @protected - */ - _trigger: function() { - - var args = Array.prototype.slice.apply(arguments); - - if (typeof args[0] == 'string') { - args[0] = { type: args[0] }; - } - - // note: the order of emitters matters - this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate, args); - this.__$emitterPublic.trigger.apply(this.__$emitterPublic, args); - - return this; - }, - - /** - * Returns instances of all tooltips in the page or an a given element - * - * @param {string|HTML object collection} selector optional Use this - * parameter to restrict the set of objects that will be inspected - * for the retrieval of instances. By default, all instances in the - * page are returned. - * @return {array} An array of instance objects - * @public - */ - instances: function(selector) { - - var instances = [], - sel = selector || '.tooltipstered'; - - $(sel).each(function() { - - var $this = $(this), - ns = $this.data('tooltipster-ns'); - - if (ns) { - - $.each(ns, function(i, namespace) { - instances.push($this.data(namespace)); - }); - } - }); - - return instances; - }, - - /** - * Returns the Tooltipster objects generated by the last initializing call - * - * @return {array} An array of instance objects - * @public - */ - instancesLatest: function() { - return this.__instancesLatestArr; - }, - - /** - * For public use only, not to be used by plugins (use ::_off() instead) - * - * @return {core} - * @public - */ - off: function() { - this.__$emitterPublic.off.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * For public use only, not to be used by plugins (use ::_on() instead) - * - * @return {core} - * @public - */ - on: function() { - this.__$emitterPublic.on.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * For public use only, not to be used by plugins (use ::_one() instead) - * - * @return {core} - * @public - */ - one: function() { - this.__$emitterPublic.one.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * Returns all HTML elements which have one or more tooltips - * - * @param {string} selector optional Use this to restrict the results - * to the descendants of an element - * @return {array} An array of HTML elements - * @public - */ - origins: function(selector) { - - var sel = selector ? - selector +' ' : - ''; - - return $(sel +'.tooltipstered').toArray(); - }, - - /** - * Change default options for all future instances - * - * @param {object} d The options that should be made defaults - * @return {core} - * @public - */ - setDefaults: function(d) { - $.extend(defaults, d); - return this; - }, - - /** - * For users to trigger their handlers on the public emitter - * - * @returns {core} - * @public - */ - triggerHandler: function() { - this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - return this; - } -}; - -// $.tooltipster will be used to call core methods -$.tooltipster = new core(); - -// the Tooltipster instance class (mind the capital T) -$.Tooltipster = function(element, options) { - - // list of instance variables - - // stack of custom callbacks provided as parameters to API methods - this.__callbacks = { - close: [], - open: [] - }; - // the schedule time of DOM removal - this.__closingTime; - // this will be the user content shown in the tooltip. A capital "C" is used - // because there is also a method called content() - this.__Content; - // for the size tracker - this.__contentBcr; - // to disable the tooltip after destruction - this.__destroyed = false; - // we can't emit directly on the instance because if a method with the same - // name as the event exists, it will be called by jQuery. Se we use a plain - // object as emitter. This emitter is for internal use by plugins, - // if needed. - this.__$emitterPrivate = $({}); - // this emitter is for the user to listen to events without risking to mess - // with our internal listeners - this.__$emitterPublic = $({}); - this.__enabled = true; - // the reference to the gc interval - this.__garbageCollector; - // various position and size data recomputed before each repositioning - this.__Geometry; - // the tooltip position, saved after each repositioning by a plugin - this.__lastPosition; - // a unique namespace per instance - this.__namespace = 'tooltipster-'+ Math.round(Math.random()*1000000); - this.__options; - // will be used to support origins in scrollable areas - this.__$originParents; - this.__pointerIsOverOrigin = false; - // to remove themes if needed - this.__previousThemes = []; - // the state can be either: appearing, stable, disappearing, closed - this.__state = 'closed'; - // timeout references - this.__timeouts = { - close: [], - open: null - }; - // store touch events to be able to detect emulated mouse events - this.__touchEvents = []; - // the reference to the tracker interval - this.__tracker = null; - // the element to which this tooltip is associated - this._$origin; - // this will be the tooltip element (jQuery wrapped HTML element). - // It's the job of a plugin to create it and append it to the DOM - this._$tooltip; - - // launch - this.__init(element, options); -}; - -$.Tooltipster.prototype = { - - /** - * @param origin - * @param options - * @private - */ - __init: function(origin, options) { - - var self = this; - - self._$origin = $(origin); - self.__options = $.extend(true, {}, defaults, options); - - // some options may need to be reformatted - self.__optionsFormat(); - - // don't run on old IE if asked no to - if ( !env.IE - || env.IE >= self.__options.IEmin - ) { - - // note: the content is null (empty) by default and can stay that - // way if the plugin remains initialized but not fed any content. The - // tooltip will just not appear. - - // let's save the initial value of the title attribute for later - // restoration if need be. - var initialTitle = null; - - // it will already have been saved in case of multiple tooltips - if (self._$origin.data('tooltipster-initialTitle') === undefined) { - - initialTitle = self._$origin.attr('title'); - - // we do not want initialTitle to be "undefined" because - // of how jQuery's .data() method works - if (initialTitle === undefined) initialTitle = null; - - self._$origin.data('tooltipster-initialTitle', initialTitle); - } - - // If content is provided in the options, it has precedence over the - // title attribute. - // Note: an empty string is considered content, only 'null' represents - // the absence of content. - // Also, an existing title="" attribute will result in an empty string - // content - if (self.__options.content !== null) { - self.__contentSet(self.__options.content); - } - else { - - var selector = self._$origin.attr('data-tooltip-content'), - $el; - - if (selector){ - $el = $(document).find(selector); - } - - if ($el && $el[0]) { - self.__contentSet($el.first()); - } - else { - self.__contentSet(initialTitle); - } - } - - self._$origin - // strip the title off of the element to prevent the default tooltips - // from popping up - .removeAttr('title') - // to be able to find all instances on the page later (upon window - // events in particular) - .addClass('tooltipstered'); - - // set listeners on the origin - self.__prepareOrigin(); - - // set the garbage collector - self.__prepareGC(); - - // init plugins - $.each(self.__options.plugins, function(i, pluginName) { - self._plug(pluginName); - }); - - // to detect swiping - if (env.hasTouchCapability) { - $(env.window.document.body).on('touchmove.'+ self.__namespace +'-triggerOpen', function(event) { - self._touchRecordEvent(event); - }); - } - - self - // prepare the tooltip when it gets created. This event must - // be fired by a plugin - ._on('created', function() { - self.__prepareTooltip(); - }) - // save position information when it's sent by a plugin - ._on('repositioned', function(e) { - self.__lastPosition = e.position; - }); - } - else { - self.__options.disabled = true; - } - }, - - /** - * Insert the content into the appropriate HTML element of the tooltip - * - * @returns {self} - * @private - */ - __contentInsert: function() { - - var self = this, - $el = self._$tooltip.find('.tooltipster-content'), - formattedContent = self.__Content, - format = function(content) { - formattedContent = content; - }; - - self._trigger({ - type: 'format', - content: self.__Content, - format: format - }); - - if (self.__options.functionFormat) { - - formattedContent = self.__options.functionFormat.call( - self, - self, - { origin: self._$origin[0] }, - self.__Content - ); - } - - if (typeof formattedContent === 'string' && !self.__options.contentAsHTML) { - $el.text(formattedContent); - } - else { - $el - .empty() - .append(formattedContent); - } - - return self; - }, - - /** - * Save the content, cloning it beforehand if need be - * - * @param content - * @returns {self} - * @private - */ - __contentSet: function(content) { - - // clone if asked. Cloning the object makes sure that each instance has its - // own version of the content (in case a same object were provided for several - // instances) - // reminder: typeof null === object - if (content instanceof $ && this.__options.contentCloning) { - content = content.clone(true); - } - - this.__Content = content; - - this._trigger({ - type: 'updated', - content: content - }); - - return this; - }, - - /** - * Error message about a method call made after destruction - * - * @private - */ - __destroyError: function() { - throw new Error('This tooltip has been destroyed and cannot execute your method call.'); - }, - - /** - * Gather all information about dimensions and available space, - * called before every repositioning - * - * @private - * @returns {object} - */ - __geometry: function() { - - var self = this, - $target = self._$origin, - originIsArea = self._$origin.is('area'); - - // if this._$origin is a map area, the target we'll need - // the dimensions of is actually the image using the map, - // not the area itself - if (originIsArea) { - - var mapName = self._$origin.parent().attr('name'); - - $target = $('img[usemap="#'+ mapName +'"]'); - } - - var bcr = $target[0].getBoundingClientRect(), - $document = $(env.window.document), - $window = $(env.window), - $parent = $target, - // some useful properties of important elements - geo = { - // available space for the tooltip, see down below - available: { - document: null, - window: null - }, - document: { - size: { - height: $document.height(), - width: $document.width() - } - }, - window: { - scroll: { - // the second ones are for IE compatibility - left: env.window.scrollX || env.window.document.documentElement.scrollLeft, - top: env.window.scrollY || env.window.document.documentElement.scrollTop - }, - size: { - height: $window.height(), - width: $window.width() - } - }, - origin: { - // the origin has a fixed lineage if itself or one of its - // ancestors has a fixed position - fixedLineage: false, - // relative to the document - offset: {}, - size: { - height: bcr.bottom - bcr.top, - width: bcr.right - bcr.left - }, - usemapImage: originIsArea ? $target[0] : null, - // relative to the window - windowOffset: { - bottom: bcr.bottom, - left: bcr.left, - right: bcr.right, - top: bcr.top - } - } - }, - geoFixed = false; - - // if the element is a map area, some properties may need - // to be recalculated - if (originIsArea) { - - var shape = self._$origin.attr('shape'), - coords = self._$origin.attr('coords'); - - if (coords) { - - coords = coords.split(','); - - $.map(coords, function(val, i) { - coords[i] = parseInt(val); - }); - } - - // if the image itself is the area, nothing more to do - if (shape != 'default') { - - switch(shape) { - - case 'circle': - - var circleCenterLeft = coords[0], - circleCenterTop = coords[1], - circleRadius = coords[2], - areaTopOffset = circleCenterTop - circleRadius, - areaLeftOffset = circleCenterLeft - circleRadius; - - geo.origin.size.height = circleRadius * 2; - geo.origin.size.width = geo.origin.size.height; - - geo.origin.windowOffset.left += areaLeftOffset; - geo.origin.windowOffset.top += areaTopOffset; - - break; - - case 'rect': - - var areaLeft = coords[0], - areaTop = coords[1], - areaRight = coords[2], - areaBottom = coords[3]; - - geo.origin.size.height = areaBottom - areaTop; - geo.origin.size.width = areaRight - areaLeft; - - geo.origin.windowOffset.left += areaLeft; - geo.origin.windowOffset.top += areaTop; - - break; - - case 'poly': - - var areaSmallestX = 0, - areaSmallestY = 0, - areaGreatestX = 0, - areaGreatestY = 0, - arrayAlternate = 'even'; - - for (var i = 0; i < coords.length; i++) { - - var areaNumber = coords[i]; - - if (arrayAlternate == 'even') { - - if (areaNumber > areaGreatestX) { - - areaGreatestX = areaNumber; - - if (i === 0) { - areaSmallestX = areaGreatestX; - } - } - - if (areaNumber < areaSmallestX) { - areaSmallestX = areaNumber; - } - - arrayAlternate = 'odd'; - } - else { - if (areaNumber > areaGreatestY) { - - areaGreatestY = areaNumber; - - if (i == 1) { - areaSmallestY = areaGreatestY; - } - } - - if (areaNumber < areaSmallestY) { - areaSmallestY = areaNumber; - } - - arrayAlternate = 'even'; - } - } - - geo.origin.size.height = areaGreatestY - areaSmallestY; - geo.origin.size.width = areaGreatestX - areaSmallestX; - - geo.origin.windowOffset.left += areaSmallestX; - geo.origin.windowOffset.top += areaSmallestY; - - break; - } - } - } - - // user callback through an event - var edit = function(r) { - geo.origin.size.height = r.height, - geo.origin.windowOffset.left = r.left, - geo.origin.windowOffset.top = r.top, - geo.origin.size.width = r.width - }; - - self._trigger({ - type: 'geometry', - edit: edit, - geometry: { - height: geo.origin.size.height, - left: geo.origin.windowOffset.left, - top: geo.origin.windowOffset.top, - width: geo.origin.size.width - } - }); - - // calculate the remaining properties with what we got - - geo.origin.windowOffset.right = geo.origin.windowOffset.left + geo.origin.size.width; - geo.origin.windowOffset.bottom = geo.origin.windowOffset.top + geo.origin.size.height; - - geo.origin.offset.left = geo.origin.windowOffset.left + geo.window.scroll.left; - geo.origin.offset.top = geo.origin.windowOffset.top + geo.window.scroll.top; - geo.origin.offset.bottom = geo.origin.offset.top + geo.origin.size.height; - geo.origin.offset.right = geo.origin.offset.left + geo.origin.size.width; - - // the space that is available to display the tooltip relatively to the document - geo.available.document = { - bottom: { - height: geo.document.size.height - geo.origin.offset.bottom, - width: geo.document.size.width - }, - left: { - height: geo.document.size.height, - width: geo.origin.offset.left - }, - right: { - height: geo.document.size.height, - width: geo.document.size.width - geo.origin.offset.right - }, - top: { - height: geo.origin.offset.top, - width: geo.document.size.width - } - }; - - // the space that is available to display the tooltip relatively to the viewport - // (the resulting values may be negative if the origin overflows the viewport) - geo.available.window = { - bottom: { - // the inner max is here to make sure the available height is no bigger - // than the viewport height (when the origin is off screen at the top). - // The outer max just makes sure that the height is not negative (when - // the origin overflows at the bottom). - height: Math.max(geo.window.size.height - Math.max(geo.origin.windowOffset.bottom, 0), 0), - width: geo.window.size.width - }, - left: { - height: geo.window.size.height, - width: Math.max(geo.origin.windowOffset.left, 0) - }, - right: { - height: geo.window.size.height, - width: Math.max(geo.window.size.width - Math.max(geo.origin.windowOffset.right, 0), 0) - }, - top: { - height: Math.max(geo.origin.windowOffset.top, 0), - width: geo.window.size.width - } - }; - - while ($parent[0].tagName.toLowerCase() != 'html') { - - if ($parent.css('position') == 'fixed') { - geo.origin.fixedLineage = true; - break; - } - - $parent = $parent.parent(); - } - - return geo; - }, - - /** - * Some options may need to be formated before being used - * - * @returns {self} - * @private - */ - __optionsFormat: function() { - - if (typeof this.__options.animationDuration == 'number') { - this.__options.animationDuration = [this.__options.animationDuration, this.__options.animationDuration]; - } - - if (typeof this.__options.delay == 'number') { - this.__options.delay = [this.__options.delay, this.__options.delay]; - } - - if (typeof this.__options.delayTouch == 'number') { - this.__options.delayTouch = [this.__options.delayTouch, this.__options.delayTouch]; - } - - if (typeof this.__options.theme == 'string') { - this.__options.theme = [this.__options.theme]; - } - - // determine the future parent - if (this.__options.parent === null) { - this.__options.parent = $(env.window.document.body); - } - else if (typeof this.__options.parent == 'string') { - this.__options.parent = $(this.__options.parent); - } - - if (this.__options.trigger == 'hover') { - - this.__options.triggerOpen = { - mouseenter: true, - touchstart: true - }; - - this.__options.triggerClose = { - mouseleave: true, - originClick: true, - touchleave: true - }; - } - else if (this.__options.trigger == 'click') { - - this.__options.triggerOpen = { - click: true, - tap: true - }; - - this.__options.triggerClose = { - click: true, - tap: true - }; - } - - // for the plugins - this._trigger('options'); - - return this; - }, - - /** - * Schedules or cancels the garbage collector task - * - * @returns {self} - * @private - */ - __prepareGC: function() { - - var self = this; - - // in case the selfDestruction option has been changed by a method call - if (self.__options.selfDestruction) { - - // the GC task - self.__garbageCollector = setInterval(function() { - - var now = new Date().getTime(); - - // forget the old events - self.__touchEvents = $.grep(self.__touchEvents, function(event, i) { - // 1 minute - return now - event.time > 60000; - }); - - // auto-destruct if the origin is gone - if (!bodyContains(self._$origin)) { - - self.close(function(){ - self.destroy(); - }); - } - }, 20000); - } - else { - clearInterval(self.__garbageCollector); - } - - return self; - }, - - /** - * Sets listeners on the origin if the open triggers require them. - * Unlike the listeners set at opening time, these ones - * remain even when the tooltip is closed. It has been made a - * separate method so it can be called when the triggers are - * changed in the options. Closing is handled in _open() - * because of the bindings that may be needed on the tooltip - * itself - * - * @returns {self} - * @private - */ - __prepareOrigin: function() { - - var self = this; - - // in case we're resetting the triggers - self._$origin.off('.'+ self.__namespace +'-triggerOpen'); - - // if the device is touch capable, even if only mouse triggers - // are asked, we need to listen to touch events to know if the mouse - // events are actually emulated (so we can ignore them) - if (env.hasTouchCapability) { - - self._$origin.on( - 'touchstart.'+ self.__namespace +'-triggerOpen ' + - 'touchend.'+ self.__namespace +'-triggerOpen ' + - 'touchcancel.'+ self.__namespace +'-triggerOpen', - function(event){ - self._touchRecordEvent(event); - } - ); - } - - // mouse click and touch tap work the same way - if ( self.__options.triggerOpen.click - || (self.__options.triggerOpen.tap && env.hasTouchCapability) - ) { - - var eventNames = ''; - if (self.__options.triggerOpen.click) { - eventNames += 'click.'+ self.__namespace +'-triggerOpen '; - } - if (self.__options.triggerOpen.tap && env.hasTouchCapability) { - eventNames += 'touchend.'+ self.__namespace +'-triggerOpen'; - } - - self._$origin.on(eventNames, function(event) { - if (self._touchIsMeaningfulEvent(event)) { - self._open(event); - } - }); - } - - // mouseenter and touch start work the same way - if ( self.__options.triggerOpen.mouseenter - || (self.__options.triggerOpen.touchstart && env.hasTouchCapability) - ) { - - var eventNames = ''; - if (self.__options.triggerOpen.mouseenter) { - eventNames += 'mouseenter.'+ self.__namespace +'-triggerOpen '; - } - if (self.__options.triggerOpen.touchstart && env.hasTouchCapability) { - eventNames += 'touchstart.'+ self.__namespace +'-triggerOpen'; - } - - self._$origin.on(eventNames, function(event) { - if ( self._touchIsTouchEvent(event) - || !self._touchIsEmulatedEvent(event) - ) { - self.__pointerIsOverOrigin = true; - self._openShortly(event); - } - }); - } - - // info for the mouseleave/touchleave close triggers when they use a delay - if ( self.__options.triggerClose.mouseleave - || (self.__options.triggerClose.touchleave && env.hasTouchCapability) - ) { - - var eventNames = ''; - if (self.__options.triggerClose.mouseleave) { - eventNames += 'mouseleave.'+ self.__namespace +'-triggerOpen '; - } - if (self.__options.triggerClose.touchleave && env.hasTouchCapability) { - eventNames += 'touchend.'+ self.__namespace +'-triggerOpen touchcancel.'+ self.__namespace +'-triggerOpen'; - } - - self._$origin.on(eventNames, function(event) { - - if (self._touchIsMeaningfulEvent(event)) { - self.__pointerIsOverOrigin = false; - } - }); - } - - return self; - }, - - /** - * Do the things that need to be done only once after the tooltip - * HTML element it has been created. It has been made a separate - * method so it can be called when options are changed. Remember - * that the tooltip may actually exist in the DOM before it is - * opened, and present after it has been closed: it's the display - * plugin that takes care of handling it. - * - * @returns {self} - * @private - */ - __prepareTooltip: function() { - - var self = this, - p = self.__options.interactive ? 'auto' : ''; - - // this will be useful to know quickly if the tooltip is in - // the DOM or not - self._$tooltip - .attr('id', self.__namespace) - .css({ - // pointer events - 'pointer-events': p, - zIndex: self.__options.zIndex - }); - - // themes - // remove the old ones and add the new ones - $.each(self.__previousThemes, function(i, theme) { - self._$tooltip.removeClass(theme); - }); - $.each(self.__options.theme, function(i, theme) { - self._$tooltip.addClass(theme); - }); - - self.__previousThemes = $.merge([], self.__options.theme); - - return self; - }, - - /** - * Handles the scroll on any of the parents of the origin (when the - * tooltip is open) - * - * @param {object} event - * @returns {self} - * @private - */ - __scrollHandler: function(event) { - - var self = this; - - if (self.__options.triggerClose.scroll) { - self._close(event); - } - else { - - // if the origin or tooltip have been removed: do nothing, the tracker will - // take care of it later - if (bodyContains(self._$origin) && bodyContains(self._$tooltip)) { - - var geo = null; - - // if the scroll happened on the window - if (event.target === env.window.document) { - - // if the origin has a fixed lineage, window scroll will have no - // effect on its position nor on the position of the tooltip - if (!self.__Geometry.origin.fixedLineage) { - - // we don't need to do anything unless repositionOnScroll is true - // because the tooltip will already have moved with the window - // (and of course with the origin) - if (self.__options.repositionOnScroll) { - self.reposition(event); - } - } - } - // if the scroll happened on another parent of the tooltip, it means - // that it's in a scrollable area and now needs to have its position - // adjusted or recomputed, depending ont the repositionOnScroll - // option. Also, if the origin is partly hidden due to a parent that - // hides its overflow, we'll just hide (not close) the tooltip. - else { - - geo = self.__geometry(); - - var overflows = false; - - // a fixed position origin is not affected by the overflow hiding - // of a parent - if (self._$origin.css('position') != 'fixed') { - - self.__$originParents.each(function(i, el) { - - var $el = $(el), - overflowX = $el.css('overflow-x'), - overflowY = $el.css('overflow-y'); - - if (overflowX != 'visible' || overflowY != 'visible') { - - var bcr = el.getBoundingClientRect(); - - if (overflowX != 'visible') { - - if ( geo.origin.windowOffset.left < bcr.left - || geo.origin.windowOffset.right > bcr.right - ) { - overflows = true; - return false; - } - } - - if (overflowY != 'visible') { - - if ( geo.origin.windowOffset.top < bcr.top - || geo.origin.windowOffset.bottom > bcr.bottom - ) { - overflows = true; - return false; - } - } - } - - // no need to go further if fixed, for the same reason as above - if ($el.css('position') == 'fixed') { - return false; - } - }); - } - - if (overflows) { - self._$tooltip.css('visibility', 'hidden'); - } - else { - - self._$tooltip.css('visibility', 'visible'); - - // reposition - if (self.__options.repositionOnScroll) { - self.reposition(event); - } - // or just adjust offset - else { - - // we have to use offset and not windowOffset because this way, - // only the scroll distance of the scrollable areas are taken into - // account (the scrolltop value of the main window must be - // ignored since the tooltip already moves with it) - var offsetLeft = geo.origin.offset.left - self.__Geometry.origin.offset.left, - offsetTop = geo.origin.offset.top - self.__Geometry.origin.offset.top; - - // add the offset to the position initially computed by the display plugin - self._$tooltip.css({ - left: self.__lastPosition.coord.left + offsetLeft, - top: self.__lastPosition.coord.top + offsetTop - }); - } - } - } - - self._trigger({ - type: 'scroll', - event: event, - geo: geo - }); - } - } - - return self; - }, - - /** - * Changes the state of the tooltip - * - * @param {string} state - * @returns {self} - * @private - */ - __stateSet: function(state) { - - this.__state = state; - - this._trigger({ - type: 'state', - state: state - }); - - return this; - }, - - /** - * Clear appearance timeouts - * - * @returns {self} - * @private - */ - __timeoutsClear: function() { - - // there is only one possible open timeout: the delayed opening - // when the mouseenter/touchstart open triggers are used - clearTimeout(this.__timeouts.open); - this.__timeouts.open = null; - - // ... but several close timeouts: the delayed closing when the - // mouseleave close trigger is used and the timer option - $.each(this.__timeouts.close, function(i, timeout) { - clearTimeout(timeout); - }); - this.__timeouts.close = []; - - return this; - }, - - /** - * Start the tracker that will make checks at regular intervals - * - * @returns {self} - * @private - */ - __trackerStart: function() { - - var self = this, - $content = self._$tooltip.find('.tooltipster-content'); - - // get the initial content size - if (self.__options.trackTooltip) { - self.__contentBcr = $content[0].getBoundingClientRect(); - } - - self.__tracker = setInterval(function() { - - // if the origin or tooltip elements have been removed. - // Note: we could destroy the instance now if the origin has - // been removed but we'll leave that task to our garbage collector - if (!bodyContains(self._$origin) || !bodyContains(self._$tooltip)) { - self._close(); - } - // if everything is alright - else { - - // compare the former and current positions of the origin to reposition - // the tooltip if need be - if (self.__options.trackOrigin) { - - var g = self.__geometry(), - identical = false; - - // compare size first (a change requires repositioning too) - if (areEqual(g.origin.size, self.__Geometry.origin.size)) { - - // for elements that have a fixed lineage (see __geometry()), we track the - // top and left properties (relative to window) - if (self.__Geometry.origin.fixedLineage) { - if (areEqual(g.origin.windowOffset, self.__Geometry.origin.windowOffset)) { - identical = true; - } - } - // otherwise, track total offset (relative to document) - else { - if (areEqual(g.origin.offset, self.__Geometry.origin.offset)) { - identical = true; - } - } - } - - if (!identical) { - - // close the tooltip when using the mouseleave close trigger - // (see https://github.com/calebjacob/tooltipster/pull/253) - if (self.__options.triggerClose.mouseleave) { - self._close(); - } - else { - self.reposition(); - } - } - } - - if (self.__options.trackTooltip) { - - var currentBcr = $content[0].getBoundingClientRect(); - - if ( currentBcr.height !== self.__contentBcr.height - || currentBcr.width !== self.__contentBcr.width - ) { - self.reposition(); - self.__contentBcr = currentBcr; - } - } - } - }, self.__options.trackerInterval); - - return self; - }, - - /** - * Closes the tooltip (after the closing delay) - * - * @param event - * @param callback - * @param force Set to true to override a potential refusal of the user's function - * @returns {self} - * @protected - */ - _close: function(event, callback, force) { - - var self = this, - ok = true; - - self._trigger({ - type: 'close', - event: event, - stop: function() { - ok = false; - } - }); - - // a destroying tooltip (force == true) may not refuse to close - if (ok || force) { - - // save the method custom callback and cancel any open method custom callbacks - if (callback) self.__callbacks.close.push(callback); - self.__callbacks.open = []; - - // clear open/close timeouts - self.__timeoutsClear(); - - var finishCallbacks = function() { - - // trigger any close method custom callbacks and reset them - $.each(self.__callbacks.close, function(i,c) { - c.call(self, self, { - event: event, - origin: self._$origin[0] - }); - }); - - self.__callbacks.close = []; - }; - - if (self.__state != 'closed') { - - var necessary = true, - d = new Date(), - now = d.getTime(), - newClosingTime = now + self.__options.animationDuration[1]; - - // the tooltip may already already be disappearing, but if a new - // call to close() is made after the animationDuration was changed - // to 0 (for example), we ought to actually close it sooner than - // previously scheduled. In that case it should be noted that the - // browser will not adapt the animation duration to the new - // animationDuration that was set after the start of the closing - // animation. - // Note: the same thing could be considered at opening, but is not - // really useful since the tooltip is actually opened immediately - // upon a call to _open(). Since it would not make the opening - // animation finish sooner, its sole impact would be to trigger the - // state event and the open callbacks sooner than the actual end of - // the opening animation, which is not great. - if (self.__state == 'disappearing') { - - if ( newClosingTime > self.__closingTime - // in case closing is actually overdue because the script - // execution was suspended. See #679 - && self.__options.animationDuration[1] > 0 - ) { - necessary = false; - } - } - - if (necessary) { - - self.__closingTime = newClosingTime; - - if (self.__state != 'disappearing') { - self.__stateSet('disappearing'); - } - - var finish = function() { - - // stop the tracker - clearInterval(self.__tracker); - - // a "beforeClose" option has been asked several times but would - // probably useless since the content element is still accessible - // via ::content(), and because people can always use listeners - // inside their content to track what's going on. For the sake of - // simplicity, this has been denied. Bur for the rare people who - // really need the option (for old browsers or for the case where - // detaching the content is actually destructive, for file or - // password inputs for example), this event will do the work. - self._trigger({ - type: 'closing', - event: event - }); - - // unbind listeners which are no longer needed - - self._$tooltip - .off('.'+ self.__namespace +'-triggerClose') - .removeClass('tooltipster-dying'); - - // orientationchange, scroll and resize listeners - $(env.window).off('.'+ self.__namespace +'-triggerClose'); - - // scroll listeners - self.__$originParents.each(function(i, el) { - $(el).off('scroll.'+ self.__namespace +'-triggerClose'); - }); - // clear the array to prevent memory leaks - self.__$originParents = null; - - $(env.window.document.body).off('.'+ self.__namespace +'-triggerClose'); - - self._$origin.off('.'+ self.__namespace +'-triggerClose'); - - self._off('dismissable'); - - // a plugin that would like to remove the tooltip from the - // DOM when closed should bind on this - self.__stateSet('closed'); - - // trigger event - self._trigger({ - type: 'after', - event: event - }); - - // call our constructor custom callback function - if (self.__options.functionAfter) { - self.__options.functionAfter.call(self, self, { - event: event, - origin: self._$origin[0] - }); - } - - // call our method custom callbacks functions - finishCallbacks(); - }; - - if (env.hasTransitions) { - - self._$tooltip.css({ - '-moz-animation-duration': self.__options.animationDuration[1] + 'ms', - '-ms-animation-duration': self.__options.animationDuration[1] + 'ms', - '-o-animation-duration': self.__options.animationDuration[1] + 'ms', - '-webkit-animation-duration': self.__options.animationDuration[1] + 'ms', - 'animation-duration': self.__options.animationDuration[1] + 'ms', - 'transition-duration': self.__options.animationDuration[1] + 'ms' - }); - - self._$tooltip - // clear both potential open and close tasks - .clearQueue() - .removeClass('tooltipster-show') - // for transitions only - .addClass('tooltipster-dying'); - - if (self.__options.animationDuration[1] > 0) { - self._$tooltip.delay(self.__options.animationDuration[1]); - } - - self._$tooltip.queue(finish); - } - else { - - self._$tooltip - .stop() - .fadeOut(self.__options.animationDuration[1], finish); - } - } - } - // if the tooltip is already closed, we still need to trigger - // the method custom callbacks - else { - finishCallbacks(); - } - } - - return self; - }, - - /** - * For internal use by plugins, if needed - * - * @returns {self} - * @protected - */ - _off: function() { - this.__$emitterPrivate.off.apply(this.__$emitterPrivate, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * For internal use by plugins, if needed - * - * @returns {self} - * @protected - */ - _on: function() { - this.__$emitterPrivate.on.apply(this.__$emitterPrivate, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * For internal use by plugins, if needed - * - * @returns {self} - * @protected - */ - _one: function() { - this.__$emitterPrivate.one.apply(this.__$emitterPrivate, Array.prototype.slice.apply(arguments)); - return this; - }, - - /** - * Opens the tooltip right away. - * - * @param event - * @param callback Will be called when the opening animation is over - * @returns {self} - * @protected - */ - _open: function(event, callback) { - - var self = this; - - // if the destruction process has not begun and if this was not - // triggered by an unwanted emulated click event - if (!self.__destroying) { - - // check that the origin is still in the DOM - if ( bodyContains(self._$origin) - // if the tooltip is enabled - && self.__enabled - ) { - - var ok = true; - - // if the tooltip is not open yet, we need to call functionBefore. - // otherwise we can jst go on - if (self.__state == 'closed') { - - // trigger an event. The event.stop function allows the callback - // to prevent the opening of the tooltip - self._trigger({ - type: 'before', - event: event, - stop: function() { - ok = false; - } - }); - - if (ok && self.__options.functionBefore) { - - // call our custom function before continuing - ok = self.__options.functionBefore.call(self, self, { - event: event, - origin: self._$origin[0] - }); - } - } - - if (ok !== false) { - - // if there is some content - if (self.__Content !== null) { - - // save the method callback and cancel close method callbacks - if (callback) { - self.__callbacks.open.push(callback); - } - self.__callbacks.close = []; - - // get rid of any appearance timeouts - self.__timeoutsClear(); - - var extraTime, - finish = function() { - - if (self.__state != 'stable') { - self.__stateSet('stable'); - } - - // trigger any open method custom callbacks and reset them - $.each(self.__callbacks.open, function(i,c) { - c.call(self, self, { - origin: self._$origin[0], - tooltip: self._$tooltip[0] - }); - }); - - self.__callbacks.open = []; - }; - - // if the tooltip is already open - if (self.__state !== 'closed') { - - // the timer (if any) will start (or restart) right now - extraTime = 0; - - // if it was disappearing, cancel that - if (self.__state === 'disappearing') { - - self.__stateSet('appearing'); - - if (env.hasTransitions) { - - self._$tooltip - .clearQueue() - .removeClass('tooltipster-dying') - .addClass('tooltipster-show'); - - if (self.__options.animationDuration[0] > 0) { - self._$tooltip.delay(self.__options.animationDuration[0]); - } - - self._$tooltip.queue(finish); - } - else { - // in case the tooltip was currently fading out, bring it back - // to life - self._$tooltip - .stop() - .fadeIn(finish); - } - } - // if the tooltip is already open, we still need to trigger the method - // custom callback - else if (self.__state == 'stable') { - finish(); - } - } - // if the tooltip isn't already open, open it - else { - - // a plugin must bind on this and store the tooltip in this._$tooltip - self.__stateSet('appearing'); - - // the timer (if any) will start when the tooltip has fully appeared - // after its transition - extraTime = self.__options.animationDuration[0]; - - // insert the content inside the tooltip - self.__contentInsert(); - - // reposition the tooltip and attach to the DOM - self.reposition(event, true); - - // animate in the tooltip. If the display plugin wants no css - // animations, it may override the animation option with a - // dummy value that will produce no effect - if (env.hasTransitions) { - - // note: there seems to be an issue with start animations which - // are randomly not played on fast devices in both Chrome and FF, - // couldn't find a way to solve it yet. It seems that applying - // the classes before appending to the DOM helps a little, but - // it messes up some CSS transitions. The issue almost never - // happens when delay[0]==0 though - self._$tooltip - .addClass('tooltipster-'+ self.__options.animation) - .addClass('tooltipster-initial') - .css({ - '-moz-animation-duration': self.__options.animationDuration[0] + 'ms', - '-ms-animation-duration': self.__options.animationDuration[0] + 'ms', - '-o-animation-duration': self.__options.animationDuration[0] + 'ms', - '-webkit-animation-duration': self.__options.animationDuration[0] + 'ms', - 'animation-duration': self.__options.animationDuration[0] + 'ms', - 'transition-duration': self.__options.animationDuration[0] + 'ms' - }); - - setTimeout( - function() { - - // a quick hover may have already triggered a mouseleave - if (self.__state != 'closed') { - - self._$tooltip - .addClass('tooltipster-show') - .removeClass('tooltipster-initial'); - - if (self.__options.animationDuration[0] > 0) { - self._$tooltip.delay(self.__options.animationDuration[0]); - } - - self._$tooltip.queue(finish); - } - }, - 0 - ); - } - else { - - // old browsers will have to live with this - self._$tooltip - .css('display', 'none') - .fadeIn(self.__options.animationDuration[0], finish); - } - - // checks if the origin is removed while the tooltip is open - self.__trackerStart(); - - // NOTE: the listeners below have a '-triggerClose' namespace - // because we'll remove them when the tooltip closes (unlike - // the '-triggerOpen' listeners). So some of them are actually - // not about close triggers, rather about positioning. - - $(env.window) - // reposition on resize - .on('resize.'+ self.__namespace +'-triggerClose', function(e) { - - var $ae = $(document.activeElement); - - // reposition only if the resize event was not triggered upon the opening - // of a virtual keyboard due to an input field being focused within the tooltip - // (otherwise the repositioning would lose the focus) - if ( (!$ae.is('input') && !$ae.is('textarea')) - || !$.contains(self._$tooltip[0], $ae[0]) - ) { - self.reposition(e); - } - }) - // same as below for parents - .on('scroll.'+ self.__namespace +'-triggerClose', function(e) { - self.__scrollHandler(e); - }); - - self.__$originParents = self._$origin.parents(); - - // scrolling may require the tooltip to be moved or even - // repositioned in some cases - self.__$originParents.each(function(i, parent) { - - $(parent).on('scroll.'+ self.__namespace +'-triggerClose', function(e) { - self.__scrollHandler(e); - }); - }); - - if ( self.__options.triggerClose.mouseleave - || (self.__options.triggerClose.touchleave && env.hasTouchCapability) - ) { - - // we use an event to allow users/plugins to control when the mouseleave/touchleave - // close triggers will come to action. It allows to have more triggering elements - // than just the origin and the tooltip for example, or to cancel/delay the closing, - // or to make the tooltip interactive even if it wasn't when it was open, etc. - self._on('dismissable', function(event) { - - if (event.dismissable) { - - if (event.delay) { - - timeout = setTimeout(function() { - // event.event may be undefined - self._close(event.event); - }, event.delay); - - self.__timeouts.close.push(timeout); - } - else { - self._close(event); - } - } - else { - clearTimeout(timeout); - } - }); - - // now set the listeners that will trigger 'dismissable' events - var $elements = self._$origin, - eventNamesIn = '', - eventNamesOut = '', - timeout = null; - - // if we have to allow interaction, bind on the tooltip too - if (self.__options.interactive) { - $elements = $elements.add(self._$tooltip); - } - - if (self.__options.triggerClose.mouseleave) { - eventNamesIn += 'mouseenter.'+ self.__namespace +'-triggerClose '; - eventNamesOut += 'mouseleave.'+ self.__namespace +'-triggerClose '; - } - if (self.__options.triggerClose.touchleave && env.hasTouchCapability) { - eventNamesIn += 'touchstart.'+ self.__namespace +'-triggerClose'; - eventNamesOut += 'touchend.'+ self.__namespace +'-triggerClose touchcancel.'+ self.__namespace +'-triggerClose'; - } - - $elements - // close after some time spent outside of the elements - .on(eventNamesOut, function(event) { - - // it's ok if the touch gesture ended up to be a swipe, - // it's still a "touch leave" situation - if ( self._touchIsTouchEvent(event) - || !self._touchIsEmulatedEvent(event) - ) { - - var delay = (event.type == 'mouseleave') ? - self.__options.delay : - self.__options.delayTouch; - - self._trigger({ - delay: delay[1], - dismissable: true, - event: event, - type: 'dismissable' - }); - } - }) - // suspend the mouseleave timeout when the pointer comes back - // over the elements - .on(eventNamesIn, function(event) { - - // it's also ok if the touch event is a swipe gesture - if ( self._touchIsTouchEvent(event) - || !self._touchIsEmulatedEvent(event) - ) { - self._trigger({ - dismissable: false, - event: event, - type: 'dismissable' - }); - } - }); - } - - // close the tooltip when the origin gets a mouse click (common behavior of - // native tooltips) - if (self.__options.triggerClose.originClick) { - - self._$origin.on('click.'+ self.__namespace + '-triggerClose', function(event) { - - // we could actually let a tap trigger this but this feature just - // does not make sense on touch devices - if ( !self._touchIsTouchEvent(event) - && !self._touchIsEmulatedEvent(event) - ) { - self._close(event); - } - }); - } - - // set the same bindings for click and touch on the body to close the tooltip - if ( self.__options.triggerClose.click - || (self.__options.triggerClose.tap && env.hasTouchCapability) - ) { - - // don't set right away since the click/tap event which triggered this method - // (if it was a click/tap) is going to bubble up to the body, we don't want it - // to close the tooltip immediately after it opened - setTimeout(function() { - - if (self.__state != 'closed') { - - var eventNames = '', - $body = $(env.window.document.body); - - if (self.__options.triggerClose.click) { - eventNames += 'click.'+ self.__namespace +'-triggerClose '; - } - if (self.__options.triggerClose.tap && env.hasTouchCapability) { - eventNames += 'touchend.'+ self.__namespace +'-triggerClose'; - } - - $body.on(eventNames, function(event) { - - if (self._touchIsMeaningfulEvent(event)) { - - self._touchRecordEvent(event); - - if (!self.__options.interactive || !$.contains(self._$tooltip[0], event.target)) { - self._close(event); - } - } - }); - - // needed to detect and ignore swiping - if (self.__options.triggerClose.tap && env.hasTouchCapability) { - - $body.on('touchstart.'+ self.__namespace +'-triggerClose', function(event) { - self._touchRecordEvent(event); - }); - } - } - }, 0); - } - - self._trigger('ready'); - - // call our custom callback - if (self.__options.functionReady) { - self.__options.functionReady.call(self, self, { - origin: self._$origin[0], - tooltip: self._$tooltip[0] - }); - } - } - - // if we have a timer set, let the countdown begin - if (self.__options.timer > 0) { - - var timeout = setTimeout(function() { - self._close(); - }, self.__options.timer + extraTime); - - self.__timeouts.close.push(timeout); - } - } - } - } - } - - return self; - }, - - /** - * When using the mouseenter/touchstart open triggers, this function will - * schedule the opening of the tooltip after the delay, if there is one - * - * @param event - * @returns {self} - * @protected - */ - _openShortly: function(event) { - - var self = this, - ok = true; - - if (self.__state != 'stable' && self.__state != 'appearing') { - - // if a timeout is not already running - if (!self.__timeouts.open) { - - self._trigger({ - type: 'start', - event: event, - stop: function() { - ok = false; - } - }); - - if (ok) { - - var delay = (event.type.indexOf('touch') == 0) ? - self.__options.delayTouch : - self.__options.delay; - - if (delay[0]) { - - self.__timeouts.open = setTimeout(function() { - - self.__timeouts.open = null; - - // open only if the pointer (mouse or touch) is still over the origin. - // The check on the "meaningful event" can only be made here, after some - // time has passed (to know if the touch was a swipe or not) - if (self.__pointerIsOverOrigin && self._touchIsMeaningfulEvent(event)) { - - // signal that we go on - self._trigger('startend'); - - self._open(event); - } - else { - // signal that we cancel - self._trigger('startcancel'); - } - }, delay[0]); - } - else { - // signal that we go on - self._trigger('startend'); - - self._open(event); - } - } - } - } - - return self; - }, - - /** - * Meant for plugins to get their options - * - * @param {string} pluginName The name of the plugin that asks for its options - * @param {object} defaultOptions The default options of the plugin - * @returns {object} The options - * @protected - */ - _optionsExtract: function(pluginName, defaultOptions) { - - var self = this, - options = $.extend(true, {}, defaultOptions); - - // if the plugin options were isolated in a property named after the - // plugin, use them (prevents conflicts with other plugins) - var pluginOptions = self.__options[pluginName]; - - // if not, try to get them as regular options - if (!pluginOptions){ - - pluginOptions = {}; - - $.each(defaultOptions, function(optionName, value) { - - var o = self.__options[optionName]; - - if (o !== undefined) { - pluginOptions[optionName] = o; - } - }); - } - - // let's merge the default options and the ones that were provided. We'd want - // to do a deep copy but not let jQuery merge arrays, so we'll do a shallow - // extend on two levels, that will be enough if options are not more than 1 - // level deep - $.each(options, function(optionName, value) { - - if (pluginOptions[optionName] !== undefined) { - - if (( typeof value == 'object' - && !(value instanceof Array) - && value != null - ) - && - ( typeof pluginOptions[optionName] == 'object' - && !(pluginOptions[optionName] instanceof Array) - && pluginOptions[optionName] != null - ) - ) { - $.extend(options[optionName], pluginOptions[optionName]); - } - else { - options[optionName] = pluginOptions[optionName]; - } - } - }); - - return options; - }, - - /** - * Used at instantiation of the plugin, or afterwards by plugins that activate themselves - * on existing instances - * - * @param {object} pluginName - * @returns {self} - * @protected - */ - _plug: function(pluginName) { - - var plugin = $.tooltipster._plugin(pluginName); - - if (plugin) { - - // if there is a constructor for instances - if (plugin.instance) { - - // proxy non-private methods on the instance to allow new instance methods - $.tooltipster.__bridge(plugin.instance, this, plugin.name); - } - } - else { - throw new Error('The "'+ pluginName +'" plugin is not defined'); - } - - return this; - }, - - /** - * This will return true if the event is a mouse event which was - * emulated by the browser after a touch event. This allows us to - * really dissociate mouse and touch triggers. - * - * There is a margin of error if a real mouse event is fired right - * after (within the delay shown below) a touch event on the same - * element, but hopefully it should not happen often. - * - * @returns {boolean} - * @protected - */ - _touchIsEmulatedEvent: function(event) { - - var isEmulated = false, - now = new Date().getTime(); - - for (var i = this.__touchEvents.length - 1; i >= 0; i--) { - - var e = this.__touchEvents[i]; - - // delay, in milliseconds. It's supposed to be 300ms in - // most browsers (350ms on iOS) to allow a double tap but - // can be less (check out FastClick for more info) - if (now - e.time < 500) { - - if (e.target === event.target) { - isEmulated = true; - } - } - else { - break; - } - } - - return isEmulated; - }, - - /** - * Returns false if the event was an emulated mouse event or - * a touch event involved in a swipe gesture. - * - * @param {object} event - * @returns {boolean} - * @protected - */ - _touchIsMeaningfulEvent: function(event) { - return ( - (this._touchIsTouchEvent(event) && !this._touchSwiped(event.target)) - || (!this._touchIsTouchEvent(event) && !this._touchIsEmulatedEvent(event)) - ); - }, - - /** - * Checks if an event is a touch event - * - * @param {object} event - * @returns {boolean} - * @protected - */ - _touchIsTouchEvent: function(event){ - return event.type.indexOf('touch') == 0; - }, - - /** - * Store touch events for a while to detect swiping and emulated mouse events - * - * @param {object} event - * @returns {self} - * @protected - */ - _touchRecordEvent: function(event) { - - if (this._touchIsTouchEvent(event)) { - event.time = new Date().getTime(); - this.__touchEvents.push(event); - } - - return this; - }, - - /** - * Returns true if a swipe happened after the last touchstart event fired on - * event.target. - * - * We need to differentiate a swipe from a tap before we let the event open - * or close the tooltip. A swipe is when a touchmove (scroll) event happens - * on the body between the touchstart and the touchend events of an element. - * - * @param {object} target The HTML element that may have triggered the swipe - * @returns {boolean} - * @protected - */ - _touchSwiped: function(target) { - - var swiped = false; - - for (var i = this.__touchEvents.length - 1; i >= 0; i--) { - - var e = this.__touchEvents[i]; - - if (e.type == 'touchmove') { - swiped = true; - break; - } - else if ( - e.type == 'touchstart' - && target === e.target - ) { - break; - } - } - - return swiped; - }, - - /** - * Triggers an event on the instance emitters - * - * @returns {self} - * @protected - */ - _trigger: function() { - - var args = Array.prototype.slice.apply(arguments); - - if (typeof args[0] == 'string') { - args[0] = { type: args[0] }; - } - - // add properties to the event - args[0].instance = this; - args[0].origin = this._$origin ? this._$origin[0] : null; - args[0].tooltip = this._$tooltip ? this._$tooltip[0] : null; - - // note: the order of emitters matters - this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate, args); - $.tooltipster._trigger.apply($.tooltipster, args); - this.__$emitterPublic.trigger.apply(this.__$emitterPublic, args); - - return this; - }, - - /** - * Deactivate a plugin on this instance - * - * @returns {self} - * @protected - */ - _unplug: function(pluginName) { - - var self = this; - - // if the plugin has been activated on this instance - if (self[pluginName]) { - - var plugin = $.tooltipster._plugin(pluginName); - - // if there is a constructor for instances - if (plugin.instance) { - - // unbridge - $.each(plugin.instance, function(methodName, fn) { - - // if the method exists (privates methods do not) and comes indeed from - // this plugin (may be missing or come from a conflicting plugin). - if ( self[methodName] - && self[methodName].bridged === self[pluginName] - ) { - delete self[methodName]; - } - }); - } - - // destroy the plugin - if (self[pluginName].__destroy) { - self[pluginName].__destroy(); - } - - // remove the reference to the plugin instance - delete self[pluginName]; - } - - return self; - }, - - /** - * @see self::_close - * @returns {self} - * @public - */ - close: function(callback) { - - if (!this.__destroyed) { - this._close(null, callback); - } - else { - this.__destroyError(); - } - - return this; - }, - - /** - * Sets or gets the content of the tooltip - * - * @returns {mixed|self} - * @public - */ - content: function(content) { - - var self = this; - - // getter method - if (content === undefined) { - return self.__Content; - } - // setter method - else { - - if (!self.__destroyed) { - - // change the content - self.__contentSet(content); - - if (self.__Content !== null) { - - // update the tooltip if it is open - if (self.__state !== 'closed') { - - // reset the content in the tooltip - self.__contentInsert(); - - // reposition and resize the tooltip - self.reposition(); - - // if we want to play a little animation showing the content changed - if (self.__options.updateAnimation) { - - if (env.hasTransitions) { - - // keep the reference in the local scope - var animation = self.__options.updateAnimation; - - self._$tooltip.addClass('tooltipster-update-'+ animation); - - // remove the class after a while. The actual duration of the - // update animation may be shorter, it's set in the CSS rules - setTimeout(function() { - - if (self.__state != 'closed') { - - self._$tooltip.removeClass('tooltipster-update-'+ animation); - } - }, 1000); - } - else { - self._$tooltip.fadeTo(200, 0.5, function() { - if (self.__state != 'closed') { - self._$tooltip.fadeTo(200, 1); - } - }); - } - } - } - } - else { - self._close(); - } - } - else { - self.__destroyError(); - } - - return self; - } - }, - - /** - * Destroys the tooltip - * - * @returns {self} - * @public - */ - destroy: function() { - - var self = this; - - if (!self.__destroyed) { - - if(self.__state != 'closed'){ - - // no closing delay - self.option('animationDuration', 0) - // force closing - ._close(null, null, true); - } - else { - // there might be an open timeout still running - self.__timeoutsClear(); - } - - // send event - self._trigger('destroy'); - - self.__destroyed = true; - - self._$origin - .removeData(self.__namespace) - // remove the open trigger listeners - .off('.'+ self.__namespace +'-triggerOpen'); - - // remove the touch listener - $(env.window.document.body).off('.' + self.__namespace +'-triggerOpen'); - - var ns = self._$origin.data('tooltipster-ns'); - - // if the origin has been removed from DOM, its data may - // well have been destroyed in the process and there would - // be nothing to clean up or restore - if (ns) { - - // if there are no more tooltips on this element - if (ns.length === 1) { - - // optional restoration of a title attribute - var title = null; - if (self.__options.restoration == 'previous') { - title = self._$origin.data('tooltipster-initialTitle'); - } - else if (self.__options.restoration == 'current') { - - // old school technique to stringify when outerHTML is not supported - title = (typeof self.__Content == 'string') ? - self.__Content : - $('<div></div>').append(self.__Content).html(); - } - - if (title) { - self._$origin.attr('title', title); - } - - // final cleaning - - self._$origin.removeClass('tooltipstered'); - - self._$origin - .removeData('tooltipster-ns') - .removeData('tooltipster-initialTitle'); - } - else { - // remove the instance namespace from the list of namespaces of - // tooltips present on the element - ns = $.grep(ns, function(el, i) { - return el !== self.__namespace; - }); - self._$origin.data('tooltipster-ns', ns); - } - } - - // last event - self._trigger('destroyed'); - - // unbind private and public event listeners - self._off(); - self.off(); - - // remove external references, just in case - self.__Content = null; - self.__$emitterPrivate = null; - self.__$emitterPublic = null; - self.__options.parent = null; - self._$origin = null; - self._$tooltip = null; - - // make sure the object is no longer referenced in there to prevent - // memory leaks - $.tooltipster.__instancesLatestArr = $.grep($.tooltipster.__instancesLatestArr, function(el, i) { - return self !== el; - }); - - clearInterval(self.__garbageCollector); - } - else { - self.__destroyError(); - } - - // we return the scope rather than true so that the call to - // .tooltipster('destroy') actually returns the matched elements - // and applies to all of them - return self; - }, - - /** - * Disables the tooltip - * - * @returns {self} - * @public - */ - disable: function() { - - if (!this.__destroyed) { - - // close first, in case the tooltip would not disappear on - // its own (no close trigger) - this._close(); - this.__enabled = false; - - return this; - } - else { - this.__destroyError(); - } - - return this; - }, - - /** - * Returns the HTML element of the origin - * - * @returns {self} - * @public - */ - elementOrigin: function() { - - if (!this.__destroyed) { - return this._$origin[0]; - } - else { - this.__destroyError(); - } - }, - - /** - * Returns the HTML element of the tooltip - * - * @returns {self} - * @public - */ - elementTooltip: function() { - return this._$tooltip ? this._$tooltip[0] : null; - }, - - /** - * Enables the tooltip - * - * @returns {self} - * @public - */ - enable: function() { - this.__enabled = true; - return this; - }, - - /** - * Alias, deprecated in 4.0.0 - * - * @param {function} callback - * @returns {self} - * @public - */ - hide: function(callback) { - return this.close(callback); - }, - - /** - * Returns the instance - * - * @returns {self} - * @public - */ - instance: function() { - return this; - }, - - /** - * For public use only, not to be used by plugins (use ::_off() instead) - * - * @returns {self} - * @public - */ - off: function() { - - if (!this.__destroyed) { - this.__$emitterPublic.off.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - } - - return this; - }, - - /** - * For public use only, not to be used by plugins (use ::_on() instead) - * - * @returns {self} - * @public - */ - on: function() { - - if (!this.__destroyed) { - this.__$emitterPublic.on.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - } - else { - this.__destroyError(); - } - - return this; - }, - - /** - * For public use only, not to be used by plugins - * - * @returns {self} - * @public - */ - one: function() { - - if (!this.__destroyed) { - this.__$emitterPublic.one.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - } - else { - this.__destroyError(); - } - - return this; - }, - - /** - * @see self::_open - * @returns {self} - * @public - */ - open: function(callback) { - - if (!this.__destroyed) { - this._open(null, callback); - } - else { - this.__destroyError(); - } - - return this; - }, - - /** - * Get or set options. For internal use and advanced users only. - * - * @param {string} o Option name - * @param {mixed} val optional A new value for the option - * @return {mixed|self} If val is omitted, the value of the option - * is returned, otherwise the instance itself is returned - * @public - */ - option: function(o, val) { - - // getter - if (val === undefined) { - return this.__options[o]; - } - // setter - else { - - if (!this.__destroyed) { - - // change value - this.__options[o] = val; - - // format - this.__optionsFormat(); - - // re-prepare the triggers if needed - if ($.inArray(o, ['trigger', 'triggerClose', 'triggerOpen']) >= 0) { - this.__prepareOrigin(); - } - - if (o === 'selfDestruction') { - this.__prepareGC(); - } - } - else { - this.__destroyError(); - } - - return this; - } - }, - - /** - * This method is in charge of setting the position and size properties of the tooltip. - * All the hard work is delegated to the display plugin. - * Note: The tooltip may be detached from the DOM at the moment the method is called - * but must be attached by the end of the method call. - * - * @param {object} event For internal use only. Defined if an event such as - * window resizing triggered the repositioning - * @param {boolean} tooltipIsDetached For internal use only. Set this to true if you - * know that the tooltip not being in the DOM is not an issue (typically when the - * tooltip element has just been created but has not been added to the DOM yet). - * @returns {self} - * @public - */ - reposition: function(event, tooltipIsDetached) { - - var self = this; - - if (!self.__destroyed) { - - // if the tooltip is still open and the origin is still in the DOM - if (self.__state != 'closed' && bodyContains(self._$origin)) { - - // if the tooltip has not been removed from DOM manually (or if it - // has been detached on purpose) - if (tooltipIsDetached || bodyContains(self._$tooltip)) { - - if (!tooltipIsDetached) { - // detach in case the tooltip overflows the window and adds - // scrollbars to it, so __geometry can be accurate - self._$tooltip.detach(); - } - - // refresh the geometry object before passing it as a helper - self.__Geometry = self.__geometry(); - - // let a plugin fo the rest - self._trigger({ - type: 'reposition', - event: event, - helper: { - geo: self.__Geometry - } - }); - } - } - } - else { - self.__destroyError(); - } - - return self; - }, - - /** - * Alias, deprecated in 4.0.0 - * - * @param callback - * @returns {self} - * @public - */ - show: function(callback) { - return this.open(callback); - }, - - /** - * Returns some properties about the instance - * - * @returns {object} - * @public - */ - status: function() { - - return { - destroyed: this.__destroyed, - enabled: this.__enabled, - open: this.__state !== 'closed', - state: this.__state - }; - }, - - /** - * For public use only, not to be used by plugins - * - * @returns {self} - * @public - */ - triggerHandler: function() { - - if (!this.__destroyed) { - this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic, Array.prototype.slice.apply(arguments)); - } - else { - this.__destroyError(); - } - - return this; - } -}; - -$.fn.tooltipster = function() { - - // for using in closures - var args = Array.prototype.slice.apply(arguments), - // common mistake: an HTML element can't be in several tooltips at the same time - contentCloningWarning = 'You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.'; - - // this happens with $(sel).tooltipster(...) when $(sel) does not match anything - if (this.length === 0) { - - // still chainable - return this; - } - // this happens when calling $(sel).tooltipster('methodName or options') - // where $(sel) matches one or more elements - else { - - // method calls - if (typeof args[0] === 'string') { - - var v = '#*$~&'; - - this.each(function() { - - // retrieve the namepaces of the tooltip(s) that exist on that element. - // We will interact with the first tooltip only. - var ns = $(this).data('tooltipster-ns'), - // self represents the instance of the first tooltipster plugin - // associated to the current HTML object of the loop - self = ns ? $(this).data(ns[0]) : null; - - // if the current element holds a tooltipster instance - if (self) { - - if (typeof self[args[0]] === 'function') { - - if ( this.length > 1 - && args[0] == 'content' - && ( args[1] instanceof $ - || (typeof args[1] == 'object' && args[1] != null && args[1].tagName) - ) - && !self.__options.contentCloning - && self.__options.debug - ) { - console.log(contentCloningWarning); - } - - // note : args[1] and args[2] may not be defined - var resp = self[args[0]](args[1], args[2]); - } - else { - throw new Error('Unknown method "'+ args[0] +'"'); - } - - // if the function returned anything other than the instance - // itself (which implies chaining, except for the `instance` method) - if (resp !== self || args[0] === 'instance') { - - v = resp; - - // return false to stop .each iteration on the first element - // matched by the selector - return false; - } - } - else { - throw new Error('You called Tooltipster\'s "'+ args[0] +'" method on an uninitialized element'); - } - }); - - return (v !== '#*$~&') ? v : this; - } - // first argument is undefined or an object: the tooltip is initializing - else { - - // reset the array of last initialized objects - $.tooltipster.__instancesLatestArr = []; - - // is there a defined value for the multiple option in the options object ? - var multipleIsSet = args[0] && args[0].multiple !== undefined, - // if the multiple option is set to true, or if it's not defined but - // set to true in the defaults - multiple = (multipleIsSet && args[0].multiple) || (!multipleIsSet && defaults.multiple), - // same for content - contentIsSet = args[0] && args[0].content !== undefined, - content = (contentIsSet && args[0].content) || (!contentIsSet && defaults.content), - // same for contentCloning - contentCloningIsSet = args[0] && args[0].contentCloning !== undefined, - contentCloning = - (contentCloningIsSet && args[0].contentCloning) - || (!contentCloningIsSet && defaults.contentCloning), - // same for debug - debugIsSet = args[0] && args[0].debug !== undefined, - debug = (debugIsSet && args[0].debug) || (!debugIsSet && defaults.debug); - - if ( this.length > 1 - && ( content instanceof $ - || (typeof content == 'object' && content != null && content.tagName) - ) - && !contentCloning - && debug - ) { - console.log(contentCloningWarning); - } - - // create a tooltipster instance for each element if it doesn't - // already have one or if the multiple option is set, and attach the - // object to it - this.each(function() { - - var go = false, - $this = $(this), - ns = $this.data('tooltipster-ns'), - obj = null; - - if (!ns) { - go = true; - } - else if (multiple) { - go = true; - } - else if (debug) { - console.log('Tooltipster: one or more tooltips are already attached to the element below. Ignoring.'); - console.log(this); - } - - if (go) { - obj = new $.Tooltipster(this, args[0]); - - // save the reference of the new instance - if (!ns) ns = []; - ns.push(obj.__namespace); - $this.data('tooltipster-ns', ns); - - // save the instance itself - $this.data(obj.__namespace, obj); - - // call our constructor custom function. - // we do this here and not in ::init() because we wanted - // the object to be saved in $this.data before triggering - // it - if (obj.__options.functionInit) { - obj.__options.functionInit.call(obj, obj, { - origin: this - }); - } - - // and now the event, for the plugins and core emitter - obj._trigger('init'); - } - - $.tooltipster.__instancesLatestArr.push(obj); - }); - - return this; - } - } -}; - -// Utilities - -/** - * A class to check if a tooltip can fit in given dimensions - * - * @param {object} $tooltip The jQuery wrapped tooltip element, or a clone of it - */ -function Ruler($tooltip) { - - // list of instance variables - - this.$container; - this.constraints = null; - this.__$tooltip; - - this.__init($tooltip); -} - -Ruler.prototype = { - - /** - * Move the tooltip into an invisible div that does not allow overflow to make - * size tests. Note: the tooltip may or may not be attached to the DOM at the - * moment this method is called, it does not matter. - * - * @param {object} $tooltip The object to test. May be just a clone of the - * actual tooltip. - * @private - */ - __init: function($tooltip) { - - this.__$tooltip = $tooltip; - - this.__$tooltip - .css({ - // for some reason we have to specify top and left 0 - left: 0, - // any overflow will be ignored while measuring - overflow: 'hidden', - // positions at (0,0) without the div using 100% of the available width - position: 'absolute', - top: 0 - }) - // overflow must be auto during the test. We re-set this in case - // it were modified by the user - .find('.tooltipster-content') - .css('overflow', 'auto'); - - this.$container = $('<div class="tooltipster-ruler"></div>') - .append(this.__$tooltip) - .appendTo(env.window.document.body); - }, - - /** - * Force the browser to redraw (re-render) the tooltip immediately. This is required - * when you changed some CSS properties and need to make something with it - * immediately, without waiting for the browser to redraw at the end of instructions. - * - * @see http://stackoverflow.com/questions/3485365/how-can-i-force-webkit-to-redraw-repaint-to-propagate-style-changes - * @private - */ - __forceRedraw: function() { - - // note: this would work but for Webkit only - //this.__$tooltip.close(); - //this.__$tooltip[0].offsetHeight; - //this.__$tooltip.open(); - - // works in FF too - var $p = this.__$tooltip.parent(); - this.__$tooltip.detach(); - this.__$tooltip.appendTo($p); - }, - - /** - * Set maximum dimensions for the tooltip. A call to ::measure afterwards - * will tell us if the content overflows or if it's ok - * - * @param {int} width - * @param {int} height - * @return {Ruler} - * @public - */ - constrain: function(width, height) { - - this.constraints = { - width: width, - height: height - }; - - this.__$tooltip.css({ - // we disable display:flex, otherwise the content would overflow without - // creating horizontal scrolling (which we need to detect). - display: 'block', - // reset any previous height - height: '', - // we'll check if horizontal scrolling occurs - overflow: 'auto', - // we'll set the width and see what height is generated and if there - // is horizontal overflow - width: width - }); - - return this; - }, - - /** - * Reset the tooltip content overflow and remove the test container - * - * @returns {Ruler} - * @public - */ - destroy: function() { - - // in case the element was not a clone - this.__$tooltip - .detach() - .find('.tooltipster-content') - .css({ - // reset to CSS value - display: '', - overflow: '' - }); - - this.$container.remove(); - }, - - /** - * Removes any constraints - * - * @returns {Ruler} - * @public - */ - free: function() { - - this.constraints = null; - - // reset to natural size - this.__$tooltip.css({ - display: '', - height: '', - overflow: 'visible', - width: '' - }); - - return this; - }, - - /** - * Returns the size of the tooltip. When constraints are applied, also returns - * whether the tooltip fits in the provided dimensions. - * The idea is to see if the new height is small enough and if the content does - * not overflow horizontally. - * - * @param {int} width - * @param {int} height - * @returns {object} An object with a bool `fits` property and a `size` property - * @public - */ - measure: function() { - - this.__forceRedraw(); - - var tooltipBcr = this.__$tooltip[0].getBoundingClientRect(), - result = { size: { - // bcr.width/height are not defined in IE8- but in this - // case, bcr.right/bottom will have the same value - // except in iOS 8+ where tooltipBcr.bottom/right are wrong - // after scrolling for reasons yet to be determined. - // tooltipBcr.top/left might not be 0, see issue #514 - height: tooltipBcr.height || (tooltipBcr.bottom - tooltipBcr.top), - width: tooltipBcr.width || (tooltipBcr.right - tooltipBcr.left) - }}; - - if (this.constraints) { - - // note: we used to use offsetWidth instead of boundingRectClient but - // it returned rounded values, causing issues with sub-pixel layouts. - - // note2: noticed that the bcrWidth of text content of a div was once - // greater than the bcrWidth of its container by 1px, causing the final - // tooltip box to be too small for its content. However, evaluating - // their widths one against the other (below) surprisingly returned - // equality. Happened only once in Chrome 48, was not able to reproduce - // => just having fun with float position values... - - var $content = this.__$tooltip.find('.tooltipster-content'), - height = this.__$tooltip.outerHeight(), - contentBcr = $content[0].getBoundingClientRect(), - fits = { - height: height <= this.constraints.height, - width: ( - // this condition accounts for min-width property that - // may apply - tooltipBcr.width <= this.constraints.width - // the -1 is here because scrollWidth actually returns - // a rounded value, and may be greater than bcr.width if - // it was rounded up. This may cause an issue for contents - // which actually really overflow by 1px or so, but that - // should be rare. Not sure how to solve this efficiently. - // See http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx - && contentBcr.width >= $content[0].scrollWidth - 1 - ) - }; - - result.fits = fits.height && fits.width; - } - - // old versions of IE get the width wrong for some reason and it causes - // the text to be broken to a new line, so we round it up. If the width - // is the width of the screen though, we can assume it is accurate. - if ( env.IE - && env.IE <= 11 - && result.size.width !== env.window.document.documentElement.clientWidth - ) { - result.size.width = Math.ceil(result.size.width) + 1; - } - - return result; - } -}; - -// quick & dirty compare function, not bijective nor multidimensional -function areEqual(a,b) { - var same = true; - $.each(a, function(i, _) { - if (b[i] === undefined || a[i] !== b[i]) { - same = false; - return false; - } - }); - return same; -} - -/** - * A fast function to check if an element is still in the DOM. It - * tries to use an id as ids are indexed by the browser, or falls - * back to jQuery's `contains` method. May fail if two elements - * have the same id, but so be it - * - * @param {object} $obj A jQuery-wrapped HTML element - * @return {boolean} - */ -function bodyContains($obj) { - var id = $obj.attr('id'), - el = id ? env.window.document.getElementById(id) : null; - // must also check that the element with the id is the one we want - return el ? el === $obj[0] : $.contains(env.window.document.body, $obj[0]); -} - -// detect IE versions for dirty fixes -var uA = navigator.userAgent.toLowerCase(); -if (uA.indexOf('msie') != -1) env.IE = parseInt(uA.split('msie')[1]); -else if (uA.toLowerCase().indexOf('trident') !== -1 && uA.indexOf(' rv:11') !== -1) env.IE = 11; -else if (uA.toLowerCase().indexOf('edge/') != -1) env.IE = parseInt(uA.toLowerCase().split('edge/')[1]); - -// detecting support for CSS transitions -function transitionSupport() { - - // env.window is not defined yet when this is called - if (!win) return false; - - var b = win.document.body || win.document.documentElement, - s = b.style, - p = 'transition', - v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms']; - - if (typeof s[p] == 'string') { return true; } - - p = p.charAt(0).toUpperCase() + p.substr(1); - for (var i=0; i<v.length; i++) { - if (typeof s[v[i] + p] == 'string') { return true; } - } - return false; -} - -// we'll return jQuery for plugins not to have to declare it as a dependency, -// but it's done by a build task since it should be included only once at the -// end when we concatenate the main file with a plugin -// sideTip is Tooltipster's default plugin. -// This file will be UMDified by a build task. - -var pluginName = 'tooltipster.sideTip'; - -$.tooltipster._plugin({ - name: pluginName, - instance: { - /** - * Defaults are provided as a function for an easy override by inheritance - * - * @return {object} An object with the defaults options - * @private - */ - __defaults: function() { - - return { - // if the tooltip should display an arrow that points to the origin - arrow: true, - // the distance in pixels between the tooltip and the origin - distance: 6, - // allows to easily change the position of the tooltip - functionPosition: null, - maxWidth: null, - // used to accomodate the arrow of tooltip if there is one. - // First to make sure that the arrow target is not too close - // to the edge of the tooltip, so the arrow does not overflow - // the tooltip. Secondly when we reposition the tooltip to - // make sure that it's positioned in such a way that the arrow is - // still pointing at the target (and not a few pixels beyond it). - // It should be equal to or greater than half the width of - // the arrow (by width we mean the size of the side which touches - // the side of the tooltip). - minIntersection: 16, - minWidth: 0, - // deprecated in 4.0.0. Listed for _optionsExtract to pick it up - position: null, - side: 'top', - // set to false to position the tooltip relatively to the document rather - // than the window when we open it - viewportAware: true - }; - }, - - /** - * Run once: at instantiation of the plugin - * - * @param {object} instance The tooltipster object that instantiated this plugin - * @private - */ - __init: function(instance) { - - var self = this; - - // list of instance variables - - self.__instance = instance; - self.__namespace = 'tooltipster-sideTip-'+ Math.round(Math.random()*1000000); - self.__previousState = 'closed'; - self.__options; - - // initial formatting - self.__optionsFormat(); - - self.__instance._on('state.'+ self.__namespace, function(event) { - - if (event.state == 'closed') { - self.__close(); - } - else if (event.state == 'appearing' && self.__previousState == 'closed') { - self.__create(); - } - - self.__previousState = event.state; - }); - - // reformat every time the options are changed - self.__instance._on('options.'+ self.__namespace, function() { - self.__optionsFormat(); - }); - - self.__instance._on('reposition.'+ self.__namespace, function(e) { - self.__reposition(e.event, e.helper); - }); - }, - - /** - * Called when the tooltip has closed - * - * @private - */ - __close: function() { - - // detach our content object first, so the next jQuery's remove() - // call does not unbind its event handlers - if (this.__instance.content() instanceof $) { - this.__instance.content().detach(); - } - - // remove the tooltip from the DOM - this.__instance._$tooltip.remove(); - this.__instance._$tooltip = null; - }, - - /** - * Creates the HTML element of the tooltip. - * - * @private - */ - __create: function() { - - // note: we wrap with a .tooltipster-box div to be able to set a margin on it - // (.tooltipster-base must not have one) - var $html = $( - '<div class="tooltipster-base tooltipster-sidetip">' + - '<div class="tooltipster-box">' + - '<div class="tooltipster-content"></div>' + - '</div>' + - '<div class="tooltipster-arrow">' + - '<div class="tooltipster-arrow-uncropped">' + - '<div class="tooltipster-arrow-border"></div>' + - '<div class="tooltipster-arrow-background"></div>' + - '</div>' + - '</div>' + - '</div>' - ); - - // hide arrow if asked - if (!this.__options.arrow) { - $html - .find('.tooltipster-box') - .css('margin', 0) - .end() - .find('.tooltipster-arrow') - .hide(); - } - - // apply min/max width if asked - if (this.__options.minWidth) { - $html.css('min-width', this.__options.minWidth + 'px'); - } - if (this.__options.maxWidth) { - $html.css('max-width', this.__options.maxWidth + 'px'); - } - - this.__instance._$tooltip = $html; - - // tell the instance that the tooltip element has been created - this.__instance._trigger('created'); - }, - - /** - * Used when the plugin is to be unplugged - * - * @private - */ - __destroy: function() { - this.__instance._off('.'+ self.__namespace); - }, - - /** - * (Re)compute this.__options from the options declared to the instance - * - * @private - */ - __optionsFormat: function() { - - var self = this; - - // get the options - self.__options = self.__instance._optionsExtract(pluginName, self.__defaults()); - - // for backward compatibility, deprecated in v4.0.0 - if (self.__options.position) { - self.__options.side = self.__options.position; - } - - // options formatting - - // format distance as a four-cell array if it ain't one yet and then make - // it an object with top/bottom/left/right properties - if (typeof self.__options.distance != 'object') { - self.__options.distance = [self.__options.distance]; - } - if (self.__options.distance.length < 4) { - if (self.__options.distance[1] === undefined) self.__options.distance[1] = self.__options.distance[0]; - if (self.__options.distance[2] === undefined) self.__options.distance[2] = self.__options.distance[0]; - if (self.__options.distance[3] === undefined) self.__options.distance[3] = self.__options.distance[1]; - } - - self.__options.distance = { - top: self.__options.distance[0], - right: self.__options.distance[1], - bottom: self.__options.distance[2], - left: self.__options.distance[3] - }; - - // let's transform: - // 'top' into ['top', 'bottom', 'right', 'left'] - // 'right' into ['right', 'left', 'top', 'bottom'] - // 'bottom' into ['bottom', 'top', 'right', 'left'] - // 'left' into ['left', 'right', 'top', 'bottom'] - if (typeof self.__options.side == 'string') { - - var opposites = { - 'top': 'bottom', - 'right': 'left', - 'bottom': 'top', - 'left': 'right' - }; - - self.__options.side = [self.__options.side, opposites[self.__options.side]]; - - if (self.__options.side[0] == 'left' || self.__options.side[0] == 'right') { - self.__options.side.push('top', 'bottom'); - } - else { - self.__options.side.push('right', 'left'); - } - } - - // misc - // disable the arrow in IE6 unless the arrow option was explicitly set to true - if ( $.tooltipster._env.IE === 6 - && self.__options.arrow !== true - ) { - self.__options.arrow = false; - } - }, - - /** - * This method must compute and set the positioning properties of the - * tooltip (left, top, width, height, etc.). It must also make sure the - * tooltip is eventually appended to its parent (since the element may be - * detached from the DOM at the moment the method is called). - * - * We'll evaluate positioning scenarios to find which side can contain the - * tooltip in the best way. We'll consider things relatively to the window - * (unless the user asks not to), then to the document (if need be, or if the - * user explicitly requires the tests to run on the document). For each - * scenario, measures are taken, allowing us to know how well the tooltip - * is going to fit. After that, a sorting function will let us know what - * the best scenario is (we also allow the user to choose his favorite - * scenario by using an event). - * - * @param {object} helper An object that contains variables that plugin - * creators may find useful (see below) - * @param {object} helper.geo An object with many layout properties - * about objects of interest (window, document, origin). This should help - * plugin users compute the optimal position of the tooltip - * @private - */ - __reposition: function(event, helper) { - - var self = this, - finalResult, - // to know where to put the tooltip, we need to know on which point - // of the x or y axis we should center it. That coordinate is the target - targets = self.__targetFind(helper), - testResults = []; - - // make sure the tooltip is detached while we make tests on a clone - self.__instance._$tooltip.detach(); - - // we could actually provide the original element to the Ruler and - // not a clone, but it just feels right to keep it out of the - // machinery. - var $clone = self.__instance._$tooltip.clone(), - // start position tests session - ruler = $.tooltipster._getRuler($clone), - satisfied = false, - animation = self.__instance.option('animation'); - - // an animation class could contain properties that distort the size - if (animation) { - $clone.removeClass('tooltipster-'+ animation); - } - - // start evaluating scenarios - $.each(['window', 'document'], function(i, container) { - - var takeTest = null; - - // let the user decide to keep on testing or not - self.__instance._trigger({ - container: container, - helper: helper, - satisfied: satisfied, - takeTest: function(bool) { - takeTest = bool; - }, - results: testResults, - type: 'positionTest' - }); - - if ( takeTest == true - || ( takeTest != false - && satisfied == false - // skip the window scenarios if asked. If they are reintegrated by - // the callback of the positionTest event, they will have to be - // excluded using the callback of positionTested - && (container != 'window' || self.__options.viewportAware) - ) - ) { - - // for each allowed side - for (var i=0; i < self.__options.side.length; i++) { - - var distance = { - horizontal: 0, - vertical: 0 - }, - side = self.__options.side[i]; - - if (side == 'top' || side == 'bottom') { - distance.vertical = self.__options.distance[side]; - } - else { - distance.horizontal = self.__options.distance[side]; - } - - // this may have an effect on the size of the tooltip if there are css - // rules for the arrow or something else - self.__sideChange($clone, side); - - $.each(['natural', 'constrained'], function(i, mode) { - - takeTest = null; - - // emit an event on the instance - self.__instance._trigger({ - container: container, - event: event, - helper: helper, - mode: mode, - results: testResults, - satisfied: satisfied, - side: side, - takeTest: function(bool) { - takeTest = bool; - }, - type: 'positionTest' - }); - - if ( takeTest == true - || ( takeTest != false - && satisfied == false - ) - ) { - - var testResult = { - container: container, - // we let the distance as an object here, it can make things a little easier - // during the user's calculations at positionTest/positionTested - distance: distance, - // whether the tooltip can fit in the size of the viewport (does not mean - // that we'll be able to make it initially entirely visible, see 'whole') - fits: null, - mode: mode, - outerSize: null, - side: side, - size: null, - target: targets[side], - // check if the origin has enough surface on screen for the tooltip to - // aim at it without overflowing the viewport (this is due to the thickness - // of the arrow represented by the minIntersection length). - // If not, the tooltip will have to be partly or entirely off screen in - // order to stay docked to the origin. This value will stay null when the - // container is the document, as it is not relevant - whole: null - }; - - // get the size of the tooltip with or without size constraints - var rulerConfigured = (mode == 'natural') ? - ruler.free() : - ruler.constrain( - helper.geo.available[container][side].width - distance.horizontal, - helper.geo.available[container][side].height - distance.vertical - ), - rulerResults = rulerConfigured.measure(); - - testResult.size = rulerResults.size; - testResult.outerSize = { - height: rulerResults.size.height + distance.vertical, - width: rulerResults.size.width + distance.horizontal - }; - - if (mode == 'natural') { - - if( helper.geo.available[container][side].width >= testResult.outerSize.width - && helper.geo.available[container][side].height >= testResult.outerSize.height - ) { - testResult.fits = true; - } - else { - testResult.fits = false; - } - } - else { - testResult.fits = rulerResults.fits; - } - - if (container == 'window') { - - if (!testResult.fits) { - testResult.whole = false; - } - else { - if (side == 'top' || side == 'bottom') { - - testResult.whole = ( - helper.geo.origin.windowOffset.right >= self.__options.minIntersection - && helper.geo.window.size.width - helper.geo.origin.windowOffset.left >= self.__options.minIntersection - ); - } - else { - testResult.whole = ( - helper.geo.origin.windowOffset.bottom >= self.__options.minIntersection - && helper.geo.window.size.height - helper.geo.origin.windowOffset.top >= self.__options.minIntersection - ); - } - } - } - - testResults.push(testResult); - - // we don't need to compute more positions if we have one fully on screen - if (testResult.whole) { - satisfied = true; - } - else { - // don't run the constrained test unless the natural width was greater - // than the available width, otherwise it's pointless as we know it - // wouldn't fit either - if ( testResult.mode == 'natural' - && ( testResult.fits - || testResult.size.width <= helper.geo.available[container][side].width - ) - ) { - return false; - } - } - } - }); - } - } - }); - - // the user may eliminate the unwanted scenarios from testResults, but he's - // not supposed to alter them at this point. functionPosition and the - // position event serve that purpose. - self.__instance._trigger({ - edit: function(r) { - testResults = r; - }, - event: event, - helper: helper, - results: testResults, - type: 'positionTested' - }); - - /** - * Sort the scenarios to find the favorite one. - * - * The favorite scenario is when we can fully display the tooltip on screen, - * even if it means that the middle of the tooltip is no longer centered on - * the middle of the origin (when the origin is near the edge of the screen - * or even partly off screen). We want the tooltip on the preferred side, - * even if it means that we have to use a constrained size rather than a - * natural one (as long as it fits). When the origin is off screen at the top - * the tooltip will be positioned at the bottom (if allowed), if the origin - * is off screen on the right, it will be positioned on the left, etc. - * If there are no scenarios where the tooltip can fit on screen, or if the - * user does not want the tooltip to fit on screen (viewportAware == false), - * we fall back to the scenarios relative to the document. - * - * When the tooltip is bigger than the viewport in either dimension, we stop - * looking at the window scenarios and consider the document scenarios only, - * with the same logic to find on which side it would fit best. - * - * If the tooltip cannot fit the document on any side, we force it at the - * bottom, so at least the user can scroll to see it. - */ - testResults.sort(function(a, b) { - - // best if it's whole (the tooltip fits and adapts to the viewport) - if (a.whole && !b.whole) { - return -1; - } - else if (!a.whole && b.whole) { - return 1; - } - else if (a.whole && b.whole) { - - var ai = self.__options.side.indexOf(a.side), - bi = self.__options.side.indexOf(b.side); - - // use the user's sides fallback array - if (ai < bi) { - return -1; - } - else if (ai > bi) { - return 1; - } - else { - // will be used if the user forced the tests to continue - return a.mode == 'natural' ? -1 : 1; - } - } - else { - - // better if it fits - if (a.fits && !b.fits) { - return -1; - } - else if (!a.fits && b.fits) { - return 1; - } - else if (a.fits && b.fits) { - - var ai = self.__options.side.indexOf(a.side), - bi = self.__options.side.indexOf(b.side); - - // use the user's sides fallback array - if (ai < bi) { - return -1; - } - else if (ai > bi) { - return 1; - } - else { - // will be used if the user forced the tests to continue - return a.mode == 'natural' ? -1 : 1; - } - } - else { - - // if everything failed, this will give a preference to the case where - // the tooltip overflows the document at the bottom - if ( a.container == 'document' - && a.side == 'bottom' - && a.mode == 'natural' - ) { - return -1; - } - else { - return 1; - } - } - } - }); - - finalResult = testResults[0]; - - - // now let's find the coordinates of the tooltip relatively to the window - finalResult.coord = {}; - - switch (finalResult.side) { - - case 'left': - case 'right': - finalResult.coord.top = Math.floor(finalResult.target - finalResult.size.height / 2); - break; - - case 'bottom': - case 'top': - finalResult.coord.left = Math.floor(finalResult.target - finalResult.size.width / 2); - break; - } - - switch (finalResult.side) { - - case 'left': - finalResult.coord.left = helper.geo.origin.windowOffset.left - finalResult.outerSize.width; - break; - - case 'right': - finalResult.coord.left = helper.geo.origin.windowOffset.right + finalResult.distance.horizontal; - break; - - case 'top': - finalResult.coord.top = helper.geo.origin.windowOffset.top - finalResult.outerSize.height; - break; - - case 'bottom': - finalResult.coord.top = helper.geo.origin.windowOffset.bottom + finalResult.distance.vertical; - break; - } - - // if the tooltip can potentially be contained within the viewport dimensions - // and that we are asked to make it fit on screen - if (finalResult.container == 'window') { - - // if the tooltip overflows the viewport, we'll move it accordingly (then it will - // not be centered on the middle of the origin anymore). We only move horizontally - // for top and bottom tooltips and vice versa. - if (finalResult.side == 'top' || finalResult.side == 'bottom') { - - // if there is an overflow on the left - if (finalResult.coord.left < 0) { - - // prevent the overflow unless the origin itself gets off screen (minus the - // margin needed to keep the arrow pointing at the target) - if (helper.geo.origin.windowOffset.right - this.__options.minIntersection >= 0) { - finalResult.coord.left = 0; - } - else { - finalResult.coord.left = helper.geo.origin.windowOffset.right - this.__options.minIntersection - 1; - } - } - // or an overflow on the right - else if (finalResult.coord.left > helper.geo.window.size.width - finalResult.size.width) { - - if (helper.geo.origin.windowOffset.left + this.__options.minIntersection <= helper.geo.window.size.width) { - finalResult.coord.left = helper.geo.window.size.width - finalResult.size.width; - } - else { - finalResult.coord.left = helper.geo.origin.windowOffset.left + this.__options.minIntersection + 1 - finalResult.size.width; - } - } - } - else { - - // overflow at the top - if (finalResult.coord.top < 0) { - - if (helper.geo.origin.windowOffset.bottom - this.__options.minIntersection >= 0) { - finalResult.coord.top = 0; - } - else { - finalResult.coord.top = helper.geo.origin.windowOffset.bottom - this.__options.minIntersection - 1; - } - } - // or at the bottom - else if (finalResult.coord.top > helper.geo.window.size.height - finalResult.size.height) { - - if (helper.geo.origin.windowOffset.top + this.__options.minIntersection <= helper.geo.window.size.height) { - finalResult.coord.top = helper.geo.window.size.height - finalResult.size.height; - } - else { - finalResult.coord.top = helper.geo.origin.windowOffset.top + this.__options.minIntersection + 1 - finalResult.size.height; - } - } - } - } - else { - - // there might be overflow here too but it's easier to handle. If there has - // to be an overflow, we'll make sure it's on the right side of the screen - // (because the browser will extend the document size if there is an overflow - // on the right, but not on the left). The sort function above has already - // made sure that a bottom document overflow is preferred to a top overflow, - // so we don't have to care about it. - - // if there is an overflow on the right - if (finalResult.coord.left > helper.geo.window.size.width - finalResult.size.width) { - - // this may actually create on overflow on the left but we'll fix it in a sec - finalResult.coord.left = helper.geo.window.size.width - finalResult.size.width; - } - - // if there is an overflow on the left - if (finalResult.coord.left < 0) { - - // don't care if it overflows the right after that, we made our best - finalResult.coord.left = 0; - } - } - - - // submit the positioning proposal to the user function which may choose to change - // the side, size and/or the coordinates - - // first, set the rules that corresponds to the proposed side: it may change - // the size of the tooltip, and the custom functionPosition may want to detect the - // size of something before making a decision. So let's make things easier for the - // implementor - self.__sideChange($clone, finalResult.side); - - // add some variables to the helper - helper.tooltipClone = $clone[0]; - helper.tooltipParent = self.__instance.option('parent').parent[0]; - // move informative values to the helper - helper.mode = finalResult.mode; - helper.whole = finalResult.whole; - // add some variables to the helper for the functionPosition callback (these - // will also be added to the event fired by self.__instance._trigger but that's - // ok, we're just being consistent) - helper.origin = self.__instance._$origin[0]; - helper.tooltip = self.__instance._$tooltip[0]; - - // leave only the actionable values in there for functionPosition - delete finalResult.container; - delete finalResult.fits; - delete finalResult.mode; - delete finalResult.outerSize; - delete finalResult.whole; - - // keep only the distance on the relevant side, for clarity - finalResult.distance = finalResult.distance.horizontal || finalResult.distance.vertical; - - // beginners may not be comfortable with the concept of editing the object - // passed by reference, so we provide an edit function and pass a clone - var finalResultClone = $.extend(true, {}, finalResult); - - // emit an event on the instance - self.__instance._trigger({ - edit: function(result) { - finalResult = result; - }, - event: event, - helper: helper, - position: finalResultClone, - type: 'position' - }); - - if (self.__options.functionPosition) { - - var result = self.__options.functionPosition.call(self, self.__instance, helper, finalResultClone); - - if (result) finalResult = result; - } - - // end the positioning tests session (the user might have had a - // use for it during the position event, now it's over) - ruler.destroy(); - - // compute the position of the target relatively to the tooltip root - // element so we can place the arrow and make the needed adjustments - var arrowCoord, - maxVal; - - if (finalResult.side == 'top' || finalResult.side == 'bottom') { - - arrowCoord = { - prop: 'left', - val: finalResult.target - finalResult.coord.left - }; - maxVal = finalResult.size.width - this.__options.minIntersection; - } - else { - - arrowCoord = { - prop: 'top', - val: finalResult.target - finalResult.coord.top - }; - maxVal = finalResult.size.height - this.__options.minIntersection; - } - - // cannot lie beyond the boundaries of the tooltip, minus the - // arrow margin - if (arrowCoord.val < this.__options.minIntersection) { - arrowCoord.val = this.__options.minIntersection; - } - else if (arrowCoord.val > maxVal) { - arrowCoord.val = maxVal; - } - - var originParentOffset; - - // let's convert the window-relative coordinates into coordinates relative to the - // future positioned parent that the tooltip will be appended to - if (helper.geo.origin.fixedLineage) { - - // same as windowOffset when the position is fixed - originParentOffset = helper.geo.origin.windowOffset; - } - else { - - // this assumes that the parent of the tooltip is located at - // (0, 0) in the document, typically like when the parent is - // <body>. - // If we ever allow other types of parent, .tooltipster-ruler - // will have to be appended to the parent to inherit css style - // values that affect the display of the text and such. - originParentOffset = { - left: helper.geo.origin.windowOffset.left + helper.geo.window.scroll.left, - top: helper.geo.origin.windowOffset.top + helper.geo.window.scroll.top - }; - } - - finalResult.coord = { - left: originParentOffset.left + (finalResult.coord.left - helper.geo.origin.windowOffset.left), - top: originParentOffset.top + (finalResult.coord.top - helper.geo.origin.windowOffset.top) - }; - - // set position values on the original tooltip element - - self.__sideChange(self.__instance._$tooltip, finalResult.side); - - if (helper.geo.origin.fixedLineage) { - self.__instance._$tooltip - .css('position', 'fixed'); - } - else { - // CSS default - self.__instance._$tooltip - .css('position', ''); - } - - self.__instance._$tooltip - .css({ - left: finalResult.coord.left, - top: finalResult.coord.top, - // we need to set a size even if the tooltip is in its natural size - // because when the tooltip is positioned beyond the width of the body - // (which is by default the width of the window; it will happen when - // you scroll the window horizontally to get to the origin), its text - // content will otherwise break lines at each word to keep up with the - // body overflow strategy. - height: finalResult.size.height, - width: finalResult.size.width - }) - .find('.tooltipster-arrow') - .css({ - 'left': '', - 'top': '' - }) - .css(arrowCoord.prop, arrowCoord.val); - - // append the tooltip HTML element to its parent - self.__instance._$tooltip.appendTo(self.__instance.option('parent')); - - self.__instance._trigger({ - type: 'repositioned', - event: event, - position: finalResult - }); - }, - - /** - * Make whatever modifications are needed when the side is changed. This has - * been made an independant method for easy inheritance in custom plugins based - * on this default plugin. - * - * @param {object} $obj - * @param {string} side - * @private - */ - __sideChange: function($obj, side) { - - $obj - .removeClass('tooltipster-bottom') - .removeClass('tooltipster-left') - .removeClass('tooltipster-right') - .removeClass('tooltipster-top') - .addClass('tooltipster-'+ side); - }, - - /** - * Returns the target that the tooltip should aim at for a given side. - * The calculated value is a distance from the edge of the window - * (left edge for top/bottom sides, top edge for left/right side). The - * tooltip will be centered on that position and the arrow will be - * positioned there (as much as possible). - * - * @param {object} helper - * @return {integer} - * @private - */ - __targetFind: function(helper) { - - var target = {}, - rects = this.__instance._$origin[0].getClientRects(); - - // these lines fix a Chrome bug (issue #491) - if (rects.length > 1) { - var opacity = this.__instance._$origin.css('opacity'); - if(opacity == 1) { - this.__instance._$origin.css('opacity', 0.99); - rects = this.__instance._$origin[0].getClientRects(); - this.__instance._$origin.css('opacity', 1); - } - } - - // by default, the target will be the middle of the origin - if (rects.length < 2) { - - target.top = Math.floor(helper.geo.origin.windowOffset.left + (helper.geo.origin.size.width / 2)); - target.bottom = target.top; - - target.left = Math.floor(helper.geo.origin.windowOffset.top + (helper.geo.origin.size.height / 2)); - target.right = target.left; - } - // if multiple client rects exist, the element may be text split - // up into multiple lines and the middle of the origin may not be - // best option anymore. We need to choose the best target client rect - else { - - // top: the first - var targetRect = rects[0]; - target.top = Math.floor(targetRect.left + (targetRect.right - targetRect.left) / 2); - - // right: the middle line, rounded down in case there is an even - // number of lines (looks more centered => check out the - // demo with 4 split lines) - if (rects.length > 2) { - targetRect = rects[Math.ceil(rects.length / 2) - 1]; - } - else { - targetRect = rects[0]; - } - target.right = Math.floor(targetRect.top + (targetRect.bottom - targetRect.top) / 2); - - // bottom: the last - targetRect = rects[rects.length - 1]; - target.bottom = Math.floor(targetRect.left + (targetRect.right - targetRect.left) / 2); - - // left: the middle line, rounded up - if (rects.length > 2) { - targetRect = rects[Math.ceil((rects.length + 1) / 2) - 1]; - } - else { - targetRect = rects[rects.length - 1]; - } - - target.left = Math.floor(targetRect.top + (targetRect.bottom - targetRect.top) / 2); - } - - return target; - } - } -}); - -/* a build task will add "return $;" here */ -return $; - -})); diff --git a/assets/admin/js/tooltipster/tooltipster.bundle.min.js b/assets/admin/js/tooltipster/tooltipster.bundle.min.js deleted file mode 100644 index e614c7a..0000000 --- a/assets/admin/js/tooltipster/tooltipster.bundle.min.js +++ /dev/null @@ -1 +0,0 @@ -(t=>{"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)})(function(y){function t(){this.__$emitterPrivate=y({}),this.__$emitterPublic=y({}),this.__instancesLatestArr=[],this.__plugins={},this._env=b}var a={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},n="undefined"!=typeof window?window:null,b={hasTouchCapability:!(!n||!("ontouchstart"in n||n.DocumentTouch&&n.document instanceof n.DocumentTouch||n.navigator.maxTouchPoints)),hasTransitions:(()=>{if(n){var t=(n.document.body||n.document.documentElement).style,i="transition",o=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof t[i])return!0;i=i.charAt(0).toUpperCase()+i.substr(1);for(var e=0;e<o.length;e++)if("string"==typeof t[o[e]+i])return!0}return!1})(),IE:!1,semVer:"4.2.8",window:n};function i(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function s(o,e){var n=!0;return y.each(o,function(t,i){if(void 0===e[t]||o[t]!==e[t])return n=!1}),n}function l(t){var i=t.attr("id"),i=i?b.window.document.getElementById(i):null;return i?i===t[0]:y.contains(b.window.document.body,t[0])}t.prototype={__bridge:function(t,o,e){var i,n;return o[e]||((i=function(){}).prototype=t,(n=new i).__init&&n.__init(o),y.each(t,function(t,i){0!=t.indexOf("__")&&(o[t]?a.debug&&console.log("The "+t+" method of the "+e+" plugin conflicts with another plugin or native methods"):(o[t]=function(){return n[t].apply(n,Array.prototype.slice.apply(arguments))},o[t].bridged=n))}),o[e]=n),this},__setWindow:function(t){return b.window=t,this},_getRuler:function(t){return new i(t)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(t){var o,e,i=this;if("string"==typeof t)return e=null,0<(o=t).indexOf(".")?e=i.__plugins[o]:y.each(i.__plugins,function(t,i){if(i.name.substring(i.name.length-o.length-1)=="."+o)return e=i,!1}),e;if(t.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return(i.__plugins[t.name]=t).core&&i.__bridge(t.core,i,t.name),this},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},instances:function(t){var e=[];return y(t||".tooltipstered").each(function(){var o=y(this),t=o.data("tooltipster-ns");t&&y.each(t,function(t,i){e.push(o.data(i))})}),e},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(t){return y((t?t+" ":"")+".tooltipstered").toArray()},setDefaults:function(t){return y.extend(a,t),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},y.tooltipster=new t,y.Tooltipster=function(t,i){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=y({}),this.__$emitterPublic=y({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(t,i)},y.Tooltipster.prototype={__init:function(t,i){var o,e=this;e._$origin=y(t),e.__options=y.extend(!0,{},a,i),e.__optionsFormat(),!b.IE||b.IE>=e.__options.IEmin?(t=null,void 0===e._$origin.data("tooltipster-initialTitle")&&(t=e._$origin.attr("title"),e._$origin.data("tooltipster-initialTitle",t=void 0===t?null:t)),null!==e.__options.content?e.__contentSet(e.__options.content):(o=(i=e._$origin.attr("data-tooltip-content"))?y(document).find(i):o)&&o[0]?e.__contentSet(o.first()):e.__contentSet(t),e._$origin.removeAttr("title").addClass("tooltipstered"),e.__prepareOrigin(),e.__prepareGC(),y.each(e.__options.plugins,function(t,i){e._plug(i)}),b.hasTouchCapability&&y(b.window.document.body).on("touchmove."+e.__namespace+"-triggerOpen",function(t){e._touchRecordEvent(t)}),e._on("created",function(){e.__prepareTooltip()})._on("repositioned",function(t){e.__lastPosition=t.position})):e.__options.disabled=!0},__contentInsert:function(){var t=this,i=t._$tooltip.find(".tooltipster-content"),o=t.__Content;return t._trigger({type:"format",content:t.__Content,format:function(t){o=t}}),"string"!=typeof(o=t.__options.functionFormat?t.__options.functionFormat.call(t,t,{origin:t._$origin[0]},t.__Content):o)||t.__options.contentAsHTML?i.empty().append(o):i.text(o),t},__contentSet:function(t){return t instanceof y&&this.__options.contentCloning&&(t=t.clone(!0)),this.__Content=t,this._trigger({type:"updated",content:t}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var t=this,i=t._$origin,o=t._$origin.is("area"),e=(o&&(e=t._$origin.parent().attr("name"),i=y('img[usemap="#'+e+'"]')),i[0].getBoundingClientRect()),n=y(b.window.document),s=y(b.window),r=i,_={available:{document:null,window:null},document:{size:{height:n.height(),width:n.width()}},window:{scroll:{left:b.window.scrollX||b.window.document.documentElement.scrollLeft,top:b.window.scrollY||b.window.document.documentElement.scrollTop},size:{height:s.height(),width:s.width()}},origin:{fixedLineage:!1,offset:{},size:{height:e.bottom-e.top,width:e.right-e.left},usemapImage:o?i[0]:null,windowOffset:{bottom:e.bottom,left:e.left,right:e.right,top:e.top}}};if(o){var n=t._$origin.attr("shape"),a=t._$origin.attr("coords");if(a&&(a=a.split(","),y.map(a,function(t,i){a[i]=parseInt(t)})),"default"!=n)switch(n){case"circle":var l=a[0],p=a[1],c=a[2],p=p-c,l=l-c;_.origin.size.height=2*c,_.origin.size.width=_.origin.size.height,_.origin.windowOffset.left+=l,_.origin.windowOffset.top+=p;break;case"rect":var c=a[0],l=a[1],p=a[2],h=a[3];_.origin.size.height=h-l,_.origin.size.width=p-c,_.origin.windowOffset.left+=c,_.origin.windowOffset.top+=l;break;case"poly":for(var d=0,u=0,g=0,f=0,m="even",w=0;w<a.length;w++)var v=a[w],m="even"==m?(v<(d=g<v&&(g=v,0===w)?g:d)&&(d=v),"odd"):(v<(u=f<v&&(f=v,1==w)?f:u)&&(u=v),"even");_.origin.size.height=f-u,_.origin.size.width=g-d,_.origin.windowOffset.left+=d,_.origin.windowOffset.top+=u}}for(t._trigger({type:"geometry",edit:function(t){_.origin.size.height=t.height,_.origin.windowOffset.left=t.left,_.origin.windowOffset.top=t.top,_.origin.size.width=t.width},geometry:{height:_.origin.size.height,left:_.origin.windowOffset.left,top:_.origin.windowOffset.top,width:_.origin.size.width}}),_.origin.windowOffset.right=_.origin.windowOffset.left+_.origin.size.width,_.origin.windowOffset.bottom=_.origin.windowOffset.top+_.origin.size.height,_.origin.offset.left=_.origin.windowOffset.left+_.window.scroll.left,_.origin.offset.top=_.origin.windowOffset.top+_.window.scroll.top,_.origin.offset.bottom=_.origin.offset.top+_.origin.size.height,_.origin.offset.right=_.origin.offset.left+_.origin.size.width,_.available.document={bottom:{height:_.document.size.height-_.origin.offset.bottom,width:_.document.size.width},left:{height:_.document.size.height,width:_.origin.offset.left},right:{height:_.document.size.height,width:_.document.size.width-_.origin.offset.right},top:{height:_.origin.offset.top,width:_.document.size.width}},_.available.window={bottom:{height:Math.max(_.window.size.height-Math.max(_.origin.windowOffset.bottom,0),0),width:_.window.size.width},left:{height:_.window.size.height,width:Math.max(_.origin.windowOffset.left,0)},right:{height:_.window.size.height,width:Math.max(_.window.size.width-Math.max(_.origin.windowOffset.right,0),0)},top:{height:Math.max(_.origin.windowOffset.top,0),width:_.window.size.width}};"html"!=r[0].tagName.toLowerCase();){if("fixed"==r.css("position")){_.origin.fixedLineage=!0;break}r=r.parent()}return _},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=y(b.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=y(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var t=this;return t.__options.selfDestruction?t.__garbageCollector=setInterval(function(){var o=(new Date).getTime();t.__touchEvents=y.grep(t.__touchEvents,function(t,i){return 6e4<o-t.time}),l(t._$origin)||t.close(function(){t.destroy()})},2e4):clearInterval(t.__garbageCollector),t},__prepareOrigin:function(){var t,i=this;return i._$origin.off("."+i.__namespace+"-triggerOpen"),b.hasTouchCapability&&i._$origin.on("touchstart."+i.__namespace+"-triggerOpen touchend."+i.__namespace+"-triggerOpen touchcancel."+i.__namespace+"-triggerOpen",function(t){i._touchRecordEvent(t)}),(i.__options.triggerOpen.click||i.__options.triggerOpen.tap&&b.hasTouchCapability)&&(t="",i.__options.triggerOpen.click&&(t+="click."+i.__namespace+"-triggerOpen "),i.__options.triggerOpen.tap&&b.hasTouchCapability&&(t+="touchend."+i.__namespace+"-triggerOpen"),i._$origin.on(t,function(t){i._touchIsMeaningfulEvent(t)&&i._open(t)})),(i.__options.triggerOpen.mouseenter||i.__options.triggerOpen.touchstart&&b.hasTouchCapability)&&(t="",i.__options.triggerOpen.mouseenter&&(t+="mouseenter."+i.__namespace+"-triggerOpen "),i.__options.triggerOpen.touchstart&&b.hasTouchCapability&&(t+="touchstart."+i.__namespace+"-triggerOpen"),i._$origin.on(t,function(t){!i._touchIsTouchEvent(t)&&i._touchIsEmulatedEvent(t)||(i.__pointerIsOverOrigin=!0,i._openShortly(t))})),(i.__options.triggerClose.mouseleave||i.__options.triggerClose.touchleave&&b.hasTouchCapability)&&(t="",i.__options.triggerClose.mouseleave&&(t+="mouseleave."+i.__namespace+"-triggerOpen "),i.__options.triggerClose.touchleave&&b.hasTouchCapability&&(t+="touchend."+i.__namespace+"-triggerOpen touchcancel."+i.__namespace+"-triggerOpen"),i._$origin.on(t,function(t){i._touchIsMeaningfulEvent(t)&&(i.__pointerIsOverOrigin=!1)})),i},__prepareTooltip:function(){var o=this,t=o.__options.interactive?"auto":"";return o._$tooltip.attr("id",o.__namespace).css({"pointer-events":t,zIndex:o.__options.zIndex}),y.each(o.__previousThemes,function(t,i){o._$tooltip.removeClass(i)}),y.each(o.__options.theme,function(t,i){o._$tooltip.addClass(i)}),o.__previousThemes=y.merge([],o.__options.theme),o},__scrollHandler:function(t){var s,r,i,o,e=this;return e.__options.triggerClose.scroll?e._close(t):l(e._$origin)&&l(e._$tooltip)&&(s=null,t.target===b.window.document?e.__Geometry.origin.fixedLineage||e.__options.repositionOnScroll&&e.reposition(t):(s=e.__geometry(),r=!1,"fixed"!=e._$origin.css("position")&&e.__$originParents.each(function(t,i){var o=y(i),e=o.css("overflow-x"),n=o.css("overflow-y");if("visible"!=e||"visible"!=n){i=i.getBoundingClientRect();if("visible"!=e&&(s.origin.windowOffset.left<i.left||s.origin.windowOffset.right>i.right))return!(r=!0);if("visible"!=n&&(s.origin.windowOffset.top<i.top||s.origin.windowOffset.bottom>i.bottom))return!(r=!0)}if("fixed"==o.css("position"))return!1}),r?e._$tooltip.css("visibility","hidden"):(e._$tooltip.css("visibility","visible"),e.__options.repositionOnScroll?e.reposition(t):(i=s.origin.offset.left-e.__Geometry.origin.offset.left,o=s.origin.offset.top-e.__Geometry.origin.offset.top,e._$tooltip.css({left:e.__lastPosition.coord.left+i,top:e.__lastPosition.coord.top+o})))),e._trigger({type:"scroll",event:t,geo:s})),e},__stateSet:function(t){return this.__state=t,this._trigger({type:"state",state:t}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,y.each(this.__timeouts.close,function(t,i){clearTimeout(i)}),this.__timeouts.close=[],this},__trackerStart:function(){var o=this,e=o._$tooltip.find(".tooltipster-content");return o.__options.trackTooltip&&(o.__contentBcr=e[0].getBoundingClientRect()),o.__tracker=setInterval(function(){var t,i;l(o._$origin)&&l(o._$tooltip)?(o.__options.trackOrigin&&(t=!1,s((i=o.__geometry()).origin.size,o.__Geometry.origin.size)&&(o.__Geometry.origin.fixedLineage?s(i.origin.windowOffset,o.__Geometry.origin.windowOffset)&&(t=!0):s(i.origin.offset,o.__Geometry.origin.offset)&&(t=!0)),t||(o.__options.triggerClose.mouseleave?o._close():o.reposition())),!o.__options.trackTooltip||(i=e[0].getBoundingClientRect()).height===o.__contentBcr.height&&i.width===o.__contentBcr.width||(o.reposition(),o.__contentBcr=i)):o._close()},o.__options.trackerInterval),o},_close:function(o,t,i){var e,n=this,s=!0;return n._trigger({type:"close",event:o,stop:function(){s=!1}}),(s||i)&&(t&&n.__callbacks.close.push(t),n.__callbacks.open=[],n.__timeoutsClear(),e=function(){y.each(n.__callbacks.close,function(t,i){i.call(n,n,{event:o,origin:n._$origin[0]})}),n.__callbacks.close=[]},"closed"!=n.__state?(i=!0,t=(new Date).getTime()+n.__options.animationDuration[1],(i="disappearing"==n.__state&&t>n.__closingTime&&0<n.__options.animationDuration[1]?!1:i)&&(n.__closingTime=t,"disappearing"!=n.__state&&n.__stateSet("disappearing"),i=function(){clearInterval(n.__tracker),n._trigger({type:"closing",event:o}),n._$tooltip.off("."+n.__namespace+"-triggerClose").removeClass("tooltipster-dying"),y(b.window).off("."+n.__namespace+"-triggerClose"),n.__$originParents.each(function(t,i){y(i).off("scroll."+n.__namespace+"-triggerClose")}),n.__$originParents=null,y(b.window.document.body).off("."+n.__namespace+"-triggerClose"),n._$origin.off("."+n.__namespace+"-triggerClose"),n._off("dismissable"),n.__stateSet("closed"),n._trigger({type:"after",event:o}),n.__options.functionAfter&&n.__options.functionAfter.call(n,n,{event:o,origin:n._$origin[0]}),e()},b.hasTransitions?(n._$tooltip.css({"-moz-animation-duration":n.__options.animationDuration[1]+"ms","-ms-animation-duration":n.__options.animationDuration[1]+"ms","-o-animation-duration":n.__options.animationDuration[1]+"ms","-webkit-animation-duration":n.__options.animationDuration[1]+"ms","animation-duration":n.__options.animationDuration[1]+"ms","transition-duration":n.__options.animationDuration[1]+"ms"}),n._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),0<n.__options.animationDuration[1]&&n._$tooltip.delay(n.__options.animationDuration[1]),n._$tooltip.queue(i)):n._$tooltip.stop().fadeOut(n.__options.animationDuration[1],i))):e()),n},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(t,i){var o,e,n,s,r,_=this;return _.__destroying||l(_._$origin)&&_.__enabled&&!(o=!0)!==(o="closed"==_.__state&&(_._trigger({type:"before",event:t,stop:function(){o=!1}}),o)&&_.__options.functionBefore?_.__options.functionBefore.call(_,_,{event:t,origin:_._$origin[0]}):o)&&null!==_.__Content&&(i&&_.__callbacks.open.push(i),_.__callbacks.close=[],_.__timeoutsClear(),n=function(){"stable"!=_.__state&&_.__stateSet("stable"),y.each(_.__callbacks.open,function(t,i){i.call(_,_,{origin:_._$origin[0],tooltip:_._$tooltip[0]})}),_.__callbacks.open=[]},"closed"!==_.__state?(e=0,"disappearing"===_.__state?(_.__stateSet("appearing"),b.hasTransitions?(_._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),0<_.__options.animationDuration[0]&&_._$tooltip.delay(_.__options.animationDuration[0]),_._$tooltip.queue(n)):_._$tooltip.stop().fadeIn(n)):"stable"==_.__state&&n()):(_.__stateSet("appearing"),e=_.__options.animationDuration[0],_.__contentInsert(),_.reposition(t,!0),b.hasTransitions?(_._$tooltip.addClass("tooltipster-"+_.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":_.__options.animationDuration[0]+"ms","-ms-animation-duration":_.__options.animationDuration[0]+"ms","-o-animation-duration":_.__options.animationDuration[0]+"ms","-webkit-animation-duration":_.__options.animationDuration[0]+"ms","animation-duration":_.__options.animationDuration[0]+"ms","transition-duration":_.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=_.__state&&(_._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),0<_.__options.animationDuration[0]&&_._$tooltip.delay(_.__options.animationDuration[0]),_._$tooltip.queue(n))},0)):_._$tooltip.css("display","none").fadeIn(_.__options.animationDuration[0],n),_.__trackerStart(),y(b.window).on("resize."+_.__namespace+"-triggerClose",function(t){var i=y(document.activeElement);(i.is("input")||i.is("textarea"))&&y.contains(_._$tooltip[0],i[0])||_.reposition(t)}).on("scroll."+_.__namespace+"-triggerClose",function(t){_.__scrollHandler(t)}),_.__$originParents=_._$origin.parents(),_.__$originParents.each(function(t,i){y(i).on("scroll."+_.__namespace+"-triggerClose",function(t){_.__scrollHandler(t)})}),(_.__options.triggerClose.mouseleave||_.__options.triggerClose.touchleave&&b.hasTouchCapability)&&(_._on("dismissable",function(t){t.dismissable?t.delay?(r=setTimeout(function(){_._close(t.event)},t.delay),_.__timeouts.close.push(r)):_._close(t):clearTimeout(r)}),i=_._$origin,s=t="",r=null,_.__options.interactive&&(i=i.add(_._$tooltip)),_.__options.triggerClose.mouseleave&&(t+="mouseenter."+_.__namespace+"-triggerClose ",s+="mouseleave."+_.__namespace+"-triggerClose "),_.__options.triggerClose.touchleave&&b.hasTouchCapability&&(t+="touchstart."+_.__namespace+"-triggerClose",s+="touchend."+_.__namespace+"-triggerClose touchcancel."+_.__namespace+"-triggerClose"),i.on(s,function(t){var i;!_._touchIsTouchEvent(t)&&_._touchIsEmulatedEvent(t)||(i="mouseleave"==t.type?_.__options.delay:_.__options.delayTouch,_._trigger({delay:i[1],dismissable:!0,event:t,type:"dismissable"}))}).on(t,function(t){!_._touchIsTouchEvent(t)&&_._touchIsEmulatedEvent(t)||_._trigger({dismissable:!1,event:t,type:"dismissable"})})),_.__options.triggerClose.originClick&&_._$origin.on("click."+_.__namespace+"-triggerClose",function(t){_._touchIsTouchEvent(t)||_._touchIsEmulatedEvent(t)||_._close(t)}),(_.__options.triggerClose.click||_.__options.triggerClose.tap&&b.hasTouchCapability)&&setTimeout(function(){var t,i;"closed"!=_.__state&&(t="",i=y(b.window.document.body),_.__options.triggerClose.click&&(t+="click."+_.__namespace+"-triggerClose "),_.__options.triggerClose.tap&&b.hasTouchCapability&&(t+="touchend."+_.__namespace+"-triggerClose"),i.on(t,function(t){_._touchIsMeaningfulEvent(t)&&(_._touchRecordEvent(t),_.__options.interactive&&y.contains(_._$tooltip[0],t.target)||_._close(t))}),_.__options.triggerClose.tap)&&b.hasTouchCapability&&i.on("touchstart."+_.__namespace+"-triggerClose",function(t){_._touchRecordEvent(t)})},0),_._trigger("ready"),_.__options.functionReady&&_.__options.functionReady.call(_,_,{origin:_._$origin[0],tooltip:_._$tooltip[0]})),0<_.__options.timer)&&(r=setTimeout(function(){_._close()},_.__options.timer+e),_.__timeouts.close.push(r)),_},_openShortly:function(t){var i,o=this,e=!0;return"stable"==o.__state||"appearing"==o.__state||o.__timeouts.open||(o._trigger({type:"start",event:t,stop:function(){e=!1}}),e&&((i=0==t.type.indexOf("touch")?o.__options.delayTouch:o.__options.delay)[0]?o.__timeouts.open=setTimeout(function(){o.__timeouts.open=null,o.__pointerIsOverOrigin&&o._touchIsMeaningfulEvent(t)?(o._trigger("startend"),o._open(t)):o._trigger("startcancel")},i[0]):(o._trigger("startend"),o._open(t)))),o},_optionsExtract:function(t,i){var e=this,o=y.extend(!0,{},i),n=e.__options[t];return n||(n={},y.each(i,function(t,i){var o=e.__options[t];void 0!==o&&(n[t]=o)})),y.each(o,function(t,i){void 0!==n[t]&&("object"!=typeof i||i instanceof Array||null==i||"object"!=typeof n[t]||n[t]instanceof Array||null==n[t]?o[t]=n[t]:y.extend(o[t],n[t]))}),o},_plug:function(t){var i=y.tooltipster._plugin(t);if(i)return i.instance&&y.tooltipster.__bridge(i.instance,this,i.name),this;throw new Error('The "'+t+'" plugin is not defined')},_touchIsEmulatedEvent:function(t){for(var i=!1,o=(new Date).getTime(),e=this.__touchEvents.length-1;0<=e;e--){var n=this.__touchEvents[e];if(!(o-n.time<500))break;n.target===t.target&&(i=!0)}return i},_touchIsMeaningfulEvent:function(t){return this._touchIsTouchEvent(t)&&!this._touchSwiped(t.target)||!this._touchIsTouchEvent(t)&&!this._touchIsEmulatedEvent(t)},_touchIsTouchEvent:function(t){return 0==t.type.indexOf("touch")},_touchRecordEvent:function(t){return this._touchIsTouchEvent(t)&&(t.time=(new Date).getTime(),this.__touchEvents.push(t)),this},_touchSwiped:function(t){for(var i=!1,o=this.__touchEvents.length-1;0<=o;o--){var e=this.__touchEvents[o];if("touchmove"==e.type){i=!0;break}if("touchstart"==e.type&&t===e.target)break}return i},_trigger:function(){var t=Array.prototype.slice.apply(arguments);return"string"==typeof t[0]&&(t[0]={type:t[0]}),t[0].instance=this,t[0].origin=this._$origin?this._$origin[0]:null,t[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,t),y.tooltipster._trigger.apply(y.tooltipster,t),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,t),this},_unplug:function(o){var t,e=this;return e[o]&&((t=y.tooltipster._plugin(o)).instance&&y.each(t.instance,function(t,i){e[t]&&e[t].bridged===e[o]&&delete e[t]}),e[o].__destroy&&e[o].__destroy(),delete e[o]),e},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var i,o=this;return void 0===t?o.__Content:(o.__destroyed?o.__destroyError():(o.__contentSet(t),null!==o.__Content?"closed"!==o.__state&&(o.__contentInsert(),o.reposition(),o.__options.updateAnimation)&&(b.hasTransitions?(i=o.__options.updateAnimation,o._$tooltip.addClass("tooltipster-update-"+i),setTimeout(function(){"closed"!=o.__state&&o._$tooltip.removeClass("tooltipster-update-"+i)},1e3)):o._$tooltip.fadeTo(200,.5,function(){"closed"!=o.__state&&o._$tooltip.fadeTo(200,1)})):o._close()),o)},destroy:function(){var t,i,o=this;return o.__destroyed?o.__destroyError():("closed"!=o.__state?o.option("animationDuration",0)._close(null,null,!0):o.__timeoutsClear(),o._trigger("destroy"),o.__destroyed=!0,o._$origin.removeData(o.__namespace).off("."+o.__namespace+"-triggerOpen"),y(b.window.document.body).off("."+o.__namespace+"-triggerOpen"),(t=o._$origin.data("tooltipster-ns"))&&(1===t.length?(i=null,"previous"==o.__options.restoration?i=o._$origin.data("tooltipster-initialTitle"):"current"==o.__options.restoration&&(i="string"==typeof o.__Content?o.__Content:y("<div></div>").append(o.__Content).html()),i&&o._$origin.attr("title",i),o._$origin.removeClass("tooltipstered"),o._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")):(t=y.grep(t,function(t,i){return t!==o.__namespace}),o._$origin.data("tooltipster-ns",t))),o._trigger("destroyed"),o._off(),o.off(),o.__Content=null,o.__$emitterPrivate=null,o.__$emitterPublic=null,o.__options.parent=null,o._$origin=null,o._$tooltip=null,y.tooltipster.__instancesLatestArr=y.grep(y.tooltipster.__instancesLatestArr,function(t,i){return o!==t}),clearInterval(o.__garbageCollector)),o},disable:function(){return this.__destroyed?this.__destroyError():(this._close(),this.__enabled=!1),this},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(t,i){return void 0===i?this.__options[t]:(this.__destroyed?this.__destroyError():(this.__options[t]=i,this.__optionsFormat(),0<=y.inArray(t,["trigger","triggerClose","triggerOpen"])&&this.__prepareOrigin(),"selfDestruction"===t&&this.__prepareGC()),this)},reposition:function(t,i){var o=this;return o.__destroyed?o.__destroyError():"closed"!=o.__state&&l(o._$origin)&&(i||l(o._$tooltip))&&(i||o._$tooltip.detach(),o.__Geometry=o.__geometry(),o._trigger({type:"reposition",event:t,helper:{geo:o.__Geometry}})),o},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},y.fn.tooltipster=function(){var o,n,t,i,e,s,r=Array.prototype.slice.apply(arguments),_="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";return 0===this.length?this:"string"==typeof r[0]?(o="#*$~&",this.each(function(){var t=y(this).data("tooltipster-ns"),t=t?y(this).data(t[0]):null;if(!t)throw new Error("You called Tooltipster's \""+r[0]+'" method on an uninitialized element');if("function"!=typeof t[r[0]])throw new Error('Unknown method "'+r[0]+'"');1<this.length&&"content"==r[0]&&(r[1]instanceof y||"object"==typeof r[1]&&null!=r[1]&&r[1].tagName)&&!t.__options.contentCloning&&t.__options.debug&&console.log(_);var i=t[r[0]](r[1],r[2]);if(i!==t||"instance"===r[0])return o=i,!1}),"#*$~&"!==o?o:this):(y.tooltipster.__instancesLatestArr=[],t=r[0]&&void 0!==r[0].multiple,n=t&&r[0].multiple||!t&&a.multiple,t=(t=r[0]&&void 0!==r[0].content)&&r[0].content||!t&&a.content,i=(i=r[0]&&void 0!==r[0].contentCloning)&&r[0].contentCloning||!i&&a.contentCloning,e=r[0]&&void 0!==r[0].debug,s=e&&r[0].debug||!e&&a.debug,1<this.length&&(t instanceof y||"object"==typeof t&&null!=t&&t.tagName)&&!i&&s&&console.log(_),this.each(function(){var t=!1,i=y(this),o=i.data("tooltipster-ns"),e=null;!o||n?t=!0:s&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)),t&&(e=new y.Tooltipster(this,r[0]),(o=o||[]).push(e.__namespace),i.data("tooltipster-ns",o),i.data(e.__namespace,e),e.__options.functionInit&&e.__options.functionInit.call(e,e,{origin:this}),e._trigger("init")),y.tooltipster.__instancesLatestArr.push(e)}),this)},i.prototype={__init:function(t){this.__$tooltip=t,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=y('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(b.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,i){return this.constraints={width:t,height:i},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t,i,o,e=this.__$tooltip[0].getBoundingClientRect(),n={size:{height:e.height||e.bottom-e.top,width:e.width||e.right-e.left}};return this.constraints&&(t=this.__$tooltip.find(".tooltipster-content"),o=this.__$tooltip.outerHeight(),i=t[0].getBoundingClientRect(),o={height:o<=this.constraints.height,width:e.width<=this.constraints.width&&i.width>=t[0].scrollWidth-1},n.fits=o.height&&o.width),b.IE&&b.IE<=11&&n.size.width!==b.window.document.documentElement.clientWidth&&(n.size.width=Math.ceil(n.size.width)+1),n}};var o=navigator.userAgent.toLowerCase();-1!=o.indexOf("msie")?b.IE=parseInt(o.split("msie")[1]):-1!==o.toLowerCase().indexOf("trident")&&-1!==o.indexOf(" rv:11")?b.IE=11:-1!=o.toLowerCase().indexOf("edge/")&&(b.IE=parseInt(o.toLowerCase().split("edge/")[1]));var e="tooltipster.sideTip";return y.tooltipster._plugin({name:e,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var i=this;i.__instance=t,i.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),i.__previousState="closed",i.__options,i.__optionsFormat(),i.__instance._on("state."+i.__namespace,function(t){"closed"==t.state?i.__close():"appearing"==t.state&&"closed"==i.__previousState&&i.__create(),i.__previousState=t.state}),i.__instance._on("options."+i.__namespace,function(){i.__optionsFormat()}),i.__instance._on("reposition."+i.__namespace,function(t){i.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof y&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var t=y('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||t.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&t.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&t.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=t,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var t=this;t.__options=t.__instance._optionsExtract(e,t.__defaults()),t.__options.position&&(t.__options.side=t.__options.position),"object"!=typeof t.__options.distance&&(t.__options.distance=[t.__options.distance]),t.__options.distance.length<4&&(void 0===t.__options.distance[1]&&(t.__options.distance[1]=t.__options.distance[0]),void 0===t.__options.distance[2]&&(t.__options.distance[2]=t.__options.distance[0]),void 0===t.__options.distance[3])&&(t.__options.distance[3]=t.__options.distance[1]),t.__options.distance={top:t.__options.distance[0],right:t.__options.distance[1],bottom:t.__options.distance[2],left:t.__options.distance[3]},"string"==typeof t.__options.side&&(t.__options.side=[t.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[t.__options.side]],"left"==t.__options.side[0]||"right"==t.__options.side[0]?t.__options.side.push("top","bottom"):t.__options.side.push("right","left")),6===y.tooltipster._env.IE&&!0!==t.__options.arrow&&(t.__options.arrow=!1)},__reposition:function(a,l){var i,p=this,c=p.__targetFind(l),h=[],o=(p.__instance._$tooltip.detach(),p.__instance._$tooltip.clone()),d=y.tooltipster._getRuler(o),u=!1,t=p.__instance.option("animation");switch(t&&o.removeClass("tooltipster-"+t),y.each(["window","document"],function(t,n){var s=null;if(p.__instance._trigger({container:n,helper:l,satisfied:u,takeTest:function(t){s=t},results:h,type:"positionTest"}),1==s||0!=s&&0==u&&("window"!=n||p.__options.viewportAware))for(t=0;t<p.__options.side.length;t++){var r={horizontal:0,vertical:0},_=p.__options.side[t];"top"==_||"bottom"==_?r.vertical=p.__options.distance[_]:r.horizontal=p.__options.distance[_],p.__sideChange(o,_),y.each(["natural","constrained"],function(t,i){if(s=null,p.__instance._trigger({container:n,event:a,helper:l,mode:i,results:h,satisfied:u,side:_,takeTest:function(t){s=t},type:"positionTest"}),1==s||0!=s&&0==u){var o={container:n,distance:r,fits:null,mode:i,outerSize:null,side:_,size:null,target:c[_],whole:null},e=("natural"==i?d.free():d.constrain(l.geo.available[n][_].width-r.horizontal,l.geo.available[n][_].height-r.vertical)).measure();if(o.size=e.size,o.outerSize={height:e.size.height+r.vertical,width:e.size.width+r.horizontal},"natural"==i?l.geo.available[n][_].width>=o.outerSize.width&&l.geo.available[n][_].height>=o.outerSize.height?o.fits=!0:o.fits=!1:o.fits=e.fits,"window"==n&&(o.whole=!!o.fits&&("top"==_||"bottom"==_?l.geo.origin.windowOffset.right>=p.__options.minIntersection&&l.geo.window.size.width-l.geo.origin.windowOffset.left>=p.__options.minIntersection:l.geo.origin.windowOffset.bottom>=p.__options.minIntersection&&l.geo.window.size.height-l.geo.origin.windowOffset.top>=p.__options.minIntersection)),h.push(o),o.whole)u=!0;else if("natural"==o.mode&&(o.fits||o.size.width<=l.geo.available[n][_].width))return!1}})}}),p.__instance._trigger({edit:function(t){h=t},event:a,helper:l,results:h,type:"positionTested"}),h.sort(function(t,i){var o,e;return t.whole&&!i.whole?-1:!t.whole&&i.whole?1:t.whole&&i.whole?(o=p.__options.side.indexOf(t.side))<(e=p.__options.side.indexOf(i.side))||!(e<o)&&"natural"==t.mode?-1:1:t.fits&&!i.fits?-1:!t.fits&&i.fits?1:t.fits&&i.fits?(o=p.__options.side.indexOf(t.side))<(e=p.__options.side.indexOf(i.side))||!(e<o)&&"natural"==t.mode?-1:1:"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1}),(i=h[0]).coord={},i.side){case"left":case"right":i.coord.top=Math.floor(i.target-i.size.height/2);break;case"bottom":case"top":i.coord.left=Math.floor(i.target-i.size.width/2)}switch(i.side){case"left":i.coord.left=l.geo.origin.windowOffset.left-i.outerSize.width;break;case"right":i.coord.left=l.geo.origin.windowOffset.right+i.distance.horizontal;break;case"top":i.coord.top=l.geo.origin.windowOffset.top-i.outerSize.height;break;case"bottom":i.coord.top=l.geo.origin.windowOffset.bottom+i.distance.vertical}"window"==i.container?"top"==i.side||"bottom"==i.side?i.coord.left<0?0<=l.geo.origin.windowOffset.right-this.__options.minIntersection?i.coord.left=0:i.coord.left=l.geo.origin.windowOffset.right-this.__options.minIntersection-1:i.coord.left>l.geo.window.size.width-i.size.width&&(l.geo.origin.windowOffset.left+this.__options.minIntersection<=l.geo.window.size.width?i.coord.left=l.geo.window.size.width-i.size.width:i.coord.left=l.geo.origin.windowOffset.left+this.__options.minIntersection+1-i.size.width):i.coord.top<0?0<=l.geo.origin.windowOffset.bottom-this.__options.minIntersection?i.coord.top=0:i.coord.top=l.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:i.coord.top>l.geo.window.size.height-i.size.height&&(l.geo.origin.windowOffset.top+this.__options.minIntersection<=l.geo.window.size.height?i.coord.top=l.geo.window.size.height-i.size.height:i.coord.top=l.geo.origin.windowOffset.top+this.__options.minIntersection+1-i.size.height):(i.coord.left>l.geo.window.size.width-i.size.width&&(i.coord.left=l.geo.window.size.width-i.size.width),i.coord.left<0&&(i.coord.left=0)),p.__sideChange(o,i.side),l.tooltipClone=o[0],l.tooltipParent=p.__instance.option("parent").parent[0],l.mode=i.mode,l.whole=i.whole,l.origin=p.__instance._$origin[0],l.tooltip=p.__instance._$tooltip[0],delete i.container,delete i.fits,delete i.mode,delete i.outerSize,delete i.whole,i.distance=i.distance.horizontal||i.distance.vertical;var e,t=y.extend(!0,{},i);p.__instance._trigger({edit:function(t){i=t},event:a,helper:l,position:t,type:"position"}),p.__options.functionPosition&&(t=p.__options.functionPosition.call(p,p.__instance,l,t))&&(i=t),d.destroy(),t="top"==i.side||"bottom"==i.side?(e={prop:"left",val:i.target-i.coord.left},i.size.width-this.__options.minIntersection):(e={prop:"top",val:i.target-i.coord.top},i.size.height-this.__options.minIntersection),e.val<this.__options.minIntersection?e.val=this.__options.minIntersection:e.val>t&&(e.val=t),t=l.geo.origin.fixedLineage?l.geo.origin.windowOffset:{left:l.geo.origin.windowOffset.left+l.geo.window.scroll.left,top:l.geo.origin.windowOffset.top+l.geo.window.scroll.top},i.coord={left:t.left+(i.coord.left-l.geo.origin.windowOffset.left),top:t.top+(i.coord.top-l.geo.origin.windowOffset.top)},p.__sideChange(p.__instance._$tooltip,i.side),l.geo.origin.fixedLineage?p.__instance._$tooltip.css("position","fixed"):p.__instance._$tooltip.css("position",""),p.__instance._$tooltip.css({left:i.coord.left,top:i.coord.top,height:i.size.height,width:i.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(e.prop,e.val),p.__instance._$tooltip.appendTo(p.__instance.option("parent")),p.__instance._trigger({type:"repositioned",event:a,position:i})},__sideChange:function(t,i){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+i)},__targetFind:function(t){var i={},o=this.__instance._$origin[0].getClientRects();return 1<o.length&&1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),o=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1)),o.length<2?(i.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),i.bottom=i.top,i.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),i.right=i.left):(t=o[0],i.top=Math.floor(t.left+(t.right-t.left)/2),t=2<o.length?o[Math.ceil(o.length/2)-1]:o[0],i.right=Math.floor(t.top+(t.bottom-t.top)/2),t=o[o.length-1],i.bottom=Math.floor(t.left+(t.right-t.left)/2),t=2<o.length?o[Math.ceil((o.length+1)/2)-1]:o[o.length-1],i.left=Math.floor(t.top+(t.bottom-t.top)/2)),i}}}),y}); \ No newline at end of file diff --git a/assets/vendor/floating-ui/LICENSE b/assets/vendor/floating-ui/LICENSE new file mode 100644 index 0000000..5665118 --- /dev/null +++ b/assets/vendor/floating-ui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Floating UI contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/assets/vendor/floating-ui/README.md b/assets/vendor/floating-ui/README.md new file mode 100644 index 0000000..ccac121 --- /dev/null +++ b/assets/vendor/floating-ui/README.md @@ -0,0 +1,16 @@ +# Floating UI (vendored) + +- Version: 1.8.0 (`@floating-ui/core` and `@floating-ui/dom`) +- Source: https://github.com/floating-ui/floating-ui +- Upstream files (copied verbatim): + - `@floating-ui/core/dist/floating-ui.core.umd.min.js` + - `@floating-ui/dom/dist/floating-ui.dom.umd.min.js` +- License: MIT (see `LICENSE`) +- Usage: UMD globals `window.FloatingUICore` / `window.FloatingUIDOM`. The DOM + build depends on core, so core must load first. Cooked's tooltip logic lives + in `assets/admin/js/cooked-functions.js`: add `data-tooltip="..."` (and + optionally `data-positions="top,bottom"`) to any element. + +Do not edit the `*.umd.min.js` files directly. To update, copy both new UMD builds +from upstream (keep core and dom on matching versions) and bump the version in +`includes/class.cooked-admin-enqueues.php` (`cooked-floating-ui-*` handles). diff --git a/assets/vendor/floating-ui/floating-ui.core.umd.min.js b/assets/vendor/floating-ui/floating-ui.core.umd.min.js new file mode 100644 index 0000000..a0e61d8 --- /dev/null +++ b/assets/vendor/floating-ui/floating-ui.core.umd.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUICore={})}(this,(function(t){"use strict";const e=["top","right","bottom","left"],n=["start","end"],i=e.reduce(((t,e)=>t.concat(e,e+"-"+n[0],e+"-"+n[1])),[]),r=Math.min,o=Math.max,l={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,e,n){return o(t,r(e,n))}function s(t,e){return"function"==typeof t?t(e):t}function f(t){return t.split("-")[0]}function c(t){return t.split("-")[1]}function u(t){return"x"===t?"y":"x"}function m(t){return"y"===t?"height":"width"}function d(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function g(t){return u(d(t))}function p(t,e,n){void 0===n&&(n=!1);const i=c(t),r=g(t),o=m(r);let l="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=A(l)),[l,A(l)]}function h(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const y=["left","right"],w=["right","left"],x=["top","bottom"],v=["bottom","top"];function b(t,e,n,i){const r=c(t);let o=function(t,e,n){switch(t){case"top":case"bottom":return n?e?w:y:e?y:w;case"left":case"right":return e?x:v;default:return[]}}(f(t),"start"===n,i);return r&&(o=o.map((t=>t+"-"+r)),e&&(o=o.concat(o.map(h)))),o}function A(t){const e=f(t);return l[e]+t.slice(e.length)}function R(t){return"number"!=typeof t?function(t){var e,n,i,r;return{top:null!=(e=t.top)?e:0,right:null!=(n=t.right)?n:0,bottom:null!=(i=t.bottom)?i:0,left:null!=(r=t.left)?r:0}}(t):{top:t,right:t,bottom:t,left:t}}function O(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function P(t,e,n){let{reference:i,floating:r}=t;const o=d(e),l=g(e),a=m(l),s=f(e),u="y"===o,p=i.x+i.width/2-r.width/2,h=i.y+i.height/2-r.height/2,y=i[a]/2-r[a]/2;let w;switch(s){case"top":w={x:p,y:i.y-r.height};break;case"bottom":w={x:p,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:h};break;case"left":w={x:i.x-r.width,y:h};break;default:w={x:i.x,y:i.y}}const x=c(e);return x&&(w[l]+=y*("end"===x?1:-1)*(n&&u?-1:1)),w}async function T(t,e){var n;void 0===e&&(e={});const{x:i,y:r,platform:o,rects:l,elements:a,strategy:f}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:d=!1,padding:g=0}=s(e,t),p=R(g),h=a[d?"floating"===m?"reference":"floating":m],y=O(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(h)))||n?h:h.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:f})),w="floating"===m?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),v=await(null==o.isElement?void 0:o.isElement(x))&&await(null==o.getScale?void 0:o.getScale(x))||{x:1,y:1},b=O(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:f}):w);return{top:(y.top-b.top+p.top)/v.y,bottom:(b.bottom-y.bottom+p.bottom)/v.y,left:(y.left-b.left+p.left)/v.x,right:(b.right-y.right+p.right)/v.x}}function D(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function E(t){return e.some((e=>t[e]>=0))}function L(t){const e=r(...t.map((t=>t.left))),n=r(...t.map((t=>t.top)));return{x:e,y:n,width:o(...t.map((t=>t.right)))-e,height:o(...t.map((t=>t.bottom)))-n}}const k=new Set(["left","top"]);t.arrow=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:l,platform:f,elements:u,middlewareData:d}=e,{element:p,padding:h=0}=s(t,e)||{};if(null==p)return{};const y=R(h),w={x:n,y:i},x=g(o),v=m(x),b=await f.getDimensions(p),A="y"===x,O=A?"top":"left",P=A?"bottom":"right",T=A?"clientHeight":"clientWidth",D=l.reference[v]+l.reference[x]-w[x]-l.floating[v],E=w[x]-l.reference[x],L=await(null==f.getOffsetParent?void 0:f.getOffsetParent(p));let k=L?L[T]:0;k&&await(null==f.isElement?void 0:f.isElement(L))||(k=u.floating[T]||l.floating[v]);const C=D/2-E/2,H=k/2-b[v]/2-1,S=r(y[O],H),B=r(y[P],H),F=k-b[v]-B,j=k/2-b[v]/2+C,z=a(S,j,F),M=!d.arrow&&null!=c(o)&&j!==z&&l.reference[v]/2-(j<S?S:B)-b[v]/2<0,V=M?j<S?j-S:j-F:0;return{[x]:w[x]+V,data:{[x]:z,centerOffset:j-z-V,...M&&{alignmentOffset:V}},reset:M}}}),t.autoPlacement=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,o;const{rects:l,middlewareData:a,placement:u,platform:m,elements:d}=e,{crossAxis:g=!1,alignment:y,allowedPlacements:w=i,autoAlignment:x=!0,...v}=s(t,e),b=void 0!==y||w===i?function(t,e,n){return(t?[...n.filter((e=>c(e)===t)),...n.filter((e=>c(e)!==t))]:n.filter((t=>f(t)===t))).filter((n=>!t||c(n)===t||!!e&&h(n)!==n))}(y||null,x,w):w,A=(null==(n=a.autoPlacement)?void 0:n.index)||0,R=b[A];if(null==R)return{};if(u!==R)return{reset:{placement:b[0]}};const O=await m.detectOverflow(e,v),P=p(R,l,await(null==m.isRTL?void 0:m.isRTL(d.floating))),T=[O[f(R)],O[P[0]],O[P[1]]],D=[...(null==(r=a.autoPlacement)?void 0:r.overflows)||[],{placement:R,overflows:T}],E=b[A+1];if(E)return{data:{index:A+1,overflows:D},reset:{placement:E}};const L=D.map((t=>{const e=c(t.placement);return[t.placement,e&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),k=(null==(o=L.filter((t=>t[2].slice(0,c(t[0])?2:3).every((t=>t<=0))))[0])?void 0:o[0])||L[0][0];return k!==u?{data:{index:A+1,overflows:D},reset:{placement:k}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:T},s=await(null==l.isRTL?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:u}=P(f,i,s),m=i,d=0;const g={};for(let n=0;n<o.length;n++){const p=o[n];if(!p)continue;const{name:h,fn:y}=p,{x:w,y:x,data:v,reset:b}=await y({x:c,y:u,initialPlacement:i,placement:m,strategy:r,middlewareData:g,rects:f,platform:a,elements:{reference:t,floating:e}});c=null!=w?w:c,u=null!=x?x:u,g[h]={...g[h],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(m=b.placement),b.rects&&(f=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):b.rects),({x:c,y:u}=P(f,m,s))),n=-1)}return{x:c,y:u,placement:m,strategy:r,middlewareData:g}},t.detectOverflow=T,t.flip=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:o,rects:l,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...R}=s(t,e);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const O=f(r),P=d(a),T=f(a)===a,D=await(null==c.isRTL?void 0:c.isRTL(u.floating)),E=y||(T||!v?[A(a)]:function(t){const e=A(t);return[h(t),e,h(e)]}(a)),L="none"!==x;!y&&L&&E.push(...b(a,v,x,D));const k=[a,...E],C=await c.detectOverflow(e,R),H=[];let S=(null==(i=o.flip)?void 0:i.overflows)||[];if(m&&H.push(C[O]),g){const t=p(r,l,D);H.push(C[t[0]],C[t[1]])}if(S=[...S,{placement:r,overflows:H}],!H.every((t=>t<=0))){var B,F;const t=((null==(B=o.flip)?void 0:B.index)||0)+1,e=k[t];if(e){if(!("alignment"===g&&P!==d(e))||S.every((t=>d(t.placement)!==P||t.overflows[0]>0)))return{data:{index:t,overflows:S},reset:{placement:e}}}let n=null==(F=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:F.placement;if(!n)switch(w){case"bestFit":{var j;const t=null==(j=S.filter((t=>{if(L){const e=d(t.placement);return e===P||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:j[0];t&&(n=t);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:r="referenceHidden",...o}=s(t,e);switch(r){case"referenceHidden":{const t=D(await i.detectOverflow(e,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:E(t)}}}case"escaped":{const t=D(await i.detectOverflow(e,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:E(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:l,platform:a,strategy:c}=e,{padding:u=2,x:m,y:g}=s(t,e),p=Array.from(await(null==a.getClientRects?void 0:a.getClientRects(i.reference))||[]);if(!p.length)return{};const h=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let i=null;for(let t=0;t<e.length;t++){const r=e[t];!i||r.y-i.y>i.height/2?n.push([r]):n[n.length-1].push(r),i=r}return n.map((t=>O(L(t))))}(p),y=O(L(p)),w=R(u);const x=await a.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&(h[0].left>h[1].right||h[1].left>h[0].right)&&null!=m&&null!=g)return h.find((t=>m>t.left-w.left&&m<t.right+w.right&&g>t.top-w.top&&g<t.bottom+w.bottom))||y;if(h.length>=2){if("y"===d(n)){const t=h[0],e=h[h.length-1],i="top"===f(n),r=t.top,o=e.bottom,l=i?t.left:e.left;return O({x:l,y:r,width:(i?t.right:e.right)-l,height:o-r})}const t="left"===f(n),e=o(...h.map((t=>t.right))),i=r(...h.map((t=>t.left))),l=h.filter((n=>t?n.left===i:n.right===e)),a=l[0].top,s=l[l.length-1].bottom;return O({x:i,y:a,width:e-i,height:s-a})}return y}},floating:i.floating,strategy:c});return l.reference.x!==x.reference.x||l.reference.y!==x.reference.y||l.reference.width!==x.reference.width||l.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){var n,i;const{x:r,y:o,placement:l,rects:a,middlewareData:c}=e,{offset:m=0,mainAxis:g=!0,crossAxis:p=!0}=s(t,e),h={x:r,y:o},y=d(l),w=u(y);let x=h[w],v=h[y];const b=s(m,e),A="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:null!=(n=b.mainAxis)?n:0,crossAxis:null!=(i=b.crossAxis)?i:0};if(g){const t="y"===w?"height":"width",e=a.reference[w]-a.floating[t]+A.mainAxis,n=a.reference[w]+a.reference[t]-A.mainAxis;x<e?x=e:x>n&&(x=n)}if(p){var R,O;const t="y"===w?"width":"height",e=k.has(f(l)),n=a.reference[y]-a.floating[t]+(e&&(null==(R=c.offset)?void 0:R[y])||0)+(e?0:A.crossAxis),i=a.reference[y]+a.reference[t]+(e?0:(null==(O=c.offset)?void 0:O[y])||0)-(e?A.crossAxis:0);v<n?v=n:v>i&&(v=i)}return{[w]:x,[y]:v}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:o,placement:l,middlewareData:a}=e,u=await async function(t,e){const{placement:n,platform:i,elements:r}=t,o=await(null==i.isRTL?void 0:i.isRTL(r.floating)),l=f(n),a=c(n),u="y"===d(n),m=k.has(l)?-1:1,g=o&&u?-1:1,p=s(e,t);let{mainAxis:h,crossAxis:y,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&"number"==typeof w&&(y="end"===a?-1*w:w),u?{x:y*g,y:h*m}:{x:h*m,y:y*g}}(e,t);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:r+u.x,y:o+u.y,data:{...u,placement:l}}}}},t.rectToClientRect=O,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:o}=e,{mainAxis:l=!0,crossAxis:f=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=s(t,e),g={x:n,y:i},p=await o.detectOverflow(e,m),h=d(r),y=u(h);let w=g[y],x=g[h];const v=(t,e)=>a(e+p["y"===t?"top":"left"],e,e-p["y"===t?"bottom":"right"]);l&&(w=v(y,w)),f&&(x=v(h,x));const b=c.fn({...e,[y]:w,[h]:x});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[y]:l,[h]:f}}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:l,elements:a}=e,{apply:u=()=>{},...m}=s(t,e),g=await l.detectOverflow(e,m),p=f(n),h=c(n),y="y"===d(n),{width:w,height:x}=i.floating;let v,b;"top"===p||"bottom"===p?(v=p,b=h===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(b=p,v="end"===h?"top":"bottom");const A=x-g.top-g.bottom,R=w-g.left-g.right,O=r(x-g[v],A),P=r(w-g[b],R),T=e.middlewareData.shift,D=!T;let E=O,L=P;null!=T&&T.enabled.x&&(L=R),null!=T&&T.enabled.y&&(E=A),D&&!h&&(y?L=w-2*o(g.left,g.right):E=x-2*o(g.top,g.bottom)),await u({...e,availableWidth:L,availableHeight:E});const k=await l.getDimensions(a.floating);return w!==k.width||x!==k.height?{reset:{rects:!0}}:{}}}}})); diff --git a/assets/vendor/floating-ui/floating-ui.dom.umd.min.js b/assets/vendor/floating-ui/floating-ui.dom.umd.min.js new file mode 100644 index 0000000..cd3dea3 --- /dev/null +++ b/assets/vendor/floating-ui/floating-ui.dom.umd.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,l=t=>({x:t,y:t});function c(){return"undefined"!=typeof window}function s(t){return a(t)?(t.nodeName||"").toLowerCase():"#document"}function f(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function u(t){var e;return null==(e=(a(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function a(t){return!!c()&&(t instanceof Node||t instanceof f(t).Node)}function d(t){return!!c()&&(t instanceof Element||t instanceof f(t).Element)}function h(t){return!!c()&&(t instanceof HTMLElement||t instanceof f(t).HTMLElement)}function p(t){return!(!c()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof f(t).ShadowRoot)}function g(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function m(t){return/^(table|td|th)$/.test(s(t))}function y(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const w=/transform|translate|scale|rotate|perspective|filter/,v=/paint|layout|strict|content/,x=t=>!!t&&"none"!==t;let b;function L(t){const e=d(t)?C(t):t;return x(e.transform)||x(e.translate)||x(e.scale)||x(e.rotate)||x(e.perspective)||!R()&&(x(e.backdropFilter)||x(e.filter))||w.test(e.willChange||"")||v.test(e.contain||"")}function R(){return null==b&&(b="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function T(t){return/^(html|body|#document)$/.test(s(t))}function C(t){return f(t).getComputedStyle(t)}function S(t){return d(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function E(t){if("html"===s(t))return t;const e=t.assignedSlot||t.parentNode||p(t)&&t.host||u(t);return p(e)?e.host:e}function F(t){const e=E(t);return T(e)?(t.ownerDocument||t).body:h(e)&&g(e)?e:F(e)}function O(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=F(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=f(i);if(r){const t=D(l);return e.concat(l,l.visualViewport||[],g(i)?i:[],t&&n?O(t):[])}return e.concat(i,O(i,[],n))}function D(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function W(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=h(t),l=r?t.offsetWidth:n,c=r?t.offsetHeight:o,s=i(n)!==l||i(o)!==c;return s&&(n=l,o=c),{width:n,height:o,$:s}}function M(t){return d(t)?t:t.contextElement}function z(t){const e=M(t);if(!h(e))return l(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:c}=W(e);let s=(c?i(n.width):n.width)/o,f=(c?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const H=l(0);function P(t){const e=f(t);return R()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:H}function V(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),c=M(t);let s=l(1);n&&(i?d(i)&&(s=z(i)):s=z(t));const u=function(t,e,n){return void 0===e&&(e=!1),!!n&&e&&n===f(t)}(c,o,i)?P(c):l(0);let a=(r.left+u.x)/s.x,h=(r.top+u.y)/s.y,p=r.width/s.x,g=r.height/s.y;if(c&&i){const t=f(c),e=d(i)?f(i):i;let n=t,o=D(n);for(;o&&e!==n;){const t=z(o),e=o.getBoundingClientRect(),i=C(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,l=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;a*=t.x,h*=t.y,p*=t.x,g*=t.y,a+=r,h+=l,n=f(o),o=D(n)}}return e.rectToClientRect({width:p,height:g,x:a,y:h})}function A(t,e){const n=S(t).scrollLeft;return e?e.left+n:V(u(t)).left+n}function B(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-A(t,n),y:n.top+e.scrollTop}}function N(t,n,i){let r;if("viewport"===n||"layoutViewport"===n)r=function(t,e,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,i=f(t),r=u(t),l=i.visualViewport;let c=r.clientWidth,s=r.clientHeight,a=0,d=0;if(l){const t=!R()||"fixed"===e;o?t||(a=-l.offsetLeft,d=-l.offsetTop):(c=l.width,s=l.height,t&&(a=l.offsetLeft,d=l.offsetTop))}if(A(r)<=0){const t=r.ownerDocument,e=t.body,n=getComputedStyle(e),o="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-e.clientWidth-o),l="stable both-edges"===getComputedStyle(r).scrollbarGutter?i/2:i;l<=25&&(c-=l)}return{width:c,height:s,x:a,y:d}}(t,i,n);else if("document"===n)r=function(t){const e=S(t),n=t.ownerDocument.body,i=o(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=o(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-e.scrollLeft+A(t);const c=-e.scrollTop;return"rtl"===C(n).direction&&(l+=o(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:l,y:c}}(u(t));else if(d(n))r=function(t,e){const n=V(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=z(t);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const e=P(t);r={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return e.rectToClientRect(r)}function I(t,e,n){const o=h(e),i=u(e),r="fixed"===n,c=V(t,!0,r,e);let f={scrollLeft:0,scrollTop:0};const a=l(0);if((o||!r)&&(("body"!==s(e)||g(i))&&(f=S(e)),o)){const t=V(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}!o&&i&&(a.x=A(i));const d=!i||o||r?l(0):B(i,f);return{x:c.left+f.scrollLeft-a.x-d.x,y:c.top+f.scrollTop-a.y-d.y,width:c.width,height:c.height}}function $(t){return"static"===C(t).position}function k(t,e){if(!h(t)||"fixed"===C(t).position)return null;if(e)return e(t);let n=t.offsetParent;return u(t)===n&&(n=n.ownerDocument.body),n}function q(t,e){const n=f(t);if(y(t))return n;if(!h(t)){let e=E(t);for(;e&&!T(e);){if(d(e)&&!$(e))return e;e=E(e)}return n}let o=k(t,e);for(;o&&m(o)&&$(o);)o=k(o,e);return o&&T(o)&&$(o)&&!L(o)?n:o||function(t){let e=E(t);for(;h(e)&&!T(e);){if(L(e))return e;if(y(e))return null;e=E(e)}return null}(t)||n}const U={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,c=u(o),f=!!e&&y(e.floating);if(o===c||f&&r)return n;let a={scrollLeft:0,scrollTop:0},d=l(1);const p=l(0),m=h(o);if((m||!r)&&(("body"!==s(o)||g(c))&&(a=S(o)),m)){const t=V(o);d=z(o),p.x=t.x+o.clientLeft,p.y=t.y+o.clientTop}const w=!c||m||r?l(0):B(c,a);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+p.x+w.x,y:n.y*d.y-a.scrollTop*d.y+p.y+w.y}},getDocumentElement:u,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:l}=t;const c=[..."clippingAncestors"===i?y(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=O(t,[],!1).filter((t=>d(t)&&"body"!==s(t))),i=null;const r="fixed"===C(t).position;let l=r?E(t):t;for(;d(l)&&!T(l);){const t=C(l),e=L(l),n=i?i.position:r?"fixed":"";e||"fixed"!==n&&("absolute"!==n||"static"!==t.position)?i=t:o=o.filter((t=>t!==l)),l=E(l)}return e.set(t,o),o}(e,this._c):[].concat(i),r],f=N(e,c[0],l);let u=f.top,a=f.right,h=f.bottom,p=f.left;for(let t=1;t<c.length;t++){const i=N(e,c[t],l);u=o(i.top,u),a=n(i.right,a),h=n(i.bottom,h),p=o(i.left,p)}return{width:a-p,height:h-u,x:p,y:u}},getOffsetParent:q,getElementRects:async function(t){const e=this.getOffsetParent||q,n=this.getDimensions,o=await n(t.floating);return{reference:I(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return t.getClientRects?Array.from(t.getClientRects()):[]},getDimensions:function(t){const{width:e,height:n}=W(t);return{width:e,height:n}},getScale:z,isElement:d,isRTL:function(t){return"rtl"===C(t).direction}};function j(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const X=e.detectOverflow,Y=e.offset,_=e.autoPlacement,G=e.shift,J=e.flip,K=e.size,Q=e.hide,Z=e.arrow,tt=e.inline,et=e.limitShift;t.arrow=Z,t.autoPlacement=_,t.autoUpdate=function(t,e,i,l){void 0===l&&(l={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:h=!1}=l,p=M(t),g=c||s?[...p?O(p):[],...e?O(e):[]]:[];g.forEach((t=>{c&&t.addEventListener("scroll",i),s&&t.addEventListener("resize",i)}));const m=p&&d?function(t,e,i){let l,c=null;const s=u(t);function a(){var t;clearTimeout(l),null==(t=c)||t.disconnect(),c=null}function d(i,f){void 0===i&&(i=!1),void 0===f&&(f=1),a();const u=t.getBoundingClientRect(),{left:h,top:p,width:g,height:m}=u;if(i||e(),!g||!m)return;const y={rootMargin:-r(p)+"px "+-r(s.clientWidth-(h+g))+"px "+-r(s.clientHeight-(p+m))+"px "+-r(h)+"px",threshold:o(0,n(1,f))||1};let w=!0;function v(e){const n=e[0].intersectionRatio;if(!j(u,t.getBoundingClientRect()))return d();if(n!==f){if(!w)return d();n?d(!1,n):l=setTimeout((()=>{d(!1,1e-7)}),1e3)}w=!1}try{c=new IntersectionObserver(v,{...y,root:s.ownerDocument})}catch(t){c=new IntersectionObserver(v,y)}c.observe(t)}const h=f(t),p=()=>d(i);return h.addEventListener("resize",p),d(!0),()=>{h.removeEventListener("resize",p),a()}}(p,i,s):null;let y,w=-1,v=null;a&&(v=new ResizeObserver((t=>{let[n]=t;n&&n.target===p&&v&&e&&(v.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame((()=>{var t;null==(t=v)||t.observe(e)}))),i()})),p&&!h&&v.observe(p),e&&v.observe(e));let x=h?V(t):null;return h&&function e(){const n=V(t);x&&!j(x,n)&&i();x=n,y=requestAnimationFrame(e)}(),i(),()=>{var t;g.forEach((t=>{c&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),null==m||m(),null==(t=v)||t.disconnect(),v=null,h&&cancelAnimationFrame(y)}},t.computePosition=(t,n,o)=>{const i=new Map,r=null!=o?o:{},l={...U,...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:l})},t.detectOverflow=X,t.flip=J,t.getOverflowAncestors=O,t.hide=Q,t.inline=tt,t.limitShift=et,t.offset=Y,t.platform=U,t.shift=G,t.size=K})); diff --git a/gulpfile.js b/gulpfile.js index 2c4fa46..6a7a35e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,13 +19,6 @@ function cssAdmin() { .pipe(dest('assets/admin/css')); } -function cssTooltipster() { - return src(['assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.css']) - .pipe(cleanCSS()) - .pipe(rename({ suffix: '.min' })) - .pipe(dest('assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes')); -} - // JavaScript Task. function js() { return src('assets/js/cooked-functions.js') @@ -41,13 +34,6 @@ function jsFotorama() { .pipe(dest('assets/js/fotorama')); } -function jsTooltipster() { - return src('assets/admin/js/tooltipster/tooltipster.bundle.js') - .pipe(uglify()) - .pipe(rename({ suffix: '.min' })) - .pipe(dest('assets/admin/js/tooltipster')); -} - function jsAdmin() { return src(['assets/admin/js/cooked-functions.js', 'assets/admin/js/cooked-migration.js']) .pipe(uglify()) @@ -59,16 +45,14 @@ function jsAdmin() { function watchFiles() { watch(['assets/css/icons.css', 'assets/css/print-only.css', 'assets/css/print.css', 'assets/css/style.css'], css); watch(['assets/admin/css/essentials.css', 'assets/admin/css/style.css'], cssAdmin); - watch(['assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked.css'], cssTooltipster); watch('assets/js/cooked-functions.js', js); watch('assets/js/fotorama/fotorama.js', jsFotorama); - watch('assets/admin/js/tooltipster/tooltipster.bundle.js', jsTooltipster); watch(['assets/admin/js/cooked-functions.js', 'assets/admin/js/cooked-migration.js'], jsAdmin); } // Task for building for production. -const build = series(css, cssAdmin, cssTooltipster, js, jsFotorama, jsTooltipster, jsAdmin); +const build = series(css, cssAdmin, js, jsFotorama, jsAdmin); exports.build = build; // Export the default Gulp task. -exports.default = series(css, cssAdmin, cssTooltipster, js, jsFotorama, jsTooltipster, jsAdmin, watchFiles); +exports.default = series(css, cssAdmin, js, jsFotorama, jsAdmin, watchFiles); diff --git a/includes/class.cooked-admin-enqueues.php b/includes/class.cooked-admin-enqueues.php index 80d4bae..fa9d337 100644 --- a/includes/class.cooked-admin-enqueues.php +++ b/includes/class.cooked-admin-enqueues.php @@ -188,16 +188,15 @@ public function admin_enqueues( $hook ) { ]; // Cooked Admin Style Assets - wp_register_script( 'cooked-admin-functions', COOKED_URL . 'assets/admin/js/cooked-functions' . $min . '.js', ['jquery'], COOKED_VERSION, true ); + // Tooltips (Floating UI, vendored — see assets/vendor/floating-ui/README.md). + wp_register_script( 'cooked-floating-ui-core', COOKED_URL . 'assets/vendor/floating-ui/floating-ui.core.umd.min.js', [], '1.8.0', true ); + wp_register_script( 'cooked-floating-ui-dom', COOKED_URL . 'assets/vendor/floating-ui/floating-ui.dom.umd.min.js', ['cooked-floating-ui-core'], '1.8.0', true ); + + wp_register_script( 'cooked-admin-functions', COOKED_URL . 'assets/admin/js/cooked-functions' . $min . '.js', ['jquery', 'cooked-floating-ui-dom'], COOKED_VERSION, true ); wp_register_script( 'cooked-migration', COOKED_URL . 'assets/admin/js/cooked-migration' . $min . '.js', ['jquery'], COOKED_VERSION, true ); wp_enqueue_style( 'cooked-admin', COOKED_URL . 'assets/admin/css/style' . $min . '.css', [], COOKED_VERSION ); wp_enqueue_style( 'wp-color-picker' ); - // Tooltipster - wp_enqueue_script('cooked-tooltipster', COOKED_URL . 'assets/admin/js/tooltipster/tooltipster.bundle' . $min . '.js', ['jquery'], COOKED_VERSION, true ); - wp_enqueue_style('cooked-tooltipster-core', COOKED_URL . 'assets/admin/css/tooltipster/tooltipster.bundle.min.css', [], COOKED_VERSION, 'screen' ); - wp_enqueue_style('cooked-tooltipster-theme', COOKED_URL . 'assets/admin/css/tooltipster/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-cooked' . $min . '.css', [], COOKED_VERSION, 'screen' ); - // Cooked Admin Script wp_localize_script('cooked-admin-functions', 'cooked_admin_functions_js_vars', $cooked_js_vars ); wp_localize_script('cooked-migration', 'cooked_migration_js_vars', $cooked_js_vars ); diff --git a/includes/class.cooked-recipe-meta.php b/includes/class.cooked-recipe-meta.php index 89c5163..0686e2e 100644 --- a/includes/class.cooked-recipe-meta.php +++ b/includes/class.cooked-recipe-meta.php @@ -535,7 +535,14 @@ function cooked_render_recipe_fields( $post_id ) { <div class="recipe-setting-block"> <?php if (current_user_can('edit_cooked_default_template')): ?> - <h3 class="cooked-settings-title cooked-bm-30-up"><?php esc_html_e( 'Recipe Template', 'cooked' ); ?><span title="<?php echo esc_attr( '<strong class="cooked-tooltip-heading">' . esc_html__( 'Default Recipe Template','cooked') . '</strong>' . esc_html__( 'Choose from the options below to use this layout as the default for new recipes or for all recipes.', 'cooked') . '<span class="cooked-tooltip-buttons cooked-clearfix"><a href="#" class="cooked-save-default-new button" data-nonce="' . $nonce . '">' . esc_html__( 'Save as Default','cooked' ) . '</a>  <a href="#" class="cooked-save-default-all button-primary" data-nonce="' . $nonce . '" data-bulk-nonce="' . $nonce_bulk . '">' . esc_html__( 'Apply to All','cooked' ) . '</a></span><span id="cooked-template-progress" class="cooked-progress"><span class="cooked-progress-bar"></span></span><span id="cooked-template-progress-text" class="cooked-progress-text">0 / 0</span>' ); ?>" class="button cooked-layout-save-default"><?php esc_html_e( 'Save as Default', 'cooked' ); ?></span><span class="button button-cooked-reset cooked-layout-load-default"><?php esc_html_e( 'Reset', 'cooked' ); ?></span><span class="cooked-tooltip cooked-tooltip-icon" title="<?php echo esc_attr( '<strong class="cooked-tooltip-heading">' . esc_html__( 'Recipe Template','cooked') . '</strong>' . esc_html__( 'Using the built-in recipe shortcodes found on the "Shortcodes" tab, you can create the layout of your recipe below. Use the "Save as Default" button to save your template.','cooked') ); ?>"><i class="cooked-icon cooked-icon-question"></i></span></h3> + <h3 class="cooked-settings-title cooked-bm-30-up"><?php esc_html_e( 'Recipe Template', 'cooked' ); ?><span class="button cooked-layout-save-default" role="button" tabindex="0" aria-expanded="false" aria-controls="cooked-save-default-panel"><?php esc_html_e( 'Save as Default', 'cooked' ); ?></span><span class="button button-cooked-reset cooked-layout-load-default"><?php esc_html_e( 'Reset', 'cooked' ); ?></span><span class="cooked-tooltip cooked-tooltip-icon" data-tooltip="<?php echo esc_attr( '<strong class="cooked-tooltip-heading">' . esc_html__( 'Recipe Template','cooked') . '</strong>' . esc_html__( 'Using the built-in recipe shortcodes found on the "Shortcodes" tab, you can create the layout of your recipe below. Use the "Save as Default" button to save your template.','cooked') ); ?>" data-positions="top"><i class="cooked-icon cooked-icon-question"></i></span></h3> + <div id="cooked-save-default-panel" class="cooked-save-default-panel" hidden> + <strong class="cooked-tooltip-heading"><?php esc_html_e( 'Default Recipe Template','cooked'); ?></strong> + <p><?php esc_html_e( 'Choose from the options below to use this layout as the default for new recipes or for all recipes.', 'cooked'); ?></p> + <span class="cooked-tooltip-buttons cooked-clearfix"><a href="#" class="cooked-save-default-new button" data-nonce="<?php echo esc_attr( $nonce ); ?>"><?php esc_html_e( 'Save as Default','cooked' ); ?></a>  <a href="#" class="cooked-save-default-all button-primary" data-nonce="<?php echo esc_attr( $nonce ); ?>" data-bulk-nonce="<?php echo esc_attr( $nonce_bulk ); ?>"><?php esc_html_e( 'Apply to All','cooked' ); ?></a></span> + <span id="cooked-template-progress" class="cooked-progress"><span class="cooked-progress-bar"></span></span> + <span id="cooked-template-progress-text" class="cooked-progress-text">0 / 0</span> + </div> <?php endif; ?> <div class="recipe-setting-block cooked-bm-30"> @@ -553,7 +560,7 @@ function cooked_render_recipe_fields( $post_id ) { </div> <div class="recipe-setting-block"> - <h3 class="cooked-settings-title"><?php esc_html_e( 'Recipe Excerpt', 'cooked' ); ?><span class="cooked-tooltip cooked-tooltip-icon" title="<?php echo esc_attr( esc_html__( 'The excerpt is used on recipe listing templates, where the full recipe should not be displayed.','cooked') ); ?>"><i class="cooked-icon cooked-icon-question"></i></span></h3> + <h3 class="cooked-settings-title"><?php esc_html_e( 'Recipe Excerpt', 'cooked' ); ?><span class="cooked-tooltip cooked-tooltip-icon" data-tooltip="<?php echo esc_attr( '<strong class="cooked-tooltip-heading">' . esc_html__( 'Recipe Excerpt', 'cooked' ) . '</strong>' . esc_html__( 'The excerpt is used on recipe listing templates, where the full recipe should not be displayed.','cooked') ); ?>" data-positions="top"><i class="cooked-icon cooked-icon-question"></i></span></h3> <p> <?php if ( $wp_editor_roles_allowed ): ?> <?php $recipe_excerpt = isset($recipe_settings['excerpt']) ? wp_unslash(wp_specialchars_decode($recipe_settings['excerpt'])) : ''; ?> @@ -576,7 +583,7 @@ function cooked_render_recipe_fields( $post_id ) { <?php if ( !isset($_cooked_settings['advanced']) || empty($_cooked_settings['advanced']) || !in_array( 'disable_meta_tags', $_cooked_settings['advanced'] ) ): ?> <div class="recipe-setting-block"> - <h3 class="cooked-settings-title"><?php esc_html_e( 'SEO Description', 'cooked' ); ?><span class="cooked-tooltip cooked-tooltip-icon" title="<?php echo esc_attr( esc_html__( 'This description is used for SEO purposes and is optional. By default, Cooked will use the Recipe Excerpt above if available or the Recipe Title if not.','cooked') ); ?>"><i class="cooked-icon cooked-icon-question"></i></span></h3> + <h3 class="cooked-settings-title"><?php esc_html_e( 'SEO Description', 'cooked' ); ?><span class="cooked-tooltip cooked-tooltip-icon" data-tooltip="<?php echo esc_attr( '<strong class="cooked-tooltip-heading">' . esc_html__( 'SEO Description', 'cooked' ) . '</strong>' . esc_html__( 'This description is used for SEO purposes and is optional. By default, Cooked will use the Recipe Excerpt above if available or the Recipe Title if not.','cooked') ); ?>" data-positions="top"><i class="cooked-icon cooked-icon-question"></i></span></h3> <p><textarea name="_recipe_settings[seo_description]"><?php echo isset($recipe_settings['seo_description']) ? esc_textarea( wp_specialchars_decode( $recipe_settings['seo_description'], ENT_QUOTES ) ) : ''; ?></textarea></p> </div> <?php endif; ?> @@ -614,7 +621,7 @@ function cooked_render_recipe_fields( $post_id ) { </div> <div class="recipe-setting-block cooked-bm-30"> - <h3 class="cooked-settings-title"><?php esc_html_e( 'Recipe Notes', 'cooked' ); ?><span class="cooked-tooltip cooked-tooltip-icon" title="<?php echo esc_attr__( 'The notes are displayed in the recipe.','cooked'); ?>"><i class="cooked-icon cooked-icon-question"></i></span></h3> + <h3 class="cooked-settings-title"><?php esc_html_e( 'Recipe Notes', 'cooked' ); ?><span class="cooked-tooltip cooked-tooltip-icon" data-tooltip="<?php echo esc_attr( '<strong class="cooked-tooltip-heading">' . esc_html__( 'Recipe Notes', 'cooked' ) . '</strong>' . esc_html__( 'The notes are displayed in the recipe.','cooked') ); ?>" data-positions="top"><i class="cooked-icon cooked-icon-question"></i></span></h3> <?php if ( $wp_editor_roles_allowed ): ?> <?php $recipe_notes = isset($recipe_settings['notes']) ? wp_unslash(wp_specialchars_decode($recipe_settings['notes'])) : ''; ?> <?php